Skip to content

Commit

Permalink
Ensure Distributed workers inherit threads spec properly (#49942)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpamnany authored May 24, 2023
1 parent 310f590 commit aea56a9
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion stdlib/Distributed/src/cluster.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,20 @@ end

write_cookie(io::IO) = print(io.in, string(cluster_cookie(), "\n"))

function get_threads_spec(opts)
if opts.nthreads > 0
@assert opts.nthreadpools >= 1
@assert opts.nthreads_per_pool != C_NULL
thr = "$(unsafe_load(opts.nthreads_per_pool))"
if opts.nthreadpools == 2
thr = "$(thr),$(unsafe_load(opts.nthreads_per_pool, 2))"
end
`--threads=$(thr)`
else
``
end
end

# Starts workers specified by (-n|--procs) and --machine-file command line options
function process_opts(opts)
# startup worker.
Expand All @@ -1331,7 +1345,7 @@ function process_opts(opts)
end

# Propagate --threads to workers
threads = opts.nthreads > 0 ? `--threads=$(opts.nthreads)` : ``
threads = get_threads_spec(opts)
gcthreads = opts.ngcthreads > 0 ? `--gcthreads=$(opts.ngcthreads)` : ``

exeflags = `$threads $gcthreads`
Expand Down

2 comments on commit aea56a9

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected.
A full report can be found here.

Please sign in to comment.