Ignore:
Timestamp:
04/17/20 18:55:28 (4 years ago)
Author:
ymipsl
Message:

Some update on XIOS_COUPLING branch...

YM

File:
1 edited

Legend:

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

    r1869 r1870  
    146146         CAxis* addAxis(const std::string& id=StdString()); 
    147147         CScalar* addScalar(const std::string& id=StdString()); 
     148 
     149      public: 
     150         void sendGridToFileServer(CContextClient* client) ; 
     151      private: 
     152         std::set<CContextClient*> sendGridToFileServer_done_ ; 
     153       
     154      public: 
    148155         void sendAddDomain(const std::string& id,CContextClient* contextClient); 
    149156         void sendAddAxis(const std::string& id,CContextClient* contextClient); 
     
    193200 
    194201         CDistributionServer* getDistributionServer(); 
    195          CDistributionClient* getDistributionClient(); 
    196202         CGridTransformation* getTransformations(); 
    197203 
     
    231237 
    232238         void computeGridIndexToFileServer(CContextClient* client) ; 
    233  
    234       private: 
     239  
     240     private: 
     241        /** Client-like distribution calculated based on the knowledge of the entire grid */ 
     242       CDistributionClient* clientDistribution_; 
     243     public:  
    235244       void computeClientDistribution(void) ; 
     245     private: 
    236246       bool computeClientDistribution_done_ = false ; 
    237  
     247     public: 
     248       CDistributionClient* getClientDistribution(void);  
     249 
     250     private: 
    238251       template<int N> 
    239252       void checkGridMask(CArray<bool,N>& gridMask, 
     
    277290        int getDistributedDimension(); 
    278291 
    279         
    280         void computeClientIndex(); 
    281         bool computeClientIndex_done_ = false ; 
    282          
    283292        void computeConnectedClients(CContextClient* client); 
    284293        set<CContextClient*> computeConnectedClients_done_ ; 
    285  
    286         void computeClientIndexScalarGrid();  
    287         bool computeClientIndexScalarGrid_done_ = false ; 
    288294 
    289295        void computeConnectedClientsScalarGrid(CContextClient* client);  
     
    346352// Maybe we need a flag to determine whether a client wants to write. TODO " 
    347353 
    348 /** Map storing received data on server side. This map is the equivalent to the storeIndex_client, but for data received from client 
    349   * instead that from model. This map is used to concatenate data received from several clients into a single array on server side 
    350   * which match the local workflow grid. 
    351   * outLocalIndexStoreOnClient_[client_rank] -> Array of index from client of rank "client_rank" 
    352   * outLocalIndexStoreOnClient_[client_rank](index of buffer from client) -> local index of the workflow grid 
    353   * The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData(). 
    354   * Symetrically it is also used to send data from a server to several client for reading case. */ 
    355          map<int, CArray<size_t, 1> > outLocalIndexStoreOnClient_;  
    356  
    357  
     354      private: 
     355       /** Map storing received data on server side. This map is the equivalent to the storeIndex_client, but for data received from client 
     356        * instead that from model. This map is used to concatenate data received from several clients into a single array on server side 
     357        * which match the local workflow grid. 
     358        * outLocalIndexStoreOnClient_[client_rank] -> Array of index from client of rank "client_rank" 
     359        * outLocalIndexStoreOnClient_[client_rank](index of buffer from client) -> local index of the workflow grid 
     360        * The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData(). 
     361        * Symetrically it is also used to send data from a server to several client for reading case. */ 
     362        map<int, CArray<size_t, 1>> outLocalIndexStoreOnClient_;  
     363      public: 
     364         void computeOutLocalIndexStoreOnClient(void) ; 
     365      private: 
     366         bool computeOutLocalIndexStoreOnClient_done_ = false ;   
     367      public:    
     368         map<int, CArray<size_t, 1>>& getOutLocalIndexStoreOnClient(void)  
     369         { if (!computeOutLocalIndexStoreOnClient_done_) computeOutLocalIndexStoreOnClient(); return outLocalIndexStoreOnClient_ ; } 
     370 
     371      public: 
    358372/** Indexes calculated based on server-like distribution. 
    359373 *  They are used for writing/reading data and only calculated for server level that does the writing/reading. 
     
    370384         CArray<size_t,1> localIndexToWriteOnClient_; 
    371385 
     386      public:  
     387        bool isDataDistributed(void) ;  
    372388      private: 
    373389 
     
    376392        std::set<CContextClient*> clientsSet; 
    377393 
    378 /** Map storing received indexes on server side sent by clients. Key = sender rank, value = global index array.  
    379     Later, the global indexes received will be mapped onto local index computed with the local distribution. 
    380     outGlobalIndexFromClient_[rank] -> array of global index send by client of rank "rank" 
    381     outGlobalIndexFromClient_[rank](n) -> global index of datav n sent by client 
    382 */ 
     394      private:   
     395        /** Map storing received indexes on server side sent by clients. Key = sender rank, value = global index array.  
     396            Later, the global indexes received will be mapped onto local index computed with the local distribution. 
     397            outGlobalIndexFromClient_[rank] -> array of global index send by client of rank "rank" 
     398            outGlobalIndexFromClient_[rank](n) -> global index of datav n sent by client 
     399        */       
    383400        map<int, CArray<size_t, 1> > outGlobalIndexFromClient_; 
    384  
     401      public:   
     402        map<int, CArray<size_t, 1> >& getOutGlobalIndexFromClient() { return outGlobalIndexFromClient_ ;} 
     403 
     404      private: 
    385405        bool isChecked; 
    386406        bool isDomainAxisChecked; 
     
    393413        bool isAxisListSet, isDomListSet, isScalarListSet; 
    394414 
    395 /** Client-like distribution calculated based on the knowledge of the entire grid */ 
    396         CDistributionClient* clientDistribution_; 
    397  
    398415/** Server-like distribution calculated upon receiving indexes */ 
    399416        CDistributionServer* serverDistribution_; 
     
    416433/** Size of data to be send in case of reading. It is calculated in recvIndex(). */ 
    417434        std::map<int,size_t> connectedDataSizeRead_; 
    418  
    419         bool isDataDistributed_;         
     435       
    420436         //! True if and only if the data defined on the grid can be outputted in a compressed way 
    421437        bool isCompressible_; 
     
    424440        bool isTransformed_, isGenerated_; 
    425441        bool computedWrittenIndex_; 
     442         
    426443        std::vector<int> axisPositionInGrid_; 
     444        void computeAxisPositionInGrid(void) ; 
     445        bool computeAxisPositionInGrid_done_ = false ; 
     446        std::vector<int>& getAxisPositionInGrid(void) { if (!computeAxisPositionInGrid_done_) computeAxisPositionInGrid() ; return axisPositionInGrid_ ;} 
     447 
    427448        CGridTransformation* transformations_; 
    428449        bool hasDomainAxisBaseRef_;         
Note: See TracChangeset for help on using the changeset viewer.