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%)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.