tdulcet / Distributed-Computing-Scripts

🖧 Distributed Computing Scripts for GIMPS, BOINC and Folding@home
MIT License
18 stars 12 forks source link

mlucas.sh fails on Fedora 40 Asahi Remix, M2 processor #23

Closed proski closed 5 months ago

proski commented 5 months ago

The output of lspcu on M2 CPU contains Thread(s) per core twice. As a result, the HP variable has a newline in it: 1\n1. That leads to many error messages in the script (some are very confusing). A workaround is to apply sort -u to the sed output in the HP assignment, but it would still break if the values are different. Perhaps the newline can be detected and reported. I'm attaching the complete output of lscpu. lscpu-out.txt

tdulcet commented 5 months ago

Thank you for the bug report and the lscpu output. I did not realize that Thread(s) per core could be output more than once. The solution is to select the largest value with sort -nr | head -n 1. I will update the script to do this.

For future reference, you could run Bash with the -e option so that it exits after the first error: bash -e -o pipefail -- mlucas.sh [...]