Skip to content

Commit 82364ca

Browse files
authored
enable threading by default (#129)
enable threading by default when Julia is started with multiple threads.
1 parent 4d20bee commit 82364ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/solve_homotopy.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ get_single_solution(res::Result, index) = [get_single_solution(res, index=index,
3535
swept_parameters::ParameterRange,
3636
fixed_parameters::ParameterList;
3737
random_warmup=true,
38-
threading=false,
38+
threading = Threads.nthreads() > 1,
3939
show_progress=true,
4040
sorting="nearest")
4141
@@ -86,7 +86,7 @@ A steady state result for 1000 parameter points
8686
```
8787
8888
"""
89-
function get_steady_states(prob::Problem, swept_parameters::ParameterRange, fixed_parameters::ParameterList; random_warmup=true, threading=false, show_progress=true, sorting="nearest", classify_default=true)
89+
function get_steady_states(prob::Problem, swept_parameters::ParameterRange, fixed_parameters::ParameterList; random_warmup=true, threading = Threads.nthreads() > 1, show_progress=true, sorting="nearest", classify_default=true)
9090
# make sure the variables are in our namespace to make them accessible later
9191
declare_variable.(string.(cat(prob.parameters, prob.variables, dims=1)))
9292

0 commit comments

Comments
 (0)