Changeset 1622


Ignore:
Timestamp:
12/11/18 13:22:07 (4 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   {