Only stash worker run data when a run streamer will drain it#154
Merged
Conversation
Workers called stash_worker_run_data() at the end of every run, but the master drains the static pool (take_completed_worker_run_data) only when need_a_run_streamer is true. With no run-mode digitizer, the pool was never cleared and grew run after run; a later run that did enable a run streamer then merged in all the stale prior-run contributions, double-counting events_processed (the normalization denominator) and run summary counters, and leaking memory in the common no-run-streamer case. Gate the worker stash on need_a_run_streamer, the same condition the master uses to drain. Workers and master compute it identically in BeginOfRunAction, so the pool is filled iff it will be drained that run. Fixes gemc#126 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Workers called
stash_worker_run_data()at the end of every run, but the master drains the static pool (take_completed_worker_run_data) only whenneed_a_run_streameris true. With no run-mode digitizer, the pool was never cleared and grew run after run; a later run that did enable a run streamer then merged in all the stale prior-run contributions — double-countingevents_processed(the normalization denominator) and run-summary counters — and leaked memory in the common no-run-streamer case.Gate the worker stash on
need_a_run_streamer, the same condition the master uses to drain. Workers and master compute it identically inBeginOfRunAction, so the pool is filled iff it will be drained that run.Validation:
gRunAction.cccompiles clean (Geant4 11.4.1 dev container).Fixes #126