diff --git a/doc/src/pair_reaxff.rst b/doc/src/pair_reaxff.rst index 46c1ab4145..d0c333af4b 100644 --- a/doc/src/pair_reaxff.rst +++ b/doc/src/pair_reaxff.rst @@ -164,8 +164,8 @@ ReaxFF and ignored otherwise. Setting the value to *yes* enables the "blocking" scheme (dynamically building interaction lists) for the ReaxFF bond neighbor list. This reduces the number of empty interactions and can improve performance in some cases (e.g. large -number of atoms/GPU for AMD hardware). It is also enabled by default -when running the CPU. +number of atoms/GPU on AMD hardware). It is also enabled by default +when running the CPU with Kokkos. The thermo variable *evdwl* stores the sum of all the ReaxFF potential energy contributions, with the exception of the Coulombic and charge diff --git a/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp b/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp index 174495342a..e6e63fdff3 100644 --- a/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp @@ -21,7 +21,7 @@ - Reduced math overhead: enabled specialized calls (e.g., cbrt for a cube root instead of pow) and use power/exponential laws to reduce the number of exponentials evaluated, etc. - - Fused the CG solve for "s" and "t" vectors + - Fused the CG solve for "S" and "T" matrices - Improved the SpMV algorithm by using vector instead of team level parallelism on GPUs ------------------------------------------------------------------------- */ @@ -384,7 +384,7 @@ void FixQEqReaxFFKokkos::allocate_array() template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqZero, const int &ii) const +void FixQEqReaxFFKokkos::operator()(TagQEqZero, const int &ii) const { const int i = d_ilist[ii]; const int itype = type(i); @@ -707,7 +707,7 @@ double FixQEqReaxFFKokkos::calculate_H_k(const F_FLOAT &r, const F_F template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqInitMatvec, const int &ii) const +void FixQEqReaxFFKokkos::operator()(TagQEqInitMatvec, const int &ii) const { const int i = d_ilist[ii]; const int itype = type(i); @@ -896,7 +896,7 @@ void FixQEqReaxFFKokkos::sparse_matvec_kokkos(typename AT::t_ffloat2 template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqSparseMatvec1, const int &ii) const +void FixQEqReaxFFKokkos::operator()(TagQEqSparseMatvec1, const int &ii) const { const int i = d_ilist[ii]; const int itype = type(i); @@ -913,7 +913,7 @@ void FixQEqReaxFFKokkos::operator() (TagQEqSparseMatvec1, const int template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqZeroQGhosts, const int &i) const +void FixQEqReaxFFKokkos::operator()(TagQEqZeroQGhosts, const int &i) const { if (mask[i] & groupbit) { if (!(converged & 1)) @@ -928,7 +928,7 @@ void FixQEqReaxFFKokkos::operator() (TagQEqZeroQGhosts, const int &i template template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqSparseMatvec2_Half, const int &ii) const +void FixQEqReaxFFKokkos::operator()(TagQEqSparseMatvec2_Half, const int &ii) const { // The q array is duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_o = ScatterViewHelper,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); @@ -963,7 +963,7 @@ void FixQEqReaxFFKokkos::operator() (TagQEqSparseMatvec2_Half KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqSparseMatvec2_Full, const membertype_vec &team) const +void FixQEqReaxFFKokkos::operator()(TagQEqSparseMatvec2_Full, const membertype_vec &team) const { int k = team.league_rank () * team.team_size () + team.team_rank (); if (k < nn) { @@ -992,7 +992,7 @@ void FixQEqReaxFFKokkos::operator() (TagQEqSparseMatvec2_Full, const template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqNorm1, const int &ii, F_FLOAT2& out) const +void FixQEqReaxFFKokkos::operator()(TagQEqNorm1, const int &ii, F_FLOAT2& out) const { const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1015,7 +1015,7 @@ void FixQEqReaxFFKokkos::operator() (TagQEqNorm1, const int &ii, F_F template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqDot1, const int &ii, F_FLOAT2& out) const +void FixQEqReaxFFKokkos::operator()(TagQEqDot1, const int &ii, F_FLOAT2& out) const { const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1030,7 +1030,7 @@ void FixQEqReaxFFKokkos::operator() (TagQEqDot1, const int &ii, F_FL template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqDot2, const int &ii, F_FLOAT2& out) const +void FixQEqReaxFFKokkos::operator()(TagQEqDot2, const int &ii, F_FLOAT2& out) const { const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1045,7 +1045,7 @@ void FixQEqReaxFFKokkos::operator() (TagQEqDot2, const int &ii, F_FL template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqDot3, const int &ii, F_FLOAT2& out) const +void FixQEqReaxFFKokkos::operator()(TagQEqDot3, const int &ii, F_FLOAT2& out) const { const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1071,7 +1071,7 @@ void FixQEqReaxFFKokkos::operator() (TagQEqDot3, const int &ii, F_FL template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqSum1, const int &ii) const +void FixQEqReaxFFKokkos::operator()(TagQEqSum1, const int &ii) const { const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1086,7 +1086,7 @@ void FixQEqReaxFFKokkos::operator() (TagQEqSum1, const int &ii) cons template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqSum2, const int &ii, F_FLOAT2& out) const +void FixQEqReaxFFKokkos::operator()(TagQEqSum2, const int &ii, F_FLOAT2& out) const { const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1099,7 +1099,7 @@ void FixQEqReaxFFKokkos::operator() (TagQEqSum2, const int &ii, F_FL template KOKKOS_INLINE_FUNCTION -void FixQEqReaxFFKokkos::operator() (TagQEqCalculateQ, const int &ii) const +void FixQEqReaxFFKokkos::operator()(TagQEqCalculateQ, const int &ii) const { const int i = d_ilist[ii]; if (mask[i] & groupbit) { diff --git a/src/KOKKOS/pair_reaxff_kokkos.cpp b/src/KOKKOS/pair_reaxff_kokkos.cpp index 0c545de2e6..771c505368 100644 --- a/src/KOKKOS/pair_reaxff_kokkos.cpp +++ b/src/KOKKOS/pair_reaxff_kokkos.cpp @@ -3417,8 +3417,6 @@ void PairReaxFFKokkos::operator()(TagPairReaxComputeTorsionBlocking< for (int d = 0; d < 3; d++) a_f(i,d) += fitmp[d]; } - - template template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_tersoff_kokkos.cpp b/src/KOKKOS/pair_tersoff_kokkos.cpp index 4a6a28cde0..ac670fe154 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_kokkos.cpp @@ -333,7 +333,6 @@ void PairTersoffKokkos::operator()(TagPairTersoffComputeShortNeigh, /* ---------------------------------------------------------------------- */ - template template KOKKOS_INLINE_FUNCTION @@ -341,8 +340,8 @@ void PairTersoffKokkos::operator()(TagPairTersoffComputeHalf::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - const auto a_f = v_f.template access::value>(); + const auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + const auto a_f = v_f.template access>(); const int i = d_ilist[ii]; if (i >= nlocal) return; @@ -401,7 +400,7 @@ void PairTersoffKokkos::operator()(TagPairTersoffComputeHalf::ters_fc_k_and_ters_dfc(const int &i, const i /* ---------------------------------------------------------------------- */ - - - template KOKKOS_INLINE_FUNCTION double PairTersoffKokkos::bondorder(const int &i, const int &j, const int &k, @@ -935,7 +931,6 @@ void PairTersoffKokkos:: /* ---------------------------------------------------------------------- */ - template KOKKOS_INLINE_FUNCTION double PairTersoffKokkos::ters_fa_k(const int &i, const int &j, @@ -960,7 +955,6 @@ double PairTersoffKokkos::ters_dfa(const int &i, const int &j, /* ---------------------------------------------------------------------- */ - template KOKKOS_INLINE_FUNCTION void PairTersoffKokkos::ters_fa_k_and_ters_dfa(const int &i, const int &j, @@ -978,6 +972,7 @@ void PairTersoffKokkos::ters_fa_k_and_ters_dfa(const int &i, const i } } +/* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION @@ -1057,6 +1052,8 @@ void PairTersoffKokkos::ters_bij_k_and_ters_dbij(const int &i, const prefactor = -0.5 * pow(1.0+tmp_n, -1.0-(1.0/(2.0*prm_ijk_pn)))*tmp_n / bo; } +/* ---------------------------------------------------------------------- */ + template KOKKOS_INLINE_FUNCTION void PairTersoffKokkos::ters_dthb(