1

I have a CPU with 32 processors and each has 16 cores. Here is the truncated output for cat /proc/cpuinfo for 32'nd processor.

processor   : 31
vendor_id   : GenuineIntel
cpu family  : 6
model       : 79
model name  : Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
stepping    : 1
microcode   : 0xb000037
cpu MHz     : 2700.787
cache size  : 46080 KB
physical id : 0
siblings    : 32
core id     : 15
cpu cores   : 16
apicid      : 31
initial apicid  : 31
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 mmx fxsr sse sse2 ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq monitor est ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single kaiser fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx xsaveopt ida
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips    : 4600.08
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

What does it mean for OS? Can it run 32*16=512 processes completely in parallel?

However when I run the following python code I still get 32 as output.

import multiprocessing
print("Number of cpu : ", multiprocessing.cpu_count())

So can python only run 32 processes completely in parallel?

Shimano
  • 785
  • 1
  • 6
  • 13
  • Your question is similar in nature to this question: [What is socket, core, threads, CPU?](https://stackoverflow.com/questions/40163095/what-is-socket-core-threads-cpu) – avgJoe Aug 05 '19 at 01:11

1 Answers1

1

Your processor has 16 cores that allow you to run 32 threads in parallel. This means that python can parallelize (Multi-thread) across those 32 threads. From the Intel Website:

A Thread, or thread of execution, is a software term for the basic ordered sequence of instructions that can be passed through or processed by a single CPU core.

Plainly, yes you can "only" run 32 threads in parallel.

avgJoe
  • 832
  • 7
  • 24
  • thanks for answering. I don't understand completely. if i get this output: https://pastebin.com/prPs8snH , then doesn't it mean i have 32 CPUs and each with 16 cores? which would mean 512 total cores. – Shimano Aug 01 '19 at 22:59
  • No. Thread 31 has a total of 32 siblings on that CPU, which itself has only 16 cores. I don't think there's a CPU in existence with 512 threads, let alone cores (GPUs are a different beast, of course). – Linuxios Aug 01 '19 at 23:21
  • Please run the following in python: import multiprocessing multiprocessing.cpu_count() – avgJoe Aug 01 '19 at 23:22
  • And yes, as Linuxios said, there is no such CPU to my knowledge (at least not for the average consumer). Unless you are working at NASA or the like, you do not have access to that sort of machine. Incidentally, if you really had 32 of Intel Xenon CPUs you would be able to run 1024 threads as opposed to only 512. – avgJoe Aug 01 '19 at 23:29
  • Got it. thanks a lot for all your help guys. I was confused about the number 16 and I assume it is related to hyperthreading/virtual cores. since this is aws resource, i was wondering is 32 cpus were installed side by side as in multiple physical CPUs – Shimano Aug 02 '19 at 01:35