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

Must use atomics for GPUs in pair_exp6_rx_kokkos

parent e55fa9d3
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
  lmp->kokkos = this;

  auto_sync = 1;
  gb_test = 1;

  int me = 0;
  MPI_Comm_rank(world,&me);
@@ -157,7 +156,6 @@ void KokkosLMP::accelerator(int narg, char **arg)
  neighflag = FULL;
  neighflag_qeq = FULL;
  neighflag_qeq_set = 0;
  gb_test = 1;
  int newtonflag = 0;
  double binsize = 0.0;
  exchange_comm_classic = forward_comm_classic = 0;
@@ -199,12 +197,6 @@ void KokkosLMP::accelerator(int narg, char **arg)
      else if (strcmp(arg[iarg+1],"on") == 0) newtonflag = 1;
      else error->all(FLERR,"Illegal package kokkos command");
      iarg += 2;
    } else if (strcmp(arg[iarg],"gb/test") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
      if (strcmp(arg[iarg+1],"off") == 0) gb_test = 0;
      else if (strcmp(arg[iarg+1],"on") == 0) gb_test = 1;
      else error->all(FLERR,"Illegal package kokkos command");
      iarg += 2;
    } else if (strcmp(arg[iarg],"comm") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
      if (strcmp(arg[iarg+1],"no") == 0) {
+0 −1
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ class KokkosLMP : protected Pointers {
  int num_threads,ngpu;
  int numa;
  int auto_sync;
  int gb_test;

  KokkosLMP(class LAMMPS *, int, char **);
  ~KokkosLMP();
+3 −3
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ void PairExp6rxKokkos<DeviceType>::compute(int eflag_in, int vflag_in)

  EV_FLOAT ev;

  if (!lmp->kokkos->gb_test) {
#ifdef KOKKOS_HAVE_CUDA  // Use atomics

  if (neighflag == HALF) {
    if (newton_pair) {
@@ -303,7 +303,7 @@ void PairExp6rxKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
    }
  }

  } else { // No atomics
#else // No atomics

  num_threads = lmp->kokkos->num_threads;
  int nmax = f.dimension_0();
@@ -343,7 +343,7 @@ void PairExp6rxKokkos<DeviceType>::compute(int eflag_in, int vflag_in)

  Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairExp6rxCollapseDupViews>(0,nmax),*this);

  }
#endif

  k_error_flag.template modify<DeviceType>();
  k_error_flag.template sync<LMPHostType>();