mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 21:40:33 +05:00
MPI-type for std::array
This commit is contained in:
parent
24d79dbfdd
commit
63660682c2
@ -43,6 +43,21 @@ namespace ngcore
|
||||
template <> struct MPI_typetrait<bool> {
|
||||
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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user