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

Change MPI from waitsome to waitall in P2P

parent 67885622
This diff is collapsed.
......@@ -1259,35 +1259,22 @@ private:
// 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());
MPI_Waitsome(iterRequest, requests, &countMessages, indexMessage, status);
FLOG(waitCounter.tac());
complete += countMessages;
for(int idxRcv = 0 ; idxRcv < countMessages ; ++idxRcv){
if( indexMessage[idxRcv] < nbMessagesToRecv ){
const int idxProc = status[idxRcv].MPI_SOURCE;
int nbLeaves;
(*recvBuffer[idxProc]) >> nbLeaves;
for(int idxLeaf = 0 ; idxLeaf < nbLeaves ; ++idxLeaf){
MortonIndex leafIndex;
(*recvBuffer[idxProc]) >> leafIndex;
otherP2Ptree.createLeaf(leafIndex)->getSrc()->restore((*recvBuffer[idxProc]));
}
delete recvBuffer[idxProc];
recvBuffer[idxProc] = nullptr;
}
FLOG(waitCounter.tic());
MPI_Waitall(iterRequest, requests, status);
FLOG(waitCounter.tac());
for(int idxRcv = 0 ; idxRcv < nbMessagesToRecv ; ++idxRcv){
const int idxProc = status[idxRcv].MPI_SOURCE;
int nbLeaves;
(*recvBuffer[idxProc]) >> nbLeaves;
for(int idxLeaf = 0 ; idxLeaf < nbLeaves ; ++idxLeaf){
MortonIndex leafIndex;
(*recvBuffer[idxProc]) >> leafIndex;
otherP2Ptree.createLeaf(leafIndex)->getSrc()->restore((*recvBuffer[idxProc]));
}
delete recvBuffer[idxProc];
recvBuffer[idxProc] = nullptr;
}
delete[] indexMessage;
}
///////////////////////////////////////////////////
......
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