In v0.7, I got an error when passing SharedArrays as an argument, which is better than having wrong result as in v0.6.2… although I would rather see a nice ArgumentError than a “crash” like message.
julia> using SharedArrays, Distributed
julia> A = SharedArray(rand(10,10));
julia> addprocs(2)
2-element Array{Int64,1}:
2
3
julia> sum(A)
51.45023448191144
julia> remotecall_fetch(sum, 2, A)
ERROR: On worker 2:
BoundsError: attempt to access 0×0 Array{Float64,2} at index [1]
getindex at ./array.jl:646 [inlined]
getindex at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/site/v0.7/SharedArrays/src/SharedArrays.jl:497 [inlined]
mapreduce_impl at ./reduce.jl:188
mapreduce_impl at ./reduce.jl:205 [inlined]
_mapreduce at ./reduce.jl:352 [inlined]
mapreduce at ./reduce.jl:358 [inlined]
sum at ./reduce.jl:437 [inlined]
sum at ./reduce.jl:453
#121 at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/site/v0.7/Distributed/src/process_messages.jl:269
run_work_thunk at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/site/v0.7/Distributed/src/process_messages.jl:56
macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/site/v0.7/Distributed/src/process_messages.jl:269 [inlined]
#120 at ./event.jl:92
Stacktrace:
[1] #remotecall_fetch#159(::Base.Iterators.IndexValue{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Distributed.Worker, ::SharedArray{Float64,2}, ::Vararg{SharedArray{Float64,2},N} where N) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/site/v0.7/Distributed/src/remotecall.jl:374
[2] remotecall_fetch(::Function, ::Distributed.Worker, ::SharedArray{Float64,2}, ::Vararg{SharedArray{Float64,2},N} where N) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/site/v0.7/Distributed/src/remotecall.jl:366
[3] #remotecall_fetch#162(::Base.Iterators.IndexValue{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Int64, ::SharedArray{Float64,2}, ::Vararg{SharedArray{Float64,2},N} where N) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/site/v0.7/Distributed/src/remotecall.jl:387
[4] remotecall_fetch(::Function, ::Int64, ::SharedArray{Float64,2}, ::Vararg{SharedArray{Float64,2},N} where N) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/site/v0.7/Distributed/src/remotecall.jl:387
[5] top-level scope
julia> versioninfo()
Julia Version 0.7.0-DEV.3396
Commit 4f43bf7480 (2018-01-13 19:38 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin14.5.0)
CPU: Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, haswell)
Environment: