I have access to an 8-core node of a Linux cluster. When logged in to the node, I can see a list of processors using this command:
more /proc/cpuinfo
In my 8-core node, the processors are numbered from 0 to 7. Each processor is an Intel Xeon CPU (E5430 @ 2.66GHz).
Now suppose I call the program foo
with some arguments args
:
foo args
The program foo
takes a long time to execute (hours or days, for example). Having called foo
, is it possible to determine the particular processor (i.e., 0 to 7) on which foo
is running? The top
program shows me the process ID and similar information, but I don't see the processor number. Is such information available?
foo
to two different processors. When I callfoo
once, it runs with%CPU
very close to 100% (according totop
). But when I callfoo
a second time, bothfoo
processes run such that the%CPU
for both processes sum to less than 100% (usually about 45% for eachfoo
process). To me, this suggests that the two calls tofoo
are running on the same processor (even though there are eight processors available); I would like to verify that this is the case.ps
,top
, etc, this is the only answer which seems to work!