Ignore:
Timestamp:
08/24/15 14:53:36 (9 years ago)
Author:
mhnguyen
Message:

Implementing some code factoring

+) Replace some slow searching function by faster ones

Test
+) On Curie
+) test_client and test_complete are correct

File:
1 edited

Legend:

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

    r666 r668  
    1818   , gridMask_(), localDomainIndex_(), localAxisIndex_(), indexMap_(), indexDomainData_(), indexAxisData_() 
    1919   , isDataDistributed_(true), axisNum_(0), domainNum_(0), nIndexDomain_(), nIndexAxis_() 
     20   , globalDataSendToServer_(), localDataIndexSendToServer_(), localDataIndex_(), localMaskIndex_() 
    2021{ 
    2122} 
     
    2829   , gridMask_(), localDomainIndex_(), localAxisIndex_(), indexMap_(), indexDomainData_(), indexAxisData_() 
    2930   , isDataDistributed_(true), axisNum_(0), domainNum_(0), nIndexDomain_(), nIndexAxis_() 
     31   , globalDataSendToServer_(), localDataIndexSendToServer_(), localDataIndex_(), localMaskIndex_() 
    3032{ 
    3133  readDistributionInfo(grid); 
     
    568570          gridMask_(gridMaskIndex)) 
    569571      { 
    570         localDataIndex_(indexLocalDataOnClientCount) = countLocalData; 
     572        localDataIndex_[indexLocalDataOnClientCount] = countLocalData; 
    571573 
    572574        bool isIndexOnServer = true; 
     
    584586            globalIndex += (currentIndex[k] + nBeginGlobal_[k])*mulDim; 
    585587          } 
    586           globalDataSendToServer_(indexSend2ServerCount) = globalIndex; 
    587           localDataIndexSendToServer_(indexSend2ServerCount) = indexLocalDataOnClientCount; 
    588           localMaskIndex_(indexSend2ServerCount) = gridMaskIndex; 
     588          globalDataSendToServer_[indexSend2ServerCount] = globalIndex; 
     589          localDataIndexSendToServer_[indexSend2ServerCount] = indexLocalDataOnClientCount; 
     590          localMaskIndex_[indexSend2ServerCount] = gridMaskIndex; 
    589591          ++indexSend2ServerCount; 
    590592        } 
     
    639641} 
    640642 
    641 const CArray<size_t,1>& CDistributionClient::getGlobalDataIndexSendToServer() const 
     643const std::vector<size_t>& CDistributionClient::getGlobalDataIndexSendToServer() const 
    642644{ 
    643645  return globalDataSendToServer_; 
     
    647649  Return local data index of client 
    648650*/ 
    649 const CArray<int,1>& CDistributionClient::getLocalDataIndexOnClient() const 
     651const std::vector<int>& CDistributionClient::getLocalDataIndexOnClient() const 
    650652{ 
    651653  return localDataIndex_; 
     
    655657  Return local mask index of client 
    656658*/ 
    657 const CArray<int,1>& CDistributionClient::getLocalMaskIndexOnClient() const 
     659const std::vector<int>& CDistributionClient::getLocalMaskIndexOnClient() const 
    658660{ 
    659661  return localMaskIndex_; 
     
    663665  Return local data index on client which are sent to servers 
    664666*/ 
    665 const CArray<int,1>& CDistributionClient::getLocalDataIndexSendToServer() const 
     667const std::vector<int>& CDistributionClient::getLocalDataIndexSendToServer() const 
    666668{ 
    667669  return localDataIndexSendToServer_; 
Note: See TracChangeset for help on using the changeset viewer.