Simpatico  v1.10
MpiTraits.h
1 #ifdef UTIL_MPI
2 #ifndef UTIL_MPI_TRAITS_H
3 #define UTIL_MPI_TRAITS_H
4 
5 /*
6 * Util Package - C++ Utilities for Scientific Computation
7 *
8 * Copyright 2010 - 2017, The Regents of the University of Minnesota
9 * Distributed under the terms of the GNU General Public License.
10 */
11 
12 #include <util/global.h>
13 #include <complex>
14 
15 
16 namespace Util
17 {
18 
23  {
24  protected:
25  MpiTraitsNoType(){};
27  static const MPI::Datatype type;
28  static const bool hasType;
29  };
30 
38  template <typename T>
39  class MpiTraits : public MpiTraitsNoType
40  {
41  public:
44  };
45 
49  template <>
50  class MpiTraits<char>
51  {
52  public:
53  static const MPI::Datatype type;
54  static const bool hasType;
55  };
56 
60  template <>
61  class MpiTraits<unsigned char>
62  {
63  public:
64  static const MPI::Datatype type;
65  static const bool hasType;
66  };
67 
71  template <>
72  class MpiTraits<short>
73  {
74  public:
75  static const MPI::Datatype type;
76  static const bool hasType;
77  };
78 
82  template <>
83  class MpiTraits<int>
84  {
85  public:
86  static const MPI::Datatype type;
87  static const bool hasType;
88  };
89 
93  template <>
94  class MpiTraits<long>
95  {
96  public:
97  static const MPI::Datatype type;
98  static const bool hasType;
99  };
100 
104  template <>
105  class MpiTraits<unsigned short>
106  {
107  public:
108  static const MPI::Datatype type;
109  static const bool hasType;
110  };
111 
115  template <>
116  class MpiTraits<unsigned int>
117  {
118  public:
119  static const MPI::Datatype type;
120  static const bool hasType;
121  };
122 
126  template <>
127  class MpiTraits<unsigned long>
128  {
129  public:
130  static const MPI::Datatype type;
131  static const bool hasType;
132  };
133 
137  template <>
138  class MpiTraits<float>
139  {
140  public:
141  static const MPI::Datatype type;
142  static const bool hasType;
143  };
144 
148  template <>
149  class MpiTraits<double>
150  {
151  public:
152  static const MPI::Datatype type;
153  static const bool hasType;
154  };
155 
159  template <>
160  class MpiTraits<long double>
161  {
162  public:
163  static const MPI::Datatype type;
164  static const bool hasType;
165  };
166 
170  template <>
171  class MpiTraits<bool>
172  {
173  public:
174  static const MPI::Datatype type;
175  static const bool hasType;
176  };
177 
178  #if 0
179 
182  template <>
183  class MpiTraits< std::complex<float> >
184  {
185  public:
186  static const MPI::Datatype type;
187  static const bool hasType;
188  };
189 
193  template <>
194  class MpiTraits< std::complex<double> >
195  {
196  public:
197  static const MPI::Datatype type;
198  static const bool hasType;
199  };
200 
204  template <>
205  class MpiTraits< std::complex<long double> >
206  {
207  public:
208  static const MPI::Datatype type;
209  static const bool hasType;
210  };
211  #endif
212 
213  #if 0
214 
217  template <>
218  class MpiTraits<wchar_t>
219  {
220  public:
221  static const MPI::Datatype type;
222  static const bool hasType;
223  };
224  #endif
225 
226 }
227 #endif
228 #endif
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:97
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:152
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:141
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:86
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:174
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:87
static const MPI::Datatype type
MPI Datatype (dummy - unused)
Definition: MpiTraits.h:26
STL namespace.
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:153
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:164
File containing preprocessor macros for error handling.
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:64
Base class for MpiTraits with no type.
Definition: MpiTraits.h:22
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:175
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:142
Utility classes for scientific computation.
Definition: accumulators.mod:1
Default MpiTraits class.
Definition: MpiTraits.h:39
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:131
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:108
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:119
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:98
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:120
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:163
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:28
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:75
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:109
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:65
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:54
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:53
static const bool hasType
Is the MPI type initialized?
Definition: MpiTraits.h:76
static const MPI::Datatype type
MPI Datatype.
Definition: MpiTraits.h:130