mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
MPI-type for std::array
This commit is contained in:
parent
24d79dbfdd
commit
63660682c2
@ -44,6 +44,21 @@ namespace ngcore
|
||||
static MPI_Datatype MPIType () { return MPI_C_BOOL; } };
|
||||
|
||||
|
||||
template<int S, typename T>
|
||||
struct MPI_typetrait<std::array<T,S>>
|
||||
{
|
||||
static MPI_Datatype MPIType ()
|
||||
{
|
||||
static MPI_Datatype MPI_T = 0;
|
||||
if (!MPI_T)
|
||||
{
|
||||
MPI_Type_contiguous ( S, MPI_typetrait<T>::MPIType(), &MPI_T);
|
||||
MPI_Type_commit ( &MPI_T );
|
||||
}
|
||||
return MPI_T;
|
||||
}
|
||||
};
|
||||
|
||||
template <class T, class T2 = decltype(MPI_typetrait<T>::MPIType())>
|
||||
inline MPI_Datatype GetMPIType () {
|
||||
return MPI_typetrait<T>::MPIType();
|
||||
|
Loading…
Reference in New Issue
Block a user