Skip to content
Snippets Groups Projects
Unverified Commit 1baecc68 authored by Stefan Paquay's avatar Stefan Paquay Committed by GitHub
Browse files

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.
parents 5ba80662 d916416c
No related branches found
No related tags found
No related merge requests found
...@@ -229,6 +229,8 @@ action pair_tersoff_mod_kokkos.cpp pair_tersoff_mod.cpp ...@@ -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_mod_kokkos.h pair_tersoff_mod.h
action pair_tersoff_zbl_kokkos.cpp pair_tersoff_zbl.cpp action pair_tersoff_zbl_kokkos.cpp pair_tersoff_zbl.cpp
action pair_tersoff_zbl_kokkos.h pair_tersoff_zbl.h 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.cpp pppm.cpp
action pppm_kokkos.h pppm.h action pppm_kokkos.h pppm.h
action rand_pool_wrap_kokkos.cpp action rand_pool_wrap_kokkos.cpp
......
...@@ -16,15 +16,6 @@ ...@@ -16,15 +16,6 @@
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#include <math.h> #include <math.h>
#include <stdlib.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 "pair_yukawa_kokkos.h"
#include "kokkos.h" #include "kokkos.h"
#include "atom_kokkos.h" #include "atom_kokkos.h"
...@@ -40,7 +31,6 @@ ...@@ -40,7 +31,6 @@
#include "memory.h" #include "memory.h"
#include "error.h" #include "error.h"
#include "atom_masks.h" #include "atom_masks.h"
// end These were added.
using namespace LAMMPS_NS; using namespace LAMMPS_NS;
using namespace MathConst; using namespace MathConst;
...@@ -104,24 +94,11 @@ void PairYukawaKokkos<DeviceType>::allocate() ...@@ -104,24 +94,11 @@ void PairYukawaKokkos<DeviceType>::allocate()
d_cutsq = k_cutsq.template view<DeviceType>(); d_cutsq = k_cutsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_yukawa**, k_params = Kokkos::DualView<params_yukawa**,
Kokkos::LayoutRight,DeviceType>( Kokkos::LayoutRight,DeviceType>(
"PairYukawa::params",n+1,n+1); "PairYukawa::params",n+1,n+1);
params = k_params.template view<DeviceType>(); 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 init specific to this pair style
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
...@@ -158,9 +135,6 @@ void PairYukawaKokkos<DeviceType>::init_style() ...@@ -158,9 +135,6 @@ void PairYukawaKokkos<DeviceType>::init_style()
} else if (neighflag == HALF || neighflag == HALFTHREAD) { } else if (neighflag == HALF || neighflag == HALFTHREAD) {
neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->full = 0;
neighbor->requests[irequest]->half = 1; neighbor->requests[irequest]->half = 1;
} else if (neighflag == N2) {
neighbor->requests[irequest]->full = 0;
neighbor->requests[irequest]->half = 0;
} else { } else {
error->all(FLERR,"Cannot use chosen neighbor list style with yukawa/kk"); 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) ...@@ -241,7 +215,7 @@ void PairYukawaKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// loop over neighbors of my atoms // loop over neighbors of my atoms
EV_FLOAT ev = pair_compute<PairYukawaKokkos<DeviceType>,void >( EV_FLOAT ev = pair_compute<PairYukawaKokkos<DeviceType>,void >(
this,(NeighListKokkos<DeviceType>*)list); this,(NeighListKokkos<DeviceType>*)list);
if (eflag_global) eng_vdwl += ev.evdwl; if (eflag_global) eng_vdwl += ev.evdwl;
if (vflag_global) { if (vflag_global) {
......
...@@ -31,15 +31,15 @@ namespace LAMMPS_NS { ...@@ -31,15 +31,15 @@ namespace LAMMPS_NS {
template<class DeviceType> template<class DeviceType>
class PairYukawaKokkos : public PairYukawa { class PairYukawaKokkos : public PairYukawa {
public: public:
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2}; enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
enum {COUL_FLAG=0}; enum {COUL_FLAG=0};
typedef DeviceType device_type; typedef DeviceType device_type;
typedef ArrayTypes<DeviceType> AT;
PairYukawaKokkos(class LAMMPS *); PairYukawaKokkos(class LAMMPS *);
virtual ~PairYukawaKokkos(); virtual ~PairYukawaKokkos();
void compute(int, int); void compute(int, int);
void settings(int, char**);
void init_style(); void init_style();
double init_one(int,int); double init_one(int,int);
...@@ -78,22 +78,22 @@ class PairYukawaKokkos : public PairYukawa { ...@@ -78,22 +78,22 @@ class PairYukawaKokkos : public PairYukawa {
typename Kokkos::DualView<params_yukawa**,Kokkos::LayoutRight,DeviceType>::t_dev_const_um params; 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]; params_yukawa m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
F_FLOAT m_cutsq[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 AT::t_x_array_randomread x;
typename ArrayTypes<DeviceType>::t_x_array c_x; typename AT::t_x_array c_x;
typename ArrayTypes<DeviceType>::t_f_array f; typename AT::t_f_array f;
typename ArrayTypes<DeviceType>::t_int_1d_randomread type; typename AT::t_int_1d_randomread type;
DAT::tdual_efloat_1d k_eatom; DAT::tdual_efloat_1d k_eatom;
DAT::tdual_virial_array k_vatom; DAT::tdual_virial_array k_vatom;
typename ArrayTypes<DeviceType>::t_efloat_1d d_eatom; typename AT::t_efloat_1d d_eatom;
typename ArrayTypes<DeviceType>::t_virial_array d_vatom; typename AT::t_virial_array d_vatom;
typename ArrayTypes<DeviceType>::t_tagint_1d tag; typename AT::t_tagint_1d tag;
int newton_pair; int newton_pair;
double special_lj[4]; double special_lj[4];
typename ArrayTypes<DeviceType>::tdual_ffloat_2d k_cutsq; typename AT::tdual_ffloat_2d k_cutsq;
typename ArrayTypes<DeviceType>::t_ffloat_2d d_cutsq; typename AT::t_ffloat_2d d_cutsq;
int neighflag; int neighflag;
...@@ -109,15 +109,15 @@ class PairYukawaKokkos : public PairYukawa { ...@@ -109,15 +109,15 @@ class PairYukawaKokkos : public PairYukawa {
friend class PairComputeFunctor<PairYukawaKokkos,HALFTHREAD,false>; friend class PairComputeFunctor<PairYukawaKokkos,HALFTHREAD,false>;
friend class PairComputeFunctor<PairYukawaKokkos,N2,false>; friend class PairComputeFunctor<PairYukawaKokkos,N2,false>;
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,FULL,void>( friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,FULL,void>(
PairYukawaKokkos*,NeighListKokkos<DeviceType>*); PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,HALF,void>( friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,HALF,void>(
PairYukawaKokkos*,NeighListKokkos<DeviceType>*); PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,HALFTHREAD,void>( friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,HALFTHREAD,void>(
PairYukawaKokkos*,NeighListKokkos<DeviceType>*); PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,N2,void>( friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,N2,void>(
PairYukawaKokkos*,NeighListKokkos<DeviceType>*); PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute<PairYukawaKokkos,void>( friend EV_FLOAT pair_compute<PairYukawaKokkos,void>(
PairYukawaKokkos*,NeighListKokkos<DeviceType>*); PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
friend void pair_virial_fdotr_compute<PairYukawaKokkos>(PairYukawaKokkos*); friend void pair_virial_fdotr_compute<PairYukawaKokkos>(PairYukawaKokkos*);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment