From 4e9b987fec6a04bfdf916f4b0e348a34f567d70c Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 29 Nov 2018 15:54:14 -0700 Subject: [PATCH] bug fix in original read_dump for add keep atom count --- src/read_dump.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/read_dump.cpp b/src/read_dump.cpp index 620e84e910..551cc63c9e 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -1050,12 +1050,17 @@ void ReadDump::process_atoms() } } - // if addflag = YESADD + // if addflag = YESADD or KEEPADD, update total atom count + + if (addflag == YESADD || addflag == KEEPADD) { + bigint nblocal = atom->nlocal; + MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); + } + + // if addflag = YESADD, // assign consistent IDs to new snapshot atoms across all procs if (addflag == YESADD) { - bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (atom->natoms < 0 || atom->natoms >= MAXBIGINT) error->all(FLERR,"Too many total atoms"); if (atom->tag_enable) atom->tag_extend(); @@ -1069,7 +1074,6 @@ void ReadDump::process_atoms() memory->destroy(updateflag); memory->destroy(newflag); - } /* ----------------------------------------------------------------------