Skip to content

Commit

Permalink
Asynchronously gather parts
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi committed Aug 8, 2016
1 parent d32c780 commit 888b4a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/basics/data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ parts(x::Cat) = x.parts
persist!(x::Cat) = (for p in parts(x); persist!(p); end)

function gather(ctx, part::Cat)
cat_data(parttype(part), part.domain, map(c->(gather(ctx,c)), parts(part)))
ps_input = parts(part)
ps = Array(parttype(part), size(ps_input))
@sync for i in 1:length(ps_input)
@async ps[i] = gather(ctx, ps_input[i])
end
cat_data(parttype(part), part.domain, ps)
end

"""
Expand Down

0 comments on commit 888b4a1

Please sign in to comment.