Ignore:
Timestamp:
07/15/15 16:36:38 (9 years ago)
Author:
rlacroix
Message:

Transformations: Fix some errors in MPI communications

  • Some communications could have caused deadlocks.
  • Some communications were not properly checked for completion.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/grid_transformation.cpp

    r631 r634  
    471471 if (0 != sendBuffSize) sendBuff = new unsigned long [sendBuffSize]; 
    472472 for (StdSize idx = 0; idx < sendBuffSize; ++idx) sendBuff[idx] = NumTraits<Scalar>::sfmax(); 
     473 
     474 std::map<int, MPI_Request> requests; 
    473475 
    474476 int currentBuffPosition = 0; 
     
    488490   } 
    489491   currentSendBuff = sendBuff + currentBuffPosition; 
    490    MPI_Send(currentSendBuff, countSize, MPI_UNSIGNED_LONG, destRank, 14, client->intraComm); 
     492   MPI_Isend(currentSendBuff, countSize, MPI_UNSIGNED_LONG, destRank, 14, client->intraComm, &requests[destRank]); 
    491493   currentBuffPosition += countSize; 
    492494 } 
     
    551553 } 
    552554 
     555 std::map<int, MPI_Request>::iterator itRequest; 
     556 for (itRequest = requests.begin(); itRequest != requests.end(); ++itRequest) 
     557   MPI_Wait(&itRequest->second, MPI_STATUS_IGNORE); 
     558 
    553559 if (0 != sendBuffSize) delete [] sendBuff; 
    554560 if (0 != recvBuffSize) delete [] recvBuff; 
Note: See TracChangeset for help on using the changeset viewer.