|
|
|
@ -83,11 +83,10 @@ def set_omp_mkl_env_vars(trainer_count):
|
|
|
|
|
'''Get the number of physical cores'''
|
|
|
|
|
if platform.system() == "Linux":
|
|
|
|
|
num_sockets = int(
|
|
|
|
|
os.popen("lscpu |grep \"Socket\" |awk -F':' '{print $2}'|xargs")
|
|
|
|
|
os.popen("grep 'physical id' /proc/cpuinfo | sort -u | wc -l")
|
|
|
|
|
.read())
|
|
|
|
|
num_cores_per_socket = int(
|
|
|
|
|
os.popen(
|
|
|
|
|
"lscpu |grep \"per socket\" |awk -F':' '{print $2}'|xargs")
|
|
|
|
|
os.popen("grep 'core id' /proc/cpuinfo | sort -u | wc -l")
|
|
|
|
|
.read())
|
|
|
|
|
return num_sockets * num_cores_per_socket
|
|
|
|
|
else:
|
|
|
|
|