Changeset 657 for XIOS/trunk/src/node/grid.cpp
- Timestamp:
- 07/28/15 13:37:07 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/grid.cpp
r656 r657 13 13 #include "context_server.hpp" 14 14 #include "array_new.hpp" 15 #include "server_distribution_description.hpp" 15 16 #include "client_server_mapping_distributed.hpp" 16 17 … … 23 24 , isChecked(false), isDomainAxisChecked(false) 24 25 , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false), clientDistribution_(0), isIndexSent(false) 25 , serverDistribution_(0), serverDistributionDescription_(0),clientServerMap_(0), writtenDataSize_(0), globalDim_()26 , serverDistribution_(0), clientServerMap_(0), writtenDataSize_(0), globalDim_() 26 27 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), transformations_(0), isTransformed_(false) 27 , axisPositionInGrid_() 28 , axisPositionInGrid_(), positionDimensionDistributed_(1) 28 29 { 29 30 setVirtualDomainGroup(); … … 35 36 , isChecked(false), isDomainAxisChecked(false) 36 37 , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false), clientDistribution_(0), isIndexSent(false) 37 , serverDistribution_(0), serverDistributionDescription_(0),clientServerMap_(0), writtenDataSize_(0), globalDim_()38 , serverDistribution_(0), clientServerMap_(0), writtenDataSize_(0), globalDim_() 38 39 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), transformations_(0), isTransformed_(false) 39 , axisPositionInGrid_() 40 , axisPositionInGrid_(), positionDimensionDistributed_(1) 40 41 { 41 42 setVirtualDomainGroup(); … … 47 48 if (0 != clientDistribution_) delete clientDistribution_; 48 49 if (0 != serverDistribution_) delete serverDistribution_; 49 if (0 != serverDistributionDescription_) delete serverDistributionDescription_;50 50 if (0 != clientServerMap_) delete clientServerMap_; 51 51 if (0 != transformations_) delete transformations_; … … 58 58 ENodeType CGrid::GetType(void) { return eGrid; } 59 59 60 //---------------------------------------------------------------61 60 62 61 StdSize CGrid::getDimension(void) const … … 112 111 } 113 112 113 // In some cases in which domain is masked, we need to count for connected server for longitude and latitude 114 std::vector<CDomain*> domListP = this->getDomains(); 115 if (!domListP.empty()) 116 { 117 for (int i = 0; i < domListP.size(); ++i) 118 { 119 const std::map<int, vector<size_t> >& indexDomainServer = domListP[i]->getIndexServer(); 120 std::map<int, vector<size_t> >::const_iterator itDom = indexDomainServer.begin(), iteDom = indexDomainServer.end(); 121 for (; itDom != iteDom; ++itDom) 122 { 123 if (ret.end() == ret.find(itDom->first)) 124 { 125 retVal = (itDom->second).size(); 126 retVal *= secureFactor; 127 ret.insert(std::make_pair<int,StdSize>(itDom->first, retVal)); 128 } 129 } 130 } 131 } 132 114 133 return ret; 115 134 } 116 135 136 void CGrid::checkAttributesAfterTransformation() 137 { 138 setDomainList(); 139 std::vector<CDomain*> domListP = this->getDomains(); 140 if (!domListP.empty()) 141 { 142 for (int i = 0; i < domListP.size(); ++i) 143 { 144 domListP[i]->checkAttributesOnClientAfterTransformation(); 145 } 146 } 147 } 117 148 118 149 void CGrid::solveDomainAxisRef(bool areAttributesChecked) … … 122 153 this->solveAxisRef(areAttributesChecked); 123 154 this->solveDomainRef(areAttributesChecked); 124 155 computeGridGlobalDimension(getDomains(), getAxis(), axis_domain_order); 125 156 this->isDomainAxisChecked = areAttributesChecked; 126 157 } … … 153 184 if (context->hasClient) 154 185 { 155 checkMask(); 186 this->checkAttributesAfterTransformation(); 187 this->checkMask(); 156 188 this->computeIndex(); 157 189 } … … 229 261 if (!domListP.empty()) 230 262 { 231 computeGridGlobalDimension(getDomains(), getAxis(), axis_domain_order);232 263 for (int i = 0; i < domListP.size(); ++i) 233 264 { … … 258 289 } 259 290 260 computeGridGlobalDimension(getDomains(), getAxis(), axis_domain_order);261 291 for (int i = 0; i < axisListP.size(); ++i) 262 292 { … … 267 297 ++idx; 268 298 } 269 270 299 } 271 300 } … … 275 304 return axisPositionInGrid_; 276 305 } 277 278 306 279 307 //--------------------------------------------------------------- … … 317 345 318 346 // Then compute distribution on server side 319 serverDistributionDescription_ = new CServerDistributionDescription(clientDistribution_->getNGlob());320 serverDistributionDescription _->computeServerDistribution(client->serverSize, true);321 serverDistributionDescription_->computeServerGlobalIndexInRange(client->serverSize,322 std::make_pair<size_t,size_t>(indexBegin, indexEnd));347 CServerDistributionDescription serverDistributionDescription(globalDim_); 348 serverDistributionDescription.computeServerGlobalIndexInRange(client->serverSize, 349 std::make_pair<size_t,size_t>(indexBegin, indexEnd), 350 positionDimensionDistributed_); 323 351 324 352 // Finally, compute index mapping between client(s) and server(s) 325 clientServerMap_ = new CClientServerMappingDistributed(serverDistributionDescription _->getGlobalIndexRange(),353 clientServerMap_ = new CClientServerMappingDistributed(serverDistributionDescription.getGlobalIndexRange(), 326 354 client->intraComm, 327 355 clientDistribution_->isDataDistributed()); … … 330 358 const std::map<int, std::vector<size_t> >& globalIndexOnServer = clientServerMap_->getGlobalIndexOnServer(); 331 359 const CArray<size_t,1>& globalIndexSendToServer = clientDistribution_->getGlobalDataIndexSendToServer(); 332 333 360 std::map<int, std::vector<size_t> >::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap; 334 361 itbGlobalMap = itGlobalMap = globalIndexOnServer.begin(); … … 640 667 if (axisDomainOrder(i)) 641 668 { 669 if (!(domains[idxDomain]->type.isEmpty()) && (domains[idxDomain]->type==CDomain::type_attr::unstructured)) 670 { 671 positionDimensionDistributed_ = idx; 672 } 673 else 674 { 675 positionDimensionDistributed_ = idx +1; 676 } 677 642 678 globalDim_[idx] = domains[idxDomain]->ni_glo.getValue(); 643 679 globalDim_[idx+1] = domains[idxDomain]->nj_glo.getValue(); 680 644 681 ++idxDomain; 645 682 idx += 2;
Note: See TracChangeset
for help on using the changeset viewer.