Changeset 1389
- Timestamp:
- 12/22/17 14:57:35 (5 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src/transformation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/transformation/generic_algorithm_transformation.cpp
r1298 r1389 254 254 } 255 255 } 256 256 257 /* 257 258 if (!computedProcSrcNonTransformedElement_) 258 259 { … … 292 293 293 294 procContainSrcElementIdx_.swap(procContainSrcElementIdx); 294 295 */ 296 std::set<int> commonProc ; 297 if (procElementList_.empty()) procElementList_.resize(axisDomainDstOrder.numElements()) ; 298 for (idx = 0; idx < axisDomainDstOrder.numElements(); ++idx) 299 { 300 std::set<int>& procList=procElementList_[idx] ; 301 std::set<int> commonTmp ; 302 if (idx == elementPositionInGrid) 303 { 304 set<int> tmpSet ; 305 procList.swap(tmpSet) ; 306 CClientClientDHTInt::Index2VectorInfoTypeMap::iterator itIdxb = globalIndexOfTransformedElementOnProc.begin(), 307 itIdxe = globalIndexOfTransformedElementOnProc.end(), itIdx; 308 for (itIdx = itIdxb; itIdx != itIdxe; ++itIdx) 309 { 310 std::vector<int>& tmp = itIdx->second; 311 for (int i = 0; i < tmp.size(); ++i) procList.insert(tmp[i]); 312 if (tmp.size() == nbClient) 313 break; 314 } 315 } 316 else 317 { 318 if (!computedProcSrcNonTransformedElement_) 319 { 320 set<int> tmpSet ; 321 procList.swap(tmpSet) ; 322 boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 323 ite = globalElementIndexOnProc_[idx].end(); 324 for (it = itb; it != ite; ++it) 325 { 326 procList.insert(it->first); 327 if (procList.size() == nbClient) break; 328 } 329 } 330 } 331 332 if (idx==0) commonProc.swap(procList) ; 333 else 334 { 335 for (std::set<int>::iterator it = commonProc.begin(); it != commonProc.end(); ++it) 336 if (procList.count(*it)==1) commonTmp.insert(*it) ; 337 commonProc.swap(commonTmp) ; 338 } 339 } 340 std::vector<int> procContainSrcElementIdx(commonProc.size()); 341 int count = 0; 342 for (std::set<int>::iterator it = commonProc.begin(); it != commonProc.end(); ++it) procContainSrcElementIdx[count++] = *it; 343 procContainSrcElementIdx_.swap(procContainSrcElementIdx); 344 295 345 // For the first time, surely we calculate proc containing non transformed elements 296 if (!computedProcSrcNonTransformedElement_) 297 computedProcSrcNonTransformedElement_ = true; 346 if (!computedProcSrcNonTransformedElement_) computedProcSrcNonTransformedElement_ = true; 298 347 } 299 348 … … 320 369 { 321 370 tmpCounter.insert(srcIndex[idx]); 322 323 std::vector<int>& srcProc = globalIndexOfTransformedElementOnProc[srcIndex[idx]]; 324 for (int j = 0; j < srcProc.size(); ++j) 325 globalElementIndexOnProc_[elementPositionInGrid][srcProc[j]].push_back(srcIndex[idx]); 326 /* 371 327 372 for (int j = 0; j < procContainSrcElementIdx_.size(); ++j) 328 globalElementIndexOnProc_[elementPositionInGrid][procContainSrcElementIdx_[j]].push_back(srcIndex[idx]); */373 globalElementIndexOnProc_[elementPositionInGrid][procContainSrcElementIdx_[j]].push_back(srcIndex[idx]); 329 374 } 330 375 } -
XIOS/dev/XIOS_DEV_CMIP6/src/transformation/generic_algorithm_transformation.hpp
r1298 r1389 143 143 144 144 std::vector<int> procContainSrcElementIdx_; // List of processes containing source index of transformed elements 145 std::set<int> procOfNonTransformedElements_; // Processes contain the source index of non-transformed elements 145 // std::set<int> procOfNonTransformedElements_; // Processes contain the source index of non-transformed elements 146 std::vector< set<int> > procElementList_ ; // List of processes containing source index of elements 146 147 147 148
Note: See TracChangeset
for help on using the changeset viewer.