Commit 56c21271 authored by Stan Moore's avatar Stan Moore
Browse files

Merge branch 'granular-kokkos' of github.com:valleymouth/lammps into granular-kokkos

parents b5816f26 0d1e55c9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
{
  if (narg < 6) error->all(FLERR,"Illegal fix pour command");

  if (lmp->kokkos) error->all(FLERR,"Cannot yet use fix pour with the KOKKOS package");

  time_depend = 1;

  if (!atom->radius_flag || !atom->rmass_flag)
+4 −0
Original line number Diff line number Diff line
@@ -89,6 +89,10 @@ Self-explanatory. Check the input script syntax and compare to the
documentation for the command.  You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.

E: Cannot yet use fix pour with the KOKKOS package

This feature is not yet supported.

E: Fix pour requires atom attributes radius, rmass

The atom style defined does not have these attributes.
+10 −10
Original line number Diff line number Diff line
@@ -549,7 +549,6 @@ void AtomVecSphereKokkos::unpack_comm_kokkos(
    return;
  }
  if(commKK->forward_comm_on_host) {
    sync(Host,X_MASK|RADIUS_MASK|RMASS_MASK);
    modified(Host,X_MASK|RADIUS_MASK|RMASS_MASK);
    struct AtomVecSphereKokkos_UnpackComm<LMPHostType> f(
      atomKK->k_x,
@@ -557,7 +556,6 @@ void AtomVecSphereKokkos::unpack_comm_kokkos(
      buf,first);
    Kokkos::parallel_for(n,f);
  } else {
    sync(Device,X_MASK|RADIUS_MASK|RMASS_MASK);
    modified(Device,X_MASK|RADIUS_MASK|RMASS_MASK);
    struct AtomVecSphereKokkos_UnpackComm<LMPDeviceType> f(
      atomKK->k_x,
@@ -926,7 +924,6 @@ int AtomVecSphereKokkos::pack_reverse_hybrid(int n, int first, double *buf)
void AtomVecSphereKokkos::unpack_reverse(int n, int *list, double *buf)
{
  if(n > 0) {
    sync(Host,F_MASK|TORQUE_MASK);
    modified(Host,F_MASK|TORQUE_MASK);
  }

@@ -947,7 +944,6 @@ void AtomVecSphereKokkos::unpack_reverse(int n, int *list, double *buf)
int AtomVecSphereKokkos::unpack_reverse_hybrid(int n, int *list, double *buf)
{
  if(n > 0) {
    sync(Host,TORQUE_MASK);
    modified(Host,TORQUE_MASK);
  }

@@ -1276,11 +1272,7 @@ struct AtomVecSphereKokkos_UnpackBorder {

void AtomVecSphereKokkos::unpack_border_kokkos(const int &n, const int &first,
					       const DAT::tdual_xfloat_2d &buf,ExecutionSpace space) {
  modified(space,X_MASK|TAG_MASK|TYPE_MASK|MASK_MASK|
                 RADIUS_MASK|RMASS_MASK);
  while (first+n >= nmax) grow(0);
  modified(space,X_MASK|TAG_MASK|TYPE_MASK|MASK_MASK|
	         RADIUS_MASK|RMASS_MASK);
  if(space==Host) {
    struct AtomVecSphereKokkos_UnpackBorder<LMPHostType> f(buf.view<LMPHostType>(),
      h_x,h_tag,h_type,h_mask,
@@ -1294,6 +1286,9 @@ void AtomVecSphereKokkos::unpack_border_kokkos(const int &n, const int &first,
      first);
    Kokkos::parallel_for(n,f);
  }

  modified(space,X_MASK|TAG_MASK|TYPE_MASK|MASK_MASK|
	         RADIUS_MASK|RMASS_MASK);
}

/* ---------------------------------------------------------------------- */
@@ -1771,10 +1766,8 @@ void AtomVecSphereKokkos::create_atom(int itype, double *coord)
{
  int nlocal = atom->nlocal;
  if (nlocal == nmax) {
    atomKK->modified(Host,ALL_MASK);
    grow(0);
  }
  atomKK->modified(Host,ALL_MASK);

  h_tag[nlocal] = 0;
  h_type[nlocal] = itype;
@@ -1794,6 +1787,8 @@ void AtomVecSphereKokkos::create_atom(int itype, double *coord)
  h_omega(nlocal,1) = 0.0;
  h_omega(nlocal,2) = 0.0;

  atomKK->modified(Host,ALL_MASK);

  atom->nlocal++;
}

@@ -1839,6 +1834,8 @@ void AtomVecSphereKokkos::data_atom(double *coord, imageint imagetmp, char **val
  omega[nlocal][1] = 0.0;
  omega[nlocal][2] = 0.0;

  atomKK->modified(Host,ALL_MASK);

  atom->nlocal++;
}

@@ -1862,6 +1859,9 @@ int AtomVecSphereKokkos::data_atom_hybrid(int nlocal, char **values)
    rmass[nlocal] = 4.0*MY_PI/3.0 *
      radius[nlocal]*radius[nlocal]*radius[nlocal] * density;


  atomKK->modified(Host,RADIUS_MASK|RMASS_MASK);

  return 2;
}

+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;
Loading