enforce that the number of neighbors cannot be negative (e.g. w/o neighbor list)

This commit is contained in:
Axel Kohlmeyer
2022-05-06 17:45:01 -04:00
parent 21d3de65e6
commit 00bb566893

View File

@ -483,7 +483,7 @@ void Finish::end(int flag)
if (neighflag) { if (neighflag) {
if (me == 0) utils::logmesg(lmp,"\n"); if (me == 0) utils::logmesg(lmp,"\n");
tmp = MAX(nneigh,nneighfull); tmp = MAX(MAX(nneigh,nneighfull),0.0);
double nall; double nall;
MPI_Allreduce(&tmp,&nall,1,MPI_DOUBLE,MPI_SUM,world); MPI_Allreduce(&tmp,&nall,1,MPI_DOUBLE,MPI_SUM,world);