diff --git a/src/framework/domain/metadomain_io.cpp b/src/framework/domain/metadomain_io.cpp index b9f351a0..2fc8c7b8 100644 --- a/src/framework/domain/metadomain_io.cpp +++ b/src/framework/domain/metadomain_io.cpp @@ -284,15 +284,26 @@ namespace ntt { std::make_pair(N_GHOSTS, N_GHOSTS + nx1), N_GHOSTS + nx2 - 1, buff_idx)); +#if !defined(DEVICE_ENABLED) || defined(GPU_AWARE_MPI) MPI_Send(aphi_r.data(), nx1, mpi::get_type(), rank_recv, 0, MPI_COMM_WORLD); - } else if (static_cast(local_domain->mpi_rank()) == - rank_recv) { +#else + auto aphi_r_h = Kokkos::create_mirror_view(aphi_r); + Kokkos::deep_copy(aphi_r_h, aphi_r); + MPI_Send(aphi_r_h.data(), + nx1, + mpi::get_type(), + rank_recv, + 0, + MPI_COMM_WORLD); +#endif + } else if (local_domain->mpi_rank() == rank_recv) { array_t aphi_r { "Aphi_r", nx1 }; +#if !defined(DEVICE_ENABLED) || defined(GPU_AWARE_MPI) MPI_Recv(aphi_r.data(), nx1, mpi::get_type(), @@ -300,6 +311,17 @@ namespace ntt { 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); +#else + auto aphi_r_h = Kokkos::create_mirror_view(aphi_r); + MPI_Recv(aphi_r_h.data(), + nx1, + mpi::get_type(), + rank_send, + 0, + MPI_COMM_WORLD, + MPI_STATUS_IGNORE); + Kokkos::deep_copy(aphi_r, aphi_r_h); +#endif ExtractVectorPotential(buffer, aphi_r, buff_idx, local_domain->mesh); } } @@ -482,18 +504,6 @@ namespace ntt { {}, local_domain->fields.bckp, c); - } else if (fld.id() == FldsID::V) { - if constexpr (S != SimEngine::GRPIC) { - ComputeMoments(params, - local_domain->mesh, - local_domain->species, - fld.species, - fld.comp[0], - local_domain->fields.bckp, - c); - } else { - raise::Error("Bulk velocity not supported for GRPIC", HERE); - } } else { raise::Error("Wrong moment requested for output", HERE); }