From 85aa73903ca86e90d59b6fc8f61ac63ac95b1cd3 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Tue, 28 Jun 2011 16:07:57 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6476 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/finish.cpp | 25 ++++++++++++------------- src/thermo.cpp | 7 ++++++- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/finish.cpp b/src/finish.cpp index 25e4653479..9fe68ec2d0 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -46,7 +46,6 @@ void Finish::end(int flag) int loopflag,minflag,prdflag,tadflag,timeflag,fftflag,histoflag,neighflag; double time,tmp,ave,max,min; double time_loop,time_other; - bigint natoms; int me,nprocs; MPI_Comm_rank(world,&me); @@ -83,20 +82,16 @@ void Finish::end(int flag) time_loop = tmp/nprocs; // overall loop time - // use actual natoms, in case atoms were lost - - bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (me == 0) { if (screen) fprintf(screen, "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT " atoms\n", - time_loop,nprocs,update->nsteps,natoms); + time_loop,nprocs,update->nsteps,atom->natoms); if (logfile) fprintf(logfile, "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT " atoms\n", - time_loop,nprocs,update->nsteps,natoms); + time_loop,nprocs,update->nsteps,atom->natoms); } if (time_loop == 0.0) time_loop = 1.0; @@ -585,9 +580,11 @@ void Finish::end(int flag) fprintf(screen, "Total # of neighbors = %d\n",static_cast (nall)); else fprintf(screen,"Total # of neighbors = %g\n",nall); - if (natoms > 0) fprintf(screen,"Ave neighs/atom = %g\n",nall/natoms); - if (atom->molecular && natoms > 0) - fprintf(screen,"Ave special neighs/atom = %g\n",nspec_all/natoms); + if (atom->natoms > 0) + fprintf(screen,"Ave neighs/atom = %g\n",nall/atom->natoms); + if (atom->molecular && atom->natoms > 0) + fprintf(screen,"Ave special neighs/atom = %g\n", + nspec_all/atom->natoms); fprintf(screen,"Neighbor list builds = %d\n",neighbor->ncalls); fprintf(screen,"Dangerous builds = %d\n",neighbor->ndanger); } @@ -596,9 +593,11 @@ void Finish::end(int flag) fprintf(logfile, "Total # of neighbors = %d\n",static_cast (nall)); else fprintf(logfile,"Total # of neighbors = %g\n",nall); - if (natoms > 0) fprintf(logfile,"Ave neighs/atom = %g\n",nall/natoms); - if (atom->molecular && natoms > 0) - fprintf(logfile,"Ave special neighs/atom = %g\n",nspec_all/natoms); + if (atom->natoms > 0) + fprintf(logfile,"Ave neighs/atom = %g\n",nall/atom->natoms); + if (atom->molecular && atom->natoms > 0) + fprintf(logfile,"Ave special neighs/atom = %g\n", + nspec_all/atom->natoms); fprintf(logfile,"Neighbor list builds = %d\n",neighbor->ncalls); fprintf(logfile,"Dangerous builds = %d\n",neighbor->ndanger); } diff --git a/src/thermo.cpp b/src/thermo.cpp index e4892c19d8..700ada3b85 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -372,7 +372,10 @@ bigint Thermo::lost_check() // if not checking or already warned, just return if (lostflag == IGNORE) return ntotal; - if (lostflag == WARN && lostbefore == 1) return ntotal; + if (lostflag == WARN && lostbefore == 1) { + atom->natoms = ntotal; + return ntotal; + } // error message @@ -391,6 +394,8 @@ bigint Thermo::lost_check() "Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT, atom->natoms,ntotal); if (me == 0) error->warning(str,0); + + atom->natoms = ntotal; lostbefore = 1; return ntotal; }