-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
MacBook Pro M1 Max doesn't give correct number of threads with --threads=auto
#44067
Comments
See #42099 |
Since reference [0] got cut off, here it is again. |
Right. See this comment: #42099 (comment) . There appears to be a way to query this information rather than hard code it. |
@navidcy Could you kindly build the following C script and say what it prints for you. #include <sys/sysctl.h>
#include <stdio.h>
int main()
{
char str[7];
size_t len = 7;
sysctlbyname("kern.osrelease", str, &len, NULL, 0);
printf("%s\n", str);
if (str[0] > 1 && str[1] > 0)
{
len = 4;
int ncpus;
sysctlbyname("hw.perflevel0.physicalcpu", &ncpus, &len, NULL, 0);
printf("%d\n", ncpus);
}
} |
Sure, but I'd like some help with C. How do I build this? |
It should be enough to put it into a file called |
|
Thanks for the help. I will open a PR that will make it set the correct number of threads. |
I get different results for
Threads.nthreads()
on a Macbook Pro M1 Max using the latest version of julia and the tagged v1.7.1.In particular, with latest Julia version I get 6! But when I look at System Info I see 8?
For
julia#master
at e0a4b77while on Julia v1.7
Probably the fix is related to this bit?
julia/src/sys.c
Lines 598 to 630 in 546a774
@glwagner, @sandreza
The text was updated successfully, but these errors were encountered: