From what I understand, using Module should use the module available on the master process, and send it to the workers. However, it is not working for me:
julia> addprocs([("admin@some.server",4)],exename="julia",dir="/home/admin",tunnel=true)
4-element Array{Int64,1}:
2
3
4
5
julia> using OrdinaryDiffEq
ERROR: On worker 2:
UndefVarError: ##694#696 not defined
#99 at ./event.jl:73
#remotecall_fetch#141(::Array{Any,1}, ::Function, ::Function, ::Base.Distributed.Worker) at .\distributed\remotecall.jl:354
remotecall_fetch(::Function, ::Base.Distributed.Worker) at .\distributed\remotecall.jl:346
#remotecall_fetch#144(::Array{Any,1}, ::Function, ::Function, ::Int64) at .\distributed\remotecall.jl:367
remotecall_fetch(::Function, ::Int64) at .\distributed\remotecall.jl:367
macro expansion at .\loading.jl:180 [inlined]
(::Base.##693#695)() at .\task.jl:335
...and 3 more exception(s).
Stacktrace:
[1] sync_end() at .\task.jl:287
[2] macro expansion at .\task.jl:303 [inlined]
[3] _require_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at .\loading.jl:177
[4] _require_search_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at .\loading.jl:236
[5] _require(::Symbol) at .\loading.jl:441
[6] require(::Symbol) at .\loading.jl:405
Am I missing anything obvious here or is it a Julia issue?
BTW, in this context, what does it mean for the code to not be in scope on the workers? I though that only meant that no functions were exported, but that the module name would still be available. Is that not correct?
The fully-qualified module name will work, but none of the methods exported by it will be implicitly available. So in most cases you do want to do an @everywhere using ....
Is this happening only for OrdinaryDiffEq or also for other modules?
@jebej thank you for reporting this. If you have the time/chance to try yet another module that makes use of multiple workers, please try to follow this notebook that I know was working with Julia v0.6.1 on my laptop at least. Please ignore the warnings as it is not fully implemented: https://github.com/juliohm/GeoStats.jl/blob/master/examples/ParallelSimulation.ipynb