I was wondering if it was possible to spawn shared arrays on remote
machines.
*julia> S = SharedArray(Int, (3,4), init = S -> S[localindexes(S)] =
myid(), pids=Int[1,2])*
*3x4 SharedArray{Int64,2}: 1 1 2 2 1 1 2 2 1 1 2 2*
*julia> remotecall_fetch(readall, 6, `hostname`)**"mrc-bsu-tesla4\n"*
*julia> remotecall_fetch(readall, 7, `hostname`)**"mrc-bsu-tesla4\n"*
*julia> r = @spawnat 6 S = SharedArray(Int, (3,4), init = S ->
S[localindexes(S)] = myid(), pids=Int[6,7])*
*RemoteRef{Channel{Any}}(6,1,526)*
*julia> fetch(r)*
*3x4 SharedArray{Int64,2}: #undef #undef #undef #undef #undef #undef
#undef #undef #undef #undef #undef #undef*
Am I simply trying the wrong thing, or am I missing something deeper?
I thought the error might be from trying to access memory on another
process in some unusual way, but:
*julia> r = @spawnat 6 S*eye(4)*
*RemoteRef{Channel{Any}}(6,1,542)*
*julia> fetch(r)*
*ERROR: On worker 6:UndefRefError: access to undefined reference*
To me this looks like the SharedArray being undefined even from the
perspective of process 6.
Cheers,
Matthew