Skip to content

Commit

Permalink
Merge pull request #286 from CliMA/ck/nocrop_prof
Browse files Browse the repository at this point in the history
Add option to not crop table
  • Loading branch information
charleskawczynski authored May 14, 2024
2 parents 5cbfa42 + f7ce318 commit cf71922
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 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.25"
version = "0.7.26"

[deps]
ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d"
Expand Down
19 changes: 10 additions & 9 deletions ext/ClimaTimeSteppersBenchmarkToolsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function CTS.benchmark_step(
device::ClimaComms.AbstractDevice;
with_cu_prof = :bprofile,
trace = false,
crop = false,
)
(; u, p, t, dt, sol, alg) = integrator
(; f) = sol.prob
Expand All @@ -66,15 +67,15 @@ function CTS.benchmark_step(
trials₀ = OrderedCollections.OrderedDict()

#! format: off
trials₀["Wfact"] = get_trial(wfact_fun(integrator), (W, u, p, dt, t), "Wfact", device; with_cu_prof, trace);
trials₀["ldiv!"] = get_trial(LA.ldiv!, (X, W, u), "ldiv!", device; with_cu_prof, trace);
trials₀["T_imp!"] = get_trial(implicit_fun(integrator), implicit_args(integrator), "T_imp!", device; with_cu_prof, trace);
trials₀["T_exp_T_lim!"] = get_trial(remaining_fun(integrator), remaining_args(integrator), "T_exp_T_lim!", device; with_cu_prof, trace);
trials₀["lim!"] = get_trial(f.lim!, (Xlim, p, t, u), "lim!", device; with_cu_prof, trace);
trials₀["dss!"] = get_trial(f.dss!, (u, p, t), "dss!", device; with_cu_prof, trace);
trials₀["post_explicit!"] = get_trial(f.post_explicit!, (u, p, t), "post_explicit!", device; with_cu_prof, trace);
trials₀["post_implicit!"] = get_trial(f.post_implicit!, (u, p, t), "post_implicit!", device; with_cu_prof, trace);
trials₀["step!"] = get_trial(SciMLBase.step!, (integrator, ), "step!", device; with_cu_prof, trace);
trials₀["Wfact"] = get_trial(wfact_fun(integrator), (W, u, p, dt, t), "Wfact", device; with_cu_prof, trace, crop);
trials₀["ldiv!"] = get_trial(LA.ldiv!, (X, W, u), "ldiv!", device; with_cu_prof, trace, crop);
trials₀["T_imp!"] = get_trial(implicit_fun(integrator), implicit_args(integrator), "T_imp!", device; with_cu_prof, trace, crop);
trials₀["T_exp_T_lim!"] = get_trial(remaining_fun(integrator), remaining_args(integrator), "T_exp_T_lim!", device; with_cu_prof, trace, crop);
trials₀["lim!"] = get_trial(f.lim!, (Xlim, p, t, u), "lim!", device; with_cu_prof, trace, crop);
trials₀["dss!"] = get_trial(f.dss!, (u, p, t), "dss!", device; with_cu_prof, trace, crop);
trials₀["post_explicit!"] = get_trial(f.post_explicit!, (u, p, t), "post_explicit!", device; with_cu_prof, trace, crop);
trials₀["post_implicit!"] = get_trial(f.post_implicit!, (u, p, t), "post_implicit!", device; with_cu_prof, trace, crop);
trials₀["step!"] = get_trial(SciMLBase.step!, (integrator, ), "step!", device; with_cu_prof, trace, crop);
#! format: on

trials = OrderedCollections.OrderedDict()
Expand Down
8 changes: 5 additions & 3 deletions ext/benchmark_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ function tabulate_summary(summary; n_calls_per_step)
)
end

get_trial(f::Nothing, args, name, device; with_cu_prof = :bprofile, trace = false) = nothing
function get_trial(f, args, name, device; with_cu_prof = :bprofile, trace = false)
get_trial(f::Nothing, args, name, device; with_cu_prof = :bprofile, trace = false, crop = false) = nothing
function get_trial(f, args, name, device; with_cu_prof = :bprofile, trace = false, crop = false)
f(args...) # compile first
b = if device isa ClimaComms.CUDADevice
BenchmarkTools.@benchmarkable CUDA.@sync $f($(args)...)
Expand All @@ -65,7 +65,9 @@ function get_trial(f, args, name, device; with_cu_prof = :bprofile, trace = fals
else
CUDA.@profile trace = trace f(args...)
end
println(p)
io = IOContext(stdout, :crop => crop)
show(io, p)
println()
end
println()
return trial
Expand Down

2 comments on commit cf71922

@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/106767

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.26 -m "<description of version>" cf719221a2b7eeb191b3fd0697bd79ceaaaf67dd
git push origin v0.7.26

Please sign in to comment.