Merge pull request #3 from stanmoore1/kk_yukawa

Add pair_yukawa_kokkos to Install.sh and minor cleanup.

These changes look fine. Sorry for the tabs, I must have forgotten about those.
This commit is contained in:
Stefan Paquay 2017-12-04 14:16:53 -05:00 committed by GitHub
commit 1baecc689e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 44 deletions

View File

@ -229,6 +229,8 @@ action pair_tersoff_mod_kokkos.cpp pair_tersoff_mod.cpp
action pair_tersoff_mod_kokkos.h pair_tersoff_mod.h
action pair_tersoff_zbl_kokkos.cpp pair_tersoff_zbl.cpp
action pair_tersoff_zbl_kokkos.h pair_tersoff_zbl.h
action pair_yukawa_kokkos.cpp
action pair_yukawa_kokkos.h
action pppm_kokkos.cpp pppm.cpp
action pppm_kokkos.h pppm.h
action rand_pool_wrap_kokkos.cpp

View File

@ -16,15 +16,6 @@
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
// #include "pair_yukawa.h"
// #include "atom.h"
//#include "force.h"
//#include "comm.h"
//#include "neigh_list.h"
//#include "memory.h"
//#include "error.h"
// These were added.
#include "pair_yukawa_kokkos.h"
#include "kokkos.h"
#include "atom_kokkos.h"
@ -40,7 +31,6 @@
#include "memory.h"
#include "error.h"
#include "atom_masks.h"
// end These were added.
using namespace LAMMPS_NS;
using namespace MathConst;
@ -104,24 +94,11 @@ void PairYukawaKokkos<DeviceType>::allocate()
d_cutsq = k_cutsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_yukawa**,
Kokkos::LayoutRight,DeviceType>(
"PairYukawa::params",n+1,n+1);
"PairYukawa::params",n+1,n+1);
params = k_params.template view<DeviceType>();
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
template<class DeviceType>
void PairYukawaKokkos<DeviceType>::settings(int narg, char **arg)
{
if (narg != 2) error->all(FLERR,"Illegal pair_style command");
PairYukawa::settings(2,arg);
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
@ -158,9 +135,6 @@ void PairYukawaKokkos<DeviceType>::init_style()
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
neighbor->requests[irequest]->full = 0;
neighbor->requests[irequest]->half = 1;
} else if (neighflag == N2) {
neighbor->requests[irequest]->full = 0;
neighbor->requests[irequest]->half = 0;
} else {
error->all(FLERR,"Cannot use chosen neighbor list style with yukawa/kk");
}
@ -241,7 +215,7 @@ void PairYukawaKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// loop over neighbors of my atoms
EV_FLOAT ev = pair_compute<PairYukawaKokkos<DeviceType>,void >(
this,(NeighListKokkos<DeviceType>*)list);
this,(NeighListKokkos<DeviceType>*)list);
if (eflag_global) eng_vdwl += ev.evdwl;
if (vflag_global) {

View File

@ -31,15 +31,15 @@ namespace LAMMPS_NS {
template<class DeviceType>
class PairYukawaKokkos : public PairYukawa {
public:
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2};
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
enum {COUL_FLAG=0};
typedef DeviceType device_type;
typedef ArrayTypes<DeviceType> AT;
PairYukawaKokkos(class LAMMPS *);
virtual ~PairYukawaKokkos();
void compute(int, int);
void settings(int, char**);
void init_style();
double init_one(int,int);
@ -78,22 +78,22 @@ class PairYukawaKokkos : public PairYukawa {
typename Kokkos::DualView<params_yukawa**,Kokkos::LayoutRight,DeviceType>::t_dev_const_um params;
params_yukawa m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
F_FLOAT m_cutsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
typename ArrayTypes<DeviceType>::t_x_array_randomread x;
typename ArrayTypes<DeviceType>::t_x_array c_x;
typename ArrayTypes<DeviceType>::t_f_array f;
typename ArrayTypes<DeviceType>::t_int_1d_randomread type;
typename AT::t_x_array_randomread x;
typename AT::t_x_array c_x;
typename AT::t_f_array f;
typename AT::t_int_1d_randomread type;
DAT::tdual_efloat_1d k_eatom;
DAT::tdual_virial_array k_vatom;
typename ArrayTypes<DeviceType>::t_efloat_1d d_eatom;
typename ArrayTypes<DeviceType>::t_virial_array d_vatom;
typename ArrayTypes<DeviceType>::t_tagint_1d tag;
typename AT::t_efloat_1d d_eatom;
typename AT::t_virial_array d_vatom;
typename AT::t_tagint_1d tag;
int newton_pair;
double special_lj[4];
typename ArrayTypes<DeviceType>::tdual_ffloat_2d k_cutsq;
typename ArrayTypes<DeviceType>::t_ffloat_2d d_cutsq;
typename AT::tdual_ffloat_2d k_cutsq;
typename AT::t_ffloat_2d d_cutsq;
int neighflag;
@ -109,15 +109,15 @@ class PairYukawaKokkos : public PairYukawa {
friend class PairComputeFunctor<PairYukawaKokkos,HALFTHREAD,false>;
friend class PairComputeFunctor<PairYukawaKokkos,N2,false>;
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,FULL,void>(
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,HALF,void>(
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,HALFTHREAD,void>(
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,N2,void>(
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute<PairYukawaKokkos,void>(
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
friend void pair_virial_fdotr_compute<PairYukawaKokkos>(PairYukawaKokkos*);
};