Skip to content

Commit

Permalink
Use MPI_BYTE for unknown types
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Jun 11, 2024
1 parent fc25da1 commit 12c81d4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/impl/KokkosComm_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ template <typename Scalar>
MPI_Datatype mpi_type() {
using T = std::decay_t<Scalar>;

if constexpr (std::is_same_v<T, std::byte>)
return MPI_BYTE;

else if constexpr (std::is_same_v<T, char>)
if constexpr (std::is_same_v<T, char>)
return MPI_CHAR;
else if constexpr (std::is_same_v<T, unsigned char>)
return MPI_UNSIGNED_CHAR;
Expand Down Expand Up @@ -99,10 +96,8 @@ MPI_Datatype mpi_type() {
else if constexpr (std::is_same_v<T, Kokkos::complex<double>>)
return MPI_DOUBLE_COMPLEX;

else {
static_assert(std::is_void_v<T>, "mpi_type not implemented");
return MPI_CHAR; // unreachable
}
else
return MPI_BYTE;
}

template <typename Scalar>
Expand Down

0 comments on commit 12c81d4

Please sign in to comment.