From f735a669ad01777d78e965ef13b8dd61e79e4e03 Mon Sep 17 00:00:00 2001 From: athomps Date: Thu, 30 Jun 2016 19:25:44 +0000 Subject: [PATCH] Fixed bug in qtype bugfix git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15234 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/MC/fix_atom_swap.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/MC/fix_atom_swap.cpp b/src/MC/fix_atom_swap.cpp index 41a54a64ff..b66569be34 100644 --- a/src/MC/fix_atom_swap.cpp +++ b/src/MC/fix_atom_swap.cpp @@ -251,15 +251,15 @@ void FixAtomSwap::init() } else if (qtype[iswaptype] != atom->q[i]) error->one(FLERR,"All atoms of a swapped type must have the same charge."); } - MPI_Allreduce(&first,&firstall,1,MPI_INT,MPI_MIN,world); - if (firstall) error->all(FLERR,"At least one atom of each swapped type must be present to define charges."); - if (first) qtype[iswaptype] = -DBL_MAX; - MPI_Allreduce(&qtype[iswaptype],&qmax,1,MPI_DOUBLE,MPI_MAX,world); - if (first) qtype[iswaptype] = DBL_MAX; - MPI_Allreduce(&qtype[iswaptype],&qmin,1,MPI_DOUBLE,MPI_MIN,world); - if (qmax != qmin) error->all(FLERR,"All atoms of a swapped type must have same charge."); } } + MPI_Allreduce(&first,&firstall,1,MPI_INT,MPI_MIN,world); + if (firstall) error->all(FLERR,"At least one atom of each swapped type must be present to define charges."); + if (first) qtype[iswaptype] = -DBL_MAX; + MPI_Allreduce(&qtype[iswaptype],&qmax,1,MPI_DOUBLE,MPI_MAX,world); + if (first) qtype[iswaptype] = DBL_MAX; + MPI_Allreduce(&qtype[iswaptype],&qmin,1,MPI_DOUBLE,MPI_MIN,world); + if (qmax != qmin) error->all(FLERR,"All atoms of a swapped type must have same charge."); } }