Change default binsize for Kokkos if running on GPUs

This commit is contained in:
Stan Moore
2019-03-12 15:33:28 -06:00
parent c3acb3e4ef
commit b51d06b3ea
4 changed files with 14 additions and 0 deletions

View File

@ -30,6 +30,7 @@
#include "style_nstencil.h"
#include "style_npair.h"
#include "style_ntopo.h"
#include "comm.h"
using namespace LAMMPS_NS;
@ -359,6 +360,14 @@ void NeighborKokkos::modify_mol_intra_grow_kokkos(){
k_ex_mol_intra.modify<LMPHostType>();
}
/* ---------------------------------------------------------------------- */
void NeighborKokkos::set_binsize_kokkos() {
if (!binsizeflag && lmp->kokkos->ngpu > 0) {
binsize_user = cutneighmax;
binsizeflag = 1;
}
}
/* ---------------------------------------------------------------------- */
void NeighborKokkos::init_topology() {

View File

@ -87,6 +87,7 @@ class NeighborKokkos : public Neighbor {
void modify_ex_group_grow_kokkos();
void modify_mol_group_grow_kokkos();
void modify_mol_intra_grow_kokkos();
void set_binsize_kokkos();
};
}

View File

@ -471,6 +471,9 @@ void Neighbor::init()
error->warning(FLERR,"Neighbor exclusions used with KSpace solver "
"may give inconsistent Coulombic energies");
if (lmp->kokkos)
set_binsize_kokkos();
// ------------------------------------------------------------------
// create pairwise lists
// one-time call to init_styles() to scan style files and setup

View File

@ -233,6 +233,7 @@ class Neighbor : protected Pointers {
virtual void init_ex_bit_kokkos() {}
virtual void init_ex_mol_bit_kokkos() {}
virtual void grow_ex_mol_intra_kokkos() {}
virtual void set_binsize_kokkos() {}
};
namespace NeighConst {