Changeset 2131 for XIOS/trunk/src/node/grid.hpp
- Timestamp:
- 04/23/21 15:00:35 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/grid.hpp
r1927 r2131 91 91 StdSize getDataSize(void) const; 92 92 93 StdSize getTileDataSize(int tileId); 94 95 StdSize getTileSize(int tileId); 96 93 97 /// Entrees-sorties de champs 94 98 template <int n> 95 99 void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const; 96 100 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; 98 102 template <int n> 99 103 void outputField(const CArray<double,1>& stored, CArray<double,n>& field) const; 100 104 template <int n> 101 105 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); 102 108 103 109 virtual void parse(xml::CXMLNode& node); … … 205 211 public: 206 212 CArray<int, 1> storeIndex_client; 213 CArray<int, 1> storeIndexTiled_client; 207 214 CArray<bool, 1> storeMask_client; 215 CArray<bool, 1> storeMaskTiled_client; 208 216 209 217 /** Map containing indexes that will be sent in sendIndex(). */ … … 223 231 /** Map storing received indexes. Key = sender rank, value = index array. */ 224 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; 225 236 226 237 // Manh Ha's comment: " A client receives global index from other clients (via recvIndex) … … 232 243 * The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData() */ 233 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 234 250 235 251 /** Indexes calculated based on server-like distribution. … … 255 271 const std::vector<CScalar*>& scalars, 256 272 const CArray<int,1>& axisDomainOrder); 273 274 int getNTiles(); 275 bool isTiled(void) const; 276 bool isTiledOnly(void) const; 257 277 258 278 private: … … 272 292 void restoreField_arr(const CArray<double, 1>& stored, double* const data) const; 273 293 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); 275 296 276 297 void setVirtualDomainGroup(CDomainGroup* newVDomainGroup); … … 299 320 300 321 void computeClientIndex(); 322 void computeClientIndexTiled(); 301 323 void computeConnectedClients(); 302 324 void computeClientIndexScalarGrid(); 303 325 void computeConnectedClientsScalarGrid(); 304 326 327 void computeTileIndex(); 328 305 329 private: 306 330 … … 312 336 bool isDomainAxisChecked; 313 337 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; 314 347 315 348 CDomainGroup* vDomainGroup_; … … 321 354 /** Client-like distribution calculated based on the knowledge of the entire grid */ 322 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 323 360 324 361 /** Server-like distribution calculated upon receiving indexes */ … … 387 424 388 425 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 390 433 { 391 434 //#ifdef __XIOS_DEBUG 392 435 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", 394 437 << "[ Awaiting data of size = " << this->getDataSize() << ", " 395 438 << "Received data size = " << field.numElements() << " ] " … … 397 440 << "Grid = " << this->getId()) 398 441 //#endif 399 this->maskField_arr(field.dataFirst(), stored );442 this->maskField_arr(field.dataFirst(), stored, isTiled); 400 443 } 401 444
Note: See TracChangeset
for help on using the changeset viewer.