diff --git a/AGENTS.md b/AGENTS.md index 375eb82..0e92c1e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -59,6 +59,7 @@ Parent documents (Physics, GEOSgcm_GridComp, fixture) are linked from the header the solar band exports built in loops) is added in `SetServices`. - Code owners are in `.github/CODEOWNERS`: the radiation team, and the CMake team for `CMakeLists.txt` files. +- Error handling in code you write or touch uses the MAPL3 macros (`@MAPL/include/MAPL_ErrLog.h`): `_RC` on calls, `_STAT` on `allocate`, `_ASSERT(cond, msg)` with a message, and `_RETURN(_SUCCESS)` at every successful exit. Convert `RC=STATUS`/`VERIFY_`/`ASSERT_`/`RETURN_` in any routine you change. `_RC` expands to two statements (`rc=status);_VERIFY(status`), so it cannot end a one-line `if`; use a block `if`. Do not add decorative `!----` separator lines. ## Build and test diff --git a/regression/README.md b/regression/README.md index 120b4cf..72a55fd 100644 --- a/regression/README.md +++ b/regression/README.md @@ -231,6 +231,21 @@ If a case's data directory is missing, `run_case.cmake` prints "Regression data not found ... skipping" and the test **passes without running**. +## Run time + +Measured 2026-11-09 with `ctest -L REGRESSION` (ifx Debug, 6 PEs, `logging.yaml` in place). Times are per-rank means from the MAPL profiler output in the test log. + +| Case | Test | Run | RRTMGP | Other | +|---|---|---|---|---| +| `irrad-sa` | 8.2 s | 5.3 s | 5.25 s (LW) | checkpoint writes 0.2 s | +| `solar-sa` | 8.4 s | 5.9 s | 5.46 s (SW) | `BALANCE` 0.24 s | +| `radiation` | 17.3 s | 11.7 s | 4.8 s (LW) + 5.4 s (SW) | COSP 0.5 s | +| `satsim-sa` | 3.5 s | 0.7 s | none | COSP 0.6 s | + +Unlike the Moist cases, these are dominated by the radiation computation, not by MAPL: MAPL initialize is about 1-1.5 s per case, and the rest of each test (`mpiexec`, startup, `nccmp`) about 2 s. `radiation` is roughly `irrad-sa` plus `solar-sa` plus COSP; nothing runs twice. + +A single RRTMGP call takes ~5 s on ~144 columns per rank, with the reduced g-point tables (`rrtmgp-gas-lw-g128.nc`, `rrtmgp-gas-sw-g112.nc`), because RRTMGP is built with the full Debug flags (`-O0 -check all -init=snan,arrays -fpe0 -fno-inline-functions -nolib-inline`; `RRTMGP_cmake/CMakeFiles/RRTMGP.dir/flags.make` in the build). This is inferred: the profiler timers stop at `RRTMGP`, and which kernels or checks cost most has not been profiled. Possible speedups: build the RRTMGP target with `-check none` but keep `-O0` (expected zero-diff, to be verified against the baselines), or with optimization (changes answers, so all four baselines would have to be regenerated). + ## Running ``` diff --git a/regression/irrad-sa/logging.yaml b/regression/irrad-sa/logging.yaml new file mode 100644 index 0000000..30fa63b --- /dev/null +++ b/regression/irrad-sa/logging.yaml @@ -0,0 +1,35 @@ +schema_version: 1 + +# MAPL's default logging writes every rank's warnings to warnings_and_errors.log +# under an MPI lock. Without a field dictionary in the run directory, MAPL warns +# once per variable spec per rank, and the lock serializes the ranks (about 6 s +# of a 17 s Moist case). This config logs to the console only and sets the MAPL +# logger to ERROR; MAPL.profiler keeps the timing tables on rank 0. + +formatters: + basic: + class: Formatter + format: '%(name)a15~: %(message)a' + +handlers: + console: + class: streamhandler + formatter: basic + unit: OUTPUT_UNIT + level: DEBUG + +root: + handlers: [console] + level: WARNING + root_level: INFO + +loggers: + MAPL: + level: ERROR + root_level: ERROR + + MAPL.profiler: + handlers: [console] + propagate: FALSE + level: WARNING + root_level: INFO diff --git a/regression/irrad-sa/mapl.yaml b/regression/irrad-sa/mapl.yaml index e426281..e87b9c6 100644 --- a/regression/irrad-sa/mapl.yaml +++ b/regression/irrad-sa/mapl.yaml @@ -6,3 +6,4 @@ esmf: logAppendFlag: false app_petcount: 6 +pflogger: logging.yaml diff --git a/regression/radiation/logging.yaml b/regression/radiation/logging.yaml new file mode 100644 index 0000000..30fa63b --- /dev/null +++ b/regression/radiation/logging.yaml @@ -0,0 +1,35 @@ +schema_version: 1 + +# MAPL's default logging writes every rank's warnings to warnings_and_errors.log +# under an MPI lock. Without a field dictionary in the run directory, MAPL warns +# once per variable spec per rank, and the lock serializes the ranks (about 6 s +# of a 17 s Moist case). This config logs to the console only and sets the MAPL +# logger to ERROR; MAPL.profiler keeps the timing tables on rank 0. + +formatters: + basic: + class: Formatter + format: '%(name)a15~: %(message)a' + +handlers: + console: + class: streamhandler + formatter: basic + unit: OUTPUT_UNIT + level: DEBUG + +root: + handlers: [console] + level: WARNING + root_level: INFO + +loggers: + MAPL: + level: ERROR + root_level: ERROR + + MAPL.profiler: + handlers: [console] + propagate: FALSE + level: WARNING + root_level: INFO diff --git a/regression/radiation/mapl.yaml b/regression/radiation/mapl.yaml index e426281..e87b9c6 100644 --- a/regression/radiation/mapl.yaml +++ b/regression/radiation/mapl.yaml @@ -6,3 +6,4 @@ esmf: logAppendFlag: false app_petcount: 6 +pflogger: logging.yaml diff --git a/regression/satsim-sa/logging.yaml b/regression/satsim-sa/logging.yaml new file mode 100644 index 0000000..30fa63b --- /dev/null +++ b/regression/satsim-sa/logging.yaml @@ -0,0 +1,35 @@ +schema_version: 1 + +# MAPL's default logging writes every rank's warnings to warnings_and_errors.log +# under an MPI lock. Without a field dictionary in the run directory, MAPL warns +# once per variable spec per rank, and the lock serializes the ranks (about 6 s +# of a 17 s Moist case). This config logs to the console only and sets the MAPL +# logger to ERROR; MAPL.profiler keeps the timing tables on rank 0. + +formatters: + basic: + class: Formatter + format: '%(name)a15~: %(message)a' + +handlers: + console: + class: streamhandler + formatter: basic + unit: OUTPUT_UNIT + level: DEBUG + +root: + handlers: [console] + level: WARNING + root_level: INFO + +loggers: + MAPL: + level: ERROR + root_level: ERROR + + MAPL.profiler: + handlers: [console] + propagate: FALSE + level: WARNING + root_level: INFO diff --git a/regression/satsim-sa/mapl.yaml b/regression/satsim-sa/mapl.yaml index e426281..e87b9c6 100644 --- a/regression/satsim-sa/mapl.yaml +++ b/regression/satsim-sa/mapl.yaml @@ -6,3 +6,4 @@ esmf: logAppendFlag: false app_petcount: 6 +pflogger: logging.yaml diff --git a/regression/solar-sa/logging.yaml b/regression/solar-sa/logging.yaml new file mode 100644 index 0000000..30fa63b --- /dev/null +++ b/regression/solar-sa/logging.yaml @@ -0,0 +1,35 @@ +schema_version: 1 + +# MAPL's default logging writes every rank's warnings to warnings_and_errors.log +# under an MPI lock. Without a field dictionary in the run directory, MAPL warns +# once per variable spec per rank, and the lock serializes the ranks (about 6 s +# of a 17 s Moist case). This config logs to the console only and sets the MAPL +# logger to ERROR; MAPL.profiler keeps the timing tables on rank 0. + +formatters: + basic: + class: Formatter + format: '%(name)a15~: %(message)a' + +handlers: + console: + class: streamhandler + formatter: basic + unit: OUTPUT_UNIT + level: DEBUG + +root: + handlers: [console] + level: WARNING + root_level: INFO + +loggers: + MAPL: + level: ERROR + root_level: ERROR + + MAPL.profiler: + handlers: [console] + propagate: FALSE + level: WARNING + root_level: INFO diff --git a/regression/solar-sa/mapl.yaml b/regression/solar-sa/mapl.yaml index e426281..e87b9c6 100644 --- a/regression/solar-sa/mapl.yaml +++ b/regression/solar-sa/mapl.yaml @@ -6,3 +6,4 @@ esmf: logAppendFlag: false app_petcount: 6 +pflogger: logging.yaml