WARPXM v1.10.0
Loading...
Searching...
No Matches
wxmpitraits.h
Go to the documentation of this file.
1#ifndef wxmpitraits_h
2#define wxmpitraits_h
3
4#include <mpi.h>
5
6#include "wxmsgbase.h"
7
15template<typename T> class WxMpiTraits;
16
17// bool: wrap around byte
18template<> class WxMpiTraits<bool>
19{
20public:
21 static MPI_Datatype mpiType()
22 {
23 return MPI_BYTE;
24 }
25};
26
27// char
28template<> class WxMpiTraits<char>
29{
30public:
31 static MPI_Datatype mpiType()
32 {
33 return MPI_CHAR;
34 }
35};
36// unsigned char
37template<> class WxMpiTraits<unsigned char>
38{
39public:
40 static MPI_Datatype mpiType()
41 {
42 return MPI_UNSIGNED_CHAR;
43 }
44};
45// short
46template<> class WxMpiTraits<short>
47{
48public:
49 static MPI_Datatype mpiType()
50 {
51 return MPI_SHORT;
52 }
53};
54// unsigned short
55template<> class WxMpiTraits<unsigned short>
56{
57public:
58 static MPI_Datatype mpiType()
59 {
60 return MPI_UNSIGNED_SHORT;
61 }
62};
63// int
64template<> class WxMpiTraits<int>
65{
66public:
67 static MPI_Datatype mpiType()
68 {
69 return MPI_INT;
70 }
71};
72// unsigned
73template<> class WxMpiTraits<unsigned>
74{
75public:
76 static MPI_Datatype mpiType()
77 {
78 return MPI_UNSIGNED;
79 }
80};
81// long
82template<> class WxMpiTraits<long>
83{
84public:
85 static MPI_Datatype mpiType()
86 {
87 return MPI_LONG;
88 }
89};
90// unsigned long
91template<> class WxMpiTraits<unsigned long>
92{
93public:
94 static MPI_Datatype mpiType()
95 {
96 return MPI_UNSIGNED_LONG;
97 }
98};
99// float
100template<> class WxMpiTraits<float>
101{
102public:
103 static MPI_Datatype mpiType()
104 {
105 return MPI_FLOAT;
106 }
107};
108// double
109template<> class WxMpiTraits<double>
110{
111public:
112 static MPI_Datatype mpiType()
113 {
114 return MPI_DOUBLE;
115 }
116};
117// long double
118template<> class WxMpiTraits<long double>
119{
120public:
121 static MPI_Datatype mpiType()
122 {
123 return MPI_LONG_DOUBLE;
124 }
125};
126// long long int
127template<> class WxMpiTraits<long long int>
128{
129public:
130 static MPI_Datatype mpiType()
131 {
132 return MPI_LONG_LONG_INT;
133 }
134};
136#endif // wxmpitraits_h
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:21
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:31
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:112
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:103
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:67
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:85
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:121
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:130
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:49
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:76
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:40
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:94
static MPI_Datatype mpiType()
Definition: wxmpitraits.h:58
Type traits for use in MPI messengers.
Definition: wxmpitraits.h:15