Fix bug in Kokkos neighborlist where stencil wasn't updated for occasional list

This commit is contained in:
Stan Moore
2021-11-01 14:07:04 -06:00
committed by Axel Kohlmeyer
parent 6b400fb4bf
commit 21fcdf8c56
2 changed files with 6 additions and 2 deletions

View File

@ -29,6 +29,8 @@ namespace LAMMPS_NS {
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI, int SIZE>
NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI,SIZE>::NPairKokkos(LAMMPS *lmp) : NPair(lmp) {
last_stencil_old = -1;
// use 1D view for scalars to reduce GPU memory operations
d_scalars = typename AT::t_int_1d("neighbor:scalars",2);
@ -112,9 +114,11 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI,SIZE>::copy_stencil_info()
NPair::copy_stencil_info();
nstencil = ns->nstencil;
if (ns->last_stencil == update->ntimestep) {
if (ns->last_stencil != last_stencil_old) {
// copy stencil to device as it may have changed
last_stencil_old = ns->last_stencil;
int maxstencil = ns->get_maxstencil();
if (maxstencil > (int)k_stencil.extent(0))

View File

@ -138,7 +138,7 @@ class NPairKokkos : public NPair {
// data from NStencil class
int nstencil;
int nstencil,last_stencil_old;
DAT::tdual_int_1d k_stencil; // # of J neighs for each I
DAT::tdual_int_1d_3 k_stencilxyz;
};