Open jtrakk opened 2 years ago
At the very least need a good way to get the physical core count as discussed in #43692
We could use min(1, Sys.CPU_THREADS ÷ 2)
as a safe default while waiting on that issue? I also think giving more than one thread by default would be great for new users!
There is also the issue that new cpus have big.Little architectures (M1 mac, 12th gen intel) so we would have to choose either just performance cores (probably the best) or all cores.
It seems like this issue got stuck. Is there any fundamental downside of having JULIA_NUM_THREADS=auto,auto
be the default over the current 1,0
? I understand that the auto-detection of the CPU core count is not perfect right now but setting to 1,0
seems to provide a worse default behavior (especially for new users) almost every time (since Threads.@spawn
and friends will not warn about having only a single thread so it is just silently refusing the multi-thread.)
This will help new Julia programmers who don't know about
JULIA_NUM_THREADS=auto
get fast execution. It also symbolizes how Julia supports the increasing parallelism of modern technical computing. Anybody who needs sequential execution, e.g. for debugging, can useJULIA_NUM_THREADS=1
.Rust's Rayon uses the number of logical cores by default.
Intel® Cilk™ Plus uses the number of hardware threads.
Crystal defaults to 4.
Fortran OMP defaults to 1.