it's possible to know numbers of sockets in my computer with python (and psutil ?)
for example with psutil i can to get numbers of core, but can i the number of sockets in mothercard ?
My computer have 2 sockets (and 2 xeon cpu)
it's possible to know numbers of sockets in my computer with python (and psutil ?)
for example with psutil i can to get numbers of core, but can i the number of sockets in mothercard ?
My computer have 2 sockets (and 2 xeon cpu)
psutil does not return this kind of information (as far as I could tell from the documentation and the source code).
If you are on Linux you can get the information in python with the following code:
import subprocess
cpu_sockets = int(subprocess.check_output('cat /proc/cpuinfo | grep "physical id" | sort -u | wc -l', shell=True))
Returns 1 on a single socket system (my Amazon server) and 2 on my Xeon workstation.
psutils provides cpu_count function with parameters logical=True/False. logical=False returns the number of physical cores only.