Ignore:
Timestamp:
11/23/18 14:48:14 (5 years ago)
Author:
oabramkina
Message:

Dev: adding exception handling.

To activate it, compilation flag -DXIOS_EXCEPTION should be added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.cpp

    r1599 r1612  
    3434                                            std::vector<bool>& flagInitial, 
    3535                                            bool ignoreMissingValue, bool firstPass  ) 
     36TRY 
    3637{ 
    3738  int nbLocalIndex = localIndex.size();    
     
    6162  } 
    6263} 
     64CATCH 
    6365 
    6466void CGenericAlgorithmTransformation::computePositionElements(CGrid* dst, CGrid* src) 
     67TRY 
    6568{ 
    6669  int idxScalar = 0, idxAxis = 0, idxDomain = 0; 
     
    108111  } 
    109112} 
     113CATCH 
    110114 
    111115bool CGenericAlgorithmTransformation::isDistributedTransformation(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst) 
     116TRY 
    112117{ 
    113118 
     
    147152  } 
    148153  return isDistributed_ ; 
    149  
     154} 
     155CATCH 
     156 
    150157/*! 
    151158  This function computes the global indexes of grid source, which the grid destination is in demand. 
     
    160167                                                               CGrid* gridDst, 
    161168                                                               SourceDestinationIndexMap& globaIndexWeightFromSrcToDst) 
     169TRY 
    162170 { 
    163171  CContext* context = CContext::getCurrent(); 
     
    443451  }   
    444452 } 
     453CATCH 
    445454 
    446455/*! 
     
    461470                                                                   std::vector<std::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc, 
    462471                                                                   SourceDestinationIndexMap& globaIndexWeightFromSrcToDst) 
     472TRY 
    463473{ 
    464474  SourceDestinationIndexMap globaIndexWeightFromSrcToDst_tmp ; 
     
    640650       } 
    641651     } 
    642  
    643 } 
     652} 
     653CATCH 
    644654 
    645655/*! 
     
    654664                                                                 CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    655665                                                                 std::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc) 
     666TRY 
    656667{ 
    657668  CContext* context = CContext::getCurrent(); 
     
    666677  } 
    667678} 
     679CATCH 
    668680 
    669681/*! 
     
    678690                                                               CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    679691                                                               std::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc) 
     692TRY 
    680693{ 
    681694  CContext* context = CContext::getCurrent(); 
     
    735748  } 
    736749} 
     750CATCH 
    737751 
    738752/*! 
     
    747761                                                                 CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    748762                                                                 std::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc) 
     763TRY 
    749764{ 
    750765  CContext* context = CContext::getCurrent(); 
     
    838853  } 
    839854} 
    840  
    841  
    842  
    843  
     855CATCH 
    844856 
    845857void CGenericAlgorithmTransformation::computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst, 
    846858                                                                                 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, 
    847859                                                                                 int& nlocalIndexDest) 
     860TRY 
    848861{ 
    849862 
     
    10101023                
    10111024} 
     1025CATCH 
    10121026 
    10131027 
     
    10171031                                                                   int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd, 
    10181032                                                                   vector<int>& localSrc, vector<int>& localDst, vector<double>& weight) 
     1033TRY 
    10191034{ 
    10201035  int masked_ ; 
     
    10991114 
    11001115} 
     1116CATCH 
    11011117 
    11021118/*! 
     
    11061122*/ 
    11071123void CGenericAlgorithmTransformation::computeIndexSourceMapping(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     1124TRY 
    11081125{ 
    11091126  computeIndexSourceMapping_(dataAuxInputs); 
    11101127} 
     1128CATCH 
    11111129 
    11121130std::vector<StdString> CGenericAlgorithmTransformation::getIdAuxInputs() 
     1131TRY 
    11131132{ 
    11141133  return idAuxInputs_; 
    11151134} 
     1135CATCH 
    11161136 
    11171137CGenericAlgorithmTransformation::AlgoTransType CGenericAlgorithmTransformation::type() 
     1138TRY 
    11181139{ 
    11191140  return type_; 
    11201141} 
    1121  
    1122 } 
     1142CATCH 
     1143 
     1144} 
Note: See TracChangeset for help on using the changeset viewer.