I cannot figure out how to use pmap
from within a module. For instance the following code works:
@everywhere module Work
w(i) = myid()
end
module Sub
using Work
function go()
p = pmap(Work.w, 1:10 )
println(p)
end
go()
end
Scoping the the same code within a Top module, i.e.
module Top
@everywhere module Work
w(i) = myid()
end
module Sub
using Work
function go()
p = pmap(Work.w, 1:10 )
println(p)
end
go()
end
end
errors with:
LoadError: On worker 2:
UndefVarError: Top not defined
in deserialize at ./serialize.jl:602
…
I’m using a deeply nested module hierarchy. In summary: I cannot see how to use the parallel functionality at any module level lower than the top level. Advice much appreciated!