Repository navigation
Implement batch support - #15
Merged
Merged
Conversation
Add batch lifecycle management through AccumulateBatchTally and DiscardBatchTally methods. Track per-batch flux and compute mean and standard deviation across multiple batches for improved statistical accuracy. Refactor tally finalization to separate flux accumulation, statistics computation, and volume normalization into distinct functions. Output now includes both flux mean and standard deviation. Update file formats to .osh and _vtu.
There was a problem hiding this comment.
🟡 Changes recommended
Correct the VTK output filename and update stale output-format documentation.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds batch lifecycle management and mean/standard-deviation flux statistics for mesh tallies.
Changes:
- Adds batch accumulation and discard APIs.
- Computes normalized batch statistics.
- Produces
.oshand VTK outputs.
File summaries
| File | Summary | Review notes |
|---|---|---|
src/pumitally/PumiTallyImpl.h |
Declares batch state and statistics. | Nit (1 vote): document both output formats. |
src/pumitally/PumiTallyImpl.cpp |
Implements batch processing, statistics, normalization, and output. | Nits (2 votes, 1 vote): use an explicit .vtu filename and update stale output documentation. |
src/pumitally/PumiTally.h |
Adds public batch APIs and documentation. | Nit (2 votes): document both .osh and VTK outputs. |
src/pumitally/PumiTally.cpp |
Implements public API wrappers and timing. | No review comments. |
Review details
Suppressed comments (2)
src/pumitally/PumiTallyImpl.cpp:169
- Please update the user-facing output documentation along with this basename change.
WriteTallyResultsno longer produces the documentedfluxresult.vtk; it now writesfluxresult.oshplus the VTK output using the_vtubasename, whileREADME.mdstill saysfluxresult.vtkand “VTK only”. Without updating those docs, users will look for a file that is no longer generated.
void PumiTallyImpl::WriteTallyResults() {
p_pumi_particle_at_elem_boundary_handler->FinalizeTallies(full_mesh,
"fluxresult");
src/pumitally/PumiTallyImpl.h:148
- This implementation now emits both Omega_h binary and VTK results, so describing finalization as writing only a VTK file is stale and makes the new
.oshoutput easy to miss. Please update this internal/public implementation contract to name both output formats.
* Normalize the accumulated flux with volume and write mean and standard
* deviation in a VTK file
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Fuad-HH
force-pushed
the
multi-batch
branch
from
September 14, 2026 20:49
8c5d41f to
3ecfc12
Compare
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.
Add batch lifecycle management through AccumulateBatchTally and DiscardBatchTally methods. Track per-batch flux and compute mean and standard deviation across multiple batches for improved statistical accuracy. Refactor tally finalization to separate flux accumul
This pull request introduces batch-wise tally accumulation and statistical analysis for mesh tallies in PUMI-Tally. It adds the ability to accumulate and discard per-batch tallies, computes the mean and standard deviation of the flux over multiple batches, and updates the output to include these statistics. The changes also clarify the correct usage of initial position copying and batch handling in the documentation.
Batch tallying and statistics
AccumulateBatchTallyandDiscardBatchTallymethods toPumiTallyandPumiTallyImplto allow explicit closing or discarding of per-batch tallies, enabling correct computation of statistics over multiple batches. [1] [2] [3] [4] [5]ParticleAtElemBoundarystruct now maintains running sums (flux_sum,flux_sum_sq) and a batch count (n_realizations) to compute the mean and standard deviation of the flux across batches. [1] [2]ComputeMeanAndStdDevto calculate batch-wise statistics, and updatedFinalizeTalliesto output both mean and standard deviation, normalized by element volume. Output now includes both.oshand.vtufiles. [1] [2]Mesh tally output improvements
flux(mean) andflux_std_dev(standard deviation) tags, both normalized by element volume, in addition to thevolumetag. The output behavior for single-batch runs is preserved for backward compatibility. [1] [2]Documentation and usage clarification
CopyInitialPositionto clarify that it must be called at the start of every batch, not just once per simulation, to ensure correct particle tracking.These changes provide more accurate and statistically meaningful mesh tally results, supporting workflows with multiple batches and inactive batches (e.g., for eigenvalue calculations).ation, statistics computation, and volume normalization into distinct functions. Output now includes both flux mean and standard deviation. Update file formats to .osh and _vtu.