-
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.
371: Add benchmarks r=charleskawczynski a=charleskawczynski This PR adds some benchmarks. Closes #369. Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
- Loading branch information
Showing
9 changed files
with
142 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
[deps] | ||
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" | ||
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" | ||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" | ||
CLIMAParameters = "6eacf6c3-8458-43b9-ae03-caf5306d3d53" | ||
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" | ||
ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d" | ||
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" | ||
Coverage = "a2441757-f6aa-5fb2-8edb-039e3f45d037" | ||
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" | ||
GaussQuadrature = "d54b0c1a-921d-58e0-8e36-89d8069c0969" | ||
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b" | ||
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" | ||
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab" | ||
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" | ||
Profile = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" | ||
ProfileCanvas = "efd6af41-a80b-495e-886c-e51b0c7d77a3" | ||
RRTMGP = "a01a1ee8-cea4-48fc-987c-fc7878d79da1" | ||
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" | ||
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" |
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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#= | ||
julia --project=examples | ||
julia --project=examples perf/benchmark.jl | ||
``` | ||
include(joinpath("perf", "benchmark.jl")) | ||
``` | ||
=# | ||
# ARGS[1] | ||
|
||
using BenchmarkTools | ||
using Suppressor | ||
root_dir = joinpath(dirname(@__DIR__)) | ||
import ClimaComms | ||
import Logging | ||
|
||
@info "------------------------------------------------- Benchmark: gray_atm" | ||
@suppress_out begin | ||
include(joinpath(root_dir, "test", "gray_atm_utils.jl")) | ||
gray_atmos_lw_equil(ClimaComms.context(), OneScalar, Float64; exfiltrate = true) | ||
end | ||
(; slv, max_threads) = Infiltrator.exfiltrated | ||
@info "gray_atm lw" | ||
solve_lw!(slv, max_threads) # compile first | ||
trial = @benchmark solve_lw!(slv, max_threads) | ||
show(stdout, MIME("text/plain"), trial) | ||
println() | ||
|
||
gray_atmos_sw_test(ClimaComms.context(), OneScalar, Float64, 1; exfiltrate = true) | ||
(; slv, max_threads) = Infiltrator.exfiltrated | ||
solve_sw!(slv, max_threads) # compile first | ||
@info "gray_atm sw" | ||
trial = @benchmark solve_sw!(slv, max_threads) | ||
show(stdout, MIME("text/plain"), trial) | ||
println() | ||
@info "------------------------------------------------- Benchmark: clear_sky" | ||
@suppress_out begin | ||
include(joinpath(root_dir, "test", "clear_sky_utils.jl")) | ||
context = ClimaComms.context() | ||
clear_sky(ClimaComms.context(), TwoStream, SourceLW2Str, VmrGM, Float64; exfiltrate = true) | ||
end | ||
(; slv, max_threads, lookup_sw, lookup_lw) = Infiltrator.exfiltrated | ||
|
||
@info "clear_sky lw" | ||
solve_lw!(slv, max_threads, lookup_lw) # compile first | ||
trial = @benchmark solve_lw!(slv, max_threads, lookup_lw) | ||
show(stdout, MIME("text/plain"), trial) | ||
println() | ||
|
||
@info "clear_sky sw" | ||
solve_sw!(slv, max_threads, lookup_sw) # compile first | ||
trial = @benchmark solve_sw!(slv, max_threads, lookup_sw) | ||
show(stdout, MIME("text/plain"), trial) | ||
println() | ||
|
||
@info "------------------------------------------------- Benchmark: all_sky" | ||
@suppress_out begin | ||
include(joinpath(root_dir, "test", "all_sky_utils.jl")) | ||
all_sky(ClimaComms.context(), TwoStream, Float64; use_lut = true, cldfrac = Float64(1), exfiltrate = true) | ||
end | ||
|
||
(; slv, max_threads, lookup_sw, lookup_sw_cld, lookup_lw, lookup_lw_cld) = Infiltrator.exfiltrated | ||
|
||
solve_sw!(slv, max_threads, lookup_sw, lookup_sw_cld) # compile first | ||
solve_lw!(slv, max_threads, lookup_lw, lookup_lw_cld) # compile first | ||
|
||
@info "all_sky, lw, use_lut=true" | ||
trial = @benchmark solve_lw!(slv, max_threads, lookup_lw, lookup_lw_cld) | ||
show(stdout, MIME("text/plain"), trial) | ||
println() | ||
@info "all_sky, sw, use_lut=true" | ||
trial = @benchmark solve_sw!(slv, max_threads, lookup_sw, lookup_sw_cld) | ||
show(stdout, MIME("text/plain"), trial) | ||
println() | ||
|
||
@suppress_out begin | ||
all_sky(ClimaComms.context(), TwoStream, Float64; use_lut = false, cldfrac = Float64(1), exfiltrate = true) | ||
end | ||
|
||
(; slv, max_threads, lookup_sw, lookup_sw_cld, lookup_lw, lookup_lw_cld) = Infiltrator.exfiltrated | ||
|
||
solve_sw!(slv, max_threads, lookup_sw, lookup_sw_cld) # compile first | ||
solve_lw!(slv, max_threads, lookup_lw, lookup_lw_cld) # compile first | ||
|
||
@info "all_sky, lw, use_lut=false" | ||
trial = @benchmark solve_lw!(slv, max_threads, lookup_lw, lookup_lw_cld) | ||
show(stdout, MIME("text/plain"), trial) | ||
println() | ||
@info "all_sky, sw, use_lut=false" | ||
trial = @benchmark solve_sw!(slv, max_threads, lookup_sw, lookup_sw_cld) | ||
show(stdout, MIME("text/plain"), trial) | ||
println() |
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
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