Skip to content

Commit

Permalink
Warn users when they set threaded = true in assess() and didn't setup…
Browse files Browse the repository at this point in the history
… NUM_THREADS correctly
  • Loading branch information
scdhulipala authored and GordStephen committed Nov 1, 2023
1 parent bd02c35 commit 2ded134
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ResourceAdequacy/simulations/convolution/Convolution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ function assess(
@spawn makeperiods(periods, N)

if method.threaded

if (threads == 1)
@warn "It looks like you haven't configured JULIA_NUM_THREADS before you started the julia repl. \n If you want to use multi-threading, stop the execution and start your julia repl using : \n julia --project --threads auto"
end

for _ in 1:threads
@spawn assess(system, method, periods, results, resultspecs...)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ function assess(
@spawn makeseeds(sampleseeds, method.nsamples)

if method.threaded

if (threads == 1)
@warn "It looks like you haven't configured JULIA_NUM_THREADS before you started the julia repl. \n If you want to use multi-threading, stop the execution and start your julia repl using : \n julia --project --threads auto"
end

for _ in 1:threads
@spawn assess(system, method, sampleseeds, results, resultspecs...)
end
Expand Down

0 comments on commit 2ded134

Please sign in to comment.