DFT-EFE
 
Loading...
Searching...
No Matches
MPIWrapper.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2021. *
3 * The Regents of the University of Michigan and DFT-EFE developers. *
4 * *
5 * This file is part of the DFT-EFE code. *
6 * *
7 * DFT-EFE is free software: you can redistribute it and/or modify *
8 * it under the terms of the Lesser GNU General Public License as *
9 * published by the Free Software Foundation, either version 3 of *
10 * the License, or (at your option) any later version. *
11 * *
12 * DFT-EFE is distributed in the hope that it will be useful, but *
13 * WITHOUT ANY WARRANTY; without even the implied warranty *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
15 * See the Lesser GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License at the top level of DFT-EFE distribution. If not, see *
19 * <https://www.gnu.org/licenses/>. *
20 ******************************************************************************/
21
22/*
23 * @author Bikash Kanungo
24 */
25
26#ifndef dftefeMPIWrapper_h
27#define dftefeMPIWrapper_h
28
29#include <utils/MPITypes.h>
30#include <utils/TypeConfig.h>
32#include <string>
33#include <utility>
34namespace dftefe
35{
36 namespace utils
37 {
38 namespace mpi
39 {
40 int
41 MPITypeContiguous(int count, MPIDatatype oldtype, MPIDatatype *newtype);
42
43 template <MemorySpace memorySpace>
44 int
45 MPIAllreduce(const void *sendbuf,
46 void * recvbuf,
47 int count,
48 MPIDatatype datatype,
49 MPIOp op,
50 MPIComm comm);
51
52 template <MemorySpace memorySpace>
53 int
54 MPIAllgather(const void *sendbuf,
55 int sendcount,
56 MPIDatatype sendtype,
57 void * recvbuf,
58 int recvcount,
59 MPIDatatype recvtype,
60 MPIComm comm);
61
62 template <MemorySpace memorySpace>
63 int
64 MPIAllgatherv(const void *sendbuf,
65 int sendcount,
66 MPIDatatype sendtype,
67 void * recvbuf,
68 const int * recvcounts,
69 const int * displs,
70 MPIDatatype recvtype,
71 MPIComm comm);
72
73 int
74 MPIBarrier(MPIComm comm);
75 int
76 MPIIbarrier(MPIComm comm, MPIRequest *request);
77
78 template <MemorySpace memorySpace>
79 int
80 MPIBcast(void * buffer,
81 int count,
82 MPIDatatype datatype,
83 int root,
84 MPIComm comm);
85
86 int
88 MPIGroup group,
89 int tag,
90 MPIComm *newcomm);
91
92 int
93 MPICommFree(MPIComm *comm);
94 int
95 MPICommGroup(MPIComm comm, MPIGroup *group);
96 int
97 MPICommRank(MPIComm comm, int *rank);
98 int
99 MPICommSize(MPIComm comm, int *size);
100
101 int
102 MPIGroupFree(MPIGroup *group);
103
104 int
106 int n,
107 const int ranks[],
108 MPIGroup *newgroup);
109
110 int
112 int n,
113 const int ranks1[],
114 MPIGroup group2,
115 int ranks2[]);
116
117 int
118 MPIInit(int *argc, char ***argv);
119
120 int
121 MPIInitThread(int *argc, char ***argv, int required, int *provided);
122
123 int
124 MPIInitialized(int *flag);
125
126 int
127 MPIIprobe(int source,
128 int tag,
129 MPIComm comm,
130 int * flag,
131 MPIStatus *status);
132
133 int
134 MPITest(MPIRequest *request, int *flag, MPIStatus *status);
135 int
136 MPITestall(int count,
137 MPIRequest *requests,
138 int * flag,
139 MPIStatus * statuses);
140
141 template <MemorySpace memorySpace>
142 int
143 MPIIrecv(void * buf,
144 int count,
145 MPIDatatype datatype,
146 int source,
147 int tag,
148 MPIComm comm,
149 MPIRequest *request);
150
151 template <MemorySpace memorySpace>
152 int
153 MPIIsend(const void *buf,
154 int count,
155 MPIDatatype datatype,
156 int dest,
157 int tag,
158 MPIComm comm,
159 MPIRequest *request);
160
161 template <MemorySpace memorySpace>
162 int
163 MPIRecv(void * buf,
164 int count,
165 MPIDatatype datatype,
166 int source,
167 int tag,
168 MPIComm comm,
169 MPIStatus * status);
170
171 int
172 MPIOpCreate(MPIUserFunction *userfn, int commute, MPIOp *op);
173
174 int
175 MPIOpFree(MPIOp *op);
176
177 template <MemorySpace memorySpace>
178 int
179 MPIReduce(void * sendbuf,
180 void * recvbuf,
181 int count,
182 MPIDatatype datatype,
183 MPIOp op,
184 int root,
185 MPIComm comm);
186
187 int
188 MPIRequestFree(MPIRequest *request);
189
190 template <MemorySpace memorySpace>
191 int
192 MPISend(const void *buf,
193 int count,
194 MPIDatatype datatype,
195 int dest,
196 int tag,
197 MPIComm comm);
198
199 template <MemorySpace memorySpace>
200 int
201 MPISendrecv(const void *sendbuf,
202 int sendcount,
203 MPIDatatype sendtype,
204 int dest,
205 int sendtag,
206 void * recvbuf,
207 int recvcount,
208 MPIDatatype recvtype,
209 int source,
210 int recvtag,
211 MPIComm comm,
212 MPIStatus * status);
213
214 template <MemorySpace memorySpace>
215 int
216 MPIIssend(const void *buf,
217 int count,
218 MPIDatatype datatype,
219 int dest,
220 int tag,
221 MPIComm comm,
222 MPIRequest *request);
223
224 template <MemorySpace memorySpace>
225 int
226 MPISsend(const void *buf,
227 int count,
228 MPIDatatype datatype,
229 int dest,
230 int tag,
231 MPIComm comm);
232
233 int
234 MPITypeCommit(MPIDatatype *datatype);
235
236 int
237 MPITypeFree(MPIDatatype *datatype);
238
239 int
240 MPITypeVector(int count,
241 int blocklength,
242 int stride,
243 MPIDatatype oldtype,
244 MPIDatatype *newtype);
245
246 int
247 MPIWait(MPIRequest *request, MPIStatus *status);
248
249 int
250 MPIWaitall(int count, MPIRequest requests[], MPIStatus statuses[]);
251
252 int
253 MPIErrorString(int errorcode, char *string, int *resultlen);
254
255 int
256 MPIFinalize(void);
257
258 double
259 MPIWtime(void);
260
261 int
262 MPIFinalized(int *flag);
263
264 // template <typename T>
265 // MPIDatatype
266 // MPIGetDatatype();
267
268 bool
269 MPIErrIsSuccess(int errCode);
270
271 std::string
272 MPIErrMsg(int errCode);
273
274 std::pair<bool, std::string>
275 MPIErrIsSuccessAndMsg(int errCode);
276
277 } // end of namespace mpi
278 } // end of namespace utils
279} // end of namespace dftefe
280#include "MPIWrapper.t.cpp"
281#endif // dftefeMPIWrapper_h
int MPISendrecv(const void *sendbuf, int sendcount, MPIDatatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, MPIDatatype recvtype, int source, int recvtag, MPIComm comm, MPIStatus *status)
Definition: MPIWrapper.t.cpp:504
int MPIGroupTranslateRanks(MPIGroup group1, int n, const int ranks1[], MPIGroup group2, int ranks2[])
Definition: MPIWrapper.cpp:328
int MPIErrorString(int errorcode, char *string, int *resultlen)
Definition: MPIWrapper.cpp:464
int MPISsend(const void *buf, int count, MPIDatatype datatype, int dest, int tag, MPIComm comm)
Definition: MPIWrapper.t.cpp:541
int MPIRecv(void *buf, int count, MPIDatatype datatype, int source, int tag, MPIComm comm, MPIStatus *status)
Definition: MPIWrapper.t.cpp:454
int MPITypeContiguous(int count, MPIDatatype oldtype, MPIDatatype *newtype)
Definition: MPIWrapper.cpp:253
int MPIAllgatherv(const void *sendbuf, int sendcount, MPIDatatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, MPIDatatype recvtype, MPIComm comm)
Definition: MPIWrapper.t.cpp:406
int MPIFinalized(int *flag)
Definition: MPIWrapper.cpp:479
int MPITest(MPIRequest *request, int *flag, MPIStatus *status)
Definition: MPIWrapper.cpp:361
int MPITypeVector(int count, int blocklength, int stride, MPIDatatype oldtype, MPIDatatype *newtype)
Definition: MPIWrapper.cpp:433
int MPICommRank(MPIComm comm, int *rank)
Definition: MPIWrapper.cpp:296
int MPITypeCommit(MPIDatatype *datatype)
Definition: MPIWrapper.cpp:415
int MPIDatatype
Definition: MPITypes.h:82
int MPIAllreduce(const void *sendbuf, void *recvbuf, int count, MPIDatatype datatype, MPIOp op, MPIComm comm)
Definition: MPIWrapper.t.cpp:369
void(void *, void *, int *, MPIDatatype *) MPIUserFunction
Definition: MPITypes.h:89
int MPITestall(int count, MPIRequest *requests, int *flag, MPIStatus *statuses)
Definition: MPIWrapper.cpp:368
std::pair< bool, std::string > MPIErrIsSuccessAndMsg(int errCode)
Definition: MPIWrapper.cpp:506
int MPIComm
Definition: MPITypes.h:83
int MPIBcast(void *buffer, int count, MPIDatatype datatype, int root, MPIComm comm)
Definition: MPIWrapper.t.cpp:427
int MPIGroupFree(MPIGroup *group)
Definition: MPIWrapper.cpp:310
int MPIIsend(const void *buf, int count, MPIDatatype datatype, int dest, int tag, MPIComm comm, MPIRequest *request)
Definition: MPIWrapper.t.cpp:525
int MPIIprobe(int source, int tag, MPIComm comm, int *flag, MPIStatus *status)
Definition: MPIWrapper.cpp:354
int MPIStatus
Definition: MPITypes.h:85
int MPICommSize(MPIComm comm, int *size)
Definition: MPIWrapper.cpp:303
int MPIWait(MPIRequest *request, MPIStatus *status)
Definition: MPIWrapper.cpp:446
int MPICommGroup(MPIComm comm, MPIGroup *group)
Definition: MPIWrapper.cpp:290
int MPIFinalize(void)
Definition: MPIWrapper.cpp:473
int MPIGroupIncl(MPIGroup group, int n, const int ranks[], MPIGroup *newgroup)
Definition: MPIWrapper.cpp:319
int MPIWaitall(int count, MPIRequest requests[], MPIStatus statuses[])
Definition: MPIWrapper.cpp:455
int MPIInit(int *argc, char ***argv)
Definition: MPIWrapper.cpp:341
int MPIOp
Definition: MPITypes.h:87
bool MPIErrIsSuccess(int errCode)
Definition: MPIWrapper.cpp:492
int MPICommCreateGroup(MPIComm comm, MPIGroup group, int tag, MPIComm *newcomm)
Definition: MPIWrapper.cpp:275
int MPIInitThread(int *argc, char ***argv, int required, int *provided)
Definition: MPIWrapper.cpp:378
int MPIOpCreate(MPIUserFunction *user_fn, int commute, MPIOp *op)
Definition: MPIWrapper.cpp:386
int MPIGroup
Definition: MPITypes.h:86
int MPIAllgather(const void *sendbuf, int sendcount, MPIDatatype sendtype, void *recvbuf, int recvcount, MPIDatatype recvtype, MPIComm comm)
Definition: MPIWrapper.t.cpp:386
int MPIRequest
Definition: MPITypes.h:84
int MPITypeFree(MPIDatatype *datatype)
Definition: MPIWrapper.cpp:424
int MPISend(const void *buf, int count, MPIDatatype datatype, int dest, int tag, MPIComm comm)
Definition: MPIWrapper.t.cpp:489
int MPIInitialized(int *flag)
Definition: MPIWrapper.cpp:347
int MPIOpFree(MPIOp *op)
Definition: MPIWrapper.cpp:395
int MPIIssend(const void *buf, int count, MPIDatatype datatype, int dest, int tag, MPIComm comm, MPIRequest *request)
Definition: MPIWrapper.t.cpp:556
int MPIIbarrier(MPIComm comm, MPIRequest *request)
Definition: MPIWrapper.cpp:268
std::string MPIErrMsg(int errCode)
Definition: MPIWrapper.cpp:498
int MPIIrecv(void *buf, int count, MPIDatatype datatype, int source, int tag, MPIComm comm, MPIRequest *request)
Definition: MPIWrapper.t.cpp:438
int MPIBarrier(MPIComm comm)
Definition: MPIWrapper.cpp:262
int MPICommFree(MPIComm *comm)
Definition: MPIWrapper.cpp:284
int MPIRequestFree(MPIRequest *request)
Definition: MPIWrapper.cpp:405
int MPIReduce(void *sendbuf, void *recvbuf, int count, MPIDatatype datatype, MPIOp op, int root, MPIComm comm)
Definition: MPIWrapper.t.cpp:471
double MPIWtime(void)
Definition: MPIWrapper.cpp:486
dealii includes
Definition: AtomFieldDataSpherical.cpp:31