Repository navigation
Conversation
compute_adv_tends_xyz allocated ftmp and adv_tendxyz and copied all constituents twice per physics step even when no total advective tendency field (tottnam) was active. Return on entry when all tottnam fields are inactive. In applyCAMforcing, make ftmp allocatable and guard ftmp/ftmp_fvm allocations, clipping-loss stores, and output_qdp_var_dynamics on WV_PDC, WI_PDC, WL_PDC, or TT_PDC being active. With those fields off on cesm3_0_beta10 (gfortran 13.4.0 -O2), comp_adv_tends1+2 drops from 4.98 s to 0.0009 s and applyCAMforc from 3.55 s to 2.28 s on 3-hour 32-task B1850CM (avoiding ~150 MiB/rank transient ftmp_fvm), and from 11.0-12.5 s to 0.03-0.04 s on single-column FSCAMARM97 and FCSCAM. Answer impact: Bit-for-bit identical. The equivalent cesm3_0_beta10 commit (differing only by cam_development's dp_fvm factor) gave 0 differing cprnc fields in 2-day and 3-hour B1850CM on gfortran 13.4.0 -O2 (pre-allocatable-ftmp revision also passed QPC6, 8x4 OpenMP, DEBUG, restart, and SCAM), and this commit passed standalone A/B checks across active/inactive CSLAM and GLL paths on gfortran, ifx 2025.0.4, and nvfortran 24.11-0. Prepared with AI assistance (Google Gemini).
Prepared with AI assistance (Google Gemini).
Author
CAM & Atmospheric Physics CPU Optimization Series OverviewThis comment summarizes the full 3-PR Benchmark Environment
Combined Atmosphere Speedup (exact submitted code)
Per-PR Summary
Totals: Shared Verification Matrix
Not yet run: Prepared with AI assistance (Google Gemini). |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1761
Summary
When
TA<constituent>advection-tendency and*_PDC(WV_PDC,WI_PDC,WL_PDC,TT_PDC) history fields are inactive,compute_adv_tends_xyzandapplyCAMforcingstill allocate about 150 MiB per rank each (adv_tendxyz,ftmp_fvmin 141-tracerB1850CM) and copy every tracer across every element on every step.advect_tend.F90(compute_adv_tends_xyz): Return early before allocatingftmporadv_tendxyzwhen nohist_fld_active(tottnam(ic))field is active.prim_advance_mod.F90(applyCAMforcing): Makeftmpallocatable(checkedallocate(..., stat=ierr)forftmpandftmp_fvm) and guard allocation, clipping-loss stores, andoutput_qdp_var_dynamicsbehindpdc_active. When any*_PDCfield is active, the exact same statements run (includingdp_fvmscaling oncam_development).Timing & Validation
B1850CM(gfortran 13.4.0 -O2,cesm3_0_beta10, with two other SE changes):comp_adv_tends1+2drops from 4.98 s to 0.0009 s andapplyCAMforcfrom 3.55 s to 2.28 s, skipping ~150 MiB/rank of transientftmp_fvmallocation (2-pair whole-run delta sits under 1%, near spread).SCAM(ne3_ne3_mg37, 1 MPI task):comp_adv_tends1+2drops from 11.0 s (695hFSCAMARM97) and 12.5 s (120hFCSCAM) down to 0.03 to 0.04 s.cesm3_0_beta10andcam_developmentversions compile and match bit-for-bit acrossgfortran,ifx 2025.0.4, andnvfortran 24.11-0for all 4{CSLAM, GLL} x {inactive, active}paths atftype = 0. Full-modelcprncchecks on the equivalentbeta10commit (0 diffs in 2-day and 3-hourB1850CM; earlier pre-allocatable-ftmpchecks also passedQPC6,8x4,DEBUG=TRUE, restart, andSCAM), combined atmosphere numbers, andaux_camstatus are in the series overview comment below.Prepared with AI assistance (Google Gemini).