I run Julia with 8 threads, as verified by Threads.nthreads()
, but when I try to solve a problem using Juniper I get the warning Julia was started with less processors than you defined in your options. Start julia with: `julia -p 1
. After profiling my code it does seem to be bound to a single thread.
MWE
using JuMP, Juniper, Gurobi, Ipopt
@show Threads.nthreads()
juniper_opt = optimizer_with_attributes(Juniper.Optimizer, "nl_solver" => Ipopt.Optimizer, "mip_solver" => Gurobi.Optimizer, "processors" => Threads.nthreads())
model = Model(juniper_opt)
@variable(model, 0 ≤ x ≤ 1)
@objective(model, Min, x)
optimize!(model)
How can I get Juniper to use all available threads? I’ve seen people referencing this issue but this seems to have been fixed.