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
I have a JuMP (mixed-integer) model where I'm trying to determine the upper and lower bounds on many variables. Each individual solve is very quick, but since I have many variables (~1,000), the overall solve time is slow (~5s).
One thing that I observed is that julia often seems to be using only one core at a time, and I was hoping that parallelization might be able to reduce solve times significantly. However, I'm running into an issue that seems to have to do with there being only a single Gurobi environment created.
Here's an example of a snippet of code that doesn't work. (map runs fine, but pmap does not).
Academic license - for non-commercial use only
From worker 3: Academic license - for non-commercial use only
From worker 2: Academic license - for non-commercial use only
2.317813 seconds (1.72 M allocations: 90.407 MiB, 1.04% gc time)
ERROR: LoadError: On worker 2:
AssertionError: env.ptr_env != C_NULL
get_error_msg at /home/vtjeng/.julia/v0.6/Gurobi/src/grb_env.jl:38
Type at /home/vtjeng/.julia/v0.6/Gurobi/src/grb_env.jl:50 [inlined]
get_intattr at /home/vtjeng/.julia/v0.6/Gurobi/src/grb_attrs.jl:16
setvarLB! at /home/vtjeng/.julia/v0.6/Gurobi/src/GurobiSolverInterface.jl:187
#build#119 at /home/vtjeng/.julia/v0.6/JuMP/src/solvers.jl:338
#build at ./<missing>:0
#solve#116 at /home/vtjeng/.julia/v0.6/JuMP/src/solvers.jl:168
upperbound_mip at /home/vtjeng/Dropbox/Documents/MIT/UROP/adversarial_examples/pset/6_using_MIPVerify/debug/feature-parallel-solves.jl:14
#106 at ./distributed/process_messages.jl:268 [inlined]
run_work_thunk at ./distributed/process_messages.jl:56
macro expansion at ./distributed/process_messages.jl:268 [inlined]
#105 at ./event.jl:73
Stacktrace:
[1] #571 at ./asyncmap.jl:178 [inlined]
[2] foreach(::Base.##571#573, ::Array{Any,1}) at ./abstractarray.jl:1733
[3] maptwice(::Function, ::Channel{Any}, ::Array{Any,1}, ::Array{JuMP.Variable,1}, ::Vararg{Array{JuMP.Variable,1},N} where N) at ./asyncmap.jl:178
[4] wrap_n_exec_twice(::Channel{Any}, ::Array{Any,1}, ::Base.Distributed.##204#207{WorkerPool}, ::Function, ::Array{JuMP.Variable,1}, ::Vararg{Array{JuMP.Variable,1},N} where N) at ./asyncmap.jl:154
[5] #async_usemap#556(::Function, ::Void, ::Function, ::Base.Distributed.##188#190, ::Array{JuMP.Variable,1}, ::Vararg{Array{JuMP.Variable,1},N} where N) at ./asyncmap.jl:103
[6] (::Base.#kw##async_usemap)(::Array{Any,1}, ::Base.#async_usemap, ::Function, ::Array{JuMP.Variable,1}, ::Vararg{Array{JuMP.Variable,1},N} where N) at ./<missing>:0
[7] (::Base.#kw##asyncmap)(::Array{Any,1}, ::Base.#asyncmap, ::Function, ::Array{JuMP.Variable,1}) at ./<missing>:0
[8] #pmap#203(::Bool, ::Int64, ::Void, ::Array{Any,1}, ::Void, ::Function, ::WorkerPool, ::Function, ::Array{JuMP.Variable,1}) at ./distributed/pmap.jl:126
[9] pmap(::WorkerPool, ::Function, ::Array{JuMP.Variable,1}) at ./distributed/pmap.jl:101
[10] #pmap#213(::Array{Any,1}, ::Function, ::Function, ::Array{JuMP.Variable,1}) at ./distributed/pmap.jl:156
[11] pmap(::Function, ::Array{JuMP.Variable,1}) at ./distributed/pmap.jl:156
[12] include_from_node1(::String) at ./loading.jl:576
[13] include(::String) at ./sysimg.jl:14
[14] process_options(::Base.JLOptions) at ./client.jl:305
[15] _start() at ./client.jl:371
One thing I've thought about trying to do is to generate one environment per worker thread, but 1) I don't know whether that would help and 2) I don't know how to do that.
The text was updated successfully, but these errors were encountered:
I have a JuMP (mixed-integer) model where I'm trying to determine the upper and lower bounds on many variables. Each individual solve is very quick, but since I have many variables (~1,000), the overall solve time is slow (~5s).
One thing that I observed is that
julia
often seems to be using only one core at a time, and I was hoping that parallelization might be able to reduce solve times significantly. However, I'm running into an issue that seems to have to do with there being only a single Gurobi environment created.Here's an example of a snippet of code that doesn't work. (
map
runs fine, butpmap
does not).Output
One thing I've thought about trying to do is to generate one environment per worker thread, but 1) I don't know whether that would help and 2) I don't know how to do that.
The text was updated successfully, but these errors were encountered: