Ignore:
Timestamp:
04/14/17 16:53:56 (7 years ago)
Author:
mhnguyen
Message:

Updating 2-level server

+) Make some changes in the way data rebuilt on each level of server
+) Make some changes in the order of functions call during close context to make sure that each server receives the global indexes before calculating index to send to next level
+) Modify some functions to make sure data sent to the correct server pool

Test
+) On Curie
+) Only test_client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/distribution_server.cpp

    r1030 r1099  
    175175void CDistributionServer::computeLocalIndex(CArray<size_t,1>& globalIndex) 
    176176{ 
    177   int ssize = globalIndex.numElements(); 
    178   CArray<size_t,1> localIndex(ssize); 
     177  size_t ssize = globalIndex.numElements(); 
     178  size_t localIndexSize = std::min(globalIndex_.numElements(), ssize); 
     179  CArray<size_t,1> localIndex(localIndexSize); 
    179180  GlobalLocalMap::const_iterator ite = globalLocalIndexMap_.end(), it; 
    180   for (int idx = 0; idx < ssize; ++idx) 
     181  int i = 0; 
     182  for (size_t idx = 0; idx < ssize; ++idx) 
    181183  { 
    182184    it = globalLocalIndexMap_.find(globalIndex(idx)); 
    183185    if (ite != it) 
    184       localIndex(idx) = it->second; 
     186    { 
     187      localIndex(i) = it->second; 
     188      ++i; 
     189    } 
    185190  } 
    186191 
     
    201206} 
    202207 
     208/*! 
     209  Get the size of grid index in server (e.x: sizeGrid *= size of each dimensiion) 
     210*/ 
     211int CDistributionServer::getGridSize() const 
     212{ 
     213   return globalLocalIndexMap_.size(); 
     214} 
    203215 
    204216const std::vector<int>& CDistributionServer::getZoomBeginGlobal() const 
Note: See TracChangeset for help on using the changeset viewer.