From 24a85166bf11008278f912676ec8214f416989a0 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 2 Dec 2011 15:55:55 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7276 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/GPU/Install.sh | 23 ----------------------- src/GPU/fix_gpu.cpp | 14 ++++++++++++-- src/GPU/gpu_extra.h | 5 +++++ src/GPU/pair_cg_cmm_coul_long_gpu.cpp | 6 +++--- src/GPU/pair_cg_cmm_coul_long_gpu.h | 2 +- src/GPU/pair_cg_cmm_gpu.cpp | 6 +++--- src/GPU/pair_cg_cmm_gpu.h | 2 +- src/GPU/pair_coul_long_gpu.cpp | 8 ++++---- src/GPU/pair_coul_long_gpu.h | 2 +- src/GPU/pair_gayberne_gpu.cpp | 6 +++--- src/GPU/pair_gayberne_gpu.h | 2 +- src/GPU/pair_lj96_cut_gpu.cpp | 6 +++--- src/GPU/pair_lj96_cut_gpu.h | 2 +- src/GPU/pair_lj_charmm_coul_long_gpu.cpp | 6 +++--- src/GPU/pair_lj_charmm_coul_long_gpu.h | 2 +- src/GPU/pair_lj_class2_coul_long_gpu.cpp | 6 +++--- src/GPU/pair_lj_class2_coul_long_gpu.h | 2 +- src/GPU/pair_lj_class2_gpu.cpp | 6 +++--- src/GPU/pair_lj_class2_gpu.h | 2 +- src/GPU/pair_lj_cut_coul_cut_gpu.cpp | 6 +++--- src/GPU/pair_lj_cut_coul_cut_gpu.h | 2 +- src/GPU/pair_lj_cut_coul_long_gpu.cpp | 6 +++--- src/GPU/pair_lj_cut_coul_long_gpu.h | 2 +- src/GPU/pair_lj_cut_gpu.cpp | 6 +++--- src/GPU/pair_lj_cut_gpu.h | 2 +- src/GPU/pair_lj_expand_gpu.cpp | 6 +++--- src/GPU/pair_lj_expand_gpu.h | 2 +- src/GPU/pair_morse_gpu.cpp | 6 +++--- src/GPU/pair_morse_gpu.h | 2 +- src/GPU/pair_resquared_gpu.cpp | 6 +++--- src/GPU/pair_resquared_gpu.h | 2 +- src/GPU/pppm_gpu.cpp | 2 +- 32 files changed, 75 insertions(+), 83 deletions(-) diff --git a/src/GPU/Install.sh b/src/GPU/Install.sh index 4f16599890..b9e7ecfb4b 100644 --- a/src/GPU/Install.sh +++ b/src/GPU/Install.sh @@ -58,10 +58,6 @@ if (test $1 = 1) 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.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 if (test -e ../pppm.cpp) then @@ -74,8 +70,6 @@ if (test $1 = 1) then cp pair_lj96_cut_gpu.cpp .. cp pair_lj_expand_gpu.cpp .. cp pair_lj_cut_coul_cut_gpu.cpp .. - cp pair_lj_cut_tgpu.cpp .. - cp fix_gpu.cpp .. cp pair_lj_cut_gpu.h .. @@ -83,17 +77,10 @@ if (test $1 = 1) then cp pair_lj96_cut_gpu.h .. cp pair_lj_expand_gpu.h .. cp pair_lj_cut_coul_cut_gpu.h .. - cp pair_lj_cut_tgpu.h .. cp fix_gpu.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 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_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_cg_cmm_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 ../pair_omp_gpu.cpp - rm -f ../pair_lj_cut_tgpu.cpp rm -f ../pppm_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_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_cg_cmm_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 ../gpu_extra.h - rm -f ../pair_omp_gpu.h - rm -f ../pair_lj_cut_tgpu.h fi diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index eec1391bfc..d01d7cb3f4 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -25,10 +25,11 @@ #include "domain.h" #include "universe.h" #include "gpu_extra.h" +#include "neighbor.h" 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, const int first_gpu, const int last_gpu, @@ -57,6 +58,11 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : _gpu_mode = GPU_NEIGH; if (domain->triclinic) 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 error->all(FLERR,"Illegal fix GPU command"); @@ -116,7 +122,7 @@ void FixGPU::init() { // 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 || force->pair_match("hybrid/overlay",1) != NULL) error->all(FLERR,"Cannot use pair hybrid with GPU neighbor builds"); @@ -130,6 +136,10 @@ void FixGPU::init() 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); } diff --git a/src/GPU/gpu_extra.h b/src/GPU/gpu_extra.h index d9bbb7eaa6..d03beaf21a 100644 --- a/src/GPU/gpu_extra.h +++ b/src/GPU/gpu_extra.h @@ -39,6 +39,11 @@ namespace GPU_EXTRA { else if (all_success == -5) error->all(FLERR, "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 error->all(FLERR,"Unknown error in GPU library"); } diff --git a/src/GPU/pair_cg_cmm_coul_long_gpu.cpp b/src/GPU/pair_cg_cmm_coul_long_gpu.cpp index 27aedd4192..b9439835d8 100644 --- a/src/GPU/pair_cg_cmm_coul_long_gpu.cpp +++ b/src/GPU/pair_cg_cmm_coul_long_gpu.cpp @@ -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; cpu_time = 0.0; @@ -103,7 +103,7 @@ void PairCGCMMCoulLongGPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = cmml_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -183,7 +183,7 @@ void PairCGCMMCoulLongGPU::init_style() force->qqrd2e, g_ewald); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_cg_cmm_coul_long_gpu.h b/src/GPU/pair_cg_cmm_coul_long_gpu.h index 19dd11c66d..6ce9d635ab 100644 --- a/src/GPU/pair_cg_cmm_coul_long_gpu.h +++ b/src/GPU/pair_cg_cmm_coul_long_gpu.h @@ -33,7 +33,7 @@ class PairCGCMMCoulLongGPU : public PairCGCMMCoulLong { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_cg_cmm_gpu.cpp b/src/GPU/pair_cg_cmm_gpu.cpp index c26cd37f5f..4e409bd37a 100644 --- a/src/GPU/pair_cg_cmm_gpu.cpp +++ b/src/GPU/pair_cg_cmm_gpu.cpp @@ -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; cpu_time = 0.0; @@ -90,7 +90,7 @@ void PairCGCMMGPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = cmm_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -154,7 +154,7 @@ void PairCGCMMGPU::init_style() cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_cg_cmm_gpu.h b/src/GPU/pair_cg_cmm_gpu.h index d4cead54b6..481e01af21 100644 --- a/src/GPU/pair_cg_cmm_gpu.h +++ b/src/GPU/pair_cg_cmm_gpu.h @@ -33,7 +33,7 @@ class PairCGCMMGPU : public PairCGCMM { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_coul_long_gpu.cpp b/src/GPU/pair_coul_long_gpu.cpp index 8502e8ae53..5d311a34f4 100644 --- a/src/GPU/pair_coul_long_gpu.cpp +++ b/src/GPU/pair_coul_long_gpu.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Mike Brown (SNL) + Contributing author: Axel Kohlmeyer (Temple) ------------------------------------------------------------------------- */ #include "lmptype.h" @@ -73,7 +73,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairCoulLongGPU::PairCoulLongGPU(LAMMPS *lmp) : - PairCoulLong(lmp), gpu_mode(GPU_PAIR) + PairCoulLong(lmp), gpu_mode(GPU_FORCE) { respa_enable = 0; cpu_time = 0.0; @@ -100,7 +100,7 @@ void PairCoulLongGPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = cl_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -166,7 +166,7 @@ void PairCoulLongGPU::init_style() GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_coul_long_gpu.h b/src/GPU/pair_coul_long_gpu.h index a84b281447..d381c83a04 100644 --- a/src/GPU/pair_coul_long_gpu.h +++ b/src/GPU/pair_coul_long_gpu.h @@ -33,7 +33,7 @@ class PairCoulLongGPU : public PairCoulLong { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_gayberne_gpu.cpp b/src/GPU/pair_gayberne_gpu.cpp index eb9fd0094c..ce65ca2c83 100644 --- a/src/GPU/pair_gayberne_gpu.cpp +++ b/src/GPU/pair_gayberne_gpu.cpp @@ -70,7 +70,7 @@ enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE}; /* ---------------------------------------------------------------------- */ PairGayBerneGPU::PairGayBerneGPU(LAMMPS *lmp) : PairGayBerne(lmp), - gpu_mode(GPU_PAIR) + gpu_mode(GPU_FORCE) { avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); 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; firstneigh = gb_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -201,7 +201,7 @@ void PairGayBerneGPU::init_style() maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_gayberne_gpu.h b/src/GPU/pair_gayberne_gpu.h index 9d59f0d7ff..656ca5eed0 100644 --- a/src/GPU/pair_gayberne_gpu.h +++ b/src/GPU/pair_gayberne_gpu.h @@ -33,7 +33,7 @@ class PairGayBerneGPU : public PairGayBerne { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_lj96_cut_gpu.cpp b/src/GPU/pair_lj96_cut_gpu.cpp index f09e4636f9..b678d842e9 100644 --- a/src/GPU/pair_lj96_cut_gpu.cpp +++ b/src/GPU/pair_lj96_cut_gpu.cpp @@ -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; cpu_time = 0.0; @@ -89,7 +89,7 @@ void PairLJ96CutGPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = lj96_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -153,7 +153,7 @@ void PairLJ96CutGPU::init_style() cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_lj96_cut_gpu.h b/src/GPU/pair_lj96_cut_gpu.h index b4baa68828..e7916fbe46 100644 --- a/src/GPU/pair_lj96_cut_gpu.h +++ b/src/GPU/pair_lj96_cut_gpu.h @@ -33,7 +33,7 @@ class PairLJ96CutGPU : public PairLJ96Cut { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp index a1a30bfb17..488d4195f4 100644 --- a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp @@ -79,7 +79,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairLJCharmmCoulLongGPU::PairLJCharmmCoulLongGPU(LAMMPS *lmp) : - PairLJCharmmCoulLong(lmp), gpu_mode(GPU_PAIR) + PairLJCharmmCoulLong(lmp), gpu_mode(GPU_FORCE) { respa_enable = 0; cpu_time = 0.0; @@ -106,7 +106,7 @@ void PairLJCharmmCoulLongGPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = crml_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -199,7 +199,7 @@ void PairLJCharmmCoulLongGPU::init_style() arithmetic); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.h b/src/GPU/pair_lj_charmm_coul_long_gpu.h index 0205b93860..f51f9d4fce 100644 --- a/src/GPU/pair_lj_charmm_coul_long_gpu.h +++ b/src/GPU/pair_lj_charmm_coul_long_gpu.h @@ -33,7 +33,7 @@ class PairLJCharmmCoulLongGPU : public PairLJCharmmCoulLong { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.cpp b/src/GPU/pair_lj_class2_coul_long_gpu.cpp index 568cec2bf8..adaee7ab6a 100644 --- a/src/GPU/pair_lj_class2_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_class2_coul_long_gpu.cpp @@ -77,7 +77,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairLJClass2CoulLongGPU::PairLJClass2CoulLongGPU(LAMMPS *lmp) : - PairLJClass2CoulLong(lmp), gpu_mode(GPU_PAIR) + PairLJClass2CoulLong(lmp), gpu_mode(GPU_FORCE) { cpu_time = 0.0; } @@ -103,7 +103,7 @@ void PairLJClass2CoulLongGPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = c2cl_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -178,7 +178,7 @@ void PairLJClass2CoulLongGPU::init_style() force->special_coul, force->qqrd2e, g_ewald); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.h b/src/GPU/pair_lj_class2_coul_long_gpu.h index 9dbd0ff146..ea0ab27c57 100644 --- a/src/GPU/pair_lj_class2_coul_long_gpu.h +++ b/src/GPU/pair_lj_class2_coul_long_gpu.h @@ -33,7 +33,7 @@ class PairLJClass2CoulLongGPU : public PairLJClass2CoulLong { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_lj_class2_gpu.cpp b/src/GPU/pair_lj_class2_gpu.cpp index 349c043cde..65dcea9040 100644 --- a/src/GPU/pair_lj_class2_gpu.cpp +++ b/src/GPU/pair_lj_class2_gpu.cpp @@ -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; } @@ -88,7 +88,7 @@ void PairLJClass2GPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = lj96_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -150,7 +150,7 @@ void PairLJClass2GPU::init_style() cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_lj_class2_gpu.h b/src/GPU/pair_lj_class2_gpu.h index 7a2835e830..ea03bd74af 100644 --- a/src/GPU/pair_lj_class2_gpu.h +++ b/src/GPU/pair_lj_class2_gpu.h @@ -33,7 +33,7 @@ class PairLJClass2GPU : public PairLJClass2 { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp index 66dbbed46c..33a49f20f3 100644 --- a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp @@ -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; cpu_time = 0.0; @@ -94,7 +94,7 @@ void PairLJCutCoulCutGPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = ljc_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -162,7 +162,7 @@ void PairLJCutCoulCutGPU::init_style() force->special_coul, force->qqrd2e); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.h b/src/GPU/pair_lj_cut_coul_cut_gpu.h index 17bd4aa852..12108e8e9b 100644 --- a/src/GPU/pair_lj_cut_coul_cut_gpu.h +++ b/src/GPU/pair_lj_cut_coul_cut_gpu.h @@ -33,7 +33,7 @@ class PairLJCutCoulCutGPU : public PairLJCutCoulCut { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.cpp b/src/GPU/pair_lj_cut_coul_long_gpu.cpp index 80c7926272..16f609f953 100644 --- a/src/GPU/pair_lj_cut_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_long_gpu.cpp @@ -77,7 +77,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairLJCutCoulLongGPU::PairLJCutCoulLongGPU(LAMMPS *lmp) : - PairLJCutCoulLong(lmp), gpu_mode(GPU_PAIR) + PairLJCutCoulLong(lmp), gpu_mode(GPU_FORCE) { respa_enable = 0; cpu_time = 0.0; @@ -104,7 +104,7 @@ void PairLJCutCoulLongGPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = ljcl_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -185,7 +185,7 @@ void PairLJCutCoulLongGPU::init_style() force->special_coul, force->qqrd2e, g_ewald); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.h b/src/GPU/pair_lj_cut_coul_long_gpu.h index 70fbf82a71..f30d8a2154 100644 --- a/src/GPU/pair_lj_cut_coul_long_gpu.h +++ b/src/GPU/pair_lj_cut_coul_long_gpu.h @@ -33,7 +33,7 @@ class PairLJCutCoulLongGPU : public PairLJCutCoulLong { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_lj_cut_gpu.cpp b/src/GPU/pair_lj_cut_gpu.cpp index 198328274e..2c0c2f3f1d 100644 --- a/src/GPU/pair_lj_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_gpu.cpp @@ -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; cpu_time = 0.0; @@ -89,7 +89,7 @@ void PairLJCutGPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = ljl_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, @@ -153,7 +153,7 @@ void PairLJCutGPU::init_style() cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_lj_cut_gpu.h b/src/GPU/pair_lj_cut_gpu.h index 1a8c1db46f..20b1bf3aee 100644 --- a/src/GPU/pair_lj_cut_gpu.h +++ b/src/GPU/pair_lj_cut_gpu.h @@ -33,7 +33,7 @@ class PairLJCutGPU : public PairLJCut { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_lj_expand_gpu.cpp b/src/GPU/pair_lj_expand_gpu.cpp index b610e02bc3..40c7ea1a37 100644 --- a/src/GPU/pair_lj_expand_gpu.cpp +++ b/src/GPU/pair_lj_expand_gpu.cpp @@ -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; cpu_time = 0.0; @@ -90,7 +90,7 @@ void PairLJExpandGPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = lje_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -152,7 +152,7 @@ void PairLJExpandGPU::init_style() cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_lj_expand_gpu.h b/src/GPU/pair_lj_expand_gpu.h index 96619034c7..f02d10a4c4 100644 --- a/src/GPU/pair_lj_expand_gpu.h +++ b/src/GPU/pair_lj_expand_gpu.h @@ -33,7 +33,7 @@ class PairLJExpandGPU : public PairLJExpand { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_morse_gpu.cpp b/src/GPU/pair_morse_gpu.cpp index 8ede76217b..0867e5a998 100644 --- a/src/GPU/pair_morse_gpu.cpp +++ b/src/GPU/pair_morse_gpu.cpp @@ -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; } @@ -88,7 +88,7 @@ void PairMorseGPU::compute(int eflag, int vflag) bool success = true; int *ilist, *numneigh, **firstneigh; - if (gpu_mode == GPU_NEIGH) { + if (gpu_mode != GPU_FORCE) { inum = atom->nlocal; firstneigh = mor_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, @@ -150,7 +150,7 @@ void PairMorseGPU::init_style() cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_morse_gpu.h b/src/GPU/pair_morse_gpu.h index ee9ba576d5..7023828192 100644 --- a/src/GPU/pair_morse_gpu.h +++ b/src/GPU/pair_morse_gpu.h @@ -33,7 +33,7 @@ class PairMorseGPU : public PairMorse { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pair_resquared_gpu.cpp b/src/GPU/pair_resquared_gpu.cpp index f50d1feda6..4057f45c5e 100644 --- a/src/GPU/pair_resquared_gpu.cpp +++ b/src/GPU/pair_resquared_gpu.cpp @@ -69,7 +69,7 @@ enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE}; /* ---------------------------------------------------------------------- */ PairRESquaredGPU::PairRESquaredGPU(LAMMPS *lmp) : PairRESquared(lmp), - gpu_mode(GPU_PAIR) + gpu_mode(GPU_FORCE) { avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); 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; firstneigh = re_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, domain->sublo, domain->subhi, @@ -199,7 +199,7 @@ void PairRESquaredGPU::init_style() cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); - if (gpu_mode != GPU_NEIGH) { + if (gpu_mode == GPU_FORCE) { int irequest = neighbor->request(this); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/GPU/pair_resquared_gpu.h b/src/GPU/pair_resquared_gpu.h index f16812f784..54d5513a02 100644 --- a/src/GPU/pair_resquared_gpu.h +++ b/src/GPU/pair_resquared_gpu.h @@ -33,7 +33,7 @@ class PairRESquaredGPU : public PairRESquared { void init_style(); double memory_usage(); - enum { GPU_PAIR, GPU_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index 13af9fcfbe..9dc7362867 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing authors: Mike Brown (ORNL) + Contributing authors: Mike Brown (ORNL), Axel Kohlmeyer (Temple) ------------------------------------------------------------------------- */ #include "lmptype.h"