Skip to content

Commit 3fbf0d3

Browse files
Merge pull request #289 from CliMA/ck/optional_step
Make step trial optional
2 parents 6822697 + 01277ca commit 3fbf0d3

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ClimaTimeSteppers"
22
uuid = "595c0a79-7f3d-439a-bc5a-b232dc3bde79"
33
authors = ["Climate Modeling Alliance"]
4-
version = "0.7.27"
4+
version = "0.7.28"
55

66
[deps]
77
ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d"

ext/ClimaTimeSteppersBenchmarkToolsExt.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ function CTS.benchmark_step(
120120
table_summary = OrderedCollections.OrderedDict()
121121
for k in keys(trials)
122122
isnothing(trials[k]) && continue
123-
table_summary[k] = get_summary(trials[k], trials["step!"])
123+
trial_step = haskey(trials, "step!") ? trials["step!"] : nothing
124+
table_summary[k] = get_summary(trials[k], trial_step)
124125
end
125126

126127
if !isnothing(only)

ext/benchmark_utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
##### BenchmarkTools's trial utils
33
#####
44

5-
get_summary(trial, trial_step) = (;
5+
get_summary(trial, trial_step = nothing) = (;
66
# Using some BenchmarkTools internals :/
77
mem = BenchmarkTools.prettymemory(trial.memory),
88
mem_val = trial.memory,
@@ -13,7 +13,7 @@ get_summary(trial, trial_step) = (;
1313
t_mean_val = StatsBase.mean(trial.times),
1414
t_med = BenchmarkTools.prettytime(StatsBase.median(trial.times)),
1515
n_samples = length(trial),
16-
percentage = minimum(trial.times) / minimum(trial_step.times) * 100,
16+
percentage = isnothing(trial_step) ? -1 : minimum(trial.times) / minimum(trial_step.times) * 100,
1717
)
1818

1919
function tabulate_summary(summary; n_calls_per_step)

0 commit comments

Comments
 (0)