- Timestamp:
- 09/10/20 13:51:02 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/distributed_view.hpp
r1918 r1930 15 15 16 16 CDistributedView(CDistributedElement* parent, CElementView::type type, const std::map<int,CArray<int,1>>& indexView) ; 17 CDistributedView(CDistributedElement* parent, CElementView::type type, const std::map<int,CArray<bool,1>>& maskView) ; 17 18 18 19 std::map<int,CArray<int,1>>& getIndex(void) { return index_ ;} … … 21 22 std::map<int, int>& getLocalSize(void) { return localSize_ ;} 22 23 size_t getGlobalSize(void) { return globalSize_ ;} 24 25 void getGlobalIndexView(map<int,CArray<size_t,1>>& globalIndexView) 26 { 27 for(auto& it : globalIndex_) 28 { 29 int rank=it.first ; 30 auto& globalIndex = it.second; 31 auto& globalIndView = globalIndexView[rank] ; 32 auto& index = index_[rank] ; 33 auto& size = size_[rank] ; 34 auto& localSize = localSize_[rank] ; 35 globalIndView.resize(size) ; 36 int pos=0 ; 37 for(int i=0 ; i<size ; i++) 38 { 39 if (index(i)>=0 && index(i)<localSize) 40 { 41 globalIndView(i) = globalIndex(index(i)) ; 42 pos++ ; 43 } 44 } 45 globalIndView.resizeAndPreserve(pos) ; 46 } 47 } 23 48 24 49 void getGlobalIndex(int rank, vector<size_t>& globalIndex, size_t sliceIndex, size_t* sliceSize, CDistributedView** view, int pos)
Note: See TracChangeset
for help on using the changeset viewer.