On Thursday, August 27, 2015 at 7:29:00 AM UTC-4, Nils Gudat wrote:
>
> Might be in relation to this thread 
> <https://groups.google.com/forum/#!msg/julia-users/FjGXSTzvfmc/j0ZDG629IwAJ> 
> - I've ported some code from 0.3.11 to 0.4, but when trying to run it in 
> parallel I encounter all kinds of issues. 
>

if you do "using Foo" then it imports the module on all the workers.  If 
you do "@everywhere using Foo" then it imports it twice, hence the warnings.

Solution: do "import Foo" only on node 1 (i.e. outside of @everywhere), 
which imports Foo everywhere (once), and then it is safe to do "@everywhere 
using Foo" (since using a module that has already been imported does not 
re-import it, it just puts the exported names into the namespace).

I think the same thing happened in 0.3, but there was no warning about the 
double import.

See also: https://github.com/JuliaLang/julia/issues/12381

Reply via email to