-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]
Description
i can reshape a SharedArray on the master process, but not workers. i get no errors on workers when getting the size or sum of a SharedArray. so reshape seems to be broken. or does my mental model of how they're supposed to work need corrected?
julia> using Distributed
julia> addprocs(3)
3-element Array{Int64,1}:
2
3
4
julia> using SharedArrays
julia> s=SharedArray{UInt16}(48,48,48,3);
julia> reshape(s,(1,size(s)...));
julia> f = @spawnat 2 reshape(s,(1,size(s)...))
Future(2, 1, 16, nothing)
julia> fetch(f)
ERROR: On worker 2:
MethodError: Cannot `convert` an object of type RemoteException to an object of type Array{UInt16,5}
Closest candidates are:
convert(::Type{T<:Array}, ::AbstractArray) where T<:Array at array.jl:418
convert(::Type{T<:AbstractArray}, ::T<:AbstractArray) where T<:AbstractArray at abstractarray.jl:14
convert(::Type{T<:AbstractArray}, ::LinearAlgebra.Factorization) where T<:AbstractArray at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/LinearAlgebra/src/factorization.jl:51
...
setproperty! at ./sysimg.jl:11
init_loc_flds at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/SharedArrays/src/SharedArrays.jl:419
init_loc_flds at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/SharedArrays/src/SharedArrays.jl:411 [inlined]
reshape at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/SharedArrays/src/SharedArrays.jl:301
#5 at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/Distributed/src/macros.jl:66
#117 at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/Distributed/src/process_messages.jl:265
run_work_thunk at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/Distributed/src/process_messages.jl:56
run_work_thunk at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/Distributed/src/process_messages.jl:65
#110 at ./event.jl:92
Stacktrace:
[1] #remotecall_fetch#157(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Distributed.Worker, ::Distributed.RRID, ::Vararg{Any,N} where N) at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/Distributed/src/remotecall.jl:379
[2] remotecall_fetch(::Function, ::Distributed.Worker, ::Distributed.RRID, ::Vararg{Distributed.RRID,N} where N) at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/Distributed/src/remotecall.jl:371
[3] #remotecall_fetch#160(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Int64, ::Distributed.RRID, ::Vararg{Distributed.RRID,N} where N) at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/Distributed/src/remotecall.jl:392
[4] remotecall_fetch at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/Distributed/src/remotecall.jl:392 [inlined]
[5] call_on_owner at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/Distributed/src/remotecall.jl:465 [inlined]
[6] fetch(::Future) at /Users/arthurb/src/julia/usr/share/julia/site/v0.7/Distributed/src/remotecall.jl:497
[7] top-level scope
julia> s.pids
3-element Array{Int64,1}:
2
3
4
julia> f = @spawnat 2 size(s)
Future(2, 1, 20, nothing)
julia> fetch(f)
(48, 48, 48, 3)
julia> f = @spawnat 2 sum(s)
Future(2, 1, 22, nothing)
julia> fetch(f)
0x0000000000000000
this is on a 0-day master and 0.6.2. thanks!
Metadata
Metadata
Assignees
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]