Can't import a package on remote workers

question

#1

Hi,
I’m trying to set up remote workers in my desktop, so I can use it from my laptop.
I could connect to remote workers by addprocs(), but I couldn’t import a package.

julia> addprocs([("wonjin@xxx.xxx.xxx", 4)], dir="C:/Users/wonjin", 
exename="C:/Users/wonjin/AppData/Local/Julia-0.5.0/bin/julia.exe", topology=:master_slave)
4-element Array{Int64,1}:
 2
 3
 4
 5

julia> using Roots
WARNING: Node state is inconsistent: node 2 failed to load cache from C:\Users\wonjin\.julia\lib\v0.5\Roots.ji. Got:
WARNING: Module Main uuid did not match cache file.
WARNING: Node state is inconsistent: node 3 failed to load cache from C:\Users\wonjin\.julia\lib\v0.5\Roots.ji. Got:
WARNING: Module Main uuid did not match cache file.
WARNING: Node state is inconsistent: node 4 failed to load cache from C:\Users\wonjin\.julia\lib\v0.5\Roots.ji. Got:
WARNING: Module Main uuid did not match cache file.
WARNING: Node state is inconsistent: node 5 failed to load cache from C:\Users\wonjin\.julia\lib\v0.5\Roots.ji. Got:
WARNING: Module Main uuid did not match cache file.
julia> remotecall_fetch(whos,2)
        From worker 2:                            Base  34483 KB     Module
        From worker 2:                            Core  12682 KB     Module

        From worker 2:                            Main  41310 KB     Module
julia>

So, Roots was not loaded on remote workers.
One weird thing is that I get same error after I uninstall the Roots package in remote desktop.
I found a issue that seems related (#16778), but copying whole julia folder to remote desktop resulted in below error.
Target architecture mismatch. Please delete or regenerate sys.{so,dll,dylib}.


#2

If you are compiling julia yourself and want to run it on multiple machines with different hardware, you need to compile it with MARCH or JULIA_CPU_TARGET (see readme) that’s compatible with both machine.


#3

I solved the problem by downloading and installing Windows executable from Julia website on my laptop and scp it to the desktop.
I think the problem was running include(joinpath(dirname(JULIA_HOME),"share","julia","build_sysimg.jl")); build_sysimg(force=true)
I saw that expression from this blog post.


#4

That command rebuild the sysimg so it is not shared on different machines anymore.


#5

Yes, I understand that. Thanks for your comments.