- Timestamp:
- 01/31/19 12:12:52 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/transformation/generic_algorithm_transformation.cpp
r1601 r1646 34 34 std::vector<bool>& flagInitial, 35 35 bool ignoreMissingValue, bool firstPass ) 36 TRY 36 37 { 37 38 int nbLocalIndex = localIndex.size(); … … 61 62 } 62 63 } 64 CATCH 63 65 64 66 void CGenericAlgorithmTransformation::computePositionElements(CGrid* dst, CGrid* src) 67 TRY 65 68 { 66 69 int idxScalar = 0, idxAxis = 0, idxDomain = 0; … … 108 111 } 109 112 } 113 CATCH 110 114 111 115 bool CGenericAlgorithmTransformation::isDistributedTransformation(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst) 116 TRY 112 117 { 113 118 … … 147 152 } 148 153 return isDistributed_ ; 149 } 154 } 155 CATCH 156 150 157 /*! 151 158 This function computes the global indexes of grid source, which the grid destination is in demand. … … 160 167 CGrid* gridDst, 161 168 SourceDestinationIndexMap& globaIndexWeightFromSrcToDst) 169 TRY 162 170 { 163 171 CContext* context = CContext::getCurrent(); … … 443 451 } 444 452 } 453 CATCH 445 454 446 455 /*! … … 461 470 std::vector<std::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc, 462 471 SourceDestinationIndexMap& globaIndexWeightFromSrcToDst) 472 TRY 463 473 { 464 474 SourceDestinationIndexMap globaIndexWeightFromSrcToDst_tmp ; … … 640 650 } 641 651 } 642 643 } 652 } 653 CATCH 644 654 645 655 /*! … … 654 664 CArray<size_t,1>& destGlobalIndexPositionInGrid, 655 665 std::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc) 666 TRY 656 667 { 657 668 CContext* context = CContext::getCurrent(); … … 666 677 } 667 678 } 679 CATCH 668 680 669 681 /*! … … 678 690 CArray<size_t,1>& destGlobalIndexPositionInGrid, 679 691 std::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc) 692 TRY 680 693 { 681 694 CContext* context = CContext::getCurrent(); … … 735 748 } 736 749 } 750 CATCH 737 751 738 752 /*! … … 747 761 CArray<size_t,1>& destGlobalIndexPositionInGrid, 748 762 std::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc) 763 TRY 749 764 { 750 765 CContext* context = CContext::getCurrent(); … … 838 853 } 839 854 } 840 841 842 843 844 855 CATCH 845 856 846 857 void CGenericAlgorithmTransformation::computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst, 847 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, vector<bool>& localMaskOnGridDest) 858 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, 859 int& nlocalIndexDest) 860 TRY 848 861 { 849 862 … … 871 884 872 885 int nlocalIndexSrc=1 ; 873 int nlocalIndexDest=1 ; 886 // int nlocalIndexDest=1 ; 887 nlocalIndexDest=1 ; 874 888 CArray<bool,1> maskScalar(1) ; 875 889 maskScalar = true ; … … 933 947 nlocalIndexDest=nlocalIndexDest*nIndexDst[i] ; 934 948 } 935 936 937 938 939 940 949 941 950 vector<int> dstLocalInd ; … … 985 994 } 986 995 987 // just get the local src mask988 CArray<bool,1> localMaskOnSrcGrid;989 gridSrc->getLocalMask(localMaskOnSrcGrid) ;990 // intermediate grid, mask is not initialized => set up mask to true991 if (localMaskOnSrcGrid.isEmpty())992 {993 localMaskOnSrcGrid.resize(nlocalIndexSrc) ;994 localMaskOnSrcGrid=true ;995 }996 997 998 localMaskOnGridDest.resize(nlocalIndexDest,false) ;999 1000 996 vector<vector<vector<pair<int,double> > > > dstIndWeight(transformationMapping_.size()) ; 1001 997 … … 1024 1020 1025 1021 nonDistributedrecursiveFunct(nElement-1,true,elementPositionInGrid,maskSrc,maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight, 1026 currentInd,localSrc,localDst,weight , localMaskOnSrcGrid, localMaskOnGridDest);1022 currentInd,localSrc,localDst,weight); 1027 1023 1028 1024 } 1029 1030 1031 void CGenericAlgorithmTransformation::nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid, vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc, int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd, 1032 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, CArray<bool,1>& localMaskOnGridSrc, vector<bool>& localMaskOnGridDest ) 1025 CATCH 1026 1027 1028 void CGenericAlgorithmTransformation::nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid, 1029 vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, 1030 int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc, 1031 int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd, 1032 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight) 1033 TRY 1033 1034 { 1034 1035 int masked_ ; … … 1043 1044 masked_=masked ; 1044 1045 if (!mask(i)) masked_=false ; 1045 nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight, currentInd, localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ; 1046 nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, 1047 dstIndWeight, currentInd, localSrc, localDst, weight); 1046 1048 } 1047 1049 } … … 1057 1059 for(vector<pair<int,double> >::iterator it = dstIndWeight[t][currentInd].begin(); it!=dstIndWeight[t][currentInd].end(); ++it) 1058 1060 { 1059 if (localMaskOnGridSrc(srcInd)) 1060 { 1061 localSrc.push_back(srcIndCompressed) ; 1062 localDst.push_back(it->first) ; 1063 weight.push_back(it->second) ; 1064 localMaskOnGridDest[it->first]=true ; 1065 } 1061 localSrc.push_back(srcIndCompressed) ; 1062 localDst.push_back(it->first) ; 1063 weight.push_back(it->second) ; 1066 1064 (it->first)++ ; 1067 1065 } 1068 1066 } 1069 1067 if (t < dstIndWeight.size()-1) t++ ; 1070 if (localMaskOnGridSrc(srcInd))srcIndCompressed ++ ;1068 srcIndCompressed ++ ; 1071 1069 } 1072 1070 srcInd++ ; … … 1086 1084 masked_=masked ; 1087 1085 if (!mask(i)) masked_=false ; 1088 nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight , i, localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ; 1086 nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, 1087 srcIndCompressed, nIndexSrc, t, dstIndWeight , i, localSrc, localDst, weight); 1089 1088 } 1090 1089 } … … 1100 1099 for(vector<pair<int,double> >::iterator it = dstIndWeight[t][i].begin(); it!=dstIndWeight[t][i].end(); ++it) 1101 1100 { 1102 if (localMaskOnGridSrc(srcInd)) 1103 { 1104 localSrc.push_back(srcIndCompressed) ; 1105 localDst.push_back(it->first) ; 1106 weight.push_back(it->second) ; 1107 localMaskOnGridDest[it->first]=true ; 1108 } 1101 localSrc.push_back(srcIndCompressed) ; 1102 localDst.push_back(it->first) ; 1103 weight.push_back(it->second) ; 1109 1104 (it->first)++ ; 1110 1105 } 1111 1106 } 1112 1107 if (t < dstIndWeight.size()-1) t++ ; 1113 if (localMaskOnGridSrc(srcInd))srcIndCompressed ++ ;1108 srcIndCompressed ++ ; 1114 1109 } 1115 1110 srcInd++ ; … … 1119 1114 1120 1115 } 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1116 CATCH 1131 1117 1132 1118 /*! … … 1136 1122 */ 1137 1123 void CGenericAlgorithmTransformation::computeIndexSourceMapping(const std::vector<CArray<double,1>* >& dataAuxInputs) 1124 TRY 1138 1125 { 1139 1126 computeIndexSourceMapping_(dataAuxInputs); 1140 1127 } 1128 CATCH 1141 1129 1142 1130 std::vector<StdString> CGenericAlgorithmTransformation::getIdAuxInputs() 1131 TRY 1143 1132 { 1144 1133 return idAuxInputs_; 1145 1134 } 1135 CATCH 1146 1136 1147 1137 CGenericAlgorithmTransformation::AlgoTransType CGenericAlgorithmTransformation::type() 1138 TRY 1148 1139 { 1149 1140 return type_; 1150 1141 } 1151 1152 } 1142 CATCH 1143 1144 }
Note: See TracChangeset
for help on using the changeset viewer.