Changeset 2034 for XIOS/dev/dev_oa/src/node/grid.hpp
- Timestamp:
- 02/15/21 21:14:02 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_oa/src/node/grid.hpp
r1966 r2034 99 99 void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const; 100 100 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; 102 102 template <int n> 103 103 void outputField(const CArray<double,1>& stored, CArray<double,n>& field) const; … … 211 211 public: 212 212 CArray<int, 1> storeIndex_client; 213 CArray<int, 1> storeIndexTiled_client; 213 214 CArray<bool, 1> storeMask_client; 215 CArray<bool, 1> storeMaskTiled_client; 214 216 215 217 /** Map containing indexes that will be sent in sendIndex(). */ … … 229 231 /** Map storing received indexes. Key = sender rank, value = index array. */ 230 232 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; 231 236 232 237 // Manh Ha's comment: " A client receives global index from other clients (via recvIndex) … … 238 243 * The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData() */ 239 244 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 240 250 241 251 /** Indexes calculated based on server-like distribution. … … 263 273 264 274 int getNTiles(); 275 bool isTiled(void) const; 276 bool isTiledOnly(void) const; 265 277 266 278 private: … … 280 292 void restoreField_arr(const CArray<double, 1>& stored, double* const data) const; 281 293 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; 283 295 void copyTile_arr(const double* const tileData, CArray<double, 1>& stored, int tileId); 284 296 … … 308 320 309 321 void computeClientIndex(); 322 void computeClientIndexTiled(); 310 323 void computeConnectedClients(); 311 324 void computeClientIndexScalarGrid(); … … 325 338 326 339 int nTiles_; 340 /** True if tiled data is defined on the grid */ 327 341 bool isTiled_; 342 /** True if ONLY tiled data is defined on the grid */ 343 bool isTiledOnly_; 344 328 345 /** Vector containing local domain indexes for each tile */ 329 346 std::vector<CArray<int,1> > storeTileIndex; … … 337 354 /** Client-like distribution calculated based on the knowledge of the entire grid */ 338 355 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 339 360 340 361 /** Server-like distribution calculated upon receiving indexes */ … … 409 430 410 431 template <int n> 411 void CGrid::maskField(const CArray<double,n>& field, CArray<double,1>& stored ) const432 void CGrid::maskField(const CArray<double,n>& field, CArray<double,1>& stored, bool isTiled) const 412 433 { 413 434 //#ifdef __XIOS_DEBUG … … 419 440 << "Grid = " << this->getId()) 420 441 //#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 // } 423 458 424 459 template <int n>
Note: See TracChangeset
for help on using the changeset viewer.