Mentions légales du service

Skip to content

fix: Fix number of cores for multi CPUs in same mobo on g5k

PAROL-GUARINO Volodia requested to merge vparolgu/enoslib:fix_cores into main

When I look at the enoslib source code

def _get_host_cores(cluster: str) -> int:
    nodes = g5k_api_utils.get_nodes(cluster)
    attributes = nodes[-1]
    processors = attributes.architecture["nb_procs"]
    cores = attributes.architecture["nb_cores"]

    # number of cores as reported in the Website
    return cores * processors

And I compare that to the actual returned value (cf screenshot) from g5k_api_utils it looks like it returns too much cores compared to the actual physical cores? the "nb_cores" returns the total number of cores on the motherboard and not the number of physical cores per physical CPU Paravance has 2 CPUS of 8 physical cores each, so the enos function should return 16 (without hyperthreading nor anything), however it would acutally return 32 Gros with a single cpu returns the right count of cores because it is multiplied by 1 at the end.

The code to get the details

from enoslib.infra.enos_g5k import g5k_api_utils
def get_details(cluster: str):
    nodes = g5k_api_utils.get_nodes(cluster)
    attributes = nodes[-1].architecture

    print("cores " + str(attributes["nb_cores"]))
    print("smt: " + str(attributes["nb_threads"]))
    print("procs: " + str(attributes["nb_procs"]))

print("paravance")
get_details("paravance")
print("gros")
get_details("gros")

returns

paravance
cores 16
smt: 32
procs: 2
gros
cores 18
smt: 36
procs: 1

The remaining question is whether this behaviour is consistent through all the g5k clusters?

Merge request reports