git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13952 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2015-08-28 23:41:05 +00:00
parent 4e247c3b8c
commit 6b854b397c
4 changed files with 58 additions and 4 deletions

View File

@ -27,6 +27,7 @@
#include "group.h"
#include "input.h"
#include "modify.h"
#include "neighbor.h"
#include "output.h"
#include "region.h"
#include "universe.h"
@ -237,6 +238,24 @@ void Info::command(int narg, char **arg)
fprintf(out,"MPI library level: MPI v%d.%d\n",major,minor);
fprintf(out,"Comm style = %s, Comm layout = %s\n",
commstyles[comm->style], commlayout[comm->layout]);
fprintf(out,"Communicate velocities for ghost atoms = %s\n",
comm->ghost_velocity ? "yes" : "no");
if (comm->mode == 0) {
fprintf(out,"Communication mode = single\n");
fprintf(out,"Communication cutoff = %g\n",
MAX(comm->cutghostuser,neighbor->cutneighmax));
}
if (comm->mode == 1) {
fprintf(out,"Communication mode = multi\n");
double cut;
for (int i=1; i <= atom->ntypes && neighbor->cuttype; ++i) {
cut = neighbor->cuttype[i];
if (comm->cutusermulti) cut = MAX(cut,comm->cutusermulti[i]);
fprintf(out,"Communication cutoff for type %d = %g\n", i, cut);
}
}
fprintf(out,"Nprocs = %d Nthreads = %d\n",
comm->nprocs, comm->nthreads);
fprintf(out,"Processor grid = %d x %d x %d\n",comm->procgrid[0],

View File

@ -546,6 +546,20 @@ LAMMPS::~LAMMPS()
delete citeme;
int me = comm->me;
double totalclock = MPI_Wtime() - initclock;
if ((me == 0) && (screen || logfile)) {
char outtime[128];
int seconds = fmod(totalclock,60.0);
totalclock = (totalclock - seconds) / 60.0;
int minutes = fmod(totalclock,60.0);
int hours = (totalclock - minutes) / 60.0;
sprintf(outtime,"Total wall time: "
"%d:%02d:%02d\n", hours, minutes, seconds);
if (screen) fputs(outtime,screen);
if (logfile) fputs(outtime,logfile);
}
if (universe->nworlds == 1) {
if (screen && screen != stdout) fclose(screen);
if (logfile) fclose(logfile);
@ -716,21 +730,37 @@ void LAMMPS::init()
void LAMMPS::destroy()
{
delete update;
update = NULL;
delete neighbor;
neighbor = NULL;
delete comm;
comm = NULL;
delete force;
force = NULL;
delete group;
group = NULL;
delete output;
output = NULL;
delete modify; // modify must come after output, force, update
// since they delete fixes
modify = NULL;
delete domain; // domain must come after modify
// since fix destructors access domain
domain = NULL;
delete atom; // atom must come after modify, neighbor
// since fixes delete callbacks in atom
delete timer;
atom = NULL;
modify = NULL; // necessary since input->variable->varreader
// will be destructed later
delete timer;
timer = NULL;
}
/* ----------------------------------------------------------------------

View File

@ -84,6 +84,7 @@ Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp)
cluster_check = 0;
binatomflag = 1;
cutneighmax = 0.0;
cutneighsq = NULL;
cutneighghostsq = NULL;
cuttype = NULL;

View File

@ -298,6 +298,7 @@ void ReadData::command(int narg, char **arg)
nbonds = nangles = ndihedrals = nimpropers = 0;
nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0;
triclinic = 0;
keyword[0] = '\0';
int nlocal_previous = atom->nlocal;
int firstpass = 1;
@ -1763,7 +1764,10 @@ void ReadData::parse_keyword(int first)
if (fgets(line,MAXLINE,fp) == NULL) eof = 1;
} else done = 1;
}
if (fgets(buffer,MAXLINE,fp) == NULL) eof = 1;
if (fgets(buffer,MAXLINE,fp) == NULL) {
eof = 1;
buffer[0] = '\0';
}
}
// if eof, set keyword empty and return