![]() ![]() > cat /proc/cpuinfo | grep "physical id" | tail -1 > cat /proc/cpuinfo | grep -c "cpu cores" This is the output I get: > cat /proc/cpuinfo | grep -m 1 "cpu cores" If we have such a setup, we need to consider the row physical id in cat /proc/cpuinfo. ![]() Thus, we get 64 'packages' of information. I just looked onto one node of a computing cluster, on which I am currently working: 1 node has 4 CPUs (Intel Xeon) with each 8 physical cores each CPU supports hyptherthreading therefore, each CPU has 16 virtual cores summing it up, the one node has 32 physical and 64 virtual cores Ĭat /proc/cpuinfo prints out information for each virtual core. You could also take the last found processor number and increment it by one > cat /proc/cpuinfo | grep "processor" | tail -1 Number of virtual cores: > cat /proc/cpuinfo | grep -l "cpu cores" Number of physical cores: > cat /proc/cpuinfo | grep -m 1 "cpu cores" Lets see what I get: > cat /proc/cpuinfo | grep "cpu cores" I have got a Intel(R) Core(TM) i7-3740QM CPU 2.70GHz (4 physical cores, hyperthreading). Thus, if you want to have the number of physical core, you just take the first occurrence of the line cpu cores, which is > cat /proc/cpuinfo | grep -m 1 "cpu cores"Īlternatively, if you are looking for the number of virtual cores, you count the number of times the line cpu cores is found, which is > cat /proc/cpuinfo | grep -c "cpu cores" But it prints out this information for each virtual core. The command cat /proc/cpuinfo should print out the number of physical cores in the line cpu cores. This may be the case if you work on a computing cluster or on a high-end desktop workstation for CAD/Engineering-purposes. See section "Several CPUs per mainboard". If you have more than one CPU/processor (in this sense) on your mainboard this does not properly work. 2x number of physical cores with hyper threading): > cat /proc/cpuinfo | grep -c "cpu cores" The number of physical cores: > cat /proc/cpuinfo | grep -m 1 "cpu cores"
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |