Skip to content

Commit f17c7c8

Browse files
committed
Added install scripts and Colab notebook for PRPLL.
1 parent 2fc9fe0 commit f17c7c8

File tree

13 files changed

+837
-57
lines changed

13 files changed

+837
-57
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ jobs:
6565
- name: Before script
6666
run: |
6767
sed -i '/^GPU=/,/^fi/ s/^/# /' gpuowl.sh
68-
[[ $CXX == clang* ]] && sed -i 's/-O3 -flto/-O3/' gpuowl.sh
6968
sed -i '/^nohup / s/^/# /' gpuowl.sh
7069
sed -i '/^python3 -OO / s/^/# /' gpuowl.sh
7170
$CXX --version
@@ -81,6 +80,41 @@ jobs:
8180
run: shopt -s globstar; shellcheck -o avoid-nullary-conditions,check-extra-masked-returns,check-set-e-suppressed,deprecate-which,quote-safe-variables,require-double-brackets -s bash **/*.sh
8281
continue-on-error: true
8382

83+
PRPLL:
84+
name: PRPLL
85+
86+
runs-on: ${{ matrix.os }}
87+
strategy:
88+
matrix:
89+
os: [ubuntu-22.04, ubuntu-24.04]
90+
cxx: [g++, clang++]
91+
fail-fast: false
92+
env:
93+
CXX: ${{ matrix.cxx }}
94+
steps:
95+
- uses: actions/checkout@v6
96+
- name: Install
97+
run: |
98+
sudo apt-get update -y
99+
sudo apt-get install -y ocl-icd-opencl-dev pocl-opencl-icd
100+
- name: Before script
101+
run: |
102+
sed -i '/^GPU=/,/^fi/ s/^/# /' prpll.sh
103+
sed -i '/^nohup / s/^/# /' prpll.sh
104+
sed -i '/^python3 -OO / s/^/# /' prpll.sh
105+
$CXX --version
106+
- name: Script
107+
run: bash -e -o pipefail -- prpll.sh ANONYMOUS
108+
- uses: actions/upload-artifact@v4
109+
if: always()
110+
with:
111+
name: ${{ matrix.os }}_${{ matrix.cxx }}_prpll
112+
path: |
113+
prpll/
114+
- name: ShellCheck
115+
run: shopt -s globstar; shellcheck -o avoid-nullary-conditions,check-extra-masked-returns,check-set-e-suppressed,deprecate-which,quote-safe-variables,require-double-brackets -s bash **/*.sh
116+
continue-on-error: true
117+
84118
Mlucas:
85119
name: Mlucas
86120

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,17 @@ This script follows the recommended instructions on the [Mlucas README](https://
3838
wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/mlucas.sh | bash -s -- [PrimeNet User ID] [Computer name] [Type of work] [Idle time to run (mins)]
3939
```
4040

41+
### PRPLL
42+
43+
Downloads, builds, sets up and runs [PRPLL-NTT](https://github.com/gwoltman/gpuowl). PRPLL is the successor of GpuOwl and should be much faster. Downloads, sets up and runs [AutoPrimeNet](https://github.com/tdulcet/AutoPrimeNet) for automated PrimeNet assignments. Supports Nvidia, AMD and Intel GPUs supporting OpenCL. Note that PRPLL uses C++20 and thus requires at least the GNU C++ compiler 8. Run: `g++ --version` to output your version.
44+
45+
```
46+
wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/prpll.sh | bash -s -- [PrimeNet User ID] [Computer name] [Type of work] [Idle time to run (mins)]
47+
```
48+
4149
### GpuOwl
4250

43-
Downloads, builds, sets up and runs the latest version of [GpuOwl](https://github.com/preda/gpuowl) for PRP tests, version 7.2-112 for PRP tests with combined P-1 and the [v6 branch](https://github.com/preda/gpuowl/tree/v6) for LL and standalone P-1 tests. Downloads, sets up and runs [AutoPrimeNet](https://github.com/tdulcet/AutoPrimeNet) for automated PrimeNet assignments. Creates wrapper script to run the correct version of GpuOwl based on the next assignment. Supports Nvidia, AMD and Intel GPUs supporting OpenCL. Note that [GpuOwl uses C++20](https://github.com/preda/gpuowl#build) and thus requires at least the GNU C++ compiler 8. Run: `g++ --version` to output your version.
51+
Downloads, builds, sets up and runs the latest version of [GpuOwl](https://github.com/preda/gpuowl/tree/gpuowl) for PRP tests, version 7.2-112 for PRP tests with combined P-1 and the [v6 branch](https://github.com/preda/gpuowl/tree/v6) for LL and standalone P-1 tests. Downloads, sets up and runs [AutoPrimeNet](https://github.com/tdulcet/AutoPrimeNet) for automated PrimeNet assignments. Creates wrapper script to run the correct version of GpuOwl based on the next assignment. Supports Nvidia, AMD and Intel GPUs supporting OpenCL. Note that [GpuOwl uses C++20](https://github.com/preda/gpuowl/tree/gpuowl#build) and thus requires at least the GNU C++ compiler 8. Run: `g++ --version` to output your version.
4452

4553
```
4654
wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/gpuowl.sh | bash -s -- [PrimeNet User ID] [Computer name] [Type of work] [Idle time to run (mins)]
@@ -66,6 +74,12 @@ wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/m
6674
wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/cudalucas2.sh | bash -s -- <Computer number> [PrimeNet User ID] [Computer name] [Type of work] [Idle time to run]
6775
```
6876

77+
#### PRPLL
78+
79+
```
80+
wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/prpll2.sh | bash -s -- <Computer number> [PrimeNet User ID] [Computer name] [Type of work] [Idle time to run]
81+
```
82+
6983
#### GpuOwl
7084

7185
```

google-colab/Colab CPU MPrime.ipynb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"# @markdown #### 💡 Keep each notebook **open** in the browser to prevent disconnection. 📌 [the tab](https://support.mozilla.org/kb/pinned-tabs-keep-favorite-websites-open) or move them to a dedicated window for easy access.\n",
2525
"# @markdown #### ℹ️ This notebook uses our MPrime [Bash install script](https://github.com/tdulcet/Distributed-Computing-Scripts#organizations).\n",
2626
"# @markdown #### 📜 Please see the [documentation](https://github.com/tdulcet/Distributed-Computing-Scripts/tree/master/google-colab) for more information and to ❤️ support us.\n",
27-
"# @markdown #### 🤷 Optionally, create a GIMPS/PrimeNet account [here](https://www.mersenne.org/update/) and [join](https://www.mersenne.org/jteam/) the “Portland State University” team!\n",
27+
"# @markdown #### 🤷 Optionally, create a [GIMPS/PrimeNet account](https://www.mersenne.org/update/).\n",
2828
"\n",
2929
"prime_ID = 'Default' # @param ['Default'] {allow-input: true}\n",
3030
"computer_name = 'Default' # @param ['Default'] {allow-input: true}\n",
@@ -45,7 +45,7 @@
4545
"# @markdown 12 | 23.84 | 47.68 | 71.52 | 95.36 | 119.2 | 143 | 158.4\n",
4646
"proof_certification_work = True # @param {type:\"boolean\"}\n",
4747
"computer_number = 'Default (1)' # @param ['Default (1)', '2', '3', '4']{allow-input: true}\n",
48-
"local_time = 'Pacific' # @param ['Pacific', 'Mountain', 'Central', 'Eastern', 'Alaska', 'Hawaii']\n",
48+
"local_time = 'UTC' # @param ['UTC', 'Pacific', 'Mountain', 'Central', 'Eastern', 'Alaska', 'Hawaii']\n",
4949
"debug = 'False' # @param ['False', 'CPU (MPrime)']\n",
5050
"\n",
5151
"# @markdown #### 🐛 The *debug* option outputs CPU (Prime95/MPrime) progress and status, then exits.\n",
@@ -129,8 +129,9 @@
129129
"load_drive()\n",
130130
"\n",
131131
"# set local time\n",
132-
"!rm -f /etc/localtime\n",
133-
"!ln -s {'/usr/share/zoneinfo/US/' + local_time} /etc/localtime\n",
132+
"if local_time != 'UTC':\n",
133+
" !rm -f /etc/localtime\n",
134+
" !ln -s {'/usr/share/zoneinfo/US/' + local_time} /etc/localtime\n",
134135
"\n",
135136
"# use/cleanup input from user\n",
136137
"prime_ID = 'psu' if prime_ID.lower() == 'default' else prime_ID\n",

google-colab/Colab GPU CUDALucas.ipynb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"# @markdown #### 💡 Keep each notebook **open** in the browser to prevent disconnection. 📌 [the tab](https://support.mozilla.org/kb/pinned-tabs-keep-favorite-websites-open) or move them to a dedicated window for easy access.\n",
2626
"# @markdown #### ℹ️ This notebook uses both our CUDALucas and MPrime [Bash install scripts](https://github.com/tdulcet/Distributed-Computing-Scripts#organizations) and [AutoPrimeNet](https://github.com/tdulcet/AutoPrimeNet).\n",
2727
"# @markdown #### 📜 Please see the [documentation](https://github.com/tdulcet/Distributed-Computing-Scripts/tree/master/google-colab) for more information and to ❤️ support us.\n",
28-
"# @markdown #### 🤷 Optionally, create a GIMPS/PrimeNet account [here](https://www.mersenne.org/update/) and [join](https://www.mersenne.org/jteam/) the “Portland State University” team!\n",
28+
"# @markdown #### 🤷 Optionally, create a [GIMPS/PrimeNet account](https://www.mersenne.org/update/).\n",
2929
"\n",
3030
"prime_ID = 'Default' # @param ['Default'] {allow-input: true}\n",
3131
"computer_name = 'Default' # @param ['Default'] {allow-input: true}\n",
@@ -48,7 +48,7 @@
4848
"CPU_proof_certification_work = True # @param {type:\"boolean\"}\n",
4949
"computer_number = 'Default (1)' # @param ['Default (1)', '2', '3', '4'] {allow-input: true}\n",
5050
"output_type = 'GPU (CUDALucas)' # @param ['GPU and CPU', 'GPU (CUDALucas)', 'CPU (MPrime)']\n",
51-
"local_time = 'Pacific' # @param ['Pacific', 'Mountain', 'Central', 'Eastern', 'Alaska', 'Hawaii']\n",
51+
"local_time = 'UTC' # @param ['UTC', 'Pacific', 'Mountain', 'Central', 'Eastern', 'Alaska', 'Hawaii']\n",
5252
"debug = 'False' # @param ['False', 'GPU (CUDALucas)', 'CPU (MPrime)']\n",
5353
"\n",
5454
"# @markdown #### 🐛 The *debug* option outputs GPU (CUDALucas) or CPU (Prime95/MPrime) progress and status, then exits.\n",
@@ -75,11 +75,13 @@
7575
"def run():\n",
7676
" '''Run CUDALucas and MPrime.'''\n",
7777
" print('\\nStarting AutoPrimeNet\\n')\n",
78+
" work_file = f'cudalucas/worktodo{computer_number}.txt'\n",
79+
" !rm -f '{work_file + '.lck'}'\n",
7880
" !cd cudalucas; nohup python3 -OO autoprimenet.py -T {GPU_type_of_work} -l '{'local' + computer_number + '.ini'}' >> '{'autoprimenet' + computer_number + '.out'}' &\n",
7981
" !sleep 1\n",
8082
" optimize_gpu()\n",
81-
" while not os.path.exists(f'cudalucas/worktodo{computer_number}.txt'):\n",
82-
" print(f\"Waiting for 'worktodo{computer_number}.txt' access...\")\n",
83+
" while not os.path.exists(work_file):\n",
84+
" print(f'Waiting for {work_file!r} access...')\n",
8385
" !sleep 1\n",
8486
"\n",
8587
" os.chmod('mprime_gpu/mprime', 0o777)\n",
@@ -206,8 +208,9 @@
206208
"load_drive()\n",
207209
"\n",
208210
"# set local time\n",
209-
"!rm -f /etc/localtime\n",
210-
"!ln -s {'/usr/share/zoneinfo/US/' + local_time} /etc/localtime\n",
211+
"if local_time != 'UTC':\n",
212+
" !rm -f /etc/localtime\n",
213+
" !ln -s {'/usr/share/zoneinfo/US/' + local_time} /etc/localtime\n",
211214
"\n",
212215
"# use/cleanup input from user\n",
213216
"prime_ID = 'psu' if prime_ID.lower() == 'default' else prime_ID\n",

google-colab/Colab GPU GpuOwl.ipynb

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
"# @markdown #### 💡 Keep each notebook **open** in the browser to prevent disconnection. 📌 [the tab](https://support.mozilla.org/kb/pinned-tabs-keep-favorite-websites-open) or move them to a dedicated window for easy access.\n",
2626
"# @markdown #### ℹ️ This notebook uses both our GpuOwl and MPrime [Bash install scripts](https://github.com/tdulcet/Distributed-Computing-Scripts#organizations) and [AutoPrimeNet](https://github.com/tdulcet/AutoPrimeNet).\n",
2727
"# @markdown #### 📜 Please see the [documentation](https://github.com/tdulcet/Distributed-Computing-Scripts/tree/master/google-colab) for more information and to ❤️ support us.\n",
28-
"# @markdown #### 🤷 Optionally, create a GIMPS/PrimeNet account [here](https://www.mersenne.org/update/) and [join](https://www.mersenne.org/jteam/) the “Portland State University” team!\n",
28+
"# @markdown #### 🤷 Optionally, create a [GIMPS/PrimeNet account](https://www.mersenne.org/update/).\n",
2929
"\n",
3030
"prime_ID = 'Default' # @param ['Default'] {allow-input: true}\n",
3131
"computer_name = 'Default' # @param ['Default'] {allow-input: true}\n",
32-
"GPU_type_of_work = '150 - First time PRP tests' # @param ['4 - P-1 factoring', '100 - First time LL tests', '101 - Double-check LL tests', '102 - World record LL tests', '104 - 100 million digit LL tests', '150 - First time PRP tests', '151 - Double-check PRP tests', '152 - World record PRP tests', '153 - 100 million digit PRP tests', '154 - First time PRP tests that need P-1 factoring', '155 - Double-check tests using PRP with proof']\n",
32+
"GPU_type_of_work = '150 - First time PRP tests' # @param ['4 - P-1 factoring', '100 - First time LL tests', '101 - Double-check LL tests', '102 - World record LL tests', '104 - 100 million digit LL tests', '106 - Double-check LL tests with zero shift count', '150 - First time PRP tests', '151 - Double-check PRP tests', '152 - World record PRP tests', '153 - 100 million digit PRP tests', '154 - First time PRP tests that need P-1 factoring', '155 - Double-check tests using PRP with proof']\n",
3333
"GPU_prp_proof_power = '5' # @param ['4', '5', '6', '7', '8', '9', '10', '11', '12']\n",
3434
"CPU_type_of_work = '150 - First time PRP tests' # @param ['0 - Whatever makes the most sense', '1 - Trial factoring to low limits', '2 - Trial factoring', '4 - P-1 factoring', '5 - ECM for first factors of Mersenne numbers', '6 - ECM on Fermat numbers', '8 - ECM on Mersenne cofactors', '100 - First time LL tests', '101 - Double-check LL tests', '102 - World record LL tests', '104 - 100 million digit LL tests', '150 - First time PRP tests', '151 - Double-check PRP tests', '152 - World record PRP tests', '153 - 100 million digit PRP tests', '154 - First time PRP tests that need P-1 factoring', '155 - Double-check tests using PRP with proof', '160 - First time PRP on Mersenne cofactors', '161 - Double-check PRP on Mersenne cofactors']\n",
3535
"CPU_prp_proof_power = '5' # @param ['Default', '5', '6', '7', '8', '9', '10', '11', '12']\n",
@@ -54,7 +54,7 @@
5454
"gpuowl_prp = 'Latest' # @param ['Latest', 'v7.2-112', 'v6']\n",
5555
"gpuowl_ll = 'v6' # @param ['v6']\n",
5656
"gpuowl_pm1 = 'v6' # @param ['Latest', 'v6']\n",
57-
"local_time = 'Pacific' # @param ['Pacific', 'Mountain', 'Central', 'Eastern', 'Alaska', 'Hawaii']\n",
57+
"local_time = 'UTC' # @param ['UTC', 'Pacific', 'Mountain', 'Central', 'Eastern', 'Alaska', 'Hawaii']\n",
5858
"debug = 'False' # @param ['False', 'GPU (GpuOwl)', 'CPU (MPrime)']\n",
5959
"\n",
6060
"# @markdown #### 🐛 The *debug* option outputs GPU (GpuOwl) or CPU (Prime95/MPrime) progress and status, then exits.\n",
@@ -71,10 +71,12 @@
7171
" '''Run GpuOwl and MPrime.'''\n",
7272
" print('\\nStarting AutoPrimeNet\\n')\n",
7373
" adir = f'gpuowl/{computer_number}'\n",
74+
" work_file = f'{adir}/worktodo.ini'\n",
75+
" !rm -f '{work_file + '.lck'}'\n",
7476
" !cd '{adir}'; nohup python3 -OO ../autoprimenet.py -T {GPU_type_of_work} >> autoprimenet.out &\n",
7577
" !sleep 1\n",
76-
" while not os.path.exists(f'{adir}/worktodo.ini'):\n",
77-
" print(\"Waiting for 'worktodo.ini' access...\")\n",
78+
" while not os.path.exists(work_file):\n",
79+
" print('Waiting for {work_file!r} access...')\n",
7880
" !sleep 1\n",
7981
"\n",
8082
" os.chmod('mprime_gpu/mprime', 0o777)\n",
@@ -94,14 +96,16 @@
9496
" !cd mprime_gpu; nohup ./mprime -A{computer_number} -d >> '{'cpu' + computer_number + '.out'}' &\n",
9597
" print('\\nStarting GpuOwl\\n')\n",
9698
" !cd '{adir}'; nohup stdbuf -oL ./gpuowl > gpu.out &\n",
97-
" ![[ -e '{adir + '/gpuowl.log'}' ]] && tail '{adir + '/gpuowl.log'}'\n",
99+
" if os.path.exists(f'{adir}/gpuowl.log'):\n",
100+
" !tail '{adir + '/gpuowl.log'}'\n",
98101
" !tail -f '{'mprime_gpu/cpu' + computer_number + '.out'}' '{adir + '/autoprimenet.out'}' '{adir + '/gpu.out'}'\n",
99102
" elif output_type.startswith('GPU'):\n",
100103
" print('\\nStarting MPrime\\n')\n",
101104
" !cd mprime_gpu; nohup ./mprime -A{computer_number} -d >> '{'cpu' + computer_number + '.out'}' &\n",
102105
" print('\\nStarting GpuOwl\\n')\n",
103106
" !cd '{adir}'; nohup stdbuf -oL ./gpuowl > gpu.out &\n",
104-
" ![[ -e '{adir + '/gpuowl.log'}' ]] && tail '{adir + '/gpuowl.log'}'\n",
107+
" if os.path.exists(f'{adir}/gpuowl.log'):\n",
108+
" !tail '{adir + '/gpuowl.log'}'\n",
105109
" !cd '{adir}' && tail -f autoprimenet.out gpu.out\n",
106110
" elif output_type.startswith('CPU'):\n",
107111
" print('\\nStarting GpuOwl\\n')\n",
@@ -157,13 +161,14 @@
157161
"\n",
158162
"def debug_exit():\n",
159163
" '''Output GPU and output of MPrime or GpuOwl output.'''\n",
160-
" if debug.startswith('GPU') and os.path.exists(f'gpuowl/{computer_number}/gpu.out'):\n",
164+
" adir = f'gpuowl/{computer_number}'\n",
165+
" if debug.startswith('GPU') and os.path.exists(f'{adir}/gpu.out'):\n",
161166
" print(f'\\nOutput for computer number {computer_number}:\\n')\n",
162167
" print('\\nAutoPrimeNet output:\\n')\n",
163-
" !tail -n 100 '{'gpuowl/' + computer_number + '/autoprimenet.out'}' # view AutoPrimeNet output\n",
168+
" !tail -n 100 '{adir + '/autoprimenet.out'}' # view AutoPrimeNet output\n",
164169
" print('\\nGPU (GpuOwl) output: ')\n",
165-
" !tail -n 100 '{'gpuowl/' + computer_number + '/gpu.out'}' # view GpuOwl progress\n",
166-
" !cd '{'gpuowl/' + computer_number}' && python3 -OO ../autoprimenet.py -s\n",
170+
" !tail -n 100 '{adir + '/gpu.out'}' # view GpuOwl progress\n",
171+
" !cd '{adir}' && python3 -OO ../autoprimenet.py -s\n",
167172
" print()\n",
168173
" elif debug.startswith('CPU') and os.path.exists(f'mprime_gpu/cpu{computer_number}.out'):\n",
169174
" print('\\nCPU (MPrime) output:\\n')\n",
@@ -213,8 +218,9 @@
213218
"load_drive()\n",
214219
"\n",
215220
"# set local time\n",
216-
"!rm -f /etc/localtime\n",
217-
"!ln -s {'/usr/share/zoneinfo/US/' + local_time} /etc/localtime\n",
221+
"if local_time != 'UTC':\n",
222+
" !rm -f /etc/localtime\n",
223+
" !ln -s {'/usr/share/zoneinfo/US/' + local_time} /etc/localtime\n",
218224
"\n",
219225
"# use/cleanup input from user\n",
220226
"prime_ID = 'psu' if prime_ID.lower() == 'default' else prime_ID\n",

0 commit comments

Comments
 (0)