OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
MPI_IAllGather.hpp
1/*
2 * MPI_AllGather.hpp
3 *
4 * Created on: Oct 26, 2015
5 * Author: i-bird
6 */
7
8#ifndef OPENFPM_VCLUSTER_SRC_MPI_WRAPPER_MPI_IALLGATHER_HPP_
9#define OPENFPM_VCLUSTER_SRC_MPI_WRAPPER_MPI_IALLGATHER_HPP_
10
11
29{
30public:
31 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
32 {
33 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_BYTE, rbuf, sz_r, MPI_BYTE, MPI_COMM_WORLD,&req));
34 }
35};
36
43template<typename T> class MPI_IAllGatherW
44{
45public:
46
47 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
48 {
49 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sizeof(T) * sz_s,MPI_BYTE, rbuf, sz_r * sizeof(T), MPI_BYTE, MPI_COMM_WORLD,&req));
50 }
51};
52
53
57template<> class MPI_IAllGatherW<int>
58{
59public:
60 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
61 {
62 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_INT, rbuf, sz_r, MPI_INT, MPI_COMM_WORLD,&req));
63 }
64};
65
69template<> class MPI_IAllGatherW<unsigned int>
70{
71public:
72 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
73 {
74 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_UNSIGNED, rbuf, sz_r, MPI_UNSIGNED, MPI_COMM_WORLD,&req));
75 }
76};
77
81template<> class MPI_IAllGatherW<short>
82{
83public:
84 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
85 {
86 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_SHORT, rbuf, sz_r, MPI_SHORT, MPI_COMM_WORLD,&req));
87 }
88};
89
90
94template<> class MPI_IAllGatherW<unsigned short>
95{
96public:
97 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
98 {
99 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_UNSIGNED_SHORT, rbuf, sz_r, MPI_UNSIGNED_SHORT, MPI_COMM_WORLD,&req));
100 }
101};
102
103
107template<> class MPI_IAllGatherW<char>
108{
109public:
110 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
111 {
112 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_CHAR, rbuf, sz_r, MPI_CHAR, MPI_COMM_WORLD,&req));
113 }
114};
115
116
120template<> class MPI_IAllGatherW<unsigned char>
121{
122public:
123 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
124 {
125 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_UNSIGNED_CHAR, rbuf, sz_r, MPI_UNSIGNED_CHAR, MPI_COMM_WORLD,&req));
126 }
127};
128
132template<> class MPI_IAllGatherW<size_t>
133{
134public:
135 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
136 {
137 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_UNSIGNED_LONG, rbuf, sz_r, MPI_UNSIGNED_LONG, MPI_COMM_WORLD,&req));
138 }
139};
140
144template<> class MPI_IAllGatherW<long int>
145{
146public:
147 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
148 {
149 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_LONG, rbuf, sz_r, MPI_LONG, MPI_COMM_WORLD,&req));
150 }
151};
152
156template<> class MPI_IAllGatherW<float>
157{
158public:
159 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
160 {
161 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_FLOAT, rbuf, sz_r, MPI_FLOAT, MPI_COMM_WORLD,&req));
162 }
163};
164
168template<> class MPI_IAllGatherW<double>
169{
170public:
171 static inline void gather(void * sbuf, size_t sz_s ,void * rbuf, size_t sz_r, MPI_Request & req)
172 {
173 MPI_SAFE_CALL(MPI_Iallgather(sbuf,sz_s,MPI_DOUBLE, rbuf, sz_r, MPI_DOUBLE, MPI_COMM_WORLD,&req));
174 }
175};
176
177
178#endif /* OPENFPM_VCLUSTER_SRC_MPI_WRAPPER_MPI_IALLGATHER_HPP_ */
Set of wrapping classing for MPI_Irecv.
General recv for vector of.