To anyone interested and maybe related to some other questions, what works for me is to add
module MyPkg
using Distributed
f(x) = ...
function big(...)
....
return pmap(f, iterator)
end
export big
end
Then outside the pkg I just need to do
using Distributed
addprocs(10)
using MyPkg
@everywhere using MyPkg
big(...) # works and is faster!
It is very simple to modify existing code to make it distributed that way.
If I don’t want distributed, I just do not load using Distributed
and pmap
performs as a regular map
.