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

disable coloring for parallel version

parent e9420a5b
Branches
Tags
No related merge requests found
...@@ -68,10 +68,11 @@ function init(alg::DualTVDDAlgorithm{<:DualTVL1ROFOpProblem}) ...@@ -68,10 +68,11 @@ function init(alg::DualTVDDAlgorithm{<:DualTVL1ROFOpProblem})
# global dual variable # global dual variable
p = zeros(p1type(eltype(g)), ax) p = zeros(p1type(eltype(g)), ax)
# local dual variable # local dual variable
subp = [zeros(p1type(eltype(g)), sax) for sax in subax] subp = [zeros(p1type(eltype(g)), length.(sax)) for sax in subax]
# create subproblem contexts # create subproblem contexts
cids = chessboard_coloring(size(subax)) cids = alg.parallel ? [eachindex(subax)] :
chessboard_coloring(size(subax))
cons = Array{Connector, d}(undef, size(subax)) cons = Array{Connector, d}(undef, size(subax))
for (color, sidxs) in enumerate(cids) for (color, sidxs) in enumerate(cids)
for (i, sidx) in enumerate(sidxs) for (i, sidx) in enumerate(sidxs)
...@@ -117,7 +118,7 @@ function subworker(alg, subalg) ...@@ -117,7 +118,7 @@ function subworker(alg, subalg)
subg = take!(con) subg = take!(con)
subalg.problem.g .= subg subalg.problem.g .= subg
# run algorithm # run algorithm
for _ in 1:1000 for _ in 1:ninner
step!(subst) step!(subst)
end end
# write result # write result
...@@ -139,7 +140,8 @@ function step!(ctx::DualTVDDState) ...@@ -139,7 +140,8 @@ function step!(ctx::DualTVDDState)
p_don = zeros(eltype(ctx.p), size(ctx.p)) p_don = zeros(eltype(ctx.p), size(ctx.p))
# subdomain loop (in coloring order) # subdomain loop (in coloring order)
cids = chessboard_coloring(size(ctx.subax)) cids = alg.parallel ? [eachindex(ctx.subax)] :
chessboard_coloring(size(ctx.subax))
for (color, ids) in enumerate(cids) for (color, ids) in enumerate(cids)
for i in ids for i in ids
sax = ctx.subax[i] sax = ctx.subax[i]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment