Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cpus : fix or replace py-cpuinfo to get the number of hard CPUs / sockets on a multi socket machine #13

Closed
bpetit opened this issue Apr 21, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bpetit
Copy link
Contributor

bpetit commented Apr 21, 2022

Problem / Use case

We use py-cpuinfo which apparently doesn't make a difference between mono socket and multi socket MB

Solution

We could either find another lib, or create a PR for py-cpuinfo to fix this.

@bpetit bpetit added enhancement New feature or request help wanted Extra attention is needed labels Apr 21, 2022
@benjaminlebigot
Copy link
Collaborator

benjaminlebigot commented Apr 25, 2022

Hey, Do you think that lstopo (hwloc) could do the job ?

@bpetit
Copy link
Contributor Author

bpetit commented Apr 28, 2022

Maybe ! Did you test it on multi socket machines ?

@benjaminlebigot
Copy link
Collaborator

benjaminlebigot commented Apr 28, 2022

By myself ? Nope but it looks like it does the job : https://www.open-mpi.org/projects/hwloc/ | https://linux.die.net/man/7/hwloc

If you have a use case or a machine with an ssh connection having multii-sockets on its motherboard, I can test it for you, it is really not complicated/long to do.

Tell me if you have some time to spend/to discuss about this point and the needs for the agent, I would gladly contribute to such issue.

PS : this link supposes that you can clearly ask specific information from a list of sockets https://iq.opengenus.org/hwloc-in-linux/

@benjaminlebigot
Copy link
Collaborator

Hi @bpetit,

I started to work on the contribution on py-cpuinfo in order to retrieve the socket_count.

Here is the current pull request: workhorsy/py-cpuinfo#172
I will update the /hardware/cpu/cpu.py once the pull request is accepted.

@benjaminlebigot
Copy link
Collaborator

Since we don't have any answer from the MR below, I added a function to get the nb of socket in the hardware/cpu.py file
You can find this work on the add_socket_number branch.

I will start an MR

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants