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

This commit is contained in:
sjplimp
2012-08-06 21:05:10 +00:00
parent 3f5513cc1e
commit 9631345b05
11 changed files with 30 additions and 21 deletions

View File

@ -31,7 +31,7 @@ class PPPMGPU : public PPPM {
virtual void init();
virtual void setup();
virtual void compute(int, int);
virtual void timing(int, double &, double &);
virtual int timing(int, double &, double &);
virtual double memory_usage();
protected:

View File

@ -42,7 +42,7 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
PPPMCG::PPPMCG(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
PPPMCG::PPPMCG(LAMMPS *lmp, int narg, char **arg) : PPPMOld(lmp, narg, arg)
{
if ((narg < 1) || (narg > 2))
error->all(FLERR,"Illegal kspace_style pppm/cg command");
@ -521,7 +521,7 @@ void PPPMCG::slabcorr()
double PPPMCG::memory_usage()
{
double bytes = PPPM::memory_usage();
double bytes = PPPMOld::memory_usage();
bytes += nmax * sizeof(int);
return bytes;
}

View File

@ -20,11 +20,11 @@ KSpaceStyle(pppm/cg,PPPMCG)
#ifndef LMP_PPPM_CG_H
#define LMP_PPPM_CG_H
#include "pppm.h"
#include "pppm_old.h"
namespace LAMMPS_NS {
class PPPMCG : public PPPM {
class PPPMCG : public PPPMOld {
public:
PPPMCG(class LAMMPS *, int, char **);
virtual ~PPPMCG();

View File

@ -2488,7 +2488,7 @@ void PPPMOld::slabcorr()
perform and time the 4 FFTs required for N timesteps
------------------------------------------------------------------------- */
void PPPMOld::timing(int n, double &time3d, double &time1d)
int PPPMOld::timing(int n, double &time3d, double &time1d)
{
double time1,time2;
@ -2521,6 +2521,8 @@ void PPPMOld::timing(int n, double &time3d, double &time1d)
MPI_Barrier(world);
time2 = MPI_Wtime();
time1d = time2 - time1;
return 4;
}
/* ----------------------------------------------------------------------

View File

@ -42,7 +42,7 @@ class PPPMOld : public KSpace {
virtual void init();
virtual void setup();
virtual void compute(int, int);
virtual void timing(int, double &, double &);
virtual int timing(int, double &, double &);
virtual double memory_usage();
virtual void compute_group_group(int, int, int);

View File

@ -38,7 +38,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PPPMTIP4P::PPPMTIP4P(LAMMPS *lmp, int narg, char **arg) :
PPPM(lmp, narg, arg) {}
PPPMOld(lmp, narg, arg) {}
/* ---------------------------------------------------------------------- */
@ -49,7 +49,7 @@ void PPPMTIP4P::init()
if (force->newton == 0)
error->all(FLERR,"Kspace style pppm/tip4p requires newton on");
PPPM::init();
PPPMOld::init();
}
/* ----------------------------------------------------------------------

View File

@ -20,11 +20,11 @@ KSpaceStyle(pppm/tip4p,PPPMTIP4P)
#ifndef LMP_PPPM_TIP4P_H
#define LMP_PPPM_TIP4P_H
#include "pppm.h"
#include "pppm_old.h"
namespace LAMMPS_NS {
class PPPMTIP4P : public PPPM {
class PPPMTIP4P : public PPPMOld {
public:
PPPMTIP4P(class LAMMPS *, int, char **);
virtual ~PPPMTIP4P () {};

View File

@ -97,7 +97,8 @@ void printArray(double*** data,int nx, int ny, int nz)
}
/* ---------------------------------------------------------------------- */
PPPMCuda::PPPMCuda(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, (narg==2?1:narg), arg)
PPPMCuda::PPPMCuda(LAMMPS *lmp, int narg, char **arg) :
PPPMOld(lmp, (narg==2?1:narg), arg)
{
cuda = lmp->cuda;
if(cuda == NULL)
@ -1387,7 +1388,7 @@ void PPPMCuda::fieldforce()
perform and time the 4 FFTs required for N timesteps
------------------------------------------------------------------------- */
void PPPMCuda::timing(int n, double &time3d, double &time1d)
int PPPMCuda::timing(int n, double &time3d, double &time1d)
{
double time1,time2;
@ -1422,6 +1423,7 @@ void PPPMCuda::timing(int n, double &time3d, double &time1d)
time2 = MPI_Wtime();
time1d = time2 - time1;*/
return 4;
}
void PPPMCuda::slabcorr(int eflag)

View File

@ -30,20 +30,20 @@ KSpaceStyle(pppm/cuda,PPPMCuda)
#ifndef LMP_PPPM_CUDA_H
#define LMP_PPPM_CUDA_H
#include "pppm.h"
#include "pppm_old.h"
#include "cuda_data.h"
#include "cuda_precision.h"
namespace LAMMPS_NS {
class PPPMCuda : public PPPM {
class PPPMCuda : public PPPMOld {
public:
PPPMCuda(class LAMMPS *, int, char **);
~PPPMCuda();
void init();
void setup();
void compute(int, int);
void timing(int, double &, double &);
int timing(int, double &, double &);
double poissontime;

View File

@ -419,6 +419,7 @@ void Finish::end(int flag)
// FFT timing statistics
// time3d,time1d = total time during run for 3d and 1d FFTs
// loop on timing() until nsample FFTs require at least 1.0 CPU sec
// time_kspace may be 0.0 if another partition is doing Kspace
if (fftflag) {
@ -429,9 +430,13 @@ void Finish::end(int flag)
int nsteps = update->nsteps;
int nsample = 5;
double time3d,time1d;
force->kspace->timing(nsample,time3d,time1d);
int nsample = 1;
int nfft = force->kspace->timing(nsample,time3d,time1d);
while (time3d < 1.0 || time1d < 1.0) {
nsample *= 5;
nfft = force->kspace->timing(nsample,time3d,time1d);
}
time3d = nsteps * time3d / nsample;
MPI_Allreduce(&time3d,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
@ -453,8 +458,8 @@ void Finish::end(int flag)
if (nsteps) {
if (time_kspace) fraction = time3d/time_kspace*100.0;
else fraction = 0.0;
flop3 = nflops/1.0e9/(time3d/4.0/nsteps);
flop1 = nflops/1.0e9/(time1d/4.0/nsteps);
flop3 = nfft*nflops/1.0e9/(time3d/nsteps);
flop1 = nfft*nflops/1.0e9/(time1d/nsteps);
} else fraction = flop3 = flop1 = 0.0;
if (me == 0) {

View File

@ -46,7 +46,7 @@ class KSpace : protected Pointers {
virtual void setup() = 0;
virtual void compute(int, int) = 0;
virtual void compute_group_group(int, int, int) {};
virtual void timing(int, double &, double &) {}
virtual int timing(int, double &, double &) {return 0;}
virtual double memory_usage() {return 0.0;}
protected: