diff --git a/src/GPU/pair_omp_gpu.cpp b/src/GPU/pair_omp_gpu.cpp index b980203418..dc6229fd5e 100644 --- a/src/GPU/pair_omp_gpu.cpp +++ b/src/GPU/pair_omp_gpu.cpp @@ -42,14 +42,14 @@ PairOMPGPU::PairOMPGPU(LAMMPS *lmp) : Pointers(lmp) PairOMPGPU::~PairOMPGPU() { - mem_free(); + free_mem(); } /* ---------------------------------------------------------------------- free any allocated memory ------------------------------------------------------------------------- */ -void PairOMPGPU::mem_free() { +void PairOMPGPU::free_mem() { memory->sfree(eng_vdwl_thr); memory->sfree(eng_coul_thr); memory->destroy(virial_thr); @@ -71,7 +71,7 @@ void PairOMPGPU::mem_free() { void PairOMPGPU::init_style() { - mem_free(); + free_mem(); #pragma omp parallel { diff --git a/src/GPU/pair_omp_gpu.h b/src/GPU/pair_omp_gpu.h index 1ed36b49d5..4532cf5722 100644 --- a/src/GPU/pair_omp_gpu.h +++ b/src/GPU/pair_omp_gpu.h @@ -52,7 +52,7 @@ class PairOMPGPU : protected Pointers { PairOMPGPU(LAMMPS *); ~PairOMPGPU(); - void mem_free(); + void free_mem(); void init_style(); double memory_usage(); diff --git a/src/KSPACE/pair_coul_long.h b/src/KSPACE/pair_coul_long.h index 2de7fa9d14..59e2c7609d 100644 --- a/src/KSPACE/pair_coul_long.h +++ b/src/KSPACE/pair_coul_long.h @@ -28,19 +28,19 @@ class PairCoulLong : public Pair { public: PairCoulLong(class LAMMPS *); ~PairCoulLong(); - void compute(int, int); - void settings(int, char **); + virtual void compute(int, int); + virtual void settings(int, char **); void coeff(int, char **); - void init_style(); + virtual void init_style(); double init_one(int, int); void write_restart(FILE *); void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); + virtual void write_restart_settings(FILE *); + virtual void read_restart_settings(FILE *); + virtual double single(int, int, int, int, double, double, double, double &); void *extract(char *, int &); - private: + protected: double cut_coul,cut_coulsq; double *cut_respa; double g_ewald; diff --git a/src/finish.cpp b/src/finish.cpp index 9fe68ec2d0..52fc2f312c 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -18,6 +18,7 @@ #include "finish.h" #include "timer.h" #include "atom.h" +#include "comm.h" #include "force.h" #include "kspace.h" #include "update.h" @@ -82,7 +83,22 @@ void Finish::end(int flag) time_loop = tmp/nprocs; // overall loop time - + +#if defined(_OPENMP) + if (me == 0) { + int ntasks = nprocs * comm->nthreads; + if (screen) fprintf(screen, + "Loop time of %g on %d procs (%d MPI x %d OpenMP) " + "for %d steps with " BIGINT_FORMAT " atoms\n", + time_loop,ntasks,nprocs,comm->nthreads, + update->nsteps,atom->natoms); + if (logfile) fprintf(logfile, + "Loop time of %g on %d procs (%d MPI x %d OpenMP) " + "for %d steps with " BIGINT_FORMAT " atoms\n", + time_loop,ntasks,nprocs,comm->nthreads, + update->nsteps,atom->natoms); + } +#else if (me == 0) { if (screen) fprintf(screen, "Loop time of %g on %d procs for %d steps with " @@ -92,7 +108,8 @@ void Finish::end(int flag) "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT " atoms\n", time_loop,nprocs,update->nsteps,atom->natoms); - } + } +#endif if (time_loop == 0.0) time_loop = 1.0; } diff --git a/src/min.cpp b/src/min.cpp index d7a80e72fe..7ae69fbb64 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -515,9 +515,10 @@ void Min::force_clear() int nall; if (force->newton) nall = atom->nlocal + atom->nghost; else nall = atom->nlocal; + int ntot = nall * comm->nthreads; double **f = atom->f; - for (i = 0; i < nall; i++) { + for (i = 0; i < ntot; i++) { f[i][0] = 0.0; f[i][1] = 0.0; f[i][2] = 0.0; @@ -534,8 +535,7 @@ void Min::force_clear() if (erforceflag) { double *erforce = atom->erforce; - for (i = 0; i < nall; i++) - erforce[i] = 0.0; + for (i = 0; i < nall; i++) erforce[i] = 0.0; } } diff --git a/src/respa.cpp b/src/respa.cpp index 8aa18c0eee..9786b2875e 100644 --- a/src/respa.cpp +++ b/src/respa.cpp @@ -601,9 +601,10 @@ void Respa::force_clear(int newtonflag) int nall; if (newtonflag) nall = atom->nlocal + atom->nghost; else nall = atom->nlocal; + int ntot = nall * comm->nthreads; double **f = atom->f; - for (i = 0; i < nall; i++) { + for (i = 0; i < ntot; i++) { f[i][0] = 0.0; f[i][1] = 0.0; f[i][2] = 0.0; @@ -620,8 +621,7 @@ void Respa::force_clear(int newtonflag) if (erforceflag) { double *erforce = atom->erforce; - for (i = 0; i < nall; i++) - erforce[i] = 0.0; + for (i = 0; i < nall; i++) erforce[i] = 0.0; } } diff --git a/src/verlet.cpp b/src/verlet.cpp index d23b7d738a..10932c10fb 100644 --- a/src/verlet.cpp +++ b/src/verlet.cpp @@ -311,9 +311,10 @@ void Verlet::force_clear() int nall; if (force->newton) nall = atom->nlocal + atom->nghost; else nall = atom->nlocal; + int ntot = nall * comm->nthreads; double **f = atom->f; - for (i = 0; i < nall; i++) { + for (i = 0; i < ntot; i++) { f[i][0] = 0.0; f[i][1] = 0.0; f[i][2] = 0.0; @@ -330,8 +331,7 @@ void Verlet::force_clear() if (erforceflag) { double *erforce = atom->erforce; - for (i = 0; i < nall; i++) - erforce[i] = 0.0; + for (i = 0; i < nall; i++) erforce[i] = 0.0; } // neighbor includegroup flag is set @@ -359,8 +359,7 @@ void Verlet::force_clear() if (erforceflag) { double *erforce = atom->erforce; - for (i = 0; i < nall; i++) - erforce[i] = 0.0; + for (i = 0; i < nall; i++) erforce[i] = 0.0; } if (force->newton) { @@ -383,8 +382,7 @@ void Verlet::force_clear() if (erforceflag) { double *erforce = atom->erforce; - for (i = atom->nlocal; i < nall; i++) - erforce[i] = 0.0; + for (i = atom->nlocal; i < nall; i++) erforce[i] = 0.0; } } }