top: user % half of cpu % - not running optimally?
Hi. I have a 2010 dual-quad core Mac Pro. Am running a molecular dynamics code in parallel (using OpenMPI) on 4 processors, and get the following output from top -o cpu:
Processes: 79 total, 6 running, 73 sleeping, 350 threads | 12:11:38 |
Load Avg: 4.09, 4.05, 3.24 CPU usage: 24.82% user, 0.23% sys, 74.94% idle
SharedLibs: 14M resident, 7832K data, 0B linkedit.
MemRegions: 14774 total, 3679M resident, 33M private, 269M shared.
PhysMem: 1528M wired, 2253M active, 1103M inactive, 4884M used, 15G free.
VM: 203G vsize, 1118M framework vsize, 28393092(0) pageins, 0(0) pageouts.
Networks: packets: 111460065/33G in, 127784719/165G out.
Disks: 4538291/230G read, 3509593/152G written.
PID | COMMAND | %CPU TIME | #TH #WQ #POR #MRE RPRVT RSHRD RSIZE VPRVT VSIZE | |
24998 lmp_mac | 99.9 22:02.64 1/1 0 | 24 235 61M | 9668K 161M+ 175M+ 2611M+ | |
24997 lmp_mac | 99.9 22:02.64 1/1 0 | 24 236 59M | 9668K 172M 186M 2621M | |
24999 lmp_mac | 99.8 22:02.64 1/1 0 | 24 211 54M | 9668K 59M | 74M 2509M |
24996 lmp_mac | 98.3 21:58.07 1/1 0 | 24 223 59M | 9668K 171M 185M 2620M | |
25019 top | 1.0 00:00.62 1/1 0 | 28 38 920K 216K 1636K 19M 2379M |
The noteworthy thing (and the focus of my question is that even though the code lmp_mac is running at ~99% on four processors, the reported CPU usage is only ~25%, with ~75% reported as "idle". Since the individual processes hold steady at 99% over long periods of time, I would expect the overall usage and idle percentages to be closer to 50% and 50% when running on 4 processors on a 8-processor machine.
Why do you think top reports 75% idle when 4 processes are running at 99%? Has anyone run across a similar issue? Is this some issue with multithreading (e.g. the fact that the lmp_mac code may not use it), or is it just a peculiarity of top on Mac OS X?
Thanks,
Rob
Mac Pro, Mac OS X (10.7.3)