|
25 | 25 | "# @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", |
26 | 26 | "# @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", |
27 | 27 | "# @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", |
29 | 29 | "\n", |
30 | 30 | "prime_ID = 'Default' # @param ['Default'] {allow-input: true}\n", |
31 | 31 | "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", |
33 | 33 | "GPU_prp_proof_power = '5' # @param ['4', '5', '6', '7', '8', '9', '10', '11', '12']\n", |
34 | 34 | "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", |
35 | 35 | "CPU_prp_proof_power = '5' # @param ['Default', '5', '6', '7', '8', '9', '10', '11', '12']\n", |
|
54 | 54 | "gpuowl_prp = 'Latest' # @param ['Latest', 'v7.2-112', 'v6']\n", |
55 | 55 | "gpuowl_ll = 'v6' # @param ['v6']\n", |
56 | 56 | "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", |
58 | 58 | "debug = 'False' # @param ['False', 'GPU (GpuOwl)', 'CPU (MPrime)']\n", |
59 | 59 | "\n", |
60 | 60 | "# @markdown #### 🐛 The *debug* option outputs GPU (GpuOwl) or CPU (Prime95/MPrime) progress and status, then exits.\n", |
|
94 | 94 | " !cd mprime_gpu; nohup ./mprime -A{computer_number} -d >> '{'cpu' + computer_number + '.out'}' &\n", |
95 | 95 | " print('\\nStarting GpuOwl\\n')\n", |
96 | 96 | " !cd '{adir}'; nohup stdbuf -oL ./gpuowl > gpu.out &\n", |
97 | | - " ![[ -e '{adir + '/gpuowl.log'}' ]] && tail '{adir + '/gpuowl.log'}'\n", |
| 97 | + " if os.path.exists(f'{adir}/gpuowl.log'):\n", |
| 98 | + " !tail '{adir + '/gpuowl.log'}'\n", |
98 | 99 | " !tail -f '{'mprime_gpu/cpu' + computer_number + '.out'}' '{adir + '/autoprimenet.out'}' '{adir + '/gpu.out'}'\n", |
99 | 100 | " elif output_type.startswith('GPU'):\n", |
100 | 101 | " print('\\nStarting MPrime\\n')\n", |
101 | 102 | " !cd mprime_gpu; nohup ./mprime -A{computer_number} -d >> '{'cpu' + computer_number + '.out'}' &\n", |
102 | 103 | " print('\\nStarting GpuOwl\\n')\n", |
103 | 104 | " !cd '{adir}'; nohup stdbuf -oL ./gpuowl > gpu.out &\n", |
104 | | - " ![[ -e '{adir + '/gpuowl.log'}' ]] && tail '{adir + '/gpuowl.log'}'\n", |
| 105 | + " if os.path.exists(f'{adir}/gpuowl.log'):\n", |
| 106 | + " !tail '{adir + '/gpuowl.log'}'\n", |
105 | 107 | " !cd '{adir}' && tail -f autoprimenet.out gpu.out\n", |
106 | 108 | " elif output_type.startswith('CPU'):\n", |
107 | 109 | " print('\\nStarting GpuOwl\\n')\n", |
|
157 | 159 | "\n", |
158 | 160 | "def debug_exit():\n", |
159 | 161 | " '''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", |
| 162 | + " adir = f'gpuowl/{computer_number}'\n", |
| 163 | + " if debug.startswith('GPU') and os.path.exists(f'{adir}/gpu.out'):\n", |
161 | 164 | " print(f'\\nOutput for computer number {computer_number}:\\n')\n", |
162 | 165 | " print('\\nAutoPrimeNet output:\\n')\n", |
163 | | - " !tail -n 100 '{'gpuowl/' + computer_number + '/autoprimenet.out'}' # view AutoPrimeNet output\n", |
| 166 | + " !tail -n 100 '{adir + '/autoprimenet.out'}' # view AutoPrimeNet output\n", |
164 | 167 | " 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", |
| 168 | + " !tail -n 100 '{adir + '/gpu.out'}' # view GpuOwl progress\n", |
| 169 | + " !cd '{adir}' && python3 -OO ../autoprimenet.py -s\n", |
167 | 170 | " print()\n", |
168 | 171 | " elif debug.startswith('CPU') and os.path.exists(f'mprime_gpu/cpu{computer_number}.out'):\n", |
169 | 172 | " print('\\nCPU (MPrime) output:\\n')\n", |
|
213 | 216 | "load_drive()\n", |
214 | 217 | "\n", |
215 | 218 | "# set local time\n", |
216 | | - "!rm -f /etc/localtime\n", |
217 | | - "!ln -s {'/usr/share/zoneinfo/US/' + local_time} /etc/localtime\n", |
| 219 | + "if local_time != 'UTC':\n", |
| 220 | + " !rm -f /etc/localtime\n", |
| 221 | + " !ln -s {'/usr/share/zoneinfo/US/' + local_time} /etc/localtime\n", |
218 | 222 | "\n", |
219 | 223 | "# use/cleanup input from user\n", |
220 | 224 | "prime_ID = 'psu' if prime_ID.lower() == 'default' else prime_ID\n", |
|
0 commit comments