I’m trying to learn how to use SharedArray properly.
Let’s say I have a Dict (or anything that holds SharedArray’s)
d = Dict(
:a => SharedArray{Float64}(rand(1000)),
:b => SharedArray{Float64}(rand(1000))
)
I understand that the workers would not have a reference to d
and therefore I could create functions that operates on d
by passing it as in an argument e.g.
@everywhere sum_a(d) = sum(d[:a])
Now, when I call this function remotely, am I passing just the references not the entire structure given the argument contains SharedArray not regular arrays? I hope the answer is yes…
fetch(@spawnat 2 sum_a(d))