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

fix parallel scaling experiment

parent 754ac5da
No related branches found
No related tags found
No related merge requests found
...@@ -14,4 +14,6 @@ ctx(experiment_surrogate_outerinner_ref, "surrogate/outerinner_ref") ...@@ -14,4 +14,6 @@ ctx(experiment_surrogate_outerinner_ref, "surrogate/outerinner_ref")
ctx(experiment_global_basic, "global/basic") ctx(experiment_global_basic, "global/basic")
# note: run these with multiple worker processes
# don't forget `@everywhere Pkg.activate(".")`
ctx(experiment_scaling_opticalflow, "scaling/opticalflow") ctx(experiment_scaling_opticalflow, "scaling/opticalflow")
...@@ -270,7 +270,7 @@ function experiment_scaling_opticalflow(ctx) ...@@ -270,7 +270,7 @@ function experiment_scaling_opticalflow(ctx)
β = 0.001 β = 0.001
ninner = 300 ninner = 300
Mdir = 2 * floor(Int, sqrt(nworkers())) Mdir = 2 * floor(Int, sqrt(nworkers())) # to have enough workers available
M = (Mdir, Mdir) M = (Mdir, Mdir)
overlap = (5, 5) overlap = (5, 5)
...@@ -301,10 +301,12 @@ function experiment_scaling_opticalflow(ctx) ...@@ -301,10 +301,12 @@ function experiment_scaling_opticalflow(ctx)
tg = timeit(galg) tg = timeit(galg)
nparallel = prod(M) ÷ 2^2
ws = workers() ws = workers()
@assert nparallel <= length(ws)
df = DataFrame() df = DataFrame()
for np in 0:Mdir÷2 for nw in 1:nparallel
nw = 2^np nparallel % nw == 0 || continue
push!(df, ( push!(df, (
nworkers = nw, nworkers = nw,
time = timeit(dalg(ws[1:nw])))) time = timeit(dalg(ws[1:nw]))))
......
...@@ -20,11 +20,12 @@ DualTVL1ROFOpProblem(g, B, λ::Real) = DualTVL1ROFOpProblem(g, B, fill!(similar( ...@@ -20,11 +20,12 @@ DualTVL1ROFOpProblem(g, B, λ::Real) = DualTVL1ROFOpProblem(g, B, fill!(similar(
function energy(p, prob::DualTVL1ROFOpProblem) function energy(p, prob::DualTVL1ROFOpProblem)
d = ndims(p) d = ndims(p)
@inline kfΛ(w) = @inbounds divergence(w) + prob.g[w.position] @inline kfΛ(w) = @inbounds divergence(w)
= Kernel{ntuple(_->-1:1, d)}(kfΛ) = Kernel{ntuple(_->-1:1, d)}(kfΛ)
# v = div(p) + g # v = div(p) + g
v = map(, extend(p, ExtensionNothing())) v = map(, extend(p, ExtensionNothing()))
v .+= prob.g
# |v|_B^2 # |v|_B^2
u = prob.B * vec(v) u = prob.B * vec(v)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment