src_compressible_stag: define vel_decomp before the step-0 plotfile call uses it - #282
Merged
isriva merged 1 commit intoSep 22, 2026
Conversation
…all uses it On a fresh start with plot_int > 0 and turbForcing > 0, main_driver passed vel_decomp to EvaluateWritePlotFileVelGrad / ...Tiny from inside the non-restart branch, ~40 lines before vel_decomp.define() is reached below the branch. vel_decomp is declared with no arguments, so it was an unbuilt MultiFab at that point. EvaluateWritePlotFileVelGrad dereferences it immediately (vel_decomp.ParallelCopy(vel_decomp_in,0,0,6)); ParallelCopy from a MultiFab with an empty BoxArray/DistributionMap is undefined behaviour -- an assertion failure in a debug build, a garbage dereference in release. This broke every fresh-start forced-turbulence run with plotfiles enabled, before the time loop even started. Restart runs were unaffected because they do not call these. Move the step-0 call below the define block and gate it on the fresh-start condition it previously inherited from its enclosing branch.
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.
On a fresh start with plot_int > 0 and turbForcing > 0, main_driver passed
vel_decomp to EvaluateWritePlotFileVelGrad / ...Tiny from inside the
non-restart branch, ~40 lines before vel_decomp.define() is reached below the
branch. vel_decomp is declared with no arguments, so it was an unbuilt
MultiFab at that point.
EvaluateWritePlotFileVelGrad dereferences it immediately
(vel_decomp.ParallelCopy(vel_decomp_in,0,0,6)); ParallelCopy from a MultiFab
with an empty BoxArray/DistributionMap is undefined behaviour -- an assertion
failure in a debug build, a garbage dereference in release. This broke every
fresh-start forced-turbulence run with plotfiles enabled, before the time loop
even started. Restart runs were unaffected because they do not call these.
Move the step-0 call below the define block and gate it on the fresh-start
condition it previously inherited from its enclosing branch.