If you have one processor it will display a 0. processor – Provides each processor with an identifying number.processor: Intel(R) Core(TM) i7-3740QM CPU 2.Model name : Intel(R) Xeon(R) CPU E5-2660 0 2.20GHzįlags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid xsaveoptĪddress sizes : 46 bits physical, 48 bits virtualīelow is the various items you would see in the output and their respective explanations.thread or virtual core: number of threads that can run on parallel on one CPU if the (intel-)processor is able to perform hyperthreading the number of virtual cores is twice the number of physical cores (I am not sure how other processor vendors call this feature).core or physical core: number of physical calculation units in the CPU.processor: the whole piece of hardware (e.g.Since everyone uses cores, CPU and processor in another context, I introduce a nomenclature for my answer here: Thus, "number behind cpu cores" x "number behind physical id + 1" is the number of physical cores one our node (8 x (3 + 1)). > 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 |