Skip to content

Commit 1177d81

Browse files
committed
Updated Mlucas install script.
1 parent 9815793 commit 1177d81

File tree

13 files changed

+39
-36
lines changed

13 files changed

+39
-36
lines changed

boinc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Teal Dulcet
3+
# Copyright © 2020 Teal Dulcet
44
# wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/boinc.sh | bash -s --
55
# ./boinc.sh <URL> <E-mail> <Password>
66
# ./boinc.sh <URL> <Account Key>

cudalucas.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Teal Dulcet
3+
# Copyright © 2020 Teal Dulcet
44
# wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/cudalucas.sh | bash -s --
55
# ./cudalucas.sh [PrimeNet User ID] [Computer name] [Type of work] [Idle time to run (mins)]
66
# ./cudalucas.sh "$USER" "$HOSTNAME" 100 10
@@ -90,7 +90,7 @@ if ! python3 -m pip install requests; then
9090
if command -v pip3 >/dev/null; then
9191
pip3 install requests
9292
else
93-
echo -e "\nWarning: pip3 is not installed and the Requests library may also not be installed\n"
93+
echo -e "\nWarning: Python pip3 is not installed and the Requests library may also not be installed\n"
9494
fi
9595
fi
9696
echo -e "\nSetting up CUDALucas\n"

cudalucas2.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Teal Dulcet
3+
# Copyright © 2020 Teal Dulcet
44
# wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/cudalucas2.sh | bash -s --
55
# ./cudalucas2.sh <Computer number> [PrimeNet User ID] [Computer name] [Type of work] [Idle time to run (mins)]
66
# ./cudalucas2.sh <N> "$USER" "$HOSTNAME" 100 10
@@ -146,7 +146,7 @@ if ! python3 -m pip install requests; then
146146
if command -v pip3 >/dev/null; then
147147
pip3 install requests
148148
else
149-
echo -e "\nWarning: pip3 is not installed and the Requests library may also not be installed\n"
149+
echo -e "\nWarning: Python pip3 is not installed and the Requests library may also not be installed\n"
150150
fi
151151
fi
152152
cp CUDALucas.ini "CUDALucas$N.ini"

folding.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Teal Dulcet
3+
# Copyright © 2020 Teal Dulcet
44
# wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/folding.sh | bash -s --
55
# ./folding.sh [Username] [Team number] [Passkey] [Power]
66
# ./folding.sh "$USER" 0 "" medium

gpuowl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ if ! python3 -m pip install requests; then
179179
if command -v pip3 >/dev/null; then
180180
pip3 install requests
181181
else
182-
echo -e "\nWarning: pip3 is not installed and the Requests library may also not be installed\n"
182+
echo -e "\nWarning: Python pip3 is not installed and the Requests library may also not be installed\n"
183183
fi
184184
fi
185185
echo -e "\nSetting up GpuOwl\n"

gpuowl2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ if ! python3 -m pip install requests; then
217217
if command -v pip3 >/dev/null; then
218218
pip3 install requests
219219
else
220-
echo -e "\nWarning: pip3 is not installed and the Requests library may also not be installed\n"
220+
echo -e "\nWarning: Python pip3 is not installed and the Requests library may also not be installed\n"
221221
fi
222222
fi
223223
mkdir "$N"

idletime.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Teal Dulcet
3+
# Copyright © Teal Dulcet
44
# Outputs system idle time
55
# wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/idletime.sh | bash -s --
66
# ./idletime.sh
@@ -11,26 +11,26 @@ if [[ $# -ne 0 ]]; then
1111
fi
1212

1313
# Adapted from: https://github.com/tdulcet/Remote-Servers-Status/blob/master/status.sh
14-
# getSecondsAsDigitalClock <seconds>
15-
getSecondsAsDigitalClock() {
16-
local sec_num=$1
17-
local d=$((sec_num / 86400))
18-
local h=$(((sec_num % 86400) / 3600))
19-
local m=$(((sec_num % 3600) / 60))
20-
local s=$((sec_num % 60))
14+
# outputduration <seconds>
15+
outputduration() {
16+
local sec=$1
17+
local d=$((sec / 86400))
18+
local h=$(((sec % 86400) / 3600))
19+
local m=$(((sec % 3600) / 60))
20+
local s=$((sec % 60))
2121
local text=''
22-
if [[ $d -ne 0 ]]; then
22+
if ((d)); then
2323
text+="$(printf "%'d" "$d") days "
2424
fi
25-
if [[ $d -ne 0 || $h -ne 0 ]]; then
25+
if ((d || h)); then
2626
text+="$h hours "
2727
fi
28-
if [[ $d -ne 0 || $h -ne 0 || $m -ne 0 ]]; then
28+
if ((d || h || m)); then
2929
text+="$m minutes "
3030
fi
3131
text+="$s seconds"
3232
echo "$text"
3333
}
3434

3535
IDLETIME=$(awk '{ print int($2) }' /proc/uptime)
36-
echo -e "System idle time for all processor (CPU) threads since the last boot:\t$(getSecondsAsDigitalClock "$IDLETIME")\n"
36+
echo -e "System idle time for all processor (CPU) threads since the last boot:\t$(outputduration "$IDLETIME")\n"

mlucas.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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
164164
else
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
@@ -183,7 +183,7 @@ fi
183183
if [[ -f "autoprimenet.py" ]]; then
184184
echo -e "\nAutoPrimeNet is already downloaded\n"
185185
else
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
204204
fi
205205
cd obj
@@ -422,7 +422,7 @@ RUNS=(${ARGS[MAX]})
422422
threads=(${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
516516
done
517517
echo -e "\nStarting AutoPrimeNet\n"
518518
nohup python3 -OO ../autoprimenet.py "${args[@]}" >>'autoprimenet.out' &
519-
sleep $((${#RUNS[*]} * 2))
519+
sleep $((${#RUNS[*]} * 4))
520520
for 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
539539
maxalloc=$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+
)
555555
EOF
556556
chmod +x jobs.sh
557557
#crontab -l | { cat; echo "@reboot cd ${DIR@Q} && ./jobs.sh"; } | crontab -

mprime.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/expect -f
22

3-
# Teal Dulcet
3+
# Copyright © 2020 Teal Dulcet
44
# ./mprime.exp <User ID> <Computer name> <Type of work>
55

66
set timeout -1

mprime.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Teal Dulcet
3+
# Copyright © 2020 Teal Dulcet
44
# wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/mprime.sh | bash -s --
55
# ./mprime.sh [PrimeNet User ID] [Computer name] [Type of work] [Idle time to run (mins)]
66
# ./mprime.sh "$USER" "$HOSTNAME" 150 10

0 commit comments

Comments
 (0)