Commit cfe0d02a authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1723 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent cc5def9f
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -59,12 +59,14 @@ void DumpBond::init()

void DumpBond::write_header(int ndump)
{
  if (me == 0) {
    fprintf(fp,"ITEM: TIMESTEP\n");
    fprintf(fp,"%d\n",update->ntimestep);
    fprintf(fp,"ITEM: NUMBER OF BONDS\n");
    fprintf(fp,"%d\n",ndump);
    fprintf(fp,"ITEM: BONDS\n");
  }
}

/* ---------------------------------------------------------------------- */

+5 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ void DumpXTC::openfile()

void DumpXTC::write_header(int n)
{
  // realloc coords if necessary
  // all procs realloc types & coords if necessary

  if (n != natoms) {
    memory->sfree(coords);
@@ -161,6 +161,10 @@ void DumpXTC::write_header(int n)
    coords = (float *) memory->smalloc(3*natoms*sizeof(float),"dump:coords");
  }

  // only proc 0 writes header

  if (me != 0) return;

  int tmp = XTC_MAGIC;
  xdr_int(&xd,&tmp);
  xdr_int(&xd,&n);
+2 −2
Original line number Diff line number Diff line
@@ -602,7 +602,7 @@ void Atom::tag_extend()

/* ----------------------------------------------------------------------
   check if atom tags are consecutive from 1 to Natoms
   return 0 if any tag <= 0 or maxtag > Natoms
   return 0 if any tag <= 0 or maxtag != Natoms
   return 1 if OK (doesn't actually check if all tag values are used)
------------------------------------------------------------------------- */

@@ -620,7 +620,7 @@ int Atom::tag_consecutive()
  }
  MPI_Allreduce(check,check_all,2,MPI_INT,MPI_MAX,world);

  if (check_all[0] || check_all[1] > natoms) return 0;
  if (check_all[0] || check_all[1] != static_cast<int> (natoms)) return 0;
  return 1;
}

+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ void Dump::write()
  // write timestep header

  if (multiproc) write_header(nme);
  else if (me == 0) write_header(ntotal);
  else write_header(ntotal);

  // grow communication buffer if necessary

+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ int DumpAtom::modify_param(int narg, char **arg)

void DumpAtom::write_header(int ndump)
{
  (this->*header_choice)(ndump);
  if (me == 0) (this->*header_choice)(ndump);
}

/* ---------------------------------------------------------------------- */
Loading