Commit 18e55843 authored by sjplimp's avatar sjplimp Committed by GitHub
Browse files

Merge pull request #354 from stanmoore1/kokkos_bugfixes

Kokkos bugfixes
parents 851f8046 26c8d3d9
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