martinbiel / StochasticPrograms.jl

Julia package for formulating and analyzing stochastic recourse models.
MIT License
75 stars 25 forks source link

Could not run in distributed mode #17

Closed maramos874 closed 3 years ago

maramos874 commented 3 years ago

Hi, I'm trying to make Distributed solving work on my model. Nevertheless, this error arises:

julia> include("src_new\\main.jl")
ERROR: On worker 2:
ArgumentError: Package StochasticPrograms not found in current path:
- Run `import Pkg; Pkg.add("StochasticPrograms")` to install the StochasticPrograms package.

require at .\loading.jl:892
eval at .\boot.jl:331
#101 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Distributed\src\process_messages.jl:290
run_work_thunk at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Distributed\src\process_messages.jl:79
run_work_thunk at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Distributed\src\process_messages.jl:88
#94 at .\task.jl:358

...and 5 more exception(s).

Stacktrace:
 [1] sync_end(::Array{Any,1}) at .\task.jl:316
 [2] macro expansion at .\task.jl:335 [inlined]
 [3] remotecall_eval(::Module, ::Array{Int64,1}, ::Expr) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Distributed\src\macros.jl:217
 [4] top-level scope at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Distributed\src\macros.jl:201
 [5] include(::String) at .\client.jl:439
 [6] top-level scope at C:\Users\M435719\OneDrive\OneDrive - Air France KLM\TARGETS\thor_poc\src_new\main.jl:15
 [7] include(::String) at .\client.jl:439
 [8] top-level scope at REPL[4]:1

My main does not contain the model, which is instantiated in another file. The header of such file is the following:

module StochOptModel
using Distributed
addprocs(3)
@everywhere using StochasticPrograms
@everywhere using Gurobi

Am I missing something? Thanks in advance Kind regards

martinbiel commented 3 years ago

This does not seem like an issue with StochasticPrograms, but rather with your setup. The workers seem to be running in a Julia environment where StochasticPrograms is not installed? Are the workers local or remote? I cannot really help if it is a Windows related issue I am afraid.