Search code examples
parallel-processingprocessor

Processors vs cores


Looking at my Linux machine (more /proc/cpuinfo), I see that I have 4 processors and each processor has 4 cores. Here's the full content of cpuinfo:

  processor : 0
  vendor_id : GenuineIntel
  cpu family    : 6
  model     : 60
  model name    : Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz
  stepping  : 3
  microcode : 0x20
  cpu MHz       : 3464.984
  cache size    : 8192 KB
  physical id   : 0
  siblings  : 4
  core id       : 0
  cpu cores : 4
  apicid        : 0
  initial apicid    : 0
  fpu       : yes
  fpu_exception : yes
  cpuid level   : 13
  wp        : yes
  flags     : 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 nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
  bugs      :
  bogomips  : 6185.83
  clflush size  : 64
  cache_alignment   : 64
  address sizes : 39 bits physical, 48 bits virtual
  power management:

  processor : 1
  vendor_id : GenuineIntel
  cpu family    : 6
  model     : 60
  model name    : Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz
  stepping  : 3
  microcode : 0x20
  cpu MHz       : 3462.335
  cache size    : 8192 KB
  physical id   : 0
  siblings  : 4
  core id       : 1
  cpu cores : 4
  apicid        : 2
  initial apicid    : 2
  fpu       : yes
  fpu_exception : yes
  cpuid level   : 13
  wp        : yes
  flags     : 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 nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
  bugs      :
  bogomips  : 6189.39
  clflush size  : 64
  cache_alignment   : 64
  address sizes : 39 bits physical, 48 bits virtual
  power management:

  processor : 2
  vendor_id : GenuineIntel
  cpu family    : 6
  model     : 60
  model name    : Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz
  stepping  : 3
  microcode : 0x20
  cpu MHz       : 3335.375
  cache size    : 8192 KB
  physical id   : 0
  siblings  : 4
  core id       : 2
  cpu cores : 4
  apicid        : 4
  initial apicid    : 4
  fpu       : yes
  fpu_exception : yes
  cpuid level   : 13
  wp        : yes
  flags     : 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 nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
  bugs      :
  bogomips  : 6189.68
  clflush size  : 64
  cache_alignment   : 64
  address sizes : 39 bits physical, 48 bits virtual
  power management:

  processor : 3
  vendor_id : GenuineIntel
  cpu family    : 6
  model     : 60
  model name    : Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz
  stepping  : 3
  microcode : 0x20
  cpu MHz       : 3367.352
  cache size    : 8192 KB
  physical id   : 0
  siblings  : 4
  core id       : 3
  cpu cores : 4
  apicid        : 6
  initial apicid    : 6
  fpu       : yes
  fpu_exception : yes
  cpuid level   : 13
  wp        : yes
  flags     : 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 nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
  bugs      :
  bogomips  : 6189.74
  clflush size  : 64
  cache_alignment   : 64
  address sizes : 39 bits physical, 48 bits virtual
  power management:

I understand that a core is a processing unit, and that each processor contains 4 of these cores (for example, this question addresses that nicely), but I'm very confused regarding how they are actually used and accessed.

In all of the parallel processing tools I've used (mostly in R), I can access up to 4 processors/cores (called processors or cores depending on the language of the package). Also, in my system monitor, I see 4 processors and when one of them is active, it is fully active. I never see partial activity to suggest that I can get access to anything but one full processor (i.e., 4 cores within that processor). But, have 4 processors with 4 cores would suggest I can actually run 16 threads/processes at once.

What am I missing? Can I access each of these cores individually, or are the 4 cores of a given processor bound to that processor's activities?

EDIT: I just checked another machine in our server room and found the the snip posted above is repeated 40 times (!!!), so I have processors 0 through 39. Each of those has 10 cores listed. Shouldn't I be able to run 400 parallel jobs instead of 40?

EDIT2: Investigating the server closer I see 40 blocks of output for each processor. Rather than posting the whole thing, here's a shortened version with some explanation of what I see:

processor:  0  (this ranges from 0 to 40)
physical id:  0:  (ranges from 0 to 1, with 20 of each - this is telling me 2 physical Xeon processors present)
siblings:  20  (same for all - a bit confused here as Xeon is a 10 core processor)
core id:  (ranges from 0 to 12, but missing 5,6,7 - a total of 10 ids, but where are 5,6, and 7?  Also, there are 4 of each core id - 4 0s, 4 1s, etc.)
cpu cores:  10  (all have the same here, which makes sense but seems inconsistent with siblings)

The model name for the processors on this server is Xeon CPU E5-2650 v3, if that helps. Here's the web page for it: https://ark.intel.com/products/81705/Intel-Xeon-Processor-E5-2650-v3-25M-Cache-2_30-GHz


Solution

  • Depending on which kernel you have, each separate core is identified as a processor.

    This is probably the exact question you are looking for and it has a detailed explanation: https://unix.stackexchange.com/questions/146051/number-of-processors-in-proc-cpuinfo