You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I start Julia with JULIA_EXCLUSIVE=1 julia1.7 -t4 I get
julia> results =Vector{String}(undef, Threads.nthreads())
Threads.@threadsfor i in1:Threads.nthreads()
results[i] =read(`sh -c 'taskset -p $$'`, String)
end
results
4-element Vector{String}:"pid 27240's current affinity mask: 1\n""pid 27237's current affinity mask: 2\n""pid 27239's current affinity mask: 4\n""pid 27238's current affinity mask: 8\n"
This seems to be non-ideal. Programmers ideally don't need to care which tasks run on which thread. So, it's not possible to control the CPU affinity of sub-processes in idiomatic Julia code. If two processes that can run in parallel is happened to be spawned from the same worker thread, they cannot fully utilize CPU resources.
How about saving the affinity at an early phase of the startup (so that configuration of taskset etc. propagates) and then set it in uv_process_options_t when calling uv_spawn?
The text was updated successfully, but these errors were encountered:
If I start Julia with
JULIA_EXCLUSIVE=1 julia1.7 -t4
I getThis seems to be non-ideal. Programmers ideally don't need to care which tasks run on which thread. So, it's not possible to control the CPU affinity of sub-processes in idiomatic Julia code. If two processes that can run in parallel is happened to be spawned from the same worker thread, they cannot fully utilize CPU resources.
How about saving the affinity at an early phase of the startup (so that configuration of
taskset
etc. propagates) and then set it inuv_process_options_t
when callinguv_spawn
?The text was updated successfully, but these errors were encountered: