Commit 85a14ebc authored by Stan Moore's avatar Stan Moore
Browse files

Fix issue with comm squash

parent 0a02097e
Loading
Loading
Loading
Loading
+2 −1
Changes for src/KOKKOS/atom_vec_kokkos.cpp: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -307,10 +307,11 @@ struct AtomVecKokkos_PackCommSelfSquash {
    int iswap = 0;
    while (ii >= _sendnum_scan[iswap]) iswap++;
    int i = ii;
    if (iswap > 1)
    if (iswap > 0)
      i = ii - _sendnum_scan[iswap-1];
    const int _nfirst = _firstrecv[iswap];


      const int j = _list(iswap,i);
      if (_pbc_flag(iswap) == 0) {
          _xw(i+_nfirst,0) = _x(j,0);
+8 −5
Changes for src/KOKKOS/comm_kokkos.cpp: 8 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -187,6 +187,13 @@ void CommKokkos::forward_comm_device(int dummy)
  k_sendlist.sync<DeviceType>();
  atomKK->sync(ExecutionSpaceFromDevice<DeviceType>::space,X_MASK);

  int comm_squash = 1;
  if (comm_squash) {
    n = avec->pack_comm_self_squash(totalsend,k_sendlist,k_sendnum_scan,
                    k_firstrecv,k_pbc_flag,k_pbc);
    DeviceType::fence();
  } else {

  for (int iswap = 0; iswap < nswap; iswap++) {
    if (sendproc[iswap] != me) {
      if (comm_x_only) {
@@ -242,15 +249,10 @@ void CommKokkos::forward_comm_device(int dummy)
      }
    } else {
      if (!ghost_velocity) {
        if (1) {
          n = avec->pack_comm_self_squash(totalsend,k_sendlist,k_sendnum_scan,
                          k_firstrecv,k_pbc_flag,k_pbc);
        } else {
        if (sendnum[iswap])
          n = avec->pack_comm_self(sendnum[iswap],k_sendlist,iswap,
                                   firstrecv[iswap],pbc_flag[iswap],pbc[iswap]);
        DeviceType::fence();
        }
      } else {
        n = avec->pack_comm_vel_kokkos(sendnum[iswap],k_sendlist,iswap,
                                       k_buf_send,pbc_flag[iswap],pbc[iswap]);
@@ -261,6 +263,7 @@ void CommKokkos::forward_comm_device(int dummy)
    }
  }
  }
}

/* ----------------------------------------------------------------------
   reverse communication of forces on atoms every timestep