Commit 01d0a5c4 authored by Tim Mattox's avatar Tim Mattox
Browse files

BUGFIX: use Kokkos::atomic_fetch_max() to avoid a race on new_maxneighs

parent 5c6e7b12
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -422,10 +422,10 @@ void NeighborKokkosExecute<DeviceType>::

  neigh_list.d_numneigh(i) = n;

  if(n >= neigh_list.maxneighs) {
  if(n > neigh_list.maxneighs) {
    resize() = 1;

    if(n >= new_maxneighs()) new_maxneighs() = n;
    if(n > new_maxneighs()) Kokkos::atomic_fetch_max(&new_maxneighs(),n);
  }

  neigh_list.d_ilist(i) = i;
@@ -632,10 +632,10 @@ void NeighborKokkosExecute<DeviceType>::build_ItemCuda(typename Kokkos::TeamPoli
    neigh_list.d_ilist(i) = i;
  }

  if(n >= neigh_list.maxneighs) {
  if(n > neigh_list.maxneighs) {
    resize() = 1;

    if(n >= new_maxneighs()) new_maxneighs() = n;
    if(n > new_maxneighs()) Kokkos::atomic_fetch_max(&new_maxneighs(),n);
  }
  }
}
@@ -755,10 +755,10 @@ void NeighborKokkosExecute<DeviceType>::

  neigh_list.d_numneigh(i) = n;

  if(n >= neigh_list.maxneighs) {
  if(n > neigh_list.maxneighs) {
    resize() = 1;

    if(n >= new_maxneighs()) new_maxneighs() = n;
    if(n > new_maxneighs()) Kokkos::atomic_fetch_max(&new_maxneighs(),n);
  }
  neigh_list.d_ilist(i) = i;
}