OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
MPI_IrecvW.hpp
1 #ifndef MPI_IRECV_HPP
2 #define MPI_IRECV_HPP
3 
4 
5 #include <mpi.h>
6 
13 {
14 public:
15 
25  static inline void recv(size_t proc , size_t tag ,void * buf, size_t sz, MPI_Request & req)
26  {
27  MPI_SAFE_CALL(MPI_Irecv(buf,sz,MPI_BYTE, proc, tag , MPI_COMM_WORLD,&req));
28  }
29 };
30 
37 template<typename T> class MPI_IrecvW
38 {
39 public:
40  static inline void recv(size_t proc , size_t tag ,openfpm::vector<T> & v, MPI_Request & req)
41  {
42  MPI_SAFE_CALL(MPI_Irecv(v.getPointer(), v.size() * sizeof(T),MPI_BYTE, proc, tag , MPI_COMM_WORLD,&req));
43  }
44 };
45 
46 
50 template<> class MPI_IrecvW<int>
51 {
52 public:
53  static inline void recv(size_t proc , size_t tag ,openfpm::vector<int> & v, MPI_Request & req)
54  {
55  MPI_SAFE_CALL(MPI_Irecv(v.getPointer(), v.size(),MPI_INT, proc, tag , MPI_COMM_WORLD,&req));
56  }
57 };
58 
62 template<> class MPI_IrecvW<unsigned int>
63 {
64 public:
65  static inline void recv(size_t proc , size_t tag ,openfpm::vector<unsigned int> & v, MPI_Request & req)
66  {
67  MPI_SAFE_CALL(MPI_Irecv(v.getPointer(), v.size(),MPI_UNSIGNED, proc, tag , MPI_COMM_WORLD,&req));
68  }
69 };
70 
74 template<> class MPI_IrecvW<short>
75 {
76 public:
77  static inline void recv(size_t proc , size_t tag ,openfpm::vector<short> & v, MPI_Request & req)
78  {
79  MPI_SAFE_CALL(MPI_Irecv(v.getPointer(), v.size(),MPI_SHORT, proc, tag , MPI_COMM_WORLD,&req));
80  }
81 };
82 
86 template<> class MPI_IrecvW<unsigned short>
87 {
88 public:
89  static inline void recv(size_t proc , size_t tag ,openfpm::vector<unsigned short> & v, MPI_Request & req)
90  {
91  MPI_SAFE_CALL(MPI_Irecv(v.getPointer(), v.size(),MPI_UNSIGNED_SHORT, proc, tag , MPI_COMM_WORLD,&req));
92  }
93 };
94 
98 template<> class MPI_IrecvW<char>
99 {
100 public:
101  static inline void recv(size_t proc , size_t tag ,openfpm::vector<char> & v, MPI_Request & req)
102  {
103  MPI_SAFE_CALL(MPI_Irecv(v.getPointer(), v.size(),MPI_CHAR, proc, tag , MPI_COMM_WORLD,&req));
104  }
105 };
106 
110 template<> class MPI_IrecvW<unsigned char>
111 {
112 public:
113  static inline void recv(size_t proc , size_t tag ,openfpm::vector<unsigned char> & v, MPI_Request & req)
114  {
115  MPI_SAFE_CALL(MPI_Irecv(v.getPointer(), v.size(),MPI_UNSIGNED_CHAR, proc, tag , MPI_COMM_WORLD,&req));
116  }
117 };
118 
122 template<> class MPI_IrecvW<size_t>
123 {
124 public:
125  static inline void recv(size_t proc , size_t tag ,openfpm::vector<size_t> & v, MPI_Request & req)
126  {
127  MPI_SAFE_CALL(MPI_Irecv(v.getPointer(), v.size(),MPI_UNSIGNED_LONG, proc, tag , MPI_COMM_WORLD,&req));
128  }
129 };
130 
134 template<> class MPI_IrecvW<long int>
135 {
136 public:
137  static inline void recv(size_t proc , size_t tag ,openfpm::vector<long int> & v, MPI_Request & req)
138  {
139  MPI_SAFE_CALL(MPI_Irecv(v.getPointer(), v.size(),MPI_LONG, proc, tag , MPI_COMM_WORLD,&req));
140  }
141 };
142 
146 template<> class MPI_IrecvW<float>
147 {
148 public:
149  static inline void recv(size_t proc , size_t tag ,openfpm::vector<float> & v, MPI_Request & req)
150  {
151  MPI_SAFE_CALL(MPI_Irecv(v.getPointer(), v.size(),MPI_FLOAT, proc, tag , MPI_COMM_WORLD,&req));
152  }
153 };
154 
158 template<> class MPI_IrecvW<double>
159 {
160 public:
161  static inline void recv(size_t proc , size_t tag ,openfpm::vector<double> & v, MPI_Request & req)
162  {
163  MPI_SAFE_CALL(MPI_Irecv(v.getPointer(), v.size(),MPI_DOUBLE, proc, tag , MPI_COMM_WORLD,&req));
164  }
165 };
166 
167 #endif
168 
Set of wrapping classing for MPI_Irecv.
Definition: MPI_IrecvW.hpp:12
static void recv(size_t proc, size_t tag, void *buf, size_t sz, MPI_Request &req)
General recv for general buffer.
Definition: MPI_IrecvW.hpp:25
General recv for vector of.
Definition: MPI_IrecvW.hpp:37
KeyT const ValueT ValueT OffsetIteratorT OffsetIteratorT int
[in] The number of segments that comprise the sorting data