From 212f64d2f16f163e468f4458b8d03d47bd4f5724 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 12 May 2016 13:54:17 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15040 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/MAKE/Makefile.mpi | 10 ++-------- src/MAKE/Makefile.serial | 12 +++--------- src/MANYBODY/pair_tersoff.cpp | 8 ++++---- src/MC/fix_tfmc.cpp | 5 +++-- src/USER-MANIFOLD/manifold_thylakoid.cpp | 4 ++-- src/neighbor.cpp | 6 ++++++ src/write_dump.cpp | 2 +- 7 files changed, 21 insertions(+), 26 deletions(-) diff --git a/src/MAKE/Makefile.mpi b/src/MAKE/Makefile.mpi index 5ecb8b2ca1..aebb465454 100644 --- a/src/MAKE/Makefile.mpi +++ b/src/MAKE/Makefile.mpi @@ -28,7 +28,7 @@ SHLIBFLAGS = -shared # LAMMPS ifdef settings # see possible settings in Section 2.2 (step 4) of manual -LMP_INC = -DLAMMPS_GZIP +LMP_INC = -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 # MPI library # see discussion in Section 2.2 (step 5) of manual @@ -100,13 +100,7 @@ shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/Makefile.serial b/src/MAKE/Makefile.serial index 5d9598e7fc..5954d97761 100644 --- a/src/MAKE/Makefile.serial +++ b/src/MAKE/Makefile.serial @@ -28,7 +28,7 @@ SHLIBFLAGS = -shared # LAMMPS ifdef settings # see possible settings in Section 2.2 (step 4) of manual -LMP_INC = -DLAMMPS_GZIP +LMP_INC = -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 # MPI library # see discussion in Section 2.2 (step 5) of manual @@ -44,7 +44,7 @@ MPI_PATH = -L../STUBS MPI_LIB = -lmpi_stubs # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 2.2 (step 6) of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -100,13 +100,7 @@ shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp index 4f91b273b4..4481685ec1 100755 --- a/src/MANYBODY/pair_tersoff.cpp +++ b/src/MANYBODY/pair_tersoff.cpp @@ -319,15 +319,15 @@ void PairTersoff::coeff(int narg, char **arg) // clear setflag since coeff() called once with I,J = * * n = atom->ntypes; - for (int i = 1; i <= n; i++) - for (int j = i; j <= n; j++) + for (i = 1; i <= n; i++) + for (j = i; j <= n; j++) setflag[i][j] = 0; // set setflag i,j for type pairs where both are mapped to elements int count = 0; - for (int i = 1; i <= n; i++) - for (int j = i; j <= n; j++) + for (i = 1; i <= n; i++) + for (j = i; j <= n; j++) if (map[i] >= 0 && map[j] >= 0) { setflag[i][j] = 1; count++; diff --git a/src/MC/fix_tfmc.cpp b/src/MC/fix_tfmc.cpp index a59542e890..eea0a0bf31 100755 --- a/src/MC/fix_tfmc.cpp +++ b/src/MC/fix_tfmc.cpp @@ -78,8 +78,9 @@ FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) : if (xflag < 0 || xflag > 1 || yflag < 0 || yflag > 1 || zflag < 0 || zflag > 1) error->all(FLERR,"Illegal fix tfmc command"); - if (xflag + yflag + zflag == 0) - comflag = 0; + + if (xflag + yflag + zflag == 0) + comflag = 0; if (rotflag) { xd = NULL; diff --git a/src/USER-MANIFOLD/manifold_thylakoid.cpp b/src/USER-MANIFOLD/manifold_thylakoid.cpp index 719a2d3281..4bb2b71331 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid.cpp @@ -85,7 +85,7 @@ double manifold_thylakoid::g( const double *x ) error->one(FLERR,msg); } double con_val = p->g(x); - if( isfinite(con_val) ){ + if( ISFINITE(con_val) ){ return con_val; }else{ char msg[2048]; @@ -107,7 +107,7 @@ void manifold_thylakoid::n( const double *x, double *n ) error->one(FLERR,msg); } p->n(x,n); - if( isfinite(n[0]) && isfinite(n[1]) && isfinite(n[2]) ){ + if( ISFINITE(n[0]) && ISFINITE(n[1]) && ISFINITE(n[2]) ){ return; }else{ char msg[2048]; diff --git a/src/neighbor.cpp b/src/neighbor.cpp index d11d7df6ee..84a52f0405 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -2075,6 +2075,9 @@ int Neighbor::coord2bin(double *x) { int ix,iy,iz; + if (!ISFINITE(x[0]) || !ISFINITE(x[1]) || !ISFINITE(x[2])) + error->one(FLERR,"Non-numeric positions - simulation unstable"); + if (x[0] >= bboxhi[0]) ix = static_cast ((x[0]-bboxhi[0])*bininvx) + nbinx; else if (x[0] >= bboxlo[0]) { @@ -2108,6 +2111,9 @@ int Neighbor::coord2bin(double *x) int Neighbor::coord2bin(double *x, int &ix, int &iy, int &iz) { + if (!ISFINITE(x[0]) || !ISFINITE(x[1]) || !ISFINITE(x[2])) + error->one(FLERR,"Non-numeric positions - simulation unstable"); + if (x[0] >= bboxhi[0]) ix = static_cast ((x[0]-bboxhi[0])*bininvx) + nbinx; else if (x[0] >= bboxlo[0]) { diff --git a/src/write_dump.cpp b/src/write_dump.cpp index f56faa0fcd..a8ad5419ac 100644 --- a/src/write_dump.cpp +++ b/src/write_dump.cpp @@ -51,7 +51,7 @@ void WriteDump::command(int narg, char **arg) dumpargs[0] = (char *) "WRITE_DUMP"; // dump id dumpargs[1] = arg[0]; // group dumpargs[2] = arg[1]; // dump style - dumpargs[3] = (char *) "0"; // dump frequency + dumpargs[3] = (char *) "1"; // dump frequency for (int i = 2; i < modindex; ++i) dumpargs[i+2] = arg[i];