JuliaLang / Distributed.jl

Create and control multiple Julia processes remotely for distributed computing. Ships as a Julia stdlib.
https://docs.julialang.org/en/v1/stdlib/Distributed/
MIT License
20 stars 8 forks source link

Allow @everywhere include(...) to override default path behavior #84

Open dlakelan opened 1 year ago

dlakelan commented 1 year ago

According to tests and the documentation string:

  Similar to calling remotecall_eval(Main, procs, expr), but with two extra
  features:

  - `using` and `import` statements run on the calling process first, to ensure
    packages are precompiled.
  - The current source file path used by `include` is propagated to other processes.

This last "feature" overrides the path even if that isn't desired behavior. I discovered this when doing

@everywhere include("./utilities.jl")

and I expected it to read from the "current directory" that the remote julia process started in, but in fact it tried to read from my home directory (same directory as on my machine where the whole process was initiated) however that path doesn't exist remotely and isn't the desired behavior. It would be nice to have an option to not have @everywhere include(...) override the path.