mirror of https://github.com/lammps/lammps.git
Adding kokkos half list with ghosts
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15158 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
84f65fe441
commit
253f93a579
|
@ -124,8 +124,8 @@ void NeighborKokkos::full_bin_kokkos(NeighListKokkos<DeviceType> *list)
|
|||
const int factor = 1;
|
||||
#endif
|
||||
|
||||
if (GHOST && !HALF_NEIGH) {
|
||||
NeighborKokkosBuildFunctorFullGhost<DeviceType> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor);
|
||||
if (GHOST) {
|
||||
NeighborKokkosBuildFunctorGhost<DeviceType,HALF_NEIGH> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor);
|
||||
Kokkos::parallel_for(nall, f);
|
||||
} else {
|
||||
if(newton_pair) {
|
||||
|
@ -557,9 +557,9 @@ void NeighborKokkosExecute<DeviceType>::build_ItemCuda(typename Kokkos::TeamPoli
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
template<class Device>
|
||||
template<class Device> template<int HalfNeigh>
|
||||
void NeighborKokkosExecute<Device>::
|
||||
build_Item_Full_Ghost(const int &i) const
|
||||
build_Item_Ghost(const int &i) const
|
||||
{
|
||||
/* if necessary, goto next page and add pages */
|
||||
int n = 0;
|
||||
|
@ -592,7 +592,9 @@ void NeighborKokkosExecute<Device>::
|
|||
const int jbin = ibin + stencil[k];
|
||||
for(int m = 0; m < c_bincount(jbin); m++) {
|
||||
const int j = c_bins(jbin,m);
|
||||
if (i == j) continue;
|
||||
|
||||
if (HalfNeigh && j <= i) continue;
|
||||
else if (j == i) continue;
|
||||
|
||||
const int jtype = type[j];
|
||||
if(exclude && exclusion(i,j,itype,jtype)) continue;
|
||||
|
@ -646,7 +648,9 @@ void NeighborKokkosExecute<Device>::
|
|||
const int jbin = ibin + stencil[k];
|
||||
for(int m = 0; m < c_bincount(jbin); m++) {
|
||||
const int j = c_bins(jbin,m);
|
||||
if (i == j) continue;
|
||||
|
||||
if (HalfNeigh && j <= i) continue;
|
||||
else if (j == i) continue;
|
||||
|
||||
const int jtype = type[j];
|
||||
if(exclude && exclusion(i,j,itype,jtype)) continue;
|
||||
|
|
|
@ -281,7 +281,7 @@ void NeighborKokkos::choose_build(int index, NeighRequest *rq)
|
|||
PairPtrHost pb = NULL;
|
||||
if (rq->ghost) {
|
||||
if (rq->full) pb = &NeighborKokkos::full_bin_kokkos<LMPHostType,0,1>;
|
||||
else if (rq->half) error->one(FLERR,"Cannot (yet) request ghost atoms with Kokkos half neighbor list");
|
||||
else if (rq->half) &NeighborKokkos::full_bin_kokkos<LMPHostType,1,1>;
|
||||
pair_build_host[index] = pb;
|
||||
} else {
|
||||
if (rq->full) pb = &NeighborKokkos::full_bin_kokkos<LMPHostType,0,0>;
|
||||
|
|
|
@ -158,8 +158,9 @@ class NeighborKokkosExecute
|
|||
KOKKOS_FUNCTION
|
||||
void build_Item(const int &i) const;
|
||||
|
||||
template<int HalfNeigh>
|
||||
KOKKOS_FUNCTION
|
||||
void build_Item_Full_Ghost(const int &i) const;
|
||||
void build_Item_Ghost(const int &i) const;
|
||||
|
||||
template<int ClusterSize>
|
||||
KOKKOS_FUNCTION
|
||||
|
@ -297,20 +298,20 @@ struct NeighborKokkosBuildFunctor {
|
|||
#endif
|
||||
};
|
||||
|
||||
template<class Device>
|
||||
struct NeighborKokkosBuildFunctorFullGhost {
|
||||
template<class Device,int HALF_NEIGH>
|
||||
struct NeighborKokkosBuildFunctorGhost {
|
||||
typedef Device device_type;
|
||||
|
||||
const NeighborKokkosExecute<Device> c;
|
||||
const size_t sharedsize;
|
||||
|
||||
NeighborKokkosBuildFunctorFullGhost(const NeighborKokkosExecute<Device> &_c,
|
||||
NeighborKokkosBuildFunctorGhost(const NeighborKokkosExecute<Device> &_c,
|
||||
const size_t _sharedsize):c(_c),
|
||||
sharedsize(_sharedsize) {};
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator() (const int & i) const {
|
||||
c.build_Item_Full_Ghost(i);
|
||||
c.template build_Item_Ghost<HALF_NEIGH>(i);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -433,10 +434,6 @@ class NeighborKokkos : public Neighbor {
|
|||
|
||||
/* ERROR/WARNING messages:
|
||||
|
||||
E: Cannot (yet) request ghost atoms with Kokkos half neighbor list
|
||||
|
||||
This feature is not yet supported.
|
||||
|
||||
E: Too many local+ghost atoms for neighbor list
|
||||
|
||||
The number of nlocal + nghost atoms on a processor
|
||||
|
|
Loading…
Reference in New Issue