Changeset 1129 for XIOS/dev/dev_olga/src/node/grid.hpp
- Timestamp:
- 05/11/17 18:25:20 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/node/grid.hpp
r1099 r1129 140 140 void computeIndexScalarGrid(); 141 141 void computeCompressedIndex(); 142 void computeWrittenIndex(); 142 143 143 144 void solveDomainRef(bool checkAtt); … … 224 225 std::vector<map<int,int> > nbSenders; 225 226 226 map<int, CArray<size_t, 1> > outIndexFromClient, compressedOutIndexFromClient; 227 map<int, CArray<size_t, 1> > outIndexFromClient, compressedOutIndexFromClient, outGlobalIndexFromClient; 228 229 // A client receives global index from other clients (via recvIndex) 230 // then does mapping these index into local index of STORE_CLIENTINDEX 231 // In this way, store_clientIndex can be used as an input of a source filter 232 // Maybe we need a flag to determine whether a client wants to write. TODO 233 map<int, CArray<size_t, 1> > outLocalIndexStoreOnClient; 234 235 // If a client wants to write out data, it'll use this index. 236 // A client receives global index of data from other clients (via recvIndex), 237 // then does remapping these index into local index to WRITE into a file 238 CArray<size_t,1> localIndexToWriteOnClient, localIndexToWriteOnServer; 239 227 240 CArray<size_t,1> indexFromClients; 228 241 void checkMask(void); 229 242 void createMask(void); 230 void modifyMask(const CArray<int,1>& indexToModify); 243 void modifyMask(const CArray<int,1>& indexToModify, bool valueToModify = false); 244 void modifyMaskSize(const std::vector<int>& newDimensionSize, bool newValue = false); 231 245 232 246 void computeGridGlobalDimension(const std::vector<CDomain*>& domains, … … 243 257 bool createMask = false); 244 258 template<int N> 245 void modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify); 259 void modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify); 260 261 template<int N> 262 void modifyGridMaskSize(CArray<bool,N>& gridMask, const std::vector<int>& eachDimSize, bool newValue); 246 263 247 264 void setVirtualDomainGroup(CDomainGroup* newVDomainGroup); … … 285 302 std::set<std::string> relFilesCompressed; 286 303 287 bool isTransformed_ ;288 bool isGenerated_;304 bool isTransformed_, isGenerated_; 305 bool computedWrittenIndex_; 289 306 std::vector<int> axisPositionInGrid_; 290 307 CGridTransformation* transformations_; … … 416 433 } 417 434 435 template<int N> 436 void CGrid::modifyGridMaskSize(CArray<bool,N>& gridMask, 437 const std::vector<int>& eachDimSize, 438 bool newValue) 439 { 440 if (N != eachDimSize.size()) 441 { 442 // ERROR("CGrid::modifyGridMaskSize(CArray<bool,N>& gridMask, 443 // const std::vector<int>& eachDimSize, 444 // bool newValue)", 445 // << "Dimension size of the mask is different from input dimension size." << std::endl 446 // << "Mask dimension is " << N << "." << std::endl 447 // << "Input dimension is " << eachDimSize.size() << "." << std::endl 448 // << "Grid = " << this->GetName()) 449 } 450 CArrayBoolTraits<CArray<bool,N> >::resizeArray(gridMask,eachDimSize); 451 gridMask = newValue; 452 } 453 454 418 455 /*! 419 456 Modify the current mask of grid, the local index to be modified will take value false … … 422 459 */ 423 460 template<int N> 424 void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify) 425 { 426 bool valueToModify = false; 461 void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify) 462 { 427 463 int num = indexToModify.numElements(); 428 464 for (int idx = 0; idx < num; ++idx)
Note: See TracChangeset
for help on using the changeset viewer.