Changeset 1646 for XIOS/dev/dev_trunk_omp/src/transformation
- Timestamp:
- 01/31/19 12:12:52 (5 years ago)
- Location:
- XIOS/dev/dev_trunk_omp/src/transformation
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_duplicate_scalar.cpp
r1314 r1646 21 21 std::map<int, int>& elementPositionInGridDst2AxisPosition, 22 22 std::map<int, int>& elementPositionInGridDst2DomainPosition) 23 TRY 23 24 { 24 25 std::vector<CAxis*> axisListDestP = gridDst->getAxis(); … … 31 32 return (new CAxisAlgorithmDuplicateScalar(axisListDestP[axisDstIndex], scalarListSrcP[scalarSrcIndex], duplicateScalar)); 32 33 } 34 CATCH 33 35 34 36 bool CAxisAlgorithmDuplicateScalar::registerTrans() 37 TRY 35 38 { 36 39 CGridTransformationFactory<CAxis>::registerTransformation(TRANS_DUPLICATE_SCALAR_TO_AXIS, create); 37 40 } 41 CATCH 38 42 39 43 … … 50 54 51 55 void CAxisAlgorithmDuplicateScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 56 TRY 52 57 { 53 58 this->transformationMapping_.resize(1); … … 69 74 } 70 75 } 71 76 CATCH 72 77 } -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_extract.cpp
r1558 r1646 19 19 std::map<int, int>& elementPositionInGridDst2AxisPosition, 20 20 std::map<int, int>& elementPositionInGridDst2DomainPosition) 21 TRY 21 22 { 22 23 std::vector<CAxis*> axisListDestP = gridDst->getAxis(); … … 29 30 return (new CAxisAlgorithmExtract(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], extractAxis)); 30 31 } 32 CATCH 33 31 34 bool CAxisAlgorithmExtract::registerTrans() 35 TRY 32 36 { 33 37 CGridTransformationFactory<CAxis>::registerTransformation(TRANS_EXTRACT_AXIS, create); 34 38 } 39 CATCH 35 40 36 41 CAxisAlgorithmExtract::CAxisAlgorithmExtract(CAxis* axisDestination, CAxis* axisSource, CExtractAxis* extractAxis) 37 42 : CAxisAlgorithmTransformation(axisDestination, axisSource) 43 TRY 38 44 { 39 45 extractAxis->checkValid(axisSource); … … 104 110 } 105 111 } 112 CATCH 106 113 107 114 /*! -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_extract_domain.cpp
r1601 r1646 24 24 std::map<int, int>& elementPositionInGridDst2AxisPosition, 25 25 std::map<int, int>& elementPositionInGridDst2DomainPosition) 26 TRY 26 27 { 27 28 std::vector<CAxis*> axisListDestP = gridDst->getAxis(); … … 34 35 return (new CAxisAlgorithmExtractDomain(axisListDestP[axisDstIndex], domainListSrcP[domainSrcIndex], extractDomain)); 35 36 } 37 CATCH 36 38 37 39 //bool CAxisAlgorithmExtractDomain::_dummyRegistered = CAxisAlgorithmExtractDomain::registerTrans(); 38 40 bool CAxisAlgorithmExtractDomain::registerTrans() 41 TRY 39 42 { 40 43 CGridTransformationFactory<CAxis>::registerTransformation(TRANS_EXTRACT_DOMAIN_TO_AXIS, create); 41 44 } 45 CATCH 42 46 43 47 44 48 CAxisAlgorithmExtractDomain::CAxisAlgorithmExtractDomain(CAxis* axisDestination, CDomain* domainSource, CExtractDomainToAxis* algo) 45 49 : CAxisAlgorithmTransformation(axisDestination, domainSource), pos_(-1), reduction_(0) 50 TRY 46 51 { 47 52 algo->checkValid(axisDestination, domainSource); … … 67 72 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 68 73 } 74 CATCH 69 75 70 76 void CAxisAlgorithmExtractDomain::apply(const std::vector<std::pair<int,double> >& localIndex, … … 73 79 std::vector<bool>& flagInitial, 74 80 bool ignoreMissingValue, bool firstPass) 81 TRY 75 82 { 76 83 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 77 84 } 85 CATCH 78 86 79 87 CAxisAlgorithmExtractDomain::~CAxisAlgorithmExtractDomain() 88 TRY 80 89 { 81 90 if (0 != reduction_) delete reduction_; 82 91 } 92 CATCH 83 93 84 94 void CAxisAlgorithmExtractDomain::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 95 TRY 85 96 { 86 97 this->transformationMapping_.resize(1); … … 120 131 {} 121 132 } 122 133 CATCH 123 134 } -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_interpolate.cpp
r1412 r1646 29 29 std::map<int, int>& elementPositionInGridDst2AxisPosition, 30 30 std::map<int, int>& elementPositionInGridDst2DomainPosition) 31 TRY 31 32 { 32 33 std::vector<CAxis*> axisListDestP = gridDst->getAxis(); … … 39 40 return (new CAxisAlgorithmInterpolate(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], interpolateAxis)); 40 41 } 42 CATCH 41 43 42 44 bool CAxisAlgorithmInterpolate::registerTrans() 45 TRY 43 46 { 44 47 CGridTransformationFactory<CAxis>::registerTransformation(TRANS_INTERPOLATE_AXIS, create); 45 48 } 46 49 CATCH 47 50 48 51 CAxisAlgorithmInterpolate::CAxisAlgorithmInterpolate(CAxis* axisDestination, CAxis* axisSource, CInterpolateAxis* interpAxis) 49 52 : CAxisAlgorithmTransformation(axisDestination, axisSource), coordinate_(), transPosition_() 53 TRY 50 54 { 51 55 interpAxis->checkValid(axisSource); … … 58 62 } 59 63 } 64 CATCH 60 65 61 66 /*! … … 63 68 */ 64 69 void CAxisAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 70 TRY 65 71 { 66 72 CTimer::get("CAxisAlgorithmInterpolate::computeIndexSourceMapping_").resume() ; … … 88 94 CTimer::get("CAxisAlgorithmInterpolate::computeIndexSourceMapping_").suspend() ; 89 95 } 96 CATCH 90 97 91 98 /*! … … 98 105 const std::vector<int>& indexVec, 99 106 int transPos) 107 TRY 100 108 { 101 109 std::vector<double>::const_iterator itb = axisValue.begin(), ite = axisValue.end(); … … 162 170 computeWeightedValueAndMapping(interpolatingIndexValues, transPos); 163 171 } 172 CATCH 164 173 165 174 /*! … … 168 177 */ 169 178 void CAxisAlgorithmInterpolate::computeWeightedValueAndMapping(const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos) 179 TRY 170 180 { 171 181 TransformationIndexMap& transMap = this->transformationMapping_[transPos]; … … 205 215 206 216 } 217 CATCH 207 218 208 219 /*! … … 213 224 void CAxisAlgorithmInterpolate::retrieveAllAxisValue(const CArray<double,1>& axisValue, const CArray<bool,1>& axisMask, 214 225 std::vector<double>& recvBuff, std::vector<int>& indexVec) 226 TRY 215 227 { 216 228 CContext* context = CContext::getCurrent(); … … 282 294 } 283 295 } 296 CATCH 284 297 285 298 /*! … … 289 302 void CAxisAlgorithmInterpolate::fillInAxisValue(std::vector<CArray<double,1> >& vecAxisValue, 290 303 const std::vector<CArray<double,1>* >& dataAuxInputs) 304 TRY 291 305 { 292 306 if (coordinate_.empty()) … … 377 391 } 378 392 } 379 380 } 393 CATCH 394 395 } -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_inverse.cpp
r1601 r1646 15 15 #include "inverse_axis.hpp" 16 16 #include "client_client_dht_template.hpp" 17 #ifdef _usingEP 17 18 using namespace ep_lib; 19 #endif 18 20 19 21 namespace xios { … … 28 30 std::map<int, int>& elementPositionInGridDst2AxisPosition, 29 31 std::map<int, int>& elementPositionInGridDst2DomainPosition) 32 TRY 30 33 { 31 34 std::vector<CAxis*> axisListDestP = gridDst->getAxis(); … … 38 41 return (new CAxisAlgorithmInverse(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], inverseAxis)); 39 42 } 43 CATCH 40 44 41 45 bool CAxisAlgorithmInverse::registerTrans() 46 TRY 42 47 { 43 48 CGridTransformationFactory<CAxis>::registerTransformation(TRANS_INVERSE_AXIS, create); 44 49 } 45 50 CATCH 46 51 47 52 CAxisAlgorithmInverse::CAxisAlgorithmInverse(CAxis* axisDestination, CAxis* axisSource, CInverseAxis* inverseAxis) 48 53 : CAxisAlgorithmTransformation(axisDestination, axisSource) 54 TRY 49 55 { 50 56 if (axisDestination->n_glo.getValue() != axisSource->n_glo.getValue()) … … 56 62 } 57 63 } 64 CATCH 58 65 59 66 void CAxisAlgorithmInverse::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 67 TRY 60 68 { 61 69 this->transformationMapping_.resize(1); … … 83 91 } 84 92 } 93 CATCH 85 94 86 95 /*! … … 89 98 */ 90 99 void CAxisAlgorithmInverse::updateAxisValue() 100 TRY 91 101 { 92 102 CContext* context = CContext::getCurrent(); … … 283 293 delete [] itLong->second; 284 294 } 285 286 } 295 CATCH 296 297 } -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_reduce_axis.cpp
r1601 r1646 23 23 std::map<int, int>& elementPositionInGridDst2AxisPosition, 24 24 std::map<int, int>& elementPositionInGridDst2DomainPosition) 25 TRY 25 26 { 26 27 std::vector<CAxis*> axisListDestP = gridDst->getAxis(); … … 33 34 return (new CAxisAlgorithmReduceAxis(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], reduceAxis)); 34 35 } 36 CATCH 35 37 36 38 bool CAxisAlgorithmReduceAxis::registerTrans() 39 TRY 37 40 { 38 41 CGridTransformationFactory<CAxis>::registerTransformation(TRANS_REDUCE_AXIS_TO_AXIS, create); 39 42 } 43 CATCH 40 44 41 45 42 46 CAxisAlgorithmReduceAxis::CAxisAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToAxis* algo) 43 47 : CAxisAlgorithmTransformation(axisDestination, axisSource), reduction_(0) 48 TRY 44 49 { 45 50 eliminateRedondantSrc_= false ; … … 74 79 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 75 80 } 81 CATCH 76 82 77 83 void CAxisAlgorithmReduceAxis::apply(const std::vector<std::pair<int,double> >& localIndex, … … 80 86 std::vector<bool>& flagInitial, 81 87 bool ignoreMissingValue, bool firstPass) 88 TRY 82 89 { 83 90 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 84 91 } 92 CATCH 85 93 86 94 void CAxisAlgorithmReduceAxis::updateData(CArray<double,1>& dataOut) 95 TRY 87 96 { 88 97 reduction_->updateData(dataOut); 89 98 } 99 CATCH 90 100 91 101 CAxisAlgorithmReduceAxis::~CAxisAlgorithmReduceAxis() 102 TRY 92 103 { 93 104 if (0 != reduction_) delete reduction_; 94 105 } 106 CATCH 95 107 96 108 void CAxisAlgorithmReduceAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 109 TRY 97 110 { 98 111 this->transformationMapping_.resize(1); … … 112 125 } 113 126 } 127 CATCH 114 128 115 129 } -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_reduce_domain.cpp
r1601 r1646 25 25 std::map<int, int>& elementPositionInGridDst2AxisPosition, 26 26 std::map<int, int>& elementPositionInGridDst2DomainPosition) 27 TRY 27 28 { 28 29 std::vector<CAxis*> axisListDestP = gridDst->getAxis(); … … 35 36 return (new CAxisAlgorithmReduceDomain(axisListDestP[axisDstIndex], domainListSrcP[domainSrcIndex], reduceDomain)); 36 37 } 38 CATCH 37 39 38 40 bool CAxisAlgorithmReduceDomain::registerTrans() 41 TRY 39 42 { 40 43 CGridTransformationFactory<CAxis>::registerTransformation(TRANS_REDUCE_DOMAIN_TO_AXIS, create); 41 44 } 45 CATCH 42 46 43 47 44 48 CAxisAlgorithmReduceDomain::CAxisAlgorithmReduceDomain(CAxis* axisDestination, CDomain* domainSource, CReduceDomainToAxis* algo) 45 49 : CAxisAlgorithmTransformation(axisDestination, domainSource), reduction_(0) 50 TRY 46 51 { 47 52 algo->checkValid(axisDestination, domainSource); … … 77 82 local = algo->local ; 78 83 } 84 CATCH 79 85 80 86 void CAxisAlgorithmReduceDomain::apply(const std::vector<std::pair<int,double> >& localIndex, … … 83 89 std::vector<bool>& flagInitial, 84 90 bool ignoreMissingValue, bool firstPass) 91 TRY 85 92 { 86 93 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 87 94 } 95 CATCH 88 96 89 97 void CAxisAlgorithmReduceDomain::updateData(CArray<double,1>& dataOut) 98 TRY 90 99 { 91 100 reduction_->updateData(dataOut); 92 101 } 102 CATCH 93 103 94 104 CAxisAlgorithmReduceDomain::~CAxisAlgorithmReduceDomain() 105 TRY 95 106 { 96 107 if (0 != reduction_) delete reduction_; 97 108 } 109 CATCH 98 110 99 111 void CAxisAlgorithmReduceDomain::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 112 TRY 100 113 { 101 114 this->transformationMapping_.resize(1); … … 178 191 {} 179 192 } 193 CATCH 180 194 181 195 } -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_temporal_splitting.cpp
r1275 r1646 21 21 std::map<int, int>& elementPositionInGridDst2AxisPosition, 22 22 std::map<int, int>& elementPositionInGridDst2DomainPosition) 23 TRY 23 24 { 24 25 std::vector<CAxis*> axisListDestP = gridDst->getAxis(); … … 31 32 return (new CAxisAlgorithmTemporalSplitting(axisListDestP[axisDstIndex], scalarListSrcP[scalarSrcIndex], temporalSplitting)); 32 33 } 34 CATCH 33 35 34 36 bool CAxisAlgorithmTemporalSplitting::registerTrans() 37 TRY 35 38 { 36 39 CGridTransformationFactory<CAxis>::registerTransformation(TRANS_TEMPORAL_SPLITTING, create); 37 40 } 38 41 CATCH 39 42 40 43 CAxisAlgorithmTemporalSplitting::CAxisAlgorithmTemporalSplitting(CAxis* axisDestination, CScalar* scalarSource, CTemporalSplitting* algo) … … 50 53 51 54 void CAxisAlgorithmTemporalSplitting::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 55 TRY 52 56 { 53 57 this->transformationMapping_.resize(1); … … 72 76 } 73 77 } 78 CATCH 74 79 75 80 } -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_transformation.cpp
r1403 r1646 20 20 CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CAxis* axisSource) 21 21 : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(axisSource), domainSrc_(0),scalarSrc_(0) 22 TRY 22 23 { 23 24 axisDestGlobalSize_ = axisDestination->n_glo.getValue(); … … 28 29 if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx); 29 30 } 31 CATCH 30 32 31 33 CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CDomain* domainSource) 32 34 : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(domainSource),scalarSrc_(0) 35 TRY 33 36 { 34 37 axisDestGlobalSize_ = axisDestination->n_glo.getValue(); … … 39 42 if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx); 40 43 } 44 CATCH 41 45 42 46 CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CScalar* scalarSource) 43 47 : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(0), scalarSrc_(scalarSource) 48 TRY 44 49 { 45 50 axisDestGlobalSize_ = axisDestination->n_glo.getValue(); … … 50 55 if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx); 51 56 } 57 CATCH 58 52 59 CAxisAlgorithmTransformation::~CAxisAlgorithmTransformation() 53 60 { … … 66 73 int elementType, 67 74 CClientClientDHTInt::Index2VectorInfoTypeMap& globalAxisIndexOnProc) 75 TRY 68 76 { 69 77 CContext* context = CContext::getCurrent(); … … 124 132 globalAxisIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); 125 133 } 134 CATCH 126 135 127 136 } -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_zoom.cpp
r1559 r1646 19 19 std::map<int, int>& elementPositionInGridDst2AxisPosition, 20 20 std::map<int, int>& elementPositionInGridDst2DomainPosition) 21 TRY 21 22 { 22 23 std::vector<CAxis*> axisListDestP = gridDst->getAxis(); … … 29 30 return (new CAxisAlgorithmZoom(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], zoomAxis)); 30 31 } 32 CATCH 33 31 34 bool CAxisAlgorithmZoom::registerTrans() 35 TRY 32 36 { 33 37 CGridTransformationFactory<CAxis>::registerTransformation(TRANS_ZOOM_AXIS, create); 34 38 } 39 CATCH 35 40 36 41 CAxisAlgorithmZoom::CAxisAlgorithmZoom(CAxis* axisDestination, CAxis* axisSource, CZoomAxis* zoomAxis) 37 42 : CAxisAlgorithmTransformation(axisDestination, axisSource) 43 TRY 38 44 { 39 45 zoomAxis->checkValid(axisSource); … … 104 110 } 105 111 } 112 CATCH 106 113 107 114 /*! -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_compute_connectivity.cpp
r978 r1646 24 24 std::map<int, int>& elementPositionInGridDst2AxisPosition, 25 25 std::map<int, int>& elementPositionInGridDst2DomainPosition) 26 TRY 26 27 { 27 28 std::vector<CDomain*> domainListDestP = gridDst->getDomains(); … … 34 35 return (new CDomainAlgorithmComputeConnectivity(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], compute_connectivityDomain)); 35 36 } 37 CATCH 36 38 37 39 bool CDomainAlgorithmComputeConnectivity::registerTrans() 40 TRY 38 41 { 39 42 CGridTransformationFactory<CDomain>::registerTransformation(TRANS_COMPUTE_CONNECTIVITY_DOMAIN, create); 40 43 } 44 CATCH 41 45 42 46 CDomainAlgorithmComputeConnectivity::CDomainAlgorithmComputeConnectivity(CDomain* domainDestination, CDomain* domainSource, 43 47 CComputeConnectivityDomain* compute_connectivityDomain) 44 48 : CDomainAlgorithmTransformation(domainDestination, domainSource) 49 TRY 45 50 { 46 51 this->type_ = (ELEMENT_NO_MODIFICATION_WITHOUT_DATA); … … 64 69 computeLocalConnectivity(type, domainDestination, nbNeighborMax, nbNeighbor, localNeighbors); 65 70 } 71 CATCH 66 72 67 73 /*! … … 78 84 CArray<int,1>& nbConnectivity, 79 85 CArray<int,2>& localConnectivity) 86 TRY 80 87 { 81 88 … … 93 100 if (nbConnectivityMax < nbConnectivity(idx)) nbConnectivityMax = nbConnectivity(idx); 94 101 } 95 96 102 CATCH 97 103 98 104 /*! -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_expand.cpp
r1601 r1646 26 26 std::map<int, int>& elementPositionInGridDst2AxisPosition, 27 27 std::map<int, int>& elementPositionInGridDst2DomainPosition) 28 TRY 28 29 { 29 30 std::vector<CDomain*> domainListDestP = gridDst->getDomains(); … … 36 37 return (new CDomainAlgorithmExpand(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], expandDomain)); 37 38 } 39 CATCH 38 40 39 41 bool CDomainAlgorithmExpand::registerTrans() 42 TRY 40 43 { 41 44 CGridTransformationFactory<CDomain>::registerTransformation(TRANS_EXPAND_DOMAIN, create); 42 45 } 46 CATCH 43 47 44 48 CDomainAlgorithmExpand::CDomainAlgorithmExpand(CDomain* domainDestination, … … 47 51 : CDomainAlgorithmTransformation(domainDestination, domainSource), 48 52 isXPeriodic_(false), isYPeriodic_(false) 53 TRY 49 54 { 50 55 if (domainDestination == domainSource) … … 77 82 } 78 83 } 84 CATCH 79 85 80 86 /*! … … 85 91 void CDomainAlgorithmExpand::expandDomainEdgeConnectivity(CDomain* domainDestination, 86 92 CDomain* domainSource) 93 TRY 87 94 { 88 95 CContext* context = CContext::getCurrent(); … … 104 111 } 105 112 } 113 CATCH 106 114 107 115 /*! … … 112 120 void CDomainAlgorithmExpand::expandDomainNodeConnectivity(CDomain* domainDestination, 113 121 CDomain* domainSource) 122 TRY 114 123 { 115 124 CContext* context = CContext::getCurrent(); … … 131 140 } 132 141 } 142 CATCH 133 143 134 144 /*! … … 142 152 CDomain* domainSource, 143 153 CArray<int,2>& neighborsDomainSrc) 154 TRY 144 155 { 145 156 int index, globalIndex, idx; … … 161 172 else domainDestination->domain_ref.setValue(domainDstRef); 162 173 174 163 175 // Here are attributes of source need tranfering 164 176 int niGloSrc = domainSource->ni_glo; … … 454 466 domainDestination->computeLocalMask() ; 455 467 } 468 CATCH 456 469 457 470 /*! … … 465 478 CDomain* domainSource, 466 479 CArray<int,2>& neighborsDomainSrc) 480 TRY 467 481 { 468 482 … … 668 682 domainDestination->computeLocalMask() ; 669 683 } 670 684 CATCH 671 685 672 686 /*! -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_extract.cpp
r1553 r1646 16 16 std::map<int, int>& elementPositionInGridDst2AxisPosition, 17 17 std::map<int, int>& elementPositionInGridDst2DomainPosition) 18 TRY 18 19 { 19 20 std::vector<CDomain*> domainListDestP = gridDst->getDomains(); … … 26 27 return (new CDomainAlgorithmExtract(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], extractDomain)); 27 28 } 29 CATCH 28 30 29 31 bool CDomainAlgorithmExtract::registerTrans() 32 TRY 30 33 { 31 34 CGridTransformationFactory<CDomain>::registerTransformation(TRANS_EXTRACT_DOMAIN, create); 32 35 } 36 CATCH 33 37 34 38 CDomainAlgorithmExtract::CDomainAlgorithmExtract(CDomain* domainDestination, CDomain* domainSource, CExtractDomain* extractDomain) 35 39 : CDomainAlgorithmTransformation(domainDestination, domainSource) 40 TRY 36 41 { 37 42 extractDomain->checkValid(domainSource); … … 220 225 221 226 } 227 CATCH 222 228 223 229 /*! -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_generate_rectilinear.cpp
r1158 r1646 20 20 CGenerateRectilinearDomain* genRectDomain) 21 21 : CDomainAlgorithmTransformation(domainDestination, domainSource), nbDomainDistributedPart_(0) 22 TRY 22 23 { 23 24 type_ = ELEMENT_GENERATION; … … 30 31 fillInAttributesDomainDestination(); 31 32 } 33 CATCH 32 34 33 35 /*! … … 43 45 */ 44 46 void CDomainAlgorithmGenerateRectilinear::computeDistributionGridSource(CGrid* gridSrc) 47 TRY 45 48 { 46 49 CContext* context = CContext::getCurrent(); … … 94 97 } 95 98 } 99 CATCH 96 100 97 101 /*! … … 99 103 */ 100 104 void CDomainAlgorithmGenerateRectilinear::computeDistributionGridDestination(CGrid* gridDest) 105 TRY 101 106 { 102 107 // For now, just suppose that the grid contains only one domain … … 121 126 122 127 } 128 CATCH 123 129 124 130 /*! … … 126 132 */ 127 133 void CDomainAlgorithmGenerateRectilinear::fillInAttributesDomainDestination() 134 TRY 128 135 { 129 136 if (!domainDest_->distributionAttributesHaveValue()) … … 131 138 domainDest_->fillInLonLat(); 132 139 } 133 140 CATCH 134 141 } -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_interpolate.cpp
r1630 r1646 20 20 #include "interpolate_domain.hpp" 21 21 #include "grid.hpp" 22 #ifdef _usingEP 22 23 using namespace ep_lib; 24 #endif 23 25 24 26 namespace xios { … … 32 34 std::map<int, int>& elementPositionInGridDst2AxisPosition, 33 35 std::map<int, int>& elementPositionInGridDst2DomainPosition) 36 TRY 34 37 { 35 38 std::vector<CDomain*> domainListDestP = gridDst->getDomains(); … … 42 45 return (new CDomainAlgorithmInterpolate(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], interpolateDomain)); 43 46 } 47 CATCH 44 48 45 49 bool CDomainAlgorithmInterpolate::registerTrans() 50 TRY 46 51 { 47 52 CGridTransformationFactory<CDomain>::registerTransformation(TRANS_INTERPOLATE_DOMAIN, create); 48 53 } 54 CATCH 49 55 50 56 CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain) 51 57 : CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false) 58 TRY 52 59 { 53 60 CContext* context = CContext::getCurrent(); … … 94 101 95 102 } 103 CATCH 96 104 97 105 /*! … … 99 107 */ 100 108 void CDomainAlgorithmInterpolate::computeRemap() 109 TRY 101 110 { 102 111 using namespace sphereRemap; … … 305 314 CArray<double,2> boundsLonSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 306 315 CArray<double,2> boundsLatSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 316 CArray<double,1> areaSrcUnmasked(nSrcLocalUnmasked); 317 307 318 long int * globalSrcUnmasked = new long int [nSrcLocalUnmasked]; 308 319 309 320 nSrcLocalUnmasked=0 ; 321 bool hasSrcArea=domainSrc_->hasArea && !domainSrc_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ; 322 double srcAreaFactor ; 323 if (hasSrcArea) srcAreaFactor=1./(domainSrc_->radius*domainSrc_->radius) ; 324 310 325 for (int idx=0 ; idx < nSrcLocal; idx++) 311 326 { … … 317 332 boundsLatSrcUnmasked(n,nSrcLocalUnmasked) = boundsLatSrc(n,idx) ; 318 333 } 334 if (hasSrcArea) areaSrcUnmasked(nSrcLocalUnmasked) = domainSrc_->areavalue(idx)*srcAreaFactor ; 319 335 globalSrcUnmasked[nSrcLocalUnmasked]=globalSrc[idx] ; 320 336 ++nSrcLocalUnmasked ; 321 337 } 322 338 } 323 339 324 340 325 341 int nDstLocalUnmasked = 0 ; … … 328 344 CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked); 329 345 CArray<double,2> boundsLatDestUnmasked(nVertexDest,nDstLocalUnmasked); 346 CArray<double,1> areaDstUnmasked(nDstLocalUnmasked); 347 330 348 long int * globalDstUnmasked = new long int [nDstLocalUnmasked]; 331 349 332 350 nDstLocalUnmasked=0 ; 351 bool hasDstArea=domainDest_->hasArea && !domainDest_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ; 352 double dstAreaFactor ; 353 if (hasDstArea) dstAreaFactor=1./(domainDest_->radius*domainDest_->radius) ; 333 354 for (int idx=0 ; idx < nDstLocal; idx++) 334 355 { … … 340 361 boundsLatDestUnmasked(n,nDstLocalUnmasked) = boundsLatDest(n,idx) ; 341 362 } 363 if (hasDstArea) areaDstUnmasked(nDstLocalUnmasked) = domainDest_->areavalue(idx)*dstAreaFactor ; 342 364 globalDstUnmasked[nDstLocalUnmasked]=globalDst[idx] ; 343 365 ++nDstLocalUnmasked ; … … 345 367 } 346 368 347 mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 348 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 369 double* ptAreaSrcUnmasked = NULL ; 370 if (hasSrcArea) ptAreaSrcUnmasked=areaSrcUnmasked.dataFirst() ; 371 372 double* ptAreaDstUnmasked = NULL ; 373 if (hasDstArea) ptAreaDstUnmasked=areaDstUnmasked.dataFirst() ; 374 375 mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), ptAreaSrcUnmasked, nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 376 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), ptAreaDstUnmasked, nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 349 377 350 378 std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize,quantity); … … 400 428 401 429 } 430 CATCH 402 431 403 432 void CDomainAlgorithmInterpolate::processPole(std::map<int,std::vector<std::pair<int,double> > >& interMapValuePole, 404 433 int nbGlobalPointOnPole) 434 TRY 405 435 { 406 436 CContext* context = CContext::getCurrent(); … … 468 498 469 499 } 500 CATCH 470 501 471 502 /*! … … 473 504 */ 474 505 void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 506 TRY 475 507 { 476 508 if (readFromFile_) … … 481 513 } 482 514 } 515 CATCH 483 516 484 517 void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 518 TRY 485 519 { 486 520 writeInterpolationInfo(fileToReadWrite_, interpMapValue); 487 521 } 522 CATCH 488 523 489 524 void CDomainAlgorithmInterpolate::readRemapInfo() 525 TRY 490 526 { 491 527 std::map<int,std::vector<std::pair<int,double> > > interpMapValue; … … 494 530 exchangeRemapInfo(interpMapValue); 495 531 } 532 CATCH 496 533 497 534 void CDomainAlgorithmInterpolate::convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 535 TRY 498 536 { 499 537 CContext* context = CContext::getCurrent(); … … 520 558 } 521 559 } 560 CATCH 522 561 523 562 /*! … … 525 564 */ 526 565 void CDomainAlgorithmInterpolate::exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 566 TRY 527 567 { 528 568 CContext* context = CContext::getCurrent(); … … 706 746 delete [] recvBuff; 707 747 } 748 CATCH 708 749 709 750 /*! Redefined some functions of CONetCDF4 to make use of them */ … … 716 757 int CDomainAlgorithmInterpolate::WriteNetCdf::addDimensionWrite(const StdString& name, 717 758 const StdSize size) 759 TRY 718 760 { 719 761 return CONetCDF4::addDimension(name, size); 720 762 } 763 CATCH 721 764 722 765 int CDomainAlgorithmInterpolate::WriteNetCdf::addVariableWrite(const StdString& name, nc_type type, 723 766 const std::vector<StdString>& dim) 767 TRY 724 768 { 725 769 return CONetCDF4::addVariable(name, type, dim); 726 770 } 771 CATCH 727 772 728 773 void CDomainAlgorithmInterpolate::WriteNetCdf::endDefinition() 774 TRY 729 775 { 730 776 CONetCDF4::definition_end(); 731 777 } 778 CATCH 732 779 733 780 void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<int,1>& data, const StdString& name, … … 735 782 const std::vector<StdSize>* start, 736 783 const std::vector<StdSize>* count) 784 TRY 737 785 { 738 786 CONetCDF4::writeData<int,1>(data, name, collective, record, start, count); 739 787 } 788 CATCH 740 789 741 790 void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<double,1>& data, const StdString& name, … … 743 792 const std::vector<StdSize>* start, 744 793 const std::vector<StdSize>* count) 794 TRY 745 795 { 746 796 CONetCDF4::writeData<double,1>(data, name, collective, record, start, count); 747 797 } 798 CATCH 748 799 749 800 /* … … 754 805 void CDomainAlgorithmInterpolate::writeInterpolationInfo(std::string& filename, 755 806 std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 807 TRY 756 808 { 757 809 CContext* context = CContext::getCurrent(); … … 806 858 std::vector<StdSize> count(1, localNbWeight); 807 859 860 int my_rank; 861 MPI_Comm_rank(client->intraComm, &my_rank); 862 863 #ifdef _usingEP 808 864 int my_rank_loc = client->intraComm->ep_comm_ptr->size_rank_info[1].first; 809 int my_rank = client->intraComm->ep_comm_ptr->size_rank_info[0].first; 810 865 #elif _usingMPI 866 int my_rank_loc = 0; 867 #endif 811 868 812 869 813 870 WriteNetCdf *netCdfWriter; 814 871 872 #ifdef _usingEP 815 873 MPI_Barrier_local(client->intraComm); 816 874 #endif 875 817 876 if(my_rank_loc==0) 818 877 { 819 info(100)<<"rank "<< my_rank <<" create weight info file"<< std::endl; 878 #pragma omp critical (_output) 879 { 880 info(100)<<"rank "<< my_rank <<" create weight info file"<< std::endl; 881 } 820 882 821 883 WriteNetCdf my_writer(filename, client->intraComm); 822 info(100)<<"rank "<< my_rank <<" file created"<< std::endl; 884 #pragma omp critical (_output) 885 { 886 info(100)<<"rank "<< my_rank <<" file created"<< std::endl; 887 } 823 888 netCdfWriter = &my_writer; 824 889 … … 827 892 netCdfWriter->addDimensionWrite("n_dst", n_dst); 828 893 netCdfWriter->addDimensionWrite("n_weight", globalNbWeight); 829 info(100)<<"rank "<< my_rank <<" addDimensionWrite : n_src, n_dst, n_weight"<< std::endl; 894 #pragma omp critical (_output) 895 { 896 info(100)<<"rank "<< my_rank <<" addDimensionWrite : n_src, n_dst, n_weight"<< std::endl; 897 } 830 898 831 899 std::vector<StdString> dims(1,"n_weight"); … … 836 904 netCdfWriter->addVariableWrite("weight", NC_DOUBLE, dims); 837 905 838 info(100)<<"rank "<< my_rank <<" addVariableWrite : src_idx, dst_idx, weight"<< std::endl; 906 #pragma omp critical (_output) 907 { 908 info(100)<<"rank "<< my_rank <<" addVariableWrite : src_idx, dst_idx, weight"<< std::endl; 909 } 839 910 840 911 // End of definition 841 912 netCdfWriter->endDefinition(); 842 info(100)<<"rank "<< my_rank <<" endDefinition"<< std::endl; 913 #pragma omp critical (_output) 914 { 915 info(100)<<"rank "<< my_rank <<" endDefinition"<< std::endl; 916 } 843 917 844 918 netCdfWriter->closeFile(); 845 info(100)<<"rank "<< my_rank <<" file closed"<< std::endl; 846 } 847 919 #pragma omp critical (_output) 920 { 921 info(100)<<"rank "<< my_rank <<" file closed"<< std::endl; 922 } 923 } 924 925 #ifdef _usingEP 848 926 MPI_Barrier_local(client->intraComm); 927 #endif 849 928 850 929 #pragma omp critical (write_weight_data) 851 930 { 852 931 // open file 853 info(100)<<"rank "<< my_rank <<" writing in weight info file"<< std::endl; 932 #pragma omp critical (_output) 933 { 934 info(100)<<"rank "<< my_rank <<" writing in weight info file"<< std::endl; 935 } 854 936 855 937 WriteNetCdf my_writer(filename, true, client->intraComm); 856 info(100)<<"rank "<< my_rank <<" file opened"<< std::endl; 938 #pragma omp critical (_output) 939 { 940 info(100)<<"rank "<< my_rank <<" file opened"<< std::endl; 941 } 857 942 netCdfWriter = &my_writer; 858 943 … … 864 949 netCdfWriter->writeDataIndex(weights, "weight", false, 0, &start, &count); 865 950 866 info(100)<<"rank "<< my_rank <<" WriteDataIndex : src_idx, dst_idx, weight"<< std::endl; 951 #pragma omp critical (_output) 952 { 953 info(100)<<"rank "<< my_rank <<" WriteDataIndex : src_idx, dst_idx, weight"<< std::endl; 954 } 867 955 } 868 956 869 957 netCdfWriter->closeFile(); 870 info(100)<<"rank "<< my_rank <<" file closed"<< std::endl; 958 #pragma omp critical (_output) 959 { 960 info(100)<<"rank "<< my_rank <<" file closed"<< std::endl; 961 } 871 962 872 963 } 873 964 965 #ifdef _usingEP 874 966 MPI_Barrier_local(client->intraComm); 875 876 877 } 967 #endif 968 969 970 } 971 CATCH 878 972 879 973 /*! … … 885 979 void CDomainAlgorithmInterpolate::readInterpolationInfo(std::string& filename, 886 980 std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 981 TRY 887 982 { 888 983 int ncid ; … … 946 1041 } 947 1042 } 1043 CATCH 948 1044 949 1045 void CDomainAlgorithmInterpolate::apply(const std::vector<std::pair<int,double> >& localIndex, … … 952 1048 std::vector<bool>& flagInitial, 953 1049 bool ignoreMissingValue, bool firstPass ) 1050 TRY 954 1051 { 955 1052 int nbLocalIndex = localIndex.size(); … … 993 1090 } 994 1091 } 1092 CATCH 995 1093 996 1094 void CDomainAlgorithmInterpolate::updateData(CArray<double,1>& dataOut) 1095 TRY 997 1096 { 998 1097 if (detectMissingValue) … … 1001 1100 size_t nbIndex=dataOut.numElements() ; 1002 1101 1003 for (int idx = 0; idx < nbIndex; ++idx) 1004 { 1005 if (allMissing(idx)) dataOut(idx) = defaultValue; // If all data source are nan then data destination must be nan 1102 if (allMissing.numElements()>0) 1103 { 1104 for (int idx = 0; idx < nbIndex; ++idx) 1105 { 1106 if (allMissing(idx)) dataOut(idx) = defaultValue; // If all data source are nan then data destination must be nan 1107 } 1006 1108 } 1007 1109 … … 1013 1115 } 1014 1116 } 1015 1016 } 1117 CATCH 1118 1119 } -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_reorder.cpp
r1457 r1646 19 19 std::map<int, int>& elementPositionInGridDst2AxisPosition, 20 20 std::map<int, int>& elementPositionInGridDst2DomainPosition) 21 TRY 21 22 { 22 23 std::vector<CDomain*> domainListDestP = gridDst->getDomains(); … … 29 30 return (new CDomainAlgorithmReorder(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], reorderDomain)); 30 31 } 32 CATCH 31 33 32 34 bool CDomainAlgorithmReorder::registerTrans() 35 TRY 33 36 { 34 37 CGridTransformationFactory<CDomain>::registerTransformation(TRANS_REORDER_DOMAIN, create); 35 38 } 39 CATCH 36 40 37 41 CDomainAlgorithmReorder::CDomainAlgorithmReorder(CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain) 38 42 : CDomainAlgorithmTransformation(domainDestination, domainSource) 43 TRY 39 44 { 40 45 reorderDomain->checkValid(domainSource); … … 109 114 } 110 115 } 111 112 113 116 } 117 CATCH 114 118 115 119 /*! -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_transformation.cpp
r1403 r1646 36 36 int elementType, 37 37 CClientClientDHTInt::Index2VectorInfoTypeMap& globalDomainIndexOnProc) 38 TRY 38 39 { 39 40 CContext* context = CContext::getCurrent(); … … 65 66 globalDomainIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); 66 67 } 68 CATCH 67 69 68 70 } -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_zoom.cpp
r1630 r1646 16 16 std::map<int, int>& elementPositionInGridDst2AxisPosition, 17 17 std::map<int, int>& elementPositionInGridDst2DomainPosition) 18 TRY 18 19 { 19 20 std::vector<CDomain*> domainListDestP = gridDst->getDomains(); … … 26 27 return (new CDomainAlgorithmZoom(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], zoomDomain)); 27 28 } 29 CATCH 28 30 29 31 bool CDomainAlgorithmZoom::registerTrans() 32 TRY 30 33 { 31 34 CGridTransformationFactory<CDomain>::registerTransformation(TRANS_ZOOM_DOMAIN, create); 32 35 } 36 CATCH 33 37 34 38 CDomainAlgorithmZoom::CDomainAlgorithmZoom(CDomain* domainDestination, CDomain* domainSource, CZoomDomain* zoomDomain) 35 39 : CDomainAlgorithmTransformation(domainDestination, domainSource) 40 TRY 36 41 { 37 42 zoomDomain->checkValid(domainSource); … … 93 98 domainDest_->ni.setValue(niDest); 94 99 domainDest_->nj.setValue(njDest); 95 domainDest_->ibegin.setValue(ibeginDest); 96 domainDest_->jbegin.setValue(jbeginDest); 100 if ( (niDest==0) || (njDest==0)) 101 { 102 domainDest_->ibegin.setValue(0); 103 domainDest_->jbegin.setValue(0); 104 } 105 else 106 { 107 domainDest_->ibegin.setValue(ibeginDest); 108 domainDest_->jbegin.setValue(jbeginDest); 109 } 97 110 domainDest_->i_index.resize(niDest*njDest); 98 111 domainDest_->j_index.resize(niDest*njDest); … … 100 113 domainDest_->data_ni.setValue(niDest); 101 114 domainDest_->data_nj.setValue(njDest); 102 domainDest_->data_ibegin.setValue(0); // local position103 domainDest_->data_jbegin.setValue(0); // local position104 domainDest_->data_i_index.resize(niDest*njDest); // local position105 domainDest_->data_j_index.resize(niDest*njDest); // local position115 domainDest_->data_ibegin.setValue(0); 116 domainDest_->data_jbegin.setValue(0); 117 domainDest_->data_i_index.resize(niDest*njDest); 118 domainDest_->data_j_index.resize(niDest*njDest); 106 119 107 120 domainDest_->domainMask.resize(niDest*njDest); … … 259 272 } 260 273 } 261 262 } 274 domainDest_->computeLocalMask(); 275 } 276 CATCH 263 277 264 278 /*! -
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 } -
XIOS/dev/dev_trunk_omp/src/transformation/generic_algorithm_transformation.hpp
r1542 r1646 88 88 void computeIndexSourceMapping(const std::vector<CArray<double,1>* >& dataAuxInputs = std::vector<CArray<double,1>* >()); 89 89 void computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst, 90 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, vector<bool>& localMaskOnGridDest); 91 void 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, 92 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, CArray<bool,1>& localMaskOnGridSrc, vector<bool>& localMaskOnGridDest) ; 90 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, int& nbLocalIndexOnGridDest); 91 void nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid, vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, 92 int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc, 93 int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd, 94 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight) ; 93 95 94 96 protected: -
XIOS/dev/dev_trunk_omp/src/transformation/grid_generate.cpp
r978 r1646 30 30 */ 31 31 void CGridGenerate::selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 32 TRY 32 33 { 33 34 CGenericAlgorithmTransformation* algo = 0; 34 35 algoTransformation_.push_back(algo); 35 36 } 37 CATCH 36 38 37 39 /*! … … 43 45 */ 44 46 void CGridGenerate::selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 47 TRY 45 48 { 46 49 CGenericAlgorithmTransformation* algo = 0; 47 50 algoTransformation_.push_back(algo); 48 51 } 52 CATCH 49 53 50 54 /*! … … 56 60 */ 57 61 void CGridGenerate::selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 62 TRY 58 63 { 59 64 std::vector<CDomain*> domainListDestP = gridDestination_->getDomains(); … … 89 94 algoTransformation_.push_back(algo); 90 95 } 96 CATCH 91 97 92 98 /*! … … 94 100 */ 95 101 void CGridGenerate::completeGrid() 102 TRY 96 103 { 97 104 ListAlgoType::const_iterator itb = listAlgos_.begin(), … … 110 117 } 111 118 } 119 CATCH 112 120 113 121 } -
XIOS/dev/dev_trunk_omp/src/transformation/grid_transformation.cpp
r1601 r1646 38 38 */ 39 39 void CGridTransformation::selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 40 TRY 40 41 { 41 42 std::vector<CScalar*> scaListDestP = gridDestination_->getScalars(); … … 59 60 algoTransformation_.push_back(algo); 60 61 } 62 CATCH 61 63 62 64 /*! … … 67 69 */ 68 70 void CGridTransformation::selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 71 TRY 69 72 { 70 73 std::vector<CAxis*> axisListDestP = gridDestination_->getAxis(); … … 88 91 algoTransformation_.push_back(algo); 89 92 } 93 CATCH 90 94 91 95 /*! … … 96 100 */ 97 101 void CGridTransformation::selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 102 TRY 98 103 { 99 104 std::vector<CDomain*> domainListDestP = gridDestination_->getDomains(); … … 117 122 algoTransformation_.push_back(algo); 118 123 } 124 CATCH 119 125 120 126 /*! … … 123 129 */ 124 130 std::map<int,std::pair<int,int> > CGridTransformation::getElementPosition(CGrid* grid) 131 TRY 125 132 { 126 133 std::vector<CScalar*> scalarListP = grid->getScalars(); … … 155 162 return elementPosition; 156 163 } 164 CATCH 157 165 158 166 /*! … … 163 171 */ 164 172 void CGridTransformation::setUpGridDestination(int elementPositionInGrid, ETranformationType transType) 173 TRY 165 174 { 166 175 if (isSpecialTransformation(transType)) return; … … 240 249 tempGridDests_.push_back(tmpGridDestination_); 241 250 } 251 CATCH 242 252 243 253 /*! … … 249 259 */ 250 260 void CGridTransformation::setUpGridSource(int elementPositionInGrid) 261 TRY 251 262 { 252 263 if (!tempGridSrcs_.empty() && (getNbAlgo()-1) == tempGridSrcs_.size()) … … 326 337 tempGridSrcs_.push_back(gridSource_); 327 338 } 339 CATCH 328 340 329 341 /*! … … 336 348 */ 337 349 void CGridTransformation::computeAll(const std::vector<CArray<double,1>* >& dataAuxInputs, Time timeStamp) 350 TRY 338 351 { 339 352 if (nbNormalAlgos_ < 1) return; … … 346 359 std::list<RecvIndexGridDestinationMap>().swap(localIndexToReceiveOnGridDest_); 347 360 std::list<size_t>().swap(nbLocalIndexOnGridDest_); 348 std::list<std::vector<bool> >().swap(localMaskOnGridDest_);349 361 } 350 362 else … … 399 411 vector<int> localDst ; 400 412 vector<double> weight ; 401 localMaskOnGridDest_.push_back(vector<bool>());413 int nbLocalIndexOnGridDest; 402 414 CTimer::get("computeTransformationMappingNonDistributed").resume(); 403 415 algo->computeTransformationMappingNonDistributed(elementPosition, gridSource_, tmpGridDestination_, 404 localSrc, localDst, weight, localMaskOnGridDest_.back()) ;416 localSrc, localDst, weight, nbLocalIndexOnGridDest) ; 405 417 CTimer::get("computeTransformationMappingNonDistributed").suspend(); 406 418 407 419 CTimer::get("computeTransformationMappingConvert").resume(); 408 nbLocalIndexOnGridDest_.push_back( localMaskOnGridDest_.back().size()) ;420 nbLocalIndexOnGridDest_.push_back(nbLocalIndexOnGridDest) ; 409 421 int clientRank=client->clientRank ; 410 422 { … … 453 465 } 454 466 } 467 CATCH 455 468 456 469 /*! … … 459 472 */ 460 473 void CGridTransformation::computeTransformationMapping(const SourceDestinationIndexMap& globaIndexWeightFromSrcToDst) 474 TRY 461 475 { 462 476 CContext* context = CContext::getCurrent(); … … 472 486 size_t nbLocalIndex = globalLocalIndexGridDestSendToServer.size(); 473 487 nbLocalIndexOnGridDest_.push_back(nbLocalIndex); 474 localMaskOnGridDest_.push_back(std::vector<bool>());475 std::vector<bool>& tmpMask = localMaskOnGridDest_.back();476 tmpMask.resize(nbLocalIndex,false);488 // localMaskOnGridDest_.push_back(std::vector<bool>()); 489 // std::vector<bool>& tmpMask = localMaskOnGridDest_.back(); 490 // tmpMask.resize(nbLocalIndex,false); 477 491 478 492 // Find out number of index sent from grid source and number of index received on grid destination … … 653 667 recvTmp[recvRank][realRecvSize].first = globalLocalIndexGridDestSendToServer[recvIndexDst(idx)]; 654 668 recvTmp[recvRank][realRecvSize].second = recvWeightDst(idx); 655 tmpMask[globalLocalIndexGridDestSendToServer[recvIndexDst(idx)]] = true;656 669 ++realRecvSize; 657 670 } … … 678 691 679 692 } 693 CATCH 680 694 681 695 /*! … … 684 698 */ 685 699 const std::list<CGridTransformation::SendingIndexGridSourceMap>& CGridTransformation::getLocalIndexToSendFromGridSource() const 700 TRY 686 701 { 687 702 return localIndexToSendFromGridSource_; 688 703 } 704 CATCH 689 705 690 706 /*! … … 693 709 */ 694 710 const std::list<CGridTransformation::RecvIndexGridDestinationMap>& CGridTransformation::getLocalIndexToReceiveOnGridDest() const 711 TRY 695 712 { 696 713 return localIndexToReceiveOnGridDest_; 697 714 } 715 CATCH 698 716 699 717 /*! … … 702 720 */ 703 721 const std::list<size_t>& CGridTransformation::getNbLocalIndexToReceiveOnGridDest() const 722 TRY 704 723 { 705 724 return nbLocalIndexOnGridDest_; 706 725 } 707 708 /*! 709 Local mask of data which will be received on the grid destination 710 \return local mask of data 711 */ 712 const std::list<std::vector<bool> >& CGridTransformation::getLocalMaskIndexOnGridDest() const 713 { 714 return localMaskOnGridDest_; 715 } 716 717 } 726 CATCH 727 728 } -
XIOS/dev/dev_trunk_omp/src/transformation/grid_transformation.hpp
r1601 r1646 50 50 const std::list<RecvIndexGridDestinationMap>& getLocalIndexToReceiveOnGridDest() const; 51 51 const std::list<size_t>& getNbLocalIndexToReceiveOnGridDest() const; 52 const std::list<std::vector<bool> >& getLocalMaskIndexOnGridDest() const;53 52 54 53 CGrid* getGridSource() { return originalGridSource_; } … … 85 84 //! Number of local index of data to receive on grid destination 86 85 std::list<size_t> nbLocalIndexOnGridDest_; 87 std::list<std::vector<bool> > localMaskOnGridDest_;88 86 89 87 bool dynamicalTransformation_; -
XIOS/dev/dev_trunk_omp/src/transformation/grid_transformation_selector.cpp
r1601 r1646 10 10 #include "grid.hpp" 11 11 #include "algo_types.hpp" 12 #ifdef _usingEP 12 13 using namespace ep_lib; 14 #endif 13 15 14 16 namespace xios { … … 48 50 : gridSource_(source), gridDestination_(destination), isSameGrid_(false), 49 51 listAlgos_(), algoTypes_(), nbNormalAlgos_(0), nbSpecialAlgos_(0), auxInputs_() 52 TRY 50 53 { 51 54 if (0 == source) … … 63 66 initializeTransformations(type); 64 67 } 68 CATCH 65 69 66 70 /*! … … 71 75 */ 72 76 void CGridTransformationSelector::initializeTransformations(TransformationType type) 77 TRY 73 78 { 74 79 // Initialize algorithms … … 101 106 } 102 107 } 108 CATCH 103 109 104 110 CGridTransformationSelector::~CGridTransformationSelector() 111 TRY 105 112 { 106 113 std::vector<CGenericAlgorithmTransformation*>::const_iterator itb = algoTransformation_.begin(), it, … … 108 115 for (it = itb; it != ite; ++it) delete (*it); 109 116 } 117 CATCH 110 118 111 119 /*! … … 113 121 */ 114 122 void CGridTransformationSelector::updateElementPosition() 123 TRY 115 124 { 116 125 int idxScalar = 0, idxAxis = 0, idxDomain = 0; … … 164 173 } 165 174 } 175 CATCH 166 176 167 177 /*! … … 169 179 */ 170 180 void CGridTransformationSelector::initializeAlgorithms() 181 TRY 171 182 { 172 183 updateElementPosition(); … … 189 200 } 190 201 } 202 CATCH 191 203 192 204 /*! … … 198 210 */ 199 211 void CGridTransformationSelector::initializeScalarAlgorithms(int scalarPositionInGrid) 212 TRY 200 213 { 201 214 std::vector<CScalar*> scalarListDestP = gridDestination_->getScalars(); … … 230 243 } 231 244 } 245 CATCH 232 246 233 247 /*! … … 239 253 */ 240 254 void CGridTransformationSelector::initializeAxisAlgorithms(int axisPositionInGrid) 255 TRY 241 256 { 242 257 std::vector<CAxis*> axisListDestP = gridDestination_->getAxis(); … … 271 286 } 272 287 } 288 CATCH 273 289 274 290 /*! … … 279 295 */ 280 296 void CGridTransformationSelector::initializeDomainAlgorithms(int domPositionInGrid) 297 TRY 281 298 { 282 299 std::vector<CDomain*> domListDestP = gridDestination_->getDomains(); … … 310 327 } 311 328 } 312 313 } 329 } 330 CATCH 314 331 315 332 /*! … … 322 339 */ 323 340 void CGridTransformationSelector::selectAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder, int algoType) 341 TRY 324 342 { 325 343 updateElementPosition(); … … 339 357 } 340 358 } 359 CATCH 341 360 342 361 bool CGridTransformationSelector::isSpecialTransformation(ETranformationType transType) 362 TRY 343 363 { 344 364 bool res = false; … … 354 374 return res; 355 375 } 356 357 } 376 CATCH 377 378 } -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_extract_axis.cpp
r1601 r1646 26 26 std::map<int, int>& elementPositionInGridDst2AxisPosition, 27 27 std::map<int, int>& elementPositionInGridDst2DomainPosition) 28 TRY 28 29 { 29 30 std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); … … 36 37 return (new CScalarAlgorithmExtractAxis(scalarListDestP[scalarDstIndex], axisListSrcP[axisSrcIndex], extractAxis)); 37 38 } 39 CATCH 38 40 39 41 bool CScalarAlgorithmExtractAxis::registerTrans() 42 TRY 40 43 { 41 44 CGridTransformationFactory<CScalar>::registerTransformation(TRANS_EXTRACT_AXIS_TO_SCALAR, create); 42 45 } 46 CATCH 43 47 44 48 CScalarAlgorithmExtractAxis::CScalarAlgorithmExtractAxis(CScalar* scalarDestination, CAxis* axisSource, CExtractAxisToScalar* algo) 45 49 : CScalarAlgorithmTransformation(scalarDestination, axisSource), 46 50 reduction_(0) 51 TRY 47 52 { 48 53 algo->checkValid(scalarDestination, axisSource); … … 55 60 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 56 61 } 62 CATCH 57 63 58 64 void CScalarAlgorithmExtractAxis::apply(const std::vector<std::pair<int,double> >& localIndex, … … 61 67 std::vector<bool>& flagInitial, 62 68 bool ignoreMissingValue, bool firstPass) 69 TRY 63 70 { 64 71 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 65 72 } 73 CATCH 66 74 67 75 CScalarAlgorithmExtractAxis::~CScalarAlgorithmExtractAxis() 76 TRY 68 77 { 69 78 if (0 != reduction_) delete reduction_; 70 79 } 80 CATCH 71 81 72 82 void CScalarAlgorithmExtractAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 83 TRY 73 84 { 74 85 this->transformationMapping_.resize(1); … … 81 92 transWeight[0].push_back(1.0); 82 93 } 94 CATCH 83 95 84 96 } -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_axis.cpp
r1601 r1646 26 26 std::map<int, int>& elementPositionInGridDst2AxisPosition, 27 27 std::map<int, int>& elementPositionInGridDst2DomainPosition) 28 TRY 28 29 { 29 30 std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); … … 36 37 return (new CScalarAlgorithmReduceAxis(scalarListDestP[scalarDstIndex], axisListSrcP[axisSrcIndex], reduceAxis)); 37 38 } 39 CATCH 38 40 39 41 bool CScalarAlgorithmReduceAxis::registerTrans() 42 TRY 40 43 { 41 44 CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_AXIS_TO_SCALAR, create); 42 45 } 46 CATCH 43 47 44 48 CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CScalar* scalarDestination, CAxis* axisSource, CReduceAxisToScalar* algo) 45 49 : CScalarAlgorithmTransformation(scalarDestination, axisSource), 46 50 reduction_(0) 51 TRY 47 52 { 48 53 if (algo->operation.isEmpty()) … … 87 92 reduction_ = CReductionAlgorithm::createOperation((*CReductionAlgorithm::ReductionOperations_ptr)[op]); 88 93 } 94 CATCH 89 95 90 96 void CScalarAlgorithmReduceAxis::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut, 91 97 std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass) 98 TRY 92 99 { 93 100 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 94 101 } 102 CATCH 95 103 96 104 void CScalarAlgorithmReduceAxis::updateData(CArray<double,1>& dataOut) 105 TRY 97 106 { 98 107 reduction_->updateData(dataOut); 99 108 } 109 CATCH 100 110 101 111 CScalarAlgorithmReduceAxis::~CScalarAlgorithmReduceAxis() 112 TRY 102 113 { 103 114 if (0 != reduction_) delete reduction_; 104 115 } 116 CATCH 105 117 106 118 void CScalarAlgorithmReduceAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 119 TRY 107 120 { 108 121 this->transformationMapping_.resize(1); … … 120 133 } 121 134 } 135 CATCH 122 136 123 137 } -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_domain.cpp
r1601 r1646 25 25 std::map<int, int>& elementPositionInGridDst2AxisPosition, 26 26 std::map<int, int>& elementPositionInGridDst2DomainPosition) 27 TRY 27 28 { 28 29 std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); … … 35 36 return (new CScalarAlgorithmReduceDomain(scalarListDestP[scalarDstIndex], domainListSrcP[domainSrcIndex], reduceDomain)); 36 37 } 38 CATCH 37 39 38 40 bool CScalarAlgorithmReduceDomain::registerTrans() 41 TRY 39 42 { 40 43 CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_DOMAIN_TO_SCALAR, create); 41 44 } 45 CATCH 42 46 43 47 CScalarAlgorithmReduceDomain::CScalarAlgorithmReduceDomain(CScalar* scalarDestination, CDomain* domainSource, CReduceDomainToScalar* algo) 44 48 : CScalarAlgorithmTransformation(scalarDestination, domainSource), 45 49 reduction_(0) 50 TRY 46 51 { 47 52 algo->checkValid(scalarDestination, domainSource); … … 83 88 local = algo->local ; 84 89 } 90 CATCH 85 91 86 92 void CScalarAlgorithmReduceDomain::apply(const std::vector<std::pair<int,double> >& localIndex, … … 89 95 std::vector<bool>& flagInitial, 90 96 bool ignoreMissingValue, bool firstPass) 97 TRY 91 98 { 92 99 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 93 100 } 101 CATCH 94 102 95 103 void CScalarAlgorithmReduceDomain::updateData(CArray<double,1>& dataOut) 104 TRY 96 105 { 97 106 reduction_->updateData(dataOut); 98 107 } 108 CATCH 99 109 100 110 CScalarAlgorithmReduceDomain::~CScalarAlgorithmReduceDomain() 111 TRY 101 112 { 102 113 if (0 != reduction_) delete reduction_; 103 114 } 115 CATCH 104 116 105 117 void CScalarAlgorithmReduceDomain::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 118 TRY 106 119 { 107 120 this->transformationMapping_.resize(1); … … 140 153 141 154 } 155 CATCH 142 156 143 157 } -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_scalar.cpp
r1601 r1646 22 22 std::map<int, int>& elementPositionInGridDst2AxisPosition, 23 23 std::map<int, int>& elementPositionInGridDst2DomainPosition) 24 TRY 24 25 { 25 26 std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); … … 32 33 return (new CScalarAlgorithmReduceScalar(scalarListDestP[scalarDstIndex], scalarListSrcP[scalarSrcIndex], reduceScalar)); 33 34 } 35 CATCH 34 36 35 37 bool CScalarAlgorithmReduceScalar::registerTrans() 38 TRY 36 39 { 37 40 CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_SCALAR_TO_SCALAR, create); 38 41 } 42 CATCH 39 43 40 44 CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo) 41 45 : CScalarAlgorithmTransformation(scalarDestination, scalarSource), 42 46 reduction_(0) 47 TRY 43 48 { 44 49 eliminateRedondantSrc_= false ; … … 84 89 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 85 90 } 91 CATCH 86 92 87 93 void CScalarAlgorithmReduceScalar::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut, 88 94 std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass) 95 TRY 89 96 { 90 97 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 91 98 } 99 CATCH 92 100 93 101 void CScalarAlgorithmReduceScalar::updateData(CArray<double,1>& dataOut) 102 TRY 94 103 { 95 104 reduction_->updateData(dataOut); 96 105 } 106 CATCH 97 107 98 108 CScalarAlgorithmReduceScalar::~CScalarAlgorithmReduceScalar() 109 TRY 99 110 { 100 111 if (0 != reduction_) delete reduction_; 101 112 } 113 CATCH 102 114 103 115 void CScalarAlgorithmReduceScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 116 TRY 104 117 { 105 118 this->transformationMapping_.resize(1); … … 113 126 114 127 } 128 CATCH 115 129 116 130 } -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_transformation.cpp
r1403 r1646 57 57 int elementSourceType, 58 58 CClientClientDHTInt::Index2VectorInfoTypeMap& globalIndexElementSourceOnProc) 59 TRY 59 60 { 60 61 CContext* context = CContext::getCurrent(); … … 121 122 } 122 123 } 123 124 CATCH 124 125 }
Note: See TracChangeset
for help on using the changeset viewer.