Skip to content

Commit

Permalink
Merge pull request #10103 from amitmurthy/amitm/distribute
Browse files Browse the repository at this point in the history
ensure proper initialization in distribute()
  • Loading branch information
amitmurthy committed Feb 7, 2015
2 parents 456b85a + 6861489 commit 49a1f2e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion base/darray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,15 @@ function distribute(a::AbstractArray)
owner = myid()
rr = RemoteRef()
put!(rr, a)
DArray(size(a)) do I
d = DArray(size(a)) do I
remotecall_fetch(owner, ()->fetch(rr)[I...])
end
# Ensure that all workers have fetched their localparts.
# Else a gc in between can recover the RemoteRef rr
for chunk in d.chunks
wait(chunk)
end
d
end

function convert{S,T,N}(::Type{Array{S,N}}, d::DArray{T,N})
Expand Down

0 comments on commit 49a1f2e

Please sign in to comment.