From e378532003d9f58cb52adab42811f275018eebf8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 25 Sep 2020 17:31:49 -0400 Subject: [PATCH] avoid 32-bit integer overflow --- src/reset_atom_ids.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/reset_atom_ids.cpp b/src/reset_atom_ids.cpp index bf642533d5..55513a1109 100644 --- a/src/reset_atom_ids.cpp +++ b/src/reset_atom_ids.cpp @@ -368,9 +368,9 @@ void ResetIDs::sort() // bins are numbered from 0 to Nbins-1 bigint nbins = (bigint) nbinx*nbiny*nbinz; - int nlo = nbins / nprocs; - int nhi = nlo + 1; - int nplo = nprocs - (nbins % nprocs); + bigint nlo = nbins / nprocs; + bigint nhi = nlo + 1; + bigint nplo = nprocs - (nbins % nprocs); bigint nbinlo = nplo*nlo; if (me < nplo) {