Changeset 1078 for XIOS/trunk/src/node
- Timestamp:
- 03/17/17 16:02:40 (7 years ago)
- Location:
- XIOS/trunk/src/node
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/domain.cpp
r1064 r1078 31 31 : CObjectTemplate<CDomain>(), CDomainAttributes() 32 32 , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_() 33 , hasBounds(false), hasArea(false), isDistributed_(false), nGlobDomain_(),isCompressible_(false), isUnstructed_(false)33 , hasBounds(false), hasArea(false), isDistributed_(false), isCompressible_(false), isUnstructed_(false) 34 34 , isClientAfterTransformationChecked(false), hasLonLat(false) 35 35 , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client() … … 41 41 : CObjectTemplate<CDomain>(id), CDomainAttributes() 42 42 , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_() 43 , hasBounds(false), hasArea(false), isDistributed_(false), nGlobDomain_(),isCompressible_(false), isUnstructed_(false)43 , hasBounds(false), hasArea(false), isDistributed_(false), isCompressible_(false), isUnstructed_(false) 44 44 , isClientAfterTransformationChecked(false), hasLonLat(false) 45 45 , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client() … … 844 844 for (int i = 0; i < ni; ++i) j_index(i+j*ni) = j+jbegin; 845 845 } 846 computeNGlobDomain();846 847 847 checkZoom(); 848 848 … … 1550 1550 int nbServer = client->serverSize; 1551 1551 1552 CServerDistributionDescription serverDescription( nGlobDomain_, nbServer);1552 CServerDistributionDescription serverDescription(getNbGlob(), nbServer); 1553 1553 if (isUnstructed_) serverDescription.computeServerDistribution(false, 0); 1554 1554 else serverDescription.computeServerDistribution(false, 1); … … 1587 1587 } 1588 1588 1589 void CDomain::computeNGlobDomain() 1590 { 1591 nGlobDomain_.resize(2); 1592 nGlobDomain_[0] = ni_glo.getValue(); 1593 nGlobDomain_[1] = nj_glo.getValue(); 1589 std::vector<int> CDomain::getNbGlob() 1590 { 1591 std::vector<int> nbGlob(2); 1592 nbGlob[0] = ni_glo.getValue(); 1593 nbGlob[1] = nj_glo.getValue(); 1594 1595 return nbGlob; 1594 1596 } 1595 1597 … … 1685 1687 size_t globalSizeIndex = 1, indexBegin, indexEnd; 1686 1688 int range, clientSize = client->clientSize; 1687 for (int i = 0; i < nGlobDomain_.size(); ++i) globalSizeIndex *= nGlobDomain_[i];1689 for (int i = 0; i < getNbGlob().size(); ++i) globalSizeIndex *= getNbGlob()[i]; 1688 1690 indexBegin = 0; 1689 1691 if (globalSizeIndex <= clientSize) … … 1704 1706 } 1705 1707 1706 CServerDistributionDescription serverDescription( nGlobDomain_, nbServer);1708 CServerDistributionDescription serverDescription(getNbGlob(), nbServer); 1707 1709 if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0); 1708 1710 else serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1); -
XIOS/trunk/src/node/domain.hpp
r1064 r1078 123 123 vector< vector<int> > j_indSrv ; // for each server, j global index to send 124 124 125 std::vector<int> getNbGlob(); 125 126 public: 126 127 /// Mutateur /// … … 210 211 bool isCompressible_; 211 212 bool isRedistributed_; 212 TransMapTypes transformationMap_; 213 std::vector<int> nGlobDomain_; 213 TransMapTypes transformationMap_; 214 214 bool isUnstructed_; 215 215 -
XIOS/trunk/src/node/expand_domain.cpp
r941 r1078 38 38 void CExpandDomain::checkValid(CDomain* domainDst) 39 39 { 40 if (CDomain::type_attr::unstructured != domainDst->type)41 {42 ERROR("CExpandDomain::checkValid(CDomain* domainDst)",43 << "Domain extension is only supported for unstructured" << std::endl44 << "Check type of domain destination, id = " << domainDst->getId());45 }40 // if (CDomain::type_attr::unstructured != domainDst->type) 41 // { 42 // ERROR("CExpandDomain::checkValid(CDomain* domainDst)", 43 // << "Domain extension is only supported for unstructured" << std::endl 44 // << "Check type of domain destination, id = " << domainDst->getId()); 45 // } 46 46 47 47 if (this->type.isEmpty()) this->type.setValue(CExpandDomain::type_attr::edge); -
XIOS/trunk/src/node/grid.cpp
r1008 r1078 31 31 , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0) 32 32 , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 33 , globalDim_(),connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false)33 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 34 34 , transformations_(0), isTransformed_(false) 35 , axisPositionInGrid_(), positionDimensionDistributed_(1),hasDomainAxisBaseRef_(false)35 , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 36 36 , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 37 37 { … … 49 49 , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0) 50 50 , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 51 , globalDim_(),connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false)51 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 52 52 , transformations_(0), isTransformed_(false) 53 , axisPositionInGrid_(), positionDimensionDistributed_(1),hasDomainAxisBaseRef_(false)53 , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 54 54 , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 55 55 { … … 74 74 75 75 76 StdSize CGrid::getDimension(void) const77 { 78 return g lobalDim_.size();76 StdSize CGrid::getDimension(void) 77 { 78 return getGlobalDimension().size(); 79 79 } 80 80 … … 185 185 for (int i = 0; i < axisListP.size(); ++i) 186 186 { 187 axisListP[i]->checkAttributesOnClientAfterTransformation(g lobalDim_,axisPositionInGrid_[i]);187 axisListP[i]->checkAttributesOnClientAfterTransformation(getGlobalDimension(),axisPositionInGrid_[i]); 188 188 } 189 189 } … … 232 232 this->solveScalarRef(areAttributesChecked); 233 233 this->solveAxisRef(areAttributesChecked); 234 this->solveDomainRef(areAttributesChecked); 235 computeGridGlobalDimension(getDomains(), getAxis(), getScalars(), axis_domain_order); 234 this->solveDomainRef(areAttributesChecked); 236 235 this->isDomainAxisChecked = areAttributesChecked; 237 236 } … … 463 462 { 464 463 if (sendAtt) 465 axisListP[i]->sendCheckedAttributes(g lobalDim_,axisPositionInGrid_[i]);464 axisListP[i]->sendCheckedAttributes(getGlobalDimension(),axisPositionInGrid_[i]); 466 465 else 467 466 axisListP[i]->checkAttributesOnClient(); … … 533 532 // Compute mapping between client and server 534 533 std::vector<boost::unordered_map<size_t,std::vector<int> > > indexServerOnElement; 535 CServerDistributionDescription serverDistributionDescription(g lobalDim_, client->serverSize);534 CServerDistributionDescription serverDistributionDescription(getGlobalDimension(), client->serverSize); 536 535 serverDistributionDescription.computeServerGlobalByElement(indexServerOnElement, 537 536 client->clientRank, 538 537 client->clientSize, 539 538 axis_domain_order, 540 positionDimensionDistributed_);539 getDistributedDimension()); 541 540 computeIndexByElement(indexServerOnElement, globalIndexOnServer_); 542 541 … … 1323 1322 } 1324 1323 1325 void CGrid::computeGridGlobalDimension(const std::vector<CDomain*>& domains, 1326 const std::vector<CAxis*>& axis, 1327 const std::vector<CScalar*>& scalars, 1328 const CArray<int,1>& axisDomainOrder) 1329 { 1330 globalDim_.resize(domains.size()*2+axis.size()+scalars.size()); 1324 /* 1325 Compute on the fly the global dimension of a grid with its elements 1326 \param[in/out] globalDim global dimension of grid 1327 \param[in] domains list of its domains 1328 \param[in] axiss list of its axis 1329 \param[in] scalars list of its scalars 1330 \param[in] axisDomainOrder the order of element in a grid (e.g: scalar then axis) 1331 \return The dimension of which we do distribution (often for server) 1332 */ 1333 int CGrid::computeGridGlobalDimension(std::vector<int>& globalDim, 1334 const std::vector<CDomain*> domains, 1335 const std::vector<CAxis*> axis, 1336 const std::vector<CScalar*> scalars, 1337 const CArray<int,1>& axisDomainOrder) 1338 { 1339 globalDim.resize(domains.size()*2+axis.size()+scalars.size()); 1340 int positionDimensionDistributed = 1; 1331 1341 int idx = 0, idxDomain = 0, idxAxis = 0, idxScalar = 0; 1332 1342 for (int i = 0; i < axisDomainOrder.numElements(); ++i) … … 1336 1346 if (!(domains[idxDomain]->type.isEmpty()) && (domains[idxDomain]->type==CDomain::type_attr::unstructured)) 1337 1347 { 1338 positionDimensionDistributed _= idx;1348 positionDimensionDistributed = idx; 1339 1349 } 1340 1350 else 1341 1351 { 1342 positionDimensionDistributed _= idx +1;1343 } 1344 1345 globalDim _[idx] = domains[idxDomain]->ni_glo.getValue();1346 globalDim _[idx+1] = domains[idxDomain]->nj_glo.getValue();1352 positionDimensionDistributed = idx +1; 1353 } 1354 1355 globalDim[idx] = domains[idxDomain]->ni_glo.getValue(); 1356 globalDim[idx+1] = domains[idxDomain]->nj_glo.getValue(); 1347 1357 1348 1358 ++idxDomain; … … 1351 1361 else if (1 == axisDomainOrder(i)) 1352 1362 { 1353 globalDim _[idx] = axis[idxAxis]->n_glo.getValue();1363 globalDim[idx] = axis[idxAxis]->n_glo.getValue(); 1354 1364 ++idxAxis; 1355 1365 ++idx; … … 1357 1367 else 1358 1368 { 1359 globalDim _[idx] = 1;1369 globalDim[idx] = 1; 1360 1370 ++idxScalar; 1361 1371 ++idx; 1362 1372 } 1363 1373 } 1364 } 1365 1374 1375 return positionDimensionDistributed; 1376 } 1377 1378 // Retrieve the global dimension of grid 1366 1379 std::vector<int> CGrid::getGlobalDimension() 1367 1380 { 1368 return globalDim_; 1381 std::vector<int> globalDim; 1382 computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order); 1383 1384 return globalDim; 1385 } 1386 1387 // Retrieve dimension on which we do distribution (Very often, it should be 2nd dimension) 1388 int CGrid::getDistributedDimension() 1389 { 1390 std::vector<int> globalDim; 1391 return computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order); 1369 1392 } 1370 1393 -
XIOS/trunk/src/node/grid.hpp
r988 r1078 87 87 88 88 /// Accesseurs /// 89 StdSize getDimension(void) const;89 StdSize getDimension(void); 90 90 91 91 StdSize getDataSize(void) const; … … 229 229 void modifyMask(const CArray<int,1>& indexToModify); 230 230 231 void computeGridGlobalDimension(const std::vector<CDomain*>& domains,232 const std::vector<CAxis*>& axis,233 const std::vector<CScalar*>& scalars,234 const CArray<int,1>& axisDomainOrder);235 236 231 private: 237 232 template<int N> … … 261 256 CClientServerMapping::GlobalIndexMap& globalIndexOnServer); 262 257 258 int computeGridGlobalDimension(std::vector<int>& globalDim, 259 const std::vector<CDomain*> domains, 260 const std::vector<CAxis*> axis, 261 const std::vector<CScalar*> scalars, 262 const CArray<int,1>& axisDomainOrder); 263 264 int getDistributedDimension(); 263 265 private: 264 266 CDomainGroup* vDomainGroup_; … … 276 278 std::vector<int> connectedServerRank_; 277 279 bool isDataDistributed_; 278 int positionDimensionDistributed_;280 279 281 //! True if and only if the data defined on the grid can be outputted in a compressed way 280 282 bool isCompressible_; … … 285 287 std::vector<int> axisPositionInGrid_; 286 288 CGridTransformation* transformations_; 287 bool hasDomainAxisBaseRef_; 288 std::vector<int> globalDim_; 289 bool hasDomainAxisBaseRef_; 289 290 std::map<CGrid*, std::pair<bool,StdString> > gridSrc_; 290 291 bool hasTransform_;
Note: See TracChangeset
for help on using the changeset viewer.