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/transformation_mapping.cpp

    r630 r634  
    140140  if (0 != buffSize) recvBuffGlobalIndex = new unsigned long [buffSize]; 
    141141 
     142  std::map<int, MPI_Request> requests; 
     143 
    142144  // Inform all "source clients" about index that they need to send 
    143145  for (itMapSrc = itbMapSrc; itMapSrc != iteMapSrc; ++itMapSrc) 
    144146  { 
    145     MPI_Request request; 
    146147    unsigned long* sendPtr = const_cast<unsigned long*>(&(itMapSrc->second)[0]); 
    147148    MPI_Isend(sendPtr, 
     
    151152              11, 
    152153              client->intraComm, 
    153               &request); 
     154              &requests[itMapSrc->first]); 
    154155  } 
    155156 
     
    177178  } 
    178179 
     180  std::map<int, MPI_Request>::iterator itRequest; 
     181  for (itRequest = requests.begin(); itRequest != requests.end(); ++itRequest) 
     182    MPI_Wait(&itRequest->second, MPI_STATUS_IGNORE); 
     183 
    179184  delete [] sendBuff; 
    180185  delete [] recvBuff; 
Note: See TracChangeset for help on using the changeset viewer.