Ignore:
Timestamp:
01/23/19 10:31:44 (5 years ago)
Author:
yushan
Message:

dev on ADA. add flag switch _usingEP/_usingMPI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_axis.cpp

    r1545 r1642  
    1313#include "grid.hpp" 
    1414#include "grid_transformation_factory_impl.hpp" 
     15#include "reduction.hpp" 
    1516 
    16  
     17#include "reduction.hpp" 
    1718 
    1819namespace xios { 
     
    2627                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2728                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     29TRY 
    2830{ 
    2931  std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); 
     
    3638  return (new CScalarAlgorithmReduceAxis(scalarListDestP[scalarDstIndex], axisListSrcP[axisSrcIndex], reduceAxis)); 
    3739} 
     40CATCH 
    3841 
    3942bool CScalarAlgorithmReduceAxis::registerTrans() 
     43TRY 
    4044{ 
    4145  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_AXIS_TO_SCALAR, create); 
    4246} 
     47CATCH 
    4348 
    4449CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CScalar* scalarDestination, CAxis* axisSource, CReduceAxisToScalar* algo) 
    4550 : CScalarAlgorithmTransformation(scalarDestination, axisSource), 
    4651   reduction_(0) 
     52TRY 
    4753{ 
    4854  if (algo->operation.isEmpty()) 
     
    7480  } 
    7581   
    76   if(CReductionAlgorithm::ReductionOperations_ptr == 0)  
    77   { 
    78     CReductionAlgorithm::initReductionOperation(); 
    79   } 
    80    
    81   if ((*CReductionAlgorithm::ReductionOperations_ptr).end() == (*CReductionAlgorithm::ReductionOperations_ptr).find(op)) 
     82  if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op)) 
    8283    ERROR("CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToScalar* algo)", 
    8384       << "Operation '" << op << "' not found. Please make sure to use a supported one" 
     
    8586       << "Scalar destination " << scalarDestination->getId()); 
    8687 
    87   reduction_ = CReductionAlgorithm::createOperation((*CReductionAlgorithm::ReductionOperations_ptr)[op]); 
     88  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    8889} 
     90CATCH 
    8991 
    9092void CScalarAlgorithmReduceAxis::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut, 
    9193                                         std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass) 
     94TRY 
    9295{ 
    9396  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    9497} 
     98CATCH 
    9599 
    96100void CScalarAlgorithmReduceAxis::updateData(CArray<double,1>& dataOut) 
     101TRY 
    97102{ 
    98103  reduction_->updateData(dataOut); 
    99104} 
     105CATCH 
    100106 
    101107CScalarAlgorithmReduceAxis::~CScalarAlgorithmReduceAxis() 
     108TRY 
    102109{ 
    103110  if (0 != reduction_) delete reduction_; 
    104111} 
     112CATCH 
    105113 
    106114void CScalarAlgorithmReduceAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     115TRY 
    107116{ 
    108117  this->transformationMapping_.resize(1); 
     
    120129  } 
    121130} 
     131CATCH 
    122132 
    123133} 
Note: See TracChangeset for help on using the changeset viewer.