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

Fix issues with rmass in KOKKOS package

parent 55980294
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
{
  // sync the device views which might have been modified on host
  atomKK->sync(execution_space,datamask_read);
  rmass = atomKK->rmass;
  rmass = atomKK->k_rmass.view<DeviceType>();
  f = atomKK->k_f.template view<DeviceType>();
  v = atomKK->k_v.template view<DeviceType>();
  type = atomKK->k_type.template view<DeviceType>();
@@ -191,7 +191,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
    if (gjfflag)
      if (tallyflag)
        if (tbiasflag == BIAS)
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,1,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -210,7 +210,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
              Kokkos::parallel_for(nlocal,post_functor);
            }
        else
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,0,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -230,7 +230,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
            }
      else
        if (tbiasflag == BIAS)
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,1,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -249,7 +249,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
              Kokkos::parallel_for(nlocal,post_functor);
            }
        else
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,0,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -270,7 +270,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
    else
      if (tallyflag)
        if (tbiasflag == BIAS)
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,1,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -289,7 +289,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
              Kokkos::parallel_for(nlocal,post_functor);
            }
        else
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,0,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -309,7 +309,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
            }
      else
        if (tbiasflag == BIAS)
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,1,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -328,7 +328,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
              Kokkos::parallel_for(nlocal,post_functor);
            }
        else
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,0,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -350,7 +350,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
    if (gjfflag)
      if (tallyflag)
        if (tbiasflag == BIAS)
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,1,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -369,7 +369,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
              Kokkos::parallel_for(nlocal,post_functor);
            }
        else
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,0,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -389,7 +389,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
            }
      else
        if (tbiasflag == BIAS)
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,1,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -408,7 +408,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
              Kokkos::parallel_for(nlocal,post_functor);
            }
        else
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,0,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -429,7 +429,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
    else
      if (tallyflag)
        if (tbiasflag == BIAS)
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,1,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -448,7 +448,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
              Kokkos::parallel_for(nlocal,post_functor);
            }
        else
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,0,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -468,7 +468,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
            }
      else
        if (tbiasflag == BIAS)
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,1,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@@ -487,7 +487,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
              Kokkos::parallel_for(nlocal,post_functor);
            }
        else
          if (rmass)
          if (rmass.data())
            if (zeroflag) {
              FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,0,1,1> post_functor(this);
              Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ namespace LAMMPS_NS {
  private:
    class CommKokkos *commKK;

    double *rmass;
    typename ArrayTypes<DeviceType>::t_float_1d rmass;
    typename ArrayTypes<DeviceType>::tdual_double_2d k_franprev;
    typename ArrayTypes<DeviceType>::t_double_2d d_franprev;
    HAT::t_double_2d h_franprev;
+2 −2
Original line number Diff line number Diff line
@@ -537,7 +537,7 @@ void FixNHKokkos<DeviceType>::nve_v()

  v = atomKK->k_v.view<DeviceType>();
  f = atomKK->k_f.view<DeviceType>();
  rmass = atomKK->rmass;
  rmass = atomKK->k_rmass.view<DeviceType>();
  mass = atomKK->k_mass.view<DeviceType>();
  type = atomKK->k_type.view<DeviceType>();
  mask = atomKK->k_mask.view<DeviceType>();
@@ -545,7 +545,7 @@ void FixNHKokkos<DeviceType>::nve_v()
  if (igroup == atomKK->firstgroup) nlocal = atomKK->nfirst;

  copymode = 1;
  if (rmass)
  if (rmass.data())
    Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagFixNH_nve_v<1> >(0,nlocal),*this);
  else
    Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagFixNH_nve_v<0> >(0,nlocal),*this);
+2 −2
Original line number Diff line number Diff line
@@ -71,8 +71,8 @@ class FixNHKokkos : public FixNH {
  typename ArrayTypes<DeviceType>::t_x_array x;
  typename ArrayTypes<DeviceType>::t_v_array v;
  typename ArrayTypes<DeviceType>::t_f_array_const f;
  double *rmass;
  typename ArrayTypes<DeviceType>::t_float_1d_randomread mass;
  typename ArrayTypes<DeviceType>::t_float_1d rmass;
  typename ArrayTypes<DeviceType>::t_float_1d mass;
  typename ArrayTypes<DeviceType>::t_int_1d type;
  typename ArrayTypes<DeviceType>::t_int_1d mask;
};
+4 −4
Original line number Diff line number Diff line
@@ -62,14 +62,14 @@ void FixNVEKokkos<DeviceType>::initial_integrate(int vflag)
  x = atomKK->k_x.view<DeviceType>();
  v = atomKK->k_v.view<DeviceType>();
  f = atomKK->k_f.view<DeviceType>();
  rmass = atomKK->rmass;
  rmass = atomKK->k_rmass.view<DeviceType>();
  mass = atomKK->k_mass.view<DeviceType>();
  type = atomKK->k_type.view<DeviceType>();
  mask = atomKK->k_mask.view<DeviceType>();
  int nlocal = atomKK->nlocal;
  if (igroup == atomKK->firstgroup) nlocal = atomKK->nfirst;

  if (rmass) {
  if (rmass.data()) {
    FixNVEKokkosInitialIntegrateFunctor<DeviceType,1> functor(this);
    Kokkos::parallel_for(nlocal,functor);
  } else {
@@ -118,14 +118,14 @@ void FixNVEKokkos<DeviceType>::final_integrate()

  v = atomKK->k_v.view<DeviceType>();
  f = atomKK->k_f.view<DeviceType>();
  rmass = atomKK->rmass;
  rmass = atomKK->k_rmass.view<DeviceType>();
  mass = atomKK->k_mass.view<DeviceType>();
  type = atomKK->k_type.view<DeviceType>();
  mask = atomKK->k_mask.view<DeviceType>();
  int nlocal = atomKK->nlocal;
  if (igroup == atomKK->firstgroup) nlocal = atomKK->nfirst;

  if (rmass) {
  if (rmass.data()) {
    FixNVEKokkosFinalIntegrateFunctor<DeviceType,1> functor(this);
    Kokkos::parallel_for(nlocal,functor);
  } else {
Loading