Skip to content
Snippets Groups Projects
Commit 671c2dff authored by Stephan Hilb's avatar Stephan Hilb
Browse files

issue work in nworkers()-sized batches

parent bc76b4ef
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,8 @@ function step!(ctx::DualTVDDState)
cids = alg.parallel ? [eachindex(ctx.subax)] :
chessboard_coloring(size(ctx.subax))
for (color, ids) in enumerate(cids)
for i in ids
for pids in Iterators.partition(ids, length(alg.workers))
for i in pids
sax = ctx.subax[i]
# update remaining old contribution
......@@ -166,7 +167,7 @@ function step!(ctx::DualTVDDState)
# start computation
put!(ctx.cons[i], sg)
end
for i in ids
for i in pids
sax = ctx.subax[i]
sp = take!(ctx.cons[i])
......@@ -176,6 +177,7 @@ function step!(ctx::DualTVDDState)
(1 .- σ) .* theta.(Ref(ax), Ref(sax), Ref(overlap), CartesianIndices(sax)) .* view(ctx.p, sax...) .+ σ .* sp
end
end
end
ctx.p .= p_don
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment