Skip to content

Commit

Permalink
Merge pull request #289 from CliMA/ck/optional_step
Browse files Browse the repository at this point in the history
Make step trial optional
  • Loading branch information
charleskawczynski authored May 16, 2024
2 parents 6822697 + 01277ca commit 3fbf0d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion ext/ClimaTimeSteppersBenchmarkToolsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions ext/benchmark_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down

2 comments on commit 3fbf0d3

@charleskawczynski
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/106991

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.28 -m "<description of version>" 3fbf0d34c826d932e5df81a1407b46b03b5e1bec
git push origin v0.7.28

Please sign in to comment.