11#! /bin/bash
22
3- # Teal Dulcet
3+ # Copyright © 2020 Teal Dulcet
44# wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/mlucas.sh | bash -s --
55# ./mlucas.sh [PrimeNet User ID] [Computer name] [Type of work] [Idle time to run (mins)]
66# ./mlucas.sh "$USER" "$HOSTNAME" 150 10
@@ -162,7 +162,7 @@ if [[ -d $DIR ]]; then
162162 exit 1
163163 fi
164164else
165- echo -e " \nDownloading Mlucas v21 \n"
165+ echo -e " \nDownloading Mlucas\n"
166166 if command -v git > /dev/null; then
167167 git clone https://github.com/primesearch/Mlucas.git
168168 else
183183if [[ -f " autoprimenet.py" ]]; then
184184 echo -e " \nAutoPrimeNet is already downloaded\n"
185185else
186- echo -e " \nDownloading the latest PrimeNet program \n"
186+ echo -e " \nDownloading AutoPrimeNet \n"
187187 if [[ -e ../autoprimenet.py ]]; then
188188 cp -v ../autoprimenet.py .
189189 else
@@ -199,7 +199,7 @@ if ! python3 -m pip install requests; then
199199 if command -v pip3 > /dev/null; then
200200 pip3 install requests
201201 else
202- echo -e " \nWarning: pip3 is not installed and the Requests library may also not be installed\n"
202+ echo -e " \nWarning: Python pip3 is not installed and the Requests library may also not be installed\n"
203203 fi
204204fi
205205cd obj
@@ -422,7 +422,7 @@ RUNS=(${ARGS[MAX]})
422422threads=(${THREADS[MAX]} )
423423{
424424 echo -e " \nBenchmark Summary\n"
425- echo -e " \tAdjusted msec /iter times (ms/iter) vs Actual iters/sec total throughput (iter/s) for each combination\n"
425+ echo -e " \tAdjusted ms /iter times vs Actual iters/s total throughput for each combination\n"
426426 {
427427 printf ' FFT\t'
428428 for i in " ${! ARGS[@]} " ; do
@@ -516,7 +516,7 @@ for i in "${!RUNS[@]}"; do
516516done
517517echo -e " \nStarting AutoPrimeNet\n"
518518nohup python3 -OO ../autoprimenet.py " ${args[@]} " >> ' autoprimenet.out' &
519- sleep $(( ${# RUNS[*]} * 2 ))
519+ sleep $(( ${# RUNS[*]} * 4 ))
520520for i in " ${! RUNS[@]} " ; do
521521 printf " \nWorker/CPU Core %'d: (-core argument: %s)\n" $(( i + 1 )) " ${RUNS[i]} "
522522 pushd " run$i " > /dev/null
@@ -538,20 +538,20 @@ set -e
538538# Mlucas maximum memory usage precentage per worker
539539maxalloc=$maxalloc
540540
541- pgrep -x Mlucas >/dev/null || {
541+ pgrep -x Mlucas >/dev/null || (
542542 echo -e "\nStarting Mlucas\n"
543543 set -x
544544 $( for i in " ${! RUNS[@]} " ; do
545545 (( i)) && printf ' \t'
546546 echo " (cd 'run$i ' && exec nohup nice ../Mlucas -core ${RUNS[i]} -maxalloc \$ maxalloc >>'Mlucas.out' &) "
547547 done)
548- }
548+ )
549549
550- pgrep -f '^python3 -OO \.\./autoprimenet\.py' >/dev/null || {
550+ pgrep -f '^python3 -OO \.\./autoprimenet\.py' >/dev/null || (
551551 echo -e "\nStarting AutoPrimeNet\n"
552552 set -x
553553 exec nohup python3 -OO ../autoprimenet.py ${args[@]} >>'autoprimenet.out' &
554- }
554+ )
555555EOF
556556chmod +x jobs.sh
557557# crontab -l | { cat; echo "@reboot cd ${DIR@Q} && ./jobs.sh"; } | crontab -
0 commit comments