I have a large project where one function includes a pmap call, and I’m not sure the right way to get the code in scope on all the workers.
@everywhere include("code.jl")where code.jl uses all the packages and includes my functions. Then I run a function from my code. This doesn’t work and gives me a lot of warnings/errors about reloading modules
- Wrapping my whole code in a module
using MyModule. This doesn’t work,
MyModuleisn’t defined on the workers.
@everywhere include("MyModule.jl"), then
using MyModule. The first line gives a ton of warnings about replacing modules from packages, which surprised me because I haven’t used
MyModuleyet. It works fine except for all the warnings.