Skip to content

Commit

Permalink
Remove temporary main timings
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Jul 25, 2022
1 parent 2b9317d commit acf7481
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions test/Operators/finitedifference/column_benchmark_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,16 @@ bcs_tested(c, ::typeof(op_divgrad_uₕ!)) =
# (; inner = (), outer = set_value_divgrad_uₕ_field_bcs(c)), # TODO: add once working
)

function benchmark_func!(t_main, t_ave, trials, fun, c, f, verbose = false)
function benchmark_func!(t_ave, trials, fun, c, f, verbose = false)
for bcs in bcs_tested(c, fun)
key = (fun, bc_name(bcs)...)
verbose && @info "\n@benchmarking $key"
trials[key] = BenchmarkTools.@benchmark $fun($c, $f, $bcs)
verbose && show(stdout, MIME("text/plain"), trials[key])

t_ave[key] = StatsBase.mean(trials[key].times) # nano seconds
Δpercent = trunc((t_ave[key] - t_main[key]) / t_main[key] * 100, digits=1)
t_pretty = BenchmarkTools.prettytime(t_ave[key])
verbose || @info "$t_pretty (Δ%=$Δpercent) <=> t_ave[$key]"
verbose || @info "$t_pretty <=> t_ave[$key]"
end
end

Expand Down Expand Up @@ -317,37 +316,9 @@ function benchmark_cases(vars_contig, cfield, ffield)

trials = OrderedCollections.OrderedDict()
t_ave = OrderedCollections.OrderedDict()
t_main = OrderedCollections.OrderedDict() # nano seconds
t_main[(op_GradientF2C!, :none)] = 19.013*10^3
t_main[(op_GradientF2C!, :SetValue, :SetValue)] = 18.065*10^3
t_main[(op_GradientC2F!, :SetGradient, :SetGradient)] = 16.175*10^3
t_main[(op_GradientC2F!, :SetValue, :SetValue)] = 15.908*10^3
t_main[(op_DivergenceF2C!, :none)] = 42.647*10^3
t_main[(op_DivergenceF2C!, :Extrapolate, :Extrapolate)] = 43.815*10^3
t_main[(op_DivergenceC2F!, :SetDivergence, :SetDivergence)] = 40.800*10^3
t_main[(op_InterpolateF2C!, :none)] = 17.671*10^3
t_main[(op_InterpolateC2F!, :SetValue, :SetValue)] = 15.024*10^3
t_main[(op_InterpolateC2F!, :Extrapolate, :Extrapolate)] = 15.074*10^3
t_main[(op_LeftBiasedC2F!, :SetValue)] = 11.058*10^3
t_main[(op_LeftBiasedF2C!, :none)] = 11.272*10^3
t_main[(op_LeftBiasedF2C!, :SetValue)] = 10.134*10^3
t_main[(op_RightBiasedC2F!, :SetValue)] = 10.873*10^3
t_main[(op_RightBiasedF2C!, :none)] = 10.406*10^3
t_main[(op_RightBiasedF2C!, :SetValue)] = 10.386*10^3
t_main[(op_CurlC2F!, :SetCurl, :SetCurl)] = 24.964*10^3
t_main[(op_CurlC2F!, :SetValue, :SetValue)] = 25.119*10^3
t_main[(op_UpwindBiasedProductC2F!, :SetValue, :SetValue)] = 33.363*10^3
t_main[(op_UpwindBiasedProductC2F!, :Extrapolate, :Extrapolate)] = 31.069*10^3
t_main[(op_divUpwind3rdOrderBiasedProductC2F!, :ThirdOrderOneSided, :ThirdOrderOneSided, :SetValue, :SetValue)] = 90.148*10^3
t_main[(op_divgrad_CC!, :SetValue, :SetValue, :none)] = 39.233*10^3
t_main[(op_divgrad_FF!, :none, :SetDivergence, :SetDivergence)] = 40.171*10^3
t_main[(op_div_interp_CC!, :SetValue, :SetValue, :none)] = 38.492*10^3
t_main[(op_div_interp_FF!, :none, :SetValue, :SetValue)] = 39.172*10^3
t_main[(op_divgrad_uₕ!, :none, :SetValue, :Extrapolate)] = 69.046*10^3

@info "Benchmarking operators, this may take a minute or two..."
for op in ops
benchmark_func!(t_main, t_ave, trials, op, cfield, ffield, #= verbose = =# false)
benchmark_func!(t_ave, trials, op, cfield, ffield, #= verbose = =# false)
end

@test t_ave[(op_GradientF2C!, :none)] < 500
Expand Down

0 comments on commit acf7481

Please sign in to comment.