Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/remotecall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ function serialize(s::AbstractSerializer, ::Future)
invoke(serialize, Tuple{AbstractSerializer, Any}, s, zero_fut)
end

function serialize(s::AbstractSerializer, ::RemoteChannel)
zero_rc = RemoteChannel{Channel{Any}}((0,0,0))
function serialize(s::AbstractSerializer, ::RemoteChannel{T}) where T
zero_rc = RemoteChannel{T}((0,0,0))
invoke(serialize, Tuple{AbstractSerializer, Any}, s, zero_rc)
end

Expand Down
8 changes: 6 additions & 2 deletions test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,12 @@ test_indexing(RemoteChannel(id_other))
# Test ser/deser to non-ClusterSerializer objects.
function test_regular_io_ser(ref::Distributed.AbstractRemoteRef)
io = IOBuffer()
serialize(io, ref)
# Wrapping the ref in a Dict to exercise the case when the the
# type parameter of the RemoteChannel is part of an outer type.
# See #178
serialize(io, Dict("ref" => ref))
seekstart(io)
ref2 = deserialize(io)
ref2 = deserialize(io)["ref"]
for fld in fieldnames(typeof(ref))
v = getfield(ref2, fld)
if isa(v, Number)
Expand All @@ -365,6 +368,7 @@ end

test_regular_io_ser(Future())
test_regular_io_ser(RemoteChannel())
test_regular_io_ser(RemoteChannel(() -> Channel{Bool}(1)))

# Test @distributed load balancing - all processors should get either M or M+1
# iterations out of the loop range for some M.
Expand Down