Skip to content

Commit 3e18c88

Browse files
authored
openmpi: prefer MPI_CXX_COMPLEX and MPI_CXX_DOUBLE_COMPLEX (#185)
1 parent 587dc7d commit 3e18c88

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/KokkosComm/mpi/impl/types.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,17 @@ MPI_Datatype mpi_type() {
8282
return MPI_LONG_DOUBLE;
8383

8484
else if constexpr (std::is_same_v<T, Kokkos::complex<float>>)
85+
#if defined(KOKKOSCOMM_IMPL_MPI_IS_OPENMPI)
86+
return MPI_CXX_COMPLEX;
87+
#else
8588
return MPI_COMPLEX;
89+
#endif
8690
else if constexpr (std::is_same_v<T, Kokkos::complex<double>>)
91+
#if defined(KOKKOSCOMM_IMPL_MPI_IS_OPENMPI)
92+
return MPI_CXX_DOUBLE_COMPLEX;
93+
#else
8794
return MPI_DOUBLE_COMPLEX;
88-
95+
#endif
8996
else {
9097
static_assert(std::is_void_v<T>, "mpi_type not implemented");
9198
return MPI_CHAR; // unreachable

0 commit comments

Comments
 (0)