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_scalar.cpp

    r1545 r1642  
    99#include "grid.hpp" 
    1010#include "grid_transformation_factory_impl.hpp" 
    11  
     11#include "reduction.hpp" 
    1212 
    1313 
     
    2222                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2323                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     24TRY 
    2425{ 
    2526  std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); 
     
    3233  return (new CScalarAlgorithmReduceScalar(scalarListDestP[scalarDstIndex], scalarListSrcP[scalarSrcIndex], reduceScalar)); 
    3334} 
     35CATCH 
    3436 
    3537bool CScalarAlgorithmReduceScalar::registerTrans() 
     38TRY 
    3639{ 
    3740  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_SCALAR_TO_SCALAR, create); 
    3841} 
     42CATCH 
    3943 
    4044CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo) 
    4145 : CScalarAlgorithmTransformation(scalarDestination, scalarSource), 
    4246   reduction_(0) 
     47TRY 
    4348{ 
    4449  eliminateRedondantSrc_= false ; 
     
    7075 
    7176  } 
    72  
    73   if(CReductionAlgorithm::ReductionOperations_ptr == 0)  
    74   { 
    75     CReductionAlgorithm::initReductionOperation(); 
    76   } 
    7777   
    78   if (CReductionAlgorithm::ReductionOperations_ptr->end() == CReductionAlgorithm::ReductionOperations_ptr->find(op)) 
     78  if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op)) 
    7979    ERROR("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)", 
    8080       << "Operation '" << op << "' not found. Please make sure to use a supported one" 
     
    8282       << "Scalar destination " << scalarDestination->getId()); 
    8383 
    84   reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 
     84  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    8585} 
     86CATCH 
    8687 
    8788void CScalarAlgorithmReduceScalar::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut, 
    8889                                         std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass) 
     90TRY 
    8991{ 
    9092  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    9193} 
     94CATCH 
    9295 
    9396void CScalarAlgorithmReduceScalar::updateData(CArray<double,1>& dataOut) 
     97TRY 
    9498{ 
    9599  reduction_->updateData(dataOut); 
    96100} 
     101CATCH 
    97102 
    98103CScalarAlgorithmReduceScalar::~CScalarAlgorithmReduceScalar() 
     104TRY 
    99105{ 
    100106  if (0 != reduction_) delete reduction_; 
    101107} 
     108CATCH 
    102109 
    103110void CScalarAlgorithmReduceScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     111TRY 
    104112{ 
    105113  this->transformationMapping_.resize(1); 
     
    113121 
    114122} 
     123CATCH 
    115124 
    116125} 
Note: See TracChangeset for help on using the changeset viewer.