git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5504 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -43,7 +43,8 @@ using namespace LAMMPS_NS;
|
||||
|
||||
// same as write_restart.cpp
|
||||
|
||||
enum{VERSION,UNITS,NTIMESTEP,DIMENSION,NPROCS,PROCGRID_0,PROCGRID_1,PROCGRID_2,
|
||||
enum{VERSION,SMALLINT,TAGINT,BIGINT,
|
||||
UNITS,NTIMESTEP,DIMENSION,NPROCS,PROCGRID_0,PROCGRID_1,PROCGRID_2,
|
||||
NEWTON_PAIR,NEWTON_BOND,XPERIODIC,YPERIODIC,ZPERIODIC,
|
||||
BOUNDARY_00,BOUNDARY_01,BOUNDARY_10,BOUNDARY_11,BOUNDARY_20,BOUNDARY_21,
|
||||
ATOM_STYLE,NATOMS,NTYPES,
|
||||
@ -296,28 +297,38 @@ void ReadRestart::command(int narg, char **arg)
|
||||
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
|
||||
if (me == 0) {
|
||||
if (screen) fprintf(screen," %lu atoms\n",natoms);
|
||||
if (logfile) fprintf(logfile," %lu atoms\n",natoms);
|
||||
char str[32];
|
||||
sprintf(str," %s atoms\n",BIGINT_FORMAT);
|
||||
if (screen) fprintf(screen,str,natoms);
|
||||
if (logfile) fprintf(logfile,str,natoms);
|
||||
}
|
||||
|
||||
if (natoms != atom->natoms) error->all("Did not assign all atoms correctly");
|
||||
|
||||
if (me == 0) {
|
||||
if (atom->nbonds) {
|
||||
if (screen) fprintf(screen," %lu bonds\n",atom->nbonds);
|
||||
if (logfile) fprintf(logfile," %lu bonds\n",atom->nbonds);
|
||||
char str[32];
|
||||
sprintf(str," %s bonds\n",BIGINT_FORMAT);
|
||||
if (screen) fprintf(screen,str,atom->nbonds);
|
||||
if (logfile) fprintf(logfile,str,atom->nbonds);
|
||||
}
|
||||
if (atom->nangles) {
|
||||
if (screen) fprintf(screen," %lu angles\n",atom->nangles);
|
||||
if (logfile) fprintf(logfile," %lu angles\n",atom->nangles);
|
||||
char str[32];
|
||||
sprintf(str," %s angles\n",BIGINT_FORMAT);
|
||||
if (screen) fprintf(screen,str,atom->nangles);
|
||||
if (logfile) fprintf(logfile,str,atom->nangles);
|
||||
}
|
||||
if (atom->ndihedrals) {
|
||||
if (screen) fprintf(screen," %lu dihedrals\n",atom->ndihedrals);
|
||||
if (logfile) fprintf(logfile," %lu dihedrals\n",atom->ndihedrals);
|
||||
char str[32];
|
||||
sprintf(str," %s dihedrals\n",BIGINT_FORMAT);
|
||||
if (screen) fprintf(screen,str,atom->ndihedrals);
|
||||
if (logfile) fprintf(logfile,str,atom->ndihedrals);
|
||||
}
|
||||
if (atom->nimpropers) {
|
||||
if (screen) fprintf(screen," %lu impropers\n",atom->nimpropers);
|
||||
if (logfile) fprintf(logfile," %lu impropers\n",atom->nimpropers);
|
||||
char str[32];
|
||||
sprintf(str," %s impropers\n",BIGINT_FORMAT);
|
||||
if (screen) fprintf(screen,str,atom->nimpropers);
|
||||
if (logfile) fprintf(logfile,str,atom->nimpropers);
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,6 +466,21 @@ void ReadRestart::header()
|
||||
version,universe->version);
|
||||
}
|
||||
delete [] version;
|
||||
|
||||
// check lmptype.h sizes, error if different
|
||||
|
||||
} else if (flag == SMALLINT) {
|
||||
int size = read_int();
|
||||
if (size != sizeof(smallint))
|
||||
error->all("Smallint setting in lmptype.h is not compatible");
|
||||
} else if (flag == TAGINT) {
|
||||
int size = read_int();
|
||||
if (size != sizeof(tagint))
|
||||
error->all("Tagint setting in lmptype.h is not compatible");
|
||||
} else if (flag == BIGINT) {
|
||||
int size = read_int();
|
||||
if (size != sizeof(bigint))
|
||||
error->all("Bigint setting in lmptype.h is not compatible");
|
||||
|
||||
// reset unit_style only if different
|
||||
// so that timestep,neighbor-skin are not changed
|
||||
@ -465,7 +491,9 @@ void ReadRestart::header()
|
||||
delete [] style;
|
||||
|
||||
} else if (flag == NTIMESTEP) {
|
||||
update->ntimestep = read_int();
|
||||
// placeholder until ntimestep is 8-bytes
|
||||
bigint ntimestep = read_bigint();
|
||||
update->ntimestep = static_cast<int> (ntimestep);
|
||||
|
||||
// set dimension from restart file
|
||||
|
||||
|
||||
Reference in New Issue
Block a user