Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpi: barrier wrapper #59

Merged
merged 2 commits into from
May 17, 2024
Merged
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
11 changes: 9 additions & 2 deletions src/impl/KokkosComm_barrier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@
#include "KokkosComm_types.hpp"

namespace KokkosComm::Impl {
template <KokkosExecutionSpace ExecSpace>
void barrier(const ExecSpace &space, MPI_Comm comm) {

void barrier(MPI_Comm comm) {
Kokkos::Tools::pushRegion("KokkosComm::Impl::barrier");
MPI_Barrier(comm);
Kokkos::Tools::popRegion();
}

// a barrier in the provided space. For MPI, we have to fence the space and do a host barrier
template <KokkosExecutionSpace ExecSpace>
void barrier(const ExecSpace &space, MPI_Comm comm) {
space.fence("KokkosComm::Impl::barrier");
barrier(comm);
}
} // namespace KokkosComm::Impl