![]() |
![]() |
#1 | ||
Dec 2011
After milion nines:)
3·7·73 Posts |
![]()
I wrote small script to show me cpu usage, temperature of CPU , used memory, uptime...
what is my problem? When I run mprime under linux then script show some percentage of usage (nearly every time 100%) since it run on all cores Quote:
Currently I run boinc clinet with 8 LLR2 task and CPU usage is zero? Quote:
Where is error in my script? |
||
![]() |
![]() |
![]() |
#2 |
Sep 2002
Database er0rr
3×5×281 Posts |
![]()
Try sum*100/800 or simply sum/8.
|
![]() |
![]() |
![]() |
#3 |
Dec 2011
After milion nines:)
3·7·73 Posts |
![]() |
![]() |
![]() |
![]() |
#4 |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
5·1,303 Posts |
![]() |
![]() |
![]() |
![]() |
#5 |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
5·1,303 Posts |
![]()
Perhaps a more robust summation script would be this:
CORES=$(grep stepping /proc/cpuinfo | wc -l) ; awk "{ total+=\$1 } END { print total/$CORES }" <(ps -u $USER -o %cpu h) If you wanted track just for particular programs then maybe this: CORES=$(grep stepping /proc/cpuinfo | wc -l) ; awk "{ total+=\$1 } END { print total/$CORES }" <(ps -C mprime,boinc -o %cpu h) Or for all processes: CORES=$(grep stepping /proc/cpuinfo | wc -l) ; awk "{ total+=\$1 } END { print total/$CORES }" <(ps -o %cpu h) |
![]() |
![]() |
![]() |
#6 |
Sep 2009
34×29 Posts |
![]()
Or:
CORES=$(grep -c stepping /proc/cpuinfo) Which is slightly faster, but I'd only run it once at the start of a script so speed wouldn't make much difference. |
![]() |
![]() |
![]() |
#7 |
"/X\(‘-‘)/X\"
Jan 2013
B8916 Posts |
![]()
Or CORES=$(nproc)
|
![]() |
![]() |
![]() |
#8 |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
5·1,303 Posts |
![]() |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Windows Subsystem for Linux v2 gets real Linux kernel | tServo | Software | 0 | 2019-05-07 16:59 |
GPU Usage | Brain | GPU Computing | 9 | 2011-04-12 22:25 |
Usage of GMP-ECM | ECMFreak | Factoring | 13 | 2007-07-20 17:34 |
max heap usage of Linux process | prasanta | Programming | 1 | 2006-11-13 22:49 |
CPU usage | Unregistered | Software | 6 | 2003-11-19 07:05 |