git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5504 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_ellipsoid.h"
|
#include "atom_vec_ellipsoid.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "math_extra.h"
|
#include "math_extra.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
@ -62,6 +63,8 @@ void AtomVecEllipsoid::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_colloid.h"
|
#include "atom_vec_colloid.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
@ -58,6 +59,8 @@ void AtomVecColloid::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_dipole.h"
|
#include "atom_vec_dipole.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -57,6 +58,8 @@ void AtomVecDipole::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "atom_vec_granular.h"
|
#include "atom_vec_granular.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -80,6 +81,8 @@ void AtomVecGranular::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
|
|||||||
@ -484,20 +484,22 @@ void FixPour::pre_exchange()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set tag # of new particles beyond all previous atoms
|
|
||||||
// reset global natoms
|
// reset global natoms
|
||||||
|
// set tag # of new particles beyond all previous atoms
|
||||||
// if global map exists, reset it now instead of waiting for comm
|
// if global map exists, reset it now instead of waiting for comm
|
||||||
// since deleting atoms messes up ghosts
|
// since deleting atoms messes up ghosts
|
||||||
|
|
||||||
|
if (nnear - nprevious > 0) {
|
||||||
|
atom->natoms += nnear - nprevious;
|
||||||
if (atom->tag_enable) {
|
if (atom->tag_enable) {
|
||||||
atom->tag_extend();
|
atom->tag_extend();
|
||||||
atom->natoms += nnear - nprevious;
|
|
||||||
if (atom->map_style) {
|
if (atom->map_style) {
|
||||||
atom->nghost = 0;
|
atom->nghost = 0;
|
||||||
atom->map_init();
|
atom->map_init();
|
||||||
atom->map_set();
|
atom->map_set();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// free local memory
|
// free local memory
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_angle.h"
|
#include "atom_vec_angle.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -59,6 +60,8 @@ void AtomVecAngle::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_bond.h"
|
#include "atom_vec_bond.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -59,6 +60,8 @@ void AtomVecBond::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_full.h"
|
#include "atom_vec_full.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -59,6 +60,8 @@ void AtomVecFull::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_molecular.h"
|
#include "atom_vec_molecular.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -59,6 +60,8 @@ void AtomVecMolecular::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
#include "float.h"
|
#include "float.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_peri.h"
|
#include "atom_vec_peri.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -60,6 +61,8 @@ void AtomVecPeri::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
|
|||||||
@ -300,12 +300,12 @@ void FixPeriNeigh::setup(int vflag)
|
|||||||
if (screen) {
|
if (screen) {
|
||||||
fprintf(screen,"Peridynamic bonds:\n");
|
fprintf(screen,"Peridynamic bonds:\n");
|
||||||
fprintf(screen," total # of bonds = %d\n",nall);
|
fprintf(screen," total # of bonds = %d\n",nall);
|
||||||
fprintf(screen," bonds/atom = %g\n",nall/atom->natoms);
|
fprintf(screen," bonds/atom = %g\n",(double)nall/atom->natoms);
|
||||||
}
|
}
|
||||||
if (logfile) {
|
if (logfile) {
|
||||||
fprintf(logfile,"Peridynamic bonds:\n");
|
fprintf(logfile,"Peridynamic bonds:\n");
|
||||||
fprintf(logfile," total # of bonds = %d\n",nall);
|
fprintf(logfile," total # of bonds = %d\n",nall);
|
||||||
fprintf(logfile," bonds/atom = %g\n",nall/atom->natoms);
|
fprintf(logfile," bonds/atom = %g\n",(double)nall/atom->natoms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -376,13 +376,14 @@ void PRD::command(int narg, char **arg)
|
|||||||
neighbor->ndanger = ndanger;
|
neighbor->ndanger = ndanger;
|
||||||
|
|
||||||
if (me_universe == 0) {
|
if (me_universe == 0) {
|
||||||
|
char str[128];
|
||||||
|
sprintf(str,"Loop time of %%g on %%d procs for %%d steps with %s atoms\n",
|
||||||
|
BIGINT_FORMAT);
|
||||||
if (universe->uscreen)
|
if (universe->uscreen)
|
||||||
fprintf(universe->uscreen,
|
fprintf(universe->uscreen,str,
|
||||||
"Loop time of %g on %d procs for %d steps with %lu atoms\n",
|
|
||||||
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
|
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
|
||||||
if (universe->ulogfile)
|
if (universe->ulogfile)
|
||||||
fprintf(universe->ulogfile,
|
fprintf(universe->ulogfile,str,
|
||||||
"Loop time of %g on %d procs for %d steps with %lu atoms\n",
|
|
||||||
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
|
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -385,13 +385,14 @@ void TAD::command(int narg, char **arg)
|
|||||||
neighbor->ndanger = ndanger;
|
neighbor->ndanger = ndanger;
|
||||||
|
|
||||||
if (me_universe == 0) {
|
if (me_universe == 0) {
|
||||||
|
char str[128];
|
||||||
|
sprintf(str,"Loop time of %%g on %%d procs for %%d steps with %s atoms\n",
|
||||||
|
BIGINT_FORMAT);
|
||||||
if (universe->uscreen)
|
if (universe->uscreen)
|
||||||
fprintf(universe->uscreen,
|
fprintf(universe->uscreen,str,
|
||||||
"Loop time of %g on %d procs for %d steps with %lu atoms\n",
|
|
||||||
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
|
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
|
||||||
if (universe->ulogfile)
|
if (universe->ulogfile)
|
||||||
fprintf(universe->ulogfile,
|
fprintf(universe->ulogfile,str,
|
||||||
"Loop time of %g on %d procs for %d steps with %lu atoms\n",
|
|
||||||
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
|
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2315,9 +2315,11 @@ void FixSRD::parameterize()
|
|||||||
// print SRD parameters
|
// print SRD parameters
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
|
char str[64];
|
||||||
|
sprintf(str," SRD/big particles = %s %s\n",BIGINT_FORMAT,BIGINT_FORMAT);
|
||||||
if (screen) {
|
if (screen) {
|
||||||
fprintf(screen,"SRD info:\n");
|
fprintf(screen,"SRD info:\n");
|
||||||
fprintf(screen," SRD/big particles = %lu %lu\n",nsrd,mbig);
|
fprintf(screen,str,nsrd,mbig);
|
||||||
fprintf(screen," big particle diameter max/min = %g %g\n",
|
fprintf(screen," big particle diameter max/min = %g %g\n",
|
||||||
maxbigdiam,minbigdiam);
|
maxbigdiam,minbigdiam);
|
||||||
fprintf(screen," SRD temperature & lamda = %g %g\n",
|
fprintf(screen," SRD temperature & lamda = %g %g\n",
|
||||||
@ -2332,7 +2334,7 @@ void FixSRD::parameterize()
|
|||||||
}
|
}
|
||||||
if (logfile) {
|
if (logfile) {
|
||||||
fprintf(logfile,"SRD info:\n");
|
fprintf(logfile,"SRD info:\n");
|
||||||
fprintf(logfile," SRD/big particles = %lu %lu\n",nsrd,mbig);
|
fprintf(logfile,str,nsrd,mbig);
|
||||||
fprintf(logfile," big particle diameter max/min = %g %g\n",
|
fprintf(logfile," big particle diameter max/min = %g %g\n",
|
||||||
maxbigdiam,minbigdiam);
|
maxbigdiam,minbigdiam);
|
||||||
fprintf(logfile," SRD temperature & lamda = %g %g\n",
|
fprintf(logfile," SRD temperature & lamda = %g %g\n",
|
||||||
|
|||||||
@ -44,7 +44,7 @@ elif (test $1 = 0) then
|
|||||||
rm ../compute_temp_deform_eff.cpp
|
rm ../compute_temp_deform_eff.cpp
|
||||||
rm ../compute_temp_eff.cpp
|
rm ../compute_temp_eff.cpp
|
||||||
rm ../compute_temp_region_eff.cpp
|
rm ../compute_temp_region_eff.cpp
|
||||||
rm ../fix_langevin_eff.cpp ..
|
rm ../fix_langevin_eff.cpp
|
||||||
rm ../fix_nh_eff.cpp
|
rm ../fix_nh_eff.cpp
|
||||||
rm ../fix_nve_eff.cpp
|
rm ../fix_nve_eff.cpp
|
||||||
rm ../fix_nvt_eff.cpp
|
rm ../fix_nvt_eff.cpp
|
||||||
@ -61,7 +61,7 @@ elif (test $1 = 0) then
|
|||||||
rm ../compute_temp_deform_eff.h
|
rm ../compute_temp_deform_eff.h
|
||||||
rm ../compute_temp_eff.h
|
rm ../compute_temp_eff.h
|
||||||
rm ../compute_temp_region_eff.h
|
rm ../compute_temp_region_eff.h
|
||||||
rm ../fix_langevin_eff.h ..
|
rm ../fix_langevin_eff.h
|
||||||
rm ../fix_nh_eff.h
|
rm ../fix_nh_eff.h
|
||||||
rm ../fix_nve_eff.h
|
rm ../fix_nve_eff.h
|
||||||
rm ../fix_nvt_eff.h
|
rm ../fix_nvt_eff.h
|
||||||
|
|||||||
@ -15,9 +15,9 @@
|
|||||||
Contributing author: Andres Jaramillo-Botero (Caltech)
|
Contributing author: Andres Jaramillo-Botero (Caltech)
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "math.h"
|
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_electron.h"
|
#include "atom_vec_electron.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -63,6 +63,8 @@ void AtomVecElectron::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
@ -102,7 +104,8 @@ void AtomVecElectron::grow_reset()
|
|||||||
tag = atom->tag; type = atom->type;
|
tag = atom->tag; type = atom->type;
|
||||||
mask = atom->mask; image = atom->image;
|
mask = atom->mask; image = atom->image;
|
||||||
x = atom->x; v = atom->v; f = atom->f;
|
x = atom->x; v = atom->v; f = atom->f;
|
||||||
q = atom->q; eradius = atom->eradius; ervel = atom->ervel; erforce = atom->erforce;
|
q = atom->q;
|
||||||
|
eradius = atom->eradius; ervel = atom->ervel; erforce = atom->erforce;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -268,10 +268,8 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (imd_trate < 1)
|
if (imd_trate < 1)
|
||||||
error->all("Illegal fix imd parameter. trate < 1.");
|
error->all("Illegal fix imd parameter. trate < 1.");
|
||||||
|
|
||||||
bigint n;
|
bigint n = group->count(igroup);
|
||||||
if (igroup == group->find("all")) n = atom->natoms;
|
if (n > MAXSMALLINT) error->all("Too many atoms for fix imd");
|
||||||
else n = group->count(igroup);
|
|
||||||
if (n > MAXINT32) error->all("Too many atoms for fix imd");
|
|
||||||
num_coords = static_cast<int> (n);
|
num_coords = static_cast<int> (n);
|
||||||
|
|
||||||
MPI_Comm_rank(world,&me);
|
MPI_Comm_rank(world,&me);
|
||||||
|
|||||||
@ -67,11 +67,9 @@ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
|
|||||||
|
|
||||||
// allocate global array for atom coords
|
// allocate global array for atom coords
|
||||||
|
|
||||||
bigint n;
|
bigint n = group->count(igroup);
|
||||||
if (igroup == 0) n = static_cast<int> (atom->natoms);
|
|
||||||
else n = static_cast<int> (group->count(igroup));
|
|
||||||
if (n > MAXSMALLINT) error->all("Too many atoms for dump xtc");
|
if (n > MAXSMALLINT) error->all("Too many atoms for dump xtc");
|
||||||
natoms = n;
|
natoms = static_cast<int> (n);
|
||||||
|
|
||||||
coords = (float *) memory->smalloc(3*natoms*sizeof(float),"dump:coords");
|
coords = (float *) memory->smalloc(3*natoms*sizeof(float),"dump:coords");
|
||||||
|
|
||||||
@ -136,8 +134,11 @@ void DumpXTC::openfile()
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpXTC::write_header(int n)
|
void DumpXTC::write_header(bigint nbig)
|
||||||
{
|
{
|
||||||
|
if (nbig > MAXSMALLINT) error->all("Too many atoms for dump xtc");
|
||||||
|
int n = nbig;
|
||||||
|
|
||||||
// all procs realloc coords if total count grew
|
// all procs realloc coords if total count grew
|
||||||
|
|
||||||
if (n != natoms) {
|
if (n != natoms) {
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class DumpXTC : public Dump {
|
|||||||
void init_style();
|
void init_style();
|
||||||
int modify_param(int, char **);
|
int modify_param(int, char **);
|
||||||
void openfile();
|
void openfile();
|
||||||
void write_header(int);
|
void write_header(bigint);
|
||||||
int count();
|
int count();
|
||||||
void pack(int *);
|
void pack(int *);
|
||||||
void write_data(int, double *);
|
void write_data(int, double *);
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_atomic.h"
|
#include "atom_vec_atomic.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -53,6 +54,8 @@ void AtomVecAtomic::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_charge.h"
|
#include "atom_vec_charge.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -55,6 +56,8 @@ void AtomVecCharge::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
tag = atom->tag = (int *)
|
tag = atom->tag = (int *)
|
||||||
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
memory->srealloc(atom->tag,nmax*sizeof(int),"atom:tag");
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "atom_vec_hybrid.h"
|
#include "atom_vec_hybrid.h"
|
||||||
|
#include "lmptype.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -112,6 +113,8 @@ void AtomVecHybrid::grow(int n)
|
|||||||
if (n == 0) nmax += DELTA;
|
if (n == 0) nmax += DELTA;
|
||||||
else nmax = n;
|
else nmax = n;
|
||||||
atom->nmax = nmax;
|
atom->nmax = nmax;
|
||||||
|
if (nmax < 0 || nmax > MAXSMALLINT)
|
||||||
|
error->one("Per-processor system is too big");
|
||||||
|
|
||||||
// sub-styles perform all reallocation
|
// sub-styles perform all reallocation
|
||||||
// turn off nextra_grow so hybrid can do that once below
|
// turn off nextra_grow so hybrid can do that once below
|
||||||
|
|||||||
@ -170,14 +170,18 @@ void CreateAtoms::command(int narg, char **arg)
|
|||||||
|
|
||||||
bigint nblocal = atom->nlocal;
|
bigint nblocal = atom->nlocal;
|
||||||
MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||||
|
if (atom->natoms < 0 || atom->natoms > MAXBIGINT)
|
||||||
|
error->all("Too many total atoms");
|
||||||
|
|
||||||
// print status
|
// print status
|
||||||
|
|
||||||
if (comm->me == 0) {
|
if (comm->me == 0) {
|
||||||
|
char str[32];
|
||||||
|
sprintf(str,"Created %s atoms\n",BIGINT_FORMAT);
|
||||||
if (screen)
|
if (screen)
|
||||||
fprintf(screen,"Created %lu atoms\n",atom->natoms-natoms_previous);
|
fprintf(screen,str,atom->natoms-natoms_previous);
|
||||||
if (logfile)
|
if (logfile)
|
||||||
fprintf(logfile,"Created %lu atoms\n",atom->natoms-natoms_previous);
|
fprintf(logfile,str,atom->natoms-natoms_previous);
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset simulation now that more atoms are defined
|
// reset simulation now that more atoms are defined
|
||||||
|
|||||||
@ -105,10 +105,11 @@ void DeleteAtoms::command(int narg, char **arg)
|
|||||||
bigint ndelete = natoms_previous - atom->natoms;
|
bigint ndelete = natoms_previous - atom->natoms;
|
||||||
|
|
||||||
if (comm->me == 0) {
|
if (comm->me == 0) {
|
||||||
if (screen) fprintf(screen,"Deleted %lu atoms, new total = %lu\n",
|
char str[64];
|
||||||
ndelete,atom->natoms);
|
sprintf(str,"Deleted %s atoms, new total = %s\n",
|
||||||
if (logfile) fprintf(logfile,"Deleted %lu atoms, new total = %lu\n",
|
BIGINT_FORMAT,BIGINT_FORMAT);
|
||||||
ndelete,atom->natoms);
|
if (screen) fprintf(screen,str,ndelete,atom->natoms);
|
||||||
|
if (logfile) fprintf(logfile,str,ndelete,atom->natoms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -445,34 +445,34 @@ void DeleteBonds::command(int narg, char **arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (comm->me == 0) {
|
if (comm->me == 0) {
|
||||||
if (screen) {
|
if (atom->avec->bonds_allow) {
|
||||||
if (atom->avec->bonds_allow)
|
char str[128];
|
||||||
fprintf(screen," %lu total bonds, %lu turned on, %lu turned off\n",
|
sprintf(str," %s total bonds, %s turned on, %s turned off\n",
|
||||||
atom->nbonds,bond_on,bond_off);
|
BIGINT_FORMAT,BIGINT_FORMAT,BIGINT_FORMAT);
|
||||||
if (atom->avec->angles_allow)
|
if (screen) fprintf(screen,str,atom->nbonds,bond_on,bond_off);
|
||||||
fprintf(screen," %lu total angles, %lu turned on, %lu turned off\n",
|
if (logfile) fprintf(logfile,str,atom->nbonds,bond_on,bond_off);
|
||||||
atom->nangles,angle_on,angle_off);
|
|
||||||
if (atom->avec->dihedrals_allow)
|
|
||||||
fprintf(screen," %lu total dihedrals, %lu turned on, %lu turned off\n",
|
|
||||||
atom->ndihedrals,dihedral_on,dihedral_off);
|
|
||||||
if (atom->avec->impropers_allow)
|
|
||||||
fprintf(screen," %lu total impropers, %lu turned on, %lu turned off\n",
|
|
||||||
atom->nimpropers,improper_on,improper_off);
|
|
||||||
}
|
}
|
||||||
if (logfile) {
|
if (atom->avec->angles_allow) {
|
||||||
if (atom->avec->bonds_allow)
|
char str[128];
|
||||||
fprintf(logfile," %lu total bonds, %lu turned on, %lu turned off\n",
|
sprintf(str," %s total angles, %s turned on, %s turned off\n",
|
||||||
atom->nbonds,bond_on,bond_off);
|
BIGINT_FORMAT,BIGINT_FORMAT,BIGINT_FORMAT);
|
||||||
if (atom->avec->angles_allow)
|
if (screen) fprintf(screen,str,atom->nangles,angle_on,angle_off);
|
||||||
fprintf(logfile," %lu total angles, %lu turned on, %lu turned off\n",
|
if (logfile) fprintf(logfile,str,atom->nangles,angle_on,angle_off);
|
||||||
atom->nangles,angle_on,angle_off);
|
}
|
||||||
if (atom->avec->dihedrals_allow)
|
if (atom->avec->dihedrals_allow) {
|
||||||
fprintf(logfile," %lu total dihedrals, %lu turned on, "
|
char str[128];
|
||||||
"%lu turned off\n",
|
sprintf(str," %s total dihedrals, %s turned on, %s turned off\n",
|
||||||
|
BIGINT_FORMAT,BIGINT_FORMAT,BIGINT_FORMAT);
|
||||||
|
if (screen) fprintf(screen,str,atom->ndihedrals,dihedral_on,dihedral_off);
|
||||||
|
if (logfile) fprintf(logfile,str,
|
||||||
atom->ndihedrals,dihedral_on,dihedral_off);
|
atom->ndihedrals,dihedral_on,dihedral_off);
|
||||||
if (atom->avec->impropers_allow)
|
}
|
||||||
fprintf(logfile," %lu total impropers, %lu turned on, "
|
if (atom->avec->impropers_allow) {
|
||||||
"%lu turned off\n",
|
char str[128];
|
||||||
|
sprintf(str," %s total impropers, %s turned on, %s turned off\n",
|
||||||
|
BIGINT_FORMAT,BIGINT_FORMAT,BIGINT_FORMAT);
|
||||||
|
if (screen) fprintf(screen,str,atom->nimpropers,improper_on,improper_off);
|
||||||
|
if (logfile) fprintf(logfile,str,
|
||||||
atom->nimpropers,improper_on,improper_off);
|
atom->nimpropers,improper_on,improper_off);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -215,9 +215,10 @@ void DisplaceAtoms::command(int narg, char **arg)
|
|||||||
bigint nblocal = atom->nlocal;
|
bigint nblocal = atom->nlocal;
|
||||||
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||||
if (natoms != atom->natoms) {
|
if (natoms != atom->natoms) {
|
||||||
char str[128];
|
char fstr[64],str[128];
|
||||||
sprintf(str,"Lost atoms via displace_atoms: original %lu current %lu",
|
sprintf(fstr,"Lost atoms via displace_atoms: original %s current %s",
|
||||||
atom->natoms,natoms);
|
BIGINT_FORMAT,BIGINT_FORMAT);
|
||||||
|
sprintf(str,fstr,atom->natoms,natoms);
|
||||||
error->all(str);
|
error->all(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -381,9 +381,10 @@ void DisplaceBox::command(int narg, char **arg)
|
|||||||
bigint nblocal = atom->nlocal;
|
bigint nblocal = atom->nlocal;
|
||||||
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||||
if (natoms != atom->natoms) {
|
if (natoms != atom->natoms) {
|
||||||
char str[128];
|
char fstr[64],str[128];
|
||||||
sprintf(str,"Lost atoms via displace_box: original %lu current %lu",
|
sprintf(fstr,"Lost atoms via displace_box: original %s current %s",
|
||||||
atom->natoms,natoms);
|
BIGINT_FORMAT,BIGINT_FORMAT);
|
||||||
|
sprintf(str,fstr,atom->natoms,natoms);
|
||||||
error->all(str);
|
error->all(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/dump.cpp
10
src/dump.cpp
@ -253,6 +253,7 @@ void Dump::write()
|
|||||||
// nme = # of dump lines this proc will contribute to dump
|
// nme = # of dump lines this proc will contribute to dump
|
||||||
|
|
||||||
nme = count();
|
nme = count();
|
||||||
|
bigint bnme = nme;
|
||||||
|
|
||||||
// ntotal = total # of dump lines
|
// ntotal = total # of dump lines
|
||||||
// nmax = max # of dump lines on any proc
|
// nmax = max # of dump lines on any proc
|
||||||
@ -260,21 +261,24 @@ void Dump::write()
|
|||||||
int nmax;
|
int nmax;
|
||||||
if (multiproc) nmax = nme;
|
if (multiproc) nmax = nme;
|
||||||
else {
|
else {
|
||||||
MPI_Allreduce(&nme,&ntotal,1,MPI_INT,MPI_SUM,world);
|
MPI_Allreduce(&bnme,&ntotal,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||||
MPI_Allreduce(&nme,&nmax,1,MPI_INT,MPI_MAX,world);
|
MPI_Allreduce(&nme,&nmax,1,MPI_INT,MPI_MAX,world);
|
||||||
}
|
}
|
||||||
|
|
||||||
// write timestep header
|
// write timestep header
|
||||||
|
|
||||||
if (multiproc) write_header(nme);
|
if (multiproc) write_header(bnme);
|
||||||
else write_header(ntotal);
|
else write_header(ntotal);
|
||||||
|
|
||||||
// this insures proc 0 can receive everyone's info
|
// insure proc 0 can receive everyone's info
|
||||||
|
// limit nmax*size_one to int since used as arg in MPI_Rsend() below
|
||||||
// pack my data into buf
|
// pack my data into buf
|
||||||
// if sorting on IDs also request ID list from pack()
|
// if sorting on IDs also request ID list from pack()
|
||||||
// sort buf as needed
|
// sort buf as needed
|
||||||
|
|
||||||
if (nmax > maxbuf) {
|
if (nmax > maxbuf) {
|
||||||
|
if ((bigint) nmax * size_one > MAXSMALLINT)
|
||||||
|
error->all("Too much per-proc info for dump");
|
||||||
maxbuf = nmax;
|
maxbuf = nmax;
|
||||||
memory->sfree(buf);
|
memory->sfree(buf);
|
||||||
buf = (double *)
|
buf = (double *)
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
#include "lmptype.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
@ -69,7 +70,7 @@ class Dump : protected Pointers {
|
|||||||
double boxzlo,boxzhi;
|
double boxzlo,boxzhi;
|
||||||
double boxxy,boxxz,boxyz;
|
double boxxy,boxxz,boxyz;
|
||||||
|
|
||||||
int ntotal; // # of per-atom lines in snapshot
|
bigint ntotal; // # of per-atom lines in snapshot
|
||||||
int reorderflag; // 1 if OK to reorder instead of sort
|
int reorderflag; // 1 if OK to reorder instead of sort
|
||||||
int ntotal_reorder; // # of atoms that must be in snapshot
|
int ntotal_reorder; // # of atoms that must be in snapshot
|
||||||
int nme_reorder; // # of atoms I must own in snapshot
|
int nme_reorder; // # of atoms I must own in snapshot
|
||||||
@ -91,7 +92,7 @@ class Dump : protected Pointers {
|
|||||||
virtual void init_style() = 0;
|
virtual void init_style() = 0;
|
||||||
virtual void openfile();
|
virtual void openfile();
|
||||||
virtual int modify_param(int, char **) {return 0;}
|
virtual int modify_param(int, char **) {return 0;}
|
||||||
virtual void write_header(int) = 0;
|
virtual void write_header(bigint) = 0;
|
||||||
virtual int count() = 0;
|
virtual int count() = 0;
|
||||||
virtual void pack(int *) = 0;
|
virtual void pack(int *) = 0;
|
||||||
virtual void write_data(int, double *) = 0;
|
virtual void write_data(int, double *) = 0;
|
||||||
|
|||||||
@ -123,7 +123,7 @@ int DumpAtom::modify_param(int narg, char **arg)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpAtom::write_header(int ndump)
|
void DumpAtom::write_header(bigint ndump)
|
||||||
{
|
{
|
||||||
if (multiproc) (this->*header_choice)(ndump);
|
if (multiproc) (this->*header_choice)(ndump);
|
||||||
else if (me == 0) (this->*header_choice)(ndump);
|
else if (me == 0) (this->*header_choice)(ndump);
|
||||||
@ -160,10 +160,10 @@ void DumpAtom::write_data(int n, double *mybuf)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpAtom::header_binary(int ndump)
|
void DumpAtom::header_binary(bigint ndump)
|
||||||
{
|
{
|
||||||
fwrite(&update->ntimestep,sizeof(int),1,fp);
|
fwrite(&update->ntimestep,sizeof(int),1,fp);
|
||||||
fwrite(&ndump,sizeof(int),1,fp);
|
fwrite(&ndump,sizeof(bigint),1,fp);
|
||||||
fwrite(&domain->triclinic,sizeof(int),1,fp);
|
fwrite(&domain->triclinic,sizeof(int),1,fp);
|
||||||
fwrite(&boxxlo,sizeof(double),1,fp);
|
fwrite(&boxxlo,sizeof(double),1,fp);
|
||||||
fwrite(&boxxhi,sizeof(double),1,fp);
|
fwrite(&boxxhi,sizeof(double),1,fp);
|
||||||
@ -180,10 +180,10 @@ void DumpAtom::header_binary(int ndump)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpAtom::header_binary_triclinic(int ndump)
|
void DumpAtom::header_binary_triclinic(bigint ndump)
|
||||||
{
|
{
|
||||||
fwrite(&update->ntimestep,sizeof(int),1,fp);
|
fwrite(&update->ntimestep,sizeof(int),1,fp);
|
||||||
fwrite(&ndump,sizeof(int),1,fp);
|
fwrite(&ndump,sizeof(bigint),1,fp);
|
||||||
fwrite(&domain->triclinic,sizeof(int),1,fp);
|
fwrite(&domain->triclinic,sizeof(int),1,fp);
|
||||||
fwrite(&boxxlo,sizeof(double),1,fp);
|
fwrite(&boxxlo,sizeof(double),1,fp);
|
||||||
fwrite(&boxxhi,sizeof(double),1,fp);
|
fwrite(&boxxhi,sizeof(double),1,fp);
|
||||||
@ -203,12 +203,12 @@ void DumpAtom::header_binary_triclinic(int ndump)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpAtom::header_item(int ndump)
|
void DumpAtom::header_item(bigint ndump)
|
||||||
{
|
{
|
||||||
fprintf(fp,"ITEM: TIMESTEP\n");
|
fprintf(fp,"ITEM: TIMESTEP\n");
|
||||||
fprintf(fp,"%d\n",update->ntimestep);
|
fprintf(fp,"%d\n",update->ntimestep);
|
||||||
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
|
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
|
||||||
fprintf(fp,"%d\n",ndump);
|
fprintf(fp,BIGINT_FORMAT_NL,ndump);
|
||||||
fprintf(fp,"ITEM: BOX BOUNDS\n");
|
fprintf(fp,"ITEM: BOX BOUNDS\n");
|
||||||
fprintf(fp,"%g %g\n",boxxlo,boxxhi);
|
fprintf(fp,"%g %g\n",boxxlo,boxxhi);
|
||||||
fprintf(fp,"%g %g\n",boxylo,boxyhi);
|
fprintf(fp,"%g %g\n",boxylo,boxyhi);
|
||||||
@ -218,12 +218,12 @@ void DumpAtom::header_item(int ndump)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpAtom::header_item_triclinic(int ndump)
|
void DumpAtom::header_item_triclinic(bigint ndump)
|
||||||
{
|
{
|
||||||
fprintf(fp,"ITEM: TIMESTEP\n");
|
fprintf(fp,"ITEM: TIMESTEP\n");
|
||||||
fprintf(fp,"%d\n",update->ntimestep);
|
fprintf(fp,"%d\n",update->ntimestep);
|
||||||
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
|
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
|
||||||
fprintf(fp,"%d\n",ndump);
|
fprintf(fp,BIGINT_FORMAT_NL,ndump);
|
||||||
fprintf(fp,"ITEM: BOX BOUNDS xy xz yz\n");
|
fprintf(fp,"ITEM: BOX BOUNDS xy xz yz\n");
|
||||||
fprintf(fp,"%g %g %g\n",boxxlo,boxxhi,boxxy);
|
fprintf(fp,"%g %g %g\n",boxxlo,boxxhi,boxxy);
|
||||||
fprintf(fp,"%g %g %g\n",boxylo,boxyhi,boxxz);
|
fprintf(fp,"%g %g %g\n",boxylo,boxyhi,boxxz);
|
||||||
|
|||||||
@ -36,17 +36,17 @@ class DumpAtom : public Dump {
|
|||||||
|
|
||||||
void init_style();
|
void init_style();
|
||||||
int modify_param(int, char **);
|
int modify_param(int, char **);
|
||||||
void write_header(int);
|
void write_header(bigint);
|
||||||
int count();
|
int count();
|
||||||
void pack(int *);
|
void pack(int *);
|
||||||
void write_data(int, double *);
|
void write_data(int, double *);
|
||||||
|
|
||||||
typedef void (DumpAtom::*FnPtrHeader)(int);
|
typedef void (DumpAtom::*FnPtrHeader)(bigint);
|
||||||
FnPtrHeader header_choice; // ptr to write header functions
|
FnPtrHeader header_choice; // ptr to write header functions
|
||||||
void header_binary(int);
|
void header_binary(bigint);
|
||||||
void header_binary_triclinic(int);
|
void header_binary_triclinic(bigint);
|
||||||
void header_item(int);
|
void header_item(bigint);
|
||||||
void header_item_triclinic(int);
|
void header_item_triclinic(bigint);
|
||||||
|
|
||||||
typedef void (DumpAtom::*FnPtrPack)(int *);
|
typedef void (DumpAtom::*FnPtrPack)(int *);
|
||||||
FnPtrPack pack_choice; // ptr to pack functions
|
FnPtrPack pack_choice; // ptr to pack functions
|
||||||
|
|||||||
@ -184,10 +184,12 @@ void DumpCFG::init_style()
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpCFG::write_header(int n)
|
void DumpCFG::write_header(bigint n)
|
||||||
{
|
{
|
||||||
if (me == 0 || multiproc) {
|
if (me == 0 || multiproc) {
|
||||||
fprintf(fp,"Number of particles = %d\n", n);
|
char str[64];
|
||||||
|
sprintf(str,"Number of particles = %s\n",BIGINT_FORMAT);
|
||||||
|
fprintf(fp,str,n);
|
||||||
fprintf(fp,"A = 1.0 Angstrom (basic length-scale)\n");
|
fprintf(fp,"A = 1.0 Angstrom (basic length-scale)\n");
|
||||||
fprintf(fp,"H0(1,1) = %g A\n",domain->xprd);
|
fprintf(fp,"H0(1,1) = %g A\n",domain->xprd);
|
||||||
fprintf(fp,"H0(1,2) = 0 A \n");
|
fprintf(fp,"H0(1,2) = 0 A \n");
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class DumpCFG : public DumpCustom {
|
|||||||
double **rbuf; // buf of data lines for data lines rearrangement
|
double **rbuf; // buf of data lines for data lines rearrangement
|
||||||
|
|
||||||
void init_style();
|
void init_style();
|
||||||
void write_header(int);
|
void write_header(bigint);
|
||||||
void write_data(int, double *);
|
void write_data(int, double *);
|
||||||
|
|
||||||
int modify_param2(int, char **);
|
int modify_param2(int, char **);
|
||||||
|
|||||||
@ -236,7 +236,7 @@ void DumpCustom::init_style()
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpCustom::write_header(int ndump)
|
void DumpCustom::write_header(bigint ndump)
|
||||||
{
|
{
|
||||||
if (multiproc) (this->*header_choice)(ndump);
|
if (multiproc) (this->*header_choice)(ndump);
|
||||||
else if (me == 0) (this->*header_choice)(ndump);
|
else if (me == 0) (this->*header_choice)(ndump);
|
||||||
@ -244,10 +244,10 @@ void DumpCustom::write_header(int ndump)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpCustom::header_binary(int ndump)
|
void DumpCustom::header_binary(bigint ndump)
|
||||||
{
|
{
|
||||||
fwrite(&update->ntimestep,sizeof(int),1,fp);
|
fwrite(&update->ntimestep,sizeof(int),1,fp);
|
||||||
fwrite(&ndump,sizeof(int),1,fp);
|
fwrite(&ndump,sizeof(bigint),1,fp);
|
||||||
fwrite(&domain->triclinic,sizeof(int),1,fp);
|
fwrite(&domain->triclinic,sizeof(int),1,fp);
|
||||||
fwrite(&boxxlo,sizeof(double),1,fp);
|
fwrite(&boxxlo,sizeof(double),1,fp);
|
||||||
fwrite(&boxxhi,sizeof(double),1,fp);
|
fwrite(&boxxhi,sizeof(double),1,fp);
|
||||||
@ -264,10 +264,10 @@ void DumpCustom::header_binary(int ndump)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpCustom::header_binary_triclinic(int ndump)
|
void DumpCustom::header_binary_triclinic(bigint ndump)
|
||||||
{
|
{
|
||||||
fwrite(&update->ntimestep,sizeof(int),1,fp);
|
fwrite(&update->ntimestep,sizeof(int),1,fp);
|
||||||
fwrite(&ndump,sizeof(int),1,fp);
|
fwrite(&ndump,sizeof(bigint),1,fp);
|
||||||
fwrite(&domain->triclinic,sizeof(int),1,fp);
|
fwrite(&domain->triclinic,sizeof(int),1,fp);
|
||||||
fwrite(&boxxlo,sizeof(double),1,fp);
|
fwrite(&boxxlo,sizeof(double),1,fp);
|
||||||
fwrite(&boxxhi,sizeof(double),1,fp);
|
fwrite(&boxxhi,sizeof(double),1,fp);
|
||||||
@ -287,12 +287,12 @@ void DumpCustom::header_binary_triclinic(int ndump)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpCustom::header_item(int ndump)
|
void DumpCustom::header_item(bigint ndump)
|
||||||
{
|
{
|
||||||
fprintf(fp,"ITEM: TIMESTEP\n");
|
fprintf(fp,"ITEM: TIMESTEP\n");
|
||||||
fprintf(fp,"%d\n",update->ntimestep);
|
fprintf(fp,"%d\n",update->ntimestep);
|
||||||
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
|
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
|
||||||
fprintf(fp,"%d\n",ndump);
|
fprintf(fp,BIGINT_FORMAT_NL,ndump);
|
||||||
fprintf(fp,"ITEM: BOX BOUNDS\n");
|
fprintf(fp,"ITEM: BOX BOUNDS\n");
|
||||||
fprintf(fp,"%g %g\n",boxxlo,boxxhi);
|
fprintf(fp,"%g %g\n",boxxlo,boxxhi);
|
||||||
fprintf(fp,"%g %g\n",boxylo,boxyhi);
|
fprintf(fp,"%g %g\n",boxylo,boxyhi);
|
||||||
@ -302,12 +302,12 @@ void DumpCustom::header_item(int ndump)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpCustom::header_item_triclinic(int ndump)
|
void DumpCustom::header_item_triclinic(bigint ndump)
|
||||||
{
|
{
|
||||||
fprintf(fp,"ITEM: TIMESTEP\n");
|
fprintf(fp,"ITEM: TIMESTEP\n");
|
||||||
fprintf(fp,"%d\n",update->ntimestep);
|
fprintf(fp,"%d\n",update->ntimestep);
|
||||||
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
|
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
|
||||||
fprintf(fp,"%d\n",ndump);
|
fprintf(fp,BIGINT_FORMAT_NL,ndump);
|
||||||
fprintf(fp,"ITEM: BOX BOUNDS xy xz yz\n");
|
fprintf(fp,"ITEM: BOX BOUNDS xy xz yz\n");
|
||||||
fprintf(fp,"%g %g %g\n",boxxlo,boxxhi,boxxy);
|
fprintf(fp,"%g %g %g\n",boxxlo,boxxhi,boxxy);
|
||||||
fprintf(fp,"%g %g %g\n",boxylo,boxyhi,boxxz);
|
fprintf(fp,"%g %g %g\n",boxylo,boxyhi,boxxz);
|
||||||
|
|||||||
@ -70,7 +70,7 @@ class DumpCustom : public Dump {
|
|||||||
// private methods
|
// private methods
|
||||||
|
|
||||||
virtual void init_style();
|
virtual void init_style();
|
||||||
virtual void write_header(int);
|
virtual void write_header(bigint);
|
||||||
int count();
|
int count();
|
||||||
void pack(int *);
|
void pack(int *);
|
||||||
virtual void write_data(int, double *);
|
virtual void write_data(int, double *);
|
||||||
@ -83,12 +83,12 @@ class DumpCustom : public Dump {
|
|||||||
int modify_param(int, char **);
|
int modify_param(int, char **);
|
||||||
virtual int modify_param2(int, char **) {return 0;}
|
virtual int modify_param2(int, char **) {return 0;}
|
||||||
|
|
||||||
typedef void (DumpCustom::*FnPtrHeader)(int);
|
typedef void (DumpCustom::*FnPtrHeader)(bigint);
|
||||||
FnPtrHeader header_choice; // ptr to write header functions
|
FnPtrHeader header_choice; // ptr to write header functions
|
||||||
void header_binary(int);
|
void header_binary(bigint);
|
||||||
void header_binary_triclinic(int);
|
void header_binary_triclinic(bigint);
|
||||||
void header_item(int);
|
void header_item(bigint);
|
||||||
void header_item_triclinic(int);
|
void header_item_triclinic(bigint);
|
||||||
|
|
||||||
typedef void (DumpCustom::*FnPtrData)(int, double *);
|
typedef void (DumpCustom::*FnPtrData)(int, double *);
|
||||||
FnPtrData write_choice; // ptr to write data functions
|
FnPtrData write_choice; // ptr to write data functions
|
||||||
|
|||||||
@ -68,11 +68,9 @@ DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
|
|||||||
|
|
||||||
// allocate global array for atom coords
|
// allocate global array for atom coords
|
||||||
|
|
||||||
bigint n;
|
bigint n = group->count(igroup);
|
||||||
if (igroup == 0) n = static_cast<int> (atom->natoms);
|
|
||||||
else n = static_cast<int> (group->count(igroup));
|
|
||||||
if (n > MAXSMALLINT) error->all("Too many atoms for dump dcd");
|
if (n > MAXSMALLINT) error->all("Too many atoms for dump dcd");
|
||||||
natoms = n;
|
natoms = static_cast<int> (n);
|
||||||
|
|
||||||
coords = (float *) memory->smalloc(3*natoms*sizeof(float),"dump:coords");
|
coords = (float *) memory->smalloc(3*natoms*sizeof(float),"dump:coords");
|
||||||
xf = &coords[0*natoms];
|
xf = &coords[0*natoms];
|
||||||
@ -124,7 +122,7 @@ void DumpDCD::openfile()
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpDCD::write_header(int n)
|
void DumpDCD::write_header(bigint n)
|
||||||
{
|
{
|
||||||
if (n != natoms) error->all("Dump dcd of non-matching # of atoms");
|
if (n != natoms) error->all("Dump dcd of non-matching # of atoms");
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class DumpDCD : public Dump {
|
|||||||
|
|
||||||
void init_style();
|
void init_style();
|
||||||
void openfile();
|
void openfile();
|
||||||
void write_header(int);
|
void write_header(bigint);
|
||||||
int count();
|
int count();
|
||||||
void pack(int *);
|
void pack(int *);
|
||||||
void write_data(int, double *);
|
void write_data(int, double *);
|
||||||
|
|||||||
@ -187,13 +187,13 @@ int DumpLocal::modify_param(int narg, char **arg)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpLocal::write_header(int ndump)
|
void DumpLocal::write_header(bigint ndump)
|
||||||
{
|
{
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
fprintf(fp,"ITEM: TIMESTEP\n");
|
fprintf(fp,"ITEM: TIMESTEP\n");
|
||||||
fprintf(fp,"%d\n",update->ntimestep);
|
fprintf(fp,"%d\n",update->ntimestep);
|
||||||
fprintf(fp,"ITEM: NUMBER OF %s\n",label);
|
fprintf(fp,"ITEM: NUMBER OF %s\n",label);
|
||||||
fprintf(fp,"%d\n",ndump);
|
fprintf(fp,BIGINT_FORMAT_NL,ndump);
|
||||||
fprintf(fp,"ITEM: %s %s\n",label,columns);
|
fprintf(fp,"ITEM: %s %s\n",label,columns);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class DumpLocal : public Dump {
|
|||||||
|
|
||||||
void init_style();
|
void init_style();
|
||||||
int modify_param(int, char **);
|
int modify_param(int, char **);
|
||||||
void write_header(int);
|
void write_header(bigint);
|
||||||
int count();
|
int count();
|
||||||
void pack(int *);
|
void pack(int *);
|
||||||
void write_data(int, double *);
|
void write_data(int, double *);
|
||||||
|
|||||||
@ -58,10 +58,10 @@ void DumpXYZ::init_style()
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpXYZ::write_header(int n)
|
void DumpXYZ::write_header(bigint n)
|
||||||
{
|
{
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
fprintf(fp,"%d\n",n);
|
fprintf(fp,BIGINT_FORMAT_NL,n);
|
||||||
fprintf(fp,"Atoms\n");
|
fprintf(fp,"Atoms\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class DumpXYZ : public Dump {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void init_style();
|
void init_style();
|
||||||
void write_header(int);
|
void write_header(bigint);
|
||||||
int count();
|
int count();
|
||||||
void pack(int *);
|
void pack(int *);
|
||||||
void write_data(int, double *);
|
void write_data(int, double *);
|
||||||
|
|||||||
@ -89,14 +89,11 @@ void Finish::end(int flag)
|
|||||||
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (screen)
|
char str[128];
|
||||||
fprintf(screen,
|
sprintf(str,"Loop time of %%g on %%d procs for %%d steps with %s atoms\n",
|
||||||
"Loop time of %g on %d procs for %d steps with %lu atoms\n",
|
BIGINT_FORMAT);
|
||||||
time_loop,nprocs,update->nsteps,natoms);
|
if (screen) fprintf(screen,str,time_loop,nprocs,update->nsteps,natoms);
|
||||||
if (logfile)
|
if (logfile) fprintf(logfile,str,time_loop,nprocs,update->nsteps,natoms);
|
||||||
fprintf(logfile,
|
|
||||||
"Loop time of %g on %d procs for %d steps with %lu atoms\n",
|
|
||||||
time_loop,nprocs,update->nsteps,natoms);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (time_loop == 0.0) time_loop = 1.0;
|
if (time_loop == 0.0) time_loop = 1.0;
|
||||||
|
|||||||
@ -322,24 +322,25 @@ void FixDeposit::pre_exchange()
|
|||||||
|
|
||||||
// warn if not successful b/c too many attempts or no proc owned particle
|
// warn if not successful b/c too many attempts or no proc owned particle
|
||||||
|
|
||||||
if (comm->me == 0)
|
if (!success && comm->me == 0)
|
||||||
if (success == 0)
|
|
||||||
error->warning("Particle deposition was unsuccessful",0);
|
error->warning("Particle deposition was unsuccessful",0);
|
||||||
|
|
||||||
// set tag # of new particle beyond all previous atoms
|
|
||||||
// reset global natoms
|
// reset global natoms
|
||||||
|
// set tag # of new particle beyond all previous atoms
|
||||||
// if global map exists, reset it now instead of waiting for comm
|
// if global map exists, reset it now instead of waiting for comm
|
||||||
// since deleting atoms messes up ghosts
|
// since deleting atoms messes up ghosts
|
||||||
|
|
||||||
if (success && atom->tag_enable) {
|
if (success) {
|
||||||
atom->tag_extend();
|
|
||||||
atom->natoms += 1;
|
atom->natoms += 1;
|
||||||
|
if (atom->tag_enable) {
|
||||||
|
atom->tag_extend();
|
||||||
if (atom->map_style) {
|
if (atom->map_style) {
|
||||||
atom->nghost = 0;
|
atom->nghost = 0;
|
||||||
atom->map_init();
|
atom->map_init();
|
||||||
atom->map_set();
|
atom->map_set();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// next timestep to insert
|
// next timestep to insert
|
||||||
// next_reneighbor = 0 if done
|
// next_reneighbor = 0 if done
|
||||||
|
|||||||
@ -403,20 +403,19 @@ void FixOrientFCC::post_force(int vflag)
|
|||||||
MPI_Allreduce(&maxcount,&max,1,MPI_INT,MPI_MAX,world);
|
MPI_Allreduce(&maxcount,&max,1,MPI_INT,MPI_MAX,world);
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (screen) {
|
char str[64];
|
||||||
fprintf(screen,"orient step %d: %lu atoms have %d neighbors\n",
|
sprintf(str,"orient step %%d: %s atoms have %%d neighbors\n",
|
||||||
update->ntimestep,atom->natoms,total);
|
BIGINT_FORMAT);
|
||||||
|
if (screen) fprintf(screen,str,update->ntimestep,atom->natoms,total);
|
||||||
|
if (logfile) fprintf(logfile,str,update->ntimestep,atom->natoms,total);
|
||||||
|
if (screen)
|
||||||
fprintf(screen," neighs: min = %d, max = %d, ave = %g\n",
|
fprintf(screen," neighs: min = %d, max = %d, ave = %g\n",
|
||||||
min,max,ave);
|
min,max,ave);
|
||||||
}
|
if (logfile)
|
||||||
if (logfile) {
|
|
||||||
fprintf(logfile,"orient step %d: %lu atoms have %d neighbors\n",
|
|
||||||
update->ntimestep,atom->natoms,total);
|
|
||||||
fprintf(logfile," neighs: min = %d, max = %d, ave = %g\n",
|
fprintf(logfile," neighs: min = %d, max = %d, ave = %g\n",
|
||||||
min,max,ave);
|
min,max,ave);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -241,15 +241,22 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check datatype sizes
|
// check datatype settings in lmptype.h
|
||||||
|
|
||||||
if (sizeof(bigint) != 8)
|
if (sizeof(smallint) != sizeof(int))
|
||||||
error->all("No support for 8-byte unsigned integers");
|
error->all("Smallint setting in lmptype.h is invalid");
|
||||||
|
if (sizeof(tagint) < sizeof(smallint))
|
||||||
|
error->all("Tagint setting in lmptype.h is invalid");
|
||||||
|
if (sizeof(bigint) < sizeof(tagint))
|
||||||
|
error->all("Bigint setting in lmptype.h is invalid");
|
||||||
|
|
||||||
int mpisize;
|
int mpisize;
|
||||||
|
MPI_Type_size(MPI_LMP_TAGINT,&mpisize);
|
||||||
|
if (mpisize != sizeof(tagint))
|
||||||
|
error->all("MPI_LMP_TAGINT and tagint in lmptype.h are not compatible");
|
||||||
MPI_Type_size(MPI_LMP_BIGINT,&mpisize);
|
MPI_Type_size(MPI_LMP_BIGINT,&mpisize);
|
||||||
if (mpisize != 8)
|
if (mpisize != sizeof(bigint))
|
||||||
error->all("MPI_LMP_BIGINT is not 8-byte data type");
|
error->all("MPI_LMP_BIGINT and bigint in lmptype.h are not compatible");
|
||||||
|
|
||||||
// allocate input class now that MPI is fully setup
|
// allocate input class now that MPI is fully setup
|
||||||
|
|
||||||
|
|||||||
@ -15,11 +15,12 @@
|
|||||||
|
|
||||||
// smallint = variables for system on 1 processor (nlocal, etc)
|
// smallint = variables for system on 1 processor (nlocal, etc)
|
||||||
// tagint = variables for atom IDs (tag)
|
// tagint = variables for atom IDs (tag)
|
||||||
// bigint = variables for total system and timesteps (natoms, ntimestep, etc)
|
// bigint = variables for total system (natoms, ntimestep, etc)
|
||||||
|
|
||||||
// smallint must be an int, as defined by C compiler
|
// smallint must be an int, as defined by C compiler
|
||||||
// tagint can be 32-bit or 64-bit int, must be >= smallint
|
// tagint can be 32-bit or 64-bit int, must be >= smallint
|
||||||
// bigint can be 32-bit or 64-bit int, must be >= smallint and >= tagint
|
// NOTE: 64-bit tagint is not yet supported
|
||||||
|
// bigint can be 32-bit or 64-bit int, must be >= tagint
|
||||||
|
|
||||||
// MAXSMALLINT = max value of a smallint
|
// MAXSMALLINT = max value of a smallint
|
||||||
// MAXTAGINT = max value of a tagint
|
// MAXTAGINT = max value of a tagint
|
||||||
@ -27,6 +28,8 @@
|
|||||||
|
|
||||||
// MPI_LMP_TAGINT = MPI data type corresponding to tagint
|
// MPI_LMP_TAGINT = MPI data type corresponding to tagint
|
||||||
// MPI_LMP_BIGINT = MPI data type corresponding to bigint
|
// MPI_LMP_BIGINT = MPI data type corresponding to bigint
|
||||||
|
// NOTE: you may need to set MPI_LMP_BIGINT to MPI_LONG
|
||||||
|
// if your machine/MPI does not support "long long" data types
|
||||||
|
|
||||||
#ifndef LMP_LMPTYPE_H
|
#ifndef LMP_LMPTYPE_H
|
||||||
#define LMP_LMPTYPE_H
|
#define LMP_LMPTYPE_H
|
||||||
@ -35,7 +38,8 @@
|
|||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
// default settings: 4-byte smallint, 4-byte tagint, 8-byte bigint
|
// default settings
|
||||||
|
// 32-bit smallint and tagint, 64-bit bigint
|
||||||
|
|
||||||
typedef int smallint;
|
typedef int smallint;
|
||||||
typedef int tagint;
|
typedef int tagint;
|
||||||
@ -48,6 +52,54 @@ typedef int64_t bigint;
|
|||||||
#define MPI_LMP_TAGINT MPI_INT
|
#define MPI_LMP_TAGINT MPI_INT
|
||||||
#define MPI_LMP_BIGINT MPI_LONG_LONG
|
#define MPI_LMP_BIGINT MPI_LONG_LONG
|
||||||
|
|
||||||
|
#define TAGINT_FORMAT "%d"
|
||||||
|
#define BIGINT_FORMAT "%ld"
|
||||||
|
#define TAGINT_FORMAT_NL "%d\n"
|
||||||
|
#define BIGINT_FORMAT_NL "%ld\n"
|
||||||
|
|
||||||
|
// for molecular problems that exceed 2 billion (2^31) atoms
|
||||||
|
// 32-bit smallint, 64-bit tagint and bigint
|
||||||
|
// NOTE: 64-bit tagint is not yet supported
|
||||||
|
|
||||||
|
/*
|
||||||
|
typedef int smallint;
|
||||||
|
typedef int64_t tagint;
|
||||||
|
typedef int64_t bigint;
|
||||||
|
|
||||||
|
#define MAXSMALLINT 0x7FFFFFFF
|
||||||
|
#define MAXTAGINT 0x7FFFFFFFFFFFFFFFL
|
||||||
|
#define MAXBIGINT 0x7FFFFFFFFFFFFFFFL
|
||||||
|
|
||||||
|
#define MPI_LMP_TAGINT MPI_LONG_LONG
|
||||||
|
#define MPI_LMP_BIGINT MPI_LONG_LONG
|
||||||
|
|
||||||
|
#define TAGINT_FORMAT "%ld"
|
||||||
|
#define BIGINT_FORMAT "%ld"
|
||||||
|
#define TAGINT_FORMAT_NL "%ld\n"
|
||||||
|
#define BIGINT_FORMAT_NL "%ld\n"
|
||||||
|
*/
|
||||||
|
|
||||||
|
// for machines that don't support 64-bit ints
|
||||||
|
// 32-bit smallint and tagint and bigint
|
||||||
|
|
||||||
|
/*
|
||||||
|
typedef int smallint;
|
||||||
|
typedef int tagint;
|
||||||
|
typedef int bigint;
|
||||||
|
|
||||||
|
#define MAXSMALLINT 0x7FFFFFFF
|
||||||
|
#define MAXTAGINT 0x7FFFFFFF
|
||||||
|
#define MAXBIGINT 0x7FFFFFFF
|
||||||
|
|
||||||
|
#define MPI_LMP_TAGINT MPI_INT
|
||||||
|
#define MPI_LMP_BIGINT MPI_INT
|
||||||
|
|
||||||
|
#define TAGINT_FORMAT "%d"
|
||||||
|
#define BIGINT_FORMAT "%d"
|
||||||
|
#define TAGINT_FORMAT_NL "%d\n"
|
||||||
|
#define BIGINT_FORMAT_NL "%d\n"
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -336,11 +336,14 @@ void ReadData::header(int flag)
|
|||||||
|
|
||||||
// search line for header keyword and set corresponding variable
|
// search line for header keyword and set corresponding variable
|
||||||
|
|
||||||
if (strstr(line,"atoms")) sscanf(line,"%lu",&atom->natoms);
|
if (strstr(line,"atoms")) sscanf(line,BIGINT_FORMAT,&atom->natoms);
|
||||||
else if (strstr(line,"bonds")) sscanf(line,"%lu",&atom->nbonds);
|
|
||||||
else if (strstr(line,"angles")) sscanf(line,"%lu",&atom->nangles);
|
else if (strstr(line,"bonds")) sscanf(line,BIGINT_FORMAT,&atom->nbonds);
|
||||||
else if (strstr(line,"dihedrals")) sscanf(line,"%lu",&atom->ndihedrals);
|
else if (strstr(line,"angles")) sscanf(line,BIGINT_FORMAT,&atom->nangles);
|
||||||
else if (strstr(line,"impropers")) sscanf(line,"%lu",&atom->nimpropers);
|
else if (strstr(line,"dihedrals")) sscanf(line,BIGINT_FORMAT,
|
||||||
|
&atom->ndihedrals);
|
||||||
|
else if (strstr(line,"impropers")) sscanf(line,BIGINT_FORMAT,
|
||||||
|
&atom->nimpropers);
|
||||||
|
|
||||||
else if (strstr(line,"atom types")) sscanf(line,"%d",&atom->ntypes);
|
else if (strstr(line,"atom types")) sscanf(line,"%d",&atom->ntypes);
|
||||||
else if (strstr(line,"bond types")) sscanf(line,"%d",&atom->nbondtypes);
|
else if (strstr(line,"bond types")) sscanf(line,"%d",&atom->nbondtypes);
|
||||||
@ -365,6 +368,17 @@ void ReadData::header(int flag)
|
|||||||
} else break;
|
} else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// error check on total system size
|
||||||
|
|
||||||
|
if (atom->natoms < 0 || atom->natoms > MAXBIGINT ||
|
||||||
|
atom->nbonds < 0 || atom->nbonds > MAXBIGINT ||
|
||||||
|
atom->nangles < 0 || atom->nangles > MAXBIGINT ||
|
||||||
|
atom->ndihedrals < 0 || atom->ndihedrals > MAXBIGINT ||
|
||||||
|
atom->nimpropers < 0 || atom->nimpropers > MAXBIGINT) {
|
||||||
|
if (flag == 0) error->one("System in data file is too big");
|
||||||
|
else error->all("System in data file is too big");
|
||||||
|
}
|
||||||
|
|
||||||
// check that exiting string is a valid section keyword
|
// check that exiting string is a valid section keyword
|
||||||
|
|
||||||
parse_keyword(1,flag);
|
parse_keyword(1,flag);
|
||||||
@ -438,8 +452,10 @@ void ReadData::atoms()
|
|||||||
MPI_Allreduce(&tmp,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
MPI_Allreduce(&tmp,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (screen) fprintf(screen," %lu atoms\n",natoms);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu atoms\n",natoms);
|
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 (natoms != atom->natoms) error->all("Did not assign all atoms correctly");
|
||||||
@ -529,8 +545,10 @@ void ReadData::velocities()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (screen) fprintf(screen," %lu velocities\n",natoms);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu velocities\n",natoms);
|
sprintf(str," %s velocities\n",BIGINT_FORMAT);
|
||||||
|
if (screen) fprintf(screen,str,natoms);
|
||||||
|
if (logfile) fprintf(logfile,str,natoms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,8 +591,10 @@ void ReadData::bonds()
|
|||||||
if (!force->newton_bond) factor = 2;
|
if (!force->newton_bond) factor = 2;
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (screen) fprintf(screen," %lu bonds\n",sum/factor);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu bonds\n",sum/factor);
|
sprintf(str," %s bonds\n",BIGINT_FORMAT);
|
||||||
|
if (screen) fprintf(screen,str,sum/factor);
|
||||||
|
if (logfile) fprintf(logfile,str,sum/factor);
|
||||||
}
|
}
|
||||||
if (sum != factor*atom->nbonds) error->all("Bonds assigned incorrectly");
|
if (sum != factor*atom->nbonds) error->all("Bonds assigned incorrectly");
|
||||||
}
|
}
|
||||||
@ -618,8 +638,10 @@ void ReadData::angles()
|
|||||||
if (!force->newton_bond) factor = 3;
|
if (!force->newton_bond) factor = 3;
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (screen) fprintf(screen," %lu angles\n",sum/factor);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu angles\n",sum/factor);
|
sprintf(str," %s angles\n",BIGINT_FORMAT);
|
||||||
|
if (screen) fprintf(screen,str,sum/factor);
|
||||||
|
if (logfile) fprintf(logfile,str,sum/factor);
|
||||||
}
|
}
|
||||||
if (sum != factor*atom->nangles) error->all("Angles assigned incorrectly");
|
if (sum != factor*atom->nangles) error->all("Angles assigned incorrectly");
|
||||||
}
|
}
|
||||||
@ -663,8 +685,10 @@ void ReadData::dihedrals()
|
|||||||
if (!force->newton_bond) factor = 4;
|
if (!force->newton_bond) factor = 4;
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (screen) fprintf(screen," %lu dihedrals\n",sum/factor);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu dihedrals\n",sum/factor);
|
sprintf(str," %s dihedrals\n",BIGINT_FORMAT);
|
||||||
|
if (screen) fprintf(screen,str,sum/factor);
|
||||||
|
if (logfile) fprintf(logfile,str,sum/factor);
|
||||||
}
|
}
|
||||||
if (sum != factor*atom->ndihedrals)
|
if (sum != factor*atom->ndihedrals)
|
||||||
error->all("Dihedrals assigned incorrectly");
|
error->all("Dihedrals assigned incorrectly");
|
||||||
@ -709,8 +733,10 @@ void ReadData::impropers()
|
|||||||
if (!force->newton_bond) factor = 4;
|
if (!force->newton_bond) factor = 4;
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (screen) fprintf(screen," %lu impropers\n",sum/factor);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu impropers\n",sum/factor);
|
sprintf(str," %s impropers\n",BIGINT_FORMAT);
|
||||||
|
if (screen) fprintf(screen,str,sum/factor);
|
||||||
|
if (logfile) fprintf(logfile,str,sum/factor);
|
||||||
}
|
}
|
||||||
if (sum != factor*atom->nimpropers)
|
if (sum != factor*atom->nimpropers)
|
||||||
error->all("Impropers assigned incorrectly");
|
error->all("Impropers assigned incorrectly");
|
||||||
|
|||||||
@ -43,7 +43,8 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
// same as write_restart.cpp
|
// 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,
|
NEWTON_PAIR,NEWTON_BOND,XPERIODIC,YPERIODIC,ZPERIODIC,
|
||||||
BOUNDARY_00,BOUNDARY_01,BOUNDARY_10,BOUNDARY_11,BOUNDARY_20,BOUNDARY_21,
|
BOUNDARY_00,BOUNDARY_01,BOUNDARY_10,BOUNDARY_11,BOUNDARY_20,BOUNDARY_21,
|
||||||
ATOM_STYLE,NATOMS,NTYPES,
|
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);
|
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (screen) fprintf(screen," %lu atoms\n",natoms);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu atoms\n",natoms);
|
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 (natoms != atom->natoms) error->all("Did not assign all atoms correctly");
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (atom->nbonds) {
|
if (atom->nbonds) {
|
||||||
if (screen) fprintf(screen," %lu bonds\n",atom->nbonds);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu bonds\n",atom->nbonds);
|
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 (atom->nangles) {
|
||||||
if (screen) fprintf(screen," %lu angles\n",atom->nangles);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu angles\n",atom->nangles);
|
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 (atom->ndihedrals) {
|
||||||
if (screen) fprintf(screen," %lu dihedrals\n",atom->ndihedrals);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu dihedrals\n",atom->ndihedrals);
|
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 (atom->nimpropers) {
|
||||||
if (screen) fprintf(screen," %lu impropers\n",atom->nimpropers);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu impropers\n",atom->nimpropers);
|
sprintf(str," %s impropers\n",BIGINT_FORMAT);
|
||||||
|
if (screen) fprintf(screen,str,atom->nimpropers);
|
||||||
|
if (logfile) fprintf(logfile,str,atom->nimpropers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -456,6 +467,21 @@ void ReadRestart::header()
|
|||||||
}
|
}
|
||||||
delete [] 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
|
// reset unit_style only if different
|
||||||
// so that timestep,neighbor-skin are not changed
|
// so that timestep,neighbor-skin are not changed
|
||||||
|
|
||||||
@ -465,7 +491,9 @@ void ReadRestart::header()
|
|||||||
delete [] style;
|
delete [] style;
|
||||||
|
|
||||||
} else if (flag == NTIMESTEP) {
|
} 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
|
// set dimension from restart file
|
||||||
|
|
||||||
|
|||||||
@ -124,23 +124,25 @@ void Replicate::command(int narg, char **arg)
|
|||||||
}
|
}
|
||||||
atom->create_avec(old->atom_style,nstyles,keywords);
|
atom->create_avec(old->atom_style,nstyles,keywords);
|
||||||
|
|
||||||
// check that new problem size will not be too large
|
// check that new system will not be too large
|
||||||
// if N > 2^31, turn off tags for existing and new atoms
|
// if molecular and N > MAXTAGINT, error
|
||||||
// if molecular, N/Nbonds/etc cannot be > 2^31 else tags/counts invalid
|
// if atomic and new N > MAXTAGINT, turn off tags for existing and new atoms
|
||||||
|
// new system cannot exceed MAXBIGINT
|
||||||
double rep = nrep;
|
|
||||||
if (rep*old->natoms > MAXSMALLINT) atom->tag_enable = 0;
|
|
||||||
|
|
||||||
|
if (atom->molecular && (nrep*old->natoms < 0 || nrep*old->natoms > MAXTAGINT))
|
||||||
|
error->all("Replicated molecular system atom IDs are too big");
|
||||||
|
if (nrep*old->natoms < 0 || nrep*old->natoms > MAXTAGINT)
|
||||||
|
atom->tag_enable = 0;
|
||||||
if (atom->tag_enable == 0)
|
if (atom->tag_enable == 0)
|
||||||
for (int i = 0; i < atom->nlocal; i++)
|
for (int i = 0; i < atom->nlocal; i++)
|
||||||
atom->tag[i] = 0;
|
atom->tag[i] = 0;
|
||||||
|
|
||||||
if (atom->molecular) {
|
if (nrep*old->natoms < 0 || nrep*old->natoms > MAXBIGINT ||
|
||||||
if (rep*old->natoms > MAXBIGINT || rep*old->nbonds > MAXBIGINT ||
|
nrep*old->nbonds < 0 || nrep*old->nbonds > MAXBIGINT ||
|
||||||
rep*old->nangles > MAXBIGINT || rep*old->ndihedrals > MAXBIGINT ||
|
nrep*old->nangles < 0 || nrep*old->nangles > MAXBIGINT ||
|
||||||
rep*old->nimpropers > MAXBIGINT)
|
nrep*old->ndihedrals < 0 || nrep*old->ndihedrals > MAXBIGINT ||
|
||||||
error->all("Too big a problem to replicate with molecular atom style");
|
nrep*old->nimpropers < 0 || nrep*old->nimpropers > MAXBIGINT)
|
||||||
}
|
error->all("Replicated system is too big");
|
||||||
|
|
||||||
// assign atom and topology counts in new class from old one
|
// assign atom and topology counts in new class from old one
|
||||||
|
|
||||||
@ -368,8 +370,10 @@ void Replicate::command(int narg, char **arg)
|
|||||||
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (screen) fprintf(screen," %lu atoms\n",natoms);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu atoms\n",natoms);
|
sprintf(str," %s atoms\n",BIGINT_FORMAT);
|
||||||
|
if (screen) fprintf(screen,str,natoms);
|
||||||
|
if (logfile) fprintf(logfile,str,natoms);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (natoms != atom->natoms)
|
if (natoms != atom->natoms)
|
||||||
@ -377,20 +381,28 @@ void Replicate::command(int narg, char **arg)
|
|||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
if (atom->nbonds) {
|
if (atom->nbonds) {
|
||||||
if (screen) fprintf(screen," %lu bonds\n",atom->nbonds);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu bonds\n",atom->nbonds);
|
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 (atom->nangles) {
|
||||||
if (screen) fprintf(screen," %lu angles\n",atom->nangles);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu angles\n",atom->nangles);
|
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 (atom->ndihedrals) {
|
||||||
if (screen) fprintf(screen," %lu dihedrals\n",atom->ndihedrals);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu dihedrals\n",atom->ndihedrals);
|
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 (atom->nimpropers) {
|
||||||
if (screen) fprintf(screen," %lu impropers\n",atom->nimpropers);
|
char str[32];
|
||||||
if (logfile) fprintf(logfile," %lu impropers\n",atom->nimpropers);
|
sprintf(str," %s impropers\n",BIGINT_FORMAT);
|
||||||
|
if (screen) fprintf(screen,str,atom->nimpropers);
|
||||||
|
if (logfile) fprintf(logfile,str,atom->nimpropers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -139,8 +139,13 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||||||
format_float_multi_def = (char *) "%14.4f";
|
format_float_multi_def = (char *) "%14.4f";
|
||||||
format_int_one_def = (char *) "%8d";
|
format_int_one_def = (char *) "%8d";
|
||||||
format_int_multi_def = (char *) "%14d";
|
format_int_multi_def = (char *) "%14d";
|
||||||
format_bigint_one_def = (char *) "%8lu";
|
if (sizeof(bigint) == 8) {
|
||||||
format_bigint_multi_def = (char *) "%14lu";
|
format_bigint_one_def = (char *) "%8ld";
|
||||||
|
format_bigint_multi_def = (char *) "%14ld";
|
||||||
|
} else if (sizeof(bigint) == 4) {
|
||||||
|
format_bigint_one_def = (char *) "%8d";
|
||||||
|
format_bigint_multi_def = (char *) "%14d";
|
||||||
|
}
|
||||||
format_float_user = NULL;
|
format_float_user = NULL;
|
||||||
format_int_user = NULL;
|
format_int_user = NULL;
|
||||||
format_bigint_user = NULL;
|
format_bigint_user = NULL;
|
||||||
@ -354,6 +359,7 @@ bigint Thermo::lost_check()
|
|||||||
bigint ntotal;
|
bigint ntotal;
|
||||||
bigint nblocal = atom->nlocal;
|
bigint nblocal = atom->nlocal;
|
||||||
MPI_Allreduce(&nblocal,&ntotal,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
MPI_Allreduce(&nblocal,&ntotal,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||||
|
if (ntotal < 0 || ntotal > MAXBIGINT) error->all("Too many total atoms");
|
||||||
if (ntotal == atom->natoms) return ntotal;
|
if (ntotal == atom->natoms) return ntotal;
|
||||||
|
|
||||||
// if not checking or already warned, just return
|
// if not checking or already warned, just return
|
||||||
@ -364,15 +370,19 @@ bigint Thermo::lost_check()
|
|||||||
// error message
|
// error message
|
||||||
|
|
||||||
if (lostflag == ERROR) {
|
if (lostflag == ERROR) {
|
||||||
char str[128];
|
char fstr[64],str[64];
|
||||||
sprintf(str,"Lost atoms: original %lu current %lu",atom->natoms,ntotal);
|
sprintf(fstr,
|
||||||
|
"Lost atoms: original %s current %s",BIGINT_FORMAT,BIGINT_FORMAT);
|
||||||
|
sprintf(str,fstr,atom->natoms,ntotal);
|
||||||
error->all(str);
|
error->all(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
// warning message
|
// warning message
|
||||||
|
|
||||||
char str[128];
|
char fstr[64],str[64];
|
||||||
sprintf(str,"Lost atoms: original %lu current %lu",atom->natoms,ntotal);
|
sprintf(fstr,
|
||||||
|
"Lost atoms: original %s current %s",BIGINT_FORMAT,BIGINT_FORMAT);
|
||||||
|
sprintf(str,fstr,atom->natoms,ntotal);
|
||||||
if (me == 0) error->warning(str,0);
|
if (me == 0) error->warning(str,0);
|
||||||
lostbefore = 1;
|
lostbefore = 1;
|
||||||
return ntotal;
|
return ntotal;
|
||||||
@ -505,7 +515,10 @@ void Thermo::modify_params(int narg, char **arg)
|
|||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
error->all("Thermo_modify int format does not contain d character");
|
error->all("Thermo_modify int format does not contain d character");
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
sprintf(format_bigint_user,"%s%s%s",format_int_user,"lu",ptr+1);
|
if (sizeof(bigint) == 8)
|
||||||
|
sprintf(format_bigint_user,"%s%s%s",format_int_user,"ld",ptr+1);
|
||||||
|
else if (sizeof(bigint) == 4)
|
||||||
|
sprintf(format_bigint_user,"%s%s%s",format_int_user,"d",ptr+1);
|
||||||
*ptr = 'd';
|
*ptr = 'd';
|
||||||
} else if (strcmp(arg[iarg+1],"float") == 0) {
|
} else if (strcmp(arg[iarg+1],"float") == 0) {
|
||||||
if (format_float_user) delete [] format_float_user;
|
if (format_float_user) delete [] format_float_user;
|
||||||
|
|||||||
@ -68,7 +68,7 @@ class Thermo : protected Pointers {
|
|||||||
|
|
||||||
// data used by routines that compute single values
|
// data used by routines that compute single values
|
||||||
int ivalue; // integer value to print
|
int ivalue; // integer value to print
|
||||||
double dvalue; // dvalue = double value to print
|
double dvalue; // double value to print
|
||||||
bigint bivalue; // big integer value to print
|
bigint bivalue; // big integer value to print
|
||||||
int ifield; // which field in thermo output is being computed
|
int ifield; // which field in thermo output is being computed
|
||||||
int *field2index; // which compute,fix,variable calcs this field
|
int *field2index; // which compute,fix,variable calcs this field
|
||||||
|
|||||||
@ -42,7 +42,8 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
// same as read_restart.cpp and tools/restart2data.cpp
|
// same as read_restart.cpp and tools/restart2data.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,
|
NEWTON_PAIR,NEWTON_BOND,XPERIODIC,YPERIODIC,ZPERIODIC,
|
||||||
BOUNDARY_00,BOUNDARY_01,BOUNDARY_10,BOUNDARY_11,BOUNDARY_20,BOUNDARY_21,
|
BOUNDARY_00,BOUNDARY_01,BOUNDARY_10,BOUNDARY_11,BOUNDARY_20,BOUNDARY_21,
|
||||||
ATOM_STYLE,NATOMS,NTYPES,
|
ATOM_STYLE,NATOMS,NTYPES,
|
||||||
@ -295,8 +296,13 @@ void WriteRestart::write(char *file)
|
|||||||
void WriteRestart::header()
|
void WriteRestart::header()
|
||||||
{
|
{
|
||||||
write_char(VERSION,universe->version);
|
write_char(VERSION,universe->version);
|
||||||
|
write_int(SMALLINT,sizeof(smallint));
|
||||||
|
write_int(TAGINT,sizeof(tagint));
|
||||||
|
write_int(BIGINT,sizeof(bigint));
|
||||||
write_char(UNITS,update->unit_style);
|
write_char(UNITS,update->unit_style);
|
||||||
write_int(NTIMESTEP,update->ntimestep);
|
// placeholder until ntimestep is 8-byte
|
||||||
|
bigint ntimestep = update->ntimestep;
|
||||||
|
write_bigint(NTIMESTEP,ntimestep);
|
||||||
write_int(DIMENSION,domain->dimension);
|
write_int(DIMENSION,domain->dimension);
|
||||||
write_int(NPROCS,nprocs);
|
write_int(NPROCS,nprocs);
|
||||||
write_int(PROCGRID_0,comm->procgrid[0]);
|
write_int(PROCGRID_0,comm->procgrid[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user