Repository navigation
Fix undefined allreduce min/max/sum results in non-MPI builds - #1971
Closed
sbryngelson wants to merge 1 commit into
Closed
sbryngelson wants to merge 1 commit into
sbryngelson wants to merge 1 commit into
Conversation
Lines of Code
|
sbryngelson
force-pushed
the
fix-allreduce-nompi
branch
from
October 10, 2026 16:27
5af275b to
c9478e6
Compare
4 tasks
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.
Contribution Policy
We do not accept pull requests generated primarily by AI without genuine understanding or real-world usage context.
All contributions are expected to demonstrate:
If these expectations are not met, we would prefer to implement the changes ourselves rather than spend time reviewing low-effort submissions.
Acknowledgement
Fixes #1966
Change
In non-MPI builds,
s_mpi_allreduce_minands_mpi_allreduce_maxinsrc/common/m_mpi_common.fppleft theirintent(out)var_glbundefined. Added#else var_glb = var_loc.s_mpi_allreduce_sumhad the same gap. It is also fixed in the unmerged Keep species mass fractions in [0, 1] by construction instead of clipping #1963; repeated here so this PR stands alone (trivial overlap, same one-line branch).s_mpi_gather_dataleft its allocatablegathered_vectorunallocated without MPI. Added#else gathered_vector = my_vector(single process: the gathered vector is the local one).s_mpi_allreduce_min_vec,s_mpi_allreduce_vectors_sum,s_mpi_allreduce_integer_sum(_vec),s_mpi_reduce_int_sum,s_mpi_reduce_stability_criteria_extrema.s_mpi_reduce_minands_mpi_reduce_maxlocareintent(inout), so the local value is already the result.Affected callers on single-process builds:
s_mpi_allreduce_mininm_boundary_common.fpp(global bounds), ands_mpi_allreduce_max/sumands_mpi_gather_datain post_processm_data_output.fpp(probe/integral output). These now receive the local value instead of garbage.Evidence
./mfc.sh test --no-mpi --no-gpu -j 24 --only IBMon Tuolumne (login node): 61 passed, 0 failed, 708 skipped../mfc.sh formatand./mfc.sh precheckpass.Not verified: no dedicated test exercises these routines in a no-MPI build (the garbage read is not caught by the golden-file tests); the claim that callers now get the local value is from reading the code. MPI builds are unaffected (the change is inside
#else), but I did not run MPI tests.Consolidated into draft PR #2024. This change is retained as a separate commit, and this original description is reproduced in full there. Original discussion remains available here.