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 1bf03cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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,6 +96,9 @@ MPI_Datatype mpi_type() {
else if constexpr (std::is_same_v<T, Kokkos::complex<double>>)
return MPI_DOUBLE_COMPLEX;

else if constexpr (std::is_trivially_copyable_v<T>)
return MPI_BYTE;

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

0 comments on commit 1bf03cb

Please sign in to comment.