diff --git a/scripts/run_experiments.jl b/scripts/run_experiments.jl index 148cf5549408a901b9b0abb24f7b0c626451d9fe..1c4fb44563630b2ae9e46e3bea0f29ccbae7b811 100644 --- a/scripts/run_experiments.jl +++ b/scripts/run_experiments.jl @@ -1,13 +1,10 @@ # experiments +using Distributed using Random: MersenneTwister using LinearAlgebra: Diagonal, I, dot, norm, mul!, diagm using Statistics: median -using CSV -using Colors: HSV -using DataFrames -using Distributed @everywhere using DualTVDD @everywhere using DualTVDD: DualTVL1ROFOpProblem, @@ -15,6 +12,10 @@ using Distributed SurrogateAlgorithm, DualTVDDSurrogateAlgorithm, init, step!, fetch, fetch_u, gradient, divergence, normB, energy, residual + +using CSV +using Colors: HSV +using DataFrames using DualTVDD: fetch_u using FFTW using FileIO @@ -270,10 +271,11 @@ function experiment_scaling_opticalflow(ctx) λ = 0.01 β = 0.001 - ninner = 300 - Mdir = 2 * floor(Int, sqrt(nworkers())) # to have enough workers available - M = (Mdir, Mdir) - overlap = (5, 5) + ninner = 500 + #Mdir = 2 * floor(Int, sqrt(nworkers())) # to have enough workers available + Mdir = nworkers() + M = (4, Mdir) + overlap = (10, 10) stopenergy = 130. ntimings = 3 @@ -298,6 +300,7 @@ function experiment_scaling_opticalflow(ctx) tg = timeit(galg) + # divide by 2^2 due to coloring nparallel = prod(M) ÷ 2^2 ws = workers() @assert nparallel <= length(ws) @@ -315,7 +318,7 @@ function experiment_scaling_opticalflow(ctx) CSV.write(joinpath(ctx.outdir, "timings.csv"), df) savedata(joinpath(ctx.outdir, "data.tex"); - lambda=λ, beta=β, Mdir, M=prod(M), + lambda=λ, beta=β, M1=M[1], M2=M[2], M=prod(M), ntimings, stopenergy, ninner, width=size(fo, 2), height=size(fo, 1)) end diff --git a/scripts/run_parallel_scaling.jl b/scripts/run_parallel_scaling.jl new file mode 100644 index 0000000000000000000000000000000000000000..626617977a0ff188de831d5ec798c1dcb6fb20f3 --- /dev/null +++ b/scripts/run_parallel_scaling.jl @@ -0,0 +1,20 @@ +# do not use a startup file: `julia --startup-file=no` +# otherwise precompilation will be done over and over again + +using Pkg +Pkg.activate(@__DIR__) +Pkg.instantiate() + +using Distributed +addprocs(8) + +@everywhere using Pkg +@everywhere Pkg.activate(@__DIR__) +@everywhere Pkg.instantiate() + +@everywhere using Revise +includet(joinpath(@__DIR__, "run_experiments.jl")) + +const datapath = joinpath(@__DIR__, "..", "..", "data") +ctx = Util.Context(datapath) +ctx(experiment_scaling_opticalflow, "fd/scaling/opticalflow")