Skip to content

Commit

Permalink
Send pids instead of ctx to collect_remote
Browse files Browse the repository at this point in the history
  • Loading branch information
DrChainsaw committed Sep 30, 2020
1 parent 42124a7 commit 4fd021b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/chunks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ function unrelease(c::Chunk{<:Any,DRef})
end
unrelease(c::Chunk) = c

collect_remote(ctx, chunk::Chunk) =
move(ctx, chunk.processor, OSProc(), poolget(chunk.handle))
collect_remote(pids, chunk::Chunk) =
move(Context(pids), chunk.processor, OSProc(), poolget(chunk.handle))
function collect(ctx::Context, chunk::Chunk; options=nothing)
# delegate fetching to handle by default.
if chunk.handle isa DRef && !(chunk.processor isa OSProc)
return remotecall_fetch(collect_remote, chunk.handle.owner, ctx, chunk)
pids = map(p -> p.pid, filter(p -> p isa OSProc, procs(ctx)))
return remotecall_fetch(collect_remote, chunk.handle.owner, pids, chunk)
elseif chunk.handle isa FileRef
return poolget(chunk.handle)
else
Expand Down

0 comments on commit 4fd021b

Please sign in to comment.