Hello

I am a beginner in Julia and have been trying to build an application in 
it. Although, I am facing a conceptual doubt.

I am working with 4 worker processes on one node.

> addprocs(4)

I define a variable 'a' on all the processes.

julia> @everywhere a=4

Next, I try to modify the value of 'a' at worker#2 

julia> @spawnat 2 a=5
RemoteRef(2,1,16)

julia> fetch(ans)
5

Now, if I print the value of 'a' at all processors, I get :

julia> @everywhere println(a)
4
    From worker 2:    4
    From worker 4:    4
    From worker 5:    4
    From worker 3:    4

Why is the modified value of 'a' not reflected here ? Am I missing 
something in the logic ?

Thanks so much!

Reply via email to