-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
76 additions
and
43 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
*.png | ||
*.svg | ||
*.nc | ||
*.html | ||
|
||
# Docs | ||
!docs/src/assets/*.svg | ||
|
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 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,46 @@ | ||
import Thermodynamics | ||
import RootSolvers | ||
import ClimaParams | ||
import ReportMetrics | ||
import Profile, ProfileCanvas | ||
|
||
dirs_to_monitor = | ||
[".", pkgdir(Thermodynamics), pkgdir(RootSolvers), pkgdir(ClimaParams)] | ||
include("common.jl") | ||
output_dir = joinpath(pkgdir(Thermodynamics), "perf", "allocations_output") | ||
mkpath(output_dir) | ||
thermo_state_ρeq(param_set, ρ, e_int, q_tot) | ||
Profile.Allocs.clear() | ||
Profile.Allocs.@profile sample_rate = 1 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) | ||
|
||
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_pθq(param_set, p, θ_liq_ice, q_tot) | ||
Profile.Allocs.clear() | ||
Profile.Allocs.@profile sample_rate = 1 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 = 1 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
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