6 #include "GmshConfig.h"
26 reqRecv[i] = reqSend[i] = MPI_REQUEST_NULL;
29 MPI_Irecv(&recvBuf[i][0], recvBuf[i].size(), MPI_DOUBLE, i, 0,
30 MPI_COMM_WORLD, &reqRecv[i]);
34 MPI_Isend(&sendBuf[i][0], sendBuf[i].size(), MPI_DOUBLE, i, 0,
35 MPI_COMM_WORLD, &reqSend[i]);
40 index != MPI_UNDEFINED) {
41 if(status.MPI_TAG == 0)
42 for(std::size_t j = 0; j < recvBuf[index].size(); j++) {
71 it->second += numStart;
72 std::vector<std::list<Dof> > ghostedByProc;
77 int procId = it->second.first;
78 it->second.second = nRequest[procId]++;
80 MPI_Alltoall(nRequest, 1, MPI_INT, nRequested, 1, MPI_INT, MPI_COMM_WORLD);
90 send0[i] =
new long int[nRequest[i] * 2];
91 recv0[i] =
new long int[nRequested[i] * 2];
92 send1[i] =
new int[nRequested[i]];
93 recv1[i] =
new int[nRequest[i]];
94 reqSend0[i] = reqSend1[i] = reqRecv0[i] = reqRecv1[i] = MPI_REQUEST_NULL;
100 int proc = it->second.first;
101 send0[proc][nRequest[proc] * 2] = it->first.getEntity();
102 send0[proc][nRequest[proc] * 2 + 1] = it->first.getType();
107 if(nRequested[i] > 0) {
108 MPI_Irecv(recv0[i], 2 * nRequested[i], MPI_LONG, i, 0, MPI_COMM_WORLD,
111 if(nRequest[i] > 0) {
112 MPI_Irecv(recv1[i], 2 * nRequest[i], MPI_INT, i, 1, MPI_COMM_WORLD,
114 MPI_Isend(send0[i], 2 * nRequest[i], MPI_LONG, i, 0, MPI_COMM_WORLD,
119 while(MPI_Waitany(2 *
Msg::GetCommSize(), reqRecv0, &index, &status) == 0 &&
120 index != MPI_UNDEFINED) {
121 if(status.MPI_TAG == 0) {
122 for(
int j = 0; j < nRequested[index]; j++) {
123 Dof d(recv0[index][j * 2], recv0[index][j * 2 + 1]);
126 Msg::Error(
"ghost Dof does not exist on parent process");
127 send1[index][j] = it->second;
130 MPI_Isend(send1[index], nRequested[index], MPI_INT, index, 1,
131 MPI_COMM_WORLD, &reqSend1[index]);
137 int proc = it->second.first;
138 unknown[it->first] = recv1[proc][nRequest[proc]++];