Consider the following simple example:
using HDF5, JLD
addprocs(2)
# create and save the shared array
a = SharedArray(Int64, 100)
save("example.jld", "a", a)
# clear the shared array...
a = nothing
# load what we saved...
a = load("example.jld")["a"]
# try to use it...
@parallel for i in 1:length(a)
a[i] = i
end
# Now its filled with zeros, as if it were a normal array.
@show a
So two issues here:
1) is there a way to "reassign" a shared array to processes? This seems
useful when adding/removing procs
2) JLD should use the shared array constructor, I'm not sure how it
constructs the array now. Should I open an issue?
Thanks!