-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8587938
commit eba00e2
Showing
4 changed files
with
73 additions
and
41 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,45 @@ | ||
import Thermodynamics | ||
import RootSolvers | ||
import ClimaParams | ||
import ReportMetrics | ||
import Profile, ProfileCanvas | ||
|
||
dirs_to_monitor = | ||
[".", pkgdir(Thermodynamics), pkgdir(RootSolvers), pkgdir(ClimaParams)] | ||
include("common.jl") | ||
|
||
for constructor in ["ρeq", "pθq", "pTq"] | ||
ENV["ALLOCATION_CONSTRUCTOR"] = constructor | ||
ReportMetrics.report_allocs(; | ||
job_name = constructor, | ||
run_cmd = `$(Base.julia_cmd()) --project=perf/ --track-allocation=all perf/alloc_per_constructor.jl`, | ||
dirs_to_monitor = dirs_to_monitor, | ||
process_filename = x -> last(split(x, "packages/")), | ||
) | ||
end | ||
thermo_state_ρeq(param_set, ρ, e_int, q_tot) | ||
Profile.Allocs.clear() | ||
Profile.Allocs.@profile sample_rate = sampling_rate thermo_state_ρeq( | ||
param_set, | ||
ρ, | ||
e_int, | ||
q_tot, | ||
) | ||
results = Profile.Allocs.fetch() | ||
Profile.Allocs.clear() | ||
profile = ProfileCanvas.view_allocs(results) | ||
ProfileCanvas.html_file(joinpath(output_dir, "allocs_ρeq.html"), profile) | ||
|
||
thermo_state_pθq(param_set, p, θ_liq_ice, q_tot) | ||
Profile.Allocs.clear() | ||
Profile.Allocs.@profile sample_rate = sampling_rate thermo_state_pθq( | ||
param_set, | ||
p, | ||
θ_liq_ice, | ||
q_tot, | ||
) | ||
results = Profile.Allocs.fetch() | ||
Profile.Allocs.clear() | ||
profile = ProfileCanvas.view_allocs(results) | ||
ProfileCanvas.html_file(joinpath(output_dir, "allocs_pθq.html"), profile) | ||
|
||
thermo_state_pTq(param_set, p, T, q_tot) | ||
Profile.Allocs.clear() | ||
Profile.Allocs.@profile sample_rate = sampling_rate thermo_state_pTq( | ||
param_set, | ||
p, | ||
T, | ||
q_tot, | ||
) | ||
results = Profile.Allocs.fetch() | ||
Profile.Allocs.clear() | ||
profile = ProfileCanvas.view_allocs(results) | ||
ProfileCanvas.html_file(joinpath(output_dir, "allocs_pTq.html"), profile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters