Commit 5d3e441e authored by sjplimp's avatar sjplimp
Browse files

sync with latest GHub bug fixes

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@16051 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 43e2d244
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -402,7 +402,6 @@ void DomainKokkos::pbc()
void DomainKokkos::remap_all()
{
  atomKK->sync(Device,X_MASK | IMAGE_MASK);
  atomKK->modified(Device,X_MASK | IMAGE_MASK);

  x = atomKK->k_x.view<LMPDeviceType>();
  image = atomKK->k_image.view<LMPDeviceType>();
@@ -428,6 +427,8 @@ void DomainKokkos::remap_all()
  LMPDeviceType::fence();
  copymode = 0;

  atomKK->modified(Device,X_MASK | IMAGE_MASK);

  if (triclinic) lamda2x(nlocal);
}

@@ -521,7 +522,6 @@ void DomainKokkos::image_flip(int m_in, int n_in, int p_in)
  p_flip = p_in;

  atomKK->sync(Device,IMAGE_MASK);
  atomKK->modified(Device,IMAGE_MASK);

  image = atomKK->k_image.view<LMPDeviceType>();
  int nlocal = atomKK->nlocal;
@@ -530,6 +530,8 @@ void DomainKokkos::image_flip(int m_in, int n_in, int p_in)
  Kokkos::parallel_for(Kokkos::RangePolicy<LMPDeviceType, TagDomain_image_flip>(0,nlocal),*this);
  LMPDeviceType::fence();
  copymode = 0;

  atomKK->modified(Device,IMAGE_MASK);
}

KOKKOS_INLINE_FUNCTION
@@ -554,7 +556,6 @@ void DomainKokkos::operator()(TagDomain_image_flip, const int &i) const {
void DomainKokkos::lamda2x(int n)
{
  atomKK->sync(Device,X_MASK);
  atomKK->modified(Device,X_MASK);

  x = atomKK->k_x.view<LMPDeviceType>();

@@ -562,6 +563,8 @@ void DomainKokkos::lamda2x(int n)
  Kokkos::parallel_for(Kokkos::RangePolicy<LMPDeviceType, TagDomain_lamda2x>(0,n),*this);
  LMPDeviceType::fence();
  copymode = 0;

  atomKK->modified(Device,X_MASK);
}

KOKKOS_INLINE_FUNCTION
@@ -579,7 +582,6 @@ void DomainKokkos::operator()(TagDomain_lamda2x, const int &i) const {
void DomainKokkos::x2lamda(int n)
{
  atomKK->sync(Device,X_MASK);
  atomKK->modified(Device,X_MASK);

  x = atomKK->k_x.view<LMPDeviceType>();

@@ -587,6 +589,8 @@ void DomainKokkos::x2lamda(int n)
  Kokkos::parallel_for(Kokkos::RangePolicy<LMPDeviceType, TagDomain_x2lamda>(0,n),*this);
  LMPDeviceType::fence();
  copymode = 0;

  atomKK->modified(Device,X_MASK);
}

KOKKOS_INLINE_FUNCTION
+6 −3
Original line number Diff line number Diff line
@@ -177,11 +177,12 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)

  // account for bias velocity
  if(tbiasflag == BIAS){
    atomKK->sync(temperature->execution_space,temperature->datamask_read);
    temperature->compute_scalar();
    temperature->remove_bias_all(); // modifies velocities
    // if temeprature compute is kokkosized host-devcie comm won't be needed
    atomKK->modified(Host,V_MASK);
    atomKK->sync(execution_space,V_MASK);
    atomKK->modified(temperature->execution_space,temperature->datamask_modify);
    atomKK->sync(execution_space,temperature->datamask_modify);
  }

  // compute langevin force in parallel on the device
@@ -508,8 +509,10 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
  DeviceType::fence();

  if(tbiasflag == BIAS){
    atomKK->sync(temperature->execution_space,temperature->datamask_read);
    temperature->restore_bias_all(); // modifies velocities
    atomKK->modified(Host,V_MASK);
    atomKK->modified(temperature->execution_space,temperature->datamask_modify);
    atomKK->sync(execution_space,temperature->datamask_modify);
  }

  // set modify flags for the views modified in post_force functor
+3 −4
Original line number Diff line number Diff line
@@ -42,12 +42,11 @@ namespace MathSpecialKokkos {
  {
    x *= x;
    x *= 1.4426950408889634074; // log_2(e)
#if defined(__BYTE_ORDER__)
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#if defined(__BYTE_ORDER__) &&  __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
    return (x < 1023.0) ? exp2_x86(-x) : 0.0;
#endif
#endif
#else
    return (x < 1023.0) ? exp2(-x) : 0.0;
#endif
  }

  // x**2, use instead of pow(x,2.0)
+3 −3
Original line number Diff line number Diff line
@@ -147,9 +147,9 @@ void NeighborKokkos::init_ex_mol_bit_kokkos()
int NeighborKokkos::check_distance()
{
  if (device_flag)
    check_distance_kokkos<LMPDeviceType>();
    return check_distance_kokkos<LMPDeviceType>();
  else
    check_distance_kokkos<LMPHostType>();
    return check_distance_kokkos<LMPHostType>();
}

template<class DeviceType>
@@ -157,7 +157,7 @@ int NeighborKokkos::check_distance_kokkos()
{
  typedef DeviceType device_type;

  double delx,dely,delz,rsq;
  double delx,dely,delz;
  double delta,delta1,delta2;

  if (boxcheck) {
+2 −0
Original line number Diff line number Diff line
@@ -44,7 +44,9 @@ class PairBuckCoulCutKokkos : public PairBuckCoulCut {
  double init_one(int, int);

  struct params_buck_coul{
    KOKKOS_INLINE_FUNCTION
    params_buck_coul(){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
    KOKKOS_INLINE_FUNCTION
    params_buck_coul(int i){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
    F_FLOAT cut_ljsq,cut_coulsq,a,c,rhoinv,buck1,buck2,offset;
  };
Loading