ESyS-Particle  2.3.4
gettype.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.apache.org/licenses/LICENSE-2.0 //
10 // //
12 
13 #ifndef __GETTYPE_H
14 #define __GETTYPE_H
15 
16 //--- MPI ---
17 #include <mpi.h>
18 
19 //--- STL includes ---
20 #include <utility>
21 
22 #include <Foundation/triplet.h>
23 #include <Foundation/quadtuple.h>
24 #include <Foundation/quintuple.h>
25 
26 using std::pair;
27 
33 class SGetType
34 {
35  public:
36  template <typename T> MPI_Datatype operator()(const T &);
37 
38  template<typename T1,typename T2>
39  MPI_Datatype operator()(const pair<T1,T2>&);
40 
41  template<typename T1, typename T2, typename T3>
42  MPI_Datatype operator()(const esys::lsm::triplet<T1,T2,T3> &trip);
43 
44  template<typename T1, typename T2, typename T3, typename T4>
45  MPI_Datatype operator()(const esys::lsm::quadtuple<T1,T2,T3,T4> &quad);
46 
47  template<typename T1, typename T2, typename T3, typename T4, typename T5>
48  MPI_Datatype operator()(const esys::lsm::quintuple<T1,T2,T3,T4,T5> &quin);
49 };
50 
54 template<typename T1,typename T2>
55 struct tml_pair {
56  static MPI_Datatype type;
57  static bool initialized;
58 };
59 template<typename T1,typename T2> MPI_Datatype tml_pair<T1,T2>::type=MPI_DATATYPE_NULL;
60 template<typename T1,typename T2> bool tml_pair<T1,T2>::initialized=false;
61 
65 template<typename T1, typename T2, typename T3>
66 struct tml_trip {
67  static MPI_Datatype type;
68  static bool initialized;
69 };
70 template<typename T1, typename T2, typename T3> MPI_Datatype tml_trip<T1,T2,T3>::type=MPI_DATATYPE_NULL;
71 template<typename T1, typename T2, typename T3> bool tml_trip<T1,T2,T3>::initialized=false;
72 
76 template<typename T1, typename T2, typename T3, typename T4>
77 struct tml_quad {
78  static MPI_Datatype type;
79  static bool initialized;
80 };
81 template<typename T1, typename T2, typename T3, typename T4> MPI_Datatype tml_quad<T1,T2,T3,T4>::type=MPI_DATATYPE_NULL;
82 template<typename T1, typename T2, typename T3, typename T4> bool tml_quad<T1,T2,T3,T4>::initialized=false;
83 
87 template<typename T1, typename T2, typename T3, typename T4, typename T5>
88 struct tml_quin {
89  static MPI_Datatype type;
90  static bool initialized;
91 };
92 template<typename T1, typename T2, typename T3, typename T4, typename T5> MPI_Datatype tml_quin<T1,T2,T3,T4,T5>::type=MPI_DATATYPE_NULL;
93 template<typename T1, typename T2, typename T3, typename T4, typename T5> bool tml_quin<T1,T2,T3,T4,T5>::initialized=false;
94 
96 
97 #include "tml/type/gettype.hpp"
98 
99 #endif //__GETTYPE_H
tml_pair::type
static MPI_Datatype type
Definition: gettype.h:56
SGetType::operator()
MPI_Datatype operator()(const T &)
tml_pair
Definition: gettype.h:55
tml_quad::type
static MPI_Datatype type
Definition: gettype.h:78
SGetType
static function object to extract MPI type from data in a consistent way
Definition: gettype.h:34
tml_trip
Definition: gettype.h:66
GetType
static SGetType GetType
Definition: gettype.h:95
gettype.hpp
quintuple.h
tml_quin::initialized
static bool initialized
Definition: gettype.h:90
tml_trip::initialized
static bool initialized
Definition: gettype.h:68
esys::lsm::triplet
Definition: triplet.h:24
tml_trip::type
static MPI_Datatype type
Definition: gettype.h:67
tml_quin
Definition: gettype.h:88
esys::lsm::quadtuple
Definition: quadtuple.h:25
tml_quad::initialized
static bool initialized
Definition: gettype.h:79
quadtuple.h
tml_pair::initialized
static bool initialized
Definition: gettype.h:57
triplet.h
tml_quad
Definition: gettype.h:77
tml_quin::type
static MPI_Datatype type
Definition: gettype.h:89
gettype.h
esys::lsm::quintuple
Definition: quintuple.h:25