Skip to content

Commit 55f50d0

Browse files
committed
pmapsum working
1 parent 5a921c5 commit 55f50d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ParallelUtilities.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,13 @@ function pmapsum(f::Function,iterable,args...;kwargs...)
240240

241241
futures = pmap_onebatch_per_worker(f,iterable,args...;kwargs...)
242242

243-
# final sum to be run on the first worker
244243
function final_sum(futures)
245244
s = fetch(first(futures))
246245
@sync for f in futures[2:end]
247-
@async s += fetch(f)
246+
@async begin
247+
t_i = fetch(f)
248+
s += t_i
249+
end
248250
end
249251
return s
250252
end

0 commit comments

Comments
 (0)