Ignore:
Timestamp:
04/26/16 16:04:04 (8 years ago)
Author:
mhnguyen
Message:

Several improvements

+) Replace some time-consuming operations by simpler ones

Test
+) On Curie
+) All tests pass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/client_server_mapping_distributed.cpp

    r835 r843  
    3838  ccDHT_->computeIndexInfoMapping(globalIndexOnClient); 
    3939  const boost::unordered_map<size_t,int>& infoIndexMap = (ccDHT_->getInfoIndexMap()); 
    40   boost::unordered_map<size_t,int>::const_iterator it = infoIndexMap.begin(), ite = infoIndexMap.end(); 
    41   for (; it != ite; ++it) 
     40  boost::unordered_map<size_t,int>::const_iterator itb = infoIndexMap.begin(), ite = infoIndexMap.end(), it; 
     41  std::vector<size_t> nbInfoIndex(ccDHT_->getNbClient(),0); 
     42 
     43  for (it = itb; it != ite; ++it) 
    4244  { 
    43     indexGlobalOnServer_[it->second].push_back(it->first); 
     45    ++nbInfoIndex[it->second]; 
     46  } 
     47 
     48  for (int idx = 0; idx < nbInfoIndex.size(); ++idx) 
     49  { 
     50    if (0 != nbInfoIndex[idx]) 
     51    { 
     52      indexGlobalOnServer_[idx].resize(nbInfoIndex[idx]); 
     53      nbInfoIndex[idx] = 0; 
     54    } 
     55  } 
     56 
     57  for (it = itb; it != ite; ++it) 
     58  { 
     59    indexGlobalOnServer_[it->second][nbInfoIndex[it->second]] = (it->first); 
     60    ++nbInfoIndex[it->second]; 
    4461  } 
    4562} 
Note: See TracChangeset for help on using the changeset viewer.