Skip to content

Commit

Permalink
Remove perf_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbozzolo committed May 19, 2024
1 parent 68a2d59 commit 02fbaf6
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 34 deletions.
3 changes: 0 additions & 3 deletions config/default_configs/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,6 @@ precip_model:
cloud_model:
help: "Cloud model [`grid_scale`, `quadrature` (default)]"
value: "quadrature"
perf_mode:
help: "A flag for analyzing performance [`PerfStandard` (default), `PerfExperimental`]"
value: "PerfStandard"
perf_summary:
help: "Flag for collecting performance summary information"
value: false
Expand Down
3 changes: 1 addition & 2 deletions config/perf_configs/flame_perf_target_tracers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ vert_diff: "true"
approximate_linear_solve_iters: 2
h_elem: 12
forcing: "held_suarez"
precip_model: "0M"
precip_model: "1M"
dt_save_to_sol: "Inf"
rad: "allskywithclear"
warn_allocations_diagnostics: true
log_progress: false
perf_mode: "PerfExperimental"
implicit_diffusion: false
2 changes: 1 addition & 1 deletion perf/flame.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ProfileCanvas.html_file(joinpath(output_dir, "flame.html"), results)

allocs_limit = Dict()
allocs_limit["flame_perf_target"] = 1_160_723
allocs_limit["flame_perf_target_tracers"] = 1_184_407
allocs_limit["flame_perf_target_tracers"] = 1_247_360
allocs_limit["flame_perf_target_edmfx"] = 1_383_200
allocs_limit["flame_perf_diagnostics"] = 21_359_336
allocs_limit["flame_perf_target_diagnostic_edmfx"] = 1_936_480
Expand Down
2 changes: 0 additions & 2 deletions src/initial_conditions/InitialConditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import ..NonEquilMoistModel
import ..NoPrecipitation
import ..Microphysics0Moment
import ..Microphysics1Moment
import ..PerfStandard
import ..PerfExperimental
import ..PrescribedSurfaceTemperature
import ..PrognosticSurfaceTemperature
import ..C3
Expand Down
11 changes: 4 additions & 7 deletions src/initial_conditions/atmos_state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ grid_scale_center_variables(ls, atmos_model) = (;
uₕ = C12(ls.velocity, ls.geometry),
energy_variables(ls)...,
moisture_variables(ls, atmos_model.moisture_model)...,
precip_variables(ls, atmos_model.precip_model, atmos_model.perf_mode)...,
precip_variables(ls, atmos_model.precip_model)...,
)

energy_variables(ls) = (;
Expand Down Expand Up @@ -116,15 +116,12 @@ moisture_variables(ls, ::NonEquilMoistModel) = (;
ρq_ice = ls.ρ * TD.ice_specific_humidity(ls.thermo_params, ls.thermo_state),
)

# TODO: Remove perf_mode. Currently, adding tracers hurts performance.
precip_variables(ls, ::NoPrecipitation, ::PerfStandard) = (;)
precip_variables(ls, ::Microphysics0Moment, ::PerfStandard) = (;)
precip_variables(ls, ::Microphysics1Moment, ::PerfStandard) = (;
precip_variables(ls, ::NoPrecipitation) = (;)
precip_variables(ls, ::Microphysics0Moment) = (;)
precip_variables(ls, ::Microphysics1Moment) = (;
ρq_rai = ls.ρ * ls.precip_state.q_rai,
ρq_sno = ls.ρ * ls.precip_state.q_sno,
)
precip_variables(ls, _, ::PerfExperimental) =
(; ρq_rai = zero(eltype(ls)), ρq_sno = zero(eltype(ls)))

# We can use paper-based cases for LES type configurations (no TKE)
# or SGS type configurations (initial TKE needed), so we do not need to assert
Expand Down
8 changes: 0 additions & 8 deletions src/solver/model_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,6 @@ function get_orographic_gravity_wave_model(parsed_args, ::Type{FT}) where {FT}
end
end

function get_perf_mode(parsed_args)
return if parsed_args["perf_mode"] == "PerfExperimental"
PerfExperimental()
else
PerfStandard()
end
end

function get_radiation_mode(parsed_args, ::Type{FT}) where {FT}
idealized_h2o = parsed_args["idealized_h2o"]
@assert idealized_h2o in (true, false)
Expand Down
1 change: 0 additions & 1 deletion src/solver/type_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function get_atmos(config::AtmosConfig, params)
atmos = AtmosModel(;
moisture_model,
model_config,
perf_mode = get_perf_mode(parsed_args),
radiation_mode,
subsidence = get_subsidence_model(parsed_args, radiation_mode, FT),
ls_adv = get_large_scale_advection_model(parsed_args, FT),
Expand Down
10 changes: 0 additions & 10 deletions src/solver/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,8 @@ struct RadiationTRMM_LBA{R}
end
end

# TODO: remove AbstractPerformanceMode and all subtypes
# This is temporarily needed to investigate performance of
# our handling of tracers.
abstract type AbstractPerformanceMode end
struct PerfExperimental <: AbstractPerformanceMode end
struct PerfStandard <: AbstractPerformanceMode end
struct TestDycoreConsistency end

Base.broadcastable(x::AbstractPerformanceMode) = tuple(x)

abstract type AbstractTimesteppingMode end
struct Explicit <: AbstractTimesteppingMode end
struct Implicit <: AbstractTimesteppingMode end
Expand Down Expand Up @@ -333,7 +325,6 @@ end

Base.@kwdef struct AtmosModel{
MC,
PEM,
MM,
PM,
CM,
Expand Down Expand Up @@ -367,7 +358,6 @@ Base.@kwdef struct AtmosModel{
NUM,
}
model_config::MC = nothing
perf_mode::PEM = nothing
moisture_model::MM = nothing
precip_model::PM = nothing
cloud_model::CM = nothing
Expand Down

0 comments on commit 02fbaf6

Please sign in to comment.