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

This commit is contained in:
sjplimp 2011-01-14 15:53:06 +00:00
parent 353439c414
commit d5b494397e
43 changed files with 318 additions and 334 deletions

View File

@ -210,9 +210,9 @@ void DihedralClass2::compute(int eflag, int vflag)
int me;
MPI_Comm_rank(world,&me);
if (screen) {
char str[128],fstr[64];
sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
sprintf(str,fstr,me,update->ntimestep,
char str[128];
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
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",

View File

@ -172,11 +172,9 @@ void FixQEQComb::post_force(int vflag)
// charge-equilibration loop
if (me == 0 && fp) {
char fstr[64];
sprintf(fstr,"Charge equilibration on step %s\n",BIGINT_FORMAT);
fprintf(fp,fstr,update->ntimestep);
}
if (me == 0 && fp)
fprintf(fp,"Charge equilibration on step " BIGINT_FORMAT "\n",
update->ntimestep);
heatpq = 0.01;
qmass = 0.06;

View File

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

View File

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

View File

@ -147,9 +147,9 @@ void DihedralCharmm::compute(int eflag, int vflag)
int me;
MPI_Comm_rank(world,&me);
if (screen) {
char str[128],fstr[64];
sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
sprintf(str,fstr,me,update->ntimestep,
char str[128];
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
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",

View File

@ -137,9 +137,9 @@ void DihedralHarmonic::compute(int eflag, int vflag)
int me;
MPI_Comm_rank(world,&me);
if (screen) {
char str[128],fstr[64];
sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
sprintf(str,fstr,me,update->ntimestep,
char str[128];
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
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",

View File

@ -169,9 +169,9 @@ void DihedralHelix::compute(int eflag, int vflag)
int me;
MPI_Comm_rank(world,&me);
if (screen) {
char str[128],fstr[64];
sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
sprintf(str,fstr,me,update->ntimestep,
char str[128];
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
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",

View File

@ -162,9 +162,9 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
int me;
MPI_Comm_rank(world,&me);
if (screen) {
char str[128],fstr[64];
sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
sprintf(str,fstr,me,update->ntimestep,
char str[128];
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
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",

View File

@ -168,9 +168,9 @@ void DihedralOPLS::compute(int eflag, int vflag)
int me;
MPI_Comm_rank(world,&me);
if (screen) {
char str[128],fstr[64];
sprintf(fstr,"Dihedral problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
sprintf(str,fstr,me,update->ntimestep,
char str[128];
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
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",

View File

@ -151,9 +151,10 @@ void ImproperCvff::compute(int eflag, int vflag)
int me;
MPI_Comm_rank(world,&me);
if (screen) {
char str[128],fstr[64];
sprintf(fstr,"Improper problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
sprintf(str,fstr,me,update->ntimestep,
char str[128];
sprintf(str,
"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
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",

View File

@ -122,9 +122,10 @@ void ImproperHarmonic::compute(int eflag, int vflag)
int me;
MPI_Comm_rank(world,&me);
if (screen) {
char str[128],fstr[64];
sprintf(fstr,"Improper problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
sprintf(str,fstr,me,update->ntimestep,
char str[128];
sprintf(str,
"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
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",

View File

@ -128,9 +128,10 @@ void ImproperUmbrella::compute(int eflag, int vflag)
int me;
MPI_Comm_rank(world,&me);
if (screen) {
char str[128],fstr[64];
sprintf(fstr,"Improper problem: %%d %s %%d %%d %%d %%d",BIGINT_FORMAT);
sprintf(str,fstr,me,update->ntimestep,
char str[128];
sprintf(str,
"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
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",

View File

@ -121,13 +121,11 @@ void FixReaxBonds::OutputReaxBonds(bigint ntimestep, FILE *fp)
MPI_Allreduce(&nsbmax,&nsbmax_most,1,MPI_INT,MPI_MAX,world);
if (me == 0) {
char fstr[32];
sprintf(fstr,"# Timestep %s \n",BIGINT_FORMAT);
fprintf(fp,fstr,ntimestep);
fprintf(fp,"# Timestep " BIGINT_FORMAT " \n",ntimestep);
fprintf(fp,"# \n");
fprintf(fp,"# Number of particles %d \n",nparticles_tot);
fprintf(fp,"# \n");
fprintf(fp,"# Max.number of bonds per atom %d with "
fprintf(fp,"# Max number of bonds per atom %d with "
"coarse bond order cutoff %5.3f \n",
nsbmax_most,cutof3);
fprintf(fp,"# Particle connection table and bond orders \n");

View File

@ -487,10 +487,8 @@ void NEB::print_status()
}
if (me_universe == 0) {
char fstr[32];
sprintf(fstr,"%s %%g %%g ",BIGINT_FORMAT);
if (universe->uscreen) {
fprintf(universe->uscreen,fstr,update->ntimestep,
fprintf(universe->uscreen,BIGINT_FORMAT " %g %g ",update->ntimestep,
fmaxreplica,fmaxatom);
fprintf(universe->uscreen,"%g %g %g ",
gradvnorm0,gradvnorm1,gradvnormc);
@ -500,7 +498,7 @@ void NEB::print_status()
fprintf(universe->uscreen,"\n");
}
if (universe->ulogfile) {
fprintf(universe->ulogfile,fstr,update->ntimestep,
fprintf(universe->ulogfile,BIGINT_FORMAT " %g %g ",update->ntimestep,
fmaxreplica,fmaxatom);
fprintf(universe->ulogfile,"%g %g %g ",
gradvnorm0,gradvnorm1,gradvnormc);

View File

@ -378,14 +378,15 @@ void PRD::command(int narg, char **arg)
neighbor->ndanger = ndanger;
if (me_universe == 0) {
char str[128];
sprintf(str,"Loop time of %%g on %%d procs for %%d steps with %s atoms\n",
BIGINT_FORMAT);
if (universe->uscreen)
fprintf(universe->uscreen,str,
fprintf(universe->uscreen,
"Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
" atoms\n",
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
if (universe->ulogfile)
fprintf(universe->ulogfile,str,
fprintf(universe->ulogfile,
"Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
" atoms\n",
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
}
@ -653,10 +654,9 @@ void PRD::log_event()
{
timer->array[TIME_LOOP] = time_start;
if (universe->me == 0) {
char fstr[32];
sprintf(fstr,"%s %%.3f %%d %%d %%d %%d %%d\n",BIGINT_FORMAT);
if (universe->uscreen)
fprintf(universe->uscreen,fstr,
fprintf(universe->uscreen,
BIGINT_FORMAT " %.3f %d %d %d %d %d\n",
fix_event->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->clock,
@ -664,7 +664,8 @@ void PRD::log_event()
fix_event->ncoincident,
fix_event->replica_number);
if (universe->ulogfile)
fprintf(universe->ulogfile,fstr,
fprintf(universe->ulogfile,
BIGINT_FORMAT " %.3f %d %d %d %d %d\n",
fix_event->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->clock,

View File

@ -386,14 +386,15 @@ void TAD::command(int narg, char **arg)
neighbor->ndanger = ndanger;
if (me_universe == 0) {
char str[128];
sprintf(str,"Loop time of %%g on %%d procs for %%d steps with %s atoms\n",
BIGINT_FORMAT);
if (universe->uscreen)
fprintf(universe->uscreen,str,
fprintf(universe->uscreen,
"Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
" atoms\n",
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
if (universe->ulogfile)
fprintf(universe->ulogfile,str,
fprintf(universe->ulogfile,
"Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
" atoms\n",
timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
}
@ -521,16 +522,14 @@ void TAD::log_event()
{
timer->array[TIME_LOOP] = time_start;
if (universe->me == 0) {
char fstr[32];
sprintf(fstr,"%s %%.3f %%.3f %%d\n",BIGINT_FORMAT);
if (universe->uscreen)
fprintf(universe->uscreen,fstr,
fprintf(universe->uscreen,BIGINT_FORMAT " %.3f %.3f %d\n",
fix_event->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->tlo,
fix_event->event_number);
if (universe->ulogfile)
fprintf(universe->ulogfile,fstr,
fprintf(universe->ulogfile,BIGINT_FORMAT " %.3f %.3f %d\n",
fix_event->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->tlo,
@ -918,22 +917,27 @@ void TAD::compute_tlo(int ievent)
// first-replica output about each event
if (universe->me == 0) {
char str[128],fstr[128];
double tfrac = 0.0;
if (ievent > 0) tfrac = delthi/deltstop;
// sprintf(str,
// "New event: ievent = %d eb = %g t_lo = %g t_hi = %g t_hi/t_stop = %g \n",
// ievent,ebarrier,deltlo,delthi,tfrac);
// 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);
// char str[128];
// sprintf(str,
// "New event: ievent = %d eb = %g t_lo = %g t_hi = %g t_hi/t_stop = %g \n",
// ievent,ebarrier,deltlo,delthi,tfrac);
// error->warning(str);
if (screen)
fprintf(screen,fstr,fix_event_list[ievent]->event_timestep,
fprintf(screen,
"New event: t_hi = " BIGINT_FORMAT " ievent = %d eb = %g "
"dt_lo = %g dt_hi/t_stop = %g \n",
fix_event_list[ievent]->event_timestep,
ievent,ebarrier,deltlo,tfrac);
if (logfile)
fprintf(logfile,fstr,fix_event_list[ievent]->event_timestep,
fprintf(logfile,
"New event: t_hi = " BIGINT_FORMAT " ievent = %d eb = %g "
"dt_lo = %g dt_hi/t_stop = %g \n",
fix_event_list[ievent]->event_timestep,
ievent,ebarrier,deltlo,tfrac);
}

View File

@ -692,13 +692,14 @@ void FixSRD::post_force(int vflag)
if (ix < 0 || ix >= nbin2x || iy < 0 || iy >= nbin2y ||
iz < 0 || iz >= nbin2z) {
char fstr[64];
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("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",
ix,iy,iz,nbin2x,nbin2y,nbin2z);
if (screen) {
fprintf(screen,"SRD particle %d on step " BIGINT_FORMAT "\n",
atom->tag[i],update->ntimestep);
fprintf(screen,"v = %g %g %g\n",v[i][0],v[i][1],v[i][2]);
fprintf(screen,"x = %g %g %g\n",x[i][0],x[i][1],x[i][2]);
fprintf(screen,"ix,iy,iz nx,ny,nz = %d %d %d %d %d %d\n",
ix,iy,iz,nbin2x,nbin2y,nbin2z);
}
error->one("Fix SRD: bad bin assignment for SRD advection");
}
}
@ -1152,20 +1153,19 @@ void FixSRD::collisions_single()
if (t_remain > dt) {
ninside++;
if (insideflag == INSIDE_ERROR || insideflag == INSIDE_WARN) {
char str[128],fstr[128];
if (type != WALL) {
sprintf(fstr,"SRD particle %%d started "
"inside big particle %%d on step %s bounce %%d\n",
BIGINT_FORMAT);
sprintf(str,fstr,
char str[128];
if (type != WALL)
sprintf(str,
"SRD particle %d started "
"inside big particle %d on step " BIGINT_FORMAT
" bounce %d\n",
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
else
sprintf(str,
"SRD particle %d started "
"inside big particle %d on step " BIGINT_FORMAT
" bounce %d\n",
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
} else {
sprintf(fstr,"SRD particle %%d started "
"inside wall %%d on step %s bounce %%d\n",
BIGINT_FORMAT);
sprintf(str,fstr,
atom->tag[i],j,update->ntimestep,ibounce+1);
}
if (insideflag == INSIDE_ERROR) error->one(str);
error->warning(str);
}
@ -1296,11 +1296,11 @@ void FixSRD::collisions_multi()
if (t_remain > dt || t_remain < 0.0) {
ninside++;
if (insideflag == INSIDE_ERROR || insideflag == INSIDE_WARN) {
char str[128],fstr[128];
sprintf(fstr,"SRD particle %%d started "
"inside big particle %%d on step %s bounce %%d\n",
BIGINT_FORMAT);
sprintf(str,fstr,
char str[128];
sprintf(str,
"SRD particle %d started "
"inside big particle %d on step " BIGINT_FORMAT
" bounce %d\n",
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
if (insideflag == INSIDE_ERROR) error->one(str);
error->warning(str);
@ -2071,15 +2071,15 @@ int FixSRD::update_srd(int i, double dt, double *xscoll, double *vsnew,
if (xs[0] < srdlo[0] || xs[0] > srdhi[0] ||
xs[1] < srdlo[1] || xs[1] > srdhi[1] ||
xs[2] < srdlo[2] || xs[2] > srdhi[2]) {
printf("Bad SRD particle move\n");
char fstr[64];
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(" srdlo/hi x %g %g\n",srdlo[0],srdhi[0]);
printf(" srdlo/hi y %g %g\n",srdlo[1],srdhi[1]);
printf(" srdlo/hi z %g %g\n",srdlo[2],srdhi[2]);
error->warning("Fix srd particle moved outside valid domain");
if (screen) {
error->warning("Fix srd particle moved outside valid domain");
fprintf(screen," particle %d on proc %d at timestep " BIGINT_FORMAT,
atom->tag[i],me,update->ntimestep);
fprintf(screen," xnew %g %g %g\n",xs[0],xs[1],xs[2]);
fprintf(screen," srdlo/hi x %g %g\n",srdlo[0],srdhi[0]);
fprintf(screen," srdlo/hi y %g %g\n",srdlo[1],srdhi[1]);
fprintf(screen," srdlo/hi z %g %g\n",srdlo[2],srdhi[2]);
}
}
if (triclinic) domain->lamda2x(xs,xs);
@ -2307,11 +2307,11 @@ void FixSRD::parameterize()
// print SRD parameters
if (me == 0) {
char str[64];
sprintf(str," SRD/big particles = %s %s\n",BIGINT_FORMAT,BIGINT_FORMAT);
if (screen) {
fprintf(screen,"SRD info:\n");
fprintf(screen,str,nsrd,mbig);
fprintf(screen,
" SRD/big particles = " BIGINT_FORMAT " " BIGINT_FORMAT "\n",
nsrd,mbig);
fprintf(screen," big particle diameter max/min = %g %g\n",
maxbigdiam,minbigdiam);
fprintf(screen," SRD temperature & lamda = %g %g\n",
@ -2326,7 +2326,9 @@ void FixSRD::parameterize()
}
if (logfile) {
fprintf(logfile,"SRD info:\n");
fprintf(logfile,str,nsrd,mbig);
fprintf(logfile,
" SRD/big particles = " BIGINT_FORMAT " " BIGINT_FORMAT "\n",
nsrd,mbig);
fprintf(logfile," big particle diameter max/min = %g %g\n",
maxbigdiam,minbigdiam);
fprintf(logfile," SRD temperature & lamda = %g %g\n",

View File

@ -176,12 +176,12 @@ void CreateAtoms::command(int narg, char **arg)
// print status
if (comm->me == 0) {
char str[32];
sprintf(str,"Created %s atoms\n",BIGINT_FORMAT);
if (screen)
fprintf(screen,str,atom->natoms-natoms_previous);
fprintf(screen,"Created " BIGINT_FORMAT " atoms\n",
atom->natoms-natoms_previous);
if (logfile)
fprintf(logfile,str,atom->natoms-natoms_previous);
fprintf(logfile,"Created " BIGINT_FORMAT " atoms\n",
atom->natoms-natoms_previous);
}
// reset simulation now that more atoms are defined

View File

@ -105,11 +105,12 @@ void DeleteAtoms::command(int narg, char **arg)
bigint ndelete = natoms_previous - atom->natoms;
if (comm->me == 0) {
char str[64];
sprintf(str,"Deleted %s atoms, new total = %s\n",
BIGINT_FORMAT,BIGINT_FORMAT);
if (screen) fprintf(screen,str,ndelete,atom->natoms);
if (logfile) fprintf(logfile,str,ndelete,atom->natoms);
if (screen) fprintf(screen,"Deleted " BIGINT_FORMAT
" atoms, new total = " BIGINT_FORMAT "\n",
ndelete,atom->natoms);
if (logfile) fprintf(logfile,"Deleted " BIGINT_FORMAT
" atoms, new total = " BIGINT_FORMAT "\n",
ndelete,atom->natoms);
}
}

View File

@ -447,33 +447,48 @@ void DeleteBonds::command(int narg, char **arg)
if (comm->me == 0) {
if (atom->avec->bonds_allow) {
char str[128];
sprintf(str," %s total bonds, %s turned on, %s turned off\n",
BIGINT_FORMAT,BIGINT_FORMAT,BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->nbonds,bond_on,bond_off);
if (logfile) fprintf(logfile,str,atom->nbonds,bond_on,bond_off);
if (screen) fprintf(screen,
" " BIGINT_FORMAT " total bonds, " BIGINT_FORMAT
" turned on, " BIGINT_FORMAT " turned off\n",
atom->nbonds,bond_on,bond_off);
if (logfile) fprintf(logfile,
" " BIGINT_FORMAT " total bonds, " BIGINT_FORMAT
" turned on, " BIGINT_FORMAT " turned off\n",
atom->nbonds,bond_on,bond_off);
}
if (atom->avec->angles_allow) {
char str[128];
sprintf(str," %s total angles, %s turned on, %s turned off\n",
BIGINT_FORMAT,BIGINT_FORMAT,BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->nangles,angle_on,angle_off);
if (logfile) fprintf(logfile,str,atom->nangles,angle_on,angle_off);
if (screen) fprintf(screen,
" " BIGINT_FORMAT " total angles, " BIGINT_FORMAT
" turned on, " BIGINT_FORMAT " turned off\n",
atom->nangles,angle_on,angle_off);
if (logfile) fprintf(logfile,
" " BIGINT_FORMAT " total angles, " BIGINT_FORMAT
" turned on, " BIGINT_FORMAT " turned off\n",
atom->nangles,angle_on,angle_off);
}
if (atom->avec->dihedrals_allow) {
char str[128];
sprintf(str," %s total dihedrals, %s turned on, %s turned off\n",
BIGINT_FORMAT,BIGINT_FORMAT,BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->ndihedrals,dihedral_on,dihedral_off);
if (logfile) fprintf(logfile,str,
atom->ndihedrals,dihedral_on,dihedral_off);
if (screen) fprintf(screen,
" " BIGINT_FORMAT " total dihedrals, "
BIGINT_FORMAT " turned on, " BIGINT_FORMAT
" turned off\n",
atom->ndihedrals,dihedral_on,dihedral_off);
if (logfile) fprintf(logfile,
" " BIGINT_FORMAT " total dihedrals, "
BIGINT_FORMAT " turned on, " BIGINT_FORMAT
" turned off\n",
atom->ndihedrals,dihedral_on,dihedral_off);
}
if (atom->avec->impropers_allow) {
char str[128];
sprintf(str," %s total impropers, %s turned on, %s turned off\n",
BIGINT_FORMAT,BIGINT_FORMAT,BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->nimpropers,improper_on,improper_off);
if (logfile) fprintf(logfile,str,
atom->nimpropers,improper_on,improper_off);
if (screen) fprintf(screen,
" " BIGINT_FORMAT " total impropers, "
BIGINT_FORMAT " turned on, " BIGINT_FORMAT
" turned off\n",
atom->nimpropers,improper_on,improper_off);
if (logfile) fprintf(logfile,
" " BIGINT_FORMAT " total impropers, "
BIGINT_FORMAT " turned on, " BIGINT_FORMAT
" turned off\n",
atom->nimpropers,improper_on,improper_off);
}
}

View File

@ -215,10 +215,9 @@ void DisplaceAtoms::command(int narg, char **arg)
bigint nblocal = atom->nlocal;
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (natoms != atom->natoms) {
char fstr[64],str[128];
sprintf(fstr,"Lost atoms via displace_atoms: original %s current %s",
BIGINT_FORMAT,BIGINT_FORMAT);
sprintf(str,fstr,atom->natoms,natoms);
char str[128];
sprintf(str,"Lost atoms via displace_atoms: original " BIGINT_FORMAT
" current " BIGINT_FORMAT,atom->natoms,natoms);
error->all(str);
}
}

View File

@ -381,10 +381,9 @@ void DisplaceBox::command(int narg, char **arg)
bigint nblocal = atom->nlocal;
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (natoms != atom->natoms) {
char fstr[64],str[128];
sprintf(fstr,"Lost atoms via displace_box: original %s current %s",
BIGINT_FORMAT,BIGINT_FORMAT);
sprintf(str,fstr,atom->natoms,natoms);
char str[128];
sprintf(str,"Lost atoms via displace_box: original " BIGINT_FORMAT
" current " BIGINT_FORMAT,atom->natoms,natoms);
error->all(str);
}
}

View File

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

View File

@ -206,9 +206,9 @@ void DumpAtom::header_binary_triclinic(bigint ndump)
void DumpAtom::header_item(bigint ndump)
{
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT_NL,update->ntimestep);
fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT_NL,ndump);
fprintf(fp,BIGINT_FORMAT "\n",ndump);
fprintf(fp,"ITEM: BOX BOUNDS\n");
fprintf(fp,"%g %g\n",boxxlo,boxxhi);
fprintf(fp,"%g %g\n",boxylo,boxyhi);
@ -221,9 +221,9 @@ void DumpAtom::header_item(bigint ndump)
void DumpAtom::header_item_triclinic(bigint ndump)
{
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT_NL,update->ntimestep);
fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT_NL,ndump);
fprintf(fp,BIGINT_FORMAT "\n",ndump);
fprintf(fp,"ITEM: BOX BOUNDS xy xz yz\n");
fprintf(fp,"%g %g %g\n",boxxlo,boxxhi,boxxy);
fprintf(fp,"%g %g %g\n",boxylo,boxyhi,boxxz);

View File

@ -290,9 +290,9 @@ void DumpCustom::header_binary_triclinic(bigint ndump)
void DumpCustom::header_item(bigint ndump)
{
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT_NL,update->ntimestep);
fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT_NL,ndump);
fprintf(fp,BIGINT_FORMAT "\n",ndump);
fprintf(fp,"ITEM: BOX BOUNDS\n");
fprintf(fp,"%g %g\n",boxxlo,boxxhi);
fprintf(fp,"%g %g\n",boxylo,boxyhi);
@ -305,9 +305,9 @@ void DumpCustom::header_item(bigint ndump)
void DumpCustom::header_item_triclinic(bigint ndump)
{
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT_NL,update->ntimestep);
fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT_NL,ndump);
fprintf(fp,BIGINT_FORMAT "\n",ndump);
fprintf(fp,"ITEM: BOX BOUNDS xy xz yz\n");
fprintf(fp,"%g %g %g\n",boxxlo,boxxhi,boxxy);
fprintf(fp,"%g %g %g\n",boxylo,boxyhi,boxxz);

View File

@ -191,9 +191,9 @@ void DumpLocal::write_header(bigint ndump)
{
if (me == 0) {
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT_NL,update->ntimestep);
fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF %s\n",label);
fprintf(fp,BIGINT_FORMAT_NL,ndump);
fprintf(fp,BIGINT_FORMAT "\n",ndump);
fprintf(fp,"ITEM: %s %s\n",label,columns);
}
}

View File

@ -61,7 +61,7 @@ void DumpXYZ::init_style()
void DumpXYZ::write_header(bigint n)
{
if (me == 0) {
fprintf(fp,BIGINT_FORMAT_NL,n);
fprintf(fp,BIGINT_FORMAT "\n",n);
fprintf(fp,"Atoms\n");
}
}

View File

@ -89,12 +89,15 @@ void Finish::end(int flag)
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (me == 0) {
char str[128];
sprintf(str,"Loop time of %%g on %%d procs for %%d steps with %s atoms\n",
BIGINT_FORMAT);
if (screen) fprintf(screen,str,time_loop,nprocs,update->nsteps,natoms);
if (logfile) fprintf(logfile,str,time_loop,nprocs,update->nsteps,natoms);
}
if (screen) fprintf(screen,
"Loop time of %g on %d procs for %d steps with "
BIGINT_FORMAT " atoms\n",
time_loop,nprocs,update->nsteps,natoms);
if (logfile) fprintf(logfile,
"Loop time of %g on %d procs for %d steps with "
BIGINT_FORMAT " atoms\n",
time_loop,nprocs,update->nsteps,natoms);
}
if (time_loop == 0.0) time_loop = 1.0;
}

View File

@ -467,9 +467,7 @@ void FixAveCorrelate::end_of_step()
// output to file
if (fp && me == 0) {
char fstr[16];
sprintf(fstr,"%s %%d\n",BIGINT_FORMAT);
fprintf(fp,fstr,ntimestep,nrepeat);
fprintf(fp,BIGINT_FORMAT " %d\n",ntimestep,nrepeat);
for (i = 0; i < nrepeat; i++) {
fprintf(fp,"%d %d %d",i+1,i*nevery,count[i]);
if (count[i])

View File

@ -789,9 +789,7 @@ void FixAveHisto::end_of_step()
// output result to file
if (fp && me == 0) {
char fstr[32];
sprintf(fstr,"%s %%d %%g %%g %%g %%g\n",BIGINT_FORMAT);
fprintf(fp,fstr,ntimestep,nbins,
fprintf(fp,BIGINT_FORMAT " %d %g %g %g %g\n",ntimestep,nbins,
stats_total[0],stats_total[1],stats_total[2],stats_total[3]);
if (stats_total[0] != 0.0)
for (i = 0; i < nbins; i++)

View File

@ -789,9 +789,7 @@ void FixAveSpatial::end_of_step()
// output result to file
if (fp && me == 0) {
char fstr[16];
sprintf(fstr,"%s %%d\n",BIGINT_FORMAT);
fprintf(fp,fstr,ntimestep,nbins);
fprintf(fp,BIGINT_FORMAT " %d\n",ntimestep,nbins);
if (ndim == 1)
for (m = 0; m < nbins; m++) {
fprintf(fp," %d %g %g",m+1,coord[m][0],

View File

@ -770,9 +770,7 @@ void FixAveTime::invoke_vector(bigint ntimestep)
// output result to file
if (fp && me == 0) {
char fstr[16];
sprintf(fstr,"%s %%d\n",BIGINT_FORMAT);
fprintf(fp,fstr,ntimestep,nrows);
fprintf(fp,BIGINT_FORMAT " %d\n",ntimestep,nrows);
for (i = 0; i < nrows; i++) {
fprintf(fp,"%d",i+1);
for (j = 0; j < nvalues; j++) fprintf(fp," %g",array_total[i][j]/norm);

View File

@ -403,11 +403,14 @@ void FixOrientFCC::post_force(int vflag)
MPI_Allreduce(&maxcount,&max,1,MPI_INT,MPI_MAX,world);
if (me == 0) {
char str[64];
sprintf(str,"orient step %%d: %s atoms have %%d neighbors\n",
BIGINT_FORMAT);
if (screen) fprintf(screen,str,update->ntimestep,atom->natoms,total);
if (logfile) fprintf(logfile,str,update->ntimestep,atom->natoms,total);
if (screen) fprintf(screen,
"orient step %d: " BIGINT_FORMAT
" atoms have %d neighbors\n",
update->ntimestep,atom->natoms,total);
if (logfile) fprintf(logfile,
"orient step %d: " BIGINT_FORMAT
" atoms have %d neighbors\n",
update->ntimestep,atom->natoms,total);
if (screen)
fprintf(screen," neighs: min = %d, max = %d, ave = %g\n",
min,max,ave);

View File

@ -454,10 +454,9 @@ void FixShake::pre_neighbor()
atom1 = atom->map(shake_atom[i][0]);
atom2 = atom->map(shake_atom[i][1]);
if (atom1 == -1 || atom2 == -1) {
char str[128],fstr[64];
sprintf(fstr,"Shake atoms %%d %%d missing on proc %%d at step %s",
BIGINT_FORMAT);
sprintf(str,fstr,
char str[128];
sprintf(str,
"Shake atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
shake_atom[i][0],shake_atom[i][1],me,update->ntimestep);
error->one(str);
}
@ -467,10 +466,10 @@ void FixShake::pre_neighbor()
atom2 = atom->map(shake_atom[i][1]);
atom3 = atom->map(shake_atom[i][2]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
char str[128],fstr[64];
sprintf(fstr,"Shake atoms %%d %%d %%d missing on proc %%d at step %s",
BIGINT_FORMAT);
sprintf(str,fstr,
char str[128];
sprintf(str,
"Shake atoms %d %d %d missing on proc %d at step "
BIGINT_FORMAT,
shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],
me,update->ntimestep);
error->one(str);
@ -482,11 +481,10 @@ void FixShake::pre_neighbor()
atom3 = atom->map(shake_atom[i][2]);
atom4 = atom->map(shake_atom[i][3]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
char str[128],fstr[64];
sprintf(fstr,
"Shake atoms %%d %%d %%d %%d missing on proc %%d at step %s",
BIGINT_FORMAT);
sprintf(str,fstr,
char str[128];
sprintf(str,
"Shake atoms %d %d %d %d missing on proc %d at step "
BIGINT_FORMAT,
shake_atom[i][0],shake_atom[i][1],
shake_atom[i][2],shake_atom[i][3],
me,update->ntimestep);
@ -2147,10 +2145,11 @@ void FixShake::stats()
// print stats only for non-zero counts
if (me == 0) {
char fstr[64];
sprintf(fstr,"SHAKE stats (type/ave/delta) on step %s\n",BIGINT_FORMAT);
if (screen) {
fprintf(screen,fstr,update->ntimestep);
fprintf(screen,
"SHAKE stats (type/ave/delta) on step " BIGINT_FORMAT "\n",
update->ntimestep);
for (i = 1; i < nb; i++)
if (b_count_all[i])
fprintf(screen," %d %g %g\n",i,
@ -2161,7 +2160,9 @@ void FixShake::stats()
a_ave_all[i]/a_count_all[i],a_max_all[i]-a_min_all[i]);
}
if (logfile) {
fprintf(logfile,fstr,update->ntimestep);
fprintf(logfile,
"SHAKE stats (type/ave/delta) on step " BIGINT_FORMAT "\n",
update->ntimestep);
for (i = 0; i < nb; i++)
if (b_count_all[i])
fprintf(logfile," %d %g %g\n",i,

View File

@ -285,9 +285,9 @@ void FixTMD::initial_integrate(int vflag)
work_lambda += lambda*(rho_target - rho_old);
if (!(update->ntimestep % nfileevery) &&
(previous_stat != update->ntimestep)) {
char fstr[64];
sprintf(fstr,"%s %%g %%g %%g %%g %%g %%g %%g\n",BIGINT_FORMAT);
fprintf(fp,fstr,update->ntimestep,rho_target,rho_old,
fprintf(fp,
BIGINT_FORMAT " %g %g %g %g %g %g %g\n",
update->ntimestep,rho_target,rho_old,
gamma_back,gamma_forward,lambda,work_lambda,work_analytical);
fflush(fp);
previous_stat = update->ntimestep;

View File

@ -58,8 +58,6 @@ typedef int64_t bigint;
#define TAGINT_FORMAT "%d"
#define BIGINT_FORMAT "%lld"
#define TAGINT_FORMAT_NL "%d\n"
#define BIGINT_FORMAT_NL "%lld\n"
#define ATOTAGINT atoi
#define ATOBIGINT atoll
@ -82,8 +80,6 @@ typedef int64_t bigint;
#define TAGINT_FORMAT "%lld"
#define BIGINT_FORMAT "%lld"
#define TAGINT_FORMAT_NL "%lld\n"
#define BIGINT_FORMAT_NL "%lld\n"
#define ATOTAGINT atoll
#define ATOBIGINT atoll
@ -106,8 +102,6 @@ typedef int bigint;
#define TAGINT_FORMAT "%d"
#define BIGINT_FORMAT "%d"
#define TAGINT_FORMAT_NL "%d\n"
#define BIGINT_FORMAT_NL "%d\n"
#define ATOTAGINT atoi
#define ATOBIGINT atoi

View File

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

View File

@ -273,9 +273,7 @@ void Output::write(bigint ntimestep)
char *file = new char[strlen(restart1) + 16];
char *ptr = strchr(restart1,'*');
*ptr = '\0';
char fstr[16];
sprintf(fstr,"%%s%s%%s",BIGINT_FORMAT);
sprintf(file,fstr,restart1,ntimestep,ptr+1);
sprintf(file,"%s" BIGINT_FORMAT "%s",restart1,ntimestep,ptr+1);
*ptr = '*';
restart->write(file);
delete [] file;
@ -336,9 +334,7 @@ void Output::write_restart(bigint ntimestep)
char *file = new char[strlen(restart1) + 16];
char *ptr = strchr(restart1,'*');
*ptr = '\0';
char fstr[16];
sprintf(fstr,"%%s%s%%s",BIGINT_FORMAT);
sprintf(file,fstr,restart1,ntimestep,ptr+1);
sprintf(file,"%s" BIGINT_FORMAT "%s",restart1,ntimestep,ptr+1);
*ptr = '*';
restart->write(file);
delete [] file;

View File

@ -452,10 +452,8 @@ void ReadData::atoms()
MPI_Allreduce(&tmp,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (me == 0) {
char str[32];
sprintf(str," %s atoms\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,natoms);
if (logfile) fprintf(logfile,str,natoms);
if (screen) fprintf(screen," " BIGINT_FORMAT " atoms\n",natoms);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " atoms\n",natoms);
}
if (natoms != atom->natoms) error->all("Did not assign all atoms correctly");
@ -545,10 +543,8 @@ void ReadData::velocities()
}
if (me == 0) {
char str[32];
sprintf(str," %s velocities\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,natoms);
if (logfile) fprintf(logfile,str,natoms);
if (screen) fprintf(screen," " BIGINT_FORMAT " velocities\n",natoms);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " velocities\n",natoms);
}
}
@ -591,10 +587,8 @@ void ReadData::bonds()
if (!force->newton_bond) factor = 2;
if (me == 0) {
char str[32];
sprintf(str," %s bonds\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,sum/factor);
if (logfile) fprintf(logfile,str,sum/factor);
if (screen) fprintf(screen," " BIGINT_FORMAT " bonds\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " bonds\n",sum/factor);
}
if (sum != factor*atom->nbonds) error->all("Bonds assigned incorrectly");
}
@ -638,10 +632,8 @@ void ReadData::angles()
if (!force->newton_bond) factor = 3;
if (me == 0) {
char str[32];
sprintf(str," %s angles\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,sum/factor);
if (logfile) fprintf(logfile,str,sum/factor);
if (screen) fprintf(screen," " BIGINT_FORMAT " angles\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " angles\n",sum/factor);
}
if (sum != factor*atom->nangles) error->all("Angles assigned incorrectly");
}
@ -685,10 +677,8 @@ void ReadData::dihedrals()
if (!force->newton_bond) factor = 4;
if (me == 0) {
char str[32];
sprintf(str," %s dihedrals\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,sum/factor);
if (logfile) fprintf(logfile,str,sum/factor);
if (screen) fprintf(screen," " BIGINT_FORMAT " dihedrals\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " dihedrals\n",sum/factor);
}
if (sum != factor*atom->ndihedrals)
error->all("Dihedrals assigned incorrectly");
@ -733,10 +723,8 @@ void ReadData::impropers()
if (!force->newton_bond) factor = 4;
if (me == 0) {
char str[32];
sprintf(str," %s impropers\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,sum/factor);
if (logfile) fprintf(logfile,str,sum/factor);
if (screen) fprintf(screen," " BIGINT_FORMAT " impropers\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " impropers\n",sum/factor);
}
if (sum != factor*atom->nimpropers)
error->all("Impropers assigned incorrectly");

View File

@ -299,38 +299,34 @@ void ReadRestart::command(int narg, char **arg)
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (me == 0) {
char str[32];
sprintf(str," %s atoms\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,natoms);
if (logfile) fprintf(logfile,str,natoms);
if (screen) fprintf(screen," " BIGINT_FORMAT " atoms\n",natoms);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " atoms\n",natoms);
}
if (natoms != atom->natoms) error->all("Did not assign all atoms correctly");
if (me == 0) {
if (atom->nbonds) {
char str[32];
sprintf(str," %s bonds\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->nbonds);
if (logfile) fprintf(logfile,str,atom->nbonds);
if (screen) fprintf(screen," " BIGINT_FORMAT " bonds\n",atom->nbonds);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " bonds\n",atom->nbonds);
}
if (atom->nangles) {
char str[32];
sprintf(str," %s angles\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->nangles);
if (logfile) fprintf(logfile,str,atom->nangles);
if (screen) fprintf(screen," " BIGINT_FORMAT " angles\n",
atom->nangles);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " angles\n",
atom->nangles);
}
if (atom->ndihedrals) {
char str[32];
sprintf(str," %s dihedrals\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->ndihedrals);
if (logfile) fprintf(logfile,str,atom->ndihedrals);
if (screen) fprintf(screen," " BIGINT_FORMAT " dihedrals\n",
atom->ndihedrals);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " dihedrals\n",
atom->ndihedrals);
}
if (atom->nimpropers) {
char str[32];
sprintf(str," %s impropers\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->nimpropers);
if (logfile) fprintf(logfile,str,atom->nimpropers);
if (screen) fprintf(screen," " BIGINT_FORMAT " impropers\n",
atom->nimpropers);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " impropers\n",
atom->nimpropers);
}
}

View File

@ -370,39 +370,35 @@ void Replicate::command(int narg, char **arg)
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (me == 0) {
char str[32];
sprintf(str," %s atoms\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,natoms);
if (logfile) fprintf(logfile,str,natoms);
if (screen) fprintf(screen," " BIGINT_FORMAT " atoms\n",natoms);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " atoms\n",natoms);
}
if (natoms != atom->natoms)
error->all("Replicate did not assign all atoms correctly");
if (me == 0) {
if (atom->nbonds) {
char str[32];
sprintf(str," %s bonds\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->nbonds);
if (logfile) fprintf(logfile,str,atom->nbonds);
if (screen) fprintf(screen," " BIGINT_FORMAT " bonds\n",atom->nbonds);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " bonds\n",atom->nbonds);
}
if (atom->nangles) {
char str[32];
sprintf(str," %s angles\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->nangles);
if (logfile) fprintf(logfile,str,atom->nangles);
if (screen) fprintf(screen," " BIGINT_FORMAT " angles\n",
atom->nangles);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " angles\n",
atom->nangles);
}
if (atom->ndihedrals) {
char str[32];
sprintf(str," %s dihedrals\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->ndihedrals);
if (logfile) fprintf(logfile,str,atom->ndihedrals);
if (screen) fprintf(screen," " BIGINT_FORMAT " dihedrals\n",
atom->ndihedrals);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " dihedrals\n",
atom->ndihedrals);
}
if (atom->nimpropers) {
char str[32];
sprintf(str," %s impropers\n",BIGINT_FORMAT);
if (screen) fprintf(screen,str,atom->nimpropers);
if (logfile) fprintf(logfile,str,atom->nimpropers);
if (screen) fprintf(screen," " BIGINT_FORMAT " impropers\n",
atom->nimpropers);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " impropers\n",
atom->nimpropers);
}
}

View File

@ -369,19 +369,19 @@ bigint Thermo::lost_check()
// error message
if (lostflag == ERROR) {
char fstr[64],str[64];
sprintf(fstr,
"Lost atoms: original %s current %s",BIGINT_FORMAT,BIGINT_FORMAT);
sprintf(str,fstr,atom->natoms,ntotal);
char str[64];
sprintf(str,
"Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT,
atom->natoms,ntotal);
error->all(str);
}
// warning message
char fstr[64],str[64];
sprintf(fstr,
"Lost atoms: original %s current %s",BIGINT_FORMAT,BIGINT_FORMAT);
sprintf(str,fstr,atom->natoms,ntotal);
char str[64];
sprintf(str,
"Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT,
atom->natoms,ntotal);
if (me == 0) error->warning(str,0);
lostbefore = 1;
return ntotal;
@ -514,8 +514,8 @@ void Thermo::modify_params(int narg, char **arg)
if (ptr == NULL)
error->all("Thermo_modify int format does not contain d character");
*ptr = '\0';
sprintf(format_bigint_user,"%s%s%s",format_int_user,
BIGINT_FORMAT,ptr+1);
sprintf(format_bigint_user,"%s" BIGINT_FORMAT "%s",
format_int_user,ptr+1);
*ptr = 'd';
} else if (strcmp(arg[iarg+1],"float") == 0) {
if (format_float_user) delete [] format_float_user;

View File

@ -86,9 +86,7 @@ void WriteRestart::command(int narg, char **arg)
if (ptr = strchr(arg[0],'*')) {
*ptr = '\0';
char fstr[16];
sprintf(fstr,"%%s%s%%s",BIGINT_FORMAT);
sprintf(file,fstr,arg[0],update->ntimestep,ptr+1);
sprintf(file,"%s" BIGINT_FORMAT "%s",arg[0],update->ntimestep,ptr+1);
} else strcpy(file,arg[0]);
// init entire system since comm->exchange is done