Commit cd7bdf92 authored by sjplimp's avatar sjplimp Committed by GitHub
Browse files

Merge pull request #341 from stanmoore1/qeq_kk_neighlist

Make fix_qeq_reax_kokkos request its own neighbor list
parents 8c5b1089 b2208503
Loading
Loading
Loading
Loading
+19 −52
Original line number Diff line number Diff line
@@ -62,11 +62,6 @@ FixQEqReaxKokkos<DeviceType>::FixQEqReaxKokkos(LAMMPS *lmp, int narg, char **arg

  nmax = nmax = m_cap = 0;
  allocated_flag = 0;

  reaxc = (PairReaxC *) force->pair_match("reax/c/kk",1);
  use_pair_list = 0;
  if (reaxc->execution_space == this->execution_space)
    use_pair_list = 1;
}

/* ---------------------------------------------------------------------- */
@@ -85,35 +80,11 @@ void FixQEqReaxKokkos<DeviceType>::init()
  atomKK->k_q.modify<LMPHostType>();
  atomKK->k_q.sync<LMPDeviceType>();

  //FixQEqReax::init();
  {
    if (!atom->q_flag) error->all(FLERR,"Fix qeq/reax requires atom attribute q");

    ngroup = group->count(igroup);
    if (ngroup == 0) error->all(FLERR,"Fix qeq/reax group has no atoms");

    // need a half neighbor list w/ Newton off and ghost neighbors
    // built whenever re-neighboring occurs

    if (!use_pair_list) {
      int irequest = neighbor->request(this,instance_me);
      neighbor->requests[irequest]->pair = 0;
      neighbor->requests[irequest]->fix = 1;
      neighbor->requests[irequest]->newton = 2;
      neighbor->requests[irequest]->ghost = 1;
    }
    
    init_shielding();
    init_taper();
    
    if (strstr(update->integrate_style,"respa"))
      nlevels_respa = ((Respa *) update->integrate)->nlevels;
  }
  FixQEqReax::init();

  neighflag = lmp->kokkos->neighflag;

  if (!use_pair_list) {
  int irequest = neighbor->nrequest - 1;
  
  neighbor->requests[irequest]->
    kokkos_host = Kokkos::Impl::is_same<DeviceType,LMPHostType>::value &&
    !Kokkos::Impl::is_same<DeviceType,LMPDeviceType>::value;
@@ -131,7 +102,6 @@ void FixQEqReaxKokkos<DeviceType>::init()
    neighbor->requests[irequest]->half = 1;
    neighbor->requests[irequest]->ghost = 1;
  }
  }

  int ntypes = atom->ntypes;
  k_params = Kokkos::DualView<params_qeq*,Kokkos::LayoutRight,DeviceType>
@@ -149,7 +119,6 @@ void FixQEqReaxKokkos<DeviceType>::init()

  init_shielding_k();
  init_hist();

}

/* ---------------------------------------------------------------------- */
@@ -241,8 +210,6 @@ void FixQEqReaxKokkos<DeviceType>::pre_force(int vflag)
  k_shield.template sync<DeviceType>();
  k_tap.template sync<DeviceType>();

  if (use_pair_list)
    list = reaxc->list;
  NeighListKokkos<DeviceType>* k_list = static_cast<NeighListKokkos<DeviceType>*>(list);
  d_numneigh = k_list->d_numneigh;
  d_neighbors = k_list->d_neighbors;
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ class FixQEqReaxKokkos : public FixQEqReax {
  double memory_usage();

 protected:
  int inum,use_pair_list;
  int inum;
  int allocated_flag;

  typedef Kokkos::DualView<int***,DeviceType> tdual_int_1d;