Distributed.jl
Distributed.jl copied to clipboard
include on workers has somewhat strange behavior
If I'm reading include_from_node1 correctly, we convert path passed to include to an absolute path on the current worker, and then fetch the source from node 1. This makes include inside packages work, since the absolute path is relative to the path to the required file on node 1. However, this behavior seems more questionable for a bare include not inside a file that was reloaded or required (e.g. @spawnat 2 include("mycode.jl")), since in this case the absolute path is relative to the worker's current working directory, which might not exist on node 1. In that case, I think we should either:
includerelative to the current working directory on node 1. (This is not so weird, sincerequireandreloadsearch the current working directory on node 1.)includethe file from the local file system. But this may be ill-advised. If youincludea local file and it callsinclude, that should naturally refer to a local file. But if youincludea local file and it callsrequireorusing, do you load local code or code from node 1?- Throw some kind of error.