46 typedef MPI_Comm SU2_Comm;
51 #if defined COMPLEX_TYPE || \ 52 defined ADOLC_FORWARD_TYPE || \ 53 defined CODI_FORWARD_TYPE 55 typedef CAuxMPIWrapper SU2_MPI;
56 #elif defined CODI_REVERSE_TYPE 57 class CAdjointMPIWrapper;
58 typedef CAdjointMPIWrapper SU2_MPI;
61 typedef CMPIWrapper SU2_MPI;
74 static void Init(
int *argc,
char***argv);
76 static void Isend(
void *buf,
int count, MPI_Datatype datatype,
int dest,
77 int tag, MPI_Comm comm, MPI_Request* request);
79 static void Irecv(
void *buf,
int count, MPI_Datatype datatype,
int source,
80 int tag, MPI_Comm comm, MPI_Request* request);
82 static void Wait(MPI_Request *request, MPI_Status *status);
84 static void Waitall(
int nrequests, MPI_Request *request, MPI_Status *status);
86 static void Waitany(
int nrequests, MPI_Request *request,
87 int *index, MPI_Status *status);
89 static void Send(
void *buf,
int count, MPI_Datatype datatype,
int dest,
90 int tag, MPI_Comm comm);
92 static void Recv(
void *buf,
int count, MPI_Datatype datatype,
int dest,
93 int tag, MPI_Comm comm, MPI_Status *status);
95 static void Bcast(
void *buf,
int count, MPI_Datatype datatype,
int root,
98 static void Bsend(
void *buf,
int count, MPI_Datatype datatype,
int dest,
99 int tag, MPI_Comm comm);
101 static void Reduce(
void *sendbuf,
void *recvbuf,
int count,
102 MPI_Datatype datatype, MPI_Op op,
int root, MPI_Comm comm);
104 static void Allreduce(
void *sendbuf,
void *recvbuf,
int count,
105 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
107 static void Gather(
void *sendbuf,
int sendcnt,MPI_Datatype sendtype,
108 void *recvbuf,
int recvcnt, MPI_Datatype recvtype,
int root, MPI_Comm comm);
110 static void Scatter(
void *sendbuf,
int sendcnt,MPI_Datatype sendtype,
111 void *recvbuf,
int recvcnt, MPI_Datatype recvtype,
int root, MPI_Comm comm);
113 static void Allgather(
void *sendbuf,
int sendcnt, MPI_Datatype sendtype,
114 void *recvbuf,
int recvcnt, MPI_Datatype recvtype, MPI_Comm comm);
116 static void Sendrecv(
void *sendbuf,
int sendcnt, MPI_Datatype sendtype,
117 int dest,
int sendtag,
void *recvbuf,
int recvcnt,
118 MPI_Datatype recvtype,
int source,
int recvtag,
119 MPI_Comm comm, MPI_Status *status);
132 #if defined COMPLEX_TYPE || \ 133 defined ADOLC_FORWARD_TYPE || \ 134 defined CODI_FORWARD_TYPE 136 class CAuxMPIWrapper :
public CMPIWrapper{
138 static void Isend(
void *buf,
int count, MPI_Datatype datatype,
int dest,
139 int tag, MPI_Comm comm, MPI_Request* request);
141 static void Irecv(
void *buf,
int count, MPI_Datatype datatype,
int source,
142 int tag, MPI_Comm comm, MPI_Request* request);
144 static void Wait(MPI_Request *request, MPI_Status *status);
146 static void Waitall(
int nrequests, MPI_Request *request, MPI_Status *status);
148 static void Waitany(
int nrequests, MPI_Request *request,
149 int *index, MPI_Status *status);
151 static void Send(
void *buf,
int count, MPI_Datatype datatype,
int dest,
152 int tag, MPI_Comm comm);
154 static void Recv(
void *buf,
int count, MPI_Datatype datatype,
int dest,
155 int tag, MPI_Comm comm, MPI_Status *status);
157 static void Bcast(
void *buf,
int count, MPI_Datatype datatype,
int root,
160 static void Bsend(
void *buf,
int count, MPI_Datatype datatype,
int dest,
161 int tag, MPI_Comm comm);
163 static void Reduce(
void *sendbuf,
void *recvbuf,
int count,
164 MPI_Datatype datatype, MPI_Op op,
int root, MPI_Comm comm);
166 static void Allreduce(
void *sendbuf,
void *recvbuf,
int count,
167 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
169 static void Gather(
void *sendbuf,
int sendcnt,MPI_Datatype sendtype,
170 void *recvbuf,
int recvcnt, MPI_Datatype recvtype,
int root, MPI_Comm comm);
172 static void Scatter(
void *sendbuf,
int sendcnt,MPI_Datatype sendtype,
173 void *recvbuf,
int recvcnt, MPI_Datatype recvtype,
int root, MPI_Comm comm);
175 static void Allgather(
void *sendbuf,
int sendcnt, MPI_Datatype sendtype,
176 void *recvbuf,
int recvcnt, MPI_Datatype recvtype, MPI_Comm comm);
178 static void Sendrecv(
void *sendbuf,
int sendcnt, MPI_Datatype sendtype,
179 int dest,
int sendtag,
void *recvbuf,
int recvcnt,
180 MPI_Datatype recvtype,
int source,
int recvtag,
181 MPI_Comm comm, MPI_Status *status);
192 MPI_Request* RequestAux;
195 su2double* su2doubleBuffer;
204 static std::map<MPI_Request*, CommInfo>::iterator CommInfoIterator;
206 static std::map<MPI_Request*, CommInfo> CommInfoMap;
208 static void FinalizeCommunication(std::map<MPI_Request*, CommInfo>::iterator &CommInfo);
212 #ifdef CODI_REVERSE_TYPE 213 #include "ampi_tape.hpp" 222 class CAdjointMPIWrapper:
public CMPIWrapper {
224 static void Init(
int *argc,
char***argv);
226 static void Isend(
void *buf,
int count, MPI_Datatype datatype,
int dest,
227 int tag, MPI_Comm comm, MPI_Request* request);
229 static void Irecv(
void *buf,
int count, MPI_Datatype datatype,
int source,
230 int tag, MPI_Comm comm, MPI_Request* request);
232 static void Wait(MPI_Request *request, MPI_Status *status);
234 static void Waitall(
int nrequests, MPI_Request *request, MPI_Status *status);
236 static void Waitany(
int nrequests, MPI_Request *request,
237 int *index, MPI_Status *status);
239 static void Send(
void *buf,
int count, MPI_Datatype datatype,
int dest,
240 int tag, MPI_Comm comm);
242 static void Recv(
void *buf,
int count, MPI_Datatype datatype,
int dest,
243 int tag, MPI_Comm comm, MPI_Status *status);
245 static void Bcast(
void *buf,
int count, MPI_Datatype datatype,
int root,
248 static void Bsend(
void *buf,
int count, MPI_Datatype datatype,
int dest,
249 int tag, MPI_Comm comm);
251 static void Reduce(
void *sendbuf,
void *recvbuf,
int count,
252 MPI_Datatype datatype, MPI_Op op,
int root, MPI_Comm comm);
254 static void Allreduce(
void *sendbuf,
void *recvbuf,
int count,
255 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
257 static void Gather(
void *sendbuf,
int sendcnt,MPI_Datatype sendtype,
258 void *recvbuf,
int recvcnt, MPI_Datatype recvtype,
int root, MPI_Comm comm);
260 static void Scatter(
void *sendbuf,
int sendcnt,MPI_Datatype sendtype,
261 void *recvbuf,
int recvcnt, MPI_Datatype recvtype,
int root, MPI_Comm comm);
263 static void Allgather(
void *sendbuf,
int sendcnt, MPI_Datatype sendtype,
264 void *recvbuf,
int recvcnt, MPI_Datatype recvtype, MPI_Comm comm);
266 static void Sendrecv(
void *sendbuf,
int sendcnt, MPI_Datatype sendtype,
267 int dest,
int sendtag,
void *recvbuf,
int recvcnt,
268 MPI_Datatype recvtype,
int source,
int recvtag,
269 MPI_Comm comm, MPI_Status *status);
278 typedef unsigned short SU2_Comm;
280 #include "mpi_structure.inl" Headers for generalized datatypes. The subroutines and functions are in the datatype_structure.cpp file.