src_compressible_stag: zero spatialCrossMF on the reset_stats restart path - #276
Merged
isriva merged 1 commit intoSep 22, 2026
Merged
Conversation
… path The reset_stats == 1 branch of ReadCheckPoint zeroed every statistics MultiFab except spatialCrossMF, which was defined but never given a value; MultiFab::define does not initialise memory. The non-restart path in main_driver does call setVal(0.0) right after defining it, so only the restart path was affected. EvaluateSpatialCorrelations1D accumulates in place. statsCount is reset to 1 on this path so the stale value is multiplied by zero, but 0 * NaN is NaN -- and AMReX serves large allocations from a recycled arena, so the contents are whatever the previous owner left rather than fresh zero pages. Results were non-deterministic and could poison spatialCrossMF for the rest of the run and into every subsequent checkpoint. Zero it next to the define calls so both branches are covered.
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.
The reset_stats == 1 branch of ReadCheckPoint zeroed every statistics MultiFab
except spatialCrossMF, which was defined but never given a value;
MultiFab::define does not initialise memory. The non-restart path in
main_driver does call setVal(0.0) right after defining it, so only the restart
path was affected.
EvaluateSpatialCorrelations1D accumulates in place. statsCount is reset to 1 on
this path so the stale value is multiplied by zero, but 0 * NaN is NaN -- and
AMReX serves large allocations from a recycled arena, so the contents are
whatever the previous owner left rather than fresh zero pages. Results were
non-deterministic and could poison spatialCrossMF for the rest of the run and
into every subsequent checkpoint.
Zero it next to the define calls so both branches are covered.