feat(prt): configurable event buffering#2789
Open
wpbonelli wants to merge 7 commits into
Open
Conversation
7 tasks
74d44ee to
15d0b93
Compare
Manangka
reviewed
May 11, 2026
Contributor
|
Hi @wpbonelli, I had a look at your PR and left some of my thoughts. Feel free to ignore any of my suggestions |
Member
Author
|
thanks @Manangka good thoughts all. |
Manangka
reviewed
May 12, 2026
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.
Previously PRT model particle events were written to output file(s) immediately. This was a deliberate choice motivated by MP7 suffering OOM errors when consolidating internal scratch files before writing the final output file.
With GWF models using adaptive time stepping (ATS), or with multiple Picard iterations when PRT and GWF are in the same solution group, output would be written for discarded solve attempts. Events should only end up in output files for the final, successful solve.
To gate events until a successful solve, buffer them until it's known whether they should be written. Introduce two buffering strategies, in memory and scratch file, with a new OC option
SCRATCH_BUFFERenabling the latter. Memory buffering is used by default.Since the buffer could conceivably grow large for models with lots of particles or lots of action per time step (e.g., the final time step when extended tracking is on), the scratch file approach is provided to let the modeler avoid OOM errors at the price of more file IO.
While this departs from informal MF6 convention to avoid scratch files in general, it's a well motivated option, not on by default.
This is a pure refactor but for the new option, which I figure merits calling it a feature. It was split out of #2753. The retry misbehavior is fixed in that PR, not here.
Checklist of items for pull request
fprettify