Skip to content
Snippets Groups Projects
Commit 90a1b2a0 authored by Berenger Bramas's avatar Berenger Bramas
Browse files

Add all native mpi data type to type selector

parent a310a3bb
No related branches found
No related tags found
2 merge requests!21Bugfix/nansampling,!11Feature/longlong particles
...@@ -36,11 +36,18 @@ namespace particles_utils { ...@@ -36,11 +36,18 @@ namespace particles_utils {
class GetMpiType{ class GetMpiType{
const MPI_Datatype type; const MPI_Datatype type;
public: public:
explicit GetMpiType(const long long int&) : type(MPI_LONG_LONG_INT){}
explicit GetMpiType(const unsigned char&) : type(MPI_UNSIGNED_CHAR){}
explicit GetMpiType(const unsigned short&) : type(MPI_UNSIGNED_SHORT){}
explicit GetMpiType(const unsigned int&) : type(MPI_UNSIGNED){}
explicit GetMpiType(const unsigned long&) : type(MPI_UNSIGNED_LONG){}
explicit GetMpiType(const char&) : type(MPI_CHAR){}
explicit GetMpiType(const short&) : type(MPI_SHORT){}
explicit GetMpiType(const int&) : type(MPI_INT){} explicit GetMpiType(const int&) : type(MPI_INT){}
explicit GetMpiType(const long&) : type(MPI_LONG){}
explicit GetMpiType(const long double&) : type(MPI_LONG_DOUBLE){}
explicit GetMpiType(const double&) : type(MPI_DOUBLE){} explicit GetMpiType(const double&) : type(MPI_DOUBLE){}
explicit GetMpiType(const float&) : type(MPI_FLOAT){} explicit GetMpiType(const float&) : type(MPI_FLOAT){}
explicit GetMpiType(const char&) : type(MPI_CHAR){}
explicit GetMpiType(const long&) : type(MPI_LONG){}
/*do not make it explicit*/ operator MPI_Datatype() const { return type; } /*do not make it explicit*/ operator MPI_Datatype() const { return type; }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment