I'm Intel(R) Core(TM)2 Duo CPU T6600 @ 2.20GHz (as told to me by cat /proc/cpuinfo
), but I need to go into as much depth as possible re. architecture for working on parallel programming (likely using pthreads
). Any pointers?
There are three basic parallel processing hardware architectures in the server market such as symmetric multiprocessing (SMP), massively parallel processing (MPP), and non-uniform memory architecture (NUMA).
If it's x64, then it's AMD64, if it's x86, then it's i386 :) If you are unable to find “This PC” on your desktop, then open the start menu, then click on the settings icon, then click on “System”, then click on “About”, and you should be able to see the 'system type' there.
Go to Start » Run and then type cmd . Now you will be in command prompt. There you can type systeminfo and then press enter.
To determine system type for macOSOpen the Apple menu and choose About This Mac. Click the System Report button. If you do not see a System Report button, click the More Info button and then click the System Report button. Under the Hardware panel, locate the Processor Name in the Hardware Overview.
The sys filesystem knows all about this:
$ ls /sys/devices/system/cpu
cpu0 cpu2 cpuidle possible sched_mc_power_savings
cpu1 cpu3 online present
$ ls /sys/devices/system/cpu/cpu0/topology/
core_id core_siblings_list thread_siblings
core_siblings physical_package_id thread_siblings_list
Here's the documentation
Using this filesystem, you can find out how many CPUs you have, how many threads they have, which CPUs are next to which other cpus, and which CPUs share caches with which other ones.
For example - Q: which CPUs does cpu0 share it's L2 cache with?
$ cat /sys/devices/system/cpu/cpu0/cache/index2/{type,level,shared_cpu_list}
Unified
2
0-1
A: It shares it's unified L2 cache with cpu1 (and itself).
Another example: Q: which CPUs are in the same physical package as cpu0 (on a larger machine):
cat /sys/devices/system/cpu/cpu0/topology/core_siblings
00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000055
A: cores 0, 2, 4 and 6. (taken from the bit pattern above, lsb=cpu0)
not all linux systems have the sys filesystem in, and it's not always in root. (possibly in proc/sys?). the thread_siblings_list form is not always available, but the thread_siblings (bit pattern) one is.
I found lstopo
of the hwloc project quite useful. This will give you graphical output
(based on information found in /proc
and /sys
as Alex Brown described)
of the topology of your system (see their webpage for an example). From the graphical
output you can easily see
etc.
If you need to access this information programmatically, there is some documentation how hwloc
can be used as a library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With