git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8530 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -31,7 +31,7 @@ class PPPMGPU : public PPPM {
|
|||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void setup();
|
virtual void setup();
|
||||||
virtual void compute(int, int);
|
virtual void compute(int, int);
|
||||||
virtual void timing(int, double &, double &);
|
virtual int timing(int, double &, double &);
|
||||||
virtual double memory_usage();
|
virtual double memory_usage();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -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))
|
if ((narg < 1) || (narg > 2))
|
||||||
error->all(FLERR,"Illegal kspace_style pppm/cg command");
|
error->all(FLERR,"Illegal kspace_style pppm/cg command");
|
||||||
@ -521,7 +521,7 @@ void PPPMCG::slabcorr()
|
|||||||
|
|
||||||
double PPPMCG::memory_usage()
|
double PPPMCG::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = PPPM::memory_usage();
|
double bytes = PPPMOld::memory_usage();
|
||||||
bytes += nmax * sizeof(int);
|
bytes += nmax * sizeof(int);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,11 +20,11 @@ KSpaceStyle(pppm/cg,PPPMCG)
|
|||||||
#ifndef LMP_PPPM_CG_H
|
#ifndef LMP_PPPM_CG_H
|
||||||
#define LMP_PPPM_CG_H
|
#define LMP_PPPM_CG_H
|
||||||
|
|
||||||
#include "pppm.h"
|
#include "pppm_old.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class PPPMCG : public PPPM {
|
class PPPMCG : public PPPMOld {
|
||||||
public:
|
public:
|
||||||
PPPMCG(class LAMMPS *, int, char **);
|
PPPMCG(class LAMMPS *, int, char **);
|
||||||
virtual ~PPPMCG();
|
virtual ~PPPMCG();
|
||||||
|
|||||||
@ -2488,7 +2488,7 @@ void PPPMOld::slabcorr()
|
|||||||
perform and time the 4 FFTs required for N timesteps
|
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;
|
double time1,time2;
|
||||||
|
|
||||||
@ -2521,6 +2521,8 @@ void PPPMOld::timing(int n, double &time3d, double &time1d)
|
|||||||
MPI_Barrier(world);
|
MPI_Barrier(world);
|
||||||
time2 = MPI_Wtime();
|
time2 = MPI_Wtime();
|
||||||
time1d = time2 - time1;
|
time1d = time2 - time1;
|
||||||
|
|
||||||
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
@ -42,7 +42,7 @@ class PPPMOld : public KSpace {
|
|||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void setup();
|
virtual void setup();
|
||||||
virtual void compute(int, int);
|
virtual void compute(int, int);
|
||||||
virtual void timing(int, double &, double &);
|
virtual int timing(int, double &, double &);
|
||||||
virtual double memory_usage();
|
virtual double memory_usage();
|
||||||
|
|
||||||
virtual void compute_group_group(int, int, int);
|
virtual void compute_group_group(int, int, int);
|
||||||
|
|||||||
@ -38,7 +38,7 @@ using namespace LAMMPS_NS;
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
PPPMTIP4P::PPPMTIP4P(LAMMPS *lmp, int narg, char **arg) :
|
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)
|
if (force->newton == 0)
|
||||||
error->all(FLERR,"Kspace style pppm/tip4p requires newton on");
|
error->all(FLERR,"Kspace style pppm/tip4p requires newton on");
|
||||||
|
|
||||||
PPPM::init();
|
PPPMOld::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
@ -20,11 +20,11 @@ KSpaceStyle(pppm/tip4p,PPPMTIP4P)
|
|||||||
#ifndef LMP_PPPM_TIP4P_H
|
#ifndef LMP_PPPM_TIP4P_H
|
||||||
#define LMP_PPPM_TIP4P_H
|
#define LMP_PPPM_TIP4P_H
|
||||||
|
|
||||||
#include "pppm.h"
|
#include "pppm_old.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class PPPMTIP4P : public PPPM {
|
class PPPMTIP4P : public PPPMOld {
|
||||||
public:
|
public:
|
||||||
PPPMTIP4P(class LAMMPS *, int, char **);
|
PPPMTIP4P(class LAMMPS *, int, char **);
|
||||||
virtual ~PPPMTIP4P () {};
|
virtual ~PPPMTIP4P () {};
|
||||||
|
|||||||
@ -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;
|
cuda = lmp->cuda;
|
||||||
if(cuda == NULL)
|
if(cuda == NULL)
|
||||||
@ -1387,7 +1388,7 @@ void PPPMCuda::fieldforce()
|
|||||||
perform and time the 4 FFTs required for N timesteps
|
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;
|
double time1,time2;
|
||||||
@ -1422,6 +1423,7 @@ void PPPMCuda::timing(int n, double &time3d, double &time1d)
|
|||||||
time2 = MPI_Wtime();
|
time2 = MPI_Wtime();
|
||||||
time1d = time2 - time1;*/
|
time1d = time2 - time1;*/
|
||||||
|
|
||||||
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPPMCuda::slabcorr(int eflag)
|
void PPPMCuda::slabcorr(int eflag)
|
||||||
|
|||||||
@ -30,20 +30,20 @@ KSpaceStyle(pppm/cuda,PPPMCuda)
|
|||||||
#ifndef LMP_PPPM_CUDA_H
|
#ifndef LMP_PPPM_CUDA_H
|
||||||
#define LMP_PPPM_CUDA_H
|
#define LMP_PPPM_CUDA_H
|
||||||
|
|
||||||
#include "pppm.h"
|
#include "pppm_old.h"
|
||||||
#include "cuda_data.h"
|
#include "cuda_data.h"
|
||||||
#include "cuda_precision.h"
|
#include "cuda_precision.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class PPPMCuda : public PPPM {
|
class PPPMCuda : public PPPMOld {
|
||||||
public:
|
public:
|
||||||
PPPMCuda(class LAMMPS *, int, char **);
|
PPPMCuda(class LAMMPS *, int, char **);
|
||||||
~PPPMCuda();
|
~PPPMCuda();
|
||||||
void init();
|
void init();
|
||||||
void setup();
|
void setup();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void timing(int, double &, double &);
|
int timing(int, double &, double &);
|
||||||
|
|
||||||
double poissontime;
|
double poissontime;
|
||||||
|
|
||||||
|
|||||||
@ -419,6 +419,7 @@ void Finish::end(int flag)
|
|||||||
|
|
||||||
// FFT timing statistics
|
// FFT timing statistics
|
||||||
// time3d,time1d = total time during run for 3d and 1d FFTs
|
// 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
|
// time_kspace may be 0.0 if another partition is doing Kspace
|
||||||
|
|
||||||
if (fftflag) {
|
if (fftflag) {
|
||||||
@ -429,9 +430,13 @@ void Finish::end(int flag)
|
|||||||
|
|
||||||
int nsteps = update->nsteps;
|
int nsteps = update->nsteps;
|
||||||
|
|
||||||
int nsample = 5;
|
|
||||||
double time3d,time1d;
|
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;
|
time3d = nsteps * time3d / nsample;
|
||||||
MPI_Allreduce(&time3d,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
|
MPI_Allreduce(&time3d,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
|
||||||
@ -453,8 +458,8 @@ void Finish::end(int flag)
|
|||||||
if (nsteps) {
|
if (nsteps) {
|
||||||
if (time_kspace) fraction = time3d/time_kspace*100.0;
|
if (time_kspace) fraction = time3d/time_kspace*100.0;
|
||||||
else fraction = 0.0;
|
else fraction = 0.0;
|
||||||
flop3 = nflops/1.0e9/(time3d/4.0/nsteps);
|
flop3 = nfft*nflops/1.0e9/(time3d/nsteps);
|
||||||
flop1 = nflops/1.0e9/(time1d/4.0/nsteps);
|
flop1 = nfft*nflops/1.0e9/(time1d/nsteps);
|
||||||
} else fraction = flop3 = flop1 = 0.0;
|
} else fraction = flop3 = flop1 = 0.0;
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class KSpace : protected Pointers {
|
|||||||
virtual void setup() = 0;
|
virtual void setup() = 0;
|
||||||
virtual void compute(int, int) = 0;
|
virtual void compute(int, int) = 0;
|
||||||
virtual void compute_group_group(int, int, int) {};
|
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;}
|
virtual double memory_usage() {return 0.0;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user