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

This commit is contained in:
sjplimp 2011-12-02 15:55:55 +00:00
parent 37f098062b
commit 24a85166bf
32 changed files with 75 additions and 83 deletions

View File

@ -58,10 +58,6 @@ if (test $1 = 1) then
if (test -e ../pair_cg_cmm_coul_long.cpp) then if (test -e ../pair_cg_cmm_coul_long.cpp) then
cp pair_cg_cmm_coul_long_gpu.cpp .. cp pair_cg_cmm_coul_long_gpu.cpp ..
cp pair_cg_cmm_coul_long_gpu.h .. cp pair_cg_cmm_coul_long_gpu.h ..
cp pair_cg_cmm_coul_msm.cpp ..
cp pair_cg_cmm_coul_msm.h ..
cp pair_cg_cmm_coul_msm_gpu.cpp ..
cp pair_cg_cmm_coul_msm_gpu.h ..
fi fi
if (test -e ../pppm.cpp) then if (test -e ../pppm.cpp) then
@ -74,8 +70,6 @@ if (test $1 = 1) then
cp pair_lj96_cut_gpu.cpp .. cp pair_lj96_cut_gpu.cpp ..
cp pair_lj_expand_gpu.cpp .. cp pair_lj_expand_gpu.cpp ..
cp pair_lj_cut_coul_cut_gpu.cpp .. cp pair_lj_cut_coul_cut_gpu.cpp ..
cp pair_lj_cut_tgpu.cpp ..
cp fix_gpu.cpp .. cp fix_gpu.cpp ..
cp pair_lj_cut_gpu.h .. cp pair_lj_cut_gpu.h ..
@ -83,17 +77,10 @@ if (test $1 = 1) then
cp pair_lj96_cut_gpu.h .. cp pair_lj96_cut_gpu.h ..
cp pair_lj_expand_gpu.h .. cp pair_lj_expand_gpu.h ..
cp pair_lj_cut_coul_cut_gpu.h .. cp pair_lj_cut_coul_cut_gpu.h ..
cp pair_lj_cut_tgpu.h ..
cp fix_gpu.h .. cp fix_gpu.h ..
cp gpu_extra.h .. cp gpu_extra.h ..
cp pair_omp_gpu.cpp ..
cp pair_lj_cut_tgpu.cpp ..
cp pair_omp_gpu.h ..
cp pair_lj_cut_tgpu.h ..
elif (test $1 = 0) then elif (test $1 = 0) then
if (test -e ../Makefile.package) then if (test -e ../Makefile.package) then
@ -116,16 +103,11 @@ elif (test $1 = 0) then
rm -f ../pair_lj_class2_gpu.cpp rm -f ../pair_lj_class2_gpu.cpp
rm -f ../pair_lj_class2_coul_long_gpu.cpp rm -f ../pair_lj_class2_coul_long_gpu.cpp
rm -f ../pair_lj_charmm_coul_long_gpu.cpp rm -f ../pair_lj_charmm_coul_long_gpu.cpp
rm -f ../pair_lj_cut_tgpu.cpp
rm -f ../pair_coul_long_gpu.cpp rm -f ../pair_coul_long_gpu.cpp
rm -f ../pair_cg_cmm_gpu.cpp rm -f ../pair_cg_cmm_gpu.cpp
rm -f ../pair_cg_cmm_coul_long_gpu.cpp rm -f ../pair_cg_cmm_coul_long_gpu.cpp
rm -f ../pair_cg_cmm_coul_msm.cpp
rm -f ../pair_cg_cmm_coul_msm_gpu.cpp
rm -f ../fix_gpu.cpp rm -f ../fix_gpu.cpp
rm -f ../pair_omp_gpu.cpp
rm -f ../pair_lj_cut_tgpu.cpp
rm -f ../pppm_gpu.h rm -f ../pppm_gpu.h
rm -f ../pair_gayberne_gpu.h rm -f ../pair_gayberne_gpu.h
@ -139,17 +121,12 @@ elif (test $1 = 0) then
rm -f ../pair_lj_class2_gpu.h rm -f ../pair_lj_class2_gpu.h
rm -f ../pair_lj_class2_coul_long_gpu.h rm -f ../pair_lj_class2_coul_long_gpu.h
rm -f ../pair_lj_charmm_coul_long_gpu.h rm -f ../pair_lj_charmm_coul_long_gpu.h
rm -f ../pair_lj_cut_tgpu.h
rm -f ../pair_coul_long_gpu.h rm -f ../pair_coul_long_gpu.h
rm -f ../pair_cg_cmm_gpu.h rm -f ../pair_cg_cmm_gpu.h
rm -f ../pair_cg_cmm_coul_long_gpu.h rm -f ../pair_cg_cmm_coul_long_gpu.h
rm -f ../pair_cg_cmm_coul_msm.h
rm -f ../pair_cg_cmm_coul_msm_gpu.h
rm -f ../fix_gpu.h rm -f ../fix_gpu.h
rm -f ../gpu_extra.h rm -f ../gpu_extra.h
rm -f ../pair_omp_gpu.h
rm -f ../pair_lj_cut_tgpu.h
fi fi

