I'm using a large number of shared arrays and storing their references in a 
dictionary. I've noticed when I end up having to do a remotecall on all the 
workers that just passing around the references is pretty slow. In the 
example below it generally takes between 1/2 to a full second to finish all 
the remotecalls on 7 workers. I'm using Julia version 0.4.1 and CentOS 7.

addprocs(7)

@everywhere function 
test_shared(i::Dict{Tuple{Int64,Int64},SharedArray{Float64}}) 
println("test_shared $(myid()) time: $(Dates.unix2datetime(time()))") 
end

function main()
b = Dict{Tuple{Int64,Int64},SharedArray{Float64}}()

for x = 1:3
for y=1:300
b[x,y]=SharedArray(Float64, 1, init=zeros(Float64, 1))
end
end

for x = 1:nprocs()
if x != myid()
@time remotecall(x,test_shared,b)
end
end
end

main()
sleep(2)
main()
sleep(2)

Reply via email to