Loading a module locally without loading it on remote workers

#1

Hi, is there way to use a Module only locally?

If I create a remote worker (e.g. with ssh on a different machine), then when I run using Module, the module needs to be installed on the remote host as well (Otherwise I get “ERROR: on worker 2: ArgumentError: Package … is required but does not seem to be installed”).

The only command I’m aware of to do so would be @fetchfrom 1 using Module, but it does not work (ERROR: syntax: “using” expression not at top level).

I understand that it can make sense to load code everywhere (and actually, I thought we should use @everywhere in that case), but some packages are used only on the main process, and it’s useless to install them on other workers in that case.

0 Likes

#2

I might be misunderstanding your question but isn’t the standard approach of using LocalOnlyPackage and @everywhere using LocalAndRemotePackage doing what you need?

0 Likes

#3

Well that’s what I thought, but then why do I get a “package not installed” error from worker 2 when I run using SomePackage on proc 1? Is it a bug rather than the expected behavior?

0 Likes