I am trying to run this example but I get the following:
julia> remotes = addprocs([("user@remote_host", 4)])
4-element Array{Int64,1}:
2
3
4
5
julia> S = SharedArray{Int}((3,4), init = S -> S[localindexes(S)] = myid(), pids=remotes)
3×4 SharedArray{Int64,2}:
2 3 4 5
2 3 4 5
2 3 4 5
julia> procs(S)
4-element Array{Int64,1}:
2
3
4
5
julia> r = @spawnat remotes[1] S*eye(4)
ERROR: BoundsError: attempt to access 0×0 Array{Int64,2} at index [1]
Stacktrace:
[1] hash(::SharedArray{Int64,2}, ::UInt64) at ./abstractarray.jl:1950
[2] hash(::SharedArray{Int64,2}) at ./hashing.jl:5
[3] serialize_global_from_main(::Base.Distributed.ClusterSerializer{TCPSocket}, ::Symbol) at ./distributed/clusterserialize.jl:145
[4] foreach(::Base.Distributed.##4#6{Base.Distributed.ClusterSerializer{TCPSocket}}, ::Array{Symbol,1}) at ./abstractarray.jl:1731
[5] serialize(::Base.Distributed.ClusterSerializer{TCPSocket}, ::TypeName) at ./distributed/clusterserialize.jl:83
[6] serialize_type_data(::Base.Distributed.ClusterSerializer{TCPSocket}, ::DataType) at ./serialize.jl:511
[7] serialize_type(::Base.Distributed.ClusterSerializer{TCPSocket}, ::DataType, ::Bool) at ./serialize.jl:554
[8] serialize_any(::Base.Distributed.ClusterSerializer{TCPSocket}, ::Any) at ./serialize.jl:615
[9] serialize_msg(::Base.Distributed.ClusterSerializer{TCPSocket}, ::Base.Distributed.CallMsg{:call}) at ./distributed/messages.jl:89
[10] send_msg_(::Base.Distributed.Worker, ::Base.Distributed.MsgHeader, ::Base.Distributed.CallMsg{:call}, ::Bool) at ./distributed/messages.jl:181
[11] #remotecall#138 at ./distributed/remotecall.jl:325 [inlined]
[12] remotecall(::Function, ::Base.Distributed.Worker) at ./distributed/remotecall.jl:324
[13] #remotecall#139(::Array{Any,1}, ::Function, ::Function, ::Int64) at ./distributed/remotecall.jl:336
[14] spawnat(::Int64, ::Function) at ./distributed/macros.jl:15
What am I doing wrong here?