Repository navigation
Conversation
BOUT++ previously overwrote output (dmp) files unless "append" was specified. This could lead to accidentally deleting previous runs. This adds a "replace" option that is `false` by default for dmp files. By default then BOUT++ will throw a `BoutException` rather than overwrite dump files. Users can either: - Add "append" to command line to append existing data - Add "replace" to overwrite existing data - Manually delete dmp files before running BOUT++. This is an option, rather than always refusing to overwrite, because restart files need to be overwritten.
ZedThree
previously approved these changes
Sep 28, 2026
ZedThree
left a comment
Member
There was a problem hiding this comment.
Thanks @bendudson, does seem strange we've gone this long without this option!
Does ADIOS need to handle this too?
Contributor
Author
|
Thanks @ZedThree ! Good point; this should be added to the ADIOS output too. And probably some documentation. |
Member
|
Ah, the MMS tests apparently rely on overwriting the previous runs. I suspect some of the integrated tests do too |
Behaves similar to NetCDF output: Refuse to overwrite an existing file unless `replace` is true. ADIOS2 works on streams so the concepts are a bit different. The adios2 `write` function is being called multiple times (4?) per output step. Only checking if we're overwriting on the first call.
These tests run BOUT++ in a loop with different settings, overwriting the previous output.
Set replace=true by default so files can be overwritten
Codex review
When running tests don't copy any BOUT.dmp files
Remove dump files. The glob "BOUT.dmp.*" should match both NetCDF and ADIOS2 outputs; "-r" is needed because ADIOS2 outputs are directories. These changes triggered `ruff check` errors that are fixed.
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.
BOUT++ previously overwrote output (dmp) files unless "append" was specified. This could lead to accidentally deleting previous runs.
This adds a "replace" option that is
falseby default for dmp files. By default then BOUT++ will throw aBoutExceptionrather than overwrite dump files. Users can either:This is an option, rather than always refusing to overwrite, because restart files need to be overwritten.