Skip to content

Commit

Permalink
Add missing blocks to the dycore Jacobian
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisYatunin committed Jan 12, 2024
1 parent aea5ecd commit a57b7d6
Show file tree
Hide file tree
Showing 11 changed files with 404 additions and 357 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ steps:
$PERF_CONFIG_PATH/flame_perf_target_prognostic_edmfx_aquaplanet.yml
artifact_paths: "flame_perf_target_prognostic_edmfx_aquaplanet/*"
agents:
slurm_mem: 24GB
slurm_mem: 32GB

- label: ":fire: Flame graph: perf target (barowave jfnk)"
command: >
Expand Down
12 changes: 6 additions & 6 deletions perf/flame.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ ProfileCanvas.html_file(joinpath(output_dir, "flame.html"), results)
#####

allocs_limit = Dict()
allocs_limit["flame_perf_target"] = 190_816
allocs_limit["flame_perf_target_tracers"] = 223_072
allocs_limit["flame_perf_target"] = 192_544
allocs_limit["flame_perf_target_tracers"] = 224_800
allocs_limit["flame_perf_target_edmfx"] = 7_005_552
allocs_limit["flame_perf_diagnostics"] = 26_645_600
allocs_limit["flame_perf_target_diagnostic_edmfx"] = 1_394_432
allocs_limit["flame_perf_target_diagnostic_edmfx"] = 1_398_720
allocs_limit["flame_sphere_baroclinic_wave_rhoe_equilmoist_expvdiff"] =
4_018_252_656
allocs_limit["flame_perf_target_frierson"] = 8_030_478_736
allocs_limit["flame_perf_target_frierson"] = 8_030_497_552
allocs_limit["flame_perf_target_threaded"] = 1_276_864
allocs_limit["flame_perf_target_callbacks"] = 386_584
allocs_limit["flame_perf_gw"] = 3_261_869_920
allocs_limit["flame_perf_target_prognostic_edmfx_aquaplanet"] = 1_310_048
allocs_limit["flame_perf_gw"] = 3_265_411_104
allocs_limit["flame_perf_target_prognostic_edmfx_aquaplanet"] = 1_315_168

# Ideally, we would like to track all the allocations, but this becomes too
# expensive there is too many of them. Here, we set the default sample rate to
Expand Down
2 changes: 1 addition & 1 deletion regression_tests/ref_counter.jl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
142
143
1 change: 0 additions & 1 deletion src/cache/cache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ function build_cache(Y, atmos, params, surface_setup, dt, t_end, start_date)
ᶜp_ref,
ᶜT = similar(Y.c, FT),
ᶜf,
∂ᶜK_∂ᶠu₃ = similar(Y.c, BidiagonalMatrixRow{Adjoint{FT, CT3{FT}}}),
# Used by diagnostics such as hfres, evspblw
surface_ct3_unit = CT3.(
unit_basis_vector_data.(CT3, sfc_local_geometry)
Expand Down
11 changes: 11 additions & 0 deletions src/cache/temporary_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function temporary_quantities(Y, atmos)
center_space, face_space = axes(Y.c), axes(Y.f)

FT = Spaces.undertype(center_space)
CTh = CTh_vector_type(Y.c)
return (;
ᶠtemp_scalar = Fields.Field(FT, face_space), # ᶠp, ᶠρK_E
ᶜtemp_scalar = Fields.Field(FT, center_space), # ᶜ1
Expand Down Expand Up @@ -50,5 +51,15 @@ function temporary_quantities(Y, atmos)
), # ᶠstrain_rate
# TODO: Remove this hack
sfc_temp_C3 = Fields.Field(C3{FT}, Spaces.level(face_space, half)), # ρ_flux_χ
# Implicit solver cache:
∂ᶜK_∂ᶜuₕ = similar(Y.c, DiagonalMatrixRow{Adjoint{FT, CTh{FT}}}),
∂ᶜK_∂ᶠu₃ = similar(Y.c, BidiagonalMatrixRow{Adjoint{FT, CT3{FT}}}),
ᶠp_grad_matrix = similar(Y.f, BidiagonalMatrixRow{C3{FT}}),
ᶜadvection_matrix = similar(
Y.c,
BidiagonalMatrixRow{Adjoint{FT, C3{FT}}},
),
ᶜdiffusion_h_matrix = similar(Y.c, TridiagonalMatrixRow{FT}),
ᶜdiffusion_u_matrix = similar(Y.c, TridiagonalMatrixRow{FT}),
)
end
2 changes: 1 addition & 1 deletion src/parameters/Parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ for var in fieldnames(TD.Parameters.ThermodynamicsParameters)
@eval $var(ps::ACAP) = TD.Parameters.$var(thermodynamics_params(ps))
end
# Thermodynamics derived parameters
for var in [:molmass_ratio, :R_d, :R_v, :cp_d, :cv_v, :cv_l, :cv_d]
for var in [:molmass_ratio, :R_d, :R_v, :e_int_v0, :cp_d, :cv_v, :cv_l, :cv_d]
@eval $var(ps::ACAP) = TD.Parameters.$var(thermodynamics_params(ps))
end

Expand Down
Loading

0 comments on commit a57b7d6

Please sign in to comment.