From 4684bc47c2d16f2eaca1663fa028984dee2fb75d Mon Sep 17 00:00:00 2001 From: Purnendu Chakraborty Date: Mon, 9 Nov 2026 22:10:16 -0500 Subject: [PATCH] Quiet MAPL logging in the FV3 regression cases Each case directory gets a logging.yaml (console output only, MAPL logger at ERROR) that mapl.yaml loads with `pflogger: logging.yaml`. Without a field dictionary MAPL warns once per variable spec per rank, and its default logging writes each warning to warnings_and_errors.log under an MPI lock, which serializes the ranks. AGENTS.md: add the MAPL3 error-macro rule. --- AGENTS.md | 1 + regression/adv-dyn/logging.yaml | 35 +++++++++++++++++++++++++++++++++ regression/adv-dyn/mapl.yaml | 1 + regression/adv-sa/logging.yaml | 35 +++++++++++++++++++++++++++++++++ regression/adv-sa/mapl.yaml | 1 + regression/dyn-sa/logging.yaml | 35 +++++++++++++++++++++++++++++++++ regression/dyn-sa/mapl.yaml | 1 + 7 files changed, 109 insertions(+) create mode 100644 regression/adv-dyn/logging.yaml create mode 100644 regression/adv-sa/logging.yaml create mode 100644 regression/dyn-sa/logging.yaml diff --git a/AGENTS.md b/AGENTS.md index ef685eea..39483007 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -55,6 +55,7 @@ only there. - `DYN` and `ADV` share the module array `FV_Atm`. - Files not in `CMakeLists.txt` are not compiled (architecture document, section 2). `FV_PRECISION` is set by the fixture build. +- 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/adv-dyn/logging.yaml b/regression/adv-dyn/logging.yaml new file mode 100644 index 00000000..30fa63be --- /dev/null +++ b/regression/adv-dyn/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/adv-dyn/mapl.yaml b/regression/adv-dyn/mapl.yaml index e426281c..e87b9c6e 100644 --- a/regression/adv-dyn/mapl.yaml +++ b/regression/adv-dyn/mapl.yaml @@ -6,3 +6,4 @@ esmf: logAppendFlag: false app_petcount: 6 +pflogger: logging.yaml diff --git a/regression/adv-sa/logging.yaml b/regression/adv-sa/logging.yaml new file mode 100644 index 00000000..30fa63be --- /dev/null +++ b/regression/adv-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/adv-sa/mapl.yaml b/regression/adv-sa/mapl.yaml index e426281c..e87b9c6e 100644 --- a/regression/adv-sa/mapl.yaml +++ b/regression/adv-sa/mapl.yaml @@ -6,3 +6,4 @@ esmf: logAppendFlag: false app_petcount: 6 +pflogger: logging.yaml diff --git a/regression/dyn-sa/logging.yaml b/regression/dyn-sa/logging.yaml new file mode 100644 index 00000000..30fa63be --- /dev/null +++ b/regression/dyn-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/dyn-sa/mapl.yaml b/regression/dyn-sa/mapl.yaml index e426281c..e87b9c6e 100644 --- a/regression/dyn-sa/mapl.yaml +++ b/regression/dyn-sa/mapl.yaml @@ -6,3 +6,4 @@ esmf: logAppendFlag: false app_petcount: 6 +pflogger: logging.yaml