32 #ifndef Foam_UPstreamMPI_H 33 #define Foam_UPstreamMPI_H 38 #ifndef MPICH_SKIP_MPICXX 39 #define MPICH_SKIP_MPICXX 41 #ifndef OMPI_SKIP_MPICXX 42 #define OMPI_SKIP_MPICXX 50 namespace PstreamUtils
57 template<
typename Type = MPI_Comm>
60 if constexpr (std::is_pointer_v<Type>)
62 return reinterpret_cast<Type
>(arg.
value());
66 return static_cast<Type
>(arg.
value());
71 template<
typename Type = MPI_Request>
74 if constexpr (std::is_pointer_v<Type>)
76 return reinterpret_cast<Type
>(arg.
value());
80 return static_cast<Type
>(arg.
value());
85 template<
typename Type = MPI_Win>
88 if constexpr (std::is_pointer_v<Type>)
90 return reinterpret_cast<Type
>(arg.
value());
94 return static_cast<Type
>(arg.
value());
An opaque wrapper for MPI_Comm with a vendor-independent representation without any <mpi...
An opaque wrapper for MPI_Win with a vendor-independent representation and without any <mpi...
static Type to_mpi(UPstream::Communicator arg) noexcept
Cast UPstream::Communicator to MPI_Comm.
static Type to_mpi(UPstream::Window arg) noexcept
Cast UPstream::Window to MPI_Win.
An opaque wrapper for MPI_Request with a vendor-independent representation without any <mpi...
value_type value() const noexcept
Return raw value.