diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index 2f530370ed..ea911e25c4 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -1481,12 +1481,10 @@ void PPPM::particle_map() if (nx+nlower < nxlo_out || nx+nupper > nxhi_out || ny+nlower < nylo_out || ny+nupper > nyhi_out || - nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag++; + nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag = 1; } - int flag_all; - MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world); - if (flag_all) error->all("Out of range atoms - cannot compute PPPM"); + if (flag) error->one("Out of range atoms - cannot compute PPPM"); } /* ----------------------------------------------------------------------