diff --git a/Project.toml b/Project.toml index 0953c33e..eda9e0fb 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ClimaTimeSteppers" uuid = "595c0a79-7f3d-439a-bc5a-b232dc3bde79" authors = ["Climate Modeling Alliance"] -version = "0.7.27" +version = "0.7.28" [deps] ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d" diff --git a/ext/ClimaTimeSteppersBenchmarkToolsExt.jl b/ext/ClimaTimeSteppersBenchmarkToolsExt.jl index f8f361c2..897f5515 100644 --- a/ext/ClimaTimeSteppersBenchmarkToolsExt.jl +++ b/ext/ClimaTimeSteppersBenchmarkToolsExt.jl @@ -120,7 +120,8 @@ function CTS.benchmark_step( table_summary = OrderedCollections.OrderedDict() for k in keys(trials) isnothing(trials[k]) && continue - table_summary[k] = get_summary(trials[k], trials["step!"]) + trial_step = haskey(trials, "step!") ? trials["step!"] : nothing + table_summary[k] = get_summary(trials[k], trial_step) end if !isnothing(only) diff --git a/ext/benchmark_utils.jl b/ext/benchmark_utils.jl index e26c21bf..bda590f3 100644 --- a/ext/benchmark_utils.jl +++ b/ext/benchmark_utils.jl @@ -2,7 +2,7 @@ ##### BenchmarkTools's trial utils ##### -get_summary(trial, trial_step) = (; +get_summary(trial, trial_step = nothing) = (; # Using some BenchmarkTools internals :/ mem = BenchmarkTools.prettymemory(trial.memory), mem_val = trial.memory, @@ -13,7 +13,7 @@ get_summary(trial, trial_step) = (; t_mean_val = StatsBase.mean(trial.times), t_med = BenchmarkTools.prettytime(StatsBase.median(trial.times)), n_samples = length(trial), - percentage = minimum(trial.times) / minimum(trial_step.times) * 100, + percentage = isnothing(trial_step) ? -1 : minimum(trial.times) / minimum(trial_step.times) * 100, ) function tabulate_summary(summary; n_calls_per_step)