Enabled neighbor list build on the device with pair_style hybrid and hybrid/overlay

This commit is contained in:
Trung Nguyen
2019-04-16 23:30:25 -05:00
parent 898860328b
commit c55009a0ac
8 changed files with 80 additions and 27 deletions

View File

@ -30,7 +30,6 @@
#include "neighbor.h"
#include "citeme.h"
#include "error.h"
#include "utils.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -219,17 +218,6 @@ void FixGPU::init()
error->all(FLERR,"GPU package does not (yet) work with "
"atom_style template");
// hybrid cannot be used with force/neigh option
if (_gpu_mode == GPU_NEIGH || _gpu_mode == GPU_HYB_NEIGH)
if (force->pair_match("^hybrid",0) != NULL)
error->all(FLERR,"Cannot use pair hybrid with GPU neighbor list builds");
if (_particle_split < 0)
if (force->pair_match("^hybrid",0) != NULL)
error->all(FLERR,"GPU split param must be positive "
"for hybrid pair styles");
// neighbor list builds on the GPU with triclinic box is not yet supported
if ((_gpu_mode == GPU_NEIGH || _gpu_mode == GPU_HYB_NEIGH) &&
@ -243,16 +231,21 @@ void FixGPU::init()
// make sure fdotr virial is not accumulated multiple times
if (force->pair_match("^hybrid",0) != NULL) {
if (force->pair_match("hybrid",1) != NULL) {
PairHybrid *hybrid = (PairHybrid *) force->pair;
for (int i = 0; i < hybrid->nstyles; i++)
if (!utils::strmatch(hybrid->keywords[i],"/gpu$"))
if (strstr(hybrid->keywords[i],"/gpu")==NULL)
force->pair->no_virial_fdotr_compute = 1;
} else if (force->pair_match("hybrid/overlay",1) != NULL) {
PairHybridOverlay *hybrid = (PairHybridOverlay *) force->pair;
for (int i = 0; i < hybrid->nstyles; i++)
if (strstr(hybrid->keywords[i],"/gpu")==NULL)
force->pair->no_virial_fdotr_compute = 1;
}
// rRESPA support
if (utils::strmatch(update->integrate_style,"^respa"))
if (strstr(update->integrate_style,"respa"))
_nlevels_respa = ((Respa *) update->integrate)->nlevels;
}
@ -283,7 +276,7 @@ void FixGPU::min_setup(int vflag)
/* ---------------------------------------------------------------------- */
void FixGPU::post_force(int /* vflag */)
void FixGPU::post_force(int vflag)
{
if (!force->pair) return;
@ -315,7 +308,7 @@ void FixGPU::min_post_force(int vflag)
/* ---------------------------------------------------------------------- */
void FixGPU::post_force_respa(int vflag, int /* ilevel */, int /* iloop */)
void FixGPU::post_force_respa(int vflag, int ilevel, int iloop)
{
post_force(vflag);
}