Questions and Answers :
Unix/Linux :
Used bc command in Linux Debian
Message board moderation
Author | Message |
---|---|
Send message Joined: 26 Oct 20 Posts: 53 Credit: 2,520,836 RAC: 0 |
The bc command that's used in get_fraction_done is not default installed in Linux Debian. Echo every 10 seconds to stderr: get_fraction_done: 1: get_fraction_done: bc: not found No influence on the task outcome, but probably in the progress bar of the task during crunching. |
Send message Joined: 11 Oct 20 Posts: 339 Credit: 25,715,225 RAC: 5,686 |
The bc command that's used in get_fraction_done is not default installed in Linux Debian. Could you try to change lines fraction=`echo "scale=2; $NDOCKED/$NLIGANDS" | bc` printf "%.3f\n" $fraction > $3 by fraction=$(echo "$NDOCKED $NLIGANDS" | awk '{ docked = 0.0 + $1; total = 0.0 + $2; fraction = docked / total; printf("%.3f\n", fraction); }') echo $fraction > $3 ? |
Send message Joined: 26 Oct 20 Posts: 53 Credit: 2,520,836 RAC: 0 |
Sorry, that Debian VM is destroyed, but there are some other Debian hosts connected to this project. Maybe one of those users is reading this and could try it, else I could give it a try tomorrow with a new Debian-VM and with my low Linux skills. When changing a file within BOINC when has to disable file size check in BOINC's cc_config.xml. |
Send message Joined: 26 Oct 20 Posts: 53 Credit: 2,520,836 RAC: 0 |
Could you try to change linesI did and your proposed lines seems to be successful. I got an error message in BOINC's event log: sidocktest 17 Nov 11:14:39 [error] merge_info(): failed to change permissions of get_fraction_done_11.8_x86_64-pc-linux-gnu.sh Probably because I changed the file as root, but it's working. In the original version fraction_done stayed 0.000 and a lots of errors in stderr.txt https://fightcovid.boinc.ru/sidocktest/result.php?resultid=404437 In the modified version fraction_done is increasing (now 0.258). In BOINC Manager 25.8% progress. The task is still busy. When ready you can see the result https://fightcovid.boinc.ru/sidocktest/result.php?resultid=405395 |
Send message Joined: 9 Oct 20 Posts: 185 Credit: 2,782,517 RAC: 20 |
The task has finished successfully. Thank you for testing! We updated the application script. |
Send message Joined: 25 Dec 20 Posts: 4 Credit: 28,433,647 RAC: 88 |
Hey, It gets just a bit better. Since NDOCK and NLIGANDS are both integers, say NDOCKED=4 NLIGANDS=17 please change the line to printf "%.3f\n" $(($NDOCKED*1000/$NLIGANDS))e-3 > $3 which then gives you (for above setting, obviously) 0.235 without invoking any other binaries. "awk" is indeed installed almost everywhere, but, someone may not have the symlink from awk to gawk or ... whatever. Thanks go to https://www.shell-tips.com/bash/math-arithmetic-calculation/ for pointing me to this alternative. Best wishes, Steffen |
Send message Joined: 9 Oct 20 Posts: 185 Credit: 2,782,517 RAC: 20 |
Dear Steffen, we don't use the script get_fraction_done anymore, but thank you for the point. We might return to the script later. |
©2024 SiDock@home Team