Ignore:
Timestamp:
04/23/21 15:00:35 (3 years ago)
Author:
oabramkina
Message:

Merging branch dev_oa with tiling into trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/grid.hpp

    r1927 r2131  
    9191         StdSize  getDataSize(void) const; 
    9292 
     93         StdSize  getTileDataSize(int tileId); 
     94 
     95         StdSize  getTileSize(int tileId); 
     96 
    9397         /// Entrees-sorties de champs 
    9498         template <int n> 
    9599         void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const; 
    96100         template <int n> 
    97          void maskField(const CArray<double,n>& field, CArray<double,1>& stored) const; 
     101         void maskField(const CArray<double,n>& field, CArray<double,1>& stored, bool isTiled = false) const; 
    98102         template <int n> 
    99103         void outputField(const CArray<double,1>& stored, CArray<double,n>& field) const;   
    100104         template <int n> 
    101105         void uncompressField(const CArray<double,n>& data, CArray<double,1>& outData) const;  
     106         template <int n> 
     107         void copyTile(const CArray<double,n>& tileData, CArray<double, 1>& stored, int tileId); 
    102108 
    103109         virtual void parse(xml::CXMLNode& node); 
     
    205211      public: 
    206212         CArray<int, 1> storeIndex_client; 
     213         CArray<int, 1> storeIndexTiled_client; 
    207214         CArray<bool, 1> storeMask_client; 
     215         CArray<bool, 1> storeMaskTiled_client; 
    208216 
    209217/** Map containing indexes that will be sent in sendIndex(). */ 
     
    223231/** Map storing received indexes. Key = sender rank, value = index array. */ 
    224232         map<int, CArray<size_t, 1> > outGlobalIndexFromClient; 
     233 
     234/** Map storing received indexes. Key = sender rank, value = index array for tiled domains */ 
     235         map<int, CArray<size_t, 1> > outGlobalIndexFromClientTiled; 
    225236 
    226237// Manh Ha's comment: " A client receives global index from other clients (via recvIndex) 
     
    232243 *  The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData() */ 
    233244         map<int, CArray<size_t, 1> > outLocalIndexStoreOnClient;  
     245 
     246/** Map storing received data. Key = sender rank, value = data array. 
     247 *  The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData() */ 
     248         map<int, CArray<size_t, 1> > outLocalIndexStoreOnClientTiled; 
     249 
    234250 
    235251/** Indexes calculated based on server-like distribution. 
     
    255271                                         const std::vector<CScalar*>& scalars, 
    256272                                         const CArray<int,1>& axisDomainOrder); 
     273 
     274         int getNTiles(); 
     275         bool isTiled(void) const; 
     276         bool isTiledOnly(void) const; 
    257277 
    258278      private: 
     
    272292        void restoreField_arr(const CArray<double, 1>& stored, double* const data) const; 
    273293        void uncompressField_arr(const double* const data, CArray<double, 1>& outData) const; 
    274         void maskField_arr(const double* const data, CArray<double, 1>& stored) const; 
     294        void maskField_arr(const double* const data, CArray<double, 1>& stored, bool isTiled = false) const; 
     295        void copyTile_arr(const double* const tileData, CArray<double, 1>& stored, int tileId); 
    275296 
    276297        void setVirtualDomainGroup(CDomainGroup* newVDomainGroup); 
     
    299320 
    300321        void computeClientIndex(); 
     322        void computeClientIndexTiled(); 
    301323        void computeConnectedClients(); 
    302324        void computeClientIndexScalarGrid();  
    303325        void computeConnectedClientsScalarGrid();  
    304326 
     327        void computeTileIndex(); 
     328 
    305329      private: 
    306330 
     
    312336        bool isDomainAxisChecked; 
    313337        bool isIndexSent; 
     338 
     339        int nTiles_; 
     340/** True if tiled data is defined on the grid */ 
     341        bool isTiled_; 
     342/** True if ONLY tiled data is defined on the grid */ 
     343        bool isTiledOnly_; 
     344 
     345/** Vector containing local domain indexes for each tile */ 
     346        std::vector<CArray<int,1> > storeTileIndex; 
    314347 
    315348        CDomainGroup* vDomainGroup_; 
     
    321354/** Client-like distribution calculated based on the knowledge of the entire grid */ 
    322355        CDistributionClient* clientDistribution_; 
     356 
     357/** Client-like distribution calculated based on the knowledge of the entire grid in case of a tiled domain */ 
     358        CDistributionClient* clientDistributionTiled_; 
     359 
    323360 
    324361/** Server-like distribution calculated upon receiving indexes */ 
     
    387424 
    388425   template <int n> 
    389    void CGrid::maskField(const CArray<double,n>& field, CArray<double,1>& stored) const 
     426   void CGrid::copyTile(const CArray<double,n>& tileData, CArray<double,1>& storedData, int tileId) 
     427   { 
     428      this->copyTile_arr(tileData.dataFirst(), storedData, tileId); 
     429   } 
     430 
     431   template <int n> 
     432   void CGrid::maskField(const CArray<double,n>& field, CArray<double,1>& stored, bool isTiled) const 
    390433   { 
    391434//#ifdef __XIOS_DEBUG 
    392435      if (this->getDataSize() != field.numElements()) 
    393          ERROR("void CGrid::inputField(const  CArray<double,n>& field, CArray<double,1>& stored) const", 
     436         ERROR("void CGrid::maskField(const  CArray<double,n>& field, CArray<double,1>& stored) const", 
    394437                << "[ Awaiting data of size = " << this->getDataSize() << ", " 
    395438                << "Received data size = "      << field.numElements() << " ] " 
     
    397440                << "Grid = " << this->getId()) 
    398441//#endif 
    399       this->maskField_arr(field.dataFirst(), stored); 
     442      this->maskField_arr(field.dataFirst(), stored, isTiled); 
    400443   } 
    401444 
Note: See TracChangeset for help on using the changeset viewer.