Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/framework/containers/particles_comm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ namespace ntt {
npart_t nsend,
npart_t nrecv,
npart_t offset) {
#if defined(DEVICE_ENABLED)
// guard for Intel GPUs.
// Should be a null-operation for other architectures.
Kokkos::fence();
#endif
#if !defined(DEVICE_ENABLED) || defined(GPU_AWARE_MPI)
MPI_Sendrecv(send_arr.data(),
nsend,
Expand Down Expand Up @@ -98,6 +103,11 @@ namespace ntt {

template <typename T>
void send(array_t<T*>& send_arr, int send_rank, npart_t nsend) {
#if defined(DEVICE_ENABLED)
// guard for Intel GPUs.
// Should be a null-operation for other architectures.
Kokkos::fence();
#endif
#if !defined(DEVICE_ENABLED) || defined(GPU_AWARE_MPI)
MPI_Send(send_arr.data(), nsend, mpi::get_type<T>(), send_rank, 0, MPI_COMM_WORLD);
#else
Expand All @@ -109,6 +119,11 @@ namespace ntt {

template <typename T>
void recv(array_t<T*>& recv_arr, int recv_rank, npart_t nrecv, npart_t offset) {
#if defined(DEVICE_ENABLED)
// guard for Intel GPUs.
// Should be a null-operation for other architectures.
Kokkos::fence();
#endif
#if !defined(DEVICE_ENABLED) || defined(GPU_AWARE_MPI)
MPI_Recv(recv_arr.data() + offset,
nrecv,
Expand Down
15 changes: 15 additions & 0 deletions src/framework/domain/comm_mpi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ namespace comm {
int recv_rank,
ncells_t nsend,
ncells_t nrecv) {
#if defined(DEVICE_ENABLED)
// guard for Intel GPUs.
// Should be a null-operation for other architectures.
Kokkos::fence();
#endif
#if !defined(DEVICE_ENABLED) || defined(GPU_AWARE_MPI)
MPI_Sendrecv(send_arr.data(),
nsend,
Expand Down Expand Up @@ -68,6 +73,11 @@ namespace comm {

template <unsigned short D>
void send(ndarray_t<D>& send_arr, int send_rank, ncells_t nsend) {
#if defined(DEVICE_ENABLED)
// guard for Intel GPUs.
// Should be a null-operation for other architectures.
Kokkos::fence();
#endif
#if !defined(DEVICE_ENABLED) || defined(GPU_AWARE_MPI)
MPI_Send(send_arr.data(), nsend, mpi::get_type<real_t>(), send_rank, 0, MPI_COMM_WORLD);
#else
Expand All @@ -84,6 +94,11 @@ namespace comm {

template <unsigned short D>
void recv(ndarray_t<D>& recv_arr, int recv_rank, ncells_t nrecv) {
#if defined(DEVICE_ENABLED)
// guard for Intel GPUs.
// Should be a null-operation for other architectures.
Kokkos::fence();
#endif
#if !defined(DEVICE_ENABLED) || defined(GPU_AWARE_MPI)
MPI_Recv(recv_arr.data(),
nrecv,
Expand Down
13 changes: 0 additions & 13 deletions src/framework/domain/metadomain_comm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,19 +349,6 @@ namespace ntt {
false);
}
} else {
if (comm_em) {
comm::CommunicateField<M::Dim, 6>(domain.index(),
domain.fields.em,
domain.fields.em,
send_ind,
recv_ind,
send_rank,
recv_rank,
send_slice,
recv_slice,
comp_range_fld,
false);
}
if (comm_j) {
comm::CommunicateField<M::Dim, 3>(domain.index(),
domain.fields.cur,
Expand Down
Loading