View File

@ -25,10 +25,11 @@
#include "domain.h" #include "domain.h"
#include "universe.h" #include "universe.h"
#include "gpu_extra.h" #include "gpu_extra.h"
#include "neighbor.h"
using namespace LAMMPS_NS; using namespace LAMMPS_NS;
enum{GPU_FORCE, GPU_NEIGH}; enum{GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH};
extern int lmp_init_device(MPI_Comm world, MPI_Comm replica, extern int lmp_init_device(MPI_Comm world, MPI_Comm replica,
const int first_gpu, const int last_gpu, const int first_gpu, const int last_gpu,
@ -57,6 +58,11 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
_gpu_mode = GPU_NEIGH; _gpu_mode = GPU_NEIGH;
if (domain->triclinic) if (domain->triclinic)
error->all(FLERR,"Cannot use force/neigh with triclinic box"); error->all(FLERR,"Cannot use force/neigh with triclinic box");
} else if (strcmp(arg[3],"force/hybrid_neigh") == 0) {
_gpu_mode = GPU_HYB_NEIGH;
if (domain->triclinic)
error->all(FLERR,
"Cannot use force/hybrid_neigh with triclinic box");
} else } else
error->all(FLERR,"Illegal fix GPU command"); error->all(FLERR,"Illegal fix GPU command");
@ -116,7 +122,7 @@ void FixGPU::init()
{ {
// hybrid cannot be used with force/neigh option // hybrid cannot be used with force/neigh option
if (_gpu_mode == GPU_NEIGH) if (_gpu_mode == GPU_NEIGH || _gpu_mode == GPU_HYB_NEIGH)
if (force->pair_match("hybrid",1) != NULL || if (force->pair_match("hybrid",1) != NULL ||
force->pair_match("hybrid/overlay",1) != NULL) force->pair_match("hybrid/overlay",1) != NULL)
error->all(FLERR,"Cannot use pair hybrid with GPU neighbor builds"); error->all(FLERR,"Cannot use pair hybrid with GPU neighbor builds");
@ -130,6 +136,10 @@ void FixGPU::init()
void FixGPU::setup(int vflag) void FixGPU::setup(int vflag)
{ {
if (_gpu_mode == GPU_NEIGH || _gpu_mode == GPU_HYB_NEIGH)
if (neighbor->exclude_setting()!=0)
error->all(FLERR,
"Cannot use neigh_modify exclude with GPU neighbor builds");
post_force(vflag); post_force(vflag);
} }

View File

@ -39,6 +39,11 @@ namespace GPU_EXTRA {
else if (all_success == -5) else if (all_success == -5)
error->all(FLERR, error->all(FLERR,
"Double precision is not supported on this accelerator"); "Double precision is not supported on this accelerator");
else if (all_success == -6)
error->all(FLERR,"Unable to initialize accelerator for use");
else if (all_success == -7)
error->all(FLERR,
"Accelerator sharing is not currently supported on system");
else else
error->all(FLERR,"Unknown error in GPU library"); error->all(FLERR,"Unknown error in GPU library");
} }

View File

@ -76,7 +76,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairCGCMMCoulLongGPU::PairCGCMMCoulLongGPU(LAMMPS *lmp) : PairCGCMMCoulLong(lmp), gpu_mode(GPU_PAIR) PairCGCMMCoulLongGPU::PairCGCMMCoulLongGPU(LAMMPS *lmp) : PairCGCMMCoulLong(lmp), gpu_mode(GPU_FORCE)
{ {
respa_enable = 0; respa_enable = 0;
cpu_time = 0.0; cpu_time = 0.0;
@ -103,7 +103,7 @@ void PairCGCMMCoulLongGPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = cmml_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = cmml_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -183,7 +183,7 @@ void PairCGCMMCoulLongGPU::init_style()
force->qqrd2e, g_ewald); force->qqrd2e, g_ewald);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairCGCMMCoulLongGPU : public PairCGCMMCoulLong {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -63,7 +63,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairCGCMMGPU::PairCGCMMGPU(LAMMPS *lmp) : PairCGCMM(lmp), gpu_mode(GPU_PAIR) PairCGCMMGPU::PairCGCMMGPU(LAMMPS *lmp) : PairCGCMM(lmp), gpu_mode(GPU_FORCE)
{ {
respa_enable = 0; respa_enable = 0;
cpu_time = 0.0; cpu_time = 0.0;
@ -90,7 +90,7 @@ void PairCGCMMGPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = cmm_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = cmm_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -154,7 +154,7 @@ void PairCGCMMGPU::init_style()
cell_size, gpu_mode, screen); cell_size, gpu_mode, screen);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairCGCMMGPU : public PairCGCMM {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -12,7 +12,7 @@
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
Contributing author: Mike Brown (SNL) Contributing author: Axel Kohlmeyer (Temple)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#include "lmptype.h" #include "lmptype.h"
@ -73,7 +73,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairCoulLongGPU::PairCoulLongGPU(LAMMPS *lmp) : PairCoulLongGPU::PairCoulLongGPU(LAMMPS *lmp) :
PairCoulLong(lmp), gpu_mode(GPU_PAIR) PairCoulLong(lmp), gpu_mode(GPU_FORCE)
{ {
respa_enable = 0; respa_enable = 0;
cpu_time = 0.0; cpu_time = 0.0;
@ -100,7 +100,7 @@ void PairCoulLongGPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = cl_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = cl_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -166,7 +166,7 @@ void PairCoulLongGPU::init_style()
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairCoulLongGPU : public PairCoulLong {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -70,7 +70,7 @@ enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairGayBerneGPU::PairGayBerneGPU(LAMMPS *lmp) : PairGayBerne(lmp), PairGayBerneGPU::PairGayBerneGPU(LAMMPS *lmp) : PairGayBerne(lmp),
gpu_mode(GPU_PAIR) gpu_mode(GPU_FORCE)
{ {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec) if (!avec)
@ -119,7 +119,7 @@ void PairGayBerneGPU::compute(int eflag, int vflag)
} }
} }
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = gb_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = gb_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -201,7 +201,7 @@ void PairGayBerneGPU::init_style()
maxspecial, cell_size, gpu_mode, screen); maxspecial, cell_size, gpu_mode, screen);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairGayBerneGPU : public PairGayBerne {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -62,7 +62,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairLJ96CutGPU::PairLJ96CutGPU(LAMMPS *lmp) : PairLJ96Cut(lmp), gpu_mode(GPU_PAIR) PairLJ96CutGPU::PairLJ96CutGPU(LAMMPS *lmp) : PairLJ96Cut(lmp), gpu_mode(GPU_FORCE)
{ {
respa_enable = 0; respa_enable = 0;
cpu_time = 0.0; cpu_time = 0.0;
@ -89,7 +89,7 @@ void PairLJ96CutGPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = lj96_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = lj96_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -153,7 +153,7 @@ void PairLJ96CutGPU::init_style()
cell_size, gpu_mode, screen); cell_size, gpu_mode, screen);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairLJ96CutGPU : public PairLJ96Cut {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -79,7 +79,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairLJCharmmCoulLongGPU::PairLJCharmmCoulLongGPU(LAMMPS *lmp) : PairLJCharmmCoulLongGPU::PairLJCharmmCoulLongGPU(LAMMPS *lmp) :
PairLJCharmmCoulLong(lmp), gpu_mode(GPU_PAIR) PairLJCharmmCoulLong(lmp), gpu_mode(GPU_FORCE)
{ {
respa_enable = 0; respa_enable = 0;
cpu_time = 0.0; cpu_time = 0.0;
@ -106,7 +106,7 @@ void PairLJCharmmCoulLongGPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = crml_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = crml_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -199,7 +199,7 @@ void PairLJCharmmCoulLongGPU::init_style()
arithmetic); arithmetic);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairLJCharmmCoulLongGPU : public PairLJCharmmCoulLong {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -77,7 +77,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairLJClass2CoulLongGPU::PairLJClass2CoulLongGPU(LAMMPS *lmp) : PairLJClass2CoulLongGPU::PairLJClass2CoulLongGPU(LAMMPS *lmp) :
PairLJClass2CoulLong(lmp), gpu_mode(GPU_PAIR) PairLJClass2CoulLong(lmp), gpu_mode(GPU_FORCE)
{ {
cpu_time = 0.0; cpu_time = 0.0;
} }
@ -103,7 +103,7 @@ void PairLJClass2CoulLongGPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = c2cl_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = c2cl_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -178,7 +178,7 @@ void PairLJClass2CoulLongGPU::init_style()
force->special_coul, force->qqrd2e, g_ewald); force->special_coul, force->qqrd2e, g_ewald);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairLJClass2CoulLongGPU : public PairLJClass2CoulLong {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -62,7 +62,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairLJClass2GPU::PairLJClass2GPU(LAMMPS *lmp) : PairLJClass2(lmp), gpu_mode(GPU_PAIR) PairLJClass2GPU::PairLJClass2GPU(LAMMPS *lmp) : PairLJClass2(lmp), gpu_mode(GPU_FORCE)
{ {
cpu_time = 0.0; cpu_time = 0.0;
} }
@ -88,7 +88,7 @@ void PairLJClass2GPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = lj96_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = lj96_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -150,7 +150,7 @@ void PairLJClass2GPU::init_style()
cell_size, gpu_mode, screen); cell_size, gpu_mode, screen);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairLJClass2GPU : public PairLJClass2 {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -67,7 +67,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairLJCutCoulCutGPU::PairLJCutCoulCutGPU(LAMMPS *lmp) : PairLJCutCoulCut(lmp), gpu_mode(GPU_PAIR) PairLJCutCoulCutGPU::PairLJCutCoulCutGPU(LAMMPS *lmp) : PairLJCutCoulCut(lmp), gpu_mode(GPU_FORCE)
{ {
respa_enable = 0; respa_enable = 0;
cpu_time = 0.0; cpu_time = 0.0;
@ -94,7 +94,7 @@ void PairLJCutCoulCutGPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = ljc_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = ljc_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -162,7 +162,7 @@ void PairLJCutCoulCutGPU::init_style()
force->special_coul, force->qqrd2e); force->special_coul, force->qqrd2e);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairLJCutCoulCutGPU : public PairLJCutCoulCut {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -77,7 +77,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairLJCutCoulLongGPU::PairLJCutCoulLongGPU(LAMMPS *lmp) : PairLJCutCoulLongGPU::PairLJCutCoulLongGPU(LAMMPS *lmp) :
PairLJCutCoulLong(lmp), gpu_mode(GPU_PAIR) PairLJCutCoulLong(lmp), gpu_mode(GPU_FORCE)
{ {
respa_enable = 0; respa_enable = 0;
cpu_time = 0.0; cpu_time = 0.0;
@ -104,7 +104,7 @@ void PairLJCutCoulLongGPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = ljcl_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = ljcl_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -185,7 +185,7 @@ void PairLJCutCoulLongGPU::init_style()
force->special_coul, force->qqrd2e, g_ewald); force->special_coul, force->qqrd2e, g_ewald);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairLJCutCoulLongGPU : public PairLJCutCoulLong {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -62,7 +62,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairLJCutGPU::PairLJCutGPU(LAMMPS *lmp) : PairLJCut(lmp), gpu_mode(GPU_PAIR) PairLJCutGPU::PairLJCutGPU(LAMMPS *lmp) : PairLJCut(lmp), gpu_mode(GPU_FORCE)
{ {
respa_enable = 0; respa_enable = 0;
cpu_time = 0.0; cpu_time = 0.0;
@ -89,7 +89,7 @@ void PairLJCutGPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = ljl_gpu_compute_n(neighbor->ago, inum, nall, firstneigh = ljl_gpu_compute_n(neighbor->ago, inum, nall,
atom->x, atom->type, domain->sublo, atom->x, atom->type, domain->sublo,
@ -153,7 +153,7 @@ void PairLJCutGPU::init_style()
cell_size, gpu_mode, screen); cell_size, gpu_mode, screen);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairLJCutGPU : public PairLJCut {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -63,7 +63,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairLJExpandGPU::PairLJExpandGPU(LAMMPS *lmp) : PairLJExpand(lmp), gpu_mode(GPU_PAIR) PairLJExpandGPU::PairLJExpandGPU(LAMMPS *lmp) : PairLJExpand(lmp), gpu_mode(GPU_FORCE)
{ {
respa_enable = 0; respa_enable = 0;
cpu_time = 0.0; cpu_time = 0.0;
@ -90,7 +90,7 @@ void PairLJExpandGPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = lje_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = lje_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -152,7 +152,7 @@ void PairLJExpandGPU::init_style()
cell_size, gpu_mode, screen); cell_size, gpu_mode, screen);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairLJExpandGPU : public PairLJExpand {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -62,7 +62,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairMorseGPU::PairMorseGPU(LAMMPS *lmp) : PairMorse(lmp), gpu_mode(GPU_PAIR) PairMorseGPU::PairMorseGPU(LAMMPS *lmp) : PairMorse(lmp), gpu_mode(GPU_FORCE)
{ {
cpu_time = 0.0; cpu_time = 0.0;
} }
@ -88,7 +88,7 @@ void PairMorseGPU::compute(int eflag, int vflag)
bool success = true; bool success = true;
int *ilist, *numneigh, **firstneigh; int *ilist, *numneigh, **firstneigh;
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = mor_gpu_compute_n(neighbor->ago, inum, nall, firstneigh = mor_gpu_compute_n(neighbor->ago, inum, nall,
atom->x, atom->type, domain->sublo, atom->x, atom->type, domain->sublo,
@ -150,7 +150,7 @@ void PairMorseGPU::init_style()
cell_size, gpu_mode, screen); cell_size, gpu_mode, screen);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairMorseGPU : public PairMorse {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -69,7 +69,7 @@ enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairRESquaredGPU::PairRESquaredGPU(LAMMPS *lmp) : PairRESquared(lmp), PairRESquaredGPU::PairRESquaredGPU(LAMMPS *lmp) : PairRESquared(lmp),
gpu_mode(GPU_PAIR) gpu_mode(GPU_FORCE)
{ {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec) if (!avec)
@ -118,7 +118,7 @@ void PairRESquaredGPU::compute(int eflag, int vflag)
} }
} }
if (gpu_mode == GPU_NEIGH) { if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal; inum = atom->nlocal;
firstneigh = re_gpu_compute_n(neighbor->ago, inum, nall, atom->x, firstneigh = re_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi, atom->type, domain->sublo, domain->subhi,
@ -199,7 +199,7 @@ void PairRESquaredGPU::init_style()
cell_size, gpu_mode, screen); cell_size, gpu_mode, screen);
GPU_EXTRA::check_flag(success,error,world); GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode != GPU_NEIGH) { if (gpu_mode == GPU_FORCE) {
int irequest = neighbor->request(this); int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->full = 1;

View File

@ -33,7 +33,7 @@ class PairRESquaredGPU : public PairRESquared {
void init_style(); void init_style();
double memory_usage(); double memory_usage();
enum { GPU_PAIR, GPU_NEIGH }; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private: private:
int gpu_mode; int gpu_mode;

View File

@ -12,7 +12,7 @@
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
Contributing authors: Mike Brown (ORNL) Contributing authors: Mike Brown (ORNL), Axel Kohlmeyer (Temple)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#include "lmptype.h" #include "lmptype.h"