#ifndef HPC_MPI_VECTOR_H #define HPC_MPI_VECTOR_H 1 #include #include #include namespace hpc { namespace mpi { template typename Vector, Require>> = true> MPI_Datatype get_type(const Vector& vector) { MPI_Datatype datatype; MPI_Type_vector( /* count = */ vector.length(), /* blocklength = */ 1, /* stride = */ vector.inc(), /* element type = */ get_type(vector(0)), /* newly created type = */ &datatype); MPI_Type_commit(&datatype); return datatype; } } } // namespaces mpi, hpc #endif // HPC_MPI_VECTOR_H