diff -Naur lammps-30Jun09/src/REAX/fix_reax_bonds.cpp lammps-1Jul09/src/REAX/fix_reax_bonds.cpp --- lammps-30Jun09/src/REAX/fix_reax_bonds.cpp 2009-06-22 15:26:19.000000000 -0600 +++ lammps-1Jul09/src/REAX/fix_reax_bonds.cpp 2009-06-30 09:00:08.000000000 -0600 @@ -57,7 +57,7 @@ FixReaxBonds::~FixReaxBonds() { - if (fp && me == 0) fclose(fp); + if (me == 0) fclose(fp); } /* ---------------------------------------------------------------------- */ @@ -93,7 +93,7 @@ void FixReaxBonds::end_of_step() { OutputReaxBonds(update->ntimestep,fp); - fflush(fp); + if (me == 0) fflush(fp); } /* ---------------------------------------------------------------------- */ @@ -102,13 +102,12 @@ { int nparticles,nparticles_tot,nbuf,nbuf_local,most,j; int ii,jn,mbond,numbonds,nsbmax,nsbmax_most; - int node,nprocs,nlocal_tmp,itmp; + int nprocs,nlocal_tmp,itmp; double cutof3; double *buf; MPI_Request irequest; MPI_Status istatus; - node = me; MPI_Comm_size(world,&nprocs); nparticles = atom->nlocal; @@ -120,7 +119,7 @@ MPI_Allreduce(&nparticles,&most,1,MPI_INT,MPI_MAX,world); MPI_Allreduce(&nsbmax,&nsbmax_most,1,MPI_INT,MPI_MAX,world); - if (node == 0) { + if (me == 0) { fprintf(fp,"# Timestep %d \n",timestep); fprintf(fp,"# \n"); fprintf(fp,"# Number of particles %d \n",nparticles_tot); @@ -174,9 +173,8 @@ // node 0 pings each node, receives their buffer, writes to file // all other nodes wait for ping, send buffer to node 0 - if (node == 0) { - - for (int inode = 0;inode nsbmax_most"); error->one(str); } + // print connection table - for (k=2;k<2+numbonds;k++) { + + for (k=2;k<2+numbonds;k++) fprintf(fp," %d",nint(buf[j+k])); - } fprintf(fp," %d",nint(buf[j+k])); j+=(3+numbonds); + // print bond orders - for (k=0;ksfree(buf); }