Skip to content

Commit

Permalink
Merge pull request #643 from eschnett/patch-1
Browse files Browse the repository at this point in the history
Always check MPI buffer size for overflow
  • Loading branch information
WeiqunZhang authored Dec 31, 2019
2 parents 58e8b4d + ff3264f commit f71cef8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Src/Base/AMReX_FabArrayCommI.H
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ FabArray<FAB>::FBEP_nowait (int scomp, int ncomp, const IntVect& nghost,
nbytes += (*this)[cct.srcIndex].nBytes(cct.sbox,scomp,ncomp);
}

BL_ASSERT(nbytes < std::size_t(std::numeric_limits<int>::max()));
AMREX_ALWAYS_ASSERT(nbytes < std::size_t(std::numeric_limits<int>::max()));

total_volume += nbytes;

Expand Down Expand Up @@ -448,7 +448,7 @@ FabArray<FAB>::ParallelCopy (const FabArray<FAB>& src,
nbytes += src[cct.srcIndex].nBytes(cct.sbox,SC,NC);
}

BL_ASSERT(nbytes < std::size_t(std::numeric_limits<int>::max()));
AMREX_ALWAYS_ASSERT(nbytes < std::size_t(std::numeric_limits<int>::max()));

total_volume += nbytes;

Expand Down Expand Up @@ -672,7 +672,7 @@ FabArray<FAB>::PostRcvs (const MapOfCopyComTagContainers& m_RcvTags,
nbytes += (*this)[cct.dstIndex].nBytes(cct.dbox,icomp,ncomp);
}

BL_ASSERT(nbytes < std::size_t(std::numeric_limits<int>::max()));
AMREX_ALWAYS_ASSERT(nbytes < std::size_t(std::numeric_limits<int>::max()));

TotalRcvsVolume += nbytes;

Expand Down

0 comments on commit f71cef8

Please sign in to comment.