julia> using Distributed
julia> addprocs(2);
julia> @everywhere a = [1,2]
julia> @everywhere println(a)
[1, 2]
From worker 3: [1, 2]
From worker 2: [1, 2]
julia> a = 5
5
julia> @everywhere println(a)
5
From worker 2: [1, 2]
From worker 3: [1, 2]
julia> @fetchfrom 3 a[2]
ERROR: On worker 3:
BoundsError
Stacktrace:
julia> @everywhere println(a)
5
From worker 2: [1, 2]
From worker 3: 5
this above behavior is weird, how do I access the a
on the remote?
My real use case is if I have a @distributed
for loop, how can I ask Julia NOT to use my local (main process) variable in the body of the loop?