Results 1 to 6 of 6
Hello Guys,
I am examining a code that uses OpenMP APIs and I would like to see the CPU usage in my Fedora machine when running the code. I have ...
- 12-09-2009 #1Just Joined!
- Join Date
- Dec 2009
- Posts
- 3
[SOLVED] How to find out cpu usage?
Hello Guys,
I am examining a code that uses OpenMP APIs and I would like to see the CPU usage in my Fedora machine when running the code. I have a dual core so I am expecting to see a single core usage when running the code without OpenMP and then see both cores busy when OpenMP is applied.
I tried mpstat -P ALL and I ssh to the machine with two terminals, one to run the program and the other to type the mpstat command. But I did not see any change in the cpu usage and almost always I get the following numbers:
11:46:53 PM CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s
11:46:53 PM all 0.98 0.01 0.56 0.01 0.00 0.00 0.00 98.44 230.57
11:46:53 PM 0 0.52 0.01 0.19 0.01 0.00 0.00 0.00 99.28 15.65
11:46:53 PM 1 1.43 0.01 0.93 0.00 0.01 0.00 0.00 97.62 27.53
I have tried the top command which list the processes usage and I can see my code using 100% of cpu (when OpenMP is off) but I do not know why such statistics do not show up on mpstat :s
Any recommendation guys on how to accomplish what I am after?
- 12-09-2009 #2
use
Code:ps -aux | grep nameofexecutable
3rd column is %CPU
- 12-09-2009 #3Just Joined!
- Join Date
- Dec 2009
- Posts
- 3
- 12-10-2009 #4
What about the system monitor app in GNOME? Assuming that is, you use GNOME.

HTH
Dave
- 12-10-2009 #5
PS, won't show usage for multicore cpus or multiple cpus. it got only %c formatter for whole cpu usages.
May be you should use taskset command to set affinity for a process. then check its cpu usage.
- 12-10-2009 #6Just Joined!
- Join Date
- Dec 2009
- Posts
- 3
Hello Guys,
Thank you all for your response. I guess I found what I am looking for. If you go to Fedora --> applications --> system --> system monitor and click the system load tab, you will see the CPU load history per core as well as the memory and network traffic. The cpu usage there is what I am looking for since there is two plots one for each core of my dual processor machine.
Thanks all for your response.



