Skip to content
Open
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
38 changes: 24 additions & 14 deletions src/framework/domain/metadomain_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,22 +284,44 @@ 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<real_t>(),
rank_recv,
0,
MPI_COMM_WORLD);
} else if (static_cast<unsigned int>(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<real_t>(),
rank_recv,
0,
MPI_COMM_WORLD);
#endif
} else if (local_domain->mpi_rank() == rank_recv) {
array_t<real_t*> aphi_r { "Aphi_r", nx1 };
#if !defined(DEVICE_ENABLED) || defined(GPU_AWARE_MPI)
MPI_Recv(aphi_r.data(),
nx1,
mpi::get_type<real_t>(),
rank_send,
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<real_t>(),
rank_send,
0,
MPI_COMM_WORLD,
MPI_STATUS_IGNORE);
Kokkos::deep_copy(aphi_r, aphi_r_h);
#endif
ExtractVectorPotential<S, M>(buffer, aphi_r, buff_idx, local_domain->mesh);
}
}
Expand Down Expand Up @@ -482,18 +504,6 @@ namespace ntt {
{},
local_domain->fields.bckp,
c);
} else if (fld.id() == FldsID::V) {
if constexpr (S != SimEngine::GRPIC) {
ComputeMoments<S, M, FldsID::V>(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);
}
Expand Down
Loading