Ignore:
Timestamp:
10/06/17 13:41:57 (4 years ago)
Author:
oabramkina
Message:

Improvements for the secondary server: each grid is only sent to secondary-server pools that need it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/grid.hpp

    r1263 r1294  
    161161         void sendIndex(void); 
    162162         void sendIndexScalarGrid(); 
     163 
     164         void setContextClient(CContextClient* contextClient); 
    163165 
    164166         void computeDomConServer(); 
     
    215217         map<int, CArray<int, 1> > storeIndex_fromSrv; // Support, for now, reading with level-1 server 
    216218 
    217  
    218          map<int, CArray<size_t, 1> > outIndexFromClient, compressedOutIndexFromClient, outGlobalIndexFromClient; 
    219  
    220          // A client receives global index from other clients (via recvIndex) 
    221          // then does mapping these index into local index of STORE_CLIENTINDEX 
    222          // In this way, store_clientIndex can be used as an input of a source filter 
    223          // Maybe we need a flag to determine whether a client wants to write. TODO 
     219         map<int, CArray<size_t, 1> > outIndexFromClient;  // Deprecated 
     220 
     221         map<int, CArray<size_t, 1> > compressedOutIndexFromClient; 
     222 
     223/** Map storing received indexes. Key = sender rank, value = index array. */ 
     224         map<int, CArray<size_t, 1> > outGlobalIndexFromClient; 
     225 
     226// Manh Ha's comment: " A client receives global index from other clients (via recvIndex) 
     227// then does mapping these index into local index of STORE_CLIENTINDEX 
     228// In this way, store_clientIndex can be used as an input of a source filter 
     229// Maybe we need a flag to determine whether a client wants to write. TODO " 
     230 
     231/** Map storing received data. Key = sender rank, value = data array. 
     232 *  The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData() */ 
    224233         map<int, CArray<size_t, 1> > outLocalIndexStoreOnClient;  
    225234 
    226 /** Indexes calculated based on server distribution (serverDistribution_). They are used for writing data into a file. */ 
     235/** Indexes calculated based on server-like distribution. 
     236 *  They are used for writing/reading data and only calculated for server level that does the writing/reading. 
     237 *  Along with localIndexToWriteOnClient, these indexes are used to correctly place incoming data. */ 
    227238         CArray<size_t,1> localIndexToWriteOnServer; 
    228239 
    229 /** Indexes calculated based on client distribution (clientDistribution_). They are not used at all. 
    230     They should be the same as localIndexToWriteOnServer and potentially can be used as an additional check.*/ 
     240/** Indexes calculated based on client-like distribution. 
     241 *  They are used for writing/reading data and only calculated for server level that does the writing/reading. 
     242 *  Along with localIndexToWriteOnServer, these indexes are used to correctly place incoming data. */ 
    231243         CArray<size_t,1> localIndexToWriteOnClient; 
    232244 
    233245         CArray<size_t,1> indexFromClients; 
     246 
    234247         void checkMask(void); 
    235248         void createMask(void); 
     
    289302 
    290303      private: 
    291          bool isChecked; 
    292          bool isDomainAxisChecked; 
    293          bool isIndexSent; 
     304 
     305/** Clients that have to send a grid. There can be multiple clients in case of secondary server, otherwise only one client. */ 
     306        std::set<CContextClient*> clients; 
     307 
     308        bool isChecked; 
     309        bool isDomainAxisChecked; 
     310        bool isIndexSent; 
    294311 
    295312        CDomainGroup* vDomainGroup_; 
     
    299316        bool isAxisListSet, isDomListSet, isScalarListSet; 
    300317 
    301 /** Distribution calculated in computeClientIndex() based on the knowledge of the entire grid */ 
     318/** Client-like distribution calculated based on the knowledge of the entire grid */ 
    302319        CDistributionClient* clientDistribution_; 
    303320 
    304 /** Distribution calculated upon receiving indexes */ 
     321/** Server-like distribution calculated upon receiving indexes */ 
    305322        CDistributionServer* serverDistribution_; 
    306323 
     
    345362   void CGrid::inputField(const CArray<double,n>& field, CArray<double,1>& stored) const 
    346363   { 
     364//#ifdef __XIOS_DEBUG 
    347365      if (this->getDataSize() != field.numElements()) 
    348366         ERROR("void CGrid::inputField(const  CArray<double,n>& field, CArray<double,1>& stored) const", 
     
    351369                << "The data array does not have the right size! " 
    352370                << "Grid = " << this->GetName()) 
     371//#endif 
    353372      this->storeField_arr(field.dataFirst(), stored); 
    354373   } 
     
    357376   void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const 
    358377   { 
     378//#ifdef __XIOS_DEBUG 
    359379      if (this->getDataSize() != field.numElements()) 
    360380         ERROR("void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const", 
     
    363383                << "The ouput array does not have the right size! " 
    364384                << "Grid = " << this->GetName()) 
     385//#endif 
    365386      this->restoreField_arr(stored, field.dataFirst()); 
    366387   } 
Note: See TracChangeset for help on using the changeset viewer.