Ignore:
Timestamp:
02/15/21 21:14:02 (3 years ago)
Author:
oabramkina
Message:

Adding a possibility of tiled and non-tiled sent on the same domain.

File:
1 edited

Legend:

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

    r1966 r2034  
    9999         void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const; 
    100100         template <int n> 
    101          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; 
    102102         template <int n> 
    103103         void outputField(const CArray<double,1>& stored, CArray<double,n>& field) const;   
     
    211211      public: 
    212212         CArray<int, 1> storeIndex_client; 
     213         CArray<int, 1> storeIndexTiled_client; 
    213214         CArray<bool, 1> storeMask_client; 
     215         CArray<bool, 1> storeMaskTiled_client; 
    214216 
    215217/** Map containing indexes that will be sent in sendIndex(). */ 
     
    229231/** Map storing received indexes. Key = sender rank, value = index array. */ 
    230232         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; 
    231236 
    232237// Manh Ha's comment: " A client receives global index from other clients (via recvIndex) 
     
    238243 *  The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData() */ 
    239244         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 
    240250 
    241251/** Indexes calculated based on server-like distribution. 
     
    263273 
    264274         int getNTiles(); 
     275         bool isTiled(void) const; 
     276         bool isTiledOnly(void) const; 
    265277 
    266278      private: 
     
    280292        void restoreField_arr(const CArray<double, 1>& stored, double* const data) const; 
    281293        void uncompressField_arr(const double* const data, CArray<double, 1>& outData) const; 
    282         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; 
    283295        void copyTile_arr(const double* const tileData, CArray<double, 1>& stored, int tileId); 
    284296 
     
    308320 
    309321        void computeClientIndex(); 
     322        void computeClientIndexTiled(); 
    310323        void computeConnectedClients(); 
    311324        void computeClientIndexScalarGrid();  
     
    325338 
    326339        int nTiles_; 
     340/** True if tiled data is defined on the grid */ 
    327341        bool isTiled_; 
     342/** True if ONLY tiled data is defined on the grid */ 
     343        bool isTiledOnly_; 
     344 
    328345/** Vector containing local domain indexes for each tile */ 
    329346        std::vector<CArray<int,1> > storeTileIndex; 
     
    337354/** Client-like distribution calculated based on the knowledge of the entire grid */ 
    338355        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 
    339360 
    340361/** Server-like distribution calculated upon receiving indexes */ 
     
    409430 
    410431   template <int n> 
    411    void CGrid::maskField(const CArray<double,n>& field, CArray<double,1>& stored) const 
     432   void CGrid::maskField(const CArray<double,n>& field, CArray<double,1>& stored, bool isTiled) const 
    412433   { 
    413434//#ifdef __XIOS_DEBUG 
     
    419440                << "Grid = " << this->getId()) 
    420441//#endif 
    421       this->maskField_arr(field.dataFirst(), stored); 
    422    } 
     442      this->maskField_arr(field.dataFirst(), stored, isTiled); 
     443   } 
     444 
     445//   template <int n> 
     446//   void CGrid::maskFieldTiled(const CArray<double,n>& field, CArray<double,1>& stored) const 
     447//   { 
     448////#ifdef __XIOS_DEBUG 
     449//      if (this->getDataSize() != field.numElements()) 
     450//         ERROR("void CGrid::maskField(const  CArray<double,n>& field, CArray<double,1>& stored) const", 
     451//                << "[ Awaiting data of size = " << this->getDataSize() << ", " 
     452//                << "Received data size = "      << field.numElements() << " ] " 
     453//                << "The data array does not have the right size! " 
     454//                << "Grid = " << this->getId()) 
     455////#endif 
     456//      this->maskField_arr(field.dataFirst(), stored, true); 
     457//   } 
    423458 
    424459   template <int n> 
Note: See TracChangeset for help on using the changeset viewer.