Changeset 1622


Ignore:
Timestamp:
12/11/18 13:22:07 (5 years ago)
Author:
oabramkina
Message:

Exception handling on trunk.

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

Location:
XIOS/trunk/src
Files:
89 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/array_new.hpp

    r1290 r1622  
    532532      virtual void fromString(const string& str) { istringstream iss(str); iss >> *this; initialized = true; } 
    533533      virtual string toString(void) const { ostringstream oss; oss << *this; return oss.str(); } 
     534 
     535      virtual string dump(void) const 
     536      { 
     537        ostringstream oss; 
     538        oss << this->shape()<<" "; 
     539        if (this->shape().numElements() == 1 && this->shape().dataFirst()[0] == 1) 
     540          oss << this->dataFirst()[0]; 
     541        else 
     542          oss << this->dataFirst()[0] <<" ... "<< this->dataFirst()[this->numElements()-1]; 
     543        return oss.str(); 
     544      } 
     545 
    534546      virtual void reset(void) { this->free(); initialized = false; } 
    535547      virtual bool isEmpty(void) const { return !initialized; } 
  • XIOS/trunk/src/attribute.hpp

    r1158 r1622  
    4141            virtual StdString toString(void) const = 0; 
    4242            virtual void fromString(const StdString & str) = 0; 
     43            virtual StdString dump(void) const = 0; 
    4344            virtual bool isEqual(const CAttribute& ) = 0; 
    4445 
  • XIOS/trunk/src/attribute_array.hpp

    r1219 r1622  
    5555            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);} 
    5656            virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } 
     57            virtual string dump(void) const { return _dump();} 
    5758 
    5859            virtual void generateCInterface(ostream& oss,const string& className) ; 
     
    6970          CArray<T_numtype, N_rank> inheritedValue ; 
    7071          StdString _toString(void) const; 
     72          StdString _dump(void) const; 
    7173          void _fromString(const StdString & str); 
    7274          bool _toBuffer  (CBufferOut& buffer) const; 
  • XIOS/trunk/src/attribute_array_impl.hpp

    r1219 r1622  
    129129    } 
    130130 
     131    template <typename T_numtype, int N_rank> 
     132    StdString CAttributeArray<T_numtype,N_rank>::_dump(void) const 
     133    { 
     134      StdOStringStream oss; 
     135      if (! isEmpty() && this->hasId() && (this->numElements()!=0)) 
     136        oss << this->getName() << "=\"" << CArray<T_numtype, N_rank>::dump() << "\""; 
     137      return (oss.str()); 
     138    } 
     139 
     140 
    131141      template <typename T_numtype, int N_rank> 
    132142         void CAttributeArray<T_numtype, N_rank>::_fromString(const StdString & str) 
  • XIOS/trunk/src/attribute_enum.hpp

    r1219 r1622  
    1414namespace xios 
    1515{ 
    16       /// ////////////////////// Déclarations ////////////////////// /// 
     16      /// ////////////////////// Declarations ////////////////////// /// 
    1717        /*! 
    1818        \class CAttributeEnum 
     
    6262            virtual StdString toString(void) const { return _toString();} 
    6363            virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;}  else _fromString(str);} 
     64            virtual StdString dump(void) const { return _toString();} 
    6465 
    6566            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);}  
  • XIOS/trunk/src/attribute_map.cpp

    r1158 r1622  
    2828            att.second->reset(); 
    2929         } 
     30      } 
     31 
     32      ///-------------------------------------------------------------- 
     33      /*! 
     34         Dump of all non-empty attributes of an object 
     35      */ 
     36      StdString CAttributeMap::dumpXiosAttributes(void) const 
     37      { 
     38        int maxNbChar = 250; 
     39        StdString str; 
     40        typedef std::pair<StdString, CAttribute*> StdStrAttPair; 
     41        auto it = SuperClassMap::begin(), end = SuperClassMap::end(); 
     42        for (; it != end; it++) 
     43        { 
     44          const StdStrAttPair& att = *it; 
     45          if (!att.second->isEmpty()) 
     46          { 
     47            if (str.length() < maxNbChar) 
     48            { 
     49              str.append(att.second->dump()); 
     50              str.append(" "); 
     51            } 
     52            else if (str.length() == maxNbChar) 
     53            { 
     54              str.append("..."); 
     55            } 
     56          } 
     57        } 
     58        return str; 
    3059      } 
    3160 
  • XIOS/trunk/src/attribute_map.hpp

    r1158 r1622  
    3838            void duplicateAttributes(const CAttributeMap* const _parent); 
    3939            void clearAllAttributes(void); 
     40            StdString dumpXiosAttributes(void) const; 
    4041 
    4142            void clearAttribute(const StdString& key); 
  • XIOS/trunk/src/attribute_template.hpp

    r1478 r1622  
    7474//            virtual void toBinary  (StdOStream & os) const; 
    7575//            virtual void fromBinary(StdIStream & is); 
     76            virtual StdString dump(void) const { return _dump();} 
    7677 
    7778            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);} 
     
    9899          bool isEqual_(const CAttributeTemplate& attr); 
    99100          StdString _toString(void) const; 
     101          StdString _dump(void) const; 
    100102          void _fromString(const StdString & str); 
    101103          bool _toBuffer  (CBufferOut& buffer) const; 
  • XIOS/trunk/src/attribute_template_impl.hpp

    r1478 r1622  
    199199        CType<T>::fromString(str) ; 
    200200      } 
     201 
     202      //--------------------------------------------------------------- 
     203 
     204      template <class T> 
     205         StdString CAttributeTemplate<T>::_dump(void) const 
     206      { 
     207         StdOStringStream oss; 
     208         if (!CType<T>::isEmpty() && this->hasId()) 
     209            oss << this->getName() << "=\"" << CType<T>::dump() << "\""; 
     210         return (oss.str()); 
     211      } 
     212 
    201213 
    202214      //--------------------------------------------------------------- 
  • XIOS/trunk/src/cxios.cpp

    r1519 r1622  
    2020  string CXios::serverPrmFile="./xios_server1"; 
    2121  string CXios::serverSndFile="./xios_server2"; 
     22 
     23  bool CXios::xiosStack = true; 
     24  bool CXios::systemStack = false; 
    2225 
    2326  bool CXios::isClient ; 
     
    6265    printLogs2Files=getin<bool>("print_file",false); 
    6366 
     67    xiosStack=getin<bool>("xios_stack",true) ; 
     68    systemStack=getin<bool>("system_stack",false) ; 
     69    if (xiosStack && systemStack) 
     70    { 
     71      xiosStack = false; 
     72    } 
     73 
    6474    StdString bufMemory("memory"); 
    6575    StdString bufPerformance("performance"); 
     
    91101  */ 
    92102  void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm) 
     103  TRY 
    93104  { 
    94105    initialize() ; 
     
    114125    } 
    115126  } 
     127  CATCH 
    116128 
    117129  void CXios::clientFinalize(void) 
  • XIOS/trunk/src/cxios.hpp

    r1377 r1622  
    3333     static string serverPrmFile;  //!< Filename template for primary server in case of two server levels 
    3434     static string serverSndFile;  //!< Filename template for secondary server in case of two server levels 
     35 
     36     static bool xiosStack;    //!< Exception handling 
     37     static bool systemStack;  //!< Exception handling 
    3538 
    3639     static bool isClient ; //!< Check if xios is client 
  • XIOS/trunk/src/data_output.cpp

    r1542 r1622  
    4747 
    4848      void CDataOutput::writeGrid(CDomain* domain, CAxis* axis) 
     49      TRY 
    4950      { 
    5051         this->writeDomain_(domain); 
    5152         this->writeAxis_(axis); 
    5253      } 
     54      CATCH 
    5355 
    5456      void CDataOutput::writeGrid(std::vector<CDomain*> domains, std::vector<CAxis*> axis) 
     57      TRY 
    5558      { 
    5659        int domSize = domains.size(); 
     
    5962        for (int i = 0; i < aSize; ++i) this->writeAxis_(axis[i]); 
    6063      } 
     64      CATCH 
    6165 
    6266      void CDataOutput::writeGrid(std::vector<CDomain*> domains, std::vector<CAxis*> axis, std::vector<CScalar*> scalars) 
     67      TRY 
    6368      { 
    6469        int domSize = domains.size(); 
     
    6974        for (int i = 0; i < sSize; ++i) this->writeScalar_(scalars[i]); 
    7075      } 
     76      CATCH 
    7177 
    7278      //---------------------------------------------------------------- 
    7379 
    7480      void CDataOutput::writeGrid(CDomain* domain) 
     81      TRY 
    7582      { 
    7683         this->writeDomain_(domain); 
    7784      } 
     85      CATCH 
    7886 
    7987      void CDataOutput::writeTimeDimension(void) 
     88      TRY 
    8089      { 
    8190         this->writeTimeDimension_(); 
    8291      } 
     92      CATCH 
    8393 
    8494      //---------------------------------------------------------------- 
    8595 
    8696      void CDataOutput::writeFieldTimeAxis(CField* field) 
     97      TRY 
    8798      { 
    8899         CContext* context = CContext::getCurrent() ; 
     
    91102         this->writeTimeAxis_(field, calendar); 
    92103      } 
    93        
     104      CATCH 
     105 
    94106      void CDataOutput::writeField(CField* field) 
     107      TRY 
    95108      { 
    96109         this->writeField_(field); 
    97110      } 
     111      CATCH 
    98112 
    99113      //---------------------------------------------------------------- 
    100114 
    101115      void CDataOutput::writeFieldGrid(CField* field) 
     116      TRY 
    102117      { 
    103118         this->writeGrid(field->getRelGrid(), 
    104119                         !field->indexed_output.isEmpty() && field->indexed_output); 
    105120      } 
    106  
     121      CATCH 
    107122      //---------------------------------------------------------------- 
    108123 
    109124      void CDataOutput::writeFieldData(CField* field) 
     125      TRY 
    110126      { 
    111127//         CGrid* grid = CGrid::get(field->grid_ref.getValue()); 
     
    113129         this->writeFieldData_(field); 
    114130      } 
     131      CATCH 
    115132 
    116133      ///---------------------------------------------------------------- 
  • XIOS/trunk/src/exception.cpp

    r828 r1622  
    55#include "client.hpp" 
    66#include "server.hpp" 
    7 #include "cxios.hpp" 
    87#include "log.hpp" 
    98 
     
    1211  /// ////////////////////// Définitions ////////////////////// /// 
    1312   CException::CException(void) 
    14       : CObject(), desc_rethrow(true) 
     13      : CObject(), desc_rethrow(true), stream() 
    1514   { /* Ne rien faire de plus */ } 
    1615 
    17    CException::CException(const StdString & id) 
    18       : CObject(id), desc_rethrow(true) 
     16   CException::CException(const std::string & id) 
     17      : CObject(id), desc_rethrow(true), stream() 
    1918   { /* Ne rien faire de plus */ } 
    2019 
    2120   CException::CException(const CException & exception) 
    22       : std::basic_ios<char>() 
    23       , CObject(exception.getId()) 
    24       , StdOStringStream() 
    25       , desc_rethrow(false) 
     21//      : std::basic_ios<char>() 
     22       : CObject(exception.getId()) 
     23//      , StdOStringStream() 
     24//      , desc_rethrow(false) 
    2625   { (*this) << exception.str(); } 
    2726 
    2827   CException::~CException(void) 
    2928   { 
    30       if (desc_rethrow) 
    31 #ifdef __XIOS_NOABORT 
    32       { 
    33         throw (*this); 
    34       } 
    35 #else 
    36      { 
    37       error << this->getMessage() << std::endl; 
    38       MPI_Abort(CXios::globalComm, -1); //abort(); 
    39       } 
    40 #endif 
     29//      if (desc_rethrow) 
     30//#ifdef __XIOS_NOABORT 
     31//      { 
     32//        throw (*this); 
     33//      } 
     34//#else 
     35//     { 
     36//      error << this->getMessage() << std::endl; 
     37//        throw 4; 
     38//      MPI_Abort(CXios::globalComm, -1); //abort(); 
     39//      } 
     40//#endif 
    4141   } 
    4242 
    4343   //--------------------------------------------------------------- 
    4444 
    45    StdString CException::getMessage(void) const 
     45   std::string CException::getMessage(void) const 
    4646   { 
    47       StdOStringStream oss; 
    48       oss << "> Error [" << this->getId() << "] : " << this->str(); 
    49       return (oss.str()); 
     47//     StdOStringStream oss; 
     48//     oss << "> Error [" << this->getId() << "] : " << this->str(); 
     49//     return (oss.str()); 
     50     return (stream.str()); 
    5051   } 
    5152 
    5253   StdOStringStream &  CException::getStream(void) 
    53    { return (*boost::polymorphic_cast<StdOStringStream*>(this)); } 
     54//   { return (*boost::polymorphic_cast<StdOStringStream*>(this)); } 
     55   { return stream; } 
    5456 
    55    StdString CException::toString(void) const 
    56    { return (StdString(this->getMessage())); } 
     57   std::string CException::toString(void) const 
     58//   { return (std::string(this->getMessage())); } 
     59   { return stream.str(); } 
    5760 
    58    void CException::fromString(const StdString & str) 
    59    { this->str(str); } 
     61   void CException::fromString(const std::string & str) 
     62   { } 
     63//   { this->str(str); } 
    6064 
    6165   //--------------------------------------------------------------- 
  • XIOS/trunk/src/exception.hpp

    r792 r1622  
    55#include "xios_spl.hpp" 
    66#include "object.hpp" 
     7#include <iomanip> 
     8#include <stdexcept> 
    79 
    810namespace xios 
    911{ 
    1012   /// ////////////////////// Déclarations ////////////////////// /// 
     13 
    1114   class CException 
    1215      : private CObject, public StdOStringStream 
     
    3336         virtual void fromString(const StdString & str); 
    3437 
     38         struct StackInfo 
     39         { 
     40           StdString file; 
     41           StdString function; 
     42           int line; 
     43           StdString info; 
     44         }; 
     45 
     46         std::list<StackInfo> stack; 
     47 
    3548      private : 
    3649 
    3750         /// Propriétés /// 
    3851         bool desc_rethrow; // throw destructor 
     52         StdOStringStream stream; 
    3953 
    4054   }; // CException 
     
    4357/// //////////////////////////// Macros //////////////////////////// /// 
    4458 
     59#define FILE_NAME (std::strrchr("/" __FILE__, '/') + 1) 
     60 
     61#define FUNCTION_NAME (StdString(BOOST_CURRENT_FUNCTION).length() > 100 ? \ 
     62                       StdString(BOOST_CURRENT_FUNCTION).substr(0,100).append("...)") : BOOST_CURRENT_FUNCTION) 
     63 
    4564#define INFO(x) \ 
    46    "In file \'" __FILE__ "\', line " << __LINE__ << " -> " x << std::endl; 
     65   "In file \""<< FILE_NAME <<"\", function \"" << BOOST_CURRENT_FUNCTION <<"\", line " << __LINE__ << " -> " x << std::endl; 
    4766 
    4867#ifdef __XIOS_DEBUG 
     
    5271#endif 
    5372 
    54 #define ERROR(id, x) xios::CException(id).getStream() << INFO(x) 
     73#define ERROR(id, x)  \ 
     74{                     \ 
     75       xios::CException exc(id);                \ 
     76       exc.getStream() << INFO(x);              \ 
     77       error << exc.getMessage() << std::endl;  \ 
     78       throw exc;                               \ 
     79} 
     80 
     81#ifdef __XIOS_EXCEPTION 
     82  #define TRY                          \ 
     83    {                                  \ 
     84      int funcFirstLine = __LINE__;    \ 
     85      try 
     86  #define CATCH                              \ 
     87      catch(CException& e)                   \ 
     88      {                                      \ 
     89        CException::StackInfo stk;           \ 
     90        stk.file = FILE_NAME;                \ 
     91        stk.function = FUNCTION_NAME;        \ 
     92        stk.line = funcFirstLine;            \ 
     93        e.stack.push_back(stk);              \ 
     94        if (CXios::xiosStack)                \ 
     95          throw;                             \ 
     96       else                                  \ 
     97         throw 0;                            \ 
     98      }                                      \ 
     99    } 
     100  #define CATCH_DUMP_ATTR                    \ 
     101      catch(CException& e)                   \ 
     102      {                                      \ 
     103        CException::StackInfo stk;           \ 
     104        stk.info.append(StdString("Object id=\"" + this->getId()) + "\" object type=\"" + this->getName() + "\"\n"); \ 
     105        stk.info.append("*** XIOS attributes as defined in XML file(s) or via Fortran interface:\n");                \ 
     106        stk.info.append("[" + this->dumpXiosAttributes() + "]\n");     \ 
     107        stk.info.append("*** Additional information:\n");              \ 
     108        stk.info.append("[" + this->dumpClassAttributes() + "]\n");    \ 
     109        stk.file = FILE_NAME;                \ 
     110        stk.function = FUNCTION_NAME;        \ 
     111        stk.line = funcFirstLine;            \ 
     112        e.stack.push_back(stk);              \ 
     113        if (CXios::xiosStack)                \ 
     114          throw;                             \ 
     115       else                                  \ 
     116         throw 0;                            \ 
     117      }                                      \ 
     118    } 
     119  #define CATCH_DUMP_STACK                                           \ 
     120      catch(CException& e)                                           \ 
     121      {                                                              \ 
     122        CException::StackInfo stk;                                   \ 
     123        int i = 1;                                                   \ 
     124        stk.file = FILE_NAME;                                        \ 
     125        stk.function = FUNCTION_NAME;                                \ 
     126        stk.line = funcFirstLine;                                    \ 
     127        e.stack.push_back(stk);                                      \ 
     128        for (auto itr = e.stack.crbegin(); itr!=e.stack.crend(); ++itr) \ 
     129        {                                                            \ 
     130          error << "("<< i <<") **************** ";                  \ 
     131          error << itr->function << std::endl;                       \ 
     132          error << itr->info << std::endl;                           \ 
     133          ++i;                                                       \ 
     134        }                                                            \ 
     135        error << left << "      ";                                   \ 
     136        error << left << std::setw(40) << "File " ;                  \ 
     137        error << left << std::setw(106) << "Function " ;             \ 
     138        error << std::setw(5)   << "Line " << std::endl;             \ 
     139        i = e.stack.size();                                          \ 
     140        for (auto itr = e.stack.begin(); itr!=e.stack.end(); itr++)  \ 
     141        {                                                            \ 
     142          StdOStringStream tmp;                                      \ 
     143          tmp <<  "("<< i <<")";                                     \ 
     144          error << left << std::setw(6) << tmp.str();                \ 
     145          error << left << std::setw(40)  << itr->file;              \ 
     146          error << left << std::setw(106) << itr->function;          \ 
     147          error << left << std::setw(5)   << itr->line << std::endl; \ 
     148          --i;                                                       \ 
     149        }                                                            \ 
     150        throw;                                                       \ 
     151      }                                                              \ 
     152    } 
     153#else 
     154  #define TRY 
     155  #define CATCH 
     156  #define CATCH_DUMP_ATTR 
     157  #define CATCH_DUMP_STACK 
     158#endif 
    55159 
    56160#endif // __XIOS_CException__ 
     161 
  • XIOS/trunk/src/interface/c/icaxis.cpp

    r1542 r1622  
    2828    
    2929   void cxios_axis_handle_create (XAxisPtr * _ret, const char * _id, int _id_len) 
     30   TRY 
    3031   { 
    3132      std::string id;  
     
    3536      CTimer::get("XIOS").suspend() ; 
    3637   } 
     38   CATCH_DUMP_STACK 
    3739    
    3840   void cxios_axisgroup_handle_create (XAxisGroupPtr * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id;  
     
    4447      CTimer::get("XIOS").suspend() ; 
    4548    } 
     49   CATCH_DUMP_STACK 
    4650 
    4751   // -------------------- Vérification des identifiants ----------------------- 
    4852 
    4953   void cxios_axis_valid_id (bool * _ret, const char * _id, int _id_len) 
     54   TRY 
    5055   { 
    5156      std::string id; 
     
    5661      CTimer::get("XIOS").suspend() ; 
    5762   } 
     63   CATCH_DUMP_STACK 
    5864 
    5965   void cxios_axisgroup_valid_id (bool * _ret, const char * _id, int _id_len) 
     66   TRY 
    6067   { 
    6168      std::string id; 
     
    6774 
    6875   } 
     76   CATCH_DUMP_STACK 
    6977    
    7078} // extern "C" 
  • XIOS/trunk/src/interface/c/iccalendar.cpp

    r1542 r1622  
    1010{ 
    1111  void cxios_update_calendar(int step) 
     12  TRY 
    1213  { 
    1314    CTimer::get("XIOS").resume(); 
     
    1920    CTimer::get("XIOS").suspend(); 
    2021  } 
     22  CATCH_DUMP_STACK 
    2123 
    2224  void cxios_get_current_date(cxios_date* current_date_c) 
     25  TRY 
    2326  { 
    2427    CTimer::get("XIOS").resume(); 
     
    3740    CTimer::get("XIOS").suspend(); 
    3841  } 
     42  CATCH_DUMP_STACK 
    3943 
    4044  int cxios_get_year_length_in_seconds(int year) 
     45  TRY 
    4146  { 
    4247    CTimer::get("XIOS").resume(); 
     
    5055    return length; 
    5156  } 
     57  CATCH_DUMP_STACK 
    5258 
    5359  int cxios_get_day_length_in_seconds() 
     60  TRY 
    5461  { 
    5562    CTimer::get("XIOS").resume(); 
     
    6370    return length; 
    6471  } 
     72  CATCH_DUMP_STACK 
    6573} 
  • XIOS/trunk/src/interface/c/iccalendar_wrapper.cpp

    r1542 r1622  
    2929 
    3030  void cxios_calendar_wrapper_handle_create(XCalendarWrapperPtr* _ret, const char* _id, int _id_len) 
     31  TRY 
    3132  { 
    3233    std::string id; 
     
    3637    CTimer::get("XIOS").suspend(); 
    3738  } 
     39  CATCH_DUMP_STACK 
    3840 
    3941  void cxios_get_current_calendar_wrapper(XCalendarWrapperPtr* _ret) 
     42  TRY 
    4043  { 
    4144    CTimer::get("XIOS").resume(); 
     
    4346    CTimer::get("XIOS").suspend(); 
    4447  } 
     48  CATCH_DUMP_STACK 
    4549 
    4650  // -------------------- Vérification des identifiants ----------------------- 
    4751 
    4852  void cxios_calendar_wrapper_valid_id(bool* _ret, const char* _id, int _id_len) 
     53  TRY 
    4954  { 
    5055    std::string id; 
     
    5459    CTimer::get("XIOS").suspend(); 
    5560  } 
     61  CATCH_DUMP_STACK 
    5662 
    5763  // ----------------------- Custom getters and setters ----------------------- 
    5864 
    5965  void cxios_set_calendar_wrapper_date_start_date(XCalendarWrapperPtr calendarWrapper_hdl, cxios_date start_date_c) 
     66  TRY 
    6067  { 
    6168    CTimer::get("XIOS").resume(); 
     
    7077    CTimer::get("XIOS").suspend(); 
    7178  } 
     79  CATCH_DUMP_STACK 
    7280 
    7381  void cxios_get_calendar_wrapper_date_start_date(XCalendarWrapperPtr calendarWrapper_hdl, cxios_date* start_date_c) 
     82  TRY 
    7483  { 
    7584    CTimer::get("XIOS").resume(); 
     
    8392    CTimer::get("XIOS").suspend(); 
    8493  } 
     94  CATCH_DUMP_STACK 
    8595 
    8696  void cxios_set_calendar_wrapper_date_time_origin(XCalendarWrapperPtr calendarWrapper_hdl, cxios_date time_origin_c) 
     97  TRY 
    8798  { 
    8899    CTimer::get("XIOS").resume(); 
     
    97108    CTimer::get("XIOS").suspend(); 
    98109  } 
     110  CATCH_DUMP_STACK 
    99111 
    100112  void cxios_get_calendar_wrapper_date_time_origin(XCalendarWrapperPtr calendarWrapper_hdl, cxios_date* time_origin_c) 
     113  TRY 
    101114  { 
    102115    CTimer::get("XIOS").resume(); 
     
    110123    CTimer::get("XIOS").suspend(); 
    111124  } 
     125  CATCH_DUMP_STACK 
    112126 
    113127  // ----------------------- Calendar creation and update ---------------------- 
    114128 
    115129  void cxios_create_calendar(XCalendarWrapperPtr calendarWrapper_hdl) 
     130  TRY 
    116131  { 
    117132    CTimer::get("XIOS").resume(); 
     
    119134    CTimer::get("XIOS").suspend(); 
    120135  } 
     136  CATCH_DUMP_STACK 
    121137 
    122138  void cxios_update_calendar_timestep(XCalendarWrapperPtr calendarWrapper_hdl) 
     139  TRY 
    123140  { 
    124141    CTimer::get("XIOS").resume(); 
     
    126143    CTimer::get("XIOS").suspend(); 
    127144  } 
     145  CATCH_DUMP_STACK 
    128146} // extern "C" 
  • XIOS/trunk/src/interface/c/iccompute_connectivity_domain.cpp

    r1542 r1622  
    2525   // ------------------------ Création des handle ----------------------------- 
    2626   void cxios_compute_connectivity_domain_handle_create(XComConDomainPtr * _ret, const char * _id, int _id_len) 
     27   TRY 
    2728   { 
    2829      std::string id; 
     
    3233      CTimer::get("XIOS").suspend() ; 
    3334   } 
     35   CATCH_DUMP_STACK 
    3436 
    3537   // -------------------- Vérification des identifiants ----------------------- 
    3638   void cxios_compute_connectivity_domain_valid_id(bool * _ret, const char * _id, int _id_len) 
     39   TRY 
    3740   { 
    3841      std::string id; 
     
    4346      CTimer::get("XIOS").suspend() ; 
    4447   } 
     48   CATCH_DUMP_STACK 
    4549} // extern "C" 
  • XIOS/trunk/src/interface/c/iccontext.cpp

    r1542 r1622  
    3232 
    3333   void cxios_context_handle_create (XContextPtr * _ret, const char * _id, int _id_len) 
     34   TRY 
    3435   { 
    3536      std::string id; 
     
    5455      // Lever une exeception ici 
    5556   } 
     57   CATCH_DUMP_STACK 
    5658 
    5759   // ------------------------ Changements de contextes ------------------------ 
    5860 
    5961   void cxios_context_get_current(XContextPtr* context) 
     62   TRY 
    6063   { 
    6164      CTimer::get("XIOS").resume(); 
     
    6366      CTimer::get("XIOS").suspend(); 
    6467   } 
     68   CATCH_DUMP_STACK 
    6569 
    6670   void cxios_context_set_current(XContextPtr context, bool withswap) 
     71   TRY 
    6772   { 
    6873      CTimer::get("XIOS").resume() ; 
     
    7075      CTimer::get("XIOS").suspend() ; 
    7176   } 
     77   CATCH_DUMP_STACK 
    7278 
    7379   // -------------------- Vérification des identifiants ----------------------- 
    7480 
    7581   void cxios_context_valid_id (bool * _ret, const char * _id, int _id_len) 
     82   TRY 
    7683   { 
    7784      std::string id; 
     
    93100      CTimer::get("XIOS").suspend(); 
    94101   } 
     102   CATCH_DUMP_STACK 
    95103} // extern "C" 
  • XIOS/trunk/src/interface/c/icdata.cpp

    r1587 r1622  
    4343   // it is only used from the parse_xml.exe standalone test tool. 
    4444   void cxios_init(void) 
     45   TRY 
    4546   { 
    4647     CXios::initialize(); 
    4748   } 
     49   CATCH_DUMP_STACK 
    4850 
    4951   void cxios_init_server(void) 
     52   TRY 
    5053   { 
    5154     CXios::initServerSide(); 
    5255   } 
     56   CATCH_DUMP_STACK 
    5357 
    5458   void cxios_init_client(const char* client_id , int len_client_id, MPI_Fint* f_local_comm, MPI_Fint* f_return_comm ) 
     59   TRY 
    5560   { 
    5661      std::string str; 
     
    6974      CTimer::get("XIOS").suspend(); 
    7075   } 
     76   CATCH_DUMP_STACK 
    7177 
    7278   void cxios_context_initialize(const char* context_id , int len_context_id, MPI_Fint* f_comm) 
     79   TRY 
    7380   { 
    7481     std::string str; 
     
    8390     CTimer::get("XIOS").suspend(); 
    8491   } 
     92   CATCH_DUMP_STACK 
    8593 
    8694   void cxios_oasis_enddef() 
     95   TRY 
    8796   { 
    8897     CTimer::get("XIOS").resume(); 
     
    9099     CTimer::get("XIOS").suspend(); 
    91100   } 
     101   CATCH_DUMP_STACK 
    92102 
    93103   void cxios_context_is_initialized(const char* context_id , int len_context_id, bool* initialized) 
     104   TRY 
    94105   { 
    95106     std::string str; 
     
    101112     CTimer::get("XIOS").suspend(); 
    102113   } 
    103  
    104     void cxios_context_close_definition() 
     114   CATCH_DUMP_STACK 
     115 
     116   void cxios_context_close_definition() 
     117   TRY 
    105118   { 
    106119     CTimer::get("XIOS").resume(); 
     
    111124     CTimer::get("XIOS").suspend(); 
    112125   } 
     126   CATCH_DUMP_STACK 
    113127 
    114128   void cxios_context_finalize() 
     129   TRY 
    115130   { 
    116131     CTimer::get("XIOS").resume(); 
     
    121136     CTimer::get("XIOS").suspend(); 
    122137   } 
     138   CATCH_DUMP_STACK 
    123139 
    124140   void cxios_finalize() 
     141   TRY 
    125142   { 
    126143     CTimer::get("XIOS").resume(); 
     
    128145     CXios::clientFinalize(); 
    129146   } 
     147   CATCH_DUMP_STACK 
    130148 
    131149   void cxios_solve_inheritance() 
     150   TRY 
    132151   { 
    133152     CTimer::get("XIOS").resume(); 
     
    136155     CTimer::get("XIOS").suspend(); 
    137156   } 
     157   CATCH_DUMP_STACK 
    138158 
    139159   /*! \brief This group of functions retrieve variable information from the configuration file (.xml) 
     
    148168   */ 
    149169   void cxios_get_variable_data_k8(const char* varId, int varIdSize, double* data, bool* isVarExisted) 
     170   TRY 
    150171   { 
    151172      std::string varIdStr; 
     
    166187      CTimer::get("XIOS").suspend(); 
    167188   } 
     189   CATCH_DUMP_STACK 
    168190 
    169191   void cxios_get_variable_data_k4(const char* varId, int varIdSize, float* data, bool* isVarExisted) 
     192   TRY 
    170193   { 
    171194      std::string varIdStr; 
     
    186209      CTimer::get("XIOS").suspend(); 
    187210   } 
     211   CATCH_DUMP_STACK 
    188212 
    189213   void cxios_get_variable_data_int(const char* varId, int varIdSize, int* data, bool* isVarExisted) 
     214   TRY 
    190215   { 
    191216      std::string varIdStr; 
     
    206231      CTimer::get("XIOS").suspend(); 
    207232   } 
     233   CATCH_DUMP_STACK 
    208234 
    209235   void cxios_get_variable_data_logic(const char* varId, int varIdSize, bool* data, bool* isVarExisted) 
     236   TRY 
    210237   { 
    211238      std::string varIdStr; 
     
    226253      CTimer::get("XIOS").suspend(); 
    227254   } 
     255   CATCH_DUMP_STACK 
    228256 
    229257   void cxios_get_variable_data_char(const char* varId, int varIdSize, char* data, int dataSizeIn, bool* isVarExisted) 
     258   TRY 
    230259   { 
    231260      std::string varIdStr; 
     
    247276      CTimer::get("XIOS").suspend(); 
    248277   } 
     278   CATCH_DUMP_STACK 
    249279 
    250280   /*! \brief This group of functions write information into existing variable in the configuration file (.xml) 
     
    259289   */ 
    260290   void cxios_set_variable_data_k8(const char* varId, int varIdSize, double data, bool* isVarExisted) 
    261    { 
     291   TRY 
     292  { 
    262293      std::string varIdStr; 
    263294      if (!cstr2string(varId, varIdSize, varIdStr)) return; 
     
    278309      CTimer::get("XIOS").suspend(); 
    279310   } 
     311   CATCH_DUMP_STACK 
    280312 
    281313   void cxios_set_variable_data_k4(const char* varId, int varIdSize, float data, bool* isVarExisted) 
     314   TRY 
    282315   { 
    283316      std::string varIdStr; 
     
    299332      CTimer::get("XIOS").suspend(); 
    300333   } 
     334   CATCH_DUMP_STACK 
    301335 
    302336   void cxios_set_variable_data_int(const char* varId, int varIdSize, int data, bool* isVarExisted) 
     337   TRY 
    303338   { 
    304339      std::string varIdStr; 
     
    321356      CTimer::get("XIOS").suspend(); 
    322357   } 
     358   CATCH_DUMP_STACK 
    323359 
    324360   void cxios_set_variable_data_logic(const char* varId, int varIdSize, bool data, bool* isVarExisted) 
     361   TRY 
    325362   { 
    326363      std::string varIdStr; 
     
    342379      CTimer::get("XIOS").suspend(); 
    343380   } 
     381   CATCH_DUMP_STACK 
    344382 
    345383   void cxios_set_variable_data_char(const char* varId, int varIdSize, const char* data, int dataSizeIn, bool* isVarExisted) 
    346    { 
     384   TRY 
     385  { 
    347386      std::string varIdStr, dataStr; 
    348387      if (!cstr2string(varId, varIdSize, varIdStr)) return; 
     
    368407      CTimer::get("XIOS").suspend(); 
    369408   } 
    370  
     409   CATCH_DUMP_STACK 
    371410 
    372411   // ---------------------- Ecriture des données ------------------------------ 
    373412 
    374413   void cxios_write_data_k80(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 
     414   TRY 
    375415   { 
    376416      std::string fieldid_str; 
     
    387427      CTimer::get("XIOS").suspend(); 
    388428   } 
     429   CATCH_DUMP_STACK 
    389430 
    390431   void cxios_write_data_k81(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 
     432   TRY 
    391433   { 
    392434      std::string fieldid_str; 
     
    406448      CTimer::get("XIOS").suspend(); 
    407449   } 
     450   CATCH_DUMP_STACK 
    408451 
    409452   void cxios_write_data_k82(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize, int data_Ysize) 
     453   TRY 
    410454   { 
    411455      std::string fieldid_str; 
     
    425469      CTimer::get("XIOS").suspend(); 
    426470   } 
     471   CATCH_DUMP_STACK 
    427472 
    428473   void cxios_write_data_k83(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize, int data_Ysize, int data_Zsize) 
     474   TRY 
    429475   { 
    430476      std::string fieldid_str; 
     
    444490      CTimer::get("XIOS").suspend(); 
    445491   } 
     492   CATCH_DUMP_STACK 
    446493 
    447494   void cxios_write_data_k84(const char* fieldid, int fieldid_size, double* data_k8, int data_0size, int data_1size, int data_2size, int data_3size) 
     495   TRY 
    448496   { 
    449497      std::string fieldid_str; 
     
    463511      CTimer::get("XIOS").suspend(); 
    464512   } 
     513   CATCH_DUMP_STACK 
    465514 
    466515   void cxios_write_data_k85(const char* fieldid, int fieldid_size, double* data_k8, 
    467516                             int data_0size, int data_1size, int data_2size, 
    468517                             int data_3size, int data_4size) 
     518   TRY 
    469519   { 
    470520      std::string fieldid_str; 
     
    484534      CTimer::get("XIOS").suspend(); 
    485535   } 
     536   CATCH_DUMP_STACK 
    486537 
    487538   void cxios_write_data_k86(const char* fieldid, int fieldid_size, double* data_k8, 
    488539                             int data_0size, int data_1size, int data_2size, 
    489540                             int data_3size, int data_4size, int data_5size) 
     541   TRY 
    490542   { 
    491543      std::string fieldid_str; 
     
    505557      CTimer::get("XIOS").suspend(); 
    506558   } 
     559   CATCH_DUMP_STACK 
    507560 
    508561   void cxios_write_data_k87(const char* fieldid, int fieldid_size, double* data_k8, 
     
    510563                             int data_3size, int data_4size, int data_5size, 
    511564                             int data_6size) 
     565   TRY 
    512566   { 
    513567      std::string fieldid_str; 
     
    527581      CTimer::get("XIOS").suspend(); 
    528582   } 
     583   CATCH_DUMP_STACK 
    529584 
    530585   void cxios_write_data_k40(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 
     586   TRY 
    531587   { 
    532588      std::string fieldid_str; 
     
    546602      CTimer::get("XIOS").suspend(); 
    547603   } 
     604   CATCH_DUMP_STACK 
    548605 
    549606   void cxios_write_data_k41(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 
     607   TRY 
    550608   { 
    551609      std::string fieldid_str; 
     
    567625      CTimer::get("XIOS").suspend(); 
    568626   } 
     627   CATCH_DUMP_STACK 
    569628 
    570629   void cxios_write_data_k42(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize, int data_Ysize) 
     630   TRY 
    571631   { 
    572632      std::string fieldid_str; 
     
    588648      CTimer::get("XIOS").suspend(); 
    589649   } 
     650   CATCH_DUMP_STACK 
    590651 
    591652   void cxios_write_data_k43(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize, int data_Ysize, int data_Zsize) 
     653   TRY 
    592654   { 
    593655      std::string fieldid_str; 
     
    609671      CTimer::get("XIOS").suspend(); 
    610672    } 
     673   CATCH_DUMP_STACK 
    611674 
    612675   void cxios_write_data_k44(const char* fieldid, int fieldid_size, float* data_k4, 
    613676                             int data_0size, int data_1size, int data_2size, 
    614677                             int data_3size) 
     678   TRY 
    615679   { 
    616680      std::string fieldid_str; 
     
    632696      CTimer::get("XIOS").suspend(); 
    633697    } 
     698   CATCH_DUMP_STACK 
    634699 
    635700   void cxios_write_data_k45(const char* fieldid, int fieldid_size, float* data_k4, 
    636701                             int data_0size, int data_1size, int data_2size, 
    637702                             int data_3size, int data_4size) 
     703   TRY 
    638704   { 
    639705      std::string fieldid_str; 
     
    655721      CTimer::get("XIOS").suspend(); 
    656722    } 
     723   CATCH_DUMP_STACK 
    657724 
    658725   void cxios_write_data_k46(const char* fieldid, int fieldid_size, float* data_k4, 
    659726                             int data_0size, int data_1size, int data_2size, 
    660727                             int data_3size, int data_4size, int data_5size) 
     728   TRY 
    661729   { 
    662730      std::string fieldid_str; 
     
    678746      CTimer::get("XIOS").suspend(); 
    679747    } 
     748   CATCH_DUMP_STACK 
    680749 
    681750   void cxios_write_data_k47(const char* fieldid, int fieldid_size, float* data_k4, 
     
    683752                             int data_3size, int data_4size, int data_5size, 
    684753                             int data_6size) 
     754   TRY 
    685755   { 
    686756      std::string fieldid_str; 
     
    702772      CTimer::get("XIOS").suspend(); 
    703773    } 
     774   CATCH_DUMP_STACK 
    704775 
    705776   // ---------------------- Lecture des données ------------------------------ 
    706777 
    707778   void cxios_read_data_k80(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 
     779   TRY 
    708780   { 
    709781      std::string fieldid_str; 
     
    723795      CTimer::get("XIOS").suspend(); 
    724796   } 
     797   CATCH_DUMP_STACK 
    725798 
    726799   void cxios_read_data_k81(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 
     800   TRY 
    727801   { 
    728802      std::string fieldid_str; 
     
    742816      CTimer::get("XIOS").suspend(); 
    743817   } 
     818   CATCH_DUMP_STACK 
    744819 
    745820   void cxios_read_data_k82(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize, int data_Ysize) 
     821   TRY 
    746822   { 
    747823      std::string fieldid_str; 
     
    761837      CTimer::get("XIOS").suspend(); 
    762838   } 
     839   CATCH_DUMP_STACK 
    763840 
    764841   void cxios_read_data_k83(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize, int data_Ysize, int data_Zsize) 
     842   TRY 
    765843   { 
    766844      std::string fieldid_str; 
     
    780858      CTimer::get("XIOS").suspend(); 
    781859   } 
     860   CATCH_DUMP_STACK 
    782861 
    783862   void cxios_read_data_k84(const char* fieldid, int fieldid_size, double* data_k8, 
    784863                            int data_0size, int data_1size, int data_2size, 
    785864                            int data_3size) 
     865   TRY 
    786866   { 
    787867      std::string fieldid_str; 
     
    801881      CTimer::get("XIOS").suspend(); 
    802882   } 
     883   CATCH_DUMP_STACK 
    803884 
    804885   void cxios_read_data_k85(const char* fieldid, int fieldid_size, double* data_k8, 
    805886                            int data_0size, int data_1size, int data_2size, 
    806887                            int data_3size, int data_4size) 
     888   TRY 
    807889   { 
    808890      std::string fieldid_str; 
     
    822904      CTimer::get("XIOS").suspend(); 
    823905   } 
     906   CATCH_DUMP_STACK 
    824907 
    825908   void cxios_read_data_k86(const char* fieldid, int fieldid_size, double* data_k8, 
    826909                            int data_0size, int data_1size, int data_2size, 
    827910                            int data_3size, int data_4size, int data_5size) 
     911   TRY 
    828912   { 
    829913      std::string fieldid_str; 
     
    843927      CTimer::get("XIOS").suspend(); 
    844928   } 
     929   CATCH_DUMP_STACK 
    845930 
    846931   void cxios_read_data_k87(const char* fieldid, int fieldid_size, double* data_k8, 
     
    848933                            int data_3size, int data_4size, int data_5size, 
    849934                            int data_6size) 
     935   TRY 
    850936   { 
    851937      std::string fieldid_str; 
     
    865951      CTimer::get("XIOS").suspend(); 
    866952   } 
     953   CATCH_DUMP_STACK 
    867954 
    868955   void cxios_read_data_k40(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 
     956   TRY 
    869957   { 
    870958      std::string fieldid_str; 
     
    886974      CTimer::get("XIOS").suspend(); 
    887975   } 
     976   CATCH_DUMP_STACK 
    888977 
    889978   void cxios_read_data_k41(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 
     979   TRY 
    890980   { 
    891981      std::string fieldid_str; 
     
    907997      CTimer::get("XIOS").suspend(); 
    908998   } 
     999   CATCH_DUMP_STACK 
    9091000 
    9101001   void cxios_read_data_k42(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize, int data_Ysize) 
     1002   TRY 
    9111003   { 
    9121004      std::string fieldid_str; 
     
    9281020      CTimer::get("XIOS").suspend(); 
    9291021   } 
     1022   CATCH_DUMP_STACK 
    9301023 
    9311024   void cxios_read_data_k43(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize, int data_Ysize, int data_Zsize) 
     1025   TRY 
    9321026   { 
    9331027      std::string fieldid_str; 
     
    9491043      CTimer::get("XIOS").suspend(); 
    9501044    } 
     1045   CATCH_DUMP_STACK 
    9511046 
    9521047   void cxios_read_data_k44(const char* fieldid, int fieldid_size, float* data_k4, 
    9531048                            int data_0size, int data_1size, int data_2size, 
    9541049                            int data_3size) 
     1050   TRY 
    9551051   { 
    9561052      std::string fieldid_str; 
     
    9721068      CTimer::get("XIOS").suspend(); 
    9731069    } 
     1070   CATCH_DUMP_STACK 
    9741071 
    9751072   void cxios_read_data_k45(const char* fieldid, int fieldid_size, float* data_k4, 
    9761073                            int data_0size, int data_1size, int data_2size, 
    9771074                            int data_3size, int data_4size) 
     1075   TRY 
    9781076   { 
    9791077      std::string fieldid_str; 
     
    9951093      CTimer::get("XIOS").suspend(); 
    9961094    } 
     1095   CATCH_DUMP_STACK 
    9971096 
    9981097   void cxios_read_data_k46(const char* fieldid, int fieldid_size, float* data_k4, 
    9991098                            int data_0size, int data_1size, int data_2size, 
    10001099                            int data_3size, int data_4size, int data_5size) 
     1100   TRY 
    10011101   { 
    10021102      std::string fieldid_str; 
     
    10181118      CTimer::get("XIOS").suspend(); 
    10191119    } 
     1120   CATCH_DUMP_STACK 
    10201121 
    10211122   void cxios_read_data_k47(const char* fieldid, int fieldid_size, float* data_k4, 
     
    10231124                            int data_3size, int data_4size, int data_5size, 
    10241125                            int data_6size) 
     1126   TRY 
    10251127   { 
    10261128      std::string fieldid_str; 
     
    10421144      CTimer::get("XIOS").suspend(); 
    10431145    } 
     1146   CATCH_DUMP_STACK 
    10441147} // extern "C" 
  • XIOS/trunk/src/interface/c/icdate.cpp

    r1542 r1622  
    3535{ 
    3636  long long int cxios_date_convert_to_seconds(cxios_date date_c) 
     37  TRY 
    3738  { 
    3839    xios::CDate date = xios::CDate(getCalendar("long long int cxios_date_convert_to_seconds(cxios_date date_c)"), 
     
    4142    return date; 
    4243  } 
     44  CATCH_DUMP_STACK 
    4345 
    4446  void cxios_date_convert_to_string(cxios_date date_c, char* str, int str_size) 
     47  TRY 
    4548  { 
    4649    xios::CDate date = xios::CDate(getCalendar("void cxios_date_convert_to_string(cxios_date date_c, char* str, int str_size)"), 
     
    5154      ERROR("void cxios_date_convert_to_string(cxios_date date_c, char* str, int str_size)", << "Input string is too short"); 
    5255  } 
     56  CATCH_DUMP_STACK 
    5357 
    5458  cxios_date cxios_date_convert_from_string(const char* str, int str_size) 
     59  TRY 
    5560  { 
    5661    std::string date_str; 
     
    6368    return { date.getYear(), date.getMonth(), date.getDay(), date.getHour(), date.getMinute(), date.getSecond() }; 
    6469  } 
     70  CATCH_DUMP_STACK 
    6571 
    6672  cxios_date cxios_date_add_duration(cxios_date date_c, cxios_duration dur_c) 
     73  TRY 
    6774  { 
    6875    xios::CDate date = xios::CDate(getCalendar("cxios_date cxios_date_add_duration(cxios_date date_c, cxios_duration dur_c)"), 
     
    7380    return { res.getYear(), res.getMonth(), res.getDay(), res.getHour(), res.getMinute(), res.getSecond() }; 
    7481  } 
     82  CATCH_DUMP_STACK 
    7583 
    7684  cxios_date cxios_date_sub_duration(cxios_date date_c, cxios_duration dur_c) 
     85  TRY 
    7786  { 
    7887    xios::CDate date = xios::CDate(getCalendar("cxios_date cxios_date_sub_duration(cxios_date date_c, cxios_duration dur_c)"), 
     
    8493    return { res.getYear(), res.getMonth(), res.getDay(), res.getHour(), res.getMinute(), res.getSecond() }; 
    8594  } 
     95  CATCH_DUMP_STACK 
    8696 
    8797  cxios_duration cxios_date_sub(cxios_date date1_c, cxios_date date2_c) 
     98  TRY 
    8899  { 
    89100    xios::CDate date1 = xios::CDate(getCalendar("cxios_duration cxios_date_sub(cxios_date date1_c, cxios_date date2_c)"), 
     
    96107    return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 
    97108  } 
     109  CATCH_DUMP_STACK 
    98110 
    99111  bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c) 
     112  TRY 
    100113  { 
    101114    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    107120    return (date1 == date2); 
    108121  } 
     122  CATCH_DUMP_STACK 
    109123 
    110124  bool cxios_date_neq(cxios_date date1_c, cxios_date date2_c) 
     125  TRY 
    111126  { 
    112127    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    118133    return (date1 != date2); 
    119134  } 
     135  CATCH_DUMP_STACK 
    120136 
    121137  bool cxios_date_lt(cxios_date date1_c, cxios_date date2_c) 
     138  TRY 
    122139  { 
    123140    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    129146    return (date1 < date2); 
    130147  } 
     148  CATCH_DUMP_STACK 
    131149 
    132150  bool cxios_date_le(cxios_date date1_c, cxios_date date2_c) 
     151  TRY 
    133152  { 
    134153    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    140159    return (date1 <= date2); 
    141160  } 
     161  CATCH_DUMP_STACK 
    142162 
    143163  bool cxios_date_gt(cxios_date date1_c, cxios_date date2_c) 
     164  TRY 
    144165  { 
    145166    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    151172    return (date1 > date2); 
    152173  } 
     174  CATCH_DUMP_STACK 
    153175 
    154176  bool cxios_date_ge(cxios_date date1_c, cxios_date date2_c) 
     177  TRY 
    155178  { 
    156179    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    162185    return (date1 >= date2); 
    163186  } 
     187  CATCH_DUMP_STACK 
    164188 
    165189  int cxios_date_get_second_of_year(cxios_date date_c) 
     190  TRY 
    166191  { 
    167192    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_second_of_year(cxios_date date_c)"), 
     
    170195    return date.getSecondOfYear(); 
    171196  } 
     197  CATCH_DUMP_STACK 
    172198 
    173199  double cxios_date_get_day_of_year(cxios_date date_c) 
     200  TRY 
    174201  { 
    175202    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_day_of_year(cxios_date date_c)"), 
     
    178205    return date.getDayOfYear(); 
    179206  } 
     207  CATCH_DUMP_STACK 
    180208 
    181209  double cxios_date_get_fraction_of_year(cxios_date date_c) 
     210  TRY 
    182211  { 
    183212    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_fraction_of_year(cxios_date date_c)"), 
     
    186215    return date.getFractionOfYear(); 
    187216  } 
     217  CATCH_DUMP_STACK 
    188218 
    189219  int cxios_date_get_second_of_day(cxios_date date_c) 
     220  TRY 
    190221  { 
    191222    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_second_of_day(cxios_date date_c)"), 
     
    194225    return date.getSecondOfDay(); 
    195226  } 
     227  CATCH_DUMP_STACK 
    196228 
    197229  double cxios_date_get_fraction_of_day(cxios_date date_c) 
     230  TRY 
    198231  { 
    199232    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_fraction_of_day(cxios_date date_c)"), 
     
    202235    return date.getFractionOfDay(); 
    203236  } 
     237  CATCH_DUMP_STACK 
    204238} // extern "C" 
  • XIOS/trunk/src/interface/c/icdomain.cpp

    r1542 r1622  
    2929    
    3030   void cxios_domain_handle_create (XDomainPtr * _ret, const char * _id, int _id_len) 
     31   TRY 
    3132   { 
    3233      std::string id;  
     
    3637      CTimer::get("XIOS").suspend() ; 
    3738   } 
     39   CATCH_DUMP_STACK 
    3840    
    3941   void cxios_domaingroup_handle_create (XDomainGroupPtr * _ret, const char * _id, int _id_len) 
     42   TRY 
    4043   { 
    4144      std::string id;  
     
    4649      CTimer::get("XIOS").suspend() ; 
    4750   } 
     51   CATCH_DUMP_STACK 
    4852 
    4953   // -------------------- Vérification des identifiants ----------------------- 
    5054 
    5155   void cxios_domain_valid_id (bool * _ret, const char * _id, int _id_len) 
     56   TRY 
    5257   { 
    5358      std::string id; 
     
    5863      CTimer::get("XIOS").suspend() ; 
    5964   } 
     65   CATCH_DUMP_STACK 
    6066 
    6167   void cxios_domaingroup_valid_id (bool * _ret, const char * _id, int _id_len) 
     68   TRY 
    6269   { 
    6370      std::string id; 
     
    6774      CTimer::get("XIOS").suspend() ; 
    6875   } 
     76   CATCH_DUMP_STACK 
    6977} // extern "C" 
  • XIOS/trunk/src/interface/c/icduplicate_scalar_to_axis.cpp

    r1542 r1622  
    2626   // ------------------------ Création des handle ----------------------------- 
    2727   void cxios_duplicate_scalar_to_axis_handle_create(XDuplicateScalarToAxisPtr * _ret, const char * _id, int _id_len) 
     28   TRY 
    2829   { 
    2930      std::string id; 
     
    3334      CTimer::get("XIOS").suspend() ; 
    3435   } 
     36   CATCH_DUMP_STACK 
    3537 
    3638   // -------------------- Vérification des identifiants ----------------------- 
    3739   void cxios_duplicate_scalar_to_axis_valid_id(bool * _ret, const char * _id, int _id_len) 
     40   TRY 
    3841   { 
    3942      std::string id; 
     
    4447      CTimer::get("XIOS").suspend() ; 
    4548   } 
     49   CATCH_DUMP_STACK 
    4650 
    4751} // extern "C" 
  • XIOS/trunk/src/interface/c/icduration.cpp

    r1472 r1622  
     1#include "xios.hpp" 
     2 
    13#include "icutil.hpp" 
    24#include "icdate.hpp" 
     
    68{ 
    79  void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size) 
     10  TRY 
    811  { 
    912    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 
     
    1215      ERROR("void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size)", << "Input string is too short"); 
    1316  } 
     17  CATCH_DUMP_STACK 
    1418 
    1519  cxios_duration cxios_duration_convert_from_string(const char* str, int str_size) 
     20  TRY 
    1621  { 
    1722    std::string dur_str; 
     
    2328    return { dur.year, dur.month, dur.day, dur.hour, dur.minute, dur.second, dur.timestep }; 
    2429  } 
     30  CATCH_DUMP_STACK 
    2531 
    2632  cxios_duration cxios_duration_add(cxios_duration dur1_c, cxios_duration dur2_c) 
     33  TRY 
    2734  { 
    2835    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 
     
    3239    return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 
    3340  } 
     41  CATCH_DUMP_STACK 
    3442 
    3543  cxios_duration cxios_duration_sub(cxios_duration dur1_c, cxios_duration dur2_c) 
     44  TRY 
    3645  { 
    3746    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 
     
    4150    return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 
    4251  } 
     52  CATCH_DUMP_STACK 
    4353 
    4454  cxios_duration cxios_duration_mult(double val, cxios_duration dur_c) 
     55  TRY 
    4556  { 
    4657    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 
     
    4859    return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 
    4960  } 
     61  CATCH_DUMP_STACK 
    5062 
    5163  cxios_duration cxios_duration_neg(cxios_duration dur_c) 
     64  TRY 
    5265  { 
    5366    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 
     
    5568    return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 
    5669  } 
     70  CATCH_DUMP_STACK 
    5771 
    5872  bool cxios_duration_eq(cxios_duration dur1_c, cxios_duration dur2_c) 
     73  TRY 
    5974  { 
    6075    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 
     
    6277    return (dur1 == dur2); 
    6378  } 
     79  CATCH_DUMP_STACK 
    6480 
    6581  bool cxios_duration_neq(cxios_duration dur1_c, cxios_duration dur2_c) 
     82  TRY 
    6683  { 
    6784    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 
     
    6986    return (dur1 != dur2); 
    7087  } 
     88  CATCH_DUMP_STACK 
    7189} 
  • XIOS/trunk/src/interface/c/icexpand_domain.cpp

    r1542 r1622  
    2727   // ------------------------ Création des handle ----------------------------- 
    2828   void cxios_expand_domain_handle_create(XExpandDomainPtr * _ret, const char * _id, int _id_len) 
     29   TRY 
    2930   { 
    3031      std::string id; 
     
    3435      CTimer::get("XIOS").suspend() ; 
    3536   } 
     37   CATCH_DUMP_STACK 
    3638 
    3739   // -------------------- Vérification des identifiants ----------------------- 
    3840   void cxios_expand_domain_valid_id(bool * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id; 
     
    4548      CTimer::get("XIOS").suspend() ; 
    4649   } 
     50   CATCH_DUMP_STACK 
    4751} // extern "C" 
  • XIOS/trunk/src/interface/c/icextract_to_axis.cpp

    r1542 r1622  
    2626   // ------------------------ Création des handle ----------------------------- 
    2727   void cxios_extract_domain_to_axis_handle_create(XExtractDomainToAxisPtr * _ret, const char * _id, int _id_len) 
     28   TRY 
    2829   { 
    2930      std::string id; 
     
    3334      CTimer::get("XIOS").suspend() ; 
    3435   } 
     36   CATCH_DUMP_STACK 
    3537 
    3638   // -------------------- Vérification des identifiants ----------------------- 
    3739   void cxios_extract_domain_to_axis_valid_id(bool * _ret, const char * _id, int _id_len) 
     40   TRY 
    3841   { 
    3942      std::string id; 
     
    4447      CTimer::get("XIOS").suspend() ; 
    4548   } 
     49   CATCH_DUMP_STACK 
    4650 
    4751} // extern "C" 
  • XIOS/trunk/src/interface/c/icextract_to_scalar.cpp

    r1542 r1622  
    2626   // ------------------------ Création des handle ----------------------------- 
    2727   void cxios_extract_axis_to_scalar_handle_create(XExtractAxisToScalarPtr * _ret, const char * _id, int _id_len) 
     28   TRY 
    2829   { 
    2930      std::string id; 
     
    3334      CTimer::get("XIOS").suspend() ; 
    3435   } 
     36   CATCH_DUMP_STACK 
    3537 
    3638   // -------------------- Vérification des identifiants ----------------------- 
    3739   void cxios_extract_axis_to_scalar_valid_id(bool * _ret, const char * _id, int _id_len) 
     40   TRY 
    3841   { 
    3942      std::string id; 
     
    4447      CTimer::get("XIOS").suspend() ; 
    4548   } 
     49   CATCH_DUMP_STACK 
    4650 
    4751} // extern "C" 
  • XIOS/trunk/src/interface/c/icfield.cpp

    r1542 r1622  
    3535    
    3636   void cxios_field_handle_create (XFieldPtr * _ret, const char * _id, int _id_len) 
     37   TRY 
    3738   { 
    3839      std::string id;  
     
    4243      CTimer::get("XIOS").suspend() ; 
    4344   } 
     45   CATCH_DUMP_STACK 
    4446    
    4547   void cxios_fieldgroup_handle_create (XFieldGroupPtr * _ret, const char * _id, int _id_len) 
     48   TRY 
    4649   { 
    4750      std::string id;  
     
    5154      CTimer::get("XIOS").suspend() ; 
    5255   } 
    53  
     56   CATCH_DUMP_STACK 
    5457 
    5558   // -------------------- Vérification des identifiants ----------------------- 
    5659 
    5760   void cxios_field_valid_id (bool * _ret, const char * _id, int _id_len) 
     61   TRY 
    5862   { 
    5963      std::string id; 
     
    6367      CTimer::get("XIOS").suspend() ; 
    6468   } 
     69   CATCH_DUMP_STACK 
    6570 
    6671   void cxios_fieldgroup_valid_id (bool * _ret, const char * _id, int _id_len) 
     72   TRY 
    6773   { 
    6874      std::string id; 
     
    7278      CTimer::get("XIOS").suspend() ; 
    7379   } 
     80   CATCH_DUMP_STACK 
    7481 
    7582// -----------------------------------------------------------------------------------------------------    
     
    7885 
    7986  void cxios_field_is_active (XFieldPtr field_hdl, bool at_current_timestep, bool* ret) 
     87  TRY 
    8088  { 
    8189    CTimer::get("XIOS").resume() ; 
     
    8391    CTimer::get("XIOS").suspend() ; 
    8492  } 
     93  CATCH_DUMP_STACK 
    8594 
    8695// ----------------------------------------------------------------------------------------------------- 
     
    8897// ----------------------------------------------------------------------------------------------------- 
    8998  void cxios_field_get_domain_handle(XDomainPtr * domain_hdl_ret, XFieldPtr field_hdl, int domainIndex) 
     99  TRY 
    90100  { 
    91101     CTimer::get("XIOS").resume() ; 
     
    93103     CTimer::get("XIOS").suspend(); 
    94104  } 
     105  CATCH_DUMP_STACK 
    95106 
    96107  void cxios_field_get_axis_handle(XAxisPtr * axis_hdl_ret, XFieldPtr field_hdl, int axisIndex) 
     108  TRY 
    97109  { 
    98110     CTimer::get("XIOS").resume() ; 
     
    100112     CTimer::get("XIOS").suspend(); 
    101113  } 
     114  CATCH_DUMP_STACK 
    102115 
    103116  void cxios_field_get_scalar_handle(XScalarPtr * scalar_hdl_ret, XFieldPtr field_hdl, int scalarIndex) 
     117  TRY 
    104118  { 
    105119     CTimer::get("XIOS").resume() ; 
     
    107121     CTimer::get("XIOS").suspend(); 
    108122  } 
     123  CATCH_DUMP_STACK 
    109124} // extern "C" 
  • XIOS/trunk/src/interface/c/icfile.cpp

    r1542 r1622  
    2828    
    2929   void cxios_file_handle_create (XFilePtr * _ret, const char * _id, int _id_len) 
     30   TRY 
    3031   { 
    3132      std::string id;  
     
    3536      CTimer::get("XIOS").suspend() ; 
    3637   } 
     38   CATCH_DUMP_STACK 
    3739    
    3840   void cxios_filegroup_handle_create (XFileGroupPtr * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id;  
     
    4447      CTimer::get("XIOS").suspend() ; 
    4548   } 
     49   CATCH_DUMP_STACK 
    4650 
    4751   // -------------------- Vérification des identifiants ----------------------- 
    4852 
    4953   void cxios_file_valid_id (bool * _ret, const char * _id, int _id_len) 
     54   TRY 
    5055   { 
    5156      std::string id; 
     
    5560      CTimer::get("XIOS").suspend() ; 
    5661   } 
     62   CATCH_DUMP_STACK 
    5763 
    5864   void cxios_filegroup_valid_id (bool * _ret, const char * _id, int _id_len) 
     65   TRY 
    5966   { 
    6067      std::string id; 
     
    6471      CTimer::get("XIOS").suspend() ; 
    6572   } 
     73   CATCH_DUMP_STACK 
    6674} // extern "C" 
  • XIOS/trunk/src/interface/c/icgenerate_rectilinear_domain.cpp

    r1542 r1622  
    2727   // ------------------------ Création des handle ----------------------------- 
    2828   void cxios_generate_rectilinear_domain_handle_create(XGenDomainPtr * _ret, const char * _id, int _id_len) 
     29   TRY 
    2930   { 
    3031      std::string id; 
     
    3435      CTimer::get("XIOS").suspend() ; 
    3536   } 
     37   CATCH_DUMP_STACK 
    3638 
    3739   // -------------------- Vérification des identifiants ----------------------- 
    3840   void cxios_generate_rectilinear_domain_valid_id(bool * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id; 
     
    4548      CTimer::get("XIOS").suspend() ; 
    4649   } 
     50   CATCH_DUMP_STACK 
    4751} // extern "C" 
  • XIOS/trunk/src/interface/c/icgrid.cpp

    r1542 r1622  
    2727   
    2828   void cxios_grid_handle_create (XGridPtr * _ret, const char * _id, int _id_len) 
     29   TRY 
    2930   { 
    3031      std::string id;  
     
    3435      CTimer::get("XIOS").suspend() ; 
    3536   } 
     37   CATCH_DUMP_STACK 
    3638    
    3739   void cxios_gridgroup_handle_create (XGridGroupPtr * _ret, const char * _id, int _id_len) 
     40   TRY 
    3841   { 
    3942      std::string id;  
     
    4346      CTimer::get("XIOS").suspend() ; 
    4447   } 
     48   CATCH_DUMP_STACK 
    4549 
    4650   // -------------------- Vérification des identifiants ----------------------- 
    4751 
    4852   void cxios_grid_valid_id (bool * _ret, const char * _id, int _id_len) 
     53   TRY 
    4954   { 
    5055      std::string id; 
     
    5459      CTimer::get("XIOS").suspend() ; 
    5560   } 
     61   CATCH_DUMP_STACK 
    5662 
    5763   void cxios_gridgroup_valid_id (bool * _ret, const char * _id, int _id_len) 
     64   TRY 
    5865   { 
    5966      std::string id; 
     
    6370      CTimer::get("XIOS").suspend() ; 
    6471   } 
     72   CATCH_DUMP_STACK 
    6573} // extern "C" 
  • XIOS/trunk/src/interface/c/icinterpolate.cpp

    r1542 r1622  
    2727   // ------------------------ Création des handle ----------------------------- 
    2828   void cxios_interpolate_domain_handle_create(XInterpolateDomainPtr * _ret, const char * _id, int _id_len) 
     29   TRY 
    2930   { 
    3031      std::string id; 
     
    3435      CTimer::get("XIOS").suspend() ; 
    3536   } 
     37   CATCH_DUMP_STACK 
    3638 
    3739   // -------------------- Vérification des identifiants ----------------------- 
    3840   void cxios_interpolate_domain_valid_id(bool * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id; 
     
    4548      CTimer::get("XIOS").suspend() ; 
    4649   } 
     50   CATCH_DUMP_STACK 
    4751 
    4852    // ------------------------ Création des handle ----------------------------- 
    4953   void cxios_interpolate_axis_handle_create(XInterpolateAxisPtr * _ret, const char * _id, int _id_len) 
     54   TRY 
    5055   { 
    5156      std::string id; 
     
    5560      CTimer::get("XIOS").suspend() ; 
    5661   } 
     62   CATCH_DUMP_STACK 
    5763 
    5864   // -------------------- Vérification des identifiants ----------------------- 
    5965   void cxios_interpolate_axis_valid_id(bool * _ret, const char * _id, int _id_len) 
     66   TRY 
    6067   { 
    6168      std::string id; 
     
    6673      CTimer::get("XIOS").suspend() ; 
    6774   } 
     75   CATCH_DUMP_STACK 
    6876} // extern "C" 
  • XIOS/trunk/src/interface/c/icinverse_axis.cpp

    r1542 r1622  
    2727   // ------------------------ Création des handle ----------------------------- 
    2828   void cxios_inverse_axis_handle_create(XInverseAxisPtr * _ret, const char * _id, int _id_len) 
     29   TRY 
    2930   { 
    3031      std::string id; 
     
    3435      CTimer::get("XIOS").suspend() ; 
    3536   } 
     37   CATCH_DUMP_STACK 
    3638 
    3739   // -------------------- Vérification des identifiants ----------------------- 
    3840   void cxios_inverse_axis_valid_id(bool * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id; 
     
    4548      CTimer::get("XIOS").suspend() ; 
    4649   } 
     50   CATCH_DUMP_STACK 
    4751} // extern "C" 
  • XIOS/trunk/src/interface/c/icreduce_axis_to_axis.cpp

    r1542 r1622  
    2727   // ------------------------ Création des handle ----------------------------- 
    2828   void cxios_reduce_axis_to_axis_handle_create(XReduceAxisToAxisPtr * _ret, const char * _id, int _id_len) 
     29   TRY 
    2930   { 
    3031      std::string id; 
     
    3435      CTimer::get("XIOS").suspend() ; 
    3536   } 
     37   CATCH_DUMP_STACK 
    3638 
    3739   // -------------------- Vérification des identifiants ----------------------- 
    3840   void cxios_reduce_axis_to_axis_valid_id(bool * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id; 
     
    4548      CTimer::get("XIOS").suspend() ; 
    4649   } 
     50   CATCH_DUMP_STACK 
    4751 
    4852} // extern "C" 
  • XIOS/trunk/src/interface/c/icreduce_scalar_to_scalar.cpp

    r1542 r1622  
    2727   // ------------------------ Création des handle ----------------------------- 
    2828   void cxios_reduce_scalar_to_scalar_handle_create(XReduceScalarToScalarPtr * _ret, const char * _id, int _id_len) 
     29   TRY 
    2930   { 
    3031      std::string id; 
     
    3435      CTimer::get("XIOS").suspend() ; 
    3536   } 
     37   CATCH_DUMP_STACK 
    3638 
    3739   // -------------------- Vérification des identifiants ----------------------- 
    3840   void cxios_reduce_scalar_to_scalar_valid_id(bool * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id; 
     
    4548      CTimer::get("XIOS").suspend() ; 
    4649   } 
     50   CATCH_DUMP_STACK 
    4751 
    4852} // extern "C" 
  • XIOS/trunk/src/interface/c/icreduce_to_axis.cpp

    r1542 r1622  
    2727   // ------------------------ Création des handle ----------------------------- 
    2828   void cxios_reduce_domain_to_axis_handle_create(XReduceDomainToAxisPtr * _ret, const char * _id, int _id_len) 
     29   TRY 
    2930   { 
    3031      std::string id; 
     
    3435      CTimer::get("XIOS").suspend() ; 
    3536   } 
     37   CATCH_DUMP_STACK 
    3638 
    3739   // -------------------- Vérification des identifiants ----------------------- 
    3840   void cxios_reduce_domain_to_axis_valid_id(bool * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id; 
     
    4548      CTimer::get("XIOS").suspend() ; 
    4649   } 
     50   CATCH_DUMP_STACK 
    4751 
    4852} // extern "C" 
  • XIOS/trunk/src/interface/c/icreduce_to_scalar.cpp

    r1542 r1622  
    2727   // ------------------------ Création des handle ----------------------------- 
    2828   void cxios_reduce_axis_to_scalar_handle_create(XReduceAxisToScalarPtr * _ret, const char * _id, int _id_len) 
     29   TRY 
    2930   { 
    3031      std::string id; 
     
    3435      CTimer::get("XIOS").suspend() ; 
    3536   } 
     37   CATCH_DUMP_STACK 
    3638 
    3739   // -------------------- Vérification des identifiants ----------------------- 
    3840   void cxios_reduce_axis_to_scalar_valid_id(bool * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id; 
     
    4548      CTimer::get("XIOS").suspend() ; 
    4649   } 
     50   CATCH_DUMP_STACK 
    4751 
    4852   void cxios_reduce_domain_to_scalar_handle_create(XReduceDomainToScalarPtr * _ret, const char * _id, int _id_len) 
     53   TRY 
    4954   { 
    5055      std::string id; 
     
    5459      CTimer::get("XIOS").suspend() ; 
    5560   } 
     61   CATCH_DUMP_STACK 
    5662 
    5763   // -------------------- Vérification des identifiants ----------------------- 
    5864   void cxios_reduce_domain_to_scalar_valid_id(bool * _ret, const char * _id, int _id_len) 
     65   TRY 
    5966   { 
    6067      std::string id; 
     
    6572      CTimer::get("XIOS").suspend() ; 
    6673   } 
     74   CATCH_DUMP_STACK 
    6775 
    6876} // extern "C" 
  • XIOS/trunk/src/interface/c/icreorder_domain.cpp

    r1542 r1622  
    2727   // ------------------------ Création des handle ----------------------------- 
    2828   void cxios_reorder_domain_handle_create(XReorderDomainPtr * _ret, const char * _id, int _id_len) 
     29   TRY 
    2930   { 
    3031      std::string id; 
     
    3435      CTimer::get("XIOS").suspend() ; 
    3536   } 
     37   CATCH_DUMP_STACK 
    3638 
    3739   // -------------------- Vérification des identifiants ----------------------- 
    3840   void cxios_reorder_domain_valid_id(bool * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id; 
     
    4548      CTimer::get("XIOS").suspend() ; 
    4649   } 
     50   CATCH_DUMP_STACK 
    4751} // extern "C" 
  • XIOS/trunk/src/interface/c/icscalar.cpp

    r1542 r1622  
    2828 
    2929   void cxios_scalar_handle_create (XScalarPtr * _ret, const char * _id, int _id_len) 
     30   TRY 
    3031   { 
    3132      std::string id; 
     
    3536      CTimer::get("XIOS").suspend() ; 
    3637   } 
     38   CATCH_DUMP_STACK 
    3739 
    3840   void cxios_scalargroup_handle_create (XScalarGroupPtr * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id; 
     
    4447      CTimer::get("XIOS").suspend() ; 
    4548    } 
     49   CATCH_DUMP_STACK 
    4650 
    4751   // -------------------- Vérification des identifiants ----------------------- 
    4852 
    4953   void cxios_scalar_valid_id (bool * _ret, const char * _id, int _id_len) 
     54   TRY 
    5055   { 
    5156      std::string id; 
     
    5661      CTimer::get("XIOS").suspend() ; 
    5762   } 
     63   CATCH_DUMP_STACK 
    5864 
    5965   void cxios_scalargroup_valid_id (bool * _ret, const char * _id, int _id_len) 
     66   TRY 
    6067   { 
    6168      std::string id; 
     
    6774 
    6875   } 
     76   CATCH_DUMP_STACK 
    6977 
    7078} // extern "C" 
  • XIOS/trunk/src/interface/c/ictemporal_splitting.cpp

    r1542 r1622  
    2727   // ------------------------ Création des handle ----------------------------- 
    2828   void cxios_temporal_splitting_handle_create(XTemporalSplittingPtr * _ret, const char * _id, int _id_len) 
     29   TRY 
    2930   { 
    3031      std::string id; 
     
    3435      CTimer::get("XIOS").suspend() ; 
    3536   } 
     37   CATCH_DUMP_STACK 
    3638 
    3739   // -------------------- Vérification des identifiants ----------------------- 
    3840   void cxios_temporal_splitting_valid_id(bool * _ret, const char * _id, int _id_len) 
     41   TRY 
    3942   { 
    4043      std::string id; 
     
    4548      CTimer::get("XIOS").suspend() ; 
    4649   } 
     50   CATCH_DUMP_STACK 
    4751 
    4852} // extern "C" 
  • XIOS/trunk/src/interface/c/icvariable.cpp

    r1542 r1622  
    2929    
    3030   void cxios_variable_handle_create (XVariablePtr * _ret, const char * _id, int _id_len) 
     31   TRY 
    3132   { 
    3233      std::string id;  
     
    3637      CTimer::get("XIOS").suspend() ; 
    3738   } 
     39   CATCH_DUMP_STACK 
    3840    
    3941   void cxios_variablegroup_handle_create (XVariableGroupPtr * _ret, const char * _id, int _id_len) 
     42   TRY 
    4043   { 
    4144      std::string id;  
     
    4548      CTimer::get("XIOS").suspend() ; 
    4649    } 
     50   CATCH_DUMP_STACK 
    4751 
    4852   // -------------------- Vérification des identifiants ----------------------- 
    4953 
    5054   void cxios_variable_valid_id (bool * _ret, const char * _id, int _id_len) 
     55   TRY 
    5156   { 
    5257      std::string id; 
     
    5762      CTimer::get("XIOS").suspend() ; 
    5863   } 
     64   CATCH_DUMP_STACK 
    5965 
    6066   void cxios_variablegroup_valid_id (bool * _ret, const char * _id, int _id_len) 
     67   TRY 
    6168   { 
    6269      std::string id; 
     
    6875 
    6976   } 
     77   CATCH_DUMP_STACK 
    7078    
    7179} // extern "C" 
  • XIOS/trunk/src/interface/c/iczoom.cpp

    r1542 r1622  
    2828   // ------------------------ Création des handle ----------------------------- 
    2929   void cxios_zoom_axis_handle_create (XZoomAxisPtr * _ret, const char * _id, int _id_len) 
     30   TRY 
    3031   { 
    3132      std::string id; 
     
    3536      CTimer::get("XIOS").suspend() ; 
    3637   } 
     38   CATCH_DUMP_STACK 
    3739 
    3840   // -------------------- Vérification des identifiants ----------------------- 
    3941   void cxios_zoom_axis_valid_id (bool * _ret, const char * _id, int _id_len) 
     42   TRY 
    4043   { 
    4144      std::string id; 
     
    4649      CTimer::get("XIOS").suspend() ; 
    4750   } 
     51   CATCH_DUMP_STACK 
    4852 
    4953   // ------------------------ Création des handle ----------------------------- 
    5054   void cxios_zoom_domain_handle_create(XZoomDomainPtr * _ret, const char * _id, int _id_len) 
     55   TRY 
    5156   { 
    5257      std::string id; 
     
    5661      CTimer::get("XIOS").suspend() ; 
    5762   } 
     63   CATCH_DUMP_STACK 
    5864 
    5965   // -------------------- Vérification des identifiants ----------------------- 
    6066   void cxios_zoom_domain_valid_id(bool * _ret, const char * _id, int _id_len) 
     67   TRY 
    6168   { 
    6269      std::string id; 
     
    6774      CTimer::get("XIOS").suspend() ; 
    6875   } 
     76   CATCH_DUMP_STACK 
    6977} // extern "C" 
  • XIOS/trunk/src/io/nc4_data_input.cpp

    r1582 r1622  
    2929 
    3030  StdSize CNc4DataInput::getFieldNbRecords_(CField* field) 
     31  TRY 
    3132  { 
    3233    StdString fieldId = field->getFieldOutputName(); 
     
    4041    return 1; 
    4142  } 
     43  CATCH 
    4244 
    4345  void CNc4DataInput::readFieldData_(CField* field) 
     46  TRY 
    4447  { 
    4548    CContext* context = CContext::getCurrent(); 
     
    121124    } 
    122125  } 
     126  CATCH 
    123127 
    124128  void CNc4DataInput::readFieldAttributes_(CField* field, bool readAttributeValues) 
     129  TRY 
    125130  { 
    126131    StdString fieldId = field->getFieldOutputName(); 
     
    248253    } 
    249254  } 
     255  CATCH 
    250256 
    251257  /*! 
     
    258264  void CNc4DataInput::readDomainAttributeValueFromFile(CDomain* domain, std::list<std::pair<StdString, StdSize> >& dimSizeMap, 
    259265                                                       int elementPosition, const StdString& fieldId) 
     266  TRY 
    260267  { 
    261268    // There are some optional attributes of a domain to retrieve from file    // + lon lat? 
     
    436443    domain->fillInLonLat(); 
    437444  } 
     445  CATCH 
    438446 
    439447  /*! 
     
    446454  void CNc4DataInput::readDomainAttributesFromFile(CDomain* domain, std::list<std::pair<StdString, StdSize> >& dimSizeMap, 
    447455                                                   int elementPosition, const StdString& fieldId) 
     456  TRY 
    448457  { 
    449458    // There are some mandatory attributes of a domain to retrieve from file 
     
    514523    } 
    515524  } 
     525  CATCH 
    516526 
    517527  /*! 
     
    524534  void CNc4DataInput::readAxisAttributesFromFile(CAxis* axis, std::list<std::pair<StdString, StdSize> >& dimSizeMap, 
    525535                                                 int elementPosition, const StdString& fieldId) 
     536  TRY 
    526537  { 
    527538    std::list<std::pair<StdString, StdSize> >::const_iterator itMapN = dimSizeMap.begin(), 
     
    540551    axis->n_glo.setValue(itMapN->second); 
    541552  } 
     553  CATCH 
    542554 
    543555  /*! 
     
    550562  void CNc4DataInput::readAxisAttributeValueFromFile(CAxis* axis, std::list<std::pair<StdString, StdSize> >& dimSizeMap, 
    551563                                                    int elementPosition, const StdString& fieldId) 
     564  TRY 
    552565  { 
    553566    std::list<std::pair<StdString, StdSize> >::const_iterator itMapN = dimSizeMap.begin(), 
     
    570583    } 
    571584  } 
     585  CATCH 
    572586 
    573587  /*! 
     
    598612 
    599613  void CNc4DataInput::closeFile_(void) 
     614  TRY 
    600615  { 
    601616    SuperClassWriter::close(); 
    602617  } 
     618  CATCH 
    603619} // namespace xios 
  • XIOS/trunk/src/io/nc4_data_output.cpp

    r1559 r1622  
    5454 
    5555      void CNc4DataOutput::writeDomain_(CDomain* domain) 
     56      TRY 
    5657      { 
    5758        StdString lonName,latName ; 
     
    540541         domain->addRelFile(this->filename); 
    541542      } 
     543      CATCH 
    542544 
    543545    //-------------------------------------------------------------- 
  • XIOS/trunk/src/node/axis.cpp

    r1566 r1622  
    4848   bool CAxis::dummyTransformationMapList_ = CAxis::initializeTransformationMap(CAxis::transformationMapList_); 
    4949   bool CAxis::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 
     50   TRY 
    5051   { 
    5152     m["zoom_axis"] = TRANS_ZOOM_AXIS; 
     
    6061 
    6162   } 
     63   CATCH 
    6264 
    6365   ///--------------------------------------------------------------- 
    6466 
    6567   const std::set<StdString> & CAxis::getRelFiles(void) const 
     68   TRY 
    6669   { 
    6770      return (this->relFiles); 
    6871   } 
     72   CATCH 
    6973 
    7074   bool CAxis::IsWritten(const StdString & filename) const 
     75   TRY 
    7176   { 
    7277      return (this->relFiles.find(filename) != this->relFiles.end()); 
    7378   } 
     79   CATCH 
    7480 
    7581   bool CAxis::isWrittenCompressed(const StdString& filename) const 
     82   TRY 
    7683   { 
    7784      return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 
    7885   } 
     86   CATCH 
    7987 
    8088   bool CAxis::isDistributed(void) const 
     89   TRY 
    8190   { 
    8291      bool distributed = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) || 
    8392             (!this->n.isEmpty() && (this->n != this->n_glo)); 
    84       // A same stupid condition to make sure that if there is only one client, axis 
     93      // A condition to make sure that if there is only one client, axis 
    8594      // should be considered to be distributed. This should be a temporary solution      
    8695      distributed |= (1 == CContext::getCurrent()->client->clientSize); 
    8796      return distributed; 
    8897   } 
     98   CATCH 
    8999 
    90100   /*! 
     
    94104    */ 
    95105   bool CAxis::isCompressible(void) const 
     106   TRY 
    96107   { 
    97108      return isCompressible_; 
    98109   } 
     110   CATCH 
    99111 
    100112   void CAxis::addRelFile(const StdString & filename) 
     113   TRY 
    101114   { 
    102115      this->relFiles.insert(filename); 
    103116   } 
     117   CATCH_DUMP_ATTR 
    104118 
    105119   void CAxis::addRelFileCompressed(const StdString& filename) 
     120   TRY 
    106121   { 
    107122      this->relFilesCompressed.insert(filename); 
    108123   } 
     124   CATCH_DUMP_ATTR 
    109125 
    110126   //---------------------------------------------------------------- 
     
    115131   */ 
    116132   int CAxis::getNumberWrittenIndexes(MPI_Comm writtenCom) 
     133   TRY 
    117134   { 
    118135     int writtenSize; 
     
    120137     return numberWrittenIndexes_[writtenSize]; 
    121138   } 
     139   CATCH_DUMP_ATTR 
    122140 
    123141   /*! 
     
    126144   */ 
    127145   int CAxis::getTotalNumberWrittenIndexes(MPI_Comm writtenCom) 
     146   TRY 
    128147   { 
    129148     int writtenSize; 
     
    131150     return totalNumberWrittenIndexes_[writtenSize]; 
    132151   } 
     152   CATCH_DUMP_ATTR 
    133153 
    134154   /*! 
     
    137157   */ 
    138158   int CAxis::getOffsetWrittenIndexes(MPI_Comm writtenCom) 
     159   TRY 
    139160   { 
    140161     int writtenSize; 
     
    142163     return offsetWrittenIndexes_[writtenSize]; 
    143164   } 
     165   CATCH_DUMP_ATTR 
    144166 
    145167   CArray<int, 1>& CAxis::getCompressedIndexToWriteOnServer(MPI_Comm writtenCom) 
     168   TRY 
    146169   { 
    147170     int writtenSize; 
     
    149172     return compressedIndexToWriteOnServer[writtenSize]; 
    150173   } 
     174   CATCH_DUMP_ATTR 
     175 
    151176   //---------------------------------------------------------------- 
    152177 
     
    158183   std::map<int, StdSize> CAxis::getAttributesBufferSize(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid, 
    159184                                                         CServerDistributionDescription::ServerDistributionType distType) 
     185   TRY 
    160186   { 
    161187 
     
    221247       } 
    222248     } 
    223  
    224249     return attributesSizes; 
    225250   } 
     251   CATCH_DUMP_ATTR 
    226252 
    227253   //---------------------------------------------------------------- 
     
    234260 
    235261   CAxis* CAxis::createAxis() 
     262   TRY 
    236263   { 
    237264     CAxis* axis = CAxisGroup::get("axis_definition")->createChild(); 
    238265     return axis; 
    239266   } 
     267   CATCH 
    240268 
    241269   /*! 
     
    244272   */ 
    245273   void CAxis::checkAttributes(void) 
     274   TRY 
    246275   { 
    247276      if (this->n_glo.isEmpty()) 
     
    285314      } 
    286315 
    287       // Remove this check because it doen't make sense in case of a hole or overlapping axes 
     316      // Remove this check because it doesn't make sense in case of a hole or overlapping axes 
    288317      if (!this->value.isEmpty()) 
    289318      { 
     
    306335      } 
    307336   } 
     337   CATCH_DUMP_ATTR 
    308338 
    309339   /*! 
     
    311341   */ 
    312342   void CAxis::checkData() 
     343   TRY 
    313344   { 
    314345      if (data_begin.isEmpty()) data_begin.setValue(0); 
     
    331362      } 
    332363   } 
     364   CATCH_DUMP_ATTR 
    333365 
    334366    size_t CAxis::getGlobalWrittenSize(void) 
     
    341373   */ 
    342374   void CAxis::checkMask() 
     375   TRY 
    343376   { 
    344377      if (!mask.isEmpty()) 
     
    360393      } 
    361394   } 
     395   CATCH_DUMP_ATTR 
    362396 
    363397   /*! 
     
    365399   */ 
    366400   void CAxis::checkBounds() 
     401   TRY 
    367402   { 
    368403     if (!bounds.isEmpty()) 
     
    377412     else hasBounds = false; 
    378413   } 
     414   CATCH_DUMP_ATTR 
    379415 
    380416  void CAxis::checkLabel() 
     417  TRY 
    381418  { 
    382419    if (!label.isEmpty()) 
     
    391428    else hasLabel = false; 
    392429  } 
     430  CATCH_DUMP_ATTR 
    393431 
    394432  /*! 
     
    396434  */ 
    397435  void CAxis::checkEligibilityForCompressedOutput() 
     436  TRY 
    398437  { 
    399438    // We don't check if the mask is valid here, just if a mask has been defined at this point. 
    400439    isCompressible_ = !mask.isEmpty(); 
    401440  } 
     441  CATCH_DUMP_ATTR 
    402442 
    403443  /*! 
     
    405445  */ 
    406446  bool CAxis::dispatchEvent(CEventServer& event) 
     447  TRY 
    407448  { 
    408449     if (SuperClass::dispatchEvent(event)) return true; 
     
    430471     } 
    431472  } 
     473  CATCH 
    432474 
    433475   /*! 
     
    435477   */ 
    436478   void CAxis::checkAttributesOnClient() 
     479   TRY 
    437480   { 
    438481     if (this->areClientAttributesChecked_) return; 
     
    443486     this->areClientAttributesChecked_ = true; 
    444487   } 
     488   CATCH_DUMP_ATTR 
    445489 
    446490   /* 
     
    450494   void CAxis::checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid, 
    451495                                                          CServerDistributionDescription::ServerDistributionType distType) 
     496   TRY 
    452497   { 
    453498     CContext* context=CContext::getCurrent() ; 
     
    463508     this->isClientAfterTransformationChecked = true; 
    464509   } 
     510   CATCH_DUMP_ATTR 
    465511 
    466512   /* 
     
    473519   void CAxis::sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 
    474520                                     CServerDistributionDescription::ServerDistributionType distType) 
     521   TRY 
    475522   { 
    476523     if (!this->areClientAttributesChecked_) checkAttributesOnClient(); 
     
    483530     this->isChecked = true; 
    484531   } 
     532   CATCH_DUMP_ATTR 
    485533 
    486534  /*! 
     
    491539  void CAxis::sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 
    492540                             CServerDistributionDescription::ServerDistributionType distType) 
     541  TRY 
    493542  { 
    494543     sendDistributionAttribute(globalDim, orderPositionInGrid, distType); 
     
    505554     }      
    506555  } 
     556  CATCH_DUMP_ATTR 
    507557 
    508558  /* 
     
    516566  void CAxis::computeConnectedClients(const std::vector<int>& globalDim, int orderPositionInGrid, 
    517567                                     CServerDistributionDescription::ServerDistributionType distType) 
     568  TRY 
    518569  { 
    519570    CContext* context = CContext::getCurrent(); 
     
    635686    } 
    636687  } 
     688  CATCH_DUMP_ATTR 
    637689 
    638690  /* 
     
    642694  */ 
    643695  void CAxis::computeWrittenIndex() 
     696  TRY 
    644697  {   
    645698    if (computedWrittenIndex_) return; 
     
    688741    } 
    689742  } 
     743  CATCH_DUMP_ATTR 
    690744 
    691745  void CAxis::computeWrittenCompressedIndex(MPI_Comm writtenComm) 
     746  TRY 
    692747  { 
    693748    int writtenCommSize; 
     
    758813    } 
    759814  } 
     815  CATCH_DUMP_ATTR 
    760816 
    761817  /*! 
     
    768824  void CAxis::sendDistributionAttribute(const std::vector<int>& globalDim, int orderPositionInGrid, 
    769825                                        CServerDistributionDescription::ServerDistributionType distType) 
     826  TRY 
    770827  { 
    771828    std::list<CContextClient*>::iterator it; 
     
    806863    } 
    807864  } 
     865  CATCH_DUMP_ATTR 
    808866 
    809867  /* 
     
    812870  */ 
    813871  void CAxis::recvDistributionAttribute(CEventServer& event) 
     872  TRY 
    814873  { 
    815874    CBufferIn* buffer = event.subEvents.begin()->buffer; 
     
    818877    get(axisId)->recvDistributionAttribute(*buffer); 
    819878  } 
     879  CATCH 
    820880 
    821881  /* 
     
    824884  */ 
    825885  void CAxis::recvDistributionAttribute(CBufferIn& buffer) 
     886  TRY 
    826887  { 
    827888    int ni_srv, begin_srv; 
     
    833894    begin.setValue(begin_srv); 
    834895  } 
     896  CATCH_DUMP_ATTR 
    835897 
    836898  /* 
     
    840902  */ 
    841903  void CAxis::sendNonDistributedAttributes() 
     904  TRY 
    842905  { 
    843906    std::list<CContextClient*>::iterator it; 
     
    893956    } 
    894957  } 
     958  CATCH_DUMP_ATTR 
    895959 
    896960  /* 
     
    899963  */ 
    900964  void CAxis::recvNonDistributedAttributes(CEventServer& event) 
     965  TRY 
    901966  { 
    902967    list<CEventServer::SSubEvent>::iterator it; 
     
    909974    } 
    910975  } 
     976  CATCH 
    911977 
    912978  /* 
     
    916982  */ 
    917983  void CAxis::recvNonDistributedAttributes(int rank, CBufferIn& buffer) 
     984  TRY 
    918985  {  
    919986    CArray<int,1> tmp_index, tmp_data_index; 
     
    9571024    for (int idx = 0; idx < index.numElements(); ++idx) globalLocalIndexMap_[index(idx)] = idx; 
    9581025  } 
     1026  CATCH_DUMP_ATTR 
    9591027 
    9601028  /* 
     
    9641032  */ 
    9651033  void CAxis::sendDistributedAttributes(void) 
     1034  TRY 
    9661035  { 
    9671036    int ns, n, i, j, ind, nv, idx; 
     
    10691138    } 
    10701139  } 
     1140  CATCH_DUMP_ATTR 
    10711141 
    10721142  /* 
     
    10751145  */ 
    10761146  void CAxis::recvDistributedAttributes(CEventServer& event) 
     1147  TRY 
    10771148  { 
    10781149    string axisId; 
     
    10901161    get(axisId)->recvDistributedAttributes(ranks, buffers); 
    10911162  } 
     1163  CATCH 
    10921164 
    10931165  /* 
     
    10971169  */ 
    10981170  void CAxis::recvDistributedAttributes(vector<int>& ranks, vector<CBufferIn*> buffers) 
     1171  TRY 
    10991172  { 
    11001173    int nbReceived = ranks.size(), idx, ind, gloInd, locInd; 
     
    12191292    data_begin.setValue(0); 
    12201293  } 
    1221  
     1294  CATCH_DUMP_ATTR 
    12221295 
    12231296  /*! 
     
    12291302  */ 
    12301303  bool CAxis::isEqual(CAxis* obj) 
     1304  TRY 
    12311305  { 
    12321306    vector<StdString> excludedAttr; 
     
    12521326    return objEqual; 
    12531327  } 
     1328  CATCH_DUMP_ATTR 
    12541329 
    12551330  /* 
     
    12591334  */ 
    12601335  CTransformation<CAxis>* CAxis::addTransformation(ETranformationType transType, const StdString& id) 
     1336  TRY 
    12611337  { 
    12621338    transformationMap_.push_back(std::make_pair(transType, CTransformation<CAxis>::createTransformation(transType,id))); 
    12631339    return transformationMap_.back().second; 
    12641340  } 
     1341  CATCH_DUMP_ATTR 
    12651342 
    12661343  /* 
     
    12681345  */ 
    12691346  bool CAxis::hasTransformation() 
     1347  TRY 
    12701348  { 
    12711349    return (!transformationMap_.empty()); 
    12721350  } 
     1351  CATCH_DUMP_ATTR 
    12731352 
    12741353  /* 
     
    12771356  */ 
    12781357  void CAxis::setTransformations(const TransMapTypes& axisTrans) 
     1358  TRY 
    12791359  { 
    12801360    transformationMap_ = axisTrans; 
    12811361  } 
     1362  CATCH_DUMP_ATTR 
    12821363 
    12831364  /* 
     
    12861367  */ 
    12871368  CAxis::TransMapTypes CAxis::getAllTransformations(void) 
     1369  TRY 
    12881370  { 
    12891371    return transformationMap_; 
    12901372  } 
     1373  CATCH_DUMP_ATTR 
    12911374 
    12921375  /* 
     
    12951378  */ 
    12961379  void CAxis::duplicateTransformation(CAxis* src) 
     1380  TRY 
    12971381  { 
    12981382    if (src->hasTransformation()) 
     
    13011385    } 
    13021386  } 
     1387  CATCH_DUMP_ATTR 
    13031388 
    13041389  /*! 
     
    13061391   */ 
    13071392  void CAxis::solveInheritanceTransformation() 
     1393  TRY 
    13081394  { 
    13091395    if (hasTransformation() || !hasDirectAxisReference()) 
     
    13221408        refAxis[i]->setTransformations(axis->getAllTransformations()); 
    13231409  } 
     1410  CATCH_DUMP_ATTR 
    13241411 
    13251412  void CAxis::setContextClient(CContextClient* contextClient) 
     1413  TRY 
    13261414  { 
    13271415    if (clientsSet.find(contextClient)==clientsSet.end()) 
     
    13301418      clientsSet.insert(contextClient); 
    13311419    } 
    1332 } 
     1420  } 
     1421  CATCH_DUMP_ATTR 
    13331422 
    13341423  void CAxis::parse(xml::CXMLNode & node) 
     1424  TRY 
    13351425  { 
    13361426    SuperClass::parse(node); 
     
    13631453    } 
    13641454  } 
     1455  CATCH_DUMP_ATTR 
    13651456 
    13661457  DEFINE_REF_FUNC(Axis,axis) 
  • XIOS/trunk/src/node/context.cpp

    r1542 r1622  
    3333      , idServer_(), client(0), server(0) 
    3434      , allProcessed(false), countChildCtx_(0) 
     35 
    3536   { /* Ne rien faire de plus */ } 
    3637 
     
    6566   */ 
    6667   CContextGroup* CContext::getRoot(void) 
     68   TRY 
    6769   { 
    6870      if (root.get()==NULL) root=std::shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 
    6971      return root.get(); 
    7072   } 
     73   CATCH 
    7174 
    7275   //---------------------------------------------------------------- 
     
    7780   */ 
    7881   std::shared_ptr<CCalendar> CContext::getCalendar(void) const 
     82   TRY 
    7983   { 
    8084      return (this->calendar); 
    8185   } 
     86   CATCH 
    8287 
    8388   //---------------------------------------------------------------- 
     
    8893   */ 
    8994   void CContext::setCalendar(std::shared_ptr<CCalendar> newCalendar) 
     95   TRY 
    9096   { 
    9197      this->calendar = newCalendar; 
    9298   } 
     99   CATCH_DUMP_ATTR 
    93100 
    94101   //---------------------------------------------------------------- 
     
    98105   */ 
    99106   void CContext::parse(xml::CXMLNode & node) 
     107   TRY 
    100108   { 
    101109      CContext::SuperClass::parse(node); 
     
    152160      } 
    153161   } 
     162   CATCH_DUMP_ATTR 
    154163 
    155164   //---------------------------------------------------------------- 
    156165   //! Show tree structure of context 
    157166   void CContext::ShowTree(StdOStream & out) 
     167   TRY 
    158168   { 
    159169      StdString currentContextId = CContext::getCurrent() -> getId(); 
     
    176186      CContext::setCurrent(currentContextId); 
    177187   } 
    178  
     188   CATCH 
    179189 
    180190   //---------------------------------------------------------------- 
     
    182192   //! Convert context object into string (to print) 
    183193   StdString CContext::toString(void) const 
     194   TRY 
    184195   { 
    185196      StdOStringStream oss; 
     
    201212 
    202213      } 
    203  
    204214      oss << "</" << CContext::GetName() << " >"; 
    205  
    206215      return (oss.str()); 
    207216   } 
     217   CATCH 
    208218 
    209219   //---------------------------------------------------------------- 
     
    216226   */ 
    217227   void CContext::solveDescInheritance(bool apply, const CAttributeMap * const UNUSED(parent)) 
     228   TRY 
    218229   { 
    219230#define DECLARE_NODE(Name_, name_)    \ 
     
    223234#include "node_type.conf" 
    224235   } 
     236   CATCH_DUMP_ATTR 
    225237 
    226238   //---------------------------------------------------------------- 
     
    228240   //! Verify if all root definition in the context have child. 
    229241   bool CContext::hasChild(void) const 
     242   TRY 
    230243   { 
    231244      return ( 
     
    236249      false); 
    237250} 
     251   CATCH 
    238252 
    239253   //---------------------------------------------------------------- 
    240254 
    241255   void CContext::CleanTree(void) 
     256   TRY 
    242257   { 
    243258#define DECLARE_NODE(Name_, name_) C##Name_##Definition::ClearAllAttributes(); 
     
    245260#include "node_type.conf" 
    246261   } 
     262   CATCH 
     263 
    247264   ///--------------------------------------------------------------- 
    248265 
    249266   //! Initialize client side 
    250267   void CContext::initClient(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtServer /*= 0*/) 
     268   TRY 
    251269   { 
    252270 
     
    298316     } 
    299317   } 
     318   CATCH_DUMP_ATTR 
    300319 
    301320   /*! 
     
    306325  */ 
    307326   void CContext::setClientServerBuffer(CContextClient* contextClient, bool bufferForWriting) 
     327   TRY 
    308328   { 
    309329      // Estimated minimum event size for small events (10 is an arbitrary constant just for safety) 
     
    352372     } 
    353373     contextClient->setBufferSize(bufferSize, maxEventSize); 
    354  
    355    } 
     374   } 
     375   CATCH_DUMP_ATTR 
    356376 
    357377   //! Verify whether a context is initialized 
    358378   bool CContext::isInitialized(void) 
     379   TRY 
    359380   { 
    360381     return hasClient; 
    361382   } 
     383   CATCH_DUMP_ATTR 
    362384 
    363385   void CContext::initServer(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtClient /*= 0*/) 
     386   TRY 
    364387   { 
    365388     hasServer=true; 
     
    394417     client = new CContextClient(this,intraCommClient,interCommClient, cxtClient); 
    395418   } 
     419   CATCH_DUMP_ATTR 
    396420 
    397421   //! Try to send the buffers and receive possible answers 
    398422  bool CContext::checkBuffersAndListen(bool enableEventsProcessing /*= true*/) 
     423  TRY 
    399424  { 
    400425    bool clientReady, serverFinished; 
     
    434459    } 
    435460  } 
     461   CATCH_DUMP_ATTR 
    436462 
    437463   //! Terminate a context 
    438464   void CContext::finalize(void) 
     465   TRY 
    439466   { 
    440467      if (hasClient && !hasServer) // For now we only use server level 1 to read data 
     
    527554     } 
    528555   } 
     556   CATCH_DUMP_ATTR 
    529557 
    530558   //! Free internally allocated communicators 
    531559   void CContext::freeComms(void) 
     560   TRY 
    532561   { 
    533562     for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) 
     
    535564     comms.clear(); 
    536565   } 
     566   CATCH_DUMP_ATTR 
    537567 
    538568   //! Deallocate buffers allocated by clientContexts 
    539569   void CContext::releaseClientBuffers(void) 
     570   TRY 
    540571   { 
    541572     client->releaseBuffers(); 
     
    543574       clientPrimServer[i]->releaseBuffers(); 
    544575   } 
     576   CATCH_DUMP_ATTR 
    545577 
    546578   void CContext::postProcessingGlobalAttributes() 
     579   TRY 
    547580   { 
    548581     if (allProcessed) return;   
     
    608641     allProcessed = true; 
    609642   } 
     643   CATCH_DUMP_ATTR 
    610644 
    611645   void CContext::sendPostProcessingGlobalAttributes() 
     646   TRY 
    612647   { 
    613648      // Use correct context client to send message 
     
    634669     } 
    635670   } 
     671   CATCH_DUMP_ATTR 
    636672 
    637673   void CContext::recvPostProcessingGlobalAttributes(CEventServer& event) 
     674   TRY 
    638675   { 
    639676      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    642679      get(id)->recvPostProcessingGlobalAttributes(*buffer); 
    643680   } 
     681   CATCH 
    644682 
    645683   void CContext::recvPostProcessingGlobalAttributes(CBufferIn& buffer) 
     684   TRY 
    646685   {       
    647686      postProcessingGlobalAttributes(); 
    648687   } 
     688   CATCH_DUMP_ATTR 
    649689 
    650690   /*! 
     
    657697   and the active fields (fields will be written onto active files) 
    658698   */ 
     699 
    659700   void CContext::closeDefinition(void) 
     701   TRY 
    660702   { 
    661703    CTimer::get("Context : close definition").resume() ; 
     
    688730    CTimer::get("Context : close definition").suspend() ; 
    689731   } 
     732   CATCH_DUMP_ATTR 
    690733 
    691734   void CContext::findAllEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     735   TRY 
    692736   { 
    693737     for (unsigned int i = 0; i < activeFiles.size(); i++) 
    694738     (void)activeFiles[i]->getEnabledFields(); 
    695739   } 
     740   CATCH_DUMP_ATTR 
    696741 
    697742   void CContext::readAttributesOfEnabledFieldsInReadModeFiles() 
     743   TRY 
    698744   { 
    699745      for (unsigned int i = 0; i < this->enabledReadModeFiles.size(); ++i) 
    700746        (void)this->enabledReadModeFiles[i]->readAttributesOfEnabledFieldsInReadMode(); 
    701747   } 
     748   CATCH_DUMP_ATTR 
    702749 
    703750   void CContext::sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     751   TRY 
    704752   { 
    705753     int size = activeFiles.size(); 
     
    709757     } 
    710758   } 
     759   CATCH_DUMP_ATTR 
    711760 
    712761   /*! 
     
    715764   */ 
    716765   void CContext::sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     766   TRY 
    717767   { 
    718768     int size = activeFiles.size(); 
     
    722772     } 
    723773   } 
     774   CATCH_DUMP_ATTR 
    724775 
    725776   void CContext::checkGridEnabledFields() 
     777   TRY 
    726778   { 
    727779     int size = enabledFiles.size(); 
     
    731783     } 
    732784   } 
     785   CATCH_DUMP_ATTR 
    733786 
    734787   /*! 
     
    737790   */ 
    738791   void CContext::checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     792   TRY 
    739793   { 
    740794     int size = activeFiles.size(); 
     
    744798     } 
    745799   } 
     800   CATCH_DUMP_ATTR 
    746801 
    747802    /*! 
     
    751806   */ 
    752807   void CContext::solveOnlyRefOfEnabledFields(bool sendToServer) 
     808   TRY 
    753809   { 
    754810     int size = this->enabledFiles.size(); 
     
    763819     } 
    764820   } 
     821   CATCH_DUMP_ATTR 
    765822 
    766823    /*! 
     
    771828   */ 
    772829   void CContext::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer) 
     830   TRY 
    773831   { 
    774832     int size = this->enabledFiles.size(); 
     
    778836     } 
    779837   } 
     838   CATCH_DUMP_ATTR 
    780839 
    781840   void CContext::buildFilterGraphOfEnabledFields() 
     841   TRY 
    782842   { 
    783843     int size = this->enabledFiles.size(); 
     
    787847     } 
    788848   } 
     849   CATCH_DUMP_ATTR 
    789850 
    790851   void CContext::postProcessFilterGraph() 
     852   TRY 
    791853   { 
    792854     int size = enabledFiles.size(); 
     
    796858     } 
    797859   } 
     860   CATCH_DUMP_ATTR 
    798861 
    799862   void CContext::startPrefetchingOfEnabledReadModeFiles() 
     863   TRY 
    800864   { 
    801865     int size = enabledReadModeFiles.size(); 
     
    805869     } 
    806870   } 
     871   CATCH_DUMP_ATTR 
    807872 
    808873   void CContext::doPreTimestepOperationsForEnabledReadModeFiles() 
     874   TRY 
    809875   { 
    810876     int size = enabledReadModeFiles.size(); 
     
    814880     } 
    815881   } 
     882   CATCH_DUMP_ATTR 
    816883 
    817884   void CContext::doPostTimestepOperationsForEnabledReadModeFiles() 
     885   TRY 
    818886   { 
    819887     int size = enabledReadModeFiles.size(); 
     
    823891     } 
    824892   } 
     893   CATCH_DUMP_ATTR 
    825894 
    826895  void CContext::findFieldsWithReadAccess(void) 
     896  TRY 
    827897  { 
    828898    fieldsWithReadAccess.clear(); 
     
    838908    } 
    839909  } 
     910  CATCH_DUMP_ATTR 
    840911 
    841912  void CContext::solveAllRefOfFieldsWithReadAccess() 
     913  TRY 
    842914  { 
    843915    for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i) 
    844916      fieldsWithReadAccess[i]->solveAllReferenceEnabledField(false); 
    845917  } 
     918  CATCH_DUMP_ATTR 
    846919 
    847920  void CContext::buildFilterGraphOfFieldsWithReadAccess() 
     921  TRY 
    848922  { 
    849923    for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i) 
    850924      fieldsWithReadAccess[i]->buildFilterGraph(garbageCollector, true); 
    851925  } 
     926  CATCH_DUMP_ATTR 
    852927 
    853928   void CContext::solveAllInheritance(bool apply) 
     929   TRY 
    854930   { 
    855931     // Résolution des héritages descendants (càd des héritages de groupes) 
     
    874950 
    875951   } 
     952  CATCH_DUMP_ATTR 
    876953 
    877954   void CContext::findEnabledFiles(void) 
     955   TRY 
    878956   { 
    879957      const std::vector<CFile*> allFiles = CFile::getAll(); 
     
    9241002 
    9251003   } 
     1004   CATCH_DUMP_ATTR 
    9261005 
    9271006   void CContext::distributeFiles(void) 
     1007   TRY 
    9281008   { 
    9291009     bool distFileMemory=false ; 
     
    9331013     else distributeFileOverBandwith() ; 
    9341014   } 
    935  
     1015   CATCH_DUMP_ATTR 
    9361016 
    9371017   void CContext::distributeFileOverBandwith(void) 
     1018   TRY 
    9381019   { 
    9391020     double eps=std::numeric_limits<double>::epsilon()*10 ; 
     
    10151096     } 
    10161097   } 
     1098   CATCH_DUMP_ATTR 
    10171099 
    10181100   void CContext::distributeFileOverMemoryBandwith(void) 
     1101   TRY 
    10191102   { 
    10201103     // If primary server 
     
    11071190   } 
    11081191} 
    1109  
    1110  
     1192   CATCH_DUMP_ATTR 
    11111193 
    11121194   /*! 
     
    11141196   */ 
    11151197   void CContext::findEnabledWriteModeFiles(void) 
     1198   TRY 
    11161199   { 
    11171200     int size = this->enabledFiles.size(); 
     
    11231206     } 
    11241207   } 
     1208   CATCH_DUMP_ATTR 
    11251209 
    11261210   /*! 
     
    11281212   */ 
    11291213   void CContext::findEnabledReadModeFiles(void) 
     1214   TRY 
    11301215   { 
    11311216     int size = this->enabledFiles.size(); 
     
    11361221     } 
    11371222   } 
     1223   CATCH_DUMP_ATTR 
    11381224 
    11391225   void CContext::closeAllFile(void) 
     1226   TRY 
    11401227   { 
    11411228     std::vector<CFile*>::const_iterator 
     
    11481235     } 
    11491236   } 
     1237   CATCH_DUMP_ATTR 
    11501238 
    11511239   /*! 
     
    11571245   */ 
    11581246   bool CContext::dispatchEvent(CEventServer& event) 
     1247   TRY 
    11591248   { 
    11601249 
     
    11981287      } 
    11991288   } 
     1289   CATCH 
    12001290 
    12011291   //! Client side: Send a message to server to make it close 
    12021292   void CContext::sendCloseDefinition(void) 
     1293   TRY 
    12031294   { 
    12041295     // Use correct context client to send message 
     
    12231314     } 
    12241315   } 
     1316   CATCH_DUMP_ATTR 
    12251317 
    12261318   //! Server side: Receive a message of client announcing a context close 
    12271319   void CContext::recvCloseDefinition(CEventServer& event) 
     1320   TRY 
    12281321   { 
    12291322      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    12321325      get(id)->closeDefinition(); 
    12331326   } 
     1327   CATCH 
    12341328 
    12351329   //! Client side: Send a message to update calendar in each time step 
    12361330   void CContext::sendUpdateCalendar(int step) 
     1331   TRY 
    12371332   { 
    12381333     // Use correct context client to send message 
     
    12581353     } 
    12591354   } 
     1355   CATCH_DUMP_ATTR 
    12601356 
    12611357   //! Server side: Receive a message of client annoucing calendar update 
    12621358   void CContext::recvUpdateCalendar(CEventServer& event) 
     1359   TRY 
    12631360   { 
    12641361      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    12671364      get(id)->recvUpdateCalendar(*buffer); 
    12681365   } 
     1366   CATCH 
    12691367 
    12701368   //! Server side: Receive a message of client annoucing calendar update 
    12711369   void CContext::recvUpdateCalendar(CBufferIn& buffer) 
     1370   TRY 
    12721371   { 
    12731372      int step; 
     
    12791378      } 
    12801379   } 
     1380   CATCH_DUMP_ATTR 
    12811381 
    12821382   //! Client side: Send a message to create header part of netcdf file 
    12831383   void CContext::sendCreateFileHeader(void) 
     1384   TRY 
    12841385   { 
    12851386     // Use correct context client to send message 
     
    13061407     } 
    13071408   } 
     1409   CATCH_DUMP_ATTR 
    13081410 
    13091411   //! Server side: Receive a message of client annoucing the creation of header part of netcdf file 
    13101412   void CContext::recvCreateFileHeader(CEventServer& event) 
     1413   TRY 
    13111414   { 
    13121415      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    13151418      get(id)->recvCreateFileHeader(*buffer); 
    13161419   } 
     1420   CATCH 
    13171421 
    13181422   //! Server side: Receive a message of client annoucing the creation of header part of netcdf file 
    13191423   void CContext::recvCreateFileHeader(CBufferIn& buffer) 
     1424   TRY 
    13201425   { 
    13211426      if (!hasClient && hasServer)  
    13221427        createFileHeader(); 
    13231428   } 
     1429   CATCH_DUMP_ATTR 
    13241430 
    13251431   //! Client side: Send a message to do some post processing on server 
    13261432   void CContext::sendProcessingGridOfEnabledFields() 
     1433   TRY 
    13271434   { 
    13281435      // Use correct context client to send message 
     
    13481455     } 
    13491456   } 
     1457   CATCH_DUMP_ATTR 
    13501458 
    13511459   //! Server side: Receive a message to do some post processing 
    13521460   void CContext::recvProcessingGridOfEnabledFields(CEventServer& event) 
     1461   TRY 
    13531462   { 
    13541463      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    13561465      *buffer>>id;       
    13571466   } 
     1467   CATCH 
    13581468 
    13591469   //! Client side: Send a message to do some post processing on server 
    13601470   void CContext::sendPostProcessing() 
     1471   TRY 
    13611472   { 
    13621473      // Use correct context client to send message 
     
    13821493     } 
    13831494   } 
     1495   CATCH_DUMP_ATTR 
    13841496 
    13851497   //! Server side: Receive a message to do some post processing 
    13861498   void CContext::recvPostProcessing(CEventServer& event) 
     1499   TRY 
    13871500   { 
    13881501      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    13911504      get(id)->recvPostProcessing(*buffer); 
    13921505   } 
     1506   CATCH 
    13931507 
    13941508   //! Server side: Receive a message to do some post processing 
    13951509   void CContext::recvPostProcessing(CBufferIn& buffer) 
     1510   TRY 
    13961511   { 
    13971512      CCalendarWrapper::get(CCalendarWrapper::GetDefName())->createCalendar(); 
    13981513      postProcessing(); 
    13991514   } 
     1515   CATCH_DUMP_ATTR 
    14001516 
    14011517   const StdString& CContext::getIdServer() 
     1518   TRY 
    14021519   { 
    14031520      if (hasClient) 
     
    14091526      if (hasServer) return (this->getId()); 
    14101527   } 
     1528   CATCH_DUMP_ATTR 
    14111529 
    14121530   const StdString& CContext::getIdServer(const int i) 
     1531   TRY 
    14131532   { 
    14141533     idServer_ = this->getId(); 
     
    14171536     return idServer_; 
    14181537   } 
    1419  
     1538   CATCH_DUMP_ATTR 
    14201539 
    14211540   /*! 
     
    14261545   */ 
    14271546   void CContext::postProcessing() 
     1547   TRY 
    14281548   { 
    14291549     if (isPostProcessed) return; 
     
    14881608      isPostProcessed = true; 
    14891609   } 
     1610   CATCH_DUMP_ATTR 
    14901611 
    14911612   /*! 
     
    14981619   std::map<int, StdSize> CContext::getAttributesBufferSize(std::map<int, StdSize>& maxEventSize, 
    14991620                                                           CContextClient* contextClient, bool bufferForWriting /*= "false"*/) 
     1621   TRY 
    15001622   { 
    15011623         // As calendar attributes are sent even if there are no active files or fields, maps are initialized according the size of calendar attributes 
     
    15291651     return attributesSize; 
    15301652   } 
     1653   CATCH_DUMP_ATTR 
    15311654 
    15321655   /*! 
     
    15391662   std::map<int, StdSize> CContext::getDataBufferSize(std::map<int, StdSize>& maxEventSize, 
    15401663                                                      CContextClient* contextClient, bool bufferForWriting /*= "false"*/) 
     1664   TRY 
    15411665   { 
    15421666     std::map<int, StdSize> dataSize; 
     
    15471671     for (size_t i = 0; i < numEnabledFiles; ++i) 
    15481672     { 
    1549 //       CFile* file = this->enabledFiles[i]; 
    15501673       CFile* file = fileList[i]; 
    15511674       if (file->getContextClient() == contextClient) 
     
    15751698     return dataSize; 
    15761699   } 
     1700   CATCH_DUMP_ATTR 
    15771701 
    15781702   //! Client side: Send infomation of active files (files are enabled to write out) 
    15791703   void CContext::sendEnabledFiles(const std::vector<CFile*>& activeFiles) 
     1704   TRY 
    15801705   { 
    15811706     int size = activeFiles.size(); 
     
    15951720     } 
    15961721   } 
     1722   CATCH_DUMP_ATTR 
    15971723 
    15981724   //! Client side: Send information of active fields (ones are written onto files) 
    15991725   void CContext::sendEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     1726   TRY 
    16001727   { 
    16011728     int size = activeFiles.size(); 
     
    16051732     } 
    16061733   } 
     1734   CATCH_DUMP_ATTR 
    16071735 
    16081736   //! Client side: Check if the defined axis, domains and grids are eligible for compressed indexed output 
    16091737   void CContext::checkAxisDomainsGridsEligibilityForCompressedOutput() 
     1738   TRY 
    16101739   { 
    16111740     if (!hasClient) return; 
     
    16231752       (*it)->checkEligibilityForCompressedOutput(); 
    16241753   } 
     1754   CATCH_DUMP_ATTR 
    16251755 
    16261756   //! Client side: Prepare the timeseries by adding the necessary files 
    16271757   void CContext::prepareTimeseries() 
     1758   TRY 
    16281759   { 
    16291760     if (!hasClient) return; 
     
    17231854     } 
    17241855   } 
     1856   CATCH_DUMP_ATTR 
    17251857 
    17261858   //! Client side: Send information of reference grid of active fields 
    17271859   void CContext::sendRefGrid(const std::vector<CFile*>& activeFiles) 
     1860   TRY 
    17281861   { 
    17291862     std::set<StdString> gridIds; 
     
    17571890     } 
    17581891   } 
     1892   CATCH_DUMP_ATTR 
    17591893 
    17601894   //! Client side: Send information of reference domain, axis and scalar of active fields 
    17611895   void CContext::sendRefDomainsAxisScalars(const std::vector<CFile*>& activeFiles) 
     1896   TRY 
    17621897   { 
    17631898     std::set<StdString> domainIds, axisIds, scalarIds; 
     
    18181953     } 
    18191954   } 
     1955   CATCH_DUMP_ATTR 
    18201956 
    18211957   //! Update calendar in each time step 
    18221958   void CContext::updateCalendar(int step) 
     1959   TRY 
    18231960   { 
    18241961      int prevStep = calendar->getStep(); 
     
    18501987              << "Illegal calendar update: previous step was " << prevStep << ", new step " << step << "is in the past!") 
    18511988   } 
     1989   CATCH_DUMP_ATTR 
    18521990 
    18531991   void CContext::initReadFiles(void) 
     1992   TRY 
    18541993   { 
    18551994      vector<CFile*>::const_iterator it; 
     
    18601999      } 
    18612000   } 
     2001   CATCH_DUMP_ATTR 
    18622002 
    18632003   //! Server side: Create header of netcdf file 
    18642004   void CContext::createFileHeader(void) 
     2005   TRY 
    18652006   { 
    18662007      vector<CFile*>::const_iterator it; 
     
    18722013      } 
    18732014   } 
     2015   CATCH_DUMP_ATTR 
    18742016 
    18752017   //! Get current context 
    18762018   CContext* CContext::getCurrent(void) 
     2019   TRY 
    18772020   { 
    18782021     return CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()).get(); 
    18792022   } 
     2023   CATCH 
    18802024 
    18812025   /*! 
     
    18842028   */ 
    18852029   void CContext::setCurrent(const string& id) 
     2030   TRY 
    18862031   { 
    18872032     CObjectFactory::SetCurrentContextId(id); 
    18882033     CGroupFactory::SetCurrentContextId(id); 
    18892034   } 
     2035   CATCH 
    18902036 
    18912037  /*! 
     
    18952041  */ 
    18962042  CContext* CContext::create(const StdString& id) 
     2043  TRY 
    18972044  { 
    18982045    CContext::setCurrent(id); 
     
    19102057    return (context); 
    19112058  } 
    1912  
     2059  CATCH 
    19132060 
    19142061     //! Server side: Receive a message to do some post processing 
    19152062  void CContext::recvRegistry(CEventServer& event) 
     2063  TRY 
    19162064  { 
    19172065    CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    19202068    get(id)->recvRegistry(*buffer); 
    19212069  } 
     2070  CATCH 
    19222071 
    19232072  void CContext::recvRegistry(CBufferIn& buffer) 
     2073  TRY 
    19242074  { 
    19252075    if (server->intraCommRank==0) 
     
    19302080    } 
    19312081  } 
     2082  CATCH_DUMP_ATTR 
    19322083 
    19332084  void CContext::sendRegistry(void) 
     2085  TRY 
    19342086  { 
    19352087    registryOut->hierarchicalGatherRegistry() ; 
     
    19572109    } 
    19582110  } 
     2111  CATCH_DUMP_ATTR 
    19592112 
    19602113  /*! 
     
    19632116  */ 
    19642117  bool CContext::isFinalized(void) 
     2118  TRY 
    19652119  { 
    19662120    return finalized; 
    19672121  } 
     2122  CATCH_DUMP_ATTR 
     2123  ///-------------------------------------------------------------- 
     2124  StdString CContext::dumpClassAttributes(void) 
     2125  { 
     2126    StdString str; 
     2127    str.append("enabled files=\""); 
     2128    int size = this->enabledFiles.size(); 
     2129    for (int i = 0; i < size; ++i) 
     2130    { 
     2131      str.append(enabledFiles[i]->getId()); 
     2132      str.append(" "); 
     2133    } 
     2134    str.append("\""); 
     2135    return str; 
     2136  } 
    19682137 
    19692138} // namespace xios 
  • XIOS/trunk/src/node/context.hpp

    r1542 r1622  
    9191         void initServer(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtClient = 0); 
    9292         bool isInitialized(void); 
     93 
     94         StdString dumpClassAttributes(void); 
    9395 
    9496         // Put sever or client into loop state 
     
    143145         void distributeFileOverMemoryBandwith() ; 
    144146          
    145  
    146147         // Send context close definition 
    147148         void sendCloseDefinition(void); 
  • XIOS/trunk/src/node/domain.cpp

    r1578 r1622  
    5858 
    5959   void CDomain::assignMesh(const StdString meshName, const int nvertex) 
     60   TRY 
    6061   { 
    6162     mesh = CMesh::getMesh(meshName, nvertex); 
    6263   } 
     64   CATCH_DUMP_ATTR 
    6365 
    6466   CDomain* CDomain::createDomain() 
     67   TRY 
    6568   { 
    6669     CDomain* domain = CDomainGroup::get("domain_definition")->createChild(); 
    6770     return domain; 
    6871   } 
     72   CATCH 
    6973 
    7074   std::map<StdString, ETranformationType> CDomain::transformationMapList_ = std::map<StdString, ETranformationType>(); 
     
    7276 
    7377   bool CDomain::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 
     78   TRY 
    7479   { 
    7580     m["zoom_domain"] = TRANS_ZOOM_DOMAIN; 
     
    8186     m["extract_domain"] = TRANS_EXTRACT_DOMAIN; 
    8287   } 
     88   CATCH 
    8389 
    8490   const std::set<StdString> & CDomain::getRelFiles(void) const 
     91   TRY 
    8592   { 
    8693      return (this->relFiles); 
    8794   } 
    88  
     95   CATCH 
    8996 
    9097   /*! 
     
    93100   */ 
    94101   int CDomain::getNumberWrittenIndexes(MPI_Comm writtenCom) 
     102   TRY 
    95103   { 
    96104     int writtenSize; 
     
    98106     return numberWrittenIndexes_[writtenSize]; 
    99107   } 
     108   CATCH_DUMP_ATTR 
    100109 
    101110   /*! 
     
    104113   */ 
    105114   int CDomain::getTotalNumberWrittenIndexes(MPI_Comm writtenCom) 
     115   TRY 
    106116   { 
    107117     int writtenSize; 
     
    109119     return totalNumberWrittenIndexes_[writtenSize]; 
    110120   } 
     121   CATCH_DUMP_ATTR 
    111122 
    112123   /*! 
     
    115126   */ 
    116127   int CDomain::getOffsetWrittenIndexes(MPI_Comm writtenCom) 
     128   TRY 
    117129   { 
    118130     int writtenSize; 
     
    120132     return offsetWrittenIndexes_[writtenSize]; 
    121133   } 
     134   CATCH_DUMP_ATTR 
    122135 
    123136   CArray<int, 1>& CDomain::getCompressedIndexToWriteOnServer(MPI_Comm writtenCom) 
     137   TRY 
    124138   { 
    125139     int writtenSize; 
     
    127141     return compressedIndexToWriteOnServer[writtenSize]; 
    128142   } 
     143   CATCH_DUMP_ATTR 
    129144 
    130145   //---------------------------------------------------------------- 
     
    136151    */ 
    137152   std::map<int, StdSize> CDomain::getAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= false*/) 
     153   TRY 
    138154   { 
    139155 
     
    182198     return attributesSizes; 
    183199   } 
     200   CATCH_DUMP_ATTR 
    184201 
    185202   //---------------------------------------------------------------- 
    186203 
    187204   bool CDomain::isEmpty(void) const 
     205   TRY 
    188206   { 
    189207     return ((this->i_index.isEmpty()) || (0 == this->i_index.numElements())); 
    190208   } 
     209   CATCH 
    191210 
    192211   //---------------------------------------------------------------- 
    193212 
    194213   bool CDomain::IsWritten(const StdString & filename) const 
     214   TRY 
    195215   { 
    196216      return (this->relFiles.find(filename) != this->relFiles.end()); 
    197217   } 
     218   CATCH 
    198219 
    199220   bool CDomain::isWrittenCompressed(const StdString& filename) const 
     221   TRY 
    200222   { 
    201223      return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 
    202224   } 
     225   CATCH 
    203226 
    204227   //---------------------------------------------------------------- 
    205228 
    206229   bool CDomain::isDistributed(void) const 
     230   TRY 
    207231   { 
    208232      bool distributed =  !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) || 
     
    212236      return distributed; 
    213237   } 
     238   CATCH 
    214239 
    215240   //---------------------------------------------------------------- 
     
    221246    */ 
    222247   bool CDomain::isCompressible(void) const 
     248   TRY 
    223249   { 
    224250      return isCompressible_; 
    225251   } 
     252   CATCH 
    226253 
    227254   void CDomain::addRelFile(const StdString & filename) 
     255   TRY 
    228256   { 
    229257      this->relFiles.insert(filename); 
    230258   } 
     259   CATCH_DUMP_ATTR 
    231260 
    232261   void CDomain::addRelFileCompressed(const StdString& filename) 
     262   TRY 
    233263   { 
    234264      this->relFilesCompressed.insert(filename); 
    235265   } 
     266   CATCH_DUMP_ATTR 
    236267 
    237268   StdString CDomain::GetName(void)   { return (StdString("domain")); } 
     
    246277   */ 
    247278   bool CDomain::distributionAttributesHaveValue() const 
     279   TRY 
    248280   { 
    249281      bool hasValues = true; 
     
    257289      return hasValues; 
    258290   } 
     291   CATCH 
    259292 
    260293   /*! 
     
    266299   */ 
    267300   void CDomain::redistribute(int nbLocalDomain) 
     301   TRY 
    268302   { 
    269303     if (this->isRedistributed_) return; 
     
    428462     checkDomain(); 
    429463   } 
     464   CATCH_DUMP_ATTR 
    430465 
    431466   /*! 
     
    433468   */ 
    434469   void CDomain::fillInLonLat() 
     470   TRY 
    435471   { 
    436472     switch (type) 
     
    450486     } 
    451487     completeLonLatClient() ; 
    452  
    453    } 
     488   } 
     489   CATCH_DUMP_ATTR 
    454490 
    455491   /*! 
     
    459495   */ 
    460496   void CDomain::fillInRectilinearLonLat() 
     497   TRY 
    461498   { 
    462499     if (!lonvalue_rectilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) 
     
    527564     } 
    528565   } 
     566   CATCH_DUMP_ATTR 
    529567 
    530568    /* 
     
    533571    */ 
    534572   void CDomain::fillInCurvilinearLonLat() 
     573   TRY 
    535574   { 
    536575     if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) 
     
    575614       bounds_latvalue_curvilinear_read_from_file.free(); 
    576615     } 
    577  
    578    } 
     616   } 
     617   CATCH_DUMP_ATTR 
    579618 
    580619    /* 
     
    583622    */ 
    584623   void CDomain::fillInUnstructuredLonLat() 
     624   TRY 
    585625   { 
    586626     if (i_index.isEmpty()) 
     
    634674     } 
    635675   } 
     676   CATCH_DUMP_ATTR 
    636677 
    637678  /* 
     
    639680  */ 
    640681   void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g) 
     682   TRY 
    641683   { 
    642684     CContext* context = CContext::getCurrent(); 
     
    670712      delete[] nj_g ; 
    671713   } 
     714   CATCH_DUMP_ATTR 
    672715 
    673716   void CDomain::fillInRectilinearBoundLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 
    674717                                              CArray<double,2>& boundsLon, CArray<double,2>& boundsLat) 
    675    { 
     718   TRY 
     719  { 
    676720     int i,j,k; 
    677721 
     
    772816      } 
    773817   } 
     818   CATCH_DUMP_ATTR 
    774819 
    775820   /* 
     
    777822   */ 
    778823   void CDomain::checkDomain(void) 
     824   TRY 
    779825   { 
    780826     if (type.isEmpty()) 
     
    868914     } 
    869915   } 
     916   CATCH_DUMP_ATTR 
    870917 
    871918   size_t CDomain::getGlobalWrittenSize(void) 
     
    877924   // Check validity of local domain on using the combination of 3 parameters: ibegin, ni and i_index 
    878925   void CDomain::checkLocalIDomain(void) 
     926   TRY 
    879927   { 
    880928      // If ibegin and ni are provided then we use them to check the validity of local domain 
     
    935983      } 
    936984   } 
     985   CATCH_DUMP_ATTR 
    937986 
    938987   // Check validity of local domain on using the combination of 3 parameters: jbegin, nj and j_index 
    939988   void CDomain::checkLocalJDomain(void) 
     989   TRY 
    940990   { 
    941991    // If jbegin and nj are provided then we use them to check the validity of local domain 
     
    9861036     } 
    9871037   } 
     1038   CATCH_DUMP_ATTR 
    9881039 
    9891040   //---------------------------------------------------------------- 
    9901041 
    9911042   void CDomain::checkMask(void) 
     1043   TRY 
    9921044   { 
    9931045      if (!mask_1d.isEmpty() && !mask_2d.isEmpty()) 
     
    10351087     } 
    10361088   } 
     1089   CATCH_DUMP_ATTR 
    10371090 
    10381091   //---------------------------------------------------------------- 
    10391092 
    10401093   void CDomain::checkDomainData(void) 
     1094   TRY 
    10411095   { 
    10421096      if (data_dim.isEmpty()) 
     
    10781132      } 
    10791133   } 
     1134   CATCH_DUMP_ATTR 
    10801135 
    10811136   //---------------------------------------------------------------- 
    10821137 
    10831138   void CDomain::checkCompression(void) 
     1139   TRY 
    10841140   { 
    10851141      if (!data_i_index.isEmpty()) 
     
    11481204      } 
    11491205   } 
     1206   CATCH_DUMP_ATTR 
    11501207 
    11511208   //---------------------------------------------------------------- 
    11521209   void CDomain::computeLocalMask(void) 
     1210   TRY 
    11531211   { 
    11541212     localMask.resize(i_index.numElements()) ; 
     
    11821240     } 
    11831241   } 
     1242   CATCH_DUMP_ATTR 
    11841243 
    11851244   void CDomain::checkEligibilityForCompressedOutput(void) 
     1245   TRY 
    11861246   { 
    11871247     // We don't check if the mask or the indexes are valid here, just if they have been defined at this point. 
    11881248     isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !data_i_index.isEmpty(); 
    11891249   } 
     1250   CATCH_DUMP_ATTR 
    11901251 
    11911252   //---------------------------------------------------------------- 
     
    11961257   */ 
    11971258   void CDomain::completeLonLatClient(void) 
     1259   TRY 
    11981260   { 
    11991261     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); 
     
    13091371     } 
    13101372   } 
     1373   CATCH_DUMP_ATTR 
    13111374 
    13121375   /* 
     
    13141377   */ 
    13151378   void CDomain::convertLonLatValue(void) 
     1379   TRY 
    13161380   { 
    13171381     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); 
     
    14111475     } 
    14121476   } 
    1413  
     1477   CATCH_DUMP_ATTR 
    14141478 
    14151479   void CDomain::checkBounds(void) 
     1480   TRY 
    14161481   { 
    14171482     bool hasBoundValues = (0 != bounds_lonvalue.numElements()) || (0 != bounds_latvalue.numElements()); 
     
    15051570     } 
    15061571   } 
     1572   CATCH_DUMP_ATTR 
    15071573 
    15081574   void CDomain::checkArea(void) 
     1575   TRY 
    15091576   { 
    15101577     bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements()); 
     
    15341601     } 
    15351602   } 
     1603   CATCH_DUMP_ATTR 
    15361604 
    15371605   void CDomain::checkLonLat() 
     1606   TRY 
    15381607   { 
    15391608     if (!hasLonLat) hasLonLat = (!latvalue_1d.isEmpty() && !lonvalue_1d.isEmpty()) || 
     
    15951664     } 
    15961665   } 
     1666   CATCH_DUMP_ATTR 
    15971667 
    15981668   void CDomain::checkAttributesOnClientAfterTransformation() 
     1669   TRY 
    15991670   { 
    16001671     CContext* context=CContext::getCurrent() ; 
     
    16111682     this->isClientAfterTransformationChecked = true; 
    16121683   } 
     1684   CATCH_DUMP_ATTR 
    16131685 
    16141686   //---------------------------------------------------------------- 
     
    16161688   // This function only checks all attributes of current domain 
    16171689   void CDomain::checkAttributesOnClient() 
     1690   TRY 
    16181691   { 
    16191692     if (this->isClientChecked) return; 
     
    16411714      this->isClientChecked = true; 
    16421715   } 
     1716   CATCH_DUMP_ATTR 
    16431717 
    16441718   // Send all checked attributes to server 
    16451719   void CDomain::sendCheckedAttributes() 
     1720   TRY 
    16461721   { 
    16471722     if (!this->isClientChecked) checkAttributesOnClient(); 
     
    16561731     this->isChecked = true; 
    16571732   } 
     1733   CATCH_DUMP_ATTR 
    16581734 
    16591735   void CDomain::checkAttributes(void) 
     1736   TRY 
    16601737   { 
    16611738      if (this->isChecked) return; 
     
    16871764      this->isChecked = true; 
    16881765   } 
     1766   CATCH_DUMP_ATTR 
    16891767 
    16901768  /*! 
     
    16951773  */ 
    16961774  void CDomain::computeConnectedClients() 
     1775  TRY 
    16971776  { 
    16981777    CContext* context=CContext::getCurrent() ; 
     
    17991878    } 
    18001879  } 
     1880  CATCH_DUMP_ATTR 
    18011881 
    18021882   /*! 
     
    18061886   */ 
    18071887   void CDomain::computeWrittenIndex() 
     1888   TRY 
    18081889   {   
    18091890      if (computedWrittenIndex_) return; 
     
    19001981      // }       
    19011982   } 
     1983   CATCH_DUMP_ATTR 
    19021984 
    19031985  void CDomain::computeWrittenCompressedIndex(MPI_Comm writtenComm) 
     1986  TRY 
    19041987  { 
    19051988    int writtenCommSize; 
     
    19692052      } 
    19702053  } 
     2054  CATCH_DUMP_ATTR 
    19712055 
    19722056  /*! 
     
    19752059  */ 
    19762060  void CDomain::sendAttributes() 
     2061  TRY 
    19772062  { 
    19782063    sendDistributionAttributes(); 
     
    19832068    sendDataIndex(); 
    19842069  } 
    1985  
     2070  CATCH 
    19862071  /*! 
    19872072    Send global index from client to connected client(s) 
    19882073  */ 
    19892074  void CDomain::sendIndex() 
     2075  TRY 
    19902076  { 
    19912077    int ns, n, i, j, ind, nv, idx; 
     
    20302116    } 
    20312117  } 
     2118  CATCH_DUMP_ATTR 
    20322119 
    20332120  /*! 
     
    20372124  */ 
    20382125  void CDomain::sendDistributionAttributes(void) 
     2126  TRY 
    20392127  { 
    20402128    std::list<CContextClient*>::iterator it; 
     
    20832171    } 
    20842172  } 
     2173  CATCH_DUMP_ATTR 
    20852174 
    20862175  /*! 
     
    20882177  */ 
    20892178  void CDomain::sendMask() 
     2179  TRY 
    20902180  { 
    20912181    int ns, n, i, j, ind, nv, idx; 
     
    21272217    } 
    21282218  } 
     2219  CATCH_DUMP_ATTR 
    21292220 
    21302221  /*! 
     
    21322223  */ 
    21332224  void CDomain::sendArea() 
     2225  TRY 
    21342226  { 
    21352227    if (!hasArea) return; 
     
    21752267    } 
    21762268  } 
     2269  CATCH_DUMP_ATTR 
    21772270 
    21782271  /*! 
     
    21822275  */ 
    21832276  void CDomain::sendLonLat() 
     2277  TRY 
    21842278  { 
    21852279    if (!hasLonLat) return; 
     
    22702364    } 
    22712365  } 
     2366  CATCH_DUMP_ATTR 
    22722367 
    22732368  /*! 
     
    22782373  */ 
    22792374  void CDomain::sendDataIndex() 
     2375  TRY 
    22802376  { 
    22812377    int ns, n, i, j, ind, nv, idx; 
     
    23462442    } 
    23472443  } 
     2444  CATCH 
    23482445   
    23492446  bool CDomain::dispatchEvent(CEventServer& event) 
     2447  TRY 
    23502448  { 
    23512449    if (SuperClass::dispatchEvent(event)) return true; 
     
    23892487    } 
    23902488  } 
     2489  CATCH 
    23912490 
    23922491  /*! 
     
    23952494  */ 
    23962495  void CDomain::recvIndex(CEventServer& event) 
     2496  TRY 
    23972497  { 
    23982498    string domainId; 
     
    24082508    get(domainId)->recvIndex(rankBuffers); 
    24092509  } 
     2510  CATCH 
    24102511 
    24112512  /*! 
     
    24152516  */ 
    24162517  void CDomain::recvIndex(std::map<int, CBufferIn*>& rankBuffers) 
     2518  TRY 
    24172519  { 
    24182520    int nbReceived = rankBuffers.size(), i, ind, index, type_int, iIndex, jIndex; 
     
    24792581    } 
    24802582  } 
     2583  CATCH 
    24812584 
    24822585  /*! 
     
    24852588  */ 
    24862589  void CDomain::recvDistributionAttributes(CEventServer& event) 
     2590  TRY 
    24872591  { 
    24882592    CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    24912595    get(domainId)->recvDistributionAttributes(*buffer); 
    24922596  } 
     2597  CATCH 
    24932598 
    24942599  /*! 
     
    24982603  */ 
    24992604  void CDomain::recvDistributionAttributes(CBufferIn& buffer) 
     2605  TRY 
    25002606  { 
    25012607    int ni_tmp, ibegin_tmp, nj_tmp, jbegin_tmp; 
     
    25132619 
    25142620  } 
     2621  CATCH_DUMP_ATTR 
    25152622 
    25162623  /*! 
     
    25192626  */ 
    25202627  void CDomain::recvMask(CEventServer& event) 
     2628  TRY 
    25212629  { 
    25222630    string domainId; 
     
    25322640    get(domainId)->recvMask(rankBuffers); 
    25332641  } 
    2534  
     2642  CATCH 
    25352643 
    25362644  /*! 
     
    25392647  */ 
    25402648  void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers) 
     2649  TRY 
    25412650  { 
    25422651    int nbReceived = rankBuffers.size(), i, ind, index, lInd; 
     
    25822691    domainMask=mask_1d ; 
    25832692  } 
     2693  CATCH_DUMP_ATTR 
    25842694 
    25852695  /*! 
     
    25882698  */ 
    25892699  void CDomain::recvLon(CEventServer& event) 
     2700  TRY 
    25902701  { 
    25912702    string domainId; 
     
    26012712    get(domainId)->recvLon(rankBuffers); 
    26022713  } 
     2714  CATCH 
    26032715 
    26042716  /*! 
     
    26072719  */ 
    26082720  void CDomain::recvLon(std::map<int, CBufferIn*>& rankBuffers) 
     2721  TRY 
    26092722  { 
    26102723    int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; 
     
    26662779    } 
    26672780  } 
     2781  CATCH_DUMP_ATTR 
    26682782 
    26692783  /*! 
     
    26722786  */ 
    26732787  void CDomain::recvLat(CEventServer& event) 
     2788  TRY 
    26742789  { 
    26752790    string domainId; 
     
    26852800    get(domainId)->recvLat(rankBuffers); 
    26862801  } 
     2802  CATCH 
    26872803 
    26882804  /*! 
     
    26912807  */ 
    26922808  void CDomain::recvLat(std::map<int, CBufferIn*>& rankBuffers) 
     2809  TRY 
    26932810  { 
    26942811    int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; 
     
    27522869    } 
    27532870  } 
     2871  CATCH_DUMP_ATTR 
    27542872 
    27552873  /*! 
     
    27582876  */ 
    27592877  void CDomain::recvArea(CEventServer& event) 
     2878  TRY 
    27602879  { 
    27612880    string domainId; 
     
    27712890    get(domainId)->recvArea(rankBuffers); 
    27722891  } 
     2892  CATCH 
    27732893 
    27742894  /*! 
     
    27772897  */ 
    27782898  void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers) 
     2899  TRY 
    27792900  { 
    27802901    int nbReceived = rankBuffers.size(), i, ind, index, lInd; 
     
    28222943    } 
    28232944  } 
     2945  CATCH_DUMP_ATTR 
    28242946 
    28252947  /*! 
     
    28312953  */ 
    28322954  bool CDomain::isEqual(CDomain* obj) 
     2955  TRY 
    28332956  { 
    28342957    vector<StdString> excludedAttr; 
     
    28532976    return objEqual; 
    28542977  } 
     2978  CATCH_DUMP_ATTR 
    28552979 
    28562980  /*! 
     
    28592983  */ 
    28602984  void CDomain::recvDataIndex(CEventServer& event) 
     2985  TRY 
    28612986  { 
    28622987    string domainId; 
     
    28722997    get(domainId)->recvDataIndex(rankBuffers); 
    28732998  } 
     2999  CATCH 
    28743000 
    28753001  /*! 
     
    28833009  */ 
    28843010  void CDomain::recvDataIndex(std::map<int, CBufferIn*>& rankBuffers) 
     3011  TRY 
    28853012  { 
    28863013    int nbReceived = rankBuffers.size(), i, ind, index, indexI, indexJ, type_int, lInd;     
     
    29543081    data_jbegin.setValue(0); 
    29553082  } 
     3083  CATCH_DUMP_ATTR 
    29563084 
    29573085  CTransformation<CDomain>* CDomain::addTransformation(ETranformationType transType, const StdString& id) 
     3086  TRY 
    29583087  { 
    29593088    transformationMap_.push_back(std::make_pair(transType, CTransformation<CDomain>::createTransformation(transType,id))); 
    29603089    return transformationMap_.back().second; 
    29613090  } 
     3091  CATCH_DUMP_ATTR 
    29623092 
    29633093  /*! 
     
    29663096  */ 
    29673097  bool CDomain::hasTransformation() 
     3098  TRY 
    29683099  { 
    29693100    return (!transformationMap_.empty()); 
    29703101  } 
     3102  CATCH_DUMP_ATTR 
    29713103 
    29723104  /*! 
     
    29753107  */ 
    29763108  void CDomain::setTransformations(const TransMapTypes& domTrans) 
     3109  TRY 
    29773110  { 
    29783111    transformationMap_ = domTrans; 
    29793112  } 
     3113  CATCH_DUMP_ATTR 
    29803114 
    29813115  /*! 
     
    29843118  */ 
    29853119  CDomain::TransMapTypes CDomain::getAllTransformations(void) 
     3120  TRY 
    29863121  { 
    29873122    return transformationMap_; 
    29883123  } 
     3124  CATCH_DUMP_ATTR 
    29893125 
    29903126  void CDomain::duplicateTransformation(CDomain* src) 
     3127  TRY 
    29913128  { 
    29923129    if (src->hasTransformation()) 
     
    29953132    } 
    29963133  } 
     3134  CATCH_DUMP_ATTR 
    29973135 
    29983136  /*! 
     
    30003138   */ 
    30013139  void CDomain::solveInheritanceTransformation() 
     3140  TRY 
    30023141  { 
    30033142    if (hasTransformation() || !hasDirectDomainReference()) 
     
    30163155        refDomains[i]->setTransformations(domain->getAllTransformations()); 
    30173156  } 
     3157  CATCH_DUMP_ATTR 
    30183158 
    30193159  void CDomain::setContextClient(CContextClient* contextClient) 
     3160  TRY 
    30203161  { 
    30213162    if (clientsSet.find(contextClient)==clientsSet.end()) 
     
    30253166    } 
    30263167  } 
     3168  CATCH_DUMP_ATTR 
    30273169 
    30283170  /*! 
     
    30323174  */ 
    30333175  void CDomain::parse(xml::CXMLNode & node) 
     3176  TRY 
    30343177  { 
    30353178    SuperClass::parse(node); 
     
    30623205    } 
    30633206  } 
     3207  CATCH_DUMP_ATTR 
    30643208   //---------------------------------------------------------------- 
    30653209 
  • XIOS/trunk/src/node/field.cpp

    r1574 r1622  
    7171 
    7272   void CField::setVirtualVariableGroup(CVariableGroup* newVVariableGroup) 
     73   TRY 
    7374   { 
    7475      this->vVariableGroup = newVVariableGroup; 
    7576   } 
     77   CATCH 
    7678 
    7779   CVariableGroup* CField::getVirtualVariableGroup(void) const 
     80   TRY 
    7881   { 
    7982      return this->vVariableGroup; 
    8083   } 
     84   CATCH 
    8185 
    8286   std::vector<CVariable*> CField::getAllVariables(void) const 
     87   TRY 
    8388   { 
    8489      return this->vVariableGroup->getAllChildren(); 
    8590   } 
     91   CATCH 
    8692 
    8793   void CField::solveDescInheritance(bool apply, const CAttributeMap* const parent) 
     94   TRY 
    8895   { 
    8996      SuperClassAttribute::setAttributes(parent, apply); 
    9097      this->getVirtualVariableGroup()->solveDescInheritance(apply, NULL); 
    9198   } 
     99   CATCH_DUMP_ATTR 
    92100 
    93101  //---------------------------------------------------------------- 
    94102 
    95103  bool CField::dispatchEvent(CEventServer& event) 
     104  TRY 
    96105  { 
    97106    if (SuperClass::dispatchEvent(event)) return true; 
     
    131140    } 
    132141  } 
     142  CATCH 
    133143 
    134144  void CField::sendUpdateData(const CArray<double,1>& data) 
     145  TRY 
    135146  { 
    136147    CTimer::get("Field : send data").resume(); 
     
    189200    CTimer::get("Field : send data").suspend(); 
    190201  } 
     202  CATCH_DUMP_ATTR 
    191203 
    192204  void CField::recvUpdateData(CEventServer& event) 
     205  TRY 
    193206  { 
    194207    std::map<int,CBufferIn*> rankBuffers; 
     
    207220    CTimer::get("Field : recv data").suspend(); 
    208221  } 
     222  CATCH 
    209223 
    210224  void  CField::recvUpdateData(std::map<int,CBufferIn*>& rankBuffers) 
     225  TRY 
    211226  { 
    212227    CContext* context = CContext::getCurrent(); 
     
    249264    recvDataSrv.reset() ; 
    250265  } 
     266  CATCH_DUMP_ATTR 
    251267 
    252268  void CField::writeUpdateData(const CArray<double,1>& data) 
     269  TRY 
    253270  { 
    254271    CContext* context = CContext::getCurrent(); 
     
    277294    } 
    278295  } 
     296  CATCH_DUMP_ATTR 
    279297 
    280298  void CField::writeField(void) 
     299  TRY 
    281300  { 
    282301    if (!getRelFile()->isEmptyZone()) 
     
    290309    } 
    291310  } 
     311  CATCH_DUMP_ATTR 
    292312 
    293313  /* 
     
    299319  */ 
    300320  bool CField::sendReadDataRequest(const CDate& tsDataRequested) 
     321  TRY 
    301322  { 
    302323    CContext* context = CContext::getCurrent(); 
     
    330351    return !isEOF; 
    331352  } 
     353  CATCH_DUMP_ATTR 
    332354 
    333355  /*! 
     
    336358  */ 
    337359  bool CField::sendReadDataRequestIfNeeded(void) 
     360  TRY 
    338361  { 
    339362    const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate(); 
     
    353376    return dataRequested; 
    354377  } 
     378  CATCH_DUMP_ATTR 
    355379 
    356380  void CField::recvReadDataRequest(CEventServer& event) 
     381  TRY 
    357382  { 
    358383    CBufferIn* buffer = event.subEvents.begin()->buffer; 
     
    361386    get(fieldId)->recvReadDataRequest(); 
    362387  } 
     388  CATCH 
    363389 
    364390  /*! 
     
    369395  */ 
    370396  void CField::recvReadDataRequest(void) 
     397  TRY 
    371398  { 
    372399    CContext* context = CContext::getCurrent(); 
     
    449476    } 
    450477  } 
     478  CATCH_DUMP_ATTR 
    451479 
    452480  /*! 
     
    456484  */ 
    457485  CField::EReadField CField::readField(void) 
     486  TRY 
    458487  { 
    459488    CContext* context = CContext::getCurrent(); 
     
    508537    return readState; 
    509538  } 
     539  CATCH_DUMP_ATTR 
    510540 
    511541  /* 
     
    516546  */ 
    517547  void CField::recvReadDataReady(CEventServer& event) 
     548  TRY 
    518549  { 
    519550    string fieldId; 
     
    531562    get(fieldId)->recvReadDataReady(ranks, buffers); 
    532563  } 
     564  CATCH 
    533565 
    534566  /*! 
     
    538570  */ 
    539571  void CField::recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers) 
     572  TRY 
    540573  { 
    541574    CContext* context = CContext::getCurrent(); 
     
    574607      serverSourceFilter->streamDataFromServer(lastDataReceivedFromServer, data); 
    575608  } 
     609  CATCH_DUMP_ATTR 
    576610 
    577611  void CField::checkForLateDataFromServer(void) 
     612  TRY 
    578613  { 
    579614    CContext* context = CContext::getCurrent(); 
     
    607642    } 
    608643  } 
     644  CATCH_DUMP_ATTR 
    609645 
    610646  void CField::checkIfMustAutoTrigger(void) 
     647  TRY 
    611648  { 
    612649    mustAutoTrigger = serverSourceFilter ? serverSourceFilter->mustAutoTrigger() : false; 
    613650  } 
     651  CATCH_DUMP_ATTR 
    614652 
    615653  void CField::autoTriggerIfNeeded(void) 
     654  TRY 
    616655  { 
    617656    if (mustAutoTrigger) 
    618657      serverSourceFilter->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()); 
    619658  } 
     659  CATCH_DUMP_ATTR 
    620660 
    621661   //---------------------------------------------------------------- 
    622662 
    623663   void CField::setRelFile(CFile* _file) 
     664   TRY 
    624665   { 
    625666      this->file = _file; 
    626667      hasOutputFile = true; 
    627668   } 
     669   CATCH_DUMP_ATTR 
    628670 
    629671   //---------------------------------------------------------------- 
     
    636678 
    637679   CGrid* CField::getRelGrid(void) const 
     680   TRY 
    638681   { 
    639682      return this->grid; 
    640683   } 
     684   CATCH 
    641685 
    642686   //---------------------------------------------------------------- 
    643687 
    644688   CFile* CField::getRelFile(void) const 
     689   TRY 
    645690   { 
    646691      return this->file; 
    647692   } 
     693   CATCH 
    648694 
    649695   int CField::getNStep(void) const 
     696   TRY 
    650697   { 
    651698      return this->nstep; 
    652699   } 
     700   CATCH 
    653701 
    654702   func::CFunctor::ETimeType CField::getOperationTimeType() const 
     703   TRY 
    655704   { 
    656705     return operationTimeType; 
    657706   } 
     707   CATCH 
    658708 
    659709   //---------------------------------------------------------------- 
    660710 
    661711   void CField::incrementNStep(void) 
     712   TRY 
    662713   { 
    663714      this->nstep++; 
    664715   } 
     716   CATCH_DUMP_ATTR 
    665717 
    666718   void CField::resetNStep(int nstep /*= 0*/) 
     719   TRY 
    667720   { 
    668721      this->nstep = nstep; 
    669722   } 
     723   CATCH_DUMP_ATTR 
    670724 
    671725   void CField::resetNStepMax(void) 
     726   TRY 
    672727   { 
    673728      this->nstepMax = 0; 
    674729      nstepMaxRead = false; 
    675730   } 
     731   CATCH_DUMP_ATTR 
    676732 
    677733   //---------------------------------------------------------------- 
    678734 
    679735   bool CField::isActive(bool atCurrentTimestep /*= false*/) const 
     736   TRY 
    680737   { 
    681738      if (clientSourceFilter) 
     
    689746      return false; 
    690747   } 
     748   CATCH 
    691749 
    692750   //---------------------------------------------------------------- 
    693751 
    694752   bool CField::wasWritten() const 
     753   TRY 
    695754   { 
    696755     return written; 
    697756   } 
     757   CATCH 
    698758 
    699759   void CField::setWritten() 
     760   TRY 
    700761   { 
    701762     written = true; 
    702763   } 
     764   CATCH_DUMP_ATTR 
    703765 
    704766   //---------------------------------------------------------------- 
    705767 
    706768   bool CField::getUseCompressedOutput() const 
     769   TRY 
    707770   { 
    708771     return useCompressedOutput; 
    709772   } 
     773   CATCH 
    710774 
    711775   void CField::setUseCompressedOutput() 
     776   TRY 
    712777   { 
    713778     useCompressedOutput = true; 
    714779   } 
     780   CATCH_DUMP_ATTR 
    715781 
    716782   //---------------------------------------------------------------- 
    717783 
    718784   std::shared_ptr<COutputPin> CField::getInstantDataFilter() 
     785   TRY 
    719786   { 
    720787     return instantDataFilter; 
    721788   } 
     789   CATCH_DUMP_ATTR 
    722790 
    723791   //---------------------------------------------------------------- 
     
    728796   */ 
    729797   void CField::buildGridTransformationGraph() 
     798   TRY 
    730799   { 
    731800     CContext* context = CContext::getCurrent(); 
     
    738807     } 
    739808   } 
     809   CATCH_DUMP_ATTR 
    740810 
    741811   /*! 
     
    743813   */ 
    744814   void CField::generateNewTransformationGridDest() 
     815   TRY 
    745816   { 
    746817     CContext* context = CContext::getCurrent(); 
     
    797868     } 
    798869   } 
     870   CATCH_DUMP_ATTR 
    799871 
    800872   void CField::updateRef(CGrid* grid) 
     873   TRY 
    801874   { 
    802875     if (!grid_ref.isEmpty()) grid_ref.setValue(grid->getId()); 
     
    820893     } 
    821894   } 
     895   CATCH_DUMP_ATTR 
    822896    
    823897   /*! 
     
    826900   */ 
    827901   void CField::solveAllEnabledFieldsAndTransform() 
     902   TRY 
    828903   { 
    829904     CContext* context = CContext::getCurrent(); 
     
    862937     } 
    863938   } 
     939   CATCH_DUMP_ATTR 
    864940 
    865941   void CField::checkGridOfEnabledFields() 
     942   TRY 
    866943   { 
    867944     if (!isGridChecked) 
     
    871948     } 
    872949   } 
     950   CATCH_DUMP_ATTR 
    873951 
    874952   void CField::sendGridComponentOfEnabledFields() 
     953   TRY 
    875954   { 
    876955      solveGridDomainAxisRef(true); 
    877956      // solveCheckMaskIndex(true); 
    878957   } 
     958   CATCH_DUMP_ATTR 
    879959 
    880960   void CField::sendGridOfEnabledFields() 
     961   TRY 
    881962   { 
    882963      // solveGridDomainAxisRef(true); 
    883964      solveCheckMaskIndex(true); 
    884965   }    
     966   CATCH_DUMP_ATTR 
    885967 
    886968   void CField::solveOnlyReferenceEnabledField(bool doSending2Server) 
     969   TRY 
    887970   { 
    888971     CContext* context = CContext::getCurrent(); 
     
    910993     } 
    911994   } 
    912       
     995   CATCH_DUMP_ATTR 
     996 
    913997   void CField::solveAllReferenceEnabledField(bool doSending2Server) 
     998   TRY 
    914999   { 
    9151000     CContext* context = CContext::getCurrent(); 
     
    9401025     solveCheckMaskIndex(doSending2Server); 
    9411026   } 
     1027   CATCH_DUMP_ATTR 
    9421028 
    9431029   std::map<int, StdSize> CField::getGridAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= "false"*/) 
     1030   TRY 
    9441031   { 
    9451032     return grid->getAttributesBufferSize(client, bufferForWriting); 
    9461033   } 
     1034   CATCH_DUMP_ATTR 
    9471035 
    9481036   std::map<int, StdSize> CField::getGridDataBufferSize(CContextClient* client, bool bufferForWriting /*= "false"*/) 
     1037   TRY 
    9491038   { 
    9501039     return grid->getDataBufferSize(client, getId(), bufferForWriting); 
    9511040   } 
     1041   CATCH_DUMP_ATTR 
    9521042 
    9531043   size_t CField::getGlobalWrittenSize() 
     1044   TRY 
    9541045   { 
    9551046     return grid->getGlobalWrittenSize(); 
    9561047   } 
     1048   CATCH_DUMP_ATTR 
    9571049 
    9581050   //---------------------------------------------------------------- 
    9591051 
    9601052   void CField::solveServerOperation(void) 
     1053   TRY 
    9611054   { 
    9621055      CContext* context = CContext::getCurrent(); 
     
    10011094      operationTimeType = functor->timeType(); 
    10021095   } 
     1096   CATCH_DUMP_ATTR 
    10031097 
    10041098   //---------------------------------------------------------------- 
     
    10131107    */ 
    10141108   void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput) 
     1109   TRY 
    10151110   {      
    10161111    if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform(); 
     
    11181213     } 
    11191214   } 
     1215   CATCH_DUMP_ATTR 
    11201216 
    11211217   /*! 
     
    11271223    */ 
    11281224   std::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc) 
     1225   TRY 
    11291226   { 
    11301227     if (instantDataFilter || field_ref.isEmpty()) 
     
    11501247     return filters.second; 
    11511248   } 
     1249   CATCH_DUMP_ATTR 
    11521250 
    11531251   /*! 
     
    11611259    */ 
    11621260   std::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc) 
     1261   TRY 
    11631262   { 
    11641263     if (instantDataFilter || !hasExpression()) 
     
    12031302     return selfReferenceFilter; 
    12041303   } 
     1304   CATCH_DUMP_ATTR 
    12051305 
    12061306   /*! 
     
    12141314    */ 
    12151315   std::shared_ptr<COutputPin> CField::getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 
     1316   TRY 
    12161317   { 
    12171318     std::map<CDuration, std::shared_ptr<COutputPin> >::iterator it = temporalDataFilters.find(outFreq); 
     
    12371338     return it->second; 
    12381339   } 
     1340   CATCH_DUMP_ATTR 
    12391341 
    12401342  /*! 
     
    12481350    
    12491351   std::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 
     1352   TRY 
    12501353   { 
    12511354     if (instantDataFilter || !hasExpression()) 
     
    12781381     } 
    12791382  } 
     1383   CATCH_DUMP_ATTR 
    12801384 
    12811385   //---------------------------------------------------------------- 
     
    12961400 
    12971401   void CField::solveGridReference(void) 
     1402   TRY 
    12981403   { 
    12991404      if (grid_ref.isEmpty() && domain_ref.isEmpty() && axis_ref.isEmpty() && scalar_ref.isEmpty()) 
     
    13791484      } 
    13801485   } 
     1486   CATCH_DUMP_ATTR 
    13811487 
    13821488   void CField::solveGridDomainAxisRef(bool checkAtt) 
     1489   TRY 
    13831490   { 
    13841491     grid->solveDomainAxisRef(checkAtt); 
    13851492   } 
     1493   CATCH_DUMP_ATTR 
    13861494 
    13871495   void CField::solveCheckMaskIndex(bool doSendingIndex) 
     1496   TRY 
    13881497   { 
    13891498     grid->checkMaskIndex(doSendingIndex); 
    13901499   } 
     1500   CATCH_DUMP_ATTR 
    13911501 
    13921502   void CField::solveTransformedGrid() 
     1503   TRY 
    13931504   { 
    13941505     if (grid && !grid->isTransformed() && hasDirectFieldReference() && grid != getDirectFieldReference()->grid) 
     
    14391550     } 
    14401551   } 
     1552   CATCH_DUMP_ATTR 
    14411553 
    14421554   void CField::solveGenerateGrid() 
     1555   TRY 
    14431556   { 
    14441557     if (grid && !grid->isTransformed() && hasDirectFieldReference() && grid != getDirectFieldReference()->grid) 
     
    14471560       grid->completeGrid(); 
    14481561   } 
     1562   CATCH_DUMP_ATTR 
    14491563 
    14501564   void CField::solveGridDomainAxisBaseRef() 
     1565   TRY 
    14511566   { 
    14521567     grid->solveDomainAxisRef(false); 
    14531568     grid->solveDomainAxisBaseRef(); 
    14541569   } 
     1570   CATCH_DUMP_ATTR 
    14551571 
    14561572   ///------------------------------------------------------------------- 
     
    14581574   template <> 
    14591575   void CGroupTemplate<CField, CFieldGroup, CFieldAttributes>::solveRefInheritance(void) 
     1576   TRY 
    14601577   { 
    14611578      if (this->group_ref.isEmpty()) return; 
     
    14811598      } 
    14821599   } 
     1600   CATCH_DUMP_ATTR 
    14831601 
    14841602   void CField::scaleFactorAddOffset(double scaleFactor, double addOffset) 
     1603   TRY 
    14851604   { 
    14861605     recvDataSrv = (recvDataSrv - addOffset) / scaleFactor; 
    14871606   } 
     1607   CATCH_DUMP_ATTR 
    14881608 
    14891609   void CField::invertScaleFactorAddOffset(double scaleFactor, double addOffset) 
     1610   TRY 
    14901611   { 
    14911612     recvDataSrv = recvDataSrv * scaleFactor + addOffset; 
    14921613   } 
     1614   CATCH_DUMP_ATTR 
    14931615 
    14941616   void CField::outputField(CArray<double,1>& fieldOut) 
     1617   TRY 
    14951618   {  
    14961619      CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient; 
     
    15011624      } 
    15021625   } 
     1626   CATCH_DUMP_ATTR 
    15031627 
    15041628   void CField::inputField(CArray<double,1>& fieldIn) 
     1629   TRY 
    15051630   { 
    15061631      CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient; 
     
    15101635        recvDataSrv(outIndexClient(idx)) = fieldIn(outIndexServer(idx)); 
    15111636      } 
    1512  
    1513    } 
     1637   } 
     1638   CATCH_DUMP_ATTR 
    15141639 
    15151640   void CField::outputCompressedField(CArray<double,1>& fieldOut) 
     1641   TRY 
    15161642   { 
    15171643      CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient; 
     
    15221648      } 
    15231649   } 
     1650   CATCH_DUMP_ATTR 
    15241651 
    15251652   ///------------------------------------------------------------------- 
    15261653 
    15271654   void CField::parse(xml::CXMLNode& node) 
     1655   TRY 
    15281656   { 
    15291657      string newContent ; 
     
    15401668      if (node.getContent(newContent)) content=newContent ; 
    15411669    } 
     1670   CATCH_DUMP_ATTR 
    15421671 
    15431672   /*! 
     
    15471676   */ 
    15481677   const std::vector<StdString>& CField::getRefDomainAxisIds() 
     1678   TRY 
    15491679   { 
    15501680     CGrid* cgPtr = getRelGrid(); 
     
    15751705     return (domAxisScalarIds_); 
    15761706   } 
     1707   CATCH_DUMP_ATTR 
    15771708 
    15781709   CVariable* CField::addVariable(const string& id) 
     1710   TRY 
    15791711   { 
    15801712     return vVariableGroup->createChild(id); 
    15811713   } 
     1714   CATCH 
    15821715 
    15831716   CVariableGroup* CField::addVariableGroup(const string& id) 
     1717   TRY 
    15841718   { 
    15851719     return vVariableGroup->createChildGroup(id); 
    15861720   } 
     1721   CATCH 
    15871722 
    15881723   void CField::setContextClient(CContextClient* contextClient) 
     1724   TRY 
    15891725   { 
    15901726     CContext* context = CContext::getCurrent(); 
     
    16021738     } 
    16031739   } 
     1740   CATCH_DUMP_ATTR 
    16041741 
    16051742   CContextClient* CField::getContextClient() 
     1743   TRY 
    16061744   { 
    16071745     return client; 
    16081746   } 
     1747   CATCH 
    16091748 
    16101749   void CField::sendAddAllVariables(CContextClient* client) 
     1750   TRY 
    16111751   { 
    16121752     std::vector<CVariable*> allVar = getAllVariables(); 
     
    16211761     } 
    16221762   } 
    1623  
     1763   CATCH_DUMP_ATTR 
    16241764 
    16251765   /*! 
     
    16291769     
    16301770   void CField::sendAllAttributesToServer(CContextClient* client) 
     1771   TRY 
    16311772   { 
    16321773     if (grid_ref.isEmpty()) 
     
    16381779     else SuperClass::sendAllAttributesToServer(client) ; 
    16391780   } 
     1781   CATCH_DUMP_ATTR 
    16401782     
    16411783   void CField::sendAddVariable(const string& id, CContextClient* client) 
     1784   TRY 
    16421785   { 
    16431786      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client); 
    16441787   } 
     1788   CATCH_DUMP_ATTR 
    16451789 
    16461790   void CField::sendAddVariableGroup(const string& id, CContextClient* client) 
     1791   TRY 
    16471792   { 
    16481793      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP, client); 
    16491794   } 
     1795   CATCH_DUMP_ATTR 
    16501796 
    16511797   void CField::recvAddVariable(CEventServer& event) 
     1798   TRY 
    16521799   { 
    16531800 
     
    16571804      get(id)->recvAddVariable(*buffer); 
    16581805   } 
     1806   CATCH 
    16591807 
    16601808   void CField::recvAddVariable(CBufferIn& buffer) 
     1809   TRY 
    16611810   { 
    16621811      string id; 
     
    16641813      addVariable(id); 
    16651814   } 
     1815   CATCH_DUMP_ATTR 
    16661816 
    16671817   void CField::recvAddVariableGroup(CEventServer& event) 
     1818   TRY 
    16681819   { 
    16691820 
     
    16731824      get(id)->recvAddVariableGroup(*buffer); 
    16741825   } 
     1826   CATCH 
    16751827 
    16761828   void CField::recvAddVariableGroup(CBufferIn& buffer) 
     1829   TRY 
    16771830   { 
    16781831      string id; 
     
    16801833      addVariableGroup(id); 
    16811834   } 
     1835   CATCH_DUMP_ATTR 
    16821836 
    16831837   /*! 
     
    16851839    */ 
    16861840   void CField::checkTimeAttributes(CDuration* freqOp) 
     1841   TRY 
    16871842   { 
    16881843     bool isFieldRead  = file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read; 
     
    17061861       freq_offset.setValue(isFieldRead ? NoneDu : (freq_op.getValue() - TimeStep)); 
    17071862   } 
     1863   CATCH_DUMP_ATTR 
    17081864 
    17091865   /*! 
     
    17121868    */ 
    17131869   const string& CField::getExpression(void) 
     1870   TRY 
    17141871   { 
    17151872     if (!expr.isEmpty() && content.empty()) 
     
    17211878     return content; 
    17221879   } 
     1880   CATCH_DUMP_ATTR 
    17231881 
    17241882   bool CField::hasExpression(void) const 
     1883   TRY 
    17251884   { 
    17261885     return (!expr.isEmpty() || !content.empty()); 
    17271886   } 
    1728  
     1887   CATCH 
    17291888 
    17301889   DEFINE_REF_FUNC(Field,field) 
  • XIOS/trunk/src/node/field_impl.hpp

    r1201 r1622  
    1717  template <int N> 
    1818  void CField::setData(const CArray<double, N>& _data) 
     19  TRY 
    1920  { 
    2021    if (clientSourceFilter) 
     
    2728            << "Impossible to receive data from the model for a field [ id = " << getId() << " ] with a reference or an arithmetic operation."); 
    2829  } 
     30  CATCH_DUMP_ATTR 
    2931 
    3032  template <int N> 
    3133  void CField::getData(CArray<double, N>& _data) const 
     34  TRY 
    3235  { 
    3336    if (storeFilter) 
     
    4548    } 
    4649  } 
     50  CATCH 
    4751} // namespace xios 
    4852 
  • XIOS/trunk/src/node/file.cpp

    r1542 r1622  
    5353 
    5454   const StdString CFile::getFileOutputName(void) const 
     55   TRY 
    5556   { 
    5657     return (name.isEmpty() ? getId() : name) + (name_suffix.isEmpty() ? StdString("") :  name_suffix.getValue()); 
    5758   } 
     59   CATCH 
    5860 
    5961   //---------------------------------------------------------------- 
     
    6567   */ 
    6668   std::shared_ptr<CDataOutput> CFile::getDataOutput(void) const 
     69   TRY 
    6770   { 
    6871      return data_out; 
    6972   } 
     73   CATCH 
    7074 
    7175   /*! 
     
    7680   */ 
    7781   std::shared_ptr<CDataInput> CFile::getDataInput(void) const 
     82   TRY 
    7883   { 
    7984      return data_in; 
    8085   } 
     86   CATCH 
    8187 
    8288   /*! 
     
    8894   */ 
    8995   CFieldGroup* CFile::getVirtualFieldGroup(void) const 
     96   TRY 
    9097   { 
    9198      return (this->vFieldGroup); 
    9299   } 
     100   CATCH 
    93101 
    94102   /*! 
     
    100108   */ 
    101109   CVariableGroup* CFile::getVirtualVariableGroup(void) const 
     110   TRY 
    102111   { 
    103112      return (this->vVariableGroup); 
    104113   } 
     114   CATCH 
    105115 
    106116   //! Get all fields of a file 
    107117   std::vector<CField*> CFile::getAllFields(void) const 
     118   TRY 
    108119   { 
    109120      return (this->vFieldGroup->getAllChildren()); 
    110121   } 
     122   CATCH 
    111123 
    112124   //! Get all variables of a file 
    113125   std::vector<CVariable*> CFile::getAllVariables(void) const 
     126   TRY 
    114127   { 
    115128      return (this->vVariableGroup->getAllChildren()); 
    116129   } 
     130   CATCH 
    117131 
    118132   //---------------------------------------------------------------- 
     
    129143                                                int default_level, 
    130144                                                bool default_enabled) 
     145   TRY 
    131146   { 
    132147      if (!this->enabledFields.empty()) 
     
    145160         { 
    146161            if (! (*it)->enabled.getValue()) continue; 
    147 //            { it--; this->enabledFields.erase(it+1); continue; } 
    148162         } 
    149163         else // Si l'attribut 'enabled' n'est pas dfini ... 
    150164         { 
    151165            if (!default_enabled) continue; 
    152 //            { it--; this->enabledFields.erase(it+1); continue; } 
    153166         } 
    154167 
     
    156169         { 
    157170            if ((*it)->level.getValue() > _outputlevel) continue; 
    158 //            { it--; this->enabledFields.erase(it+1); continue; } 
    159171         } 
    160172         else // Si l'attribut 'level' n'est pas dfini ... 
    161173         { 
    162174            if (default_level > _outputlevel) continue; 
    163 //            { it--; this->enabledFields.erase(it+1); continue; } 
    164175         } 
    165176 
    166 //         CField* field_tmp=(*it).get(); 
    167 //         shared_ptr<CField> sptfield=*it; 
    168 //         field_tmp->refObject.push_back(sptfield); 
    169177         newEnabledFields.push_back(*it); 
    170          // Le champ est finalement actif, on y ajoute sa propre reference. 
    171 //         (*it)->refObject.push_back(*it); 
    172178         // Le champ est finalement actif, on y ajoute la rfrence au champ de base. 
    173179         (*it)->setRelFile(CFile::get(this)); 
     
    177183      return (this->enabledFields); 
    178184   } 
     185   CATCH_DUMP_ATTR 
    179186 
    180187   //---------------------------------------------------------------- 
    181188   //! Change virtual field group to a new one 
    182189   void CFile::setVirtualFieldGroup(CFieldGroup* newVFieldGroup) 
     190   TRY 
    183191   { 
    184192      this->vFieldGroup = newVFieldGroup; 
    185193   } 
     194   CATCH_DUMP_ATTR 
    186195 
    187196   //! Change virtual variable group to new one 
    188197   void CFile::setVirtualVariableGroup(CVariableGroup* newVVariableGroup) 
     198   TRY 
    189199   { 
    190200      this->vVariableGroup = newVVariableGroup; 
    191201   } 
     202   CATCH_DUMP_ATTR 
    192203 
    193204   //---------------------------------------------------------------- 
    194205   bool CFile::isSyncTime(void) 
     206   TRY 
    195207   { 
    196208     CContext* context = CContext::getCurrent(); 
     
    206218      return false; 
    207219    } 
     220    CATCH_DUMP_ATTR 
    208221 
    209222   //! Initialize a file in order to write into it 
    210223   void CFile::initWrite(void) 
     224   TRY 
    211225   { 
    212226      CContext* context = CContext::getCurrent(); 
     
    261275      if (time_counter_name.isEmpty()) time_counter_name = "time_counter"; 
    262276    } 
     277    CATCH_DUMP_ATTR 
    263278 
    264279    //! Initialize a file in order to write into it 
    265280    void CFile::initRead(void) 
     281    TRY 
    266282    { 
    267283      if (checkRead) return; 
     
    269285      checkRead = true; 
    270286    } 
     287    CATCH_DUMP_ATTR 
    271288 
    272289    /*! 
     
    274291    */ 
    275292    void CFile::createSubComFile() 
     293    TRY 
    276294    { 
    277295      CContext* context = CContext::getCurrent(); 
     
    292310      if (allZoneEmpty) MPI_Comm_free(&fileComm); 
    293311    } 
     312    CATCH_DUMP_ATTR 
    294313 
    295314    /* 
     
    299318    */ 
    300319    void CFile::checkWriteFile(void) 
     320    TRY 
    301321    { 
    302322      CContext* context = CContext::getCurrent(); 
     
    315335      } 
    316336    } 
     337    CATCH_DUMP_ATTR 
    317338 
    318339    /* 
     
    323344    */ 
    324345    void CFile::checkReadFile(void) 
     346    TRY 
    325347    { 
    326348      CContext* context = CContext::getCurrent(); 
     
    340362      } 
    341363    } 
     364    CATCH_DUMP_ATTR 
    342365 
    343366    /*! 
     
    346369    */ 
    347370    bool CFile::isEmptyZone() 
     371    TRY 
    348372    { 
    349373      return allZoneEmpty; 
    350374    } 
     375    CATCH_DUMP_ATTR 
    351376 
    352377    /*! 
     
    357382    */ 
    358383   bool CFile::checkSync(void) 
     384   TRY 
    359385   { 
    360386     CContext* context = CContext::getCurrent(); 
     
    371397      return false; 
    372398    } 
     399   CATCH_DUMP_ATTR 
    373400 
    374401    /*! 
     
    379406    */ 
    380407    bool CFile::checkSplit(void) 
     408    TRY 
    381409    { 
    382410      CContext* context = CContext::getCurrent(); 
     
    402430      return false; 
    403431    } 
     432    CATCH_DUMP_ATTR 
    404433 
    405434   /*! 
     
    408437   */ 
    409438   void CFile::createHeader(void) 
     439   TRY 
    410440   { 
    411441      CContext* context = CContext::getCurrent(); 
     
    594624      } 
    595625   } 
     626   CATCH_DUMP_ATTR 
    596627 
    597628  /*! 
     
    599630  */ 
    600631  void CFile::openInReadMode() 
     632  TRY 
    601633  { 
    602634    CContext* context = CContext::getCurrent(); 
     
    675707    } 
    676708  } 
     709  CATCH_DUMP_ATTR 
    677710 
    678711   //! Close file 
    679712   void CFile::close(void) 
     713   TRY 
    680714   { 
    681715     if (!allZoneEmpty) 
     
    690724      if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm); 
    691725   } 
     726   CATCH_DUMP_ATTR 
     727 
    692728   //---------------------------------------------------------------- 
    693729 
    694730   void CFile::readAttributesOfEnabledFieldsInReadMode() 
     731   TRY 
    695732   { 
    696733     if (enabledFields.empty()) return; 
     
    722759     close(); 
    723760   } 
    724  
     761   CATCH_DUMP_ATTR 
    725762 
    726763   /*! 
     
    729766   */ 
    730767   void CFile::parse(xml::CXMLNode & node) 
     768   TRY 
    731769   { 
    732770      SuperClass::parse(node); 
     
    741779        node.goToParentElement(); 
    742780      } 
    743  
    744    } 
     781   } 
     782   CATCH_DUMP_ATTR 
     783 
    745784   //---------------------------------------------------------------- 
    746785 
     
    750789   */ 
    751790   StdString CFile::toString(void) const 
     791   TRY 
    752792   { 
    753793      StdOStringStream oss; 
     
    762802      return (oss.str()); 
    763803   } 
     804   CATCH 
    764805 
    765806   //---------------------------------------------------------------- 
     
    772813   */ 
    773814   void CFile::solveDescInheritance(bool apply, const CAttributeMap * const parent) 
     815   TRY 
    774816   { 
    775817      SuperClassAttribute::setAttributes(parent,apply); 
     
    777819      this->getVirtualVariableGroup()->solveDescInheritance(apply, NULL); 
    778820   } 
     821   CATCH_DUMP_ATTR 
    779822 
    780823   //---------------------------------------------------------------- 
     
    789832   */ 
    790833   void CFile::solveOnlyRefOfEnabledFields(bool sendToServer) 
     834   TRY 
    791835   { 
    792836     int size = this->enabledFields.size(); 
     
    796840     } 
    797841   } 
     842   CATCH_DUMP_ATTR 
    798843 
    799844   void CFile::checkGridOfEnabledFields() 
     845   TRY 
    800846   {  
    801847     int size = this->enabledFields.size(); 
     
    805851     } 
    806852   } 
     853   CATCH_DUMP_ATTR 
    807854 
    808855   void CFile::sendGridComponentOfEnabledFields() 
     856   TRY 
    809857   {  
    810858     int size = this->enabledFields.size(); 
     
    814862     } 
    815863   } 
     864   CATCH_DUMP_ATTR 
    816865 
    817866   /*! 
     
    820869   */ 
    821870   void CFile::sortEnabledFieldsForUgrid() 
     871   TRY 
    822872   { 
    823873     int size = this->enabledFields.size(); 
     
    868918     } 
    869919   } 
     920   CATCH_DUMP_ATTR 
    870921 
    871922   void CFile::sendGridOfEnabledFields() 
     923   TRY 
    872924   {  
    873925     int size = this->enabledFields.size(); 
     
    877929     } 
    878930   } 
     931   CATCH_DUMP_ATTR 
    879932 
    880933   void CFile::generateNewTransformationGridDest() 
     934   TRY 
    881935   { 
    882936     int size = this->enabledFields.size(); 
     
    886940     } 
    887941   } 
     942   CATCH_DUMP_ATTR 
    888943 
    889944   /*! 
     
    896951   */ 
    897952   void CFile::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer) 
     953   TRY 
    898954   { 
    899955     int size = this->enabledFields.size(); 
     
    903959     } 
    904960   } 
     961   CATCH_DUMP_ATTR 
    905962 
    906963   /*! 
     
    910967    */ 
    911968   void CFile::buildFilterGraphOfEnabledFields(CGarbageCollector& gc) 
     969   TRY 
    912970   { 
    913971     int size = this->enabledFields.size(); 
     
    917975     } 
    918976   } 
     977   CATCH_DUMP_ATTR 
    919978 
    920979   /*! 
     
    922981    */ 
    923982   void CFile::postProcessFilterGraph() 
     983   TRY 
    924984   { 
    925985     int size = this->enabledFields.size(); 
     
    929989     } 
    930990   } 
     991   CATCH_DUMP_ATTR 
    931992 
    932993   /*! 
     
    934995   */ 
    935996   void CFile::prefetchEnabledReadModeFields(void) 
     997   TRY 
    936998   { 
    937999     if (mode.isEmpty() || mode.getValue() != mode_attr::read) 
     
    9421004       this->enabledFields[i]->sendReadDataRequest(CContext::getCurrent()->getCalendar()->getCurrentDate()); 
    9431005   } 
     1006   CATCH_DUMP_ATTR 
    9441007 
    9451008   /*! 
     
    9491012   */ 
    9501013   void CFile::doPreTimestepOperationsForEnabledReadModeFields(void) 
     1014   TRY 
    9511015   { 
    9521016     if (mode.isEmpty() || mode.getValue() != mode_attr::read) 
     
    9601024     } 
    9611025   } 
     1026   CATCH_DUMP_ATTR 
    9621027 
    9631028   /*! 
     
    9661031   */ 
    9671032   void CFile::doPostTimestepOperationsForEnabledReadModeFields(void) 
     1033   TRY 
    9681034   { 
    9691035     if (mode.isEmpty() || mode.getValue() != mode_attr::read) 
     
    9761042     } 
    9771043   } 
     1044   CATCH_DUMP_ATTR 
    9781045 
    9791046   void CFile::solveFieldRefInheritance(bool apply) 
     1047   TRY 
    9801048   { 
    9811049      // Rsolution des hritages par rfrence de chacun des champs contenus dans le fichier. 
     
    9841052         allF[i]->solveRefInheritance(apply); 
    9851053   } 
     1054   CATCH_DUMP_ATTR 
    9861055 
    9871056   //---------------------------------------------------------------- 
     
    9961065   */ 
    9971066   CField* CFile::addField(const string& id) 
     1067   TRY 
    9981068   { 
    9991069     return vFieldGroup->createChild(id); 
    10001070   } 
     1071   CATCH_DUMP_ATTR 
    10011072 
    10021073   /*! 
     
    10081079   */ 
    10091080   CFieldGroup* CFile::addFieldGroup(const string& id) 
     1081   TRY 
    10101082   { 
    10111083     return vFieldGroup->createChildGroup(id); 
    10121084   } 
     1085   CATCH_DUMP_ATTR 
    10131086 
    10141087   /*! 
     
    10231096   */ 
    10241097   CVariable* CFile::addVariable(const string& id) 
     1098   TRY 
    10251099   { 
    10261100     return vVariableGroup->createChild(id); 
    10271101   } 
     1102   CATCH_DUMP_ATTR 
    10281103 
    10291104   /*! 
     
    10351110   */ 
    10361111   CVariableGroup* CFile::addVariableGroup(const string& id) 
     1112   TRY 
    10371113   { 
    10381114     return vVariableGroup->createChildGroup(id); 
    10391115   } 
     1116   CATCH_DUMP_ATTR 
    10401117 
    10411118   void CFile::setContextClient(CContextClient* newContextClient) 
     1119   TRY 
    10421120   { 
    10431121     client = newContextClient; 
     
    10481126     } 
    10491127   } 
     1128   CATCH_DUMP_ATTR 
    10501129 
    10511130   CContextClient* CFile::getContextClient() 
     1131   TRY 
    10521132   { 
    10531133     return client; 
    10541134   } 
     1135   CATCH_DUMP_ATTR 
    10551136 
    10561137   void CFile::setReadContextClient(CContextClient* readContextclient) 
     1138   TRY 
    10571139   { 
    10581140     read_client = readContextclient; 
    10591141   } 
     1142   CATCH_DUMP_ATTR 
    10601143 
    10611144   CContextClient* CFile::getReadContextClient() 
     1145   TRY 
    10621146   { 
    10631147     return read_client; 
    10641148   } 
     1149   CATCH_DUMP_ATTR 
    10651150 
    10661151   /*! 
     
    10691154   */ 
    10701155   void CFile::sendAddField(const string& id, CContextClient* client) 
     1156   TRY 
    10711157   { 
    10721158      sendAddItem(id, EVENT_ID_ADD_FIELD, client); 
    10731159   } 
     1160   CATCH_DUMP_ATTR 
    10741161 
    10751162   /*! 
     
    10781165   */ 
    10791166   void CFile::sendAddFieldGroup(const string& id, CContextClient* client) 
     1167   TRY 
    10801168   { 
    10811169      sendAddItem(id, (int)EVENT_ID_ADD_FIELD_GROUP, client); 
    10821170   } 
     1171   CATCH_DUMP_ATTR 
    10831172 
    10841173   /*! 
     
    10871176   */ 
    10881177   void CFile::recvAddField(CEventServer& event) 
     1178   TRY 
    10891179   { 
    10901180 
     
    10941184      get(id)->recvAddField(*buffer); 
    10951185   } 
     1186   CATCH 
    10961187 
    10971188   /*! 
     
    11001191   */ 
    11011192   void CFile::recvAddField(CBufferIn& buffer) 
     1193   TRY 
    11021194   { 
    11031195      string id; 
     
    11051197      addField(id); 
    11061198   } 
     1199   CATCH_DUMP_ATTR 
    11071200 
    11081201   /*! 
     
    11111204   */ 
    11121205   void CFile::recvAddFieldGroup(CEventServer& event) 
     1206   TRY 
    11131207   { 
    11141208 
     
    11181212      get(id)->recvAddFieldGroup(*buffer); 
    11191213   } 
     1214   CATCH 
    11201215 
    11211216   /*! 
     
    11241219   */ 
    11251220   void CFile::recvAddFieldGroup(CBufferIn& buffer) 
     1221   TRY 
    11261222   { 
    11271223      string id; 
     
    11291225      addFieldGroup(id); 
    11301226   } 
     1227   CATCH_DUMP_ATTR 
    11311228 
    11321229   /*! 
     
    11371234   */ 
    11381235   void CFile::sendAddAllVariables(CContextClient* client) 
     1236   TRY 
    11391237   { 
    11401238     std::vector<CVariable*> allVar = getAllVariables(); 
     
    11491247     } 
    11501248   } 
     1249   CATCH_DUMP_ATTR 
    11511250 
    11521251   /*! 
     
    11561255   */ 
    11571256   void CFile::sendAddVariableGroup(const string& id, CContextClient* client) 
     1257   TRY 
    11581258   { 
    11591259      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP, client); 
    11601260   } 
     1261   CATCH_DUMP_ATTR 
    11611262 
    11621263   /* 
     
    11661267   */ 
    11671268   void CFile::sendAddVariable(const string& id, CContextClient* client) 
     1269   TRY 
    11681270   { 
    11691271      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client); 
    11701272   } 
     1273   CATCH_DUMP_ATTR 
    11711274 
    11721275   /*! 
     
    11751278   */ 
    11761279   void CFile::recvAddVariable(CEventServer& event) 
    1177    { 
    1178  
     1280   TRY 
     1281   { 
    11791282      CBufferIn* buffer = event.subEvents.begin()->buffer; 
    11801283      string id; 
     
    11821285      get(id)->recvAddVariable(*buffer); 
    11831286   } 
     1287   CATCH 
    11841288 
    11851289   /*! 
     
    11881292   */ 
    11891293   void CFile::recvAddVariable(CBufferIn& buffer) 
     1294   TRY 
    11901295   { 
    11911296      string id; 
     
    11931298      addVariable(id); 
    11941299   } 
     1300   CATCH_DUMP_ATTR 
    11951301 
    11961302   /*! 
     
    11991305   */ 
    12001306   void CFile::recvAddVariableGroup(CEventServer& event) 
     1307   TRY 
    12011308   { 
    12021309 
     
    12061313      get(id)->recvAddVariableGroup(*buffer); 
    12071314   } 
     1315   CATCH 
    12081316 
    12091317   /*! 
     
    12121320   */ 
    12131321   void CFile::recvAddVariableGroup(CBufferIn& buffer) 
     1322   TRY 
    12141323   { 
    12151324      string id; 
     
    12171326      addVariableGroup(id); 
    12181327   } 
     1328   CATCH_DUMP_ATTR 
    12191329 
    12201330   /*! 
     
    12261336   */ 
    12271337   void CFile::sendEnabledFields(CContextClient* client) 
     1338   TRY 
    12281339   { 
    12291340     size_t size = this->enabledFields.size(); 
     
    12371348     } 
    12381349   } 
    1239  
     1350   CATCH_DUMP_ATTR 
    12401351 
    12411352   /*! 
     
    12471358   */ 
    12481359   bool CFile::dispatchEvent(CEventServer& event) 
     1360   TRY 
    12491361   { 
    12501362      if (SuperClass::dispatchEvent(event)) return true; 
     
    12781390      } 
    12791391   } 
    1280  
    1281  
    1282  
     1392   CATCH 
     1393 
     1394   ///-------------------------------------------------------------- 
     1395   /*! 
     1396   */ 
     1397   StdString CFile::dumpClassAttributes(void) 
     1398   { 
     1399     StdString str; 
     1400     CContext* context = CContext::getCurrent(); 
     1401     str.append("context=\""); 
     1402     str.append(context->getId()); 
     1403     str.append("\""); 
     1404     str.append(" enabled fields=\""); 
     1405     int size = this->enabledFields.size(); 
     1406     for (int i = 0; i < size; ++i) 
     1407     { 
     1408       str.append(this->enabledFields[i]->getId()); 
     1409       str.append(" "); 
     1410     } 
     1411     str.append("\""); 
     1412     return str; 
     1413   } 
    12831414 
    12841415   ///--------------------------------------------------------------- 
  • XIOS/trunk/src/node/file.hpp

    r1542 r1622  
    8181                                                int default_level = 1, 
    8282                                                bool default_enabled = true); 
     83 
     84         StdString dumpClassAttributes(void); 
    8385 
    8486      public : 
  • XIOS/trunk/src/node/grid.cpp

    r1562 r1622  
    8282 
    8383   StdSize CGrid::getDimension(void) 
     84   TRY 
    8485   { 
    8586      return getGlobalDimension().size(); 
    8687   } 
     88   CATCH_DUMP_ATTR 
    8789 
    8890   //--------------------------------------------------------------- 
    8991 
    9092   StdSize CGrid::getDataSize(void) const 
     93   TRY 
    9194   { 
    9295     StdSize retvalue = 1; 
     
    98101     return retvalue; 
    99102   } 
     103   CATCH 
    100104 
    101105   /*! 
     
    106110    */ 
    107111   std::map<int, StdSize> CGrid::getAttributesBufferSize(CContextClient* client, bool bufferForWriting) 
     112   TRY 
    108113   { 
    109114     std::map<int, StdSize> attributesSizes = getMinimumBufferSizeForAttributes(client); 
     
    147152     return attributesSizes; 
    148153  } 
     154   CATCH_DUMP_ATTR 
    149155 
    150156   /*! 
     
    156162    */ 
    157163   std::map<int, StdSize> CGrid::getDataBufferSize(CContextClient* client, const std::string& id /*= ""*/, bool bufferForWriting /*= "false"*/) 
     164   TRY 
    158165   {      
    159166     // The record index is sometimes sent along with the data but we always 
     
    180187     return dataSizes; 
    181188   } 
     189   CATCH_DUMP_ATTR 
    182190 
    183191   size_t CGrid::getGlobalWrittenSize(void) 
     192   TRY 
    184193   { 
    185194         std::vector<CDomain*> domainP = this->getDomains(); 
     
    191200     return globalGridSize ; 
    192201   } 
    193     
     202   CATCH_DUMP_ATTR 
    194203    
    195204   void CGrid::checkAttributesAfterTransformation() 
     205   TRY 
    196206   { 
    197207      setAxisList(); 
     
    228238      } 
    229239   } 
     240   CATCH_DUMP_ATTR 
    230241 
    231242   //--------------------------------------------------------------- 
     
    237248    */ 
    238249   bool CGrid::isCompressible(void) const 
     250   TRY 
    239251   { 
    240252      return isCompressible_; 
    241253   } 
     254   CATCH 
    242255 
    243256   //--------------------------------------------------------------- 
    244257 
    245258   void CGrid::addRelFileCompressed(const StdString& filename) 
     259   TRY 
    246260   { 
    247261      this->relFilesCompressed.insert(filename); 
    248262   } 
     263   CATCH_DUMP_ATTR 
    249264 
    250265   bool CGrid::isWrittenCompressed(const StdString& filename) const 
     266   TRY 
    251267   { 
    252268      return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 
    253269   } 
     270   CATCH 
    254271 
    255272   //--------------------------------------------------------------- 
     
    258275   */ 
    259276   void CGrid::solveDomainAxisRef(bool areAttributesChecked) 
     277   TRY 
    260278   { 
    261279     if (this->isDomainAxisChecked) return; 
     
    266284     this->isDomainAxisChecked = areAttributesChecked; 
    267285   } 
     286   CATCH_DUMP_ATTR 
    268287 
    269288   /* 
     
    272291   */ 
    273292   void CGrid::solveDomainAxisBaseRef() 
     293   TRY 
    274294   { 
    275295     if (this->hasDomainAxisBaseRef_) return; 
     
    297317     this->hasDomainAxisBaseRef_ = true; 
    298318   } 
     319   CATCH_DUMP_ATTR 
    299320 
    300321   void CGrid::checkEligibilityForCompressedOutput() 
     322   TRY 
    301323   { 
    302324     // We don't check if the mask is valid here, just if a mask has been defined at this point. 
    303325     isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !mask_3d.isEmpty(); 
    304326   } 
     327   CATCH_DUMP_ATTR 
    305328 
    306329   void CGrid::checkMaskIndex(bool doSendingIndex) 
     330   TRY 
    307331   { 
    308332     CContext* context = CContext::getCurrent(); 
     
    339363      this->isChecked = true; 
    340364   } 
     365   CATCH_DUMP_ATTR 
    341366 
    342367   /* 
     
    344369   */ 
    345370   void CGrid::createMask(void) 
     371   TRY 
    346372   { 
    347373      using namespace std; 
     
    381407      } 
    382408   } 
     409   CATCH_DUMP_ATTR 
    383410 
    384411   /* 
     
    386413   */ 
    387414   void CGrid::checkMask(void) 
     415   TRY 
    388416   { 
    389417      using namespace std; 
     
    423451      } 
    424452   } 
    425  
     453   CATCH_DUMP_ATTR 
    426454 
    427455/*! 
     
    433461 
    434462  void CGrid::getLocalMask(CArray<bool,1>& localMask) 
     463  TRY 
    435464  { 
    436465      std::vector<CDomain*> domainP = this->getDomains(); 
     
    468497      } 
    469498  } 
     499  CATCH_DUMP_ATTR 
    470500       
    471501   /* 
     
    476506   */ 
    477507   void CGrid::modifyMask(const CArray<int,1>& indexToModify, bool modifyValue) 
     508   TRY 
    478509   { 
    479510      using namespace std; 
     
    511542      } 
    512543   } 
     544   CATCH_DUMP_ATTR 
    513545 
    514546   /* 
     
    518550   */ 
    519551   void CGrid::modifyMaskSize(const std::vector<int>& newDimensionSize, bool newValue) 
     552   TRY 
    520553   {       
    521554      std::vector<CDomain*> domainP = this->getDomains(); 
     
    552585      } 
    553586   } 
     587   CATCH_DUMP_ATTR 
    554588 
    555589   //--------------------------------------------------------------- 
    556590 
    557591   void CGrid::solveDomainRef(bool sendAtt) 
     592   TRY 
    558593   { 
    559594      setDomainList(); 
     
    568603      } 
    569604   } 
     605   CATCH_DUMP_ATTR 
    570606 
    571607   //--------------------------------------------------------------- 
    572608 
    573609   void CGrid::solveAxisRef(bool sendAtt) 
     610   TRY 
    574611   { 
    575612      setAxisList(); 
     
    599636      } 
    600637   } 
     638   CATCH_DUMP_ATTR 
    601639 
    602640   //--------------------------------------------------------------- 
    603641 
    604642   void CGrid::solveScalarRef(bool sendAtt) 
     643   TRY 
    605644   { 
    606645      setScalarList(); 
     
    616655      } 
    617656   } 
     657   CATCH_DUMP_ATTR 
    618658 
    619659   /*! 
     
    621661   */ 
    622662   void CGrid::computeWrittenIndex() 
     663   TRY 
    623664   {       
    624665      if (computedWrittenIndex_) return; 
     
    680721      } 
    681722   } 
     723   CATCH_DUMP_ATTR 
    682724 
    683725   //--------------------------------------------------------------- 
     
    690732   */ 
    691733   void CGrid::computeClientIndex() 
     734   TRY 
    692735   { 
    693736     CContext* context = CContext::getCurrent(); 
     
    746789      } 
    747790   } 
     791   CATCH_DUMP_ATTR 
    748792 
    749793   /*! 
     
    751795   */ 
    752796   void CGrid::computeConnectedClients() 
     797   TRY 
    753798   { 
    754799     CContext* context = CContext::getCurrent(); 
     
    844889     } 
    845890   } 
     891   CATCH_DUMP_ATTR 
    846892 
    847893   /*! 
     
    853899   */ 
    854900   void CGrid::computeIndex(void) 
     901   TRY 
    855902   { 
    856903     CContext* context = CContext::getCurrent(); 
     
    879926     } 
    880927   } 
     928   CATCH_DUMP_ATTR 
    881929 
    882930   /*! 
     
    892940                                     const CContextClient* client, 
    893941                                     CClientServerMapping::GlobalIndexMap& globalIndexOnServer) 
     942   TRY 
    894943   { 
    895944     int serverSize = client->serverSize; 
     
    10581107    } 
    10591108   } 
    1060    //---------------------------------------------------------------- 
     1109   CATCH_DUMP_ATTR 
     1110//---------------------------------------------------------------- 
    10611111 
    10621112   CGrid* CGrid::createGrid(CDomain* domain) 
     1113   TRY 
    10631114   { 
    10641115      std::vector<CDomain*> vecDom(1, domain); 
     
    10671118      return createGrid(vecDom, vecAxis); 
    10681119   } 
     1120   CATCH 
    10691121 
    10701122   CGrid* CGrid::createGrid(CDomain* domain, CAxis* axis) 
    1071    { 
     1123   TRY 
     1124  { 
    10721125      std::vector<CDomain*> vecDom(1, domain); 
    10731126      std::vector<CAxis*> vecAxis(1, axis); 
     
    10751128      return createGrid(vecDom, vecAxis); 
    10761129   } 
     1130   CATCH 
    10771131 
    10781132   CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10791133                            const CArray<int,1>& axisDomainOrder) 
     1134   TRY 
    10801135   { 
    10811136     std::vector<CScalar*> vecScalar; 
    10821137     return createGrid(generateId(domains, axis, vecScalar, axisDomainOrder), domains, axis, vecScalar, axisDomainOrder); 
    10831138   } 
     1139   CATCH 
    10841140 
    10851141   CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10861142                            const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1143   TRY 
    10871144   { 
    10881145     return createGrid(generateId(domains, axis, scalars, axisDomainOrder), domains, axis, scalars, axisDomainOrder); 
    10891146   } 
     1147   CATCH 
    10901148 
    10911149   CGrid* CGrid::createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10921150                            const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1151   TRY 
    10931152   { 
    10941153      if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size())) 
     
    11321191      return grid; 
    11331192   } 
     1193   CATCH 
    11341194 
    11351195   CGrid* CGrid::cloneGrid(const StdString& idNewGrid, CGrid* gridSrc) 
     1196   TRY 
    11361197   { 
    11371198     std::vector<CDomain*> domainSrcTmp = gridSrc->getDomains(), domainSrc; 
     
    11731234      return grid; 
    11741235   } 
     1236   CATCH 
    11751237 
    11761238   StdString CGrid::generateId(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    11771239                               const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1240   TRY 
    11781241   { 
    11791242      if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size())) 
     
    12161279      return id.str(); 
    12171280   } 
     1281   CATCH 
    12181282 
    12191283   StdString CGrid::generateId(const CGrid* gridSrc, const CGrid* gridDest) 
     1284   TRY 
    12201285   { 
    12211286     StdString idSrc  = gridSrc->getId(); 
     
    12271292     return id.str(); 
    12281293   } 
     1294   CATCH 
    12291295 
    12301296   //---------------------------------------------------------------- 
    12311297 
    12321298   CDomainGroup* CGrid::getVirtualDomainGroup() const 
     1299   TRY 
    12331300   { 
    12341301     return this->vDomainGroup_; 
    12351302   } 
     1303   CATCH 
    12361304 
    12371305   CAxisGroup* CGrid::getVirtualAxisGroup() const 
     1306   TRY 
    12381307   { 
    12391308     return this->vAxisGroup_; 
    12401309   } 
     1310   CATCH 
    12411311 
    12421312   CScalarGroup* CGrid::getVirtualScalarGroup() const 
     1313   TRY 
    12431314   { 
    12441315     return this->vScalarGroup_; 
    12451316   } 
     1317   CATCH 
    12461318 
    12471319/* 
     
    12791351 
    12801352   void CGrid::storeField_arr(const double* const data, CArray<double, 1>& stored) const 
     1353   TRY 
    12811354   { 
    12821355      const StdSize size = storeIndex_client.numElements(); 
     
    12851358      for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)]; 
    12861359   } 
     1360   CATCH 
    12871361 
    12881362   void CGrid::restoreField_arr(const CArray<double, 1>& stored, double* const data) const 
     1363   TRY 
    12891364   { 
    12901365      const StdSize size = storeIndex_client.numElements(); 
     
    12921367      for(StdSize i = 0; i < size; i++) data[storeIndex_client(i)] = stored(i); 
    12931368   } 
     1369   CATCH 
    12941370 
    12951371   void CGrid::uncompressField_arr(const double* const data, CArray<double, 1>& out) const 
     1372   TRY 
    12961373   { 
    12971374      const std::vector<int>& localMaskedDataIndex = clientDistribution_->getLocalMaskedDataIndexOnClient(); 
     
    12991376      for(int i = 0; i < size; ++i) out(localMaskedDataIndex[i]) = data[i]; 
    13001377   } 
    1301  
     1378   CATCH 
    13021379 
    13031380  void CGrid::computeClientIndexScalarGrid() 
     1381  TRY 
    13041382  { 
    13051383    CContext* context = CContext::getCurrent();     
     
    13351413    } 
    13361414  } 
     1415  CATCH_DUMP_ATTR 
    13371416 
    13381417  void CGrid::computeConnectedClientsScalarGrid() 
     1418  TRY 
    13391419  { 
    13401420    CContext* context = CContext::getCurrent();     
     
    13811461    } 
    13821462  } 
     1463  CATCH_DUMP_ATTR 
    13831464 
    13841465  void CGrid::sendIndexScalarGrid() 
     1466  TRY 
    13851467  { 
    13861468    CContext* context = CContext::getCurrent(); 
     
    14461528    } 
    14471529  } 
     1530  CATCH_DUMP_ATTR 
    14481531 
    14491532  void CGrid::sendIndex(void) 
     1533  TRY 
    14501534  { 
    14511535    CContext* context = CContext::getCurrent(); 
     
    15671651    } 
    15681652  } 
     1653  CATCH_DUMP_ATTR 
    15691654 
    15701655  void CGrid::recvIndex(CEventServer& event) 
     1656  TRY 
    15711657  { 
    15721658    string gridId; 
     
    15841670    get(gridId)->recvIndex(ranks, buffers); 
    15851671  } 
     1672  CATCH 
    15861673 
    15871674  void CGrid::recvIndex(vector<int> ranks, vector<CBufferIn*> buffers) 
     1675  TRY 
    15881676  { 
    15891677    CContext* context = CContext::getCurrent(); 
     
    17911879    } 
    17921880  } 
     1881  CATCH_DUMP_ATTR 
    17931882 
    17941883  /* 
     
    18061895                                        const std::vector<CScalar*> scalars, 
    18071896                                        const CArray<int,1>& axisDomainOrder) 
    1808   { 
     1897  TRY 
     1898 { 
    18091899 //   globalDim.resize(domains.size()*2+axis.size()+scalars.size()); 
    18101900    globalDim.resize(domains.size()*2+axis.size()); 
     
    18461936    return positionDimensionDistributed; 
    18471937  } 
     1938  CATCH_DUMP_ATTR 
    18481939 
    18491940  // Retrieve the global dimension of grid 
    18501941  std::vector<int> CGrid::getGlobalDimension() 
     1942  TRY 
    18511943  { 
    18521944    std::vector<int> globalDim; 
     
    18551947    return globalDim; 
    18561948  } 
     1949  CATCH_DUMP_ATTR 
    18571950 
    18581951  // Retrieve dimension on which we do distribution (Very often, it should be 2nd dimension) 
    18591952  int CGrid::getDistributedDimension() 
     1953  TRY 
    18601954  { 
    18611955    std::vector<int> globalDim; 
    18621956    return computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order);     
    18631957  } 
     1958  CATCH_DUMP_ATTR 
    18641959 
    18651960  bool CGrid::isScalarGrid() const 
     1961  TRY 
    18661962  { 
    18671963    return (axisList_.empty() && domList_.empty()); 
    18681964  } 
     1965  CATCH 
    18691966 
    18701967  /*! 
     
    18741971  */ 
    18751972  bool CGrid::doGridHaveDataToWrite() 
     1973  TRY 
    18761974  { 
    18771975     return (0 != writtenDataSize_); 
    18781976  } 
     1977  CATCH_DUMP_ATTR 
    18791978 
    18801979  /*! 
     
    18851984  */ 
    18861985  size_t CGrid::getWrittenDataSize() const 
     1986  TRY 
    18871987  { 
    18881988    return writtenDataSize_; 
    18891989  } 
     1990  CATCH 
    18901991 
    18911992  /*! 
     
    18941995  */ 
    18951996  int CGrid::getNumberWrittenIndexes() const 
     1997  TRY 
    18961998  { 
    18971999    return numberWrittenIndexes_; 
    18982000  } 
     2001  CATCH 
    18992002 
    19002003  /*! 
     
    19032006  */ 
    19042007  int CGrid::getTotalNumberWrittenIndexes() const 
     2008  TRY 
    19052009  { 
    19062010    return totalNumberWrittenIndexes_; 
    19072011  } 
     2012  CATCH 
    19082013 
    19092014  /*! 
     
    19122017  */ 
    19132018  int CGrid::getOffsetWrittenIndexes() const 
     2019  TRY 
    19142020  { 
    19152021    return offsetWrittenIndexes_; 
    19162022  } 
     2023  CATCH 
    19172024 
    19182025  CDistributionServer* CGrid::getDistributionServer() 
     2026  TRY 
    19192027  { 
    19202028    return serverDistribution_; 
    19212029  } 
     2030  CATCH_DUMP_ATTR 
    19222031 
    19232032  CDistributionClient* CGrid::getDistributionClient() 
     2033  TRY 
    19242034  { 
    19252035    return clientDistribution_; 
    19262036  } 
     2037  CATCH_DUMP_ATTR 
    19272038 
    19282039  bool CGrid::doGridHaveDataDistributed(CContextClient* client) 
     2040  TRY 
    19292041  { 
    19302042    if (isScalarGrid()) return false; 
     
    19362048      return isDataDistributed_;     
    19372049  } 
     2050  CATCH_DUMP_ATTR 
    19382051 
    19392052   /*! 
     
    19452058   */ 
    19462059  bool CGrid::dispatchEvent(CEventServer& event) 
     2060  TRY 
    19472061  { 
    19482062 
     
    19782092    } 
    19792093  } 
     2094  CATCH 
    19802095 
    19812096   ///--------------------------------------------------------------- 
    19822097 
    19832098   CDomain* CGrid::addDomain(const std::string& id) 
     2099   TRY 
    19842100   { 
    19852101     order_.push_back(2); 
     
    19882104     return vDomainGroup_->createChild(id); 
    19892105   } 
     2106   CATCH_DUMP_ATTR 
    19902107 
    19912108   CAxis* CGrid::addAxis(const std::string& id) 
     2109   TRY 
    19922110   { 
    19932111     order_.push_back(1); 
     
    19962114     return vAxisGroup_->createChild(id); 
    19972115   } 
     2116   CATCH_DUMP_ATTR 
    19982117 
    19992118   CScalar* CGrid::addScalar(const std::string& id) 
     2119   TRY 
    20002120   { 
    20012121     order_.push_back(0); 
     
    20042124     return vScalarGroup_->createChild(id); 
    20052125   } 
     2126   CATCH_DUMP_ATTR 
    20062127 
    20072128   //! Change virtual field group to a new one 
    20082129   void CGrid::setVirtualDomainGroup(CDomainGroup* newVDomainGroup) 
     2130   TRY 
    20092131   { 
    20102132      this->vDomainGroup_ = newVDomainGroup; 
    20112133   } 
     2134   CATCH_DUMP_ATTR 
    20122135 
    20132136   //! Change virtual variable group to new one 
    20142137   void CGrid::setVirtualAxisGroup(CAxisGroup* newVAxisGroup) 
     2138   TRY 
    20152139   { 
    20162140      this->vAxisGroup_ = newVAxisGroup; 
    20172141   } 
     2142   CATCH_DUMP_ATTR 
    20182143 
    20192144   //! Change virtual variable group to new one 
    20202145   void CGrid::setVirtualScalarGroup(CScalarGroup* newVScalarGroup) 
     2146   TRY 
    20212147   { 
    20222148      this->vScalarGroup_ = newVScalarGroup; 
    20232149   } 
     2150   CATCH_DUMP_ATTR 
    20242151 
    20252152   /*! 
     
    20282155   */ 
    20292156   void CGrid::sendAddDomain(const string& id) 
    2030    { 
     2157   TRY 
     2158  { 
    20312159      sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN); 
    20322160   } 
     2161   CATCH_DUMP_ATTR 
    20332162 
    20342163   /*! 
     
    20372166   */ 
    20382167   void CGrid::sendAddAxis(const string& id) 
     2168   TRY 
    20392169   { 
    20402170      sendAddItem(id, (int)EVENT_ID_ADD_AXIS); 
    20412171   } 
     2172   CATCH_DUMP_ATTR 
    20422173 
    20432174   /*! 
     
    20462177   */ 
    20472178   void CGrid::sendAddScalar(const string& id) 
     2179   TRY 
    20482180   { 
    20492181      sendAddItem(id, (int)EVENT_ID_ADD_SCALAR); 
    20502182   } 
     2183   CATCH_DUMP_ATTR 
    20512184 
    20522185   /*! 
     
    20552188   */ 
    20562189   void CGrid::recvAddDomain(CEventServer& event) 
     2190   TRY 
    20572191   { 
    20582192 
     
    20622196      get(id)->recvAddDomain(*buffer); 
    20632197   } 
     2198   CATCH 
    20642199 
    20652200   /*! 
     
    20682203   */ 
    20692204   void CGrid::recvAddDomain(CBufferIn& buffer) 
     2205   TRY 
    20702206   { 
    20712207      string id; 
     
    20732209      addDomain(id); 
    20742210   } 
     2211   CATCH_DUMP_ATTR 
    20752212 
    20762213   /*! 
     
    20792216   */ 
    20802217   void CGrid::recvAddAxis(CEventServer& event) 
     2218   TRY 
    20812219   { 
    20822220 
     
    20862224      get(id)->recvAddAxis(*buffer); 
    20872225   } 
     2226   CATCH 
    20882227 
    20892228   /*! 
     
    20922231   */ 
    20932232   void CGrid::recvAddAxis(CBufferIn& buffer) 
     2233   TRY 
    20942234   { 
    20952235      string id; 
     
    20972237      addAxis(id); 
    20982238   } 
     2239   CATCH_DUMP_ATTR 
    20992240 
    21002241   /*! 
     
    21032244   */ 
    21042245   void CGrid::recvAddScalar(CEventServer& event) 
     2246   TRY 
    21052247   { 
    21062248 
     
    21102252      get(id)->recvAddScalar(*buffer); 
    21112253   } 
     2254   CATCH 
    21122255 
    21132256   /*! 
     
    21162259   */ 
    21172260   void CGrid::recvAddScalar(CBufferIn& buffer) 
     2261   TRY 
    21182262   { 
    21192263      string id; 
     
    21212265      addScalar(id); 
    21222266   } 
     2267   CATCH_DUMP_ATTR 
    21232268 
    21242269  /*! 
     
    21292274  */ 
    21302275  void CGrid::solveDomainAxisRefInheritance(bool apply) 
     2276  TRY 
    21312277  { 
    21322278    CContext* context = CContext::getCurrent(); 
     
    21692315    } 
    21702316  } 
     2317  CATCH_DUMP_ATTR 
    21712318 
    21722319  bool CGrid::isTransformed() 
     2320  TRY 
    21732321  { 
    21742322    return isTransformed_; 
    21752323  } 
     2324  CATCH_DUMP_ATTR 
    21762325 
    21772326  void CGrid::setTransformed() 
     2327  TRY 
    21782328  { 
    21792329    isTransformed_ = true; 
    21802330  } 
     2331  CATCH_DUMP_ATTR 
    21812332 
    21822333  CGridTransformation* CGrid::getTransformations() 
     2334  TRY 
    21832335  { 
    21842336    return transformations_; 
    21852337  } 
     2338  CATCH_DUMP_ATTR 
    21862339 
    21872340  void CGrid::addTransGridSource(CGrid* gridSrc) 
     2341  TRY 
    21882342  { 
    21892343    if (gridSrc_.end() == gridSrc_.find(gridSrc)) 
    21902344      gridSrc_.insert(make_pair(gridSrc,make_pair(false,""))); 
    21912345  } 
     2346  CATCH_DUMP_ATTR 
    21922347 
    21932348  std::map<CGrid*,std::pair<bool,StdString> >& CGrid::getTransGridSource() 
     2349  TRY 
    21942350  { 
    21952351    return gridSrc_; 
    21962352  } 
     2353  CATCH_DUMP_ATTR 
    21972354 
    21982355  /*! 
     
    22012358  */ 
    22022359  void CGrid::completeGrid(CGrid* transformGridSrc) 
     2360  TRY 
    22032361  { 
    22042362    if (0 != transformGridSrc) 
     
    22192377    gridGenerate.completeGrid(); 
    22202378  } 
     2379  CATCH_DUMP_ATTR 
    22212380 
    22222381  bool CGrid::isGenerated() 
     2382  TRY 
    22232383  { 
    22242384    return isGenerated_; 
    22252385  } 
     2386  CATCH 
    22262387 
    22272388  void CGrid::setGenerated() 
     2389  TRY 
    22282390  { 
    22292391    isGenerated_ = true; 
    22302392  } 
     2393  CATCH_DUMP_ATTR 
    22312394 
    22322395  void CGrid::transformGrid(CGrid* transformGridSrc) 
     2396  TRY 
    22332397  { 
    22342398    if (!transformGridSrc) 
     
    22562420    transformGridSrc->checkMaskIndex(false); 
    22572421  } 
     2422  CATCH_DUMP_ATTR 
    22582423 
    22592424  bool CGrid::hasTransform() 
     2425  TRY 
    22602426  { 
    22612427    if (hasTransform_) return hasTransform_; 
     
    22712437    return hasTransform_; 
    22722438  } 
     2439  CATCH_DUMP_ATTR 
    22732440 
    22742441  /*! 
     
    22772444  */ 
    22782445  std::vector<CDomain*> CGrid::getDomains() 
     2446  TRY 
    22792447  { 
    22802448    std::vector<CDomain*> domList; 
     
    22852453    return domList; 
    22862454  } 
     2455  CATCH_DUMP_ATTR 
    22872456 
    22882457  /*! 
     
    22912460  */ 
    22922461  std::vector<CAxis*> CGrid::getAxis() 
     2462  TRY 
    22932463  { 
    22942464    std::vector<CAxis*> aList; 
     
    22982468    return aList; 
    22992469  } 
     2470  CATCH_DUMP_ATTR 
    23002471 
    23012472  /*! 
     
    23042475  */ 
    23052476  std::vector<CScalar*> CGrid::getScalars() 
     2477  TRY 
    23062478  { 
    23072479    std::vector<CScalar*> sList; 
     
    23112483    return sList; 
    23122484  } 
     2485  CATCH_DUMP_ATTR 
    23132486 
    23142487  /*! 
     
    23172490  */ 
    23182491  CDomain* CGrid::getDomain(int domainIndex) 
     2492  TRY 
    23192493  { 
    23202494    std::vector<CDomain*> domainListP = this->getDomains(); 
     
    23342508    return domainListP[domainIndex]; 
    23352509  } 
     2510  CATCH_DUMP_ATTR 
    23362511 
    23372512  /*! 
     
    23402515  */ 
    23412516  CAxis* CGrid::getAxis(int axisIndex) 
     2517  TRY 
    23422518  { 
    23432519    std::vector<CAxis*> axisListP = this->getAxis(); 
     
    23572533    return axisListP[axisIndex]; 
    23582534  } 
     2535  CATCH_DUMP_ATTR 
    23592536 
    23602537  /*! 
     
    23632540  */ 
    23642541  CScalar* CGrid::getScalar(int scalarIndex) 
     2542  TRY 
    23652543  { 
    23662544    std::vector<CScalar*> scalarListP = this->getScalars(); 
     
    23802558    return scalarListP[scalarIndex]; 
    23812559  } 
     2560  CATCH_DUMP_ATTR 
    23822561 
    23832562  /*! 
     
    23862565  */ 
    23872566  void CGrid::setDomainList(const std::vector<CDomain*> domains) 
     2567  TRY 
    23882568  { 
    23892569    if (isDomListSet) return; 
     
    24062586      isDomListSet = true; 
    24072587    } 
    2408  
    2409   } 
     2588  } 
     2589  CATCH_DUMP_ATTR 
    24102590 
    24112591  /*! 
     
    24142594  */ 
    24152595  void CGrid::setAxisList(const std::vector<CAxis*> axis) 
     2596  TRY 
    24162597  { 
    24172598    if (isAxisListSet) return; 
     
    24352616    } 
    24362617  } 
     2618  CATCH_DUMP_ATTR 
    24372619 
    24382620  /*! 
     
    24412623  */ 
    24422624  void CGrid::setScalarList(const std::vector<CScalar*> scalars) 
     2625  TRY 
    24432626  { 
    24442627    if (isScalarListSet) return; 
     
    24622645    } 
    24632646  } 
     2647  CATCH_DUMP_ATTR 
    24642648 
    24652649  /*! 
     
    24682652  */ 
    24692653  std::vector<StdString> CGrid::getDomainList() 
     2654  TRY 
    24702655  { 
    24712656    setDomainList(); 
    24722657    return domList_; 
    24732658  } 
     2659  CATCH 
    24742660 
    24752661  /*! 
     
    24782664  */ 
    24792665  std::vector<StdString> CGrid::getAxisList() 
     2666  TRY 
    24802667  { 
    24812668    setAxisList(); 
    24822669    return axisList_; 
    24832670  } 
     2671  CATCH 
    24842672 
    24852673  /*! 
     
    24882676  */ 
    24892677  std::vector<StdString> CGrid::getScalarList() 
     2678  TRY 
    24902679  { 
    24912680    setScalarList(); 
    24922681    return scalarList_; 
    24932682  } 
     2683  CATCH 
    24942684 
    24952685  /*! 
     
    24972687  */ 
    24982688  void CGrid::sendAllDomains() 
     2689  TRY 
    24992690  { 
    25002691    std::vector<CDomain*> domList = this->getVirtualDomainGroup()->getAllChildren(); 
     
    25062697    } 
    25072698  } 
     2699  CATCH_DUMP_ATTR 
    25082700 
    25092701  /*! 
     
    25112703  */ 
    25122704  void CGrid::sendAllAxis() 
     2705  TRY 
    25132706  { 
    25142707    std::vector<CAxis*> aList = this->getVirtualAxisGroup()->getAllChildren(); 
     
    25212714    } 
    25222715  } 
     2716  CATCH_DUMP_ATTR 
    25232717 
    25242718  /*! 
     
    25262720  */ 
    25272721  void CGrid::sendAllScalars() 
     2722  TRY 
    25282723  { 
    25292724    std::vector<CScalar*> sList = this->getVirtualScalarGroup()->getAllChildren(); 
     
    25362731    } 
    25372732  } 
     2733  CATCH_DUMP_ATTR 
    25382734 
    25392735  void CGrid::setContextClient(CContextClient* contextClient) 
     2736  TRY 
    25402737  { 
    25412738    if (clientsSet.find(contextClient)==clientsSet.end()) 
     
    25492746        this->getAxis()[i]->setContextClient(contextClient); 
    25502747  } 
     2748  CATCH_DUMP_ATTR 
    25512749 
    25522750  /*! 
     
    25542752  */ 
    25552753  void CGrid::parse(xml::CXMLNode& node) 
     2754  TRY 
    25562755  { 
    25572756    SuperClass::parse(node); 
     
    25942793    setScalarList(); 
    25952794   } 
     2795  CATCH_DUMP_ATTR 
     2796 
    25962797} // namespace xios 
  • XIOS/trunk/src/node/grid.hpp

    r1564 r1622  
    372372   template <int n> 
    373373   void CGrid::inputField(const CArray<double,n>& field, CArray<double,1>& stored) const 
     374   TRY 
    374375   { 
    375376//#ifdef __XIOS_DEBUG 
     
    383384      this->storeField_arr(field.dataFirst(), stored); 
    384385   } 
     386   CATCH 
    385387 
    386388   template <int n> 
    387389   void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const 
     390   TRY 
    388391   { 
    389392//#ifdef __XIOS_DEBUG 
     
    397400      this->restoreField_arr(stored, field.dataFirst()); 
    398401   } 
     402   CATCH 
    399403 
    400404   /*! 
     
    406410   template <int N> 
    407411   void CGrid::uncompressField(const CArray<double,N>& data, CArray<double,1>& outData) const 
     412   TRY 
    408413   {       
    409414     uncompressField_arr(data.dataFirst(), outData); 
    410415   } 
     416   CATCH 
    411417 
    412418   template<int N> 
     
    416422                             const CArray<int,1>& axisDomainOrder, 
    417423                             bool createMask) 
     424   TRY 
    418425   { 
    419426     if (!gridMask.isEmpty() || createMask) 
     
    515522     } 
    516523   } 
     524   CATCH_DUMP_ATTR 
    517525 
    518526   template<int N> 
     
    520528                                  const std::vector<int>& eachDimSize, 
    521529                                  bool newValue) 
     530   TRY 
    522531   { 
    523532      if (N != eachDimSize.size()) 
     
    534543      gridMask = newValue; 
    535544   } 
     545   CATCH_DUMP_ATTR 
    536546                                  
    537547 
     
    543553   template<int N> 
    544554   void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify) 
     555   TRY 
    545556   {      
    546557     int num = indexToModify.numElements(); 
     
    550561     } 
    551562   } 
     563   CATCH_DUMP_ATTR 
     564 
    552565   ///-------------------------------------------------------------- 
    553566 
    554  
    555 /*! 
    556   A grid can have multiple dimension, so can its mask in the form of multi-dimension array. 
    557 It's not a good idea to store all multi-dimension arrays corresponding to each mask. 
    558 One of the ways is to convert this array into 1-dimension one and every process is taken place on it. 
    559   \param [in] multi-dimension array grid mask 
    560 */ 
    561 template<int N> 
    562 void CGrid::getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask) 
    563 { 
    564   if (gridMask.isEmpty()) return ; 
    565   int dim = gridMask.dimensions(); 
    566   std::vector<int> dimensionSizes(dim); 
    567   for (int i = 0; i < dim; ++i) dimensionSizes[i] = gridMask.extent(i); 
    568  
    569   std::vector<int> idxLoop(dim,0); 
    570   int ssize = gridMask.numElements(), idx = 0; 
    571   localMask.resize(ssize); 
    572   while (idx < ssize) 
     567  /*! 
     568    A grid can have multiple dimension, so can its mask in the form of multi-dimension array. 
     569  It's not a good idea to store all multi-dimension arrays corresponding to each mask. 
     570  One of the ways is to convert this array into 1-dimension one and every process is taken place on it. 
     571    \param [in] multi-dimension array grid mask 
     572  */ 
     573  template<int N> 
     574  void CGrid::getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask) 
     575  TRY 
    573576  { 
    574     for (int i = 0; i < dim-1; ++i) 
     577    if (gridMask.isEmpty()) return ; 
     578    int dim = gridMask.dimensions(); 
     579    std::vector<int> dimensionSizes(dim); 
     580    for (int i = 0; i < dim; ++i) dimensionSizes[i] = gridMask.extent(i); 
     581 
     582    std::vector<int> idxLoop(dim,0); 
     583    int ssize = gridMask.numElements(), idx = 0; 
     584    localMask.resize(ssize); 
     585    while (idx < ssize) 
    575586    { 
    576       if (idxLoop[i] == dimensionSizes[i]) 
     587      for (int i = 0; i < dim-1; ++i) 
    577588      { 
    578         idxLoop[i] = 0; 
    579         ++idxLoop[i+1]; 
     589        if (idxLoop[i] == dimensionSizes[i]) 
     590        { 
     591          idxLoop[i] = 0; 
     592          ++idxLoop[i+1]; 
     593        } 
    580594      } 
     595 
     596      int maskIndex = idxLoop[0]; 
     597      int mulDim = 1; 
     598      for (int k = 1; k < dim; ++k) 
     599      { 
     600        mulDim *= dimensionSizes[k-1]; 
     601        maskIndex += idxLoop[k]*mulDim; 
     602      } 
     603      localMask(maskIndex) = *(gridMask.dataFirst()+maskIndex); 
     604 
     605      ++idxLoop[0]; 
     606      ++idx; 
    581607    } 
    582  
    583     int maskIndex = idxLoop[0]; 
    584     int mulDim = 1; 
    585     for (int k = 1; k < dim; ++k) 
    586     { 
    587       mulDim *= dimensionSizes[k-1]; 
    588       maskIndex += idxLoop[k]*mulDim; 
    589     } 
    590     localMask(maskIndex) = *(gridMask.dataFirst()+maskIndex); 
    591  
    592     ++idxLoop[0]; 
    593     ++idx; 
    594608  } 
    595 } 
     609   CATCH_DUMP_ATTR 
    596610 
    597611   // Declare/Define CGridGroup and CGridDefinition 
  • XIOS/trunk/src/object.cpp

    r777 r1622  
    3232  { 
    3333    return this->id; 
     34  } 
     35 
     36  StdString CObject::dumpClassAttributes(void) 
     37  { 
     38    return ""; 
    3439  } 
    3540 
  • XIOS/trunk/src/object.hpp

    r769 r1622  
    1717      /// Accesseurs /// 
    1818      const StdString& getId(void) const; 
     19      virtual const StdString& getIdServer() const; 
    1920 
    20       virtual const StdString& getIdServer() const; 
     21      virtual StdString dumpClassAttributes(void); 
    2122 
    2223      /// Mutateurs /// 
  • XIOS/trunk/src/object_template_impl.hpp

    r1542 r1622  
    109109   template <class T> 
    110110      void CObjectTemplate<T>::parse(xml::CXMLNode & node) 
     111   TRY 
    111112   { 
    112113      xml::THashAttributes attributes = node.getAttributes(); 
    113114      CAttributeMap::setAttributes(attributes); 
    114115   } 
     116   CATCH 
    115117 
    116118   //--------------------------------------------------------------- 
  • XIOS/trunk/src/transformation/axis_algorithm_duplicate_scalar.cpp

    r1314 r1622  
    2121                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2222                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     23TRY 
    2324{ 
    2425  std::vector<CAxis*> axisListDestP = gridDst->getAxis(); 
     
    3132  return (new CAxisAlgorithmDuplicateScalar(axisListDestP[axisDstIndex], scalarListSrcP[scalarSrcIndex], duplicateScalar)); 
    3233} 
     34CATCH 
    3335 
    3436bool CAxisAlgorithmDuplicateScalar::registerTrans() 
     37TRY 
    3538{ 
    3639  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_DUPLICATE_SCALAR_TO_AXIS, create); 
    3740} 
     41CATCH 
    3842 
    3943 
     
    5054 
    5155void CAxisAlgorithmDuplicateScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     56TRY 
    5257{ 
    5358  this->transformationMapping_.resize(1); 
     
    6974  } 
    7075} 
    71  
     76CATCH 
    7277} 
  • XIOS/trunk/src/transformation/axis_algorithm_extract.cpp

    r1558 r1622  
    1919                                                           std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2020                                                           std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     21TRY 
    2122{ 
    2223  std::vector<CAxis*> axisListDestP = gridDst->getAxis(); 
     
    2930  return (new CAxisAlgorithmExtract(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], extractAxis)); 
    3031} 
     32CATCH 
     33 
    3134bool CAxisAlgorithmExtract::registerTrans() 
     35TRY 
    3236{ 
    3337  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_EXTRACT_AXIS, create); 
    3438} 
     39CATCH 
    3540 
    3641CAxisAlgorithmExtract::CAxisAlgorithmExtract(CAxis* axisDestination, CAxis* axisSource, CExtractAxis* extractAxis) 
    3742: CAxisAlgorithmTransformation(axisDestination, axisSource) 
     43TRY 
    3844{ 
    3945  extractAxis->checkValid(axisSource); 
     
    104110  } 
    105111} 
     112CATCH 
    106113 
    107114/*! 
  • XIOS/trunk/src/transformation/axis_algorithm_extract_domain.cpp

    r1260 r1622  
    2525                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2626                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     27TRY 
    2728{ 
    2829  std::vector<CAxis*> axisListDestP = gridDst->getAxis(); 
     
    3536  return (new CAxisAlgorithmExtractDomain(axisListDestP[axisDstIndex], domainListSrcP[domainSrcIndex], extractDomain)); 
    3637} 
     38CATCH 
    3739 
    3840//bool CAxisAlgorithmExtractDomain::_dummyRegistered = CAxisAlgorithmExtractDomain::registerTrans(); 
    3941bool CAxisAlgorithmExtractDomain::registerTrans() 
     42TRY 
    4043{ 
    4144  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_EXTRACT_DOMAIN_TO_AXIS, create); 
    4245} 
     46CATCH 
    4347 
    4448 
    4549CAxisAlgorithmExtractDomain::CAxisAlgorithmExtractDomain(CAxis* axisDestination, CDomain* domainSource, CExtractDomainToAxis* algo) 
    4650 : CAxisAlgorithmTransformation(axisDestination, domainSource), pos_(-1), reduction_(0) 
     51TRY 
    4752{ 
    4853  algo->checkValid(axisDestination, domainSource); 
     
    6469  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    6570} 
     71CATCH 
    6672 
    6773void CAxisAlgorithmExtractDomain::apply(const std::vector<std::pair<int,double> >& localIndex, 
     
    7076                                        std::vector<bool>& flagInitial,                      
    7177                                        bool ignoreMissingValue, bool firstPass) 
     78TRY 
    7279{ 
    7380  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    7481} 
     82CATCH 
    7583 
    7684CAxisAlgorithmExtractDomain::~CAxisAlgorithmExtractDomain() 
     85TRY 
    7786{ 
    7887  if (0 != reduction_) delete reduction_; 
    7988} 
     89CATCH 
    8090 
    8191void CAxisAlgorithmExtractDomain::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     92TRY 
    8293{ 
    8394  this->transformationMapping_.resize(1); 
     
    117128  {} 
    118129} 
    119  
     130CATCH 
    120131} 
  • XIOS/trunk/src/transformation/axis_algorithm_interpolate.cpp

    r1412 r1622  
    2929                                                                   std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    3030                                                                   std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     31TRY 
    3132{ 
    3233  std::vector<CAxis*> axisListDestP = gridDst->getAxis(); 
     
    3940  return (new CAxisAlgorithmInterpolate(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], interpolateAxis)); 
    4041} 
     42CATCH 
    4143 
    4244bool CAxisAlgorithmInterpolate::registerTrans() 
     45TRY 
    4346{ 
    4447  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_INTERPOLATE_AXIS, create); 
    4548} 
    46  
     49CATCH 
    4750 
    4851CAxisAlgorithmInterpolate::CAxisAlgorithmInterpolate(CAxis* axisDestination, CAxis* axisSource, CInterpolateAxis* interpAxis) 
    4952: CAxisAlgorithmTransformation(axisDestination, axisSource), coordinate_(), transPosition_() 
     53TRY 
    5054{ 
    5155  interpAxis->checkValid(axisSource); 
     
    5862  } 
    5963} 
     64CATCH 
    6065 
    6166/*! 
     
    6368*/ 
    6469void CAxisAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     70TRY 
    6571{ 
    6672  CTimer::get("CAxisAlgorithmInterpolate::computeIndexSourceMapping_").resume() ; 
     
    8894  CTimer::get("CAxisAlgorithmInterpolate::computeIndexSourceMapping_").suspend() ; 
    8995} 
     96CATCH 
    9097 
    9198/*! 
     
    98105                                                        const std::vector<int>& indexVec, 
    99106                                                        int transPos) 
     107TRY 
    100108{ 
    101109  std::vector<double>::const_iterator itb = axisValue.begin(), ite = axisValue.end(); 
     
    162170  computeWeightedValueAndMapping(interpolatingIndexValues, transPos); 
    163171} 
     172CATCH 
    164173 
    165174/*! 
     
    168177*/ 
    169178void CAxisAlgorithmInterpolate::computeWeightedValueAndMapping(const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos) 
     179TRY 
    170180{ 
    171181  TransformationIndexMap& transMap = this->transformationMapping_[transPos]; 
     
    205215 
    206216} 
     217CATCH 
    207218 
    208219/*! 
     
    213224void CAxisAlgorithmInterpolate::retrieveAllAxisValue(const CArray<double,1>& axisValue, const CArray<bool,1>& axisMask, 
    214225                                                     std::vector<double>& recvBuff, std::vector<int>& indexVec) 
     226TRY 
    215227{ 
    216228  CContext* context = CContext::getCurrent(); 
     
    282294  } 
    283295} 
     296CATCH 
    284297 
    285298/*! 
     
    289302void CAxisAlgorithmInterpolate::fillInAxisValue(std::vector<CArray<double,1> >& vecAxisValue, 
    290303                                                const std::vector<CArray<double,1>* >& dataAuxInputs) 
     304TRY 
    291305{ 
    292306  if (coordinate_.empty()) 
     
    377391  } 
    378392} 
    379  
    380 } 
     393CATCH 
     394 
     395} 
  • XIOS/trunk/src/transformation/axis_algorithm_inverse.cpp

    r1542 r1622  
    2727                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2828                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     29TRY 
    2930{ 
    3031  std::vector<CAxis*> axisListDestP = gridDst->getAxis(); 
     
    3738  return (new CAxisAlgorithmInverse(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], inverseAxis)); 
    3839} 
     40CATCH 
    3941 
    4042bool CAxisAlgorithmInverse::registerTrans() 
     43TRY 
    4144{ 
    4245  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_INVERSE_AXIS, create); 
    4346} 
    44  
     47CATCH 
    4548 
    4649CAxisAlgorithmInverse::CAxisAlgorithmInverse(CAxis* axisDestination, CAxis* axisSource, CInverseAxis* inverseAxis) 
    4750 : CAxisAlgorithmTransformation(axisDestination, axisSource) 
     51TRY 
    4852{ 
    4953  if (axisDestination->n_glo.getValue() != axisSource->n_glo.getValue()) 
     
    5559  } 
    5660} 
     61CATCH 
    5762 
    5863void CAxisAlgorithmInverse::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     64TRY 
    5965{ 
    6066  this->transformationMapping_.resize(1); 
     
    8288  } 
    8389} 
     90CATCH 
    8491 
    8592/*! 
     
    8895*/ 
    8996void CAxisAlgorithmInverse::updateAxisValue() 
     97TRY 
    9098{ 
    9199  CContext* context = CContext::getCurrent(); 
     
    282290    delete [] itLong->second; 
    283291} 
    284  
    285 } 
     292CATCH 
     293 
     294} 
  • XIOS/trunk/src/transformation/axis_algorithm_reduce_axis.cpp

    r1314 r1622  
    2424                                                                   std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2525                                                                   std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     26TRY 
    2627{ 
    2728  std::vector<CAxis*> axisListDestP = gridDst->getAxis(); 
     
    3435  return (new CAxisAlgorithmReduceAxis(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], reduceAxis)); 
    3536} 
     37CATCH 
    3638 
    3739bool CAxisAlgorithmReduceAxis::registerTrans() 
     40TRY 
    3841{ 
    3942  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_REDUCE_AXIS_TO_AXIS, create); 
    4043} 
     44CATCH 
    4145 
    4246 
    4347CAxisAlgorithmReduceAxis::CAxisAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToAxis* algo) 
    4448 : CAxisAlgorithmTransformation(axisDestination, axisSource), reduction_(0) 
     49TRY 
    4550{ 
    4651  eliminateRedondantSrc_= false ; 
     
    7176  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    7277} 
     78CATCH 
    7379 
    7480void CAxisAlgorithmReduceAxis::apply(const std::vector<std::pair<int,double> >& localIndex, 
     
    7783                                       std::vector<bool>& flagInitial,                      
    7884                                       bool ignoreMissingValue, bool firstPass) 
     85TRY 
    7986{ 
    8087  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    8188} 
     89CATCH 
    8290 
    8391void CAxisAlgorithmReduceAxis::updateData(CArray<double,1>& dataOut) 
     92TRY 
    8493{ 
    8594  reduction_->updateData(dataOut); 
    8695} 
     96CATCH 
    8797 
    8898CAxisAlgorithmReduceAxis::~CAxisAlgorithmReduceAxis() 
     99TRY 
    89100{ 
    90101  if (0 != reduction_) delete reduction_; 
    91102} 
     103CATCH 
    92104 
    93105void CAxisAlgorithmReduceAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     106TRY 
    94107{ 
    95108  this->transformationMapping_.resize(1); 
     
    109122  } 
    110123} 
     124CATCH 
    111125 
    112126} 
  • XIOS/trunk/src/transformation/axis_algorithm_reduce_domain.cpp

    r1299 r1622  
    2525                                                                   std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2626                                                                   std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     27TRY 
    2728{ 
    2829  std::vector<CAxis*> axisListDestP = gridDst->getAxis(); 
     
    3536  return (new CAxisAlgorithmReduceDomain(axisListDestP[axisDstIndex], domainListSrcP[domainSrcIndex], reduceDomain)); 
    3637} 
     38CATCH 
    3739 
    3840bool CAxisAlgorithmReduceDomain::registerTrans() 
     41TRY 
    3942{ 
    4043  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_REDUCE_DOMAIN_TO_AXIS, create); 
    4144} 
     45CATCH 
    4246 
    4347 
    4448CAxisAlgorithmReduceDomain::CAxisAlgorithmReduceDomain(CAxis* axisDestination, CDomain* domainSource, CReduceDomainToAxis* algo) 
    4549 : CAxisAlgorithmTransformation(axisDestination, domainSource), reduction_(0) 
     50TRY 
    4651{ 
    4752  algo->checkValid(axisDestination, domainSource); 
     
    7378  local = algo->local ; 
    7479} 
     80CATCH 
    7581 
    7682void CAxisAlgorithmReduceDomain::apply(const std::vector<std::pair<int,double> >& localIndex, 
     
    7985                                       std::vector<bool>& flagInitial,                      
    8086                                       bool ignoreMissingValue, bool firstPass) 
     87TRY 
    8188{ 
    8289  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    8390} 
     91CATCH 
    8492 
    8593void CAxisAlgorithmReduceDomain::updateData(CArray<double,1>& dataOut) 
     94TRY 
    8695{ 
    8796  reduction_->updateData(dataOut); 
    8897} 
     98CATCH 
    8999 
    90100CAxisAlgorithmReduceDomain::~CAxisAlgorithmReduceDomain() 
     101TRY 
    91102{ 
    92103  if (0 != reduction_) delete reduction_; 
    93104} 
     105CATCH 
    94106 
    95107void CAxisAlgorithmReduceDomain::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     108TRY 
    96109{ 
    97110  this->transformationMapping_.resize(1); 
     
    174187  {} 
    175188} 
     189CATCH 
    176190 
    177191} 
  • XIOS/trunk/src/transformation/axis_algorithm_temporal_splitting.cpp

    r1275 r1622  
    2121                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2222                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     23TRY 
    2324{ 
    2425  std::vector<CAxis*> axisListDestP = gridDst->getAxis(); 
     
    3132  return (new CAxisAlgorithmTemporalSplitting(axisListDestP[axisDstIndex], scalarListSrcP[scalarSrcIndex], temporalSplitting)); 
    3233} 
     34CATCH 
    3335 
    3436bool CAxisAlgorithmTemporalSplitting::registerTrans() 
     37TRY 
    3538{ 
    3639  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_TEMPORAL_SPLITTING, create); 
    3740} 
    38  
     41CATCH 
    3942 
    4043CAxisAlgorithmTemporalSplitting::CAxisAlgorithmTemporalSplitting(CAxis* axisDestination, CScalar* scalarSource, CTemporalSplitting* algo) 
     
    5053 
    5154void CAxisAlgorithmTemporalSplitting::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     55TRY 
    5256{ 
    5357  this->transformationMapping_.resize(1); 
     
    7276  } 
    7377} 
     78CATCH 
    7479 
    7580} 
  • XIOS/trunk/src/transformation/axis_algorithm_transformation.cpp

    r1403 r1622  
    2020CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CAxis* axisSource) 
    2121 : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(axisSource), domainSrc_(0),scalarSrc_(0) 
     22TRY 
    2223{ 
    2324  axisDestGlobalSize_ = axisDestination->n_glo.getValue(); 
     
    2829    if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx); 
    2930} 
     31CATCH 
    3032 
    3133CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CDomain* domainSource) 
    3234 : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(domainSource),scalarSrc_(0) 
     35TRY 
    3336{ 
    3437  axisDestGlobalSize_ = axisDestination->n_glo.getValue(); 
     
    3942    if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx); 
    4043} 
     44CATCH 
    4145 
    4246CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CScalar* scalarSource) 
    4347 : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(0), scalarSrc_(scalarSource) 
     48TRY 
    4449{ 
    4550  axisDestGlobalSize_ = axisDestination->n_glo.getValue(); 
     
    5055    if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx); 
    5156} 
     57CATCH 
     58 
    5259CAxisAlgorithmTransformation::~CAxisAlgorithmTransformation() 
    5360{ 
     
    6673                                                              int elementType, 
    6774                                                              CClientClientDHTInt::Index2VectorInfoTypeMap& globalAxisIndexOnProc) 
     75TRY 
    6876{ 
    6977  CContext* context = CContext::getCurrent(); 
     
    124132  globalAxisIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); 
    125133} 
     134CATCH 
    126135 
    127136} 
  • XIOS/trunk/src/transformation/axis_algorithm_zoom.cpp

    r1559 r1622  
    1919                                                           std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2020                                                           std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     21TRY 
    2122{ 
    2223  std::vector<CAxis*> axisListDestP = gridDst->getAxis(); 
     
    2930  return (new CAxisAlgorithmZoom(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], zoomAxis)); 
    3031} 
     32CATCH 
     33 
    3134bool CAxisAlgorithmZoom::registerTrans() 
     35TRY 
    3236{ 
    3337  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_ZOOM_AXIS, create); 
    3438} 
     39CATCH 
    3540 
    3641CAxisAlgorithmZoom::CAxisAlgorithmZoom(CAxis* axisDestination, CAxis* axisSource, CZoomAxis* zoomAxis) 
    3742: CAxisAlgorithmTransformation(axisDestination, axisSource) 
     43TRY 
    3844{ 
    3945  zoomAxis->checkValid(axisSource); 
     
    104110  } 
    105111} 
     112CATCH 
    106113 
    107114/*! 
  • XIOS/trunk/src/transformation/domain_algorithm_compute_connectivity.cpp

    r978 r1622  
    2424                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2525                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     26TRY 
    2627{ 
    2728  std::vector<CDomain*> domainListDestP = gridDst->getDomains(); 
     
    3435  return (new CDomainAlgorithmComputeConnectivity(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], compute_connectivityDomain)); 
    3536} 
     37CATCH 
    3638 
    3739bool CDomainAlgorithmComputeConnectivity::registerTrans() 
     40TRY 
    3841{ 
    3942  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_COMPUTE_CONNECTIVITY_DOMAIN, create); 
    4043} 
     44CATCH 
    4145 
    4246CDomainAlgorithmComputeConnectivity::CDomainAlgorithmComputeConnectivity(CDomain* domainDestination, CDomain* domainSource, 
    4347                                                                         CComputeConnectivityDomain* compute_connectivityDomain) 
    4448: CDomainAlgorithmTransformation(domainDestination, domainSource) 
     49TRY 
    4550{ 
    4651  this->type_ = (ELEMENT_NO_MODIFICATION_WITHOUT_DATA); 
     
    6469  computeLocalConnectivity(type, domainDestination, nbNeighborMax, nbNeighbor, localNeighbors); 
    6570} 
     71CATCH 
    6672 
    6773/*! 
     
    7884                                                                  CArray<int,1>& nbConnectivity, 
    7985                                                                  CArray<int,2>& localConnectivity) 
     86TRY 
    8087{ 
    8188 
     
    93100    if (nbConnectivityMax < nbConnectivity(idx)) nbConnectivityMax = nbConnectivity(idx); 
    94101} 
    95  
    96  
     102CATCH 
    97103 
    98104/*! 
  • XIOS/trunk/src/transformation/domain_algorithm_expand.cpp

    r1553 r1622  
    2626                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2727                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     28TRY 
    2829{ 
    2930  std::vector<CDomain*> domainListDestP = gridDst->getDomains(); 
     
    3637  return (new CDomainAlgorithmExpand(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], expandDomain)); 
    3738} 
     39CATCH 
    3840 
    3941bool CDomainAlgorithmExpand::registerTrans() 
     42TRY 
    4043{ 
    4144  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_EXPAND_DOMAIN, create); 
    4245} 
     46CATCH 
    4347 
    4448CDomainAlgorithmExpand::CDomainAlgorithmExpand(CDomain* domainDestination, 
     
    4751: CDomainAlgorithmTransformation(domainDestination, domainSource), 
    4852  isXPeriodic_(false), isYPeriodic_(false) 
     53TRY 
    4954{ 
    5055  if (domainDestination == domainSource) 
     
    7782  } 
    7883} 
     84CATCH 
    7985 
    8086/*! 
     
    8591void CDomainAlgorithmExpand::expandDomainEdgeConnectivity(CDomain* domainDestination, 
    8692                                                          CDomain* domainSource) 
     93TRY 
    8794{ 
    8895  CContext* context = CContext::getCurrent(); 
     
    104111  }   
    105112} 
     113CATCH 
    106114 
    107115/*! 
     
    112120void CDomainAlgorithmExpand::expandDomainNodeConnectivity(CDomain* domainDestination, 
    113121                                                          CDomain* domainSource) 
     122TRY 
    114123{ 
    115124  CContext* context = CContext::getCurrent(); 
     
    131140  }   
    132141} 
     142CATCH 
    133143 
    134144/*! 
     
    142152                                                               CDomain* domainSource, 
    143153                                                               CArray<int,2>& neighborsDomainSrc) 
     154TRY 
    144155{ 
    145156  int index, globalIndex, idx; 
     
    455466   domainDestination->computeLocalMask() ; 
    456467} 
     468CATCH 
    457469 
    458470/*! 
     
    466478                                                                CDomain* domainSource, 
    467479                                                                CArray<int,2>& neighborsDomainSrc) 
     480TRY 
    468481{ 
    469482 
     
    669682  domainDestination->computeLocalMask() ; 
    670683} 
    671  
     684CATCH 
    672685 
    673686/*! 
  • XIOS/trunk/src/transformation/domain_algorithm_extract.cpp

    r1553 r1622  
    1616                                                             std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    1717                                                             std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     18TRY 
    1819{ 
    1920  std::vector<CDomain*> domainListDestP = gridDst->getDomains(); 
     
    2627  return (new CDomainAlgorithmExtract(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], extractDomain)); 
    2728} 
     29CATCH 
    2830 
    2931bool CDomainAlgorithmExtract::registerTrans() 
     32TRY 
    3033{ 
    3134  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_EXTRACT_DOMAIN, create); 
    3235} 
     36CATCH 
    3337 
    3438CDomainAlgorithmExtract::CDomainAlgorithmExtract(CDomain* domainDestination, CDomain* domainSource, CExtractDomain* extractDomain) 
    3539: CDomainAlgorithmTransformation(domainDestination, domainSource) 
     40TRY 
    3641{ 
    3742  extractDomain->checkValid(domainSource); 
     
    220225 
    221226} 
     227CATCH 
    222228 
    223229/*! 
  • XIOS/trunk/src/transformation/domain_algorithm_generate_rectilinear.cpp

    r1158 r1622  
    2020                                                                         CGenerateRectilinearDomain* genRectDomain) 
    2121: CDomainAlgorithmTransformation(domainDestination, domainSource), nbDomainDistributedPart_(0) 
     22TRY 
    2223{ 
    2324  type_ = ELEMENT_GENERATION; 
     
    3031  fillInAttributesDomainDestination(); 
    3132} 
     33CATCH 
    3234 
    3335/*! 
     
    4345*/ 
    4446void CDomainAlgorithmGenerateRectilinear::computeDistributionGridSource(CGrid* gridSrc) 
     47TRY 
    4548{ 
    4649  CContext* context = CContext::getCurrent(); 
     
    9497  } 
    9598} 
     99CATCH 
    96100 
    97101/*! 
     
    99103*/ 
    100104void CDomainAlgorithmGenerateRectilinear::computeDistributionGridDestination(CGrid* gridDest) 
     105TRY 
    101106{ 
    102107  // For now, just suppose that the grid contains only one domain 
     
    121126 
    122127} 
     128CATCH 
    123129 
    124130/*! 
     
    126132*/ 
    127133void CDomainAlgorithmGenerateRectilinear::fillInAttributesDomainDestination() 
     134TRY 
    128135{ 
    129136  if (!domainDest_->distributionAttributesHaveValue()) 
     
    131138  domainDest_->fillInLonLat(); 
    132139} 
    133  
     140CATCH 
    134141} 
  • XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp

    r1617 r1622  
    3131                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    3232                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     33TRY 
    3334{ 
    3435  std::vector<CDomain*> domainListDestP = gridDst->getDomains(); 
     
    4142  return (new CDomainAlgorithmInterpolate(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], interpolateDomain)); 
    4243} 
     44CATCH 
    4345 
    4446bool CDomainAlgorithmInterpolate::registerTrans() 
     47TRY 
    4548{ 
    4649  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_INTERPOLATE_DOMAIN, create); 
    4750} 
     51CATCH 
    4852 
    4953CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain) 
    5054: CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false) 
     55TRY 
    5156{ 
    5257  CContext* context = CContext::getCurrent(); 
     
    9398     
    9499} 
     100CATCH 
    95101 
    96102/*! 
     
    98104*/ 
    99105void CDomainAlgorithmInterpolate::computeRemap() 
     106TRY 
    100107{ 
    101108  using namespace sphereRemap; 
     
    418425 
    419426} 
     427CATCH 
    420428 
    421429void CDomainAlgorithmInterpolate::processPole(std::map<int,std::vector<std::pair<int,double> > >& interMapValuePole, 
    422430                                              int nbGlobalPointOnPole) 
     431TRY 
    423432{ 
    424433  CContext* context = CContext::getCurrent(); 
     
    487496 
    488497} 
     498CATCH 
    489499 
    490500/*! 
     
    492502*/ 
    493503void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     504TRY 
    494505{ 
    495506  if (readFromFile_)   
     
    500511  } 
    501512} 
     513CATCH 
    502514 
    503515void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     516TRY 
    504517 
    505518  writeInterpolationInfo(fileToReadWrite_, interpMapValue); 
    506519} 
     520CATCH 
    507521 
    508522void CDomainAlgorithmInterpolate::readRemapInfo() 
     523TRY 
    509524 
    510525  std::map<int,std::vector<std::pair<int,double> > > interpMapValue; 
     
    513528  exchangeRemapInfo(interpMapValue); 
    514529} 
     530CATCH 
    515531 
    516532void CDomainAlgorithmInterpolate::convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     533TRY 
    517534{ 
    518535  CContext* context = CContext::getCurrent(); 
     
    539556  }       
    540557} 
     558CATCH 
    541559 
    542560/*! 
     
    544562*/ 
    545563void CDomainAlgorithmInterpolate::exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     564TRY 
    546565{ 
    547566  CContext* context = CContext::getCurrent(); 
     
    723742  delete [] recvBuff; 
    724743} 
     744CATCH 
    725745  
    726746/*! Redefined some functions of CONetCDF4 to make use of them */ 
     
    729749int CDomainAlgorithmInterpolate::WriteNetCdf::addDimensionWrite(const StdString& name,  
    730750                                                                const StdSize size) 
     751TRY 
    731752{ 
    732753  return CONetCDF4::addDimension(name, size);   
    733754} 
     755CATCH 
    734756 
    735757int CDomainAlgorithmInterpolate::WriteNetCdf::addVariableWrite(const StdString& name, nc_type type, 
    736758                                                               const std::vector<StdString>& dim) 
     759TRY 
    737760{ 
    738761  return CONetCDF4::addVariable(name, type, dim); 
    739762} 
     763CATCH 
    740764 
    741765void CDomainAlgorithmInterpolate::WriteNetCdf::endDefinition() 
     766TRY 
    742767{ 
    743768  CONetCDF4::definition_end(); 
    744769} 
     770CATCH 
    745771 
    746772void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<int,1>& data, const StdString& name, 
     
    748774                                                              const std::vector<StdSize>* start, 
    749775                                                              const std::vector<StdSize>* count) 
     776TRY 
    750777{ 
    751778  CONetCDF4::writeData<int,1>(data, name, collective, record, start, count); 
    752779} 
     780CATCH 
    753781 
    754782void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<double,1>& data, const StdString& name, 
     
    756784                                                              const std::vector<StdSize>* start, 
    757785                                                              const std::vector<StdSize>* count) 
     786TRY 
    758787{ 
    759788  CONetCDF4::writeData<double,1>(data, name, collective, record, start, count); 
    760789} 
     790CATCH 
    761791 
    762792/* 
     
    767797void CDomainAlgorithmInterpolate::writeInterpolationInfo(std::string& filename, 
    768798                                                         std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     799TRY 
    769800{ 
    770801  CContext* context = CContext::getCurrent(); 
     
    846877  netCdfWriter.closeFile(); 
    847878} 
     879CATCH 
    848880 
    849881/*! 
     
    855887void CDomainAlgorithmInterpolate::readInterpolationInfo(std::string& filename, 
    856888                                                        std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     889TRY 
    857890{ 
    858891  int ncid ; 
     
    913946      interpMapValue[dstIndex[ind]-indexOffset].push_back(make_pair(srcIndex[ind]-indexOffset,weight[ind])); 
    914947 } 
     948CATCH 
    915949 
    916950void CDomainAlgorithmInterpolate::apply(const std::vector<std::pair<int,double> >& localIndex, 
     
    919953                                            std::vector<bool>& flagInitial, 
    920954                                            bool ignoreMissingValue, bool firstPass  ) 
     955TRY 
    921956{ 
    922957  int nbLocalIndex = localIndex.size();    
     
    960995  } 
    961996} 
     997CATCH 
    962998 
    963999void CDomainAlgorithmInterpolate::updateData(CArray<double,1>& dataOut) 
     1000TRY 
    9641001{ 
    9651002  if (detectMissingValue) 
     
    9831020  } 
    9841021} 
    985  
    986 } 
     1022CATCH 
     1023 
     1024} 
  • XIOS/trunk/src/transformation/domain_algorithm_reorder.cpp

    r1457 r1622  
    1919                                                             std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2020                                                             std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     21TRY 
    2122{ 
    2223  std::vector<CDomain*> domainListDestP = gridDst->getDomains(); 
     
    2930  return (new CDomainAlgorithmReorder(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], reorderDomain)); 
    3031} 
     32CATCH 
    3133 
    3234bool CDomainAlgorithmReorder::registerTrans() 
     35TRY 
    3336{ 
    3437  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_REORDER_DOMAIN, create); 
    3538} 
     39CATCH 
    3640 
    3741CDomainAlgorithmReorder::CDomainAlgorithmReorder(CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain) 
    3842: CDomainAlgorithmTransformation(domainDestination, domainSource) 
     43TRY 
    3944{ 
    4045  reorderDomain->checkValid(domainSource); 
     
    109114    } 
    110115  } 
    111      
    112    
    113116} 
     117CATCH 
    114118 
    115119/*! 
  • XIOS/trunk/src/transformation/domain_algorithm_transformation.cpp

    r1403 r1622  
    3636                                                                int elementType, 
    3737                                                                CClientClientDHTInt::Index2VectorInfoTypeMap& globalDomainIndexOnProc) 
     38TRY 
    3839{ 
    3940  CContext* context = CContext::getCurrent(); 
     
    6566  globalDomainIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); 
    6667} 
     68CATCH 
    6769 
    6870} 
  • XIOS/trunk/src/transformation/domain_algorithm_zoom.cpp

    r1621 r1622  
    1616                                                             std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    1717                                                             std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     18TRY 
    1819{ 
    1920  std::vector<CDomain*> domainListDestP = gridDst->getDomains(); 
     
    2627  return (new CDomainAlgorithmZoom(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], zoomDomain)); 
    2728} 
     29CATCH 
    2830 
    2931bool CDomainAlgorithmZoom::registerTrans() 
     32TRY 
    3033{ 
    3134  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_ZOOM_DOMAIN, create); 
    3235} 
     36CATCH 
    3337 
    3438CDomainAlgorithmZoom::CDomainAlgorithmZoom(CDomain* domainDestination, CDomain* domainSource, CZoomDomain* zoomDomain) 
    3539: CDomainAlgorithmTransformation(domainDestination, domainSource) 
     40TRY 
    3641{ 
    3742  zoomDomain->checkValid(domainSource); 
     
    269274  domainDest_->computeLocalMask(); 
    270275} 
     276CATCH 
    271277 
    272278/*! 
  • XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp

    r1542 r1622  
    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  
    844  
     855CATCH 
    845856 
    846857void CGenericAlgorithmTransformation::computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst, 
    847858                                                                                 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, vector<bool>& localMaskOnGridDest) 
     859TRY 
    848860{ 
    849861 
     
    934946  } 
    935947 
    936  
    937  
    938  
    939  
    940  
    941948  vector<int> dstLocalInd ; 
    942949  int dimElement = axisDomainDstOrder(elementPositionInGrid); 
     
    10271034                
    10281035} 
    1029  
     1036CATCH 
    10301037 
    10311038void 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, 
    10321039                    vector<int>& localSrc, vector<int>& localDst, vector<double>& weight,  CArray<bool,1>& localMaskOnGridSrc, vector<bool>& localMaskOnGridDest ) 
     1040TRY 
    10331041{ 
    10341042  int masked_ ; 
     
    11191127 
    11201128} 
    1121  
    1122  
    1123  
    1124  
    1125  
    1126  
    1127  
    1128  
    1129  
    1130  
     1129CATCH 
    11311130 
    11321131/*! 
     
    11361135*/ 
    11371136void CGenericAlgorithmTransformation::computeIndexSourceMapping(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     1137TRY 
    11381138{ 
    11391139  computeIndexSourceMapping_(dataAuxInputs); 
    11401140} 
     1141CATCH 
    11411142 
    11421143std::vector<StdString> CGenericAlgorithmTransformation::getIdAuxInputs() 
     1144TRY 
    11431145{ 
    11441146  return idAuxInputs_; 
    11451147} 
     1148CATCH 
    11461149 
    11471150CGenericAlgorithmTransformation::AlgoTransType CGenericAlgorithmTransformation::type() 
     1151TRY 
    11481152{ 
    11491153  return type_; 
    11501154} 
    1151  
    1152 } 
     1155CATCH 
     1156 
     1157} 
  • XIOS/trunk/src/transformation/grid_generate.cpp

    r978 r1622  
    3030*/ 
    3131void CGridGenerate::selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 
     32TRY 
    3233{ 
    3334  CGenericAlgorithmTransformation* algo = 0; 
    3435  algoTransformation_.push_back(algo); 
    3536} 
     37CATCH 
    3638 
    3739/*! 
     
    4345*/ 
    4446void CGridGenerate::selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 
     47TRY 
    4548{ 
    4649  CGenericAlgorithmTransformation* algo = 0; 
    4750  algoTransformation_.push_back(algo); 
    4851} 
     52CATCH 
    4953 
    5054/*! 
     
    5660*/ 
    5761void CGridGenerate::selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 
     62TRY 
    5863{ 
    5964  std::vector<CDomain*> domainListDestP = gridDestination_->getDomains(); 
     
    8994  algoTransformation_.push_back(algo); 
    9095} 
     96CATCH 
    9197 
    9298/*! 
     
    94100*/ 
    95101void CGridGenerate::completeGrid() 
     102TRY 
    96103{ 
    97104  ListAlgoType::const_iterator itb = listAlgos_.begin(), 
     
    110117  } 
    111118} 
     119CATCH 
    112120 
    113121} 
  • XIOS/trunk/src/transformation/grid_transformation.cpp

    r1542 r1622  
    3838*/ 
    3939void CGridTransformation::selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 
     40TRY 
    4041{ 
    4142  std::vector<CScalar*> scaListDestP = gridDestination_->getScalars(); 
     
    5960  algoTransformation_.push_back(algo); 
    6061} 
     62CATCH 
    6163 
    6264/*! 
     
    6769*/ 
    6870void CGridTransformation::selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 
     71TRY 
    6972{ 
    7073  std::vector<CAxis*> axisListDestP = gridDestination_->getAxis(); 
     
    8891  algoTransformation_.push_back(algo); 
    8992} 
     93CATCH 
    9094 
    9195/*! 
     
    96100*/ 
    97101void CGridTransformation::selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 
     102TRY 
    98103{ 
    99104  std::vector<CDomain*> domainListDestP = gridDestination_->getDomains(); 
     
    117122  algoTransformation_.push_back(algo); 
    118123} 
     124CATCH 
    119125 
    120126/*! 
     
    123129*/ 
    124130std::map<int,std::pair<int,int> > CGridTransformation::getElementPosition(CGrid* grid) 
     131TRY 
    125132{ 
    126133  std::vector<CScalar*> scalarListP = grid->getScalars();  
     
    155162  return elementPosition;   
    156163} 
     164CATCH 
    157165 
    158166/*! 
     
    163171*/ 
    164172void CGridTransformation::setUpGridDestination(int elementPositionInGrid, ETranformationType transType) 
     173TRY 
    165174{ 
    166175  if (isSpecialTransformation(transType)) return; 
     
    240249  tempGridDests_.push_back(tmpGridDestination_); 
    241250} 
     251CATCH 
    242252 
    243253/*! 
     
    249259*/ 
    250260void CGridTransformation::setUpGridSource(int elementPositionInGrid) 
     261TRY 
    251262{ 
    252263  if (!tempGridSrcs_.empty() && (getNbAlgo()-1) == tempGridSrcs_.size()) 
     
    326337  tempGridSrcs_.push_back(gridSource_); 
    327338} 
     339CATCH 
    328340 
    329341/*! 
     
    336348*/ 
    337349void CGridTransformation::computeAll(const std::vector<CArray<double,1>* >& dataAuxInputs, Time timeStamp) 
     350TRY 
    338351{ 
    339352  if (nbNormalAlgos_ < 1) return; 
     
    453466  } 
    454467} 
     468CATCH 
    455469 
    456470/*! 
     
    459473*/ 
    460474void CGridTransformation::computeTransformationMapping(const SourceDestinationIndexMap& globaIndexWeightFromSrcToDst) 
     475TRY 
    461476{ 
    462477  CContext* context = CContext::getCurrent(); 
     
    682697 
    683698} 
     699CATCH 
    684700 
    685701/*! 
     
    688704*/ 
    689705const std::list<CGridTransformation::SendingIndexGridSourceMap>& CGridTransformation::getLocalIndexToSendFromGridSource() const 
     706TRY 
    690707{ 
    691708  return localIndexToSendFromGridSource_; 
    692709} 
     710CATCH 
    693711 
    694712/*! 
     
    697715*/ 
    698716const std::list<CGridTransformation::RecvIndexGridDestinationMap>& CGridTransformation::getLocalIndexToReceiveOnGridDest() const 
     717TRY 
    699718{ 
    700719  return localIndexToReceiveOnGridDest_; 
    701720} 
     721CATCH 
    702722 
    703723/*! 
     
    706726*/ 
    707727const std::list<size_t>& CGridTransformation::getNbLocalIndexToReceiveOnGridDest() const 
     728TRY 
    708729{ 
    709730  return nbLocalIndexOnGridDest_; 
    710731} 
     732CATCH 
    711733 
    712734/*! 
     
    715737*/ 
    716738const std::list<std::vector<bool> >& CGridTransformation::getLocalMaskIndexOnGridDest() const 
     739TRY 
    717740{ 
    718741  return localMaskOnGridDest_; 
    719742} 
    720  
    721 } 
     743CATCH 
     744 
     745} 
  • XIOS/trunk/src/transformation/grid_transformation_selector.cpp

    r1558 r1622  
    4747 : gridSource_(source), gridDestination_(destination), isSameGrid_(false), 
    4848  listAlgos_(), algoTypes_(), nbNormalAlgos_(0), nbSpecialAlgos_(0), auxInputs_() 
     49TRY 
    4950{ 
    5051  if (0 == source) 
     
    6263  initializeTransformations(type); 
    6364} 
     65CATCH 
    6466 
    6567/*! 
     
    7072*/ 
    7173void CGridTransformationSelector::initializeTransformations(TransformationType type) 
     74TRY 
    7275{ 
    7376  // Initialize algorithms 
     
    100103  } 
    101104} 
     105CATCH 
    102106 
    103107CGridTransformationSelector::~CGridTransformationSelector() 
     108TRY 
    104109{ 
    105110  std::vector<CGenericAlgorithmTransformation*>::const_iterator itb = algoTransformation_.begin(), it, 
     
    107112  for (it = itb; it != ite; ++it) delete (*it); 
    108113} 
     114CATCH 
    109115 
    110116/*! 
     
    112118*/ 
    113119void CGridTransformationSelector::updateElementPosition() 
     120TRY 
    114121{ 
    115122  int idxScalar = 0, idxAxis = 0, idxDomain = 0; 
     
    163170  } 
    164171} 
     172CATCH 
    165173 
    166174/*! 
     
    168176*/ 
    169177void CGridTransformationSelector::initializeAlgorithms() 
     178TRY 
    170179{ 
    171180  updateElementPosition(); 
     
    188197  } 
    189198} 
     199CATCH 
    190200 
    191201/*! 
     
    197207*/ 
    198208void CGridTransformationSelector::initializeScalarAlgorithms(int scalarPositionInGrid) 
     209TRY 
    199210{ 
    200211  std::vector<CScalar*> scalarListDestP = gridDestination_->getScalars(); 
     
    229240  } 
    230241} 
     242CATCH 
    231243 
    232244/*! 
     
    238250*/ 
    239251void CGridTransformationSelector::initializeAxisAlgorithms(int axisPositionInGrid) 
     252TRY 
    240253{ 
    241254  std::vector<CAxis*> axisListDestP = gridDestination_->getAxis(); 
     
    270283  } 
    271284} 
     285CATCH 
    272286 
    273287/*! 
     
    278292*/ 
    279293void CGridTransformationSelector::initializeDomainAlgorithms(int domPositionInGrid) 
     294TRY 
    280295{ 
    281296  std::vector<CDomain*> domListDestP = gridDestination_->getDomains(); 
     
    309324    } 
    310325  } 
    311  
    312 } 
     326} 
     327CATCH 
    313328 
    314329/*! 
     
    321336*/ 
    322337void CGridTransformationSelector::selectAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder, int algoType) 
     338TRY 
    323339{ 
    324340  updateElementPosition(); 
     
    338354  } 
    339355} 
     356CATCH 
    340357 
    341358bool CGridTransformationSelector::isSpecialTransformation(ETranformationType transType) 
     359TRY 
    342360{ 
    343361  bool res = false; 
     
    353371  return res; 
    354372} 
    355  
    356 } 
     373CATCH 
     374 
     375} 
  • XIOS/trunk/src/transformation/scalar_algorithm_extract_axis.cpp

    r1260 r1622  
    2626                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2727                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     28TRY 
    2829{ 
    2930  std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); 
     
    3637  return (new CScalarAlgorithmExtractAxis(scalarListDestP[scalarDstIndex], axisListSrcP[axisSrcIndex], extractAxis)); 
    3738} 
     39CATCH 
    3840 
    3941bool CScalarAlgorithmExtractAxis::registerTrans() 
     42TRY 
    4043{ 
    4144  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_EXTRACT_AXIS_TO_SCALAR, create); 
    4245} 
     46CATCH 
    4347 
    4448CScalarAlgorithmExtractAxis::CScalarAlgorithmExtractAxis(CScalar* scalarDestination, CAxis* axisSource, CExtractAxisToScalar* algo) 
    4549 : CScalarAlgorithmTransformation(scalarDestination, axisSource), 
    4650   reduction_(0) 
     51TRY 
    4752{ 
    4853  algo->checkValid(scalarDestination, axisSource); 
     
    5156  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    5257} 
     58CATCH 
    5359 
    5460void CScalarAlgorithmExtractAxis::apply(const std::vector<std::pair<int,double> >& localIndex, 
     
    5763                                         std::vector<bool>& flagInitial,                      
    5864                                         bool ignoreMissingValue, bool firstPass) 
     65TRY 
    5966{ 
    6067  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    6168} 
     69CATCH 
    6270 
    6371CScalarAlgorithmExtractAxis::~CScalarAlgorithmExtractAxis() 
     72TRY 
    6473{ 
    6574  if (0 != reduction_) delete reduction_; 
    6675} 
     76CATCH 
    6777 
    6878void CScalarAlgorithmExtractAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     79TRY 
    6980{ 
    7081  this->transformationMapping_.resize(1); 
     
    7788  transWeight[0].push_back(1.0); 
    7889} 
     90CATCH 
    7991 
    8092} 
  • XIOS/trunk/src/transformation/scalar_algorithm_reduce_axis.cpp

    r1297 r1622  
    2727                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2828                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     29TRY 
    2930{ 
    3031  std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); 
     
    3738  return (new CScalarAlgorithmReduceAxis(scalarListDestP[scalarDstIndex], axisListSrcP[axisSrcIndex], reduceAxis)); 
    3839} 
     40CATCH 
    3941 
    4042bool CScalarAlgorithmReduceAxis::registerTrans() 
     43TRY 
    4144{ 
    4245  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_AXIS_TO_SCALAR, create); 
    4346} 
     47CATCH 
    4448 
    4549CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CScalar* scalarDestination, CAxis* axisSource, CReduceAxisToScalar* algo) 
    4650 : CScalarAlgorithmTransformation(scalarDestination, axisSource), 
    4751   reduction_(0) 
     52TRY 
    4853{ 
    4954  if (algo->operation.isEmpty()) 
     
    8388  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    8489} 
     90CATCH 
    8591 
    8692void CScalarAlgorithmReduceAxis::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut, 
    8793                                         std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass) 
     94TRY 
    8895{ 
    8996  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    9097} 
     98CATCH 
    9199 
    92100void CScalarAlgorithmReduceAxis::updateData(CArray<double,1>& dataOut) 
     101TRY 
    93102{ 
    94103  reduction_->updateData(dataOut); 
    95104} 
     105CATCH 
    96106 
    97107CScalarAlgorithmReduceAxis::~CScalarAlgorithmReduceAxis() 
     108TRY 
    98109{ 
    99110  if (0 != reduction_) delete reduction_; 
    100111} 
     112CATCH 
    101113 
    102114void CScalarAlgorithmReduceAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     115TRY 
    103116{ 
    104117  this->transformationMapping_.resize(1); 
     
    116129  } 
    117130} 
     131CATCH 
    118132 
    119133} 
  • XIOS/trunk/src/transformation/scalar_algorithm_reduce_domain.cpp

    r1396 r1622  
    2626                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2727                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     28TRY 
    2829{ 
    2930  std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); 
     
    3637  return (new CScalarAlgorithmReduceDomain(scalarListDestP[scalarDstIndex], domainListSrcP[domainSrcIndex], reduceDomain)); 
    3738} 
     39CATCH 
    3840 
    3941bool CScalarAlgorithmReduceDomain::registerTrans() 
     42TRY 
    4043{ 
    4144  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_DOMAIN_TO_SCALAR, create); 
    4245} 
     46CATCH 
    4347 
    4448CScalarAlgorithmReduceDomain::CScalarAlgorithmReduceDomain(CScalar* scalarDestination, CDomain* domainSource, CReduceDomainToScalar* algo) 
    4549 : CScalarAlgorithmTransformation(scalarDestination, domainSource), 
    4650   reduction_(0) 
     51TRY 
    4752{ 
    4853  algo->checkValid(scalarDestination, domainSource); 
     
    8085  local = algo->local ; 
    8186} 
     87CATCH 
    8288 
    8389void CScalarAlgorithmReduceDomain::apply(const std::vector<std::pair<int,double> >& localIndex, 
     
    8692                                         std::vector<bool>& flagInitial,                      
    8793                                         bool ignoreMissingValue, bool firstPass) 
     94TRY 
    8895{ 
    8996  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    9097} 
     98CATCH 
    9199 
    92100void CScalarAlgorithmReduceDomain::updateData(CArray<double,1>& dataOut) 
     101TRY 
    93102{ 
    94103  reduction_->updateData(dataOut); 
    95104} 
     105CATCH 
    96106 
    97107CScalarAlgorithmReduceDomain::~CScalarAlgorithmReduceDomain() 
     108TRY 
    98109{ 
    99110  if (0 != reduction_) delete reduction_; 
    100111} 
     112CATCH 
    101113 
    102114void CScalarAlgorithmReduceDomain::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     115TRY 
    103116{ 
    104117  this->transformationMapping_.resize(1); 
     
    137150   
    138151} 
     152CATCH 
    139153 
    140154} 
  • XIOS/trunk/src/transformation/scalar_algorithm_reduce_scalar.cpp

    r1314 r1622  
    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 ; 
     
    7984  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    8085} 
     86CATCH 
    8187 
    8288void CScalarAlgorithmReduceScalar::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut, 
    8389                                         std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass) 
     90TRY 
    8491{ 
    8592  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    8693} 
     94CATCH 
    8795 
    8896void CScalarAlgorithmReduceScalar::updateData(CArray<double,1>& dataOut) 
     97TRY 
    8998{ 
    9099  reduction_->updateData(dataOut); 
    91100} 
     101CATCH 
    92102 
    93103CScalarAlgorithmReduceScalar::~CScalarAlgorithmReduceScalar() 
     104TRY 
    94105{ 
    95106  if (0 != reduction_) delete reduction_; 
    96107} 
     108CATCH 
    97109 
    98110void CScalarAlgorithmReduceScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     111TRY 
    99112{ 
    100113  this->transformationMapping_.resize(1); 
     
    108121 
    109122} 
     123CATCH 
    110124 
    111125} 
  • XIOS/trunk/src/transformation/scalar_algorithm_transformation.cpp

    r1403 r1622  
    5757                                                                int elementSourceType, 
    5858                                                                CClientClientDHTInt::Index2VectorInfoTypeMap& globalIndexElementSourceOnProc) 
     59TRY 
    5960{ 
    6061  CContext* context = CContext::getCurrent(); 
     
    121122  } 
    122123} 
    123  
     124CATCH 
    124125} 
  • XIOS/trunk/src/type/type.hpp

    r1478 r1622  
    4040    virtual void fromString(const string& str)   { _fromString(str); } 
    4141    virtual string toString(void) const { return _toString(); } 
     42    virtual string dump(void) const { return _toString(); } 
    4243    virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer) ; } 
    4344    virtual bool toBuffer(CBufferOut& buffer) const { return _toBuffer(buffer); } 
  • XIOS/trunk/src/xios_spl.hpp

    r1542 r1622  
    3131/// boost headers /// 
    3232#include <boost/cast.hpp> 
     33#include <boost/current_function.hpp> 
    3334/// Map /// 
    3435#define xios_map std::map 
  • XIOS/trunk/src/xml_parser.cpp

    r1158 r1622  
    1414 
    1515      void CXMLParser::ParseFile(const StdString & filename, const std::set<StdString>& parseContextList) 
     16      TRY 
    1617      { 
    1718         StdIFStream ifs ( filename.c_str() , StdIFStream::in ); 
     
    2223         CXMLParser::ParseStream(ifs, filename, parseContextList); 
    2324      } 
     25      CATCH 
    2426 
    2527      void CXMLParser::ParseString(const StdString & xmlContent) 
     
    5456            std::set<StdString>::const_iterator itE = parseContextList.end(); 
    5557            bool isParseAll = (parseContextList.empty()); 
    56             if (node.goToChildElement()) 
     58            try 
    5759            { 
    58                do 
    59                { 
    60                   CContextGroup* group_context = CContext::getRoot() ; 
     60              if (node.goToChildElement()) 
     61              { 
     62                 do 
     63                 { 
     64                    CContextGroup* group_context = CContext::getRoot() ; 
    6165 
    62                   attributes = node.getAttributes(); 
     66                    attributes = node.getAttributes(); 
    6367 
    64                   if (attributes.end() == attributes.find("id")) 
    65                   { 
    66                      DEBUG("The context will not be processed because it is not identified (missing id)"); 
    67                      continue; 
    68                   } 
     68                    if (attributes.end() == attributes.find("id")) 
     69                    { 
     70                       DEBUG("The context will not be processed because it is not identified (missing id)"); 
     71                       continue; 
     72                    } 
    6973 
    70                   CContext::setCurrent(attributes["id"]) ; 
     74                    CContext::setCurrent(attributes["id"]) ; 
    7175 
    72  
    73                   if (isParseAll) 
    74                   { 
    75                     CContext* context = CContext::create(attributes["id"]); 
    76                     context->parse(node); 
    77  
    78                     attributes.clear(); 
    79                   } 
    80                   else 
    81                   { 
    82                     it = parseContextList.find(attributes["id"]); 
    83                     if (itE != it) 
     76                    if (isParseAll) 
    8477                    { 
    85                       CContext* context = CContext::create(*it); 
     78                      CContext* context = CContext::create(attributes["id"]); 
    8679                      context->parse(node); 
    8780 
    8881                      attributes.clear(); 
    8982                    } 
    90                   } 
    91                } while (node.goToNextElement()); 
     83                    else 
     84                    { 
     85                      it = parseContextList.find(attributes["id"]); 
     86                      if (itE != it) 
     87                      { 
     88                        CContext* context = CContext::create(*it); 
     89                        context->parse(node); 
     90 
     91                        attributes.clear(); 
     92                      } 
     93                    } 
     94                 } while (node.goToNextElement()); 
     95              } 
    9296            } 
     97            catch(CException& e) 
     98            { 
     99              CException::StackInfo stk; 
     100              stk.info.append("Exception occurred while parsing XML file \""); 
     101              stk.info.append(attributes["src"]); 
     102              stk.info.append("\".\n"); 
     103              stk.file = FILE_NAME; 
     104              stk.function = FUNCTION_NAME; 
     105              stk.line = __LINE__; 
     106              e.stack.push_back(stk); 
     107              if (CXios::xiosStack) 
     108                throw; 
     109             else 
     110               throw 0; 
     111            } 
     112            catch(...) 
     113            { 
     114              CException exc; 
     115              CException::StackInfo stk; 
     116              stk.info.append("Exception occurred while parsing XML file \""); 
     117              stk.info.append(attributes["src"]); 
     118              stk.info.append("\".\n"); 
     119              stk.file = FILE_NAME; 
     120              stk.function = FUNCTION_NAME; 
     121              stk.line = __LINE__; 
     122              exc.stack.push_back(stk); 
     123              if (CXios::xiosStack) 
     124                throw exc; 
     125             else 
     126               throw 0; 
     127            } 
     128 
    93129         } 
    94130         catch (rapidxml::parse_error & exc) 
     
    110146                  << "Error is occuring when parsing XML flux from <"<<fluxId<<"> at character "<< pos<<" line "<<lineNumber<<" column "<< columnNumber<< endl 
    111147                  << strLine<<endl 
    112                   << string(columnNumber-1,'x')<<'^'<<endl 
    113                   <<" Error : " << exc.what() ) 
     148                  << string(columnNumber-1,'x')<<'^'<<endl) 
     149//                  <<" Error : " << exc.what() ) 
    114150         } 
    115151      } 
  • XIOS/trunk/src/xml_parser.hpp

    r591 r1622  
    55#include "xios_spl.hpp" 
    66#include "exception.hpp" 
     7#include "cxios.hpp" 
    78#include "xml_node.hpp" 
    89 
  • XIOS/trunk/src/xml_parser_impl.hpp

    r591 r1622  
    3939                  << "Error is occuring when parsing XML flux from <"<<fluxId<<"> at character "<< pos<<" line "<<lineNumber<<" column "<< columnNumber<< endl 
    4040                  << strLine<<endl 
    41                   << string(columnNumber-1,'x')<<'^'<<endl 
    42                   <<" Error : " << exc.what() ) 
     41                  << string(columnNumber-1,'x')<<'^'<<endl) 
     42//                  <<" Error : " << exc.what() ) 
    4343         } 
    4444      } 
Note: See TracChangeset for help on using the changeset viewer.