Changeset 829 for XIOS/trunk/src/node


Ignore:
Timestamp:
03/23/16 16:11:01 (8 years ago)
Author:
mhnguyen
Message:

Refactoring transformation code

+) On exchanging information during transformation, not only global index are sent but also local index
+) Correct a bug in distributed hash table (dht)
+) Add new type for dht
+) Clean up some redundant codes

Test
+) On Curie
+) Every test passes
+) Code runs faster in some cases (up to 30%)

Location:
XIOS/trunk/src/node
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/axis.cpp

    r823 r829  
    433433    CServerDistributionDescription serverDescriptionGlobal(globalDim, nbServer); 
    434434    int distributedDimensionOnServer = serverDescriptionGlobal.getDimensionDistributed(); 
    435     std::map<int, std::vector<size_t> > globalIndexAxisOnServer; 
     435    CClientServerMapping::GlobalIndexMap globalIndexAxisOnServer; 
    436436    if (distributedDimensionOnServer == orderPositionInGrid) // So we have distributed axis on client side and also on server side* 
    437437    { 
     
    472472    } 
    473473 
    474     std::map<int, std::vector<size_t> >::const_iterator it = globalIndexAxisOnServer.begin(), 
    475                                                        ite = globalIndexAxisOnServer.end(); 
     474    CClientServerMapping::GlobalIndexMap::const_iterator it = globalIndexAxisOnServer.begin(), 
     475                                                         ite = globalIndexAxisOnServer.end(); 
    476476    std::vector<size_t>::const_iterator itbVec = (globalAxisZoom).begin(), 
    477477                                        iteVec = (globalAxisZoom).end(); 
     
    505505    if (!indSrv_.empty()) 
    506506    { 
     507      std::map<int, vector<size_t> >::const_iterator itIndSrv  = indSrv_.begin(), 
     508                                                     iteIndSrv = indSrv_.end(); 
    507509      connectedServerRank_.clear(); 
    508       for (it = indSrv_.begin(); it != indSrv_.end(); ++it) 
    509         connectedServerRank_.push_back(it->first); 
     510      for (; itIndSrv != iteIndSrv; ++itIndSrv) 
     511        connectedServerRank_.push_back(itIndSrv->first); 
    510512    } 
    511513    nbConnectedClients_ = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_); 
  • XIOS/trunk/src/node/domain.cpp

    r823 r829  
    13861386                                                                                client->intraComm); 
    13871387    clientServerMap->computeServerIndexMapping(globalIndexDomain); 
    1388     const std::map<int, std::vector<size_t> >& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer(); 
    1389  
    1390     std::map<int, std::vector<size_t> >::const_iterator it = globalIndexDomainOnServer.begin(), 
    1391                                                        ite = globalIndexDomainOnServer.end(); 
     1388    const CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer(); 
     1389 
     1390    CClientServerMapping::GlobalIndexMap::const_iterator it = globalIndexDomainOnServer.begin(), 
     1391                                                         ite = globalIndexDomainOnServer.end(); 
    13921392    typedef XIOSBinarySearchWithIndex<size_t> BinarySearch; 
    13931393    std::vector<int>::iterator itVec; 
  • XIOS/trunk/src/node/grid.cpp

    r824 r829  
    457457 
    458458     clientServerMap_->computeServerIndexMapping(clientDistribution_->getGlobalIndex()); 
    459      const std::map<int, std::vector<size_t> >& globalIndexOnServer = clientServerMap_->getGlobalIndexOnServer(); 
     459     const CClientServerMapping::GlobalIndexMap& globalIndexOnServer = clientServerMap_->getGlobalIndexOnServer(); 
    460460 
    461461     const std::vector<size_t>& globalIndexSendToServer = clientDistribution_->getGlobalDataIndexSendToServer(); 
    462      std::map<int, std::vector<size_t> >::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap; 
    463      itbGlobalMap = itGlobalMap = globalIndexOnServer.begin(); 
     462     CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap; 
     463     itGlobalMap  = itbGlobalMap = globalIndexOnServer.begin(); 
    464464     iteGlobalMap = globalIndexOnServer.end(); 
    465465 
     
    488488 
    489489     connectedServerRank_.clear(); 
    490      for (std::map<int, std::vector<size_t> >::const_iterator it = globalIndexOnServer.begin(); it != globalIndexOnServer.end(); ++it) { 
    491        connectedServerRank_.push_back(it->first); 
     490     for (itGlobalMap = itbGlobalMap; itGlobalMap != iteGlobalMap; ++itGlobalMap) { 
     491       connectedServerRank_.push_back(itGlobalMap->first); 
    492492     } 
    493493 
     
    787787    list<CMessage> listMsg; 
    788788    list<CArray<size_t,1> > listOutIndex; 
    789     const std::map<int, std::vector<size_t> >& globalIndexOnServer = clientServerMap_->getGlobalIndexOnServer(); 
     789    const CClientServerMapping::GlobalIndexMap& globalIndexOnServer = clientServerMap_->getGlobalIndexOnServer(); 
    790790    const std::vector<int>& localIndexSendToServer = clientDistribution_->getLocalDataIndexSendToServer(); 
    791791    const std::vector<size_t>& globalIndexSendToServer = clientDistribution_->getGlobalDataIndexSendToServer(); 
     
    821821    else 
    822822    { 
    823       std::map<int, std::vector<size_t> >::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap; 
     823      CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap; 
    824824      itbGlobalMap = itGlobalMap = globalIndexOnServer.begin(); 
    825825      iteGlobalMap = globalIndexOnServer.end(); 
Note: See TracChangeset for help on using the changeset viewer.