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

This commit is contained in:
sjplimp
2011-01-11 00:41:00 +00:00
parent 4bc2d6f332
commit 82ec94916d
79 changed files with 458 additions and 315 deletions

View File

@ -19,6 +19,7 @@
#include "string.h" #include "string.h"
#include "stdlib.h" #include "stdlib.h"
#include "dihedral_class2.h" #include "dihedral_class2.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "neighbor.h" #include "neighbor.h"
#include "update.h" #include "update.h"
@ -209,9 +210,9 @@ void DihedralClass2::compute(int eflag, int vflag)
int me; int me;
MPI_Comm_rank(world,&me); MPI_Comm_rank(world,&me);
if (screen) { if (screen) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Dihedral problem: %d %d %d %d %d %d", sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
me,update->ntimestep, sprintf(str,fstr,me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0); error->warning(str,0);
fprintf(screen," 1st atom: %d %g %g %g\n", fprintf(screen," 1st atom: %d %g %g %g\n",

View File

@ -19,6 +19,7 @@
#include "string.h" #include "string.h"
#include "stdlib.h" #include "stdlib.h"
#include "improper_class2.h" #include "improper_class2.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "neighbor.h" #include "neighbor.h"
#include "update.h" #include "update.h"
@ -156,11 +157,13 @@ void ImproperClass2::compute(int eflag, int vflag)
int me; int me;
MPI_Comm_rank(world,&me); MPI_Comm_rank(world,&me);
if (screen) { if (screen) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Improper problem: %d %d %d %d %d %d", sprintf(fstr,"Improper problem: %%d %s %%d %%d %%d %%d",
me,update->ntimestep, BIGINT_FORMAT);
sprintf(str,fstr,me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0); error->warning(str,0);
error->warning(str,0);
fprintf(screen," 1st atom: %d %g %g %g\n", fprintf(screen," 1st atom: %d %g %g %g\n",
me,x[i1][0],x[i1][1],x[i1][2]); me,x[i1][0],x[i1][1],x[i1][2]);
fprintf(screen," 2nd atom: %d %g %g %g\n", fprintf(screen," 2nd atom: %d %g %g %g\n",

View File

@ -19,6 +19,7 @@
#include "stdio.h" #include "stdio.h"
#include "stdlib.h" #include "stdlib.h"
#include "pair_cg_cmm_coul_long_gpu.h" #include "pair_cg_cmm_coul_long_gpu.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "atom_vec.h" #include "atom_vec.h"
#include "comm.h" #include "comm.h"
@ -94,6 +95,10 @@ PairCGCMMCoulLongGPU::~PairCGCMMCoulLongGPU()
void PairCGCMMCoulLongGPU::compute(int eflag, int vflag) void PairCGCMMCoulLongGPU::compute(int eflag, int vflag)
{ {
if (update->ntimestep > MAXSMALLINT)
error->all("Timestep too big for GPU pair style");
int ntimestep = update->ntimestep;
if (eflag || vflag) ev_setup(eflag,vflag); if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0; else evflag = vflag_fdotr = 0;
@ -104,7 +109,7 @@ void PairCGCMMCoulLongGPU::compute(int eflag, int vflag)
if (gpu_mode == GPU_NEIGH) { if (gpu_mode == GPU_NEIGH) {
inum = atom->nlocal; inum = atom->nlocal;
gpulist = cmml_gpu_compute_n(update->ntimestep, neighbor->ago, inum, nall, gpulist = cmml_gpu_compute_n(ntimestep, neighbor->ago, inum, nall,
atom->x, atom->type, domain->sublo, atom->x, atom->type, domain->sublo,
domain->subhi, atom->tag, atom->nspecial, domain->subhi, atom->tag, atom->nspecial,
atom->special, eflag, vflag, eflag_atom, atom->special, eflag, vflag, eflag_atom,
@ -112,7 +117,7 @@ void PairCGCMMCoulLongGPU::compute(int eflag, int vflag)
atom->q); atom->q);
} else { } else {
inum = list->inum; inum = list->inum;
cmml_gpu_compute(update->ntimestep, neighbor->ago, inum, nall, atom->x, cmml_gpu_compute(ntimestep, neighbor->ago, inum, nall, atom->x,
atom->type, list->ilist, list->numneigh, list->firstneigh, atom->type, list->ilist, list->numneigh, list->firstneigh,
eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time,
success, atom->q); success, atom->q);

View File

@ -19,6 +19,7 @@
#include "stdio.h" #include "stdio.h"
#include "stdlib.h" #include "stdlib.h"
#include "pair_cg_cmm_gpu.h" #include "pair_cg_cmm_gpu.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "atom_vec.h" #include "atom_vec.h"
#include "comm.h" #include "comm.h"
@ -83,6 +84,10 @@ PairCGCMMGPU::~PairCGCMMGPU()
void PairCGCMMGPU::compute(int eflag, int vflag) void PairCGCMMGPU::compute(int eflag, int vflag)
{ {
if (update->ntimestep > MAXSMALLINT)
error->all("Timestep too big for GPU pair style");
int ntimestep = update->ntimestep;
if (eflag || vflag) ev_setup(eflag,vflag); if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0; else evflag = vflag_fdotr = 0;
@ -93,14 +98,14 @@ void PairCGCMMGPU::compute(int eflag, int vflag)
if (gpu_mode == GPU_NEIGH) { if (gpu_mode == GPU_NEIGH) {
inum = atom->nlocal; inum = atom->nlocal;
gpulist = cmm_gpu_compute_n(update->ntimestep, neighbor->ago, inum, nall, gpulist = cmm_gpu_compute_n(ntimestep, neighbor->ago, inum, nall,
atom->x, atom->type, domain->sublo, atom->x, atom->type, domain->sublo,
domain->subhi, atom->tag, atom->nspecial, domain->subhi, atom->tag, atom->nspecial,
atom->special, eflag, vflag, eflag_atom, atom->special, eflag, vflag, eflag_atom,
vflag_atom, host_start, cpu_time, success); vflag_atom, host_start, cpu_time, success);
} else { } else {
inum = list->inum; inum = list->inum;
cmm_gpu_compute(update->ntimestep, neighbor->ago, inum, nall, atom->x, cmm_gpu_compute(ntimestep, neighbor->ago, inum, nall, atom->x,
atom->type, list->ilist, list->numneigh, list->firstneigh, atom->type, list->ilist, list->numneigh, list->firstneigh,
eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time,
success); success);

View File

@ -19,6 +19,7 @@
#include "stdio.h" #include "stdio.h"
#include "stdlib.h" #include "stdlib.h"
#include "pair_gayberne_gpu.h" #include "pair_gayberne_gpu.h"
#include "lmptype.h"
#include "math_extra.h" #include "math_extra.h"
#include "atom.h" #include "atom.h"
#include "atom_vec.h" #include "atom_vec.h"
@ -88,6 +89,10 @@ PairGayBerneGPU::~PairGayBerneGPU()
void PairGayBerneGPU::compute(int eflag, int vflag) void PairGayBerneGPU::compute(int eflag, int vflag)
{ {
if (update->ntimestep > MAXSMALLINT)
error->all("Timestep too big for GPU pair style");
int ntimestep = update->ntimestep;
if (eflag || vflag) ev_setup(eflag,vflag); if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0; else evflag = vflag_fdotr = 0;
@ -98,13 +103,13 @@ void PairGayBerneGPU::compute(int eflag, int vflag)
if (gpu_mode == GPU_NEIGH) { if (gpu_mode == GPU_NEIGH) {
inum = atom->nlocal; inum = atom->nlocal;
gpulist = gb_gpu_compute_n(update->ntimestep, neighbor->ago, inum, nall, gpulist = gb_gpu_compute_n(ntimestep, neighbor->ago, inum, nall,
atom->x, atom->type, domain->sublo, domain->subhi, atom->x, atom->type, domain->sublo, domain->subhi,
eflag, vflag, eflag_atom, vflag_atom, host_start, eflag, vflag, eflag_atom, vflag_atom, host_start,
cpu_time, success, atom->quat); cpu_time, success, atom->quat);
} else { } else {
inum = list->inum; inum = list->inum;
olist = gb_gpu_compute(update->ntimestep, neighbor->ago, inum, nall, atom->x, olist = gb_gpu_compute(ntimestep, neighbor->ago, inum, nall, atom->x,
atom->type, list->ilist, list->numneigh, atom->type, list->ilist, list->numneigh,
list->firstneigh, eflag, vflag, eflag_atom, list->firstneigh, eflag, vflag, eflag_atom,
vflag_atom, host_start, cpu_time, success, vflag_atom, host_start, cpu_time, success,

View File

@ -19,6 +19,7 @@
#include "stdio.h" #include "stdio.h"
#include "stdlib.h" #include "stdlib.h"
#include "pair_lj96_cut_gpu.h" #include "pair_lj96_cut_gpu.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "atom_vec.h" #include "atom_vec.h"
#include "comm.h" #include "comm.h"
@ -82,6 +83,10 @@ PairLJ96CutGPU::~PairLJ96CutGPU()
void PairLJ96CutGPU::compute(int eflag, int vflag) void PairLJ96CutGPU::compute(int eflag, int vflag)
{ {
if (update->ntimestep > MAXSMALLINT)
error->all("Timestep too big for GPU pair style");
int ntimestep = update->ntimestep;
if (eflag || vflag) ev_setup(eflag,vflag); if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0; else evflag = vflag_fdotr = 0;
@ -92,14 +97,14 @@ void PairLJ96CutGPU::compute(int eflag, int vflag)
if (gpu_mode == GPU_NEIGH) { if (gpu_mode == GPU_NEIGH) {
inum = atom->nlocal; inum = atom->nlocal;
gpulist = lj96_gpu_compute_n(update->ntimestep, neighbor->ago, inum, nall, gpulist = lj96_gpu_compute_n(ntimestep, neighbor->ago, inum, nall,
atom->x, atom->type, domain->sublo, atom->x, atom->type, domain->sublo,
domain->subhi, atom->tag, atom->nspecial, domain->subhi, atom->tag, atom->nspecial,
atom->special, eflag, vflag, eflag_atom, atom->special, eflag, vflag, eflag_atom,
vflag_atom, host_start, cpu_time, success); vflag_atom, host_start, cpu_time, success);
} else { } else {
inum = list->inum; inum = list->inum;
lj96_gpu_compute(update->ntimestep, neighbor->ago, inum, nall, atom->x, lj96_gpu_compute(ntimestep, neighbor->ago, inum, nall, atom->x,
atom->type, list->ilist, list->numneigh, list->firstneigh, atom->type, list->ilist, list->numneigh, list->firstneigh,
eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time,
success); success);

View File

@ -19,6 +19,7 @@
#include "stdio.h" #include "stdio.h"
#include "stdlib.h" #include "stdlib.h"
#include "pair_lj_cut_coul_cut_gpu.h" #include "pair_lj_cut_coul_cut_gpu.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "atom_vec.h" #include "atom_vec.h"
#include "comm.h" #include "comm.h"
@ -84,6 +85,10 @@ PairLJCutCoulCutGPU::~PairLJCutCoulCutGPU()
void PairLJCutCoulCutGPU::compute(int eflag, int vflag) void PairLJCutCoulCutGPU::compute(int eflag, int vflag)
{ {
if (update->ntimestep > MAXSMALLINT)
error->all("Timestep too big for GPU pair style");
int ntimestep = update->ntimestep;
if (eflag || vflag) ev_setup(eflag,vflag); if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0; else evflag = vflag_fdotr = 0;
@ -94,7 +99,7 @@ void PairLJCutCoulCutGPU::compute(int eflag, int vflag)
if (gpu_mode == GPU_NEIGH) { if (gpu_mode == GPU_NEIGH) {
inum = atom->nlocal; inum = atom->nlocal;
gpulist = ljc_gpu_compute_n(update->ntimestep, neighbor->ago, inum, nall, gpulist = ljc_gpu_compute_n(ntimestep, neighbor->ago, inum, nall,
atom->x, atom->type, domain->sublo, atom->x, atom->type, domain->sublo,
domain->subhi, atom->tag, atom->nspecial, domain->subhi, atom->tag, atom->nspecial,
atom->special, eflag, vflag, eflag_atom, atom->special, eflag, vflag, eflag_atom,
@ -102,7 +107,7 @@ void PairLJCutCoulCutGPU::compute(int eflag, int vflag)
atom->q); atom->q);
} else { } else {
inum = list->inum; inum = list->inum;
ljc_gpu_compute(update->ntimestep, neighbor->ago, inum, nall, atom->x, ljc_gpu_compute(ntimestep, neighbor->ago, inum, nall, atom->x,
atom->type, list->ilist, list->numneigh, list->firstneigh, atom->type, list->ilist, list->numneigh, list->firstneigh,
eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time,
success, atom->q); success, atom->q);

View File

@ -19,6 +19,7 @@
#include "stdio.h" #include "stdio.h"
#include "stdlib.h" #include "stdlib.h"
#include "pair_lj_cut_coul_long_gpu.h" #include "pair_lj_cut_coul_long_gpu.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "atom_vec.h" #include "atom_vec.h"
#include "comm.h" #include "comm.h"
@ -94,6 +95,10 @@ PairLJCutCoulLongGPU::~PairLJCutCoulLongGPU()
void PairLJCutCoulLongGPU::compute(int eflag, int vflag) void PairLJCutCoulLongGPU::compute(int eflag, int vflag)
{ {
if (update->ntimestep > MAXSMALLINT)
error->all("Timestep too big for GPU pair style");
int ntimestep = update->ntimestep;
if (eflag || vflag) ev_setup(eflag,vflag); if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0; else evflag = vflag_fdotr = 0;
@ -104,7 +109,7 @@ void PairLJCutCoulLongGPU::compute(int eflag, int vflag)
if (gpu_mode == GPU_NEIGH) { if (gpu_mode == GPU_NEIGH) {
inum = atom->nlocal; inum = atom->nlocal;
gpulist = ljcl_gpu_compute_n(update->ntimestep, neighbor->ago, inum, nall, gpulist = ljcl_gpu_compute_n(ntimestep, neighbor->ago, inum, nall,
atom->x, atom->type, domain->sublo, atom->x, atom->type, domain->sublo,
domain->subhi, atom->tag, atom->nspecial, domain->subhi, atom->tag, atom->nspecial,
atom->special, eflag, vflag, eflag_atom, atom->special, eflag, vflag, eflag_atom,
@ -112,7 +117,7 @@ void PairLJCutCoulLongGPU::compute(int eflag, int vflag)
atom->q); atom->q);
} else { } else {
inum = list->inum; inum = list->inum;
ljcl_gpu_compute(update->ntimestep, neighbor->ago, inum, nall, atom->x, ljcl_gpu_compute(ntimestep, neighbor->ago, inum, nall, atom->x,
atom->type, list->ilist, list->numneigh, list->firstneigh, atom->type, list->ilist, list->numneigh, list->firstneigh,
eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time,
success, atom->q); success, atom->q);

View File

@ -19,6 +19,7 @@
#include "stdio.h" #include "stdio.h"
#include "stdlib.h" #include "stdlib.h"
#include "pair_lj_cut_gpu.h" #include "pair_lj_cut_gpu.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "atom_vec.h" #include "atom_vec.h"
#include "comm.h" #include "comm.h"
@ -82,6 +83,10 @@ PairLJCutGPU::~PairLJCutGPU()
void PairLJCutGPU::compute(int eflag, int vflag) void PairLJCutGPU::compute(int eflag, int vflag)
{ {
if (update->ntimestep > MAXSMALLINT)
error->all("Timestep too big for GPU pair style");
int ntimestep = update->ntimestep;
if (eflag || vflag) ev_setup(eflag,vflag); if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0; else evflag = vflag_fdotr = 0;
@ -92,14 +97,14 @@ void PairLJCutGPU::compute(int eflag, int vflag)
if (gpu_mode == GPU_NEIGH) { if (gpu_mode == GPU_NEIGH) {
inum = atom->nlocal; inum = atom->nlocal;
gpulist = ljl_gpu_compute_n(update->ntimestep, neighbor->ago, inum, nall, gpulist = ljl_gpu_compute_n(ntimestep, neighbor->ago, inum, nall,
atom->x, atom->type, domain->sublo, atom->x, atom->type, domain->sublo,
domain->subhi, atom->tag, atom->nspecial, domain->subhi, atom->tag, atom->nspecial,
atom->special, eflag, vflag, eflag_atom, atom->special, eflag, vflag, eflag_atom,
vflag_atom, host_start, cpu_time, success); vflag_atom, host_start, cpu_time, success);
} else { } else {
inum = list->inum; inum = list->inum;
ljl_gpu_compute(update->ntimestep, neighbor->ago, inum, nall, atom->x, ljl_gpu_compute(ntimestep, neighbor->ago, inum, nall, atom->x,
atom->type, list->ilist, list->numneigh, list->firstneigh, atom->type, list->ilist, list->numneigh, list->firstneigh,
eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time,
success); success);

View File

@ -20,6 +20,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "fix_qeq_comb.h" #include "fix_qeq_comb.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "force.h" #include "force.h"
#include "group.h" #include "group.h"
@ -171,8 +172,11 @@ void FixQEQComb::post_force(int vflag)
// charge-equilibration loop // charge-equilibration loop
if (me == 0 && fp) if (me == 0 && fp) {
fprintf(fp,"Charge equilibration on step %d\n",update->ntimestep); char fstr[64];
sprintf(fstr,"Charge equilibration on step %s\n",BIGINT_FORMAT);
fprintf(fp,fstr,update->ntimestep);
}
heatpq = 0.01; heatpq = 0.01;
qmass = 0.06; qmass = 0.06;

View File

@ -14,6 +14,7 @@
#include "math.h" #include "math.h"
#include "stdlib.h" #include "stdlib.h"
#include "bond_fene.h" #include "bond_fene.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "neighbor.h" #include "neighbor.h"
#include "domain.h" #include "domain.h"
@ -85,9 +86,9 @@ void BondFENE::compute(int eflag, int vflag)
// if r > 2*r0 something serious is wrong, abort // if r > 2*r0 something serious is wrong, abort
if (rlogarg < 0.1) { if (rlogarg < 0.1) {
char str[128]; char str[128],fstr[64];
sprintf(str,"FENE bond too long: %d %d %d %g", sprintf(fstr,"FENE bond too long: %s %%d %%d %%g",BIGINT_FORMAT);
update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq)); sprintf(str,fstr,update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
error->warning(str,0); error->warning(str,0);
if (rlogarg <= -3.0) error->one("Bad FENE bond"); if (rlogarg <= -3.0) error->one("Bad FENE bond");
rlogarg = 0.1; rlogarg = 0.1;
@ -242,8 +243,9 @@ double BondFENE::single(int type, double rsq, int i, int j)
// if r > 2*r0 something serious is wrong, abort // if r > 2*r0 something serious is wrong, abort
if (rlogarg < 0.1) { if (rlogarg < 0.1) {
char str[128]; char str[128],fstr[64];
sprintf(str,"FENE bond too long: %d %g",update->ntimestep,sqrt(rsq)); sprintf(fstr,"FENE bond too long: %s %%g",BIGINT_FORMAT);
sprintf(str,fstr,update->ntimestep,sqrt(rsq));
error->warning(str,0); error->warning(str,0);
if (rlogarg <= -3.0) error->one("Bad FENE bond"); if (rlogarg <= -3.0) error->one("Bad FENE bond");
rlogarg = 0.1; rlogarg = 0.1;

View File

@ -14,6 +14,7 @@
#include "math.h" #include "math.h"
#include "stdlib.h" #include "stdlib.h"
#include "bond_fene_expand.h" #include "bond_fene_expand.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "neighbor.h" #include "neighbor.h"
#include "domain.h" #include "domain.h"
@ -90,9 +91,9 @@ void BondFENEExpand::compute(int eflag, int vflag)
// if r > 2*r0 something serious is wrong, abort // if r > 2*r0 something serious is wrong, abort
if (rlogarg < 0.1) { if (rlogarg < 0.1) {
char str[128]; char str[128],fstr[64];
sprintf(str,"FENE bond too long: %d %d %d %g", sprintf(fstr,"FENE bond too long: %s %%d %%d %%g",BIGINT_FORMAT);
update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq)); sprintf(str,fstr,update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
error->warning(str,0); error->warning(str,0);
if (rlogarg <= -3.0) error->one("Bad FENE bond"); if (rlogarg <= -3.0) error->one("Bad FENE bond");
rlogarg = 0.1; rlogarg = 0.1;
@ -256,8 +257,9 @@ double BondFENEExpand::single(int type, double rsq, int i, int j)
// if r > 2*r0 something serious is wrong, abort // if r > 2*r0 something serious is wrong, abort
if (rlogarg < 0.1) { if (rlogarg < 0.1) {
char str[128]; char str[128],fstr[64];
sprintf(str,"FENE bond too long: %d %g",update->ntimestep,sqrt(rsq)); sprintf(fstr,"FENE bond too long: %s %%g",BIGINT_FORMAT);
sprintf(str,fstr,update->ntimestep,sqrt(rsq));
error->warning(str,0); error->warning(str,0);
if (rlogarg <= -3.0) error->one("Bad FENE bond"); if (rlogarg <= -3.0) error->one("Bad FENE bond");
rlogarg = 0.1; rlogarg = 0.1;

View File

@ -19,6 +19,7 @@
#include "math.h" #include "math.h"
#include "stdlib.h" #include "stdlib.h"
#include "dihedral_charmm.h" #include "dihedral_charmm.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "comm.h" #include "comm.h"
#include "neighbor.h" #include "neighbor.h"
@ -146,9 +147,9 @@ void DihedralCharmm::compute(int eflag, int vflag)
int me; int me;
MPI_Comm_rank(world,&me); MPI_Comm_rank(world,&me);
if (screen) { if (screen) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Dihedral problem: %d %d %d %d %d %d", sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
me,update->ntimestep, sprintf(str,fstr,me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0); error->warning(str,0);
fprintf(screen," 1st atom: %d %g %g %g\n", fprintf(screen," 1st atom: %d %g %g %g\n",

View File

@ -19,6 +19,7 @@
#include "math.h" #include "math.h"
#include "stdlib.h" #include "stdlib.h"
#include "dihedral_harmonic.h" #include "dihedral_harmonic.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "comm.h" #include "comm.h"
#include "neighbor.h" #include "neighbor.h"
@ -136,9 +137,9 @@ void DihedralHarmonic::compute(int eflag, int vflag)
int me; int me;
MPI_Comm_rank(world,&me); MPI_Comm_rank(world,&me);
if (screen) { if (screen) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Dihedral problem: %d %d %d %d %d %d", sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
me,update->ntimestep, sprintf(str,fstr,me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0); error->warning(str,0);
fprintf(screen," 1st atom: %d %g %g %g\n", fprintf(screen," 1st atom: %d %g %g %g\n",

View File

@ -20,6 +20,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "mpi.h" #include "mpi.h"
#include "dihedral_helix.h" #include "dihedral_helix.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "neighbor.h" #include "neighbor.h"
#include "domain.h" #include "domain.h"
@ -168,9 +169,9 @@ void DihedralHelix::compute(int eflag, int vflag)
int me; int me;
MPI_Comm_rank(world,&me); MPI_Comm_rank(world,&me);
if (screen) { if (screen) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Dihedral problem: %d %d %d %d %d %d", sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
me,update->ntimestep, sprintf(str,fstr,me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0); error->warning(str,0);
fprintf(screen," 1st atom: %d %g %g %g\n", fprintf(screen," 1st atom: %d %g %g %g\n",

View File

@ -18,6 +18,7 @@
#include "math.h" #include "math.h"
#include "stdlib.h" #include "stdlib.h"
#include "dihedral_multi_harmonic.h" #include "dihedral_multi_harmonic.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "neighbor.h" #include "neighbor.h"
#include "domain.h" #include "domain.h"
@ -158,20 +159,22 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
// error check // error check
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) { if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) {
int me;
MPI_Comm_rank(world,&me);
if (screen) { if (screen) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Dihedral problem: %d %d %d %d %d %d", sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
comm->me,update->ntimestep, sprintf(str,fstr,me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0); error->warning(str,0);
fprintf(screen," 1st atom: %d %g %g %g\n", fprintf(screen," 1st atom: %d %g %g %g\n",
comm->me,x[i1][0],x[i1][1],x[i1][2]); me,x[i1][0],x[i1][1],x[i1][2]);
fprintf(screen," 2nd atom: %d %g %g %g\n", fprintf(screen," 2nd atom: %d %g %g %g\n",
comm->me,x[i2][0],x[i2][1],x[i2][2]); me,x[i2][0],x[i2][1],x[i2][2]);
fprintf(screen," 3rd atom: %d %g %g %g\n", fprintf(screen," 3rd atom: %d %g %g %g\n",
comm->me,x[i3][0],x[i3][1],x[i3][2]); me,x[i3][0],x[i3][1],x[i3][2]);
fprintf(screen," 4th atom: %d %g %g %g\n", fprintf(screen," 4th atom: %d %g %g %g\n",
comm->me,x[i4][0],x[i4][1],x[i4][2]); me,x[i4][0],x[i4][1],x[i4][2]);
} }
} }

View File

@ -18,6 +18,7 @@
#include "math.h" #include "math.h"
#include "stdlib.h" #include "stdlib.h"
#include "dihedral_opls.h" #include "dihedral_opls.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "comm.h" #include "comm.h"
#include "neighbor.h" #include "neighbor.h"
@ -164,20 +165,22 @@ void DihedralOPLS::compute(int eflag, int vflag)
// error check // error check
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) { if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) {
int me;
MPI_Comm_rank(world,&me);
if (screen) { if (screen) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Dihedral problem: %d %d %d %d %d %d", sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
comm->me,update->ntimestep, sprintf(str,fstr,me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0); error->warning(str,0);
fprintf(screen," 1st atom: %d %g %g %g\n", fprintf(screen," 1st atom: %d %g %g %g\n",
comm->me,x[i1][0],x[i1][1],x[i1][2]); me,x[i1][0],x[i1][1],x[i1][2]);
fprintf(screen," 2nd atom: %d %g %g %g\n", fprintf(screen," 2nd atom: %d %g %g %g\n",
comm->me,x[i2][0],x[i2][1],x[i2][2]); me,x[i2][0],x[i2][1],x[i2][2]);
fprintf(screen," 3rd atom: %d %g %g %g\n", fprintf(screen," 3rd atom: %d %g %g %g\n",
comm->me,x[i3][0],x[i3][1],x[i3][2]); me,x[i3][0],x[i3][1],x[i3][2]);
fprintf(screen," 4th atom: %d %g %g %g\n", fprintf(screen," 4th atom: %d %g %g %g\n",
comm->me,x[i4][0],x[i4][1],x[i4][2]); me,x[i4][0],x[i4][1],x[i4][2]);
} }
} }

View File

@ -15,6 +15,7 @@
#include "math.h" #include "math.h"
#include "stdlib.h" #include "stdlib.h"
#include "improper_cvff.h" #include "improper_cvff.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "comm.h" #include "comm.h"
#include "neighbor.h" #include "neighbor.h"
@ -150,9 +151,9 @@ void ImproperCvff::compute(int eflag, int vflag)
int me; int me;
MPI_Comm_rank(world,&me); MPI_Comm_rank(world,&me);
if (screen) { if (screen) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Improper problem: %d %d %d %d %d %d", sprintf(fstr,"Improper problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
me,update->ntimestep, sprintf(str,fstr,me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0); error->warning(str,0);
fprintf(screen," 1st atom: %d %g %g %g\n", fprintf(screen," 1st atom: %d %g %g %g\n",

View File

@ -15,6 +15,7 @@
#include "math.h" #include "math.h"
#include "stdlib.h" #include "stdlib.h"
#include "improper_harmonic.h" #include "improper_harmonic.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "comm.h" #include "comm.h"
#include "neighbor.h" #include "neighbor.h"
@ -121,9 +122,9 @@ void ImproperHarmonic::compute(int eflag, int vflag)
int me; int me;
MPI_Comm_rank(world,&me); MPI_Comm_rank(world,&me);
if (screen) { if (screen) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Improper problem: %d %d %d %d %d %d", sprintf(fstr,"Improper problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
me,update->ntimestep, sprintf(str,fstr,me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0); error->warning(str,0);
fprintf(screen," 1st atom: %d %g %g %g\n", fprintf(screen," 1st atom: %d %g %g %g\n",

View File

@ -128,9 +128,11 @@ void ImproperUmbrella::compute(int eflag, int vflag)
int me; int me;
MPI_Comm_rank(world,&me); MPI_Comm_rank(world,&me);
if (screen) { if (screen) {
fprintf(screen,"Improper problem: %d %d %d %d %d %d\n", char str[128],fstr[64];
me,update->ntimestep, sprintf(fstr,"Improper problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
sprintf(str,fstr,me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0);
fprintf(screen," 1st atom: %d %g %g %g\n", fprintf(screen," 1st atom: %d %g %g %g\n",
me,x[i1][0],x[i1][1],x[i1][2]); me,x[i1][0],x[i1][1],x[i1][2]);
fprintf(screen," 2nd atom: %d %g %g %g\n", fprintf(screen," 2nd atom: %d %g %g %g\n",

View File

@ -18,6 +18,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "fix_reax_bonds.h" #include "fix_reax_bonds.h"
#include "lmptype.h"
#include "pair_reax_fortran.h" #include "pair_reax_fortran.h"
#include "atom.h" #include "atom.h"
#include "update.h" #include "update.h"
@ -98,7 +99,7 @@ void FixReaxBonds::end_of_step()
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixReaxBonds::OutputReaxBonds(int timestep, FILE *fp) void FixReaxBonds::OutputReaxBonds(bigint ntimestep, FILE *fp)
{ {
int nparticles,nparticles_tot,nbuf,nbuf_local,most,j; int nparticles,nparticles_tot,nbuf,nbuf_local,most,j;
int ii,jn,mbond,numbonds,nsbmax,nsbmax_most; int ii,jn,mbond,numbonds,nsbmax,nsbmax_most;
@ -120,7 +121,9 @@ void FixReaxBonds::OutputReaxBonds(int timestep, FILE *fp)
MPI_Allreduce(&nsbmax,&nsbmax_most,1,MPI_INT,MPI_MAX,world); MPI_Allreduce(&nsbmax,&nsbmax_most,1,MPI_INT,MPI_MAX,world);
if (me == 0) { if (me == 0) {
fprintf(fp,"# Timestep %d \n",timestep); char fstr[32];
sprintf(fstr,"# Timestep %d \n",BIGINT_FORMAT);
fprintf(fp,fstr,ntimestep);
fprintf(fp,"# \n"); fprintf(fp,"# \n");
fprintf(fp,"# Number of particles %d \n",nparticles_tot); fprintf(fp,"# Number of particles %d \n",nparticles_tot);
fprintf(fp,"# \n"); fprintf(fp,"# \n");

View File

@ -20,7 +20,6 @@ namespace LAMMPS_NS {
class FixEvent : public Fix { class FixEvent : public Fix {
public: public:
FixEvent(class LAMMPS *, int, char **); FixEvent(class LAMMPS *, int, char **);
virtual ~FixEvent()=0; // Use destructor to make base class virtual virtual ~FixEvent()=0; // Use destructor to make base class virtual
int setmask(); int setmask();

View File

@ -18,6 +18,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "fix_event_prd.h" #include "fix_event_prd.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "update.h" #include "update.h"
#include "domain.h" #include "domain.h"
@ -50,10 +51,10 @@ FixEventPRD::FixEventPRD(LAMMPS *lmp, int narg, char **arg) :
update clock = elapsed time since last event, across all replicas update clock = elapsed time since last event, across all replicas
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void FixEventPRD::store_event_prd(int timestep, int delta_clock) void FixEventPRD::store_event_prd(bigint ntimestep, int delta_clock)
{ {
store_event(); store_event();
event_timestep = timestep; event_timestep = ntimestep;
clock += delta_clock; clock += delta_clock;
event_number++; event_number++;
} }

View File

@ -21,13 +21,14 @@ FixStyle(EVENT/PRD,FixEventPRD)
#define LMP_FIX_EVENT_PRD_H #define LMP_FIX_EVENT_PRD_H
#include "fix_event.h" #include "fix_event.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
class FixEventPRD : public FixEvent { class FixEventPRD : public FixEvent {
public: public:
int event_number; // event counter int event_number; // event counter
int event_timestep; // timestep of last event on any replica bigint event_timestep; // timestep of last event on any replica
int clock; // total elapsed timesteps across all replicas int clock; // total elapsed timesteps across all replicas
int replica_number; // replica where last event occured int replica_number; // replica where last event occured
int correlated_event; // 1 if last event was correlated, 0 otherwise int correlated_event; // 1 if last event was correlated, 0 otherwise
@ -41,7 +42,7 @@ class FixEventPRD : public FixEvent {
// methods specific to FixEventPRD, invoked by PRD // methods specific to FixEventPRD, invoked by PRD
void store_event_prd(int, int); void store_event_prd(bigint, int);
private: private:

View File

@ -18,6 +18,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "fix_event_tad.h" #include "fix_event_tad.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "update.h" #include "update.h"
#include "domain.h" #include "domain.h"
@ -50,10 +51,10 @@ FixEventTAD::FixEventTAD(LAMMPS *lmp, int narg, char **arg) :
set event_timestep = when event occurred set event_timestep = when event occurred
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void FixEventTAD::store_event_tad(int timestep) void FixEventTAD::store_event_tad(bigint ntimestep)
{ {
store_event(); store_event();
event_timestep = timestep; event_timestep = ntimestep;
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -21,13 +21,14 @@ FixStyle(EVENT/TAD,FixEventTAD)
#define LMP_FIX_EVENT_TAD_H #define LMP_FIX_EVENT_TAD_H
#include "fix_event.h" #include "fix_event.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
class FixEventTAD : public FixEvent { class FixEventTAD : public FixEvent {
public: public:
int event_number; // event counter int event_number; // event counter
int event_timestep; // timestep of last event bigint event_timestep; // timestep of last event
double tlo; // event time at low temperature double tlo; // event time at low temperature
double ebarrier; // energy barrier for this event double ebarrier; // energy barrier for this event
@ -39,7 +40,7 @@ class FixEventTAD : public FixEvent {
// methods specific to FixEventTAD, invoked by TAD // methods specific to FixEventTAD, invoked by TAD
void store_event_tad(int); void store_event_tad(bigint);
private: private:

View File

@ -16,6 +16,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "neb.h" #include "neb.h"
#include "lmptype.h"
#include "universe.h" #include "universe.h"
#include "atom.h" #include "atom.h"
#include "update.h" #include "update.h"
@ -482,8 +483,10 @@ void NEB::print_status()
} }
if (me_universe == 0) { if (me_universe == 0) {
char fstr[32];
sprintf(fstr,"%s %%g %%g ",BIGINT_FORMAT);
if (universe->uscreen) { if (universe->uscreen) {
fprintf(universe->uscreen,"%d %g %g ",update->ntimestep, fprintf(universe->uscreen,fstr,update->ntimestep,
fmaxreplica,fmaxatom); fmaxreplica,fmaxatom);
fprintf(universe->uscreen,"%g %g %g ", fprintf(universe->uscreen,"%g %g %g ",
gradvnorm0,gradvnorm1,gradvnormc); gradvnorm0,gradvnorm1,gradvnormc);
@ -493,7 +496,7 @@ void NEB::print_status()
fprintf(universe->uscreen,"\n"); fprintf(universe->uscreen,"\n");
} }
if (universe->ulogfile) { if (universe->ulogfile) {
fprintf(universe->ulogfile,"%d %g %g ",update->ntimestep, fprintf(universe->ulogfile,fstr,update->ntimestep,
fmaxreplica,fmaxatom); fmaxreplica,fmaxatom);
fprintf(universe->ulogfile,"%g %g %g ", fprintf(universe->ulogfile,"%g %g %g ",
gradvnorm0,gradvnorm1,gradvnormc); gradvnorm0,gradvnorm1,gradvnormc);

View File

@ -424,7 +424,7 @@ void PRD::command(int narg, char **arg)
void PRD::dephase() void PRD::dephase()
{ {
int ntimestep_hold = update->ntimestep; bigint ntimestep_hold = update->ntimestep;
update->whichflag = 1; update->whichflag = 1;
update->nsteps = n_dephase*t_dephase; update->nsteps = n_dephase*t_dephase;
@ -486,8 +486,8 @@ void PRD::dynamics()
void PRD::quench() void PRD::quench()
{ {
int ntimestep_hold = update->ntimestep; bigint ntimestep_hold = update->ntimestep;
int endstep_hold = update->endstep; bigint endstep_hold = update->endstep;
// need to change whichflag so that minimize->setup() calling // need to change whichflag so that minimize->setup() calling
// modify->setup() will call fix->min_setup() // modify->setup() will call fix->min_setup()
@ -649,8 +649,10 @@ void PRD::log_event()
{ {
timer->array[TIME_LOOP] = time_start; timer->array[TIME_LOOP] = time_start;
if (universe->me == 0) { if (universe->me == 0) {
char fstr[32];
sprintf(fstr,"%s %%.3f %%d %%d %%d %%d %%d\n",BIGINT_FORMAT);
if (universe->uscreen) if (universe->uscreen)
fprintf(universe->uscreen,"%d %.3f %d %d %d %d %d\n", fprintf(universe->uscreen,fstr,
fix_event->event_timestep, fix_event->event_timestep,
timer->elapsed(TIME_LOOP), timer->elapsed(TIME_LOOP),
fix_event->clock, fix_event->clock,
@ -658,7 +660,7 @@ void PRD::log_event()
fix_event->ncoincident, fix_event->ncoincident,
fix_event->replica_number); fix_event->replica_number);
if (universe->ulogfile) if (universe->ulogfile)
fprintf(universe->ulogfile,"%d %.3f %d %d %d %d %d\n", fprintf(universe->ulogfile,fstr,
fix_event->event_timestep, fix_event->event_timestep,
timer->elapsed(TIME_LOOP), timer->elapsed(TIME_LOOP),
fix_event->clock, fix_event->clock,

View File

@ -79,7 +79,8 @@ void TAD::command(int narg, char **arg)
if (domain->box_exist == 0) if (domain->box_exist == 0)
error->all("tad command before simulation box is defined"); error->all("tad command before simulation box is defined");
if (universe->nworlds == 1) error->all("Cannot use TAD with a single replica for NEB"); if (universe->nworlds == 1)
error->all("Cannot use TAD with a single replica for NEB");
if (universe->nworlds != universe->nprocs) if (universe->nworlds != universe->nprocs)
error->all("Can only use TAD with 1-processor replicas for NEB"); error->all("Can only use TAD with 1-processor replicas for NEB");
if (atom->sortfreq > 0) if (atom->sortfreq > 0)
@ -222,11 +223,9 @@ void TAD::command(int narg, char **arg)
if (me_universe == 0) { if (me_universe == 0) {
if (universe->uscreen) if (universe->uscreen)
fprintf(universe->uscreen,"Step CPU Clock Event " fprintf(universe->uscreen,"Step CPU Clock Event\n");
"\n");
if (universe->ulogfile) if (universe->ulogfile)
fprintf(universe->ulogfile,"Step CPU Clock Event " fprintf(universe->ulogfile,"Step CPU Clock Event\n");
"\n");
} }
ulogfile_lammps = universe->ulogfile; ulogfile_lammps = universe->ulogfile;
@ -452,8 +451,8 @@ void TAD::dynamics()
void TAD::quench() void TAD::quench()
{ {
int ntimestep_hold = update->ntimestep; bigint ntimestep_hold = update->ntimestep;
int endstep_hold = update->endstep; bigint endstep_hold = update->endstep;
// need to change whichflag so that minimize->setup() calling // need to change whichflag so that minimize->setup() calling
// modify->setup() will call fix->min_setup() // modify->setup() will call fix->min_setup()
@ -518,14 +517,16 @@ void TAD::log_event()
{ {
timer->array[TIME_LOOP] = time_start; timer->array[TIME_LOOP] = time_start;
if (universe->me == 0) { if (universe->me == 0) {
char fstr[32];
sprintf(fstr,"%s %%.3f %%.3f %%d\n",BIGINT_FORMAT);
if (universe->uscreen) if (universe->uscreen)
fprintf(universe->uscreen,"%d %.3f %.3f %d\n", fprintf(universe->uscreen,fstr,
fix_event->event_timestep, fix_event->event_timestep,
timer->elapsed(TIME_LOOP), timer->elapsed(TIME_LOOP),
fix_event->tlo, fix_event->tlo,
fix_event->event_number); fix_event->event_number);
if (universe->ulogfile) if (universe->ulogfile)
fprintf(universe->ulogfile,"%d %.3f %.3f %d\n", fprintf(universe->ulogfile,fstr,
fix_event->event_timestep, fix_event->event_timestep,
timer->elapsed(TIME_LOOP), timer->elapsed(TIME_LOOP),
fix_event->tlo, fix_event->tlo,
@ -913,7 +914,7 @@ void TAD::compute_tlo(int ievent)
// first-replica output about each event // first-replica output about each event
if (universe->me == 0) { if (universe->me == 0) {
char str[128]; char str[128],fstr[128];
double tfrac = 0.0; double tfrac = 0.0;
if (ievent > 0) tfrac = delthi/deltstop; if (ievent > 0) tfrac = delthi/deltstop;
// sprintf(str, // sprintf(str,
@ -921,15 +922,14 @@ void TAD::compute_tlo(int ievent)
// ievent,ebarrier,deltlo,delthi,tfrac); // ievent,ebarrier,deltlo,delthi,tfrac);
// error->warning(str); // error->warning(str);
sprintf(fstr,"New event: t_hi = %s ievent = %%d eb = %%g "
"dt_lo = %%g dt_hi/t_stop = %%g \n",BIGINT_FORMAT);
if (screen) if (screen)
fprintf(screen, fprintf(screen,fstr,fix_event_list[ievent]->event_timestep,
"New event: t_hi = %d ievent = %d eb = %g dt_lo = %g dt_hi/t_stop = %g \n",
fix_event_list[ievent]->event_timestep,
ievent,ebarrier,deltlo,tfrac); ievent,ebarrier,deltlo,tfrac);
if (logfile) if (logfile)
fprintf(logfile, fprintf(logfile,fstr,fix_event_list[ievent]->event_timestep,
"New event: t_hi = %d ievent = %d eb = %g dt_lo = %g dt_hi/t_stop = %g \n",
fix_event_list[ievent]->event_timestep,
ievent,ebarrier,deltlo,tfrac); ievent,ebarrier,deltlo,tfrac);
} }

View File

@ -19,6 +19,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "temper.h" #include "temper.h"
#include "lmptype.h"
#include "universe.h" #include "universe.h"
#include "domain.h" #include "domain.h"
#include "atom.h" #include "atom.h"
@ -342,15 +343,15 @@ void Temper::scale_velocities(int t_partner, int t_me)
void Temper::print_status() void Temper::print_status()
{ {
if (universe->uscreen) { if (universe->uscreen) {
fprintf(universe->uscreen,"%d ",update->ntimestep); fprintf(universe->uscreen,BIGINT_FORMAT,update->ntimestep);
for (int i = 0; i < nworlds; i++) for (int i = 0; i < nworlds; i++)
fprintf(universe->uscreen,"%d ",world2temp[i]); fprintf(universe->uscreen," %d",world2temp[i]);
fprintf(universe->uscreen,"\n"); fprintf(universe->uscreen,"\n");
} }
if (universe->ulogfile) { if (universe->ulogfile) {
fprintf(universe->ulogfile,"%d ",update->ntimestep); fprintf(universe->ulogfile,BIGINT_FORMAT,update->ntimestep);
for (int i = 0; i < nworlds; i++) for (int i = 0; i < nworlds; i++)
fprintf(universe->ulogfile,"%d ",world2temp[i]); fprintf(universe->ulogfile," %d",world2temp[i]);
fprintf(universe->ulogfile,"\n"); fprintf(universe->ulogfile,"\n");
fflush(universe->ulogfile); fflush(universe->ulogfile);
} }

View File

@ -692,8 +692,9 @@ void FixSRD::post_force(int vflag)
if (ix < 0 || ix >= nbin2x || iy < 0 || iy >= nbin2y || if (ix < 0 || ix >= nbin2x || iy < 0 || iy >= nbin2y ||
iz < 0 || iz >= nbin2z) { iz < 0 || iz >= nbin2z) {
printf("SRD particle %d on step %d\n", char fstr[64];
atom->tag[i],update->ntimestep); sprintf(fstr,"SRD particle %%d on step %s\n",BIGINT_FORMAT);
printf(fstr,atom->tag[i],update->ntimestep);
printf("v = %g %g %g\n",v[i][0],v[i][1],v[i][2]); printf("v = %g %g %g\n",v[i][0],v[i][1],v[i][2]);
printf("x = %g %g %g\n",x[i][0],x[i][1],x[i][2]); printf("x = %g %g %g\n",x[i][0],x[i][1],x[i][2]);
printf("ix,iy,iz nx,ny,nz = %d %d %d %d %d %d\n", printf("ix,iy,iz nx,ny,nz = %d %d %d %d %d %d\n",
@ -1150,28 +1151,22 @@ void FixSRD::collisions_single()
if (t_remain > dt) { if (t_remain > dt) {
ninside++; ninside++;
if (insideflag == INSIDE_ERROR) { if (insideflag == INSIDE_ERROR || insideflag == INSIDE_WARN) {
char str[128]; char str[128],fstr[128];
if (type != WALL) if (type != WALL) {
sprintf(str,"SRD particle %d started " sprintf(fstr,"SRD particle %%d started "
"inside big particle %d on step %d bounce %d\n", "inside big particle %%d on step %s bounce %%d\n",
BIGINT_FORMAT);
sprintf(str,fstr,
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1); atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
else } else {
sprintf(str,"SRD particle %d started " sprintf(fstr,"SRD particle %%d started "
"inside wall %d on step %d bounce %d\n", "inside wall %%d on step %s bounce %%d\n",
BIGINT_FORMAT);
sprintf(str,fstr,
atom->tag[i],j,update->ntimestep,ibounce+1); atom->tag[i],j,update->ntimestep,ibounce+1);
error->one(str);
} }
if (insideflag == INSIDE_WARN) { if (insideflag == INSIDE_ERROR) error->one(str);
char str[128];
if (type != WALL)
sprintf(str,"SRD particle %d started "
"inside big particle %d on step %d bounce %d\n",
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
else
sprintf(str,"SRD particle %d started "
"inside wall %d on step %d bounce %d\n",
atom->tag[i],j,update->ntimestep,ibounce+1);
error->warning(str); error->warning(str);
} }
break; break;
@ -1300,18 +1295,14 @@ void FixSRD::collisions_multi()
if (t_remain > dt || t_remain < 0.0) { if (t_remain > dt || t_remain < 0.0) {
ninside++; ninside++;
if (insideflag == INSIDE_ERROR) { if (insideflag == INSIDE_ERROR || insideflag == INSIDE_WARN) {
char str[128]; char str[128],fstr[128];
sprintf(str,"SRD particle %d started " sprintf(fstr,"SRD particle %%d started "
"inside big particle %d on step %d bounce %d\n", "inside big particle %%d on step %s bounce %%d\n",
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1); BIGINT_FORMAT);
error->one(str); sprintf(str,fstr,
}
if (insideflag == INSIDE_WARN) {
char str[128];
sprintf(str,"SRD particle %d started "
"inside big particle %d on step %d bounce %d\n",
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1); atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
if (insideflag == INSIDE_ERROR) error->one(str);
error->warning(str); error->warning(str);
} }
t_first = 0.0; t_first = 0.0;
@ -2081,8 +2072,9 @@ int FixSRD::update_srd(int i, double dt, double *xscoll, double *vsnew,
xs[1] < srdlo[1] || xs[1] > srdhi[1] || xs[1] < srdlo[1] || xs[1] > srdhi[1] ||
xs[2] < srdlo[2] || xs[2] > srdhi[2]) { xs[2] < srdlo[2] || xs[2] > srdhi[2]) {
printf("Bad SRD particle move\n"); printf("Bad SRD particle move\n");
printf(" particle %d on proc %d at timestep %d\n", char fstr[64];
atom->tag[i],me,update->ntimestep); sprintf(fstr," particle %%d on proc %%d at timestep %s\n",BIGINT_FORMAT);
printf(fstr,atom->tag[i],me,update->ntimestep);
printf(" xnew %g %g %g\n",xs[0],xs[1],xs[2]); printf(" xnew %g %g %g\n",xs[0],xs[1],xs[2]);
printf(" srdlo/hi x %g %g\n",srdlo[0],srdhi[0]); printf(" srdlo/hi x %g %g\n",srdlo[0],srdhi[0]);
printf(" srdlo/hi y %g %g\n",srdlo[1],srdhi[1]); printf(" srdlo/hi y %g %g\n",srdlo[1],srdhi[1]);

View File

@ -230,7 +230,7 @@ void FixWallSRD::wall_params(int flag)
if (varflag) modify->clearstep_compute(); if (varflag) modify->clearstep_compute();
int ntimestep = update->ntimestep; bigint ntimestep = update->ntimestep;
for (int m = 0; m < nwall; m++) { for (int m = 0; m < nwall; m++) {
if (wallstyle[m] == VARIABLE) if (wallstyle[m] == VARIABLE)

View File

@ -21,6 +21,7 @@ FixStyle(wall/srd,FixWallSRD)
#define LMP_FIX_WALL_SRD_H #define LMP_FIX_WALL_SRD_H
#include "fix.h" #include "fix.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -47,7 +48,7 @@ class FixWallSRD : public Fix {
double dt; double dt;
double xwalllast[6]; double xwalllast[6];
int laststep; bigint laststep;
double **fwall_all; double **fwall_all;
int force_flag; int force_flag;

View File

@ -68,7 +68,8 @@ 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 = group->count(igroup); bigint n = group->count(igroup);
if (n > MAXSMALLINT) error->all("Too many atoms for dump xtc"); if (n > MAXSMALLINT/3/sizeof(float))
error->all("Too many atoms for dump xtc");
natoms = static_cast<int> (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");
@ -138,6 +139,9 @@ void DumpXTC::write_header(bigint nbig)
{ {
if (nbig > MAXSMALLINT) error->all("Too many atoms for dump xtc"); if (nbig > MAXSMALLINT) error->all("Too many atoms for dump xtc");
int n = nbig; int n = nbig;
if (update->ntimestep > MAXSMALLINT)
error->all("Too big a timestep for dump xtc");
int ntimestep = update->ntimestep;
// all procs realloc coords if total count grew // all procs realloc coords if total count grew
@ -154,8 +158,8 @@ void DumpXTC::write_header(bigint nbig)
int tmp = XTC_MAGIC; int tmp = XTC_MAGIC;
xdr_int(&xd,&tmp); xdr_int(&xd,&tmp);
xdr_int(&xd,&n); xdr_int(&xd,&n);
xdr_int(&xd,&update->ntimestep); xdr_int(&xd,&ntimestep);
float time_value = update->ntimestep * update->dt; float time_value = ntimestep * update->dt;
xdr_float(&xd,&time_value); xdr_float(&xd,&time_value);
// cell basis vectors // cell basis vectors

View File

@ -108,7 +108,7 @@ class Atom : protected Pointers {
// spatial sorting of atoms // spatial sorting of atoms
int sortfreq; // sort atoms every this many steps, 0 = off int sortfreq; // sort atoms every this many steps, 0 = off
int nextsort; // next timestep to sort on bigint nextsort; // next timestep to sort on
// functions // functions

View File

@ -16,6 +16,7 @@
#include "string.h" #include "string.h"
#include "ctype.h" #include "ctype.h"
#include "compute.h" #include "compute.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "domain.h" #include "domain.h"
#include "comm.h" #include "comm.h"
@ -147,7 +148,7 @@ void Compute::reset_extra_compute_fix(char *)
search from top downward, since list of times is in decreasing order search from top downward, since list of times is in decreasing order
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Compute::addstep(int ntimestep) void Compute::addstep(bigint ntimestep)
{ {
// i = location in list to insert ntimestep // i = location in list to insert ntimestep
@ -162,8 +163,8 @@ void Compute::addstep(int ntimestep)
if (ntime == maxtime) { if (ntime == maxtime) {
maxtime += DELTA; maxtime += DELTA;
tlist = (int *) tlist = (bigint *)
memory->srealloc(tlist,maxtime*sizeof(int),"compute:tlist"); memory->srealloc(tlist,maxtime*sizeof(bigint),"compute:tlist");
} }
// move remainder of list upward and insert ntimestep // move remainder of list upward and insert ntimestep
@ -179,7 +180,7 @@ void Compute::addstep(int ntimestep)
search from top downward, since list of times is in decreasing order search from top downward, since list of times is in decreasing order
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
int Compute::matchstep(int ntimestep) int Compute::matchstep(bigint ntimestep)
{ {
for (int i = ntime-1; i >= 0; i--) { for (int i = ntime-1; i >= 0; i--) {
if (ntimestep < tlist[i]) return 0; if (ntimestep < tlist[i]) return 0;

View File

@ -15,6 +15,7 @@
#define LMP_COMPUTE_H #define LMP_COMPUTE_H
#include "pointers.h" #include "pointers.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -63,14 +64,14 @@ class Compute : protected Pointers {
int timeflag; // 1 if Compute stores list of timesteps it's called on int timeflag; // 1 if Compute stores list of timesteps it's called on
int ntime; // # of entries in time list int ntime; // # of entries in time list
int maxtime; // max # of entries time list can hold int maxtime; // max # of entries time list can hold
int *tlist; // time list of steps the Compute is called on bigint *tlist; // list of timesteps the Compute is called on
int invoked_flag; // non-zero if invoked or accessed this step, 0 if not int invoked_flag; // non-zero if invoked or accessed this step, 0 if not
int invoked_scalar; // last timestep on which compute_scalar() was invoked bigint invoked_scalar; // last timestep on which compute_scalar() was invoked
int invoked_vector; // ditto for compute_vector() bigint invoked_vector; // ditto for compute_vector()
int invoked_array; // ditto for compute_array() bigint invoked_array; // ditto for compute_array()
int invoked_peratom; // ditto for compute_peratom() bigint invoked_peratom; // ditto for compute_peratom()
int invoked_local; // ditto for compute_local() bigint invoked_local; // ditto for compute_local()
double dof; // degrees-of-freedom for temperature double dof; // degrees-of-freedom for temperature
@ -103,8 +104,8 @@ class Compute : protected Pointers {
virtual void reset_extra_compute_fix(char *); virtual void reset_extra_compute_fix(char *);
void addstep(int); void addstep(bigint);
int matchstep(int); int matchstep(bigint);
void clearstep(); void clearstep();
virtual double memory_usage() {return 0.0;} virtual double memory_usage() {return 0.0;}

View File

@ -359,7 +359,9 @@ void Dump::openfile()
filecurrent = new char[strlen(filename) + 16]; filecurrent = new char[strlen(filename) + 16];
char *ptr = strchr(filename,'*'); char *ptr = strchr(filename,'*');
*ptr = '\0'; *ptr = '\0';
sprintf(filecurrent,"%s%d%s",filename,update->ntimestep,ptr+1); char fstr[16];
sprintf(fstr,"%%s%s%%s",BIGINT_FORMAT);
sprintf(filecurrent,fstr,filename,update->ntimestep,ptr+1);
*ptr = '*'; *ptr = '*';
} }

View File

@ -162,8 +162,7 @@ void DumpAtom::write_data(int n, double *mybuf)
void DumpAtom::header_binary(bigint ndump) void DumpAtom::header_binary(bigint ndump)
{ {
bigint ntimestep = update->ntimestep; fwrite(&update->ntimestep,sizeof(bigint),1,fp);
fwrite(&ntimestep,sizeof(bigint),1,fp);
fwrite(&ndump,sizeof(bigint),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);
@ -183,8 +182,7 @@ void DumpAtom::header_binary(bigint ndump)
void DumpAtom::header_binary_triclinic(bigint ndump) void DumpAtom::header_binary_triclinic(bigint ndump)
{ {
bigint ntimestep = update->ntimestep; fwrite(&update->ntimestep,sizeof(bigint),1,fp);
fwrite(&ntimestep,sizeof(bigint),1,fp);
fwrite(&ndump,sizeof(bigint),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);
@ -208,7 +206,7 @@ void DumpAtom::header_binary_triclinic(bigint ndump)
void DumpAtom::header_item(bigint 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,BIGINT_FORMAT_NL,update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT_NL,ndump); fprintf(fp,BIGINT_FORMAT_NL,ndump);
fprintf(fp,"ITEM: BOX BOUNDS\n"); fprintf(fp,"ITEM: BOX BOUNDS\n");
@ -223,7 +221,7 @@ void DumpAtom::header_item(bigint ndump)
void DumpAtom::header_item_triclinic(bigint 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,BIGINT_FORMAT_NL,update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT_NL,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");

View File

@ -246,8 +246,7 @@ void DumpCustom::write_header(bigint ndump)
void DumpCustom::header_binary(bigint ndump) void DumpCustom::header_binary(bigint ndump)
{ {
bigint ntimestep = update->ntimestep; fwrite(&update->ntimestep,sizeof(bigint),1,fp);
fwrite(&ntimestep,sizeof(int),1,fp);
fwrite(&ndump,sizeof(bigint),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);
@ -267,7 +266,7 @@ void DumpCustom::header_binary(bigint ndump)
void DumpCustom::header_binary_triclinic(bigint ndump) void DumpCustom::header_binary_triclinic(bigint ndump)
{ {
fwrite(&update->ntimestep,sizeof(int),1,fp); fwrite(&update->ntimestep,sizeof(bigint),1,fp);
fwrite(&ndump,sizeof(bigint),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);
@ -291,7 +290,7 @@ void DumpCustom::header_binary_triclinic(bigint ndump)
void DumpCustom::header_item(bigint 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,BIGINT_FORMAT_NL,update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT_NL,ndump); fprintf(fp,BIGINT_FORMAT_NL,ndump);
fprintf(fp,"ITEM: BOX BOUNDS\n"); fprintf(fp,"ITEM: BOX BOUNDS\n");
@ -306,7 +305,7 @@ void DumpCustom::header_item(bigint ndump)
void DumpCustom::header_item_triclinic(bigint 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,BIGINT_FORMAT_NL,update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT_NL,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");
@ -344,7 +343,6 @@ int DumpCustom::count()
// invoke Computes for per-atom quantities // invoke Computes for per-atom quantities
if (ncompute) { if (ncompute) {
int ntimestep = update->ntimestep;
for (i = 0; i < ncompute; i++) for (i = 0; i < ncompute; i++)
if (!(compute[i]->invoked_flag & INVOKED_PERATOM)) { if (!(compute[i]->invoked_flag & INVOKED_PERATOM)) {
compute[i]->compute_peratom(); compute[i]->compute_peratom();

View File

@ -69,7 +69,7 @@ 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 = group->count(igroup); bigint n = group->count(igroup);
if (n > MAXSMALLINT) error->all("Too many atoms for dump dcd"); if (n > MAXSMALLINT/sizeof(float)) error->all("Too many atoms for dump dcd");
natoms = static_cast<int> (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");
@ -125,6 +125,8 @@ void DumpDCD::openfile()
void DumpDCD::write_header(bigint 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");
if (update->ntimestep > MAXSMALLINT)
error->all("Too big a timestep for dump dcd");
// first time, write header for entire file // first time, write header for entire file
@ -323,14 +325,16 @@ void DumpDCD::write_dcd_header(const char *remarks)
time_t cur_time; time_t cur_time;
struct tm *tmbuf; struct tm *tmbuf;
int ntimestep = update->ntimestep;
out_integer = 84; out_integer = 84;
fwrite_int32(fp,out_integer); fwrite_int32(fp,out_integer);
strcpy(title_string,"CORD"); strcpy(title_string,"CORD");
fwrite(title_string,4,1,fp); fwrite(title_string,4,1,fp);
fwrite_int32(fp,0); // NFILE = # of snapshots in file fwrite_int32(fp,0); // NFILE = # of snapshots in file
fwrite_int32(fp,update->ntimestep); // START = timestep of first snapshot fwrite_int32(fp,ntimestep); // START = timestep of first snapshot
fwrite_int32(fp,nevery_save); // SKIP = interval between snapshots fwrite_int32(fp,nevery_save); // SKIP = interval between snapshots
fwrite_int32(fp,update->ntimestep); // NSTEP = timestep of last snapshot fwrite_int32(fp,ntimestep); // NSTEP = timestep of last snapshot
fwrite_int32(fp,0); // NAMD writes NSTEP or ISTART fwrite_int32(fp,0); // NAMD writes NSTEP or ISTART
fwrite_int32(fp,0); fwrite_int32(fp,0);
fwrite_int32(fp,0); fwrite_int32(fp,0);

View File

@ -191,7 +191,7 @@ 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,BIGINT_FORMAT_NL,update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF %s\n",label); fprintf(fp,"ITEM: NUMBER OF %s\n",label);
fprintf(fp,BIGINT_FORMAT_NL,ndump); fprintf(fp,BIGINT_FORMAT_NL,ndump);
fprintf(fp,"ITEM: %s %s\n",label,columns); fprintf(fp,"ITEM: %s %s\n",label,columns);
@ -207,7 +207,6 @@ int DumpLocal::count()
// invoke Computes for local quantities // invoke Computes for local quantities
if (ncompute) { if (ncompute) {
int ntimestep = update->ntimestep;
for (i = 0; i < ncompute; i++) { for (i = 0; i < ncompute; i++) {
if (!(compute[i]->invoked_flag & INVOKED_LOCAL)) { if (!(compute[i]->invoked_flag & INVOKED_LOCAL)) {
compute[i]->compute_local(); compute[i]->compute_local();

View File

@ -15,6 +15,7 @@
#define LMP_FIX_H #define LMP_FIX_H
#include "pointers.h" #include "pointers.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -29,7 +30,7 @@ class Fix : protected Pointers {
int box_change; // 1 if Fix changes box, 0 if not int box_change; // 1 if Fix changes box, 0 if not
int box_change_size; // 1 if Fix changes box size, 0 if not int box_change_size; // 1 if Fix changes box size, 0 if not
int box_change_shape; // 1 if Fix changes box shape, 0 if not int box_change_shape; // 1 if Fix changes box shape, 0 if not
int next_reneighbor; // next timestep to force a reneighboring bigint next_reneighbor; // next timestep to force a reneighboring
int thermo_energy; // 1 if fix_modify enabled ThEng, 0 if not int thermo_energy; // 1 if fix_modify enabled ThEng, 0 if not
int nevery; // how often to call an end_of_step fix int nevery; // how often to call an end_of_step fix
int rigid_flag; // 1 if Fix integrates rigid bodies, 0 if not int rigid_flag; // 1 if Fix integrates rigid bodies, 0 if not

View File

@ -14,6 +14,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "fix_ave_atom.h" #include "fix_ave_atom.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "domain.h" #include "domain.h"
#include "update.h" #include "update.h"
@ -276,7 +277,7 @@ void FixAveAtom::end_of_step()
// skip if not step which requires doing something // skip if not step which requires doing something
int ntimestep = update->ntimestep; bigint ntimestep = update->ntimestep;
if (ntimestep != nvalid) return; if (ntimestep != nvalid) return;
// zero if first step // zero if first step
@ -435,9 +436,9 @@ int FixAveAtom::unpack_exchange(int nlocal, double *buf)
else backup from next multiple of nfreq else backup from next multiple of nfreq
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
int FixAveAtom::nextvalid() bigint FixAveAtom::nextvalid()
{ {
int nvalid = (update->ntimestep/peratom_freq)*peratom_freq + peratom_freq; bigint nvalid = (update->ntimestep/peratom_freq)*peratom_freq + peratom_freq;
if (nvalid-peratom_freq == update->ntimestep && nrepeat == 1) if (nvalid-peratom_freq == update->ntimestep && nrepeat == 1)
nvalid = update->ntimestep; nvalid = update->ntimestep;
else else

View File

@ -22,6 +22,7 @@ FixStyle(ave/atom,FixAveAtom)
#include "stdio.h" #include "stdio.h"
#include "fix.h" #include "fix.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -42,13 +43,13 @@ class FixAveAtom : public Fix {
private: private:
int nvalues; int nvalues;
int nrepeat,nvalid,irepeat; int nrepeat,irepeat;
bigint nvalid;
int *which,*argindex,*value2index; int *which,*argindex,*value2index;
char **ids; char **ids;
double **array; double **array;
int nextvalid(); bigint nextvalid();
}; };
} }

View File

@ -20,6 +20,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "fix_ave_correlate.h" #include "fix_ave_correlate.h"
#include "lmptype.h"
#include "update.h" #include "update.h"
#include "modify.h" #include "modify.h"
#include "compute.h" #include "compute.h"
@ -383,7 +384,7 @@ void FixAveCorrelate::end_of_step()
// skip if not step which requires doing something // skip if not step which requires doing something
int ntimestep = update->ntimestep; bigint ntimestep = update->ntimestep;
if (ntimestep != nvalid) return; if (ntimestep != nvalid) return;
// accumulate results of computes,fixes,variables to origin // accumulate results of computes,fixes,variables to origin
@ -466,7 +467,9 @@ void FixAveCorrelate::end_of_step()
// output to file // output to file
if (fp && me == 0) { if (fp && me == 0) {
fprintf(fp,"%d %d\n",ntimestep,nrepeat); char fstr[16];
sprintf(fstr,"%s %%d\n",BIGINT_FORMAT);
fprintf(fp,fstr,ntimestep,nrepeat);
for (i = 0; i < nrepeat; i++) { for (i = 0; i < nrepeat; i++) {
fprintf(fp,"%d %d %d",i+1,i*nevery,count[i]); fprintf(fp,"%d %d %d",i+1,i*nevery,count[i]);
if (count[i]) if (count[i])
@ -585,9 +588,9 @@ double FixAveCorrelate::compute_array(int i, int j)
startstep is lower bound startstep is lower bound
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
int FixAveCorrelate::nextvalid() bigint FixAveCorrelate::nextvalid()
{ {
int nvalid = update->ntimestep; bigint nvalid = update->ntimestep;
if (startstep > nvalid) nvalid = startstep; if (startstep > nvalid) nvalid = startstep;
if (nvalid % nevery) nvalid = (nvalid/nevery)*nevery + nevery; if (nvalid % nevery) nvalid = (nvalid/nevery)*nevery + nevery;
return nvalid; return nvalid;

View File

@ -22,6 +22,7 @@ FixStyle(ave/correlate,FixAveCorrelate)
#include "stdio.h" #include "stdio.h"
#include "fix.h" #include "fix.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -37,7 +38,8 @@ class FixAveCorrelate : public Fix {
private: private:
int me,nvalues; int me,nvalues;
int nrepeat,nfreq,nvalid; int nrepeat,nfreq;
bigint nvalid;
int *which,*argindex,*value2index; int *which,*argindex,*value2index;
char **ids; char **ids;
FILE *fp; FILE *fp;
@ -58,7 +60,7 @@ class FixAveCorrelate : public Fix {
double **save_corr; double **save_corr;
void accumulate(); void accumulate();
int nextvalid(); bigint nextvalid();
}; };
} }

View File

@ -14,6 +14,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "fix_ave_histo.h" #include "fix_ave_histo.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "update.h" #include "update.h"
#include "modify.h" #include "modify.h"
@ -568,7 +569,7 @@ void FixAveHisto::end_of_step()
// skip if not step which requires doing something // skip if not step which requires doing something
int ntimestep = update->ntimestep; bigint ntimestep = update->ntimestep;
if (ntimestep != nvalid) return; if (ntimestep != nvalid) return;
// zero if first step // zero if first step
@ -788,8 +789,9 @@ void FixAveHisto::end_of_step()
// output result to file // output result to file
if (fp && me == 0) { if (fp && me == 0) {
fprintf(fp,"%d %d %g %g %g %g\n", char fstr[32];
ntimestep,nbins, sprintf(fstr,"%s %%d %%g %%g %%g %%g\n",BIGINT_FORMAT);
fprintf(fp,fstr,ntimestep,nbins,
stats_total[0],stats_total[1],stats_total[2],stats_total[3]); stats_total[0],stats_total[1],stats_total[2],stats_total[3]);
if (stats_total[0] != 0.0) if (stats_total[0] != 0.0)
for (i = 0; i < nbins; i++) for (i = 0; i < nbins; i++)
@ -989,9 +991,9 @@ void FixAveHisto::allocate_values(int n)
else backup from next multiple of nfreq else backup from next multiple of nfreq
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
int FixAveHisto::nextvalid() bigint FixAveHisto::nextvalid()
{ {
int nvalid = (update->ntimestep/nfreq)*nfreq + nfreq; bigint nvalid = (update->ntimestep/nfreq)*nfreq + nfreq;
if (nvalid-nfreq == update->ntimestep && nrepeat == 1) if (nvalid-nfreq == update->ntimestep && nrepeat == 1)
nvalid = update->ntimestep; nvalid = update->ntimestep;
else else

View File

@ -22,6 +22,7 @@ FixStyle(ave/histo,FixAveHisto)
#include "stdio.h" #include "stdio.h"
#include "fix.h" #include "fix.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -38,7 +39,8 @@ class FixAveHisto : public Fix {
private: private:
int me,nvalues; int me,nvalues;
int nrepeat,nfreq,nvalid,irepeat; int nrepeat,nfreq,irepeat;
bigint nvalid;
int *which,*argindex,*value2index; int *which,*argindex,*value2index;
char **ids; char **ids;
FILE *fp; FILE *fp;
@ -65,7 +67,7 @@ class FixAveHisto : public Fix {
void bin_atoms(double *, int); void bin_atoms(double *, int);
void options(int, char **); void options(int, char **);
void allocate_values(int); void allocate_values(int);
int nextvalid(); bigint nextvalid();
}; };
} }

View File

@ -18,6 +18,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "fix_ave_spatial.h" #include "fix_ave_spatial.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "update.h" #include "update.h"
#include "force.h" #include "force.h"
@ -494,7 +495,7 @@ void FixAveSpatial::end_of_step()
// skip if not step which requires doing something // skip if not step which requires doing something
int ntimestep = update->ntimestep; bigint ntimestep = update->ntimestep;
if (ntimestep != nvalid) return; if (ntimestep != nvalid) return;
// zero out arrays that accumulate over many samples // zero out arrays that accumulate over many samples
@ -788,7 +789,9 @@ void FixAveSpatial::end_of_step()
// output result to file // output result to file
if (fp && me == 0) { if (fp && me == 0) {
fprintf(fp,"%d %d\n",ntimestep,nbins); char fstr[16];
sprintf(fstr,"%s %%d\n",BIGINT_FORMAT);
fprintf(fp,fstr,ntimestep,nbins);
if (ndim == 1) if (ndim == 1)
for (m = 0; m < nbins; m++) { for (m = 0; m < nbins; m++) {
fprintf(fp," %d %g %g",m+1,coord[m][0], fprintf(fp," %d %g %g",m+1,coord[m][0],
@ -1268,9 +1271,9 @@ double FixAveSpatial::compute_array(int i, int j)
else backup from next multiple of nfreq else backup from next multiple of nfreq
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
int FixAveSpatial::nextvalid() bigint FixAveSpatial::nextvalid()
{ {
int nvalid = (update->ntimestep/nfreq)*nfreq + nfreq; bigint nvalid = (update->ntimestep/nfreq)*nfreq + nfreq;
if (nvalid-nfreq == update->ntimestep && nrepeat == 1) if (nvalid-nfreq == update->ntimestep && nrepeat == 1)
nvalid = update->ntimestep; nvalid = update->ntimestep;
else else

View File

@ -22,6 +22,7 @@ FixStyle(ave/spatial,FixAveSpatial)
#include "stdio.h" #include "stdio.h"
#include "fix.h" #include "fix.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -38,7 +39,8 @@ class FixAveSpatial : public Fix {
private: private:
int me,nvalues; int me,nvalues;
int nrepeat,nfreq,nvalid,irepeat; int nrepeat,nfreq,irepeat;
bigint nvalid;
int ndim,normflag,regionflag,iregion; int ndim,normflag,regionflag,iregion;
char *tstring,*sstring,*idregion; char *tstring,*sstring,*idregion;
int *which,*argindex,*value2index; int *which,*argindex,*value2index;
@ -72,7 +74,7 @@ class FixAveSpatial : public Fix {
void atom2bin1d(); void atom2bin1d();
void atom2bin2d(); void atom2bin2d();
void atom2bin3d(); void atom2bin3d();
int nextvalid(); bigint nextvalid();
}; };
} }

View File

@ -18,6 +18,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "fix_ave_time.h" #include "fix_ave_time.h"
#include "lmptype.h"
#include "update.h" #include "update.h"
#include "modify.h" #include "modify.h"
#include "compute.h" #include "compute.h"
@ -506,7 +507,7 @@ void FixAveTime::end_of_step()
{ {
// skip if not step which requires doing something // skip if not step which requires doing something
int ntimestep = update->ntimestep; bigint ntimestep = update->ntimestep;
if (ntimestep != nvalid) return; if (ntimestep != nvalid) return;
if (mode == SCALAR) invoke_scalar(ntimestep); if (mode == SCALAR) invoke_scalar(ntimestep);
@ -515,7 +516,7 @@ void FixAveTime::end_of_step()
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixAveTime::invoke_scalar(int ntimestep) void FixAveTime::invoke_scalar(bigint ntimestep)
{ {
int i,m; int i,m;
double scalar; double scalar;
@ -629,7 +630,7 @@ void FixAveTime::invoke_scalar(int ntimestep)
// output result to file // output result to file
if (fp && me == 0) { if (fp && me == 0) {
fprintf(fp,"%d",ntimestep); fprintf(fp,BIGINT_FORMAT,ntimestep);
for (i = 0; i < nvalues; i++) fprintf(fp," %g",vector_total[i]/norm); for (i = 0; i < nvalues; i++) fprintf(fp," %g",vector_total[i]/norm);
fprintf(fp,"\n"); fprintf(fp,"\n");
fflush(fp); fflush(fp);
@ -638,7 +639,7 @@ void FixAveTime::invoke_scalar(int ntimestep)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixAveTime::invoke_vector(int ntimestep) void FixAveTime::invoke_vector(bigint ntimestep)
{ {
int i,j,m; int i,j,m;
@ -769,7 +770,9 @@ void FixAveTime::invoke_vector(int ntimestep)
// output result to file // output result to file
if (fp && me == 0) { if (fp && me == 0) {
fprintf(fp,"%d %d\n",ntimestep,nrows); char fstr[16];
sprintf(fstr,"%s %%d\n",BIGINT_FORMAT);
fprintf(fp,fstr,ntimestep,nrows);
for (i = 0; i < nrows; i++) { for (i = 0; i < nrows; i++) {
fprintf(fp,"%d",i+1); fprintf(fp,"%d",i+1);
for (j = 0; j < nvalues; j++) fprintf(fp," %g",array_total[i][j]/norm); for (j = 0; j < nvalues; j++) fprintf(fp," %g",array_total[i][j]/norm);
@ -920,9 +923,9 @@ void FixAveTime::allocate_values(int n)
else backup from next multiple of nfreq else backup from next multiple of nfreq
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
int FixAveTime::nextvalid() bigint FixAveTime::nextvalid()
{ {
int nvalid = (update->ntimestep/nfreq)*nfreq + nfreq; bigint nvalid = (update->ntimestep/nfreq)*nfreq + nfreq;
if (nvalid-nfreq == update->ntimestep && nrepeat == 1) if (nvalid-nfreq == update->ntimestep && nrepeat == 1)
nvalid = update->ntimestep; nvalid = update->ntimestep;
else else

View File

@ -22,6 +22,7 @@ FixStyle(ave/time,FixAveTime)
#include "stdio.h" #include "stdio.h"
#include "fix.h" #include "fix.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -39,7 +40,8 @@ class FixAveTime : public Fix {
private: private:
int me,nvalues; int me,nvalues;
int nrepeat,nfreq,nvalid,irepeat; int nrepeat,nfreq,irepeat;
bigint nvalid;
int *which,*argindex,*value2index,*offcol; int *which,*argindex,*value2index,*offcol;
char **ids; char **ids;
FILE *fp; FILE *fp;
@ -59,11 +61,11 @@ class FixAveTime : public Fix {
double **array_total; double **array_total;
double ***array_list; double ***array_list;
void invoke_scalar(int); void invoke_scalar(bigint);
void invoke_vector(int); void invoke_vector(bigint);
void options(int, char **); void options(int, char **);
void allocate_values(int); void allocate_values(int);
int nextvalid(); bigint nextvalid();
}; };
} }

View File

@ -17,6 +17,7 @@
#include "string.h" #include "string.h"
#include "stdio.h" #include "stdio.h"
#include "fix_shake.h" #include "fix_shake.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "atom_vec.h" #include "atom_vec.h"
#include "update.h" #include "update.h"
@ -390,7 +391,7 @@ void FixShake::setup(int vflag)
// setup SHAKE output // setup SHAKE output
int ntimestep = update->ntimestep; bigint ntimestep = update->ntimestep;
next_output = ntimestep + output_every; next_output = ntimestep + output_every;
if (output_every == 0) next_output = update->laststep + 1; if (output_every == 0) next_output = update->laststep + 1;
if (output_every && ntimestep % output_every != 0) if (output_every && ntimestep % output_every != 0)
@ -453,8 +454,10 @@ void FixShake::pre_neighbor()
atom1 = atom->map(shake_atom[i][0]); atom1 = atom->map(shake_atom[i][0]);
atom2 = atom->map(shake_atom[i][1]); atom2 = atom->map(shake_atom[i][1]);
if (atom1 == -1 || atom2 == -1) { if (atom1 == -1 || atom2 == -1) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Shake atoms %d %d missing on proc %d at step %d", sprintf(fstr,"Shake atoms %%d %%d missing on proc %%d at step %s",
BIGINT_FORMAT);
sprintf(str,fstr,
shake_atom[i][0],shake_atom[i][1],me,update->ntimestep); shake_atom[i][0],shake_atom[i][1],me,update->ntimestep);
error->one(str); error->one(str);
} }
@ -464,8 +467,10 @@ void FixShake::pre_neighbor()
atom2 = atom->map(shake_atom[i][1]); atom2 = atom->map(shake_atom[i][1]);
atom3 = atom->map(shake_atom[i][2]); atom3 = atom->map(shake_atom[i][2]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1) { if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Shake atoms %d %d %d missing on proc %d at step %d", sprintf(fstr,"Shake atoms %%d %%d %%d missing on proc %%d at step %s",
BIGINT_FORMAT);
sprintf(str,fstr,
shake_atom[i][0],shake_atom[i][1],shake_atom[i][2], shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],
me,update->ntimestep); me,update->ntimestep);
error->one(str); error->one(str);
@ -477,8 +482,11 @@ void FixShake::pre_neighbor()
atom3 = atom->map(shake_atom[i][2]); atom3 = atom->map(shake_atom[i][2]);
atom4 = atom->map(shake_atom[i][3]); atom4 = atom->map(shake_atom[i][3]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Shake atoms %d %d %d %d missing on proc %d at step %d", sprintf(fstr,
"Shake atoms %%d %%d %%d %%d missing on proc %%d at step %s",
BIGINT_FORMAT);
sprintf(str,fstr,
shake_atom[i][0],shake_atom[i][1], shake_atom[i][0],shake_atom[i][1],
shake_atom[i][2],shake_atom[i][3], shake_atom[i][2],shake_atom[i][3],
me,update->ntimestep); me,update->ntimestep);
@ -2139,9 +2147,10 @@ void FixShake::stats()
// print stats only for non-zero counts // print stats only for non-zero counts
if (me == 0) { if (me == 0) {
char fstr[64];
sprintf(fstr,"SHAKE stats (type/ave/delta) on step %s\n",BIGINT_FORMAT);
if (screen) { if (screen) {
fprintf(screen,"SHAKE stats (type/ave/delta) on step %d\n", fprintf(screen,fstr,update->ntimestep);
update->ntimestep);
for (i = 1; i < nb; i++) for (i = 1; i < nb; i++)
if (b_count_all[i]) if (b_count_all[i])
fprintf(screen," %d %g %g\n",i, fprintf(screen," %d %g %g\n",i,
@ -2152,8 +2161,7 @@ void FixShake::stats()
a_ave_all[i]/a_count_all[i],a_max_all[i]-a_min_all[i]); a_ave_all[i]/a_count_all[i],a_max_all[i]-a_min_all[i]);
} }
if (logfile) { if (logfile) {
fprintf(logfile,"SHAKE stats (type/ave/delta) on step %d\n", fprintf(logfile,fstr,update->ntimestep);
update->ntimestep);
for (i = 0; i < nb; i++) for (i = 0; i < nb; i++)
if (b_count_all[i]) if (b_count_all[i])
fprintf(logfile," %d %g %g\n",i, fprintf(logfile," %d %g %g\n",i,

View File

@ -21,6 +21,7 @@ FixStyle(shake,FixShake)
#define LMP_FIX_SHAKE_H #define LMP_FIX_SHAKE_H
#include "fix.h" #include "fix.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -53,7 +54,7 @@ class FixShake : public Fix {
double tolerance; // SHAKE tolerance double tolerance; // SHAKE tolerance
int max_iter; // max # of SHAKE iterations int max_iter; // max # of SHAKE iterations
int output_every; // SHAKE stat output every so often int output_every; // SHAKE stat output every so often
int next_output; // timestep for next output bigint next_output; // timestep for next output
// settings from input command // settings from input command
int *bond_flag,*angle_flag; // bond/angle types to constrain int *bond_flag,*angle_flag; // bond/angle types to constrain

View File

@ -21,6 +21,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "fix_tmd.h" #include "fix_tmd.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "update.h" #include "update.h"
#include "modify.h" #include "modify.h"
@ -284,8 +285,9 @@ void FixTMD::initial_integrate(int vflag)
work_lambda += lambda*(rho_target - rho_old); work_lambda += lambda*(rho_target - rho_old);
if (!(update->ntimestep % nfileevery) && if (!(update->ntimestep % nfileevery) &&
(previous_stat != update->ntimestep)) { (previous_stat != update->ntimestep)) {
fprintf(fp,"%d %g %g %g %g %g %g %g\n", char fstr[64];
update->ntimestep,rho_target,rho_old, sprintf(fstr,"%s %%g %%g %%g %%g %%g %%g %%g\n",BIGINT_FORMAT);
fprintf(fp,fstr,update->ntimestep,rho_target,rho_old,
gamma_back,gamma_forward,lambda,work_lambda,work_analytical); gamma_back,gamma_forward,lambda,work_lambda,work_analytical);
fflush(fp); fflush(fp);
previous_stat = update->ntimestep; previous_stat = update->ntimestep;

View File

@ -43,7 +43,8 @@ class FixTMD : public Fix {
private: private:
int me; int me;
int nfileevery,previous_stat,compressed; int nfileevery,compressed;
bigint previous_stat;
FILE *fp; FILE *fp;
double rho_start,rho_stop,rho_old,masstotal; double rho_start,rho_stop,rho_old,masstotal;
double dtv,dtf; double dtv,dtf;

View File

@ -21,6 +21,7 @@
#include "string.h" #include "string.h"
#include "stdlib.h" #include "stdlib.h"
#include "fix_ttm.h" #include "fix_ttm.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "force.h" #include "force.h"
#include "update.h" #include "update.h"
@ -525,7 +526,7 @@ void FixTTM::end_of_step()
total_nnodes,MPI_DOUBLE,MPI_SUM,world); total_nnodes,MPI_DOUBLE,MPI_SUM,world);
if (me == 0) { if (me == 0) {
fprintf(fp,"%d ",update->ntimestep); fprintf(fp,BIGINT_FORMAT,update->ntimestep);
double T_a; double T_a;
for (int ixnode = 0; ixnode < nxnodes; ixnode++) for (int ixnode = 0; ixnode < nxnodes; ixnode++)
@ -535,7 +536,7 @@ void FixTTM::end_of_step()
if (nsum_all[ixnode][iynode][iznode] > 0) if (nsum_all[ixnode][iynode][iznode] > 0)
T_a = sum_mass_vsq_all[ixnode][iynode][iznode]/ T_a = sum_mass_vsq_all[ixnode][iynode][iznode]/
(3.0*force->boltz*nsum_all[ixnode][iynode][iznode]/force->mvv2e); (3.0*force->boltz*nsum_all[ixnode][iynode][iznode]/force->mvv2e);
fprintf(fp,"%f ",T_a); fprintf(fp," %f",T_a);
} }
fprintf(fp,"\t"); fprintf(fp,"\t");

View File

@ -13,6 +13,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "integrate.h" #include "integrate.h"
#include "lmptype.h"
#include "update.h" #include "update.h"
#include "modify.h" #include "modify.h"
#include "compute.h" #include "compute.h"
@ -93,7 +94,7 @@ void Integrate::ev_setup()
vflag = 5 or 6 = both global and per-atom virial vflag = 5 or 6 = both global and per-atom virial
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Integrate::ev_set(int ntimestep) void Integrate::ev_set(bigint ntimestep)
{ {
int i,flag; int i,flag;

View File

@ -15,6 +15,7 @@
#define LMP_INTEGRATE_H #define LMP_INTEGRATE_H
#include "pointers.h" #include "pointers.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -42,7 +43,7 @@ class Integrate : protected Pointers {
class Compute **vlist_atom; class Compute **vlist_atom;
void ev_setup(); void ev_setup();
void ev_set(int); void ev_set(bigint);
}; };
} }

View File

@ -61,6 +61,9 @@ typedef int64_t bigint;
#define TAGINT_FORMAT_NL "%d\n" #define TAGINT_FORMAT_NL "%d\n"
#define BIGINT_FORMAT_NL "%lld\n" #define BIGINT_FORMAT_NL "%lld\n"
#define ATOTAGINT atoi
#define ATOBIGINT atoll
// for molecular problems that exceed 2 billion (2^31) atoms // for molecular problems that exceed 2 billion (2^31) atoms
// 32-bit smallint, 64-bit tagint and bigint // 32-bit smallint, 64-bit tagint and bigint
// NOTE: 64-bit tagint is not yet supported // NOTE: 64-bit tagint is not yet supported
@ -81,6 +84,9 @@ typedef int64_t bigint;
#define BIGINT_FORMAT "%lld" #define BIGINT_FORMAT "%lld"
#define TAGINT_FORMAT_NL "%lld\n" #define TAGINT_FORMAT_NL "%lld\n"
#define BIGINT_FORMAT_NL "%lld\n" #define BIGINT_FORMAT_NL "%lld\n"
#define ATOTAGINT atoll
#define ATOBIGINT atoll
*/ */
// for machines that do not support 64-bit ints // for machines that do not support 64-bit ints
@ -102,6 +108,9 @@ typedef int bigint;
#define BIGINT_FORMAT "%d" #define BIGINT_FORMAT "%d"
#define TAGINT_FORMAT_NL "%d\n" #define TAGINT_FORMAT_NL "%d\n"
#define BIGINT_FORMAT_NL "%d\n" #define BIGINT_FORMAT_NL "%d\n"
#define ATOTAGINT atoi
#define ATOBIGINT atoi
*/ */
} }

View File

@ -23,6 +23,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#include "min.h" #include "min.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "domain.h" #include "domain.h"
#include "comm.h" #include "comm.h"
@ -648,7 +649,7 @@ void Min::ev_setup()
vflag = 5 or 6 = both global and per-atom virial vflag = 5 or 6 = both global and per-atom virial
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Min::ev_set(int ntimestep) void Min::ev_set(bigint ntimestep)
{ {
int i,flag; int i,flag;

View File

@ -98,7 +98,7 @@ class Min : protected Pointers {
double compute_force_norm_inf(); double compute_force_norm_inf();
void ev_setup(); void ev_setup();
void ev_set(int); void ev_set(bigint);
char *stopstrings(int); char *stopstrings(int);
}; };

View File

@ -81,15 +81,16 @@ void MinFire::reset_vectors()
int MinFire::iterate(int maxiter) int MinFire::iterate(int maxiter)
{ {
int ntimestep,flag,flagall; bigint ntimestep;
double vmax,vdotf,vdotfall,vdotv,vdotvall,fdotf,fdotfall; double vmax,vdotf,vdotfall,vdotv,vdotvall,fdotf,fdotfall;
double scale1,scale2; double scale1,scale2;
double dtvone,dtv,dtfm; double dtvone,dtv,dtfm;
int flag,flagall;
alpha_final = 0.0; alpha_final = 0.0;
double alpha = ALPHA0; double alpha = ALPHA0;
double dtmax = TMAX * dt; double dtmax = TMAX * dt;
int last_negative = update->ntimestep; bigint last_negative = update->ntimestep;
for (int iter = 0; iter < maxiter; iter++) { for (int iter = 0; iter < maxiter; iter++) {
ntimestep = ++update->ntimestep; ntimestep = ++update->ntimestep;

View File

@ -14,6 +14,7 @@
#include "mpi.h" #include "mpi.h"
#include "math.h" #include "math.h"
#include "min_quickmin.h" #include "min_quickmin.h"
#include "lmptype.h"
#include "universe.h" #include "universe.h"
#include "atom.h" #include "atom.h"
#include "force.h" #include "force.h"
@ -79,12 +80,13 @@ void MinQuickMin::reset_vectors()
int MinQuickMin::iterate(int maxiter) int MinQuickMin::iterate(int maxiter)
{ {
int ntimestep,flag,flagall; bigint ntimestep;
double vmax,vdotf,vdotfall,fdotf,fdotfall,scale; double vmax,vdotf,vdotfall,fdotf,fdotfall,scale;
double dtvone,dtv,dtfm; double dtvone,dtv,dtfm;
int flag,flagall;
alpha_final = 0.0; alpha_final = 0.0;
int last_negative = update->ntimestep; bigint last_negative = update->ntimestep;
for (int iter = 0; iter < maxiter; iter++) { for (int iter = 0; iter < maxiter; iter++) {
ntimestep = ++update->ntimestep; ntimestep = ++update->ntimestep;

View File

@ -831,7 +831,7 @@ void Modify::clearstep_compute()
called everywhere that computes are used, after computes are invoked called everywhere that computes are used, after computes are invoked
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Modify::addstep_compute(int newstep) void Modify::addstep_compute(bigint newstep)
{ {
for (int icompute = 0; icompute < n_timeflag; icompute++) for (int icompute = 0; icompute < n_timeflag; icompute++)
if (compute[list_timeflag[icompute]]->invoked_flag) if (compute[list_timeflag[icompute]]->invoked_flag)
@ -845,7 +845,7 @@ void Modify::addstep_compute(int newstep)
do not loop only over n_timeflag, since may not be set yet do not loop only over n_timeflag, since may not be set yet
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Modify::addstep_compute_all(int newstep) void Modify::addstep_compute_all(bigint newstep)
{ {
for (int icompute = 0; icompute < ncompute; icompute++) for (int icompute = 0; icompute < ncompute; icompute++)
if (compute[icompute]->timeflag) compute[icompute]->addstep(newstep); if (compute[icompute]->timeflag) compute[icompute]->addstep(newstep);

View File

@ -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 {
@ -88,8 +89,8 @@ class Modify : protected Pointers {
void delete_compute(char *); void delete_compute(char *);
int find_compute(char *); int find_compute(char *);
void clearstep_compute(); void clearstep_compute();
void addstep_compute(int); void addstep_compute(bigint);
void addstep_compute_all(int); void addstep_compute_all(bigint);
void write_restart(FILE *); void write_restart(FILE *);
int read_restart(FILE *); int read_restart(FILE *);

View File

@ -12,6 +12,7 @@
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#include "neighbor.h" #include "neighbor.h"
#include "lmptype.h"
#include "atom.h" #include "atom.h"
#include "force.h" #include "force.h"
#include "update.h" #include "update.h"
@ -41,9 +42,10 @@ void Neighbor::bond_all()
for (m = 0; m < num_bond[i]; m++) { for (m = 0; m < num_bond[i]; m++) {
atom1 = atom->map(bond_atom[i][m]); atom1 = atom->map(bond_atom[i][m]);
if (atom1 == -1) { if (atom1 == -1) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Bond atoms %d %d missing on proc %d at step %d", sprintf(fstr,"Bond atoms %%d %%d missing on proc %%d at step %s",
tag[i],bond_atom[i][m],me,update->ntimestep); BIGINT_FORMAT);
sprintf(str,fstr,tag[i],bond_atom[i][m],me,update->ntimestep);
error->one(str); error->one(str);
} }
if (newton_bond || i < atom1) { if (newton_bond || i < atom1) {
@ -80,9 +82,10 @@ void Neighbor::bond_partial()
if (bond_type[i][m] <= 0) continue; if (bond_type[i][m] <= 0) continue;
atom1 = atom->map(bond_atom[i][m]); atom1 = atom->map(bond_atom[i][m]);
if (atom1 == -1) { if (atom1 == -1) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Bond atoms %d %d missing on proc %d at step %d", sprintf(fstr,"Bond atoms %%d %%d missing on proc %%d at step %s",
tag[i],bond_atom[i][m],me,update->ntimestep); BIGINT_FORMAT);
sprintf(str,fstr,tag[i],bond_atom[i][m],me,update->ntimestep);
error->one(str); error->one(str);
} }
if (newton_bond || i < atom1) { if (newton_bond || i < atom1) {
@ -121,8 +124,10 @@ void Neighbor::angle_all()
atom2 = atom->map(angle_atom2[i][m]); atom2 = atom->map(angle_atom2[i][m]);
atom3 = atom->map(angle_atom3[i][m]); atom3 = atom->map(angle_atom3[i][m]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1) { if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Angle atoms %d %d %d missing on proc %d at step %d", sprintf(fstr,"Angle atoms %%d %%d %%d missing on proc %%d at step %s",
BIGINT_FORMAT);
sprintf(str,fstr,
angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m], angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m],
me,update->ntimestep); me,update->ntimestep);
error->one(str); error->one(str);
@ -165,8 +170,10 @@ void Neighbor::angle_partial()
atom2 = atom->map(angle_atom2[i][m]); atom2 = atom->map(angle_atom2[i][m]);
atom3 = atom->map(angle_atom3[i][m]); atom3 = atom->map(angle_atom3[i][m]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1) { if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
char str[128]; char str[128],fstr[64];
sprintf(str,"Angle atoms %d %d %d missing on proc %d at step %d", sprintf(fstr,"Angle atoms %%d %%d %%d missing on proc %%d at step %s",
BIGINT_FORMAT);
sprintf(str,fstr,
angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m], angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m],
me,update->ntimestep); me,update->ntimestep);
error->one(str); error->one(str);
@ -210,8 +217,10 @@ void Neighbor::dihedral_all()
atom3 = atom->map(dihedral_atom3[i][m]); atom3 = atom->map(dihedral_atom3[i][m]);
atom4 = atom->map(dihedral_atom4[i][m]); atom4 = atom->map(dihedral_atom4[i][m]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
char str[128]; char str[128],fstr[128];
sprintf(str,"Dihedral atoms %d %d %d %d missing on proc %d at step %d", sprintf(fstr,"Dihedral atoms %%d %%d %%d %%d "
"missing on proc %%d at step %s",BIGINT_FORMAT);
sprintf(str,fstr,
dihedral_atom1[i][m],dihedral_atom2[i][m], dihedral_atom1[i][m],dihedral_atom2[i][m],
dihedral_atom3[i][m],dihedral_atom4[i][m], dihedral_atom3[i][m],dihedral_atom4[i][m],
me,update->ntimestep); me,update->ntimestep);
@ -260,8 +269,10 @@ void Neighbor::dihedral_partial()
atom3 = atom->map(dihedral_atom3[i][m]); atom3 = atom->map(dihedral_atom3[i][m]);
atom4 = atom->map(dihedral_atom4[i][m]); atom4 = atom->map(dihedral_atom4[i][m]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
char str[128]; char str[128],fstr[128];
sprintf(str,"Dihedral atoms %d %d %d %d missing on proc %d at step %d", sprintf(fstr,"Dihedral atoms %%d %%d %%d %%d "
"missing on proc %%d at step %s",BIGINT_FORMAT);
sprintf(str,fstr,
dihedral_atom1[i][m],dihedral_atom2[i][m], dihedral_atom1[i][m],dihedral_atom2[i][m],
dihedral_atom3[i][m],dihedral_atom4[i][m], dihedral_atom3[i][m],dihedral_atom4[i][m],
me,update->ntimestep); me,update->ntimestep);
@ -309,8 +320,10 @@ void Neighbor::improper_all()
atom3 = atom->map(improper_atom3[i][m]); atom3 = atom->map(improper_atom3[i][m]);
atom4 = atom->map(improper_atom4[i][m]); atom4 = atom->map(improper_atom4[i][m]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
char str[128]; char str[128],fstr[128];
sprintf(str,"Improper atoms %d %d %d %d missing on proc %d at step %d", sprintf(fstr,"Improper atoms %%d %%d %%d %%d "
"missing on proc %%d at step %s",BIGINT_FORMAT);
sprintf(str,fstr,
improper_atom1[i][m],improper_atom2[i][m], improper_atom1[i][m],improper_atom2[i][m],
improper_atom3[i][m],improper_atom4[i][m], improper_atom3[i][m],improper_atom4[i][m],
me,update->ntimestep); me,update->ntimestep);
@ -359,8 +372,10 @@ void Neighbor::improper_partial()
atom3 = atom->map(improper_atom3[i][m]); atom3 = atom->map(improper_atom3[i][m]);
atom4 = atom->map(improper_atom4[i][m]); atom4 = atom->map(improper_atom4[i][m]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
char str[128]; char str[128],fstr[128];
sprintf(str,"Improper atoms %d %d %d %d missing on proc %d at step %d", sprintf(fstr,"Improper atoms %%d %%d %%d %%d "
"missing on proc %%d at step %s",BIGINT_FORMAT);
sprintf(str,fstr,
improper_atom1[i][m],improper_atom2[i][m], improper_atom1[i][m],improper_atom2[i][m],
improper_atom3[i][m],improper_atom4[i][m], improper_atom3[i][m],improper_atom4[i][m],
me,update->ntimestep); me,update->ntimestep);

View File

@ -148,7 +148,7 @@ void Output::init()
void Output::setup(int flag) void Output::setup(int flag)
{ {
int ntimestep = update->ntimestep; bigint ntimestep = update->ntimestep;
// perform dump at start of run if current timestep is multiple of every // perform dump at start of run if current timestep is multiple of every
// and last dump was not on this timestep // and last dump was not on this timestep
@ -239,7 +239,7 @@ void Output::setup(int flag)
do dump/restart before thermo so thermo CPU time will include them do dump/restart before thermo so thermo CPU time will include them
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Output::write(int ntimestep) void Output::write(bigint ntimestep)
{ {
// next_dump does not force output on last step of run // next_dump does not force output on last step of run
// wrap dumps that invoke computes with clear/add // wrap dumps that invoke computes with clear/add
@ -273,7 +273,9 @@ void Output::write(int ntimestep)
char *file = new char[strlen(restart1) + 16]; char *file = new char[strlen(restart1) + 16];
char *ptr = strchr(restart1,'*'); char *ptr = strchr(restart1,'*');
*ptr = '\0'; *ptr = '\0';
sprintf(file,"%s%d%s",restart1,ntimestep,ptr+1); char fstr[16];
sprintf(fstr,"%%s%s%%s",BIGINT_FORMAT);
sprintf(file,fstr,restart1,ntimestep,ptr+1);
*ptr = '*'; *ptr = '*';
restart->write(file); restart->write(file);
delete [] file; delete [] file;
@ -316,7 +318,7 @@ void Output::write(int ntimestep)
force a snapshot to be written for all dumps force a snapshot to be written for all dumps
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Output::write_dump(int ntimestep) void Output::write_dump(bigint ntimestep)
{ {
for (int idump = 0; idump < ndump; idump++) { for (int idump = 0; idump < ndump; idump++) {
dump[idump]->write(); dump[idump]->write();
@ -328,13 +330,15 @@ void Output::write_dump(int ntimestep)
force a restart file to be written force a restart file to be written
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Output::write_restart(int ntimestep) void Output::write_restart(bigint ntimestep)
{ {
if (restart_toggle == 0) { if (restart_toggle == 0) {
char *file = new char[strlen(restart1) + 16]; char *file = new char[strlen(restart1) + 16];
char *ptr = strchr(restart1,'*'); char *ptr = strchr(restart1,'*');
*ptr = '\0'; *ptr = '\0';
sprintf(file,"%s%d%s",restart1,ntimestep,ptr+1); char fstr[16];
sprintf(fstr,"%%s%s%%s",BIGINT_FORMAT);
sprintf(file,fstr,restart1,ntimestep,ptr+1);
*ptr = '*'; *ptr = '*';
restart->write(file); restart->write(file);
delete [] file; delete [] file;
@ -373,10 +377,10 @@ void Output::add_dump(int narg, char **arg)
memory->srealloc(dump,max_dump*sizeof(Dump *),"output:dump"); memory->srealloc(dump,max_dump*sizeof(Dump *),"output:dump");
every_dump = (int *) every_dump = (int *)
memory->srealloc(every_dump,max_dump*sizeof(int),"output:every_dump"); memory->srealloc(every_dump,max_dump*sizeof(int),"output:every_dump");
next_dump = (int *) next_dump = (bigint *)
memory->srealloc(next_dump,max_dump*sizeof(int),"output:next_dump"); memory->srealloc(next_dump,max_dump*sizeof(bigint),"output:next_dump");
last_dump = (int *) last_dump = (bigint *)
memory->srealloc(last_dump,max_dump*sizeof(int),"output:last_dump"); memory->srealloc(last_dump,max_dump*sizeof(bigint),"output:last_dump");
var_dump = (char **) var_dump = (char **)
memory->srealloc(var_dump,max_dump*sizeof(char *),"output:var_dump"); memory->srealloc(var_dump,max_dump*sizeof(char *),"output:var_dump");
ivar_dump = (int *) ivar_dump = (int *)

View File

@ -15,33 +15,34 @@
#define LMP_OUTPUT_H #define LMP_OUTPUT_H
#include "pointers.h" #include "pointers.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
class Output : protected Pointers { class Output : protected Pointers {
public: public:
int next; // next timestep for any kind of output bigint next; // next timestep for any kind of output
int next_thermo; // next timestep for thermo output bigint next_thermo; // next timestep for thermo output
int thermo_every; // thermo output every this many steps int thermo_every; // thermo output every this many steps
int last_thermo; // last timestep thermo was output bigint last_thermo; // last timestep thermo was output
char *var_thermo; // variable name for thermo frequency char *var_thermo; // variable name for thermo frequency
int ivar_thermo; // variable index for thermo frequency int ivar_thermo; // variable index for thermo frequency
class Thermo *thermo; // Thermodynamic computations class Thermo *thermo; // Thermodynamic computations
int ndump; // # of Dumps defined int ndump; // # of Dumps defined
int max_dump; // max size of Dump list int max_dump; // max size of Dump list
int next_dump_any; // next timestep for any Dump bigint next_dump_any; // next timestep for any Dump
int *every_dump; // output of each Dump every this many steps int *every_dump; // output of each Dump every this many steps
int *next_dump; // next timestep to do each Dump bigint *next_dump; // next timestep to do each Dump
int *last_dump; // last timestep each a snapshot was output bigint *last_dump; // last timestep each snapshot was output
char **var_dump; // variable name for dump frequency char **var_dump; // variable name for dump frequency
int *ivar_dump; // variable index for dump frequency int *ivar_dump; // variable index for dump frequency
class Dump **dump; // list of defined Dumps class Dump **dump; // list of defined Dumps
int next_restart; // next timestep to write a restart file bigint next_restart; // next timestep to write a restart file
int restart_every; // write a restart file every this many steps int restart_every; // write a restart file every this many steps
int last_restart; // last timestep a restart file was output bigint last_restart; // last timestep a restart file was output
int restart_toggle; // 0 if use restart1 as prefix int restart_toggle; // 0 if use restart1 as prefix
// 1 if use restart1 as file, 2 for restart2 // 1 if use restart1 as file, 2 for restart2
char *restart1,*restart2; // names for restart files char *restart1,*restart2; // names for restart files
@ -51,9 +52,9 @@ class Output : protected Pointers {
~Output(); ~Output();
void init(); void init();
void setup(int); // initial output before run/min void setup(int); // initial output before run/min
void write(int); // output for current timestep void write(bigint); // output for current timestep
void write_dump(int); // force output of dump snapshots void write_dump(bigint); // force output of dump snapshots
void write_restart(int); // force output of a restart file void write_restart(bigint); // force output of a restart file
void add_dump(int, char **); // add a Dump to Dump list void add_dump(int, char **); // add a Dump to Dump list
void modify_dump(int, char **); // modify a Dump void modify_dump(int, char **); // modify a Dump

View File

@ -493,9 +493,7 @@ void ReadRestart::header()
delete [] style; delete [] style;
} else if (flag == NTIMESTEP) { } else if (flag == NTIMESTEP) {
// placeholder until ntimestep is 8-bytes update->ntimestep = read_bigint();
bigint ntimestep = read_bigint();
update->ntimestep = static_cast<int> (ntimestep);
// set dimension from restart file // set dimension from restart file

View File

@ -15,6 +15,7 @@
#define LMP_REGION_H #define LMP_REGION_H
#include "pointers.h" #include "pointers.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -60,7 +61,7 @@ class Region : protected Pointers {
char *xstr,*ystr,*zstr,*tstr; char *xstr,*ystr,*zstr,*tstr;
int xvar,yvar,zvar,tvar; int xvar,yvar,zvar,tvar;
double dx,dy,dz,theta; double dx,dy,dz,theta;
int laststep; bigint laststep;
void forward_transform(double &, double &, double &); void forward_transform(double &, double &, double &);
void inverse_transform(double &, double &, double &); void inverse_transform(double &, double &, double &);

View File

@ -445,7 +445,7 @@ void Respa::setup_minimal(int flag)
void Respa::run(int n) void Respa::run(int n)
{ {
int ntimestep; bigint ntimestep;
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {

View File

@ -133,19 +133,18 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
// format strings // format strings
format_multi = (char *) "---------------- Step %8d ----- " char *bigint_format = BIGINT_FORMAT;
"CPU = %11.4f (sec) ----------------"; char *fformat_multi = (char *) "---------------- Step %%8%s ----- "
"CPU = %%11.4f (sec) ----------------";
sprintf(format_multi,fformat_multi,&bigint_format[1]);
format_float_one_def = (char *) "%12.8g"; format_float_one_def = (char *) "%12.8g";
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";
if (sizeof(bigint) == 8) { sprintf(format_bigint_one_def,"%%8%s",&bigint_format[1]);
format_bigint_one_def = (char *) "%8ld"; sprintf(format_bigint_multi_def,"%%14%s",&bigint_format[1]);
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;
@ -281,7 +280,7 @@ void Thermo::compute(int flag)
int i; int i;
firststep = flag; firststep = flag;
int ntimestep = update->ntimestep; bigint ntimestep = update->ntimestep;
// check for lost atoms // check for lost atoms
// turn off normflag if natoms = 0 to avoid divide by 0 // turn off normflag if natoms = 0 to avoid divide by 0
@ -629,11 +628,11 @@ void Thermo::parse_fields(char *str)
while (word) { while (word) {
if (strcmp(word,"step") == 0) { if (strcmp(word,"step") == 0) {
addfield("Step",&Thermo::compute_step,INT); addfield("Step",&Thermo::compute_step,BIGINT);
} else if (strcmp(word,"elapsed") == 0) { } else if (strcmp(word,"elapsed") == 0) {
addfield("Elapsed",&Thermo::compute_elapsed,INT); addfield("Elapsed",&Thermo::compute_elapsed,BIGINT);
} else if (strcmp(word,"elaplong") == 0) { } else if (strcmp(word,"elaplong") == 0) {
addfield("Elaplong",&Thermo::compute_elapsed_long,INT); addfield("Elaplong",&Thermo::compute_elapsed_long,BIGINT);
} else if (strcmp(word,"dt") == 0) { } else if (strcmp(word,"dt") == 0) {
addfield("Dt",&Thermo::compute_dt,FLOAT); addfield("Dt",&Thermo::compute_dt,FLOAT);
} else if (strcmp(word,"cpu") == 0) { } else if (strcmp(word,"cpu") == 0) {
@ -942,7 +941,6 @@ int Thermo::evaluate_keyword(char *word, double *answer)
if (strcmp(word,"step") == 0) { if (strcmp(word,"step") == 0) {
compute_step(); compute_step();
dvalue = ivalue;
} else if (strcmp(word,"elapsed") == 0) { } else if (strcmp(word,"elapsed") == 0) {
if (update->whichflag == 0) if (update->whichflag == 0)
@ -1356,27 +1354,27 @@ void Thermo::compute_variable()
one method for every keyword thermo can output one method for every keyword thermo can output
called by compute() or evaluate_keyword() called by compute() or evaluate_keyword()
compute will have already been called compute will have already been called
set ivalue/dvalue if value is integer/double set ivalue/dvalue/bivalue if value is int/double/bigint
customize a new keyword by adding a method customize a new keyword by adding a method
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Thermo::compute_step() void Thermo::compute_step()
{ {
ivalue = update->ntimestep; bivalue = update->ntimestep;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void Thermo::compute_elapsed() void Thermo::compute_elapsed()
{ {
ivalue = update->ntimestep - update->firststep; bivalue = update->ntimestep - update->firststep;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void Thermo::compute_elapsed_long() void Thermo::compute_elapsed_long()
{ {
ivalue = update->ntimestep - update->beginstep; bivalue = update->ntimestep - update->beginstep;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -46,11 +46,11 @@ class Thermo : protected Pointers {
int *vtype; int *vtype;
char **format,**format_user; char **format,**format_user;
char *format_multi;
char *format_float_one_def,*format_float_multi_def; char *format_float_one_def,*format_float_multi_def;
char *format_int_one_def,*format_int_multi_def; char *format_int_one_def,*format_int_multi_def;
char *format_bigint_one_def,*format_bigint_multi_def;
char *format_float_user,*format_int_user,*format_bigint_user; char *format_float_user,*format_int_user,*format_bigint_user;
char format_multi[128];
char format_bigint_one_def[8],format_bigint_multi_def[8];
int normvalue; // use this for normflag unless natoms = 0 int normvalue; // use this for normflag unless natoms = 0
int normuserflag; // 0 if user has not set, 1 if has int normuserflag; // 0 if user has not set, 1 if has
@ -62,7 +62,7 @@ class Thermo : protected Pointers {
double last_tpcpu,last_spcpu; double last_tpcpu,last_spcpu;
double last_time; double last_time;
int last_step; bigint last_step;
bigint natoms; bigint natoms;

View File

@ -278,8 +278,9 @@ void Update::reset_timestep(int narg, char **arg)
for (int i = 0; i < modify->ncompute; i++) for (int i = 0; i < modify->ncompute; i++)
if (modify->compute[i]->timeflag) modify->compute[i]->clearstep(); if (modify->compute[i]->timeflag) modify->compute[i]->clearstep();
ntimestep = atoi(arg[0]); ntimestep = ATOBIGINT(arg[0]);
if (ntimestep < 0) error->all("Timestep must be >= 0"); if (ntimestep < 0) error->all("Timestep must be >= 0");
if (ntimestep > MAXBIGINT) error->all("Too big a timestep");
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -15,6 +15,7 @@
#define LMP_UPDATE_H #define LMP_UPDATE_H
#include "pointers.h" #include "pointers.h"
#include "lmptype.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
@ -22,19 +23,19 @@ class Update : protected Pointers {
public: public:
double dt; // timestep double dt; // timestep
double etol,ftol; // minimizer tolerances on energy/force double etol,ftol; // minimizer tolerances on energy/force
int ntimestep; // current step (dynamics or min iterations) bigint ntimestep; // current step (dynamics or min iterations)
int nsteps; // # of steps to run (dynamics or min iter) int nsteps; // # of steps to run (dynamics or min iter)
int whichflag; // 0 for unset, 1 for dynamics, 2 for min int whichflag; // 0 for unset, 1 for dynamics, 2 for min
int firststep,laststep; // 1st & last step of this run bigint firststep,laststep; // 1st & last step of this run
int beginstep,endstep; // 1st and last step of multiple runs bigint beginstep,endstep; // 1st and last step of multiple runs
int first_update; // 0 before initial update, 1 after int first_update; // 0 before initial update, 1 after
int max_eval; // max force evaluations for minimizer int max_eval; // max force evaluations for minimizer
int restrict_output; // 1 if output should not write dump/restart int restrict_output; // 1 if output should not write dump/restart
int setupflag; // set when setup() is computing forces int setupflag; // set when setup() is computing forces
int multireplica; // 1 if min across replicas, else 0 int multireplica; // 1 if min across replicas, else 0
int eflag_global,eflag_atom; // timestep global/peratom eng is tallied on bigint eflag_global,eflag_atom; // timestep global/peratom eng is tallied on
int vflag_global,vflag_atom; // ditto for virial bigint vflag_global,vflag_atom; // ditto for virial
char *unit_style; char *unit_style;

View File

@ -188,7 +188,8 @@ void Verlet::setup_minimal(int flag)
void Verlet::run(int n) void Verlet::run(int n)
{ {
int nflag,ntimestep,sortflag; bigint ntimestep;
int nflag,sortflag;
int n_post_integrate = modify->n_post_integrate; int n_post_integrate = modify->n_post_integrate;
int n_pre_exchange = modify->n_pre_exchange; int n_pre_exchange = modify->n_pre_exchange;

View File

@ -86,7 +86,9 @@ void WriteRestart::command(int narg, char **arg)
if (ptr = strchr(arg[0],'*')) { if (ptr = strchr(arg[0],'*')) {
*ptr = '\0'; *ptr = '\0';
sprintf(file,"%s%d%s",arg[0],update->ntimestep,ptr+1); char fstr[16];
sprintf(fstr,"%%s%s%%s",BIGINT_FORMAT);
sprintf(file,fstr,arg[0],update->ntimestep,ptr+1);
} else strcpy(file,arg[0]); } else strcpy(file,arg[0]);
// init entire system since comm->exchange is done // init entire system since comm->exchange is done
@ -300,9 +302,7 @@ void WriteRestart::header()
write_int(TAGINT,sizeof(tagint)); write_int(TAGINT,sizeof(tagint));
write_int(BIGINT,sizeof(bigint)); write_int(BIGINT,sizeof(bigint));
write_char(UNITS,update->unit_style); write_char(UNITS,update->unit_style);
// placeholder until ntimestep is 8-byte write_bigint(NTIMESTEP,update->ntimestep);
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]);