Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

returns 48 cores for 96 core windows machine #81

Open
jonathanstrong opened this issue Jul 19, 2019 · 3 comments
Open

returns 48 cores for 96 core windows machine #81

jonathanstrong opened this issue Jul 19, 2019 · 3 comments

Comments

@jonathanstrong
Copy link

jonathanstrong commented Jul 19, 2019

on an aws windows instance, num_cpus::get() returned 48 for a machine with 96 logical cores. I expected the result would be 96, not 48, the number of physical cores.

num_cpus v1.10.1
rustc: 1.38.0-nightly 2019-07-18

CPU readout from windows task manager:

	Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz

	Base speed:	2.50 GHz
	Sockets:	2
	Cores:	48
	Logical processors:	96
	Virtualization:	Enabled
	L1 cache:	3.0 MB
	L2 cache:	48.0 MB
	L3 cache:	2.0 MB

Thanks for your hard work on the library!

(edit: adds num_cpus version)

@seanmonstar
Copy link
Owner

Huh, I just checked the MSDN docs about GetSystemInfo and dwNumberOfProcessors, and noticed this:

The number of logical processors in the current group.

It seems the group can only have up to 64 (and thus you're seeing 48)? Since you seem to have access to a windows box with a lot of cores, would you be able to help with the fix?

@jonathanstrong
Copy link
Author

I'd love to help out, unfortunately:

  • I was only on the machine briefly to run something numerically intensive
  • I have close to no experience with windows system calls, and deeply loathe windows in general
  • I tried to read the docs you reference in the last few minutes and found them baffling, even incomprehensible. Perhaps more than 64 cores is unusual enough it's not explained super well? Maybe it's just late.

However - next time I am working on one of these instances I'll try to poke around, if it's still relevant. Thanks!

@sectorzero
Copy link

I have implemented this feature. I will send a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants