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

This commit is contained in:
sjplimp 2011-08-25 22:25:06 +00:00
parent 1d743442b3
commit d0efe70181
7 changed files with 41 additions and 26 deletions

View File

@ -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
{

View File

@ -52,7 +52,7 @@ class PairOMPGPU : protected Pointers {
PairOMPGPU(LAMMPS *);
~PairOMPGPU();
void mem_free();
void free_mem();
void init_style();
double memory_usage();

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}
}