Commit 80a0057b authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

Change MPI from waitsome to waitall in P2P

parent 67885622
...@@ -1185,21 +1185,12 @@ private: ...@@ -1185,21 +1185,12 @@ private:
// Waitsend receive // Waitsend receive
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
int complete = 0;
int*const indexMessage = new int[nbProcess * 2];
while( complete != iterRequest){
memset(indexMessage, 0, sizeof(int) * nbProcess * 2);
int countMessages = 0;
// Wait data // Wait data
FLOG(waitCounter.tic()); FLOG(waitCounter.tic());
MPI_Waitsome(iterRequest, requests, &countMessages, indexMessage, status); MPI_Waitall(iterRequest, requests, status);
FLOG(waitCounter.tac()); FLOG(waitCounter.tac());
complete += countMessages;
for(int idxRcv = 0 ; idxRcv < countMessages ; ++idxRcv){ for(int idxRcv = 0 ; idxRcv < nbMessagesToRecv ; ++idxRcv){
if( indexMessage[idxRcv] < nbMessagesToRecv ){
const int idxProc = status[idxRcv].MPI_SOURCE; const int idxProc = status[idxRcv].MPI_SOURCE;
int nbLeaves; int nbLeaves;
(*recvBuffer[idxProc]) >> nbLeaves; (*recvBuffer[idxProc]) >> nbLeaves;
...@@ -1212,9 +1203,6 @@ private: ...@@ -1212,9 +1203,6 @@ private:
recvBuffer[idxProc] = nullptr; recvBuffer[idxProc] = nullptr;
} }
} }
}
delete[] indexMessage;
}
/////////////////////////////////////////////////// ///////////////////////////////////////////////////
// Prepare data for thread P2P // Prepare data for thread P2P
......
...@@ -1259,21 +1259,11 @@ private: ...@@ -1259,21 +1259,11 @@ private:
// Waitsend receive // Waitsend receive
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
int complete = 0;
int*const indexMessage = new int[nbProcess * 2];
while( complete != iterRequest){
memset(indexMessage, 0, sizeof(int) * nbProcess * 2);
int countMessages = 0;
// Wait data
FLOG(waitCounter.tic()); FLOG(waitCounter.tic());
MPI_Waitsome(iterRequest, requests, &countMessages, indexMessage, status); MPI_Waitall(iterRequest, requests, status);
FLOG(waitCounter.tac()); FLOG(waitCounter.tac());
complete += countMessages;
for(int idxRcv = 0 ; idxRcv < countMessages ; ++idxRcv){ for(int idxRcv = 0 ; idxRcv < nbMessagesToRecv ; ++idxRcv){
if( indexMessage[idxRcv] < nbMessagesToRecv ){
const int idxProc = status[idxRcv].MPI_SOURCE; const int idxProc = status[idxRcv].MPI_SOURCE;
int nbLeaves; int nbLeaves;
(*recvBuffer[idxProc]) >> nbLeaves; (*recvBuffer[idxProc]) >> nbLeaves;
...@@ -1286,9 +1276,6 @@ private: ...@@ -1286,9 +1276,6 @@ private:
recvBuffer[idxProc] = nullptr; recvBuffer[idxProc] = nullptr;
} }
} }
}
delete[] indexMessage;
}
/////////////////////////////////////////////////// ///////////////////////////////////////////////////
// Prepare data for thread P2P // Prepare data for thread P2P
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment