In todays lecture we discussed the Unix command nm and how it

advertisement
High performance computing B, 2009
Notes on the nm command and /proc/cpuinfo
In the lecture Nov. 17 we discussed the Unix command nm and how it can be used together with grep and wc. To
list the contents of Unix libraries one may use the command nm. Useful options and trailing pipes include the
following (we assume there are libraries named libgoto2.a and blacsC.a in the current folder, as there are for
example in ~jonasson/lib on Sól):
nm blacsC.a
nm
nm
nm
nm
nm
nm
blacsC.a | grep -w T
-g --defined-only blacsC.a
-og --defined-only *.a
libgotoblas2.a | grep -w T | wc
-o *.a | grep -w T | grep dgemm
-o *.a | grep -w T | grep -w dgemm_
List all symbols in the library, both defined (with a T) and
undefined (with a U).
List only defined symbols
Another way to list only defined symbols
prefix the name of the library to each output line
Count the number of defined symbols
Find out which libraries define symbols containing dgemm
Find out which libraries define the symbol dgemm_
We also discussed the virtual Linux file /proc/cpuinfo, which exists on most (if not all) Linux systems, and on
each node in a cluster. Typical contents, obtained with
cat /proc/cpuinfo
are:
processor
vendor_id
type
cpu family
model
model name
stepping
brand id
cpu count
apic id
cpu MHz
fpu
flags
:
:
:
:
:
:
:
:
:
:
:
:
:
0
GenuineIntel
primary processor
6
7
Intel(R) Core(TM)2 Duo CPU
T8300 @ 2.40GHz
6
0
2
0
2394
yes
fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov...
processor
vendor_id
type
cpu family
model
model name
stepping
brand id
cpu count
apic id
cpu MHz
fpu
flags
:
:
:
:
:
:
:
:
:
:
:
:
:
1
GenuineIntel
primary processor
6
7
Intel(R) Core(TM)2 Duo CPU
T8300 @ 2.40GHz
6
0
2
1
2394
yes
fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov...
This is obtained cygwin on my laptop, which has a single dual core CPU. We see that each core is listed as a
separate processor, and to list all the core numbers (and thereby find the total number of cores) one may use:
cat /proc/cpuinfo | grep processor
Among other useful information obtained is the type of processor (Intel or AMD, duo or quad), the number of
cores per CPU (cpu cores or cpu count), the number of virtual cores per cpu (when hyperthreading is used;
siblings; not given by cygwin) and the nominal and actual megaherz rate (2400 and 2394 respectively in the
example above).
You could try this command on Jötunn and on different nodes on Sól (the primary node, a c0 or a c1 node, and
on the node c2-0 — see “Notes on Sól” on the course web page for how to log on to them).
Download