Skip to content

Report where state validation fails and save the state before aborting - #648

Draft
xylar wants to merge 4 commits into
E3SM-Project:developfrom
xylar:omega/report-validation-failures
Draft

xylar wants to merge 4 commits into
E3SM-Project:developfrom
xylar:omega/report-validation-failures

Conversation

@xylar

@xylar xylar commented Oct 27, 2026

Copy link
Copy Markdown

When state validation aborts, the run now says what failed and where, and leaves the bad state behind to inspect. Closes #647.

  • Ranks that do not log keep critical messages, on stderr and labeled with the rank, instead of dropping them.
  • Each validation message gives the global cell ID, latitude, longitude and layer of the first bad entry, and its value if it is out of range.
  • The abort decision now uses counts summed over all ranks. Before aborting, every rank writes the stream named by the new option State: Validation: WriteStreamOnAbort (default History).

For reviewers:

  • Because critical messages now reach stderr on every rank, out-of-range values that do not abort the run (the default, AbortOnOOB: false) are printed by each affected rank every step.
  • Validation does one global sum every step; before, it did one only when the EOS was defined.

Model answers should not change.

Checklist

  • Linting

  • Building

    • CMake build does not produce any new warnings from changes in this PR
  • Testing

    chrysalis, intel, openmpi

    • CTests Pass
    • Polaris omega_pr Pass

Posted by Claude Code on @xylar's behalf. The testing, analysis and wording above are AI-authored; please check them accordingly.

xylar and others added 4 commits October 27, 2026 04:08
Tasks that do not log turned spdlog off entirely, so a critical message
raised only on such a task, such as a NaN found by state validation on
the task that owns the cell, was lost along with the reason for the
abort that followed. These tasks now keep critical messages only, on
stderr and labeled with the task.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
State validation gave only the number of NaN or out-of-range entries in
each field, which left no way to find them in a large mesh without
rerunning. Each critical message now also gives the global cell ID,
latitude, longitude and layer of the first such entry, and the value
when it is out of range. checkOceanState can return the same issues to
the caller, which the unit test uses to check the reported location.

The first entry is searched for only when a count is nonzero, so a
valid state costs no more than before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Each task decided on its own whether to abort, so only the tasks that
found a NaN called MPI_Abort and no collective work was possible first.
validateOceanState now sums the NaN and out-of-range counts over all
tasks, in the reduction it already did for negative salinity, so every
task makes the same decision. Before aborting, every task writes the
stream named by the new option State::Validation::WriteStreamOnAbort
(default History), giving a record of the bad state to inspect. The
time steppers pass their clock for the time stamp, which is the start of
the failing step. The master task now logs the totals over all tasks,
both before an abort and when the run continues.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The user's guide gains a section on state validation, its options and
what it reports, and says where tasks that do not log write critical
messages. The design doc covers the location of the first bad value,
the collective abort and the stream written before it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@xylar xylar added enhancement New feature or request Omega Logging BFB PR leaves answers BFB labels Oct 27, 2026
@xylar

xylar commented Oct 27, 2026

Copy link
Copy Markdown
Author

Testing

CTests pass on Chrysalis with Intel and Open MPI (61/61).

I also applied these commits on top of develop plus #587 and #632 and used that build to chase a NaN in a Polaris dynamic-adjustment run on a 4M-cell mesh (3200 tasks). Before, the abort gave no field or location. With this branch, each task that found NaNs named the field, cell, latitude, longitude and layer, and the History dump held the bad state. Repeated runs put the NaN in a different place each time, which pointed to memory corruption in the MPI stack rather than the model (E3SM-Project/mache#546).


Posted by Claude Code on @xylar's behalf. The testing, analysis and wording above are AI-authored; please check them accordingly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BFB PR leaves answers BFB enhancement New feature or request Logging Omega

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A NaN abort from state validation leaves no record of the field or location

1 participant