s_mpi_allreduce_integer_sum integer overflow #1601#1605
Conversation
Claude Code ReviewHead SHA: 0b38165 Files changed:
Findings[Correctness / Compiler Portability] Breaking API change in a shared common module
- integer, intent(in) :: var_loc
- integer, intent(out) :: var_glb
+ integer(kind=8), intent(in) :: var_loc
+ integer(kind=8), intent(out) :: var_glb[Compiler Portability] The - call MPI_ALLREDUCE(var_loc, var_glb, 1, MPI_INTEGER, MPI_SUM, MPI_COMM_WORLD, ierr)
+ call MPI_ALLREDUCE(var_loc, var_glb, 1, MPI_INTEGER8, MPI_SUM, MPI_COMM_WORLD, ierr)Per the MPI-3 standard (§6.9.2), |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1605 +/- ##
=======================================
Coverage 60.51% 60.52%
=======================================
Files 83 83
Lines 19905 19904 -1
Branches 2950 2950
=======================================
Hits 12046 12046
+ Misses 5866 5865 -1
Partials 1993 1993 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Fixes integer overflow when counting the number of ghost points at exascale. Simple modification made to the
s_mpi_allreduce_integer_sumsubroutines to accept 8-byte integers instead of 4-byte.Closes #1601
Type of change (delete unused ones)
Testing
I attempted to recreate the bug locally by using 2 ranks, setting both of their sums to just-below the integer limit, and summing them together, which would normally create an overflow. But instead, the correct value was retrieved.
Checklist
__Check these like this
[x]to indicate which of the below applies.