Commit a5790ef6 authored by Stan Moore's avatar Stan Moore
Browse files

Rename to ScatterView

parent 8e68015a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ void FixQEqReaxKokkos<DeviceType>::pre_force(int vflag)
  k_t.template sync<DeviceType>();

  if (neighflag != FULL)
    red_o = Kokkos::Experimental::create_reduction_view<> (d_o); // allocate duplicated memory
    red_o = Kokkos::Experimental::create_scatter_view<> (d_o); // allocate duplicated memory

  // 1st cg solve over b_s, s
  cg_solve1();
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ FixStyle(qeq/reax/kk/host,FixQEqReaxKokkos<LMPHostType>)
#ifndef LMP_FIX_QEQ_REAX_KOKKOS_H
#define LMP_FIX_QEQ_REAX_KOKKOS_H

#include <Kokkos_ReductionView.hpp>
#include <Kokkos_ScatterView.hpp>
#include "fix_qeq_reax.h"
#include "kokkos_type.h"
#include "neigh_list.h"
@@ -193,7 +193,7 @@ class FixQEqReaxKokkos : public FixQEqReax {
  HAT::t_ffloat_2d h_s_hist, h_t_hist;
  typename AT::t_ffloat_2d_randomread r_s_hist, r_t_hist;

  Kokkos::Experimental::ReductionView<F_FLOAT*, typename AT::t_ffloat_1d::array_layout, DeviceType> red_o;
  Kokkos::Experimental::ScatterView<F_FLOAT*, typename AT::t_ffloat_1d::array_layout, DeviceType> red_o;

  void init_shielding_k();
  void init_hist();
+3 −3
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
#include "neighbor_kokkos.h"
#include "neigh_list_kokkos.h"
#include "Kokkos_Vectorization.hpp"
#include "Kokkos_ReductionView.hpp"
#include "Kokkos_ScatterView.hpp"

namespace LAMMPS_NS {

@@ -64,12 +64,12 @@ struct AtomicF<HALFTHREAD> {
// Do atomic trait when running HALFTHREAD neighbor list style
template<int NEIGHFLAG>
struct AtomicDup {
  enum {value = Kokkos::Experimental::ReductionNonAtomic};
  enum {value = Kokkos::Experimental::ScatterNonAtomic};
};

template<>
struct AtomicDup<HALFTHREAD> {
  enum {value = Kokkos::Experimental::ReductionAtomic};
  enum {value = Kokkos::Experimental::ScatterAtomic};
};

//Specialisation for Neighborlist types Half, HalfThread, Full
+11 −11
Original line number Diff line number Diff line
@@ -713,9 +713,9 @@ void PairReaxCKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
  d_ilist = k_list->d_ilist;

  // allocate duplicated memory
  dup_f            = Kokkos::Experimental::create_reduction_view<>(f);
  dup_eatom        = Kokkos::Experimental::create_reduction_view<>(v_eatom);
  dup_vatom        = Kokkos::Experimental::create_reduction_view<>(v_vatom);
  dup_f            = Kokkos::Experimental::create_scatter_view<>(f);
  dup_eatom        = Kokkos::Experimental::create_scatter_view<>(v_eatom);
  dup_vatom        = Kokkos::Experimental::create_scatter_view<>(v_vatom);

  if (eflag_global) {
    for (int i = 0; i < 14; i++)
@@ -787,8 +787,8 @@ void PairReaxCKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
  }

  // allocate duplicated memory
  dup_dDeltap_self = Kokkos::Experimental::create_reduction_view<>(d_dDeltap_self);
  dup_total_bo     = Kokkos::Experimental::create_reduction_view<>(d_total_bo);
  dup_dDeltap_self = Kokkos::Experimental::create_scatter_view<>(d_dDeltap_self);
  dup_total_bo     = Kokkos::Experimental::create_scatter_view<>(d_total_bo);

  // Neighbor lists for bond and hbond

@@ -829,16 +829,16 @@ void PairReaxCKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
    resize = resize_bo || resize_hb;
    if (resize) {
      allocate_array();
      dup_dDeltap_self = Kokkos::Experimental::create_reduction_view<>(d_dDeltap_self);
      dup_total_bo     = Kokkos::Experimental::create_reduction_view<>(d_total_bo);
      dup_dDeltap_self = Kokkos::Experimental::create_scatter_view<>(d_dDeltap_self);
      dup_total_bo     = Kokkos::Experimental::create_scatter_view<>(d_total_bo);
    }
  }

  // allocate duplicated memory
  dup_CdDelta = Kokkos::Experimental::create_reduction_view<>(d_CdDelta);
  //dup_Cdbo    = Kokkos::Experimental::create_reduction_view<>(d_Cdbo);
  //dup_Cdbopi  = Kokkos::Experimental::create_reduction_view<>(d_Cdbopi);
  //dup_Cdbopi2 = Kokkos::Experimental::create_reduction_view<>(d_Cdbopi2);
  dup_CdDelta = Kokkos::Experimental::create_scatter_view<>(d_CdDelta);
  //dup_Cdbo    = Kokkos::Experimental::create_scatter_view<>(d_Cdbo);
  //dup_Cdbopi  = Kokkos::Experimental::create_scatter_view<>(d_Cdbopi);
  //dup_Cdbopi2 = Kokkos::Experimental::create_scatter_view<>(d_Cdbopi2);

  // reduction over duplicated memory
  Kokkos::Experimental::contribute(d_total_bo, dup_total_bo); // needed in BondOrder1
+10 −10
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ PairStyle(reax/c/kk/host,PairReaxCKokkos<LMPHostType>)
#define LMP_PAIR_REAXC_KOKKOS_H

#include <stdio.h>
#include <Kokkos_ReductionView.hpp>
#include <Kokkos_ScatterView.hpp>
#include "pair_kokkos.h"
#include "pair_reaxc.h"
#include "neigh_list_kokkos.h"
@@ -412,15 +412,15 @@ class PairReaxCKokkos : public PairReaxC {
  typename AT::t_ffloat_2d_dl d_C1dbopi2, d_C2dbopi2, d_C3dbopi2, d_C4dbopi2;
  typename AT::t_ffloat_2d_dl d_Cdbo, d_Cdbopi, d_Cdbopi2, d_dDeltap_self;

  Kokkos::Experimental::ReductionView<F_FLOAT*, typename DAT::t_float_1d::array_layout,DeviceType> dup_total_bo;
  Kokkos::Experimental::ReductionView<F_FLOAT*, typename DAT::t_float_1d::array_layout,DeviceType> dup_CdDelta;
  Kokkos::Experimental::ReductionView<E_FLOAT*, typename DAT::t_efloat_1d::array_layout,DeviceType> dup_eatom;
  Kokkos::Experimental::ReductionView<F_FLOAT*[3], typename DAT::t_f_array::array_layout,DeviceType> dup_f;
  Kokkos::Experimental::ReductionView<F_FLOAT*[6], typename DAT::t_virial_array::array_layout,DeviceType> dup_vatom;
  Kokkos::Experimental::ReductionView<F_FLOAT**, typename DAT::t_ffloat_2d_dl::array_layout,DeviceType> dup_dDeltap_self;
  Kokkos::Experimental::ReductionView<F_FLOAT**, typename DAT::t_ffloat_2d_dl::array_layout,DeviceType> dup_Cdbo;
  Kokkos::Experimental::ReductionView<F_FLOAT**, typename DAT::t_ffloat_2d_dl::array_layout,DeviceType> dup_Cdbopi;
  Kokkos::Experimental::ReductionView<F_FLOAT**, typename DAT::t_ffloat_2d_dl::array_layout,DeviceType> dup_Cdbopi2;
  Kokkos::Experimental::ScatterView<F_FLOAT*, typename DAT::t_float_1d::array_layout,DeviceType> dup_total_bo;
  Kokkos::Experimental::ScatterView<F_FLOAT*, typename DAT::t_float_1d::array_layout,DeviceType> dup_CdDelta;
  Kokkos::Experimental::ScatterView<E_FLOAT*, typename DAT::t_efloat_1d::array_layout,DeviceType> dup_eatom;
  Kokkos::Experimental::ScatterView<F_FLOAT*[3], typename DAT::t_f_array::array_layout,DeviceType> dup_f;
  Kokkos::Experimental::ScatterView<F_FLOAT*[6], typename DAT::t_virial_array::array_layout,DeviceType> dup_vatom;
  Kokkos::Experimental::ScatterView<F_FLOAT**, typename DAT::t_ffloat_2d_dl::array_layout,DeviceType> dup_dDeltap_self;
  Kokkos::Experimental::ScatterView<F_FLOAT**, typename DAT::t_ffloat_2d_dl::array_layout,DeviceType> dup_Cdbo;
  Kokkos::Experimental::ScatterView<F_FLOAT**, typename DAT::t_ffloat_2d_dl::array_layout,DeviceType> dup_Cdbopi;
  Kokkos::Experimental::ScatterView<F_FLOAT**, typename DAT::t_ffloat_2d_dl::array_layout,DeviceType> dup_Cdbopi2;

  typedef Kokkos::DualView<F_FLOAT**[7],typename DeviceType::array_layout,DeviceType> tdual_ffloat_2d_n7;
  typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread;