Unverified Commit 1f210a24 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1234 from lammps/read-dump-keep

bug-fix for miscounting atoms for read_dump add keep
parents e4ca5b18 f92e61c5
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -480,11 +480,16 @@ void ReadDump::atoms()
    nread += nchunk;
  }

  // if addflag = YESADD, assign IDs to new snapshot atoms
  // if addflag = YESADD or KEEPADD, update total atom count

  if (addflag == YESADD) {
  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 IDs to new snapshot atoms

  if (addflag == YESADD) {
    if (atom->natoms < 0 || atom->natoms >= MAXBIGINT)
      error->all(FLERR,"Too many total atoms");
    if (atom->tag_enable) atom->tag_extend();