32 #ifndef Foam_UPstreamMPI_H 33 #define Foam_UPstreamMPI_H 39 #ifndef MPICH_SKIP_MPICXX 40 #define MPICH_SKIP_MPICXX 42 #ifndef OMPI_SKIP_MPICXX 43 #define OMPI_SKIP_MPICXX 51 namespace PstreamUtils
58 template<
typename Type = MPI_Comm>
61 if constexpr (std::is_pointer_v<Type>)
63 return reinterpret_cast<Type
>(arg.
value());
67 return static_cast<Type
>(arg.
value());
72 template<
typename Type = MPI_Request>
75 if constexpr (std::is_pointer_v<Type>)
77 return reinterpret_cast<Type
>(arg.
value());
81 return static_cast<Type
>(arg.
value());
86 template<
typename Type = MPI_Win>
89 if constexpr (std::is_pointer_v<Type>)
91 return reinterpret_cast<Type
>(arg.
value());
95 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.