must call Error::all() from all MPI ranks.

This commit is contained in:
Axel Kohlmeyer
2024-09-05 23:22:04 -04:00
parent 87f022576d
commit bea24c70a6
3 changed files with 4 additions and 4 deletions

View File

@ -218,7 +218,7 @@ void FixChargeRegulation::init() {
int flagall = flag; int flagall = flag;
MPI_Allreduce(&flag, &flagall, 1, MPI_INT, MPI_SUM, world); MPI_Allreduce(&flag, &flagall, 1, MPI_INT, MPI_SUM, world);
if (flagall && comm->me == 0) if (flagall)
error->all(FLERR, "fix charge/regulation cannot exchange " error->all(FLERR, "fix charge/regulation cannot exchange "
"individual atoms (ions) belonging to a molecule"); "individual atoms (ions) belonging to a molecule");
} }

View File

@ -564,7 +564,7 @@ void FixGCMC::init()
if (molecule[i]) flag = 1; if (molecule[i]) flag = 1;
int flagall; int flagall;
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall && comm->me == 0) if (flagall)
error->all(FLERR, "Fix gcmc cannot exchange individual atoms belonging to a molecule"); error->all(FLERR, "Fix gcmc cannot exchange individual atoms belonging to a molecule");
} }
@ -579,7 +579,7 @@ void FixGCMC::init()
if (molecule[i] == 0) flag = 1; if (molecule[i] == 0) flag = 1;
int flagall; int flagall;
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall && comm->me == 0) if (flagall)
error->all(FLERR, "All mol IDs should be set for fix gcmc group atoms"); error->all(FLERR, "All mol IDs should be set for fix gcmc group atoms");
} }

View File

@ -356,7 +356,7 @@ void FixWidom::init()
if (molecule[i] == 0) flag = 1; if (molecule[i] == 0) flag = 1;
int flagall; int flagall;
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall && comm->me == 0) if (flagall)
error->all(FLERR, "All mol IDs should be set for fix widom group atoms"); error->all(FLERR, "All mol IDs should be set for fix widom group atoms");
} }