Changeset 1622
- Timestamp:
- 12/11/18 13:22:07 (4 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 89 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/array_new.hpp
r1290 r1622 532 532 virtual void fromString(const string& str) { istringstream iss(str); iss >> *this; initialized = true; } 533 533 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 534 546 virtual void reset(void) { this->free(); initialized = false; } 535 547 virtual bool isEmpty(void) const { return !initialized; } -
XIOS/trunk/src/attribute.hpp
r1158 r1622 41 41 virtual StdString toString(void) const = 0; 42 42 virtual void fromString(const StdString & str) = 0; 43 virtual StdString dump(void) const = 0; 43 44 virtual bool isEqual(const CAttribute& ) = 0; 44 45 -
XIOS/trunk/src/attribute_array.hpp
r1219 r1622 55 55 virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} 56 56 virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } 57 virtual string dump(void) const { return _dump();} 57 58 58 59 virtual void generateCInterface(ostream& oss,const string& className) ; … … 69 70 CArray<T_numtype, N_rank> inheritedValue ; 70 71 StdString _toString(void) const; 72 StdString _dump(void) const; 71 73 void _fromString(const StdString & str); 72 74 bool _toBuffer (CBufferOut& buffer) const; -
XIOS/trunk/src/attribute_array_impl.hpp
r1219 r1622 129 129 } 130 130 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 131 141 template <typename T_numtype, int N_rank> 132 142 void CAttributeArray<T_numtype, N_rank>::_fromString(const StdString & str) -
XIOS/trunk/src/attribute_enum.hpp
r1219 r1622 14 14 namespace xios 15 15 { 16 /// ////////////////////// D éclarations ////////////////////// ///16 /// ////////////////////// Declarations ////////////////////// /// 17 17 /*! 18 18 \class CAttributeEnum … … 62 62 virtual StdString toString(void) const { return _toString();} 63 63 virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;} else _fromString(str);} 64 virtual StdString dump(void) const { return _toString();} 64 65 65 66 virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} -
XIOS/trunk/src/attribute_map.cpp
r1158 r1622 28 28 att.second->reset(); 29 29 } 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; 30 59 } 31 60 -
XIOS/trunk/src/attribute_map.hpp
r1158 r1622 38 38 void duplicateAttributes(const CAttributeMap* const _parent); 39 39 void clearAllAttributes(void); 40 StdString dumpXiosAttributes(void) const; 40 41 41 42 void clearAttribute(const StdString& key); -
XIOS/trunk/src/attribute_template.hpp
r1478 r1622 74 74 // virtual void toBinary (StdOStream & os) const; 75 75 // virtual void fromBinary(StdIStream & is); 76 virtual StdString dump(void) const { return _dump();} 76 77 77 78 virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} … … 98 99 bool isEqual_(const CAttributeTemplate& attr); 99 100 StdString _toString(void) const; 101 StdString _dump(void) const; 100 102 void _fromString(const StdString & str); 101 103 bool _toBuffer (CBufferOut& buffer) const; -
XIOS/trunk/src/attribute_template_impl.hpp
r1478 r1622 199 199 CType<T>::fromString(str) ; 200 200 } 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 201 213 202 214 //--------------------------------------------------------------- -
XIOS/trunk/src/cxios.cpp
r1519 r1622 20 20 string CXios::serverPrmFile="./xios_server1"; 21 21 string CXios::serverSndFile="./xios_server2"; 22 23 bool CXios::xiosStack = true; 24 bool CXios::systemStack = false; 22 25 23 26 bool CXios::isClient ; … … 62 65 printLogs2Files=getin<bool>("print_file",false); 63 66 67 xiosStack=getin<bool>("xios_stack",true) ; 68 systemStack=getin<bool>("system_stack",false) ; 69 if (xiosStack && systemStack) 70 { 71 xiosStack = false; 72 } 73 64 74 StdString bufMemory("memory"); 65 75 StdString bufPerformance("performance"); … … 91 101 */ 92 102 void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm) 103 TRY 93 104 { 94 105 initialize() ; … … 114 125 } 115 126 } 127 CATCH 116 128 117 129 void CXios::clientFinalize(void) -
XIOS/trunk/src/cxios.hpp
r1377 r1622 33 33 static string serverPrmFile; //!< Filename template for primary server in case of two server levels 34 34 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 35 38 36 39 static bool isClient ; //!< Check if xios is client -
XIOS/trunk/src/data_output.cpp
r1542 r1622 47 47 48 48 void CDataOutput::writeGrid(CDomain* domain, CAxis* axis) 49 TRY 49 50 { 50 51 this->writeDomain_(domain); 51 52 this->writeAxis_(axis); 52 53 } 54 CATCH 53 55 54 56 void CDataOutput::writeGrid(std::vector<CDomain*> domains, std::vector<CAxis*> axis) 57 TRY 55 58 { 56 59 int domSize = domains.size(); … … 59 62 for (int i = 0; i < aSize; ++i) this->writeAxis_(axis[i]); 60 63 } 64 CATCH 61 65 62 66 void CDataOutput::writeGrid(std::vector<CDomain*> domains, std::vector<CAxis*> axis, std::vector<CScalar*> scalars) 67 TRY 63 68 { 64 69 int domSize = domains.size(); … … 69 74 for (int i = 0; i < sSize; ++i) this->writeScalar_(scalars[i]); 70 75 } 76 CATCH 71 77 72 78 //---------------------------------------------------------------- 73 79 74 80 void CDataOutput::writeGrid(CDomain* domain) 81 TRY 75 82 { 76 83 this->writeDomain_(domain); 77 84 } 85 CATCH 78 86 79 87 void CDataOutput::writeTimeDimension(void) 88 TRY 80 89 { 81 90 this->writeTimeDimension_(); 82 91 } 92 CATCH 83 93 84 94 //---------------------------------------------------------------- 85 95 86 96 void CDataOutput::writeFieldTimeAxis(CField* field) 97 TRY 87 98 { 88 99 CContext* context = CContext::getCurrent() ; … … 91 102 this->writeTimeAxis_(field, calendar); 92 103 } 93 104 CATCH 105 94 106 void CDataOutput::writeField(CField* field) 107 TRY 95 108 { 96 109 this->writeField_(field); 97 110 } 111 CATCH 98 112 99 113 //---------------------------------------------------------------- 100 114 101 115 void CDataOutput::writeFieldGrid(CField* field) 116 TRY 102 117 { 103 118 this->writeGrid(field->getRelGrid(), 104 119 !field->indexed_output.isEmpty() && field->indexed_output); 105 120 } 106 121 CATCH 107 122 //---------------------------------------------------------------- 108 123 109 124 void CDataOutput::writeFieldData(CField* field) 125 TRY 110 126 { 111 127 // CGrid* grid = CGrid::get(field->grid_ref.getValue()); … … 113 129 this->writeFieldData_(field); 114 130 } 131 CATCH 115 132 116 133 ///---------------------------------------------------------------- -
XIOS/trunk/src/exception.cpp
r828 r1622 5 5 #include "client.hpp" 6 6 #include "server.hpp" 7 #include "cxios.hpp"8 7 #include "log.hpp" 9 8 … … 12 11 /// ////////////////////// Définitions ////////////////////// /// 13 12 CException::CException(void) 14 : CObject(), desc_rethrow(true) 13 : CObject(), desc_rethrow(true), stream() 15 14 { /* Ne rien faire de plus */ } 16 15 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() 19 18 { /* Ne rien faire de plus */ } 20 19 21 20 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) 26 25 { (*this) << exception.str(); } 27 26 28 27 CException::~CException(void) 29 28 { 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 41 41 } 42 42 43 43 //--------------------------------------------------------------- 44 44 45 StdString CException::getMessage(void) const45 std::string CException::getMessage(void) const 46 46 { 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()); 50 51 } 51 52 52 53 StdOStringStream & CException::getStream(void) 53 { return (*boost::polymorphic_cast<StdOStringStream*>(this)); } 54 // { return (*boost::polymorphic_cast<StdOStringStream*>(this)); } 55 { return stream; } 54 56 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(); } 57 60 58 void CException::fromString(const StdString & str) 59 { this->str(str); } 61 void CException::fromString(const std::string & str) 62 { } 63 // { this->str(str); } 60 64 61 65 //--------------------------------------------------------------- -
XIOS/trunk/src/exception.hpp
r792 r1622 5 5 #include "xios_spl.hpp" 6 6 #include "object.hpp" 7 #include <iomanip> 8 #include <stdexcept> 7 9 8 10 namespace xios 9 11 { 10 12 /// ////////////////////// Déclarations ////////////////////// /// 13 11 14 class CException 12 15 : private CObject, public StdOStringStream … … 33 36 virtual void fromString(const StdString & str); 34 37 38 struct StackInfo 39 { 40 StdString file; 41 StdString function; 42 int line; 43 StdString info; 44 }; 45 46 std::list<StackInfo> stack; 47 35 48 private : 36 49 37 50 /// Propriétés /// 38 51 bool desc_rethrow; // throw destructor 52 StdOStringStream stream; 39 53 40 54 }; // CException … … 43 57 /// //////////////////////////// Macros //////////////////////////// /// 44 58 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 45 64 #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; 47 66 48 67 #ifdef __XIOS_DEBUG … … 52 71 #endif 53 72 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 55 159 56 160 #endif // __XIOS_CException__ 161 -
XIOS/trunk/src/interface/c/icaxis.cpp
r1542 r1622 28 28 29 29 void cxios_axis_handle_create (XAxisPtr * _ret, const char * _id, int _id_len) 30 TRY 30 31 { 31 32 std::string id; … … 35 36 CTimer::get("XIOS").suspend() ; 36 37 } 38 CATCH_DUMP_STACK 37 39 38 40 void cxios_axisgroup_handle_create (XAxisGroupPtr * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 44 47 CTimer::get("XIOS").suspend() ; 45 48 } 49 CATCH_DUMP_STACK 46 50 47 51 // -------------------- Vérification des identifiants ----------------------- 48 52 49 53 void cxios_axis_valid_id (bool * _ret, const char * _id, int _id_len) 54 TRY 50 55 { 51 56 std::string id; … … 56 61 CTimer::get("XIOS").suspend() ; 57 62 } 63 CATCH_DUMP_STACK 58 64 59 65 void cxios_axisgroup_valid_id (bool * _ret, const char * _id, int _id_len) 66 TRY 60 67 { 61 68 std::string id; … … 67 74 68 75 } 76 CATCH_DUMP_STACK 69 77 70 78 } // extern "C" -
XIOS/trunk/src/interface/c/iccalendar.cpp
r1542 r1622 10 10 { 11 11 void cxios_update_calendar(int step) 12 TRY 12 13 { 13 14 CTimer::get("XIOS").resume(); … … 19 20 CTimer::get("XIOS").suspend(); 20 21 } 22 CATCH_DUMP_STACK 21 23 22 24 void cxios_get_current_date(cxios_date* current_date_c) 25 TRY 23 26 { 24 27 CTimer::get("XIOS").resume(); … … 37 40 CTimer::get("XIOS").suspend(); 38 41 } 42 CATCH_DUMP_STACK 39 43 40 44 int cxios_get_year_length_in_seconds(int year) 45 TRY 41 46 { 42 47 CTimer::get("XIOS").resume(); … … 50 55 return length; 51 56 } 57 CATCH_DUMP_STACK 52 58 53 59 int cxios_get_day_length_in_seconds() 60 TRY 54 61 { 55 62 CTimer::get("XIOS").resume(); … … 63 70 return length; 64 71 } 72 CATCH_DUMP_STACK 65 73 } -
XIOS/trunk/src/interface/c/iccalendar_wrapper.cpp
r1542 r1622 29 29 30 30 void cxios_calendar_wrapper_handle_create(XCalendarWrapperPtr* _ret, const char* _id, int _id_len) 31 TRY 31 32 { 32 33 std::string id; … … 36 37 CTimer::get("XIOS").suspend(); 37 38 } 39 CATCH_DUMP_STACK 38 40 39 41 void cxios_get_current_calendar_wrapper(XCalendarWrapperPtr* _ret) 42 TRY 40 43 { 41 44 CTimer::get("XIOS").resume(); … … 43 46 CTimer::get("XIOS").suspend(); 44 47 } 48 CATCH_DUMP_STACK 45 49 46 50 // -------------------- Vérification des identifiants ----------------------- 47 51 48 52 void cxios_calendar_wrapper_valid_id(bool* _ret, const char* _id, int _id_len) 53 TRY 49 54 { 50 55 std::string id; … … 54 59 CTimer::get("XIOS").suspend(); 55 60 } 61 CATCH_DUMP_STACK 56 62 57 63 // ----------------------- Custom getters and setters ----------------------- 58 64 59 65 void cxios_set_calendar_wrapper_date_start_date(XCalendarWrapperPtr calendarWrapper_hdl, cxios_date start_date_c) 66 TRY 60 67 { 61 68 CTimer::get("XIOS").resume(); … … 70 77 CTimer::get("XIOS").suspend(); 71 78 } 79 CATCH_DUMP_STACK 72 80 73 81 void cxios_get_calendar_wrapper_date_start_date(XCalendarWrapperPtr calendarWrapper_hdl, cxios_date* start_date_c) 82 TRY 74 83 { 75 84 CTimer::get("XIOS").resume(); … … 83 92 CTimer::get("XIOS").suspend(); 84 93 } 94 CATCH_DUMP_STACK 85 95 86 96 void cxios_set_calendar_wrapper_date_time_origin(XCalendarWrapperPtr calendarWrapper_hdl, cxios_date time_origin_c) 97 TRY 87 98 { 88 99 CTimer::get("XIOS").resume(); … … 97 108 CTimer::get("XIOS").suspend(); 98 109 } 110 CATCH_DUMP_STACK 99 111 100 112 void cxios_get_calendar_wrapper_date_time_origin(XCalendarWrapperPtr calendarWrapper_hdl, cxios_date* time_origin_c) 113 TRY 101 114 { 102 115 CTimer::get("XIOS").resume(); … … 110 123 CTimer::get("XIOS").suspend(); 111 124 } 125 CATCH_DUMP_STACK 112 126 113 127 // ----------------------- Calendar creation and update ---------------------- 114 128 115 129 void cxios_create_calendar(XCalendarWrapperPtr calendarWrapper_hdl) 130 TRY 116 131 { 117 132 CTimer::get("XIOS").resume(); … … 119 134 CTimer::get("XIOS").suspend(); 120 135 } 136 CATCH_DUMP_STACK 121 137 122 138 void cxios_update_calendar_timestep(XCalendarWrapperPtr calendarWrapper_hdl) 139 TRY 123 140 { 124 141 CTimer::get("XIOS").resume(); … … 126 143 CTimer::get("XIOS").suspend(); 127 144 } 145 CATCH_DUMP_STACK 128 146 } // extern "C" -
XIOS/trunk/src/interface/c/iccompute_connectivity_domain.cpp
r1542 r1622 25 25 // ------------------------ Création des handle ----------------------------- 26 26 void cxios_compute_connectivity_domain_handle_create(XComConDomainPtr * _ret, const char * _id, int _id_len) 27 TRY 27 28 { 28 29 std::string id; … … 32 33 CTimer::get("XIOS").suspend() ; 33 34 } 35 CATCH_DUMP_STACK 34 36 35 37 // -------------------- Vérification des identifiants ----------------------- 36 38 void cxios_compute_connectivity_domain_valid_id(bool * _ret, const char * _id, int _id_len) 39 TRY 37 40 { 38 41 std::string id; … … 43 46 CTimer::get("XIOS").suspend() ; 44 47 } 48 CATCH_DUMP_STACK 45 49 } // extern "C" -
XIOS/trunk/src/interface/c/iccontext.cpp
r1542 r1622 32 32 33 33 void cxios_context_handle_create (XContextPtr * _ret, const char * _id, int _id_len) 34 TRY 34 35 { 35 36 std::string id; … … 54 55 // Lever une exeception ici 55 56 } 57 CATCH_DUMP_STACK 56 58 57 59 // ------------------------ Changements de contextes ------------------------ 58 60 59 61 void cxios_context_get_current(XContextPtr* context) 62 TRY 60 63 { 61 64 CTimer::get("XIOS").resume(); … … 63 66 CTimer::get("XIOS").suspend(); 64 67 } 68 CATCH_DUMP_STACK 65 69 66 70 void cxios_context_set_current(XContextPtr context, bool withswap) 71 TRY 67 72 { 68 73 CTimer::get("XIOS").resume() ; … … 70 75 CTimer::get("XIOS").suspend() ; 71 76 } 77 CATCH_DUMP_STACK 72 78 73 79 // -------------------- Vérification des identifiants ----------------------- 74 80 75 81 void cxios_context_valid_id (bool * _ret, const char * _id, int _id_len) 82 TRY 76 83 { 77 84 std::string id; … … 93 100 CTimer::get("XIOS").suspend(); 94 101 } 102 CATCH_DUMP_STACK 95 103 } // extern "C" -
XIOS/trunk/src/interface/c/icdata.cpp
r1587 r1622 43 43 // it is only used from the parse_xml.exe standalone test tool. 44 44 void cxios_init(void) 45 TRY 45 46 { 46 47 CXios::initialize(); 47 48 } 49 CATCH_DUMP_STACK 48 50 49 51 void cxios_init_server(void) 52 TRY 50 53 { 51 54 CXios::initServerSide(); 52 55 } 56 CATCH_DUMP_STACK 53 57 54 58 void cxios_init_client(const char* client_id , int len_client_id, MPI_Fint* f_local_comm, MPI_Fint* f_return_comm ) 59 TRY 55 60 { 56 61 std::string str; … … 69 74 CTimer::get("XIOS").suspend(); 70 75 } 76 CATCH_DUMP_STACK 71 77 72 78 void cxios_context_initialize(const char* context_id , int len_context_id, MPI_Fint* f_comm) 79 TRY 73 80 { 74 81 std::string str; … … 83 90 CTimer::get("XIOS").suspend(); 84 91 } 92 CATCH_DUMP_STACK 85 93 86 94 void cxios_oasis_enddef() 95 TRY 87 96 { 88 97 CTimer::get("XIOS").resume(); … … 90 99 CTimer::get("XIOS").suspend(); 91 100 } 101 CATCH_DUMP_STACK 92 102 93 103 void cxios_context_is_initialized(const char* context_id , int len_context_id, bool* initialized) 104 TRY 94 105 { 95 106 std::string str; … … 101 112 CTimer::get("XIOS").suspend(); 102 113 } 103 104 void cxios_context_close_definition() 114 CATCH_DUMP_STACK 115 116 void cxios_context_close_definition() 117 TRY 105 118 { 106 119 CTimer::get("XIOS").resume(); … … 111 124 CTimer::get("XIOS").suspend(); 112 125 } 126 CATCH_DUMP_STACK 113 127 114 128 void cxios_context_finalize() 129 TRY 115 130 { 116 131 CTimer::get("XIOS").resume(); … … 121 136 CTimer::get("XIOS").suspend(); 122 137 } 138 CATCH_DUMP_STACK 123 139 124 140 void cxios_finalize() 141 TRY 125 142 { 126 143 CTimer::get("XIOS").resume(); … … 128 145 CXios::clientFinalize(); 129 146 } 147 CATCH_DUMP_STACK 130 148 131 149 void cxios_solve_inheritance() 150 TRY 132 151 { 133 152 CTimer::get("XIOS").resume(); … … 136 155 CTimer::get("XIOS").suspend(); 137 156 } 157 CATCH_DUMP_STACK 138 158 139 159 /*! \brief This group of functions retrieve variable information from the configuration file (.xml) … … 148 168 */ 149 169 void cxios_get_variable_data_k8(const char* varId, int varIdSize, double* data, bool* isVarExisted) 170 TRY 150 171 { 151 172 std::string varIdStr; … … 166 187 CTimer::get("XIOS").suspend(); 167 188 } 189 CATCH_DUMP_STACK 168 190 169 191 void cxios_get_variable_data_k4(const char* varId, int varIdSize, float* data, bool* isVarExisted) 192 TRY 170 193 { 171 194 std::string varIdStr; … … 186 209 CTimer::get("XIOS").suspend(); 187 210 } 211 CATCH_DUMP_STACK 188 212 189 213 void cxios_get_variable_data_int(const char* varId, int varIdSize, int* data, bool* isVarExisted) 214 TRY 190 215 { 191 216 std::string varIdStr; … … 206 231 CTimer::get("XIOS").suspend(); 207 232 } 233 CATCH_DUMP_STACK 208 234 209 235 void cxios_get_variable_data_logic(const char* varId, int varIdSize, bool* data, bool* isVarExisted) 236 TRY 210 237 { 211 238 std::string varIdStr; … … 226 253 CTimer::get("XIOS").suspend(); 227 254 } 255 CATCH_DUMP_STACK 228 256 229 257 void cxios_get_variable_data_char(const char* varId, int varIdSize, char* data, int dataSizeIn, bool* isVarExisted) 258 TRY 230 259 { 231 260 std::string varIdStr; … … 247 276 CTimer::get("XIOS").suspend(); 248 277 } 278 CATCH_DUMP_STACK 249 279 250 280 /*! \brief This group of functions write information into existing variable in the configuration file (.xml) … … 259 289 */ 260 290 void cxios_set_variable_data_k8(const char* varId, int varIdSize, double data, bool* isVarExisted) 261 { 291 TRY 292 { 262 293 std::string varIdStr; 263 294 if (!cstr2string(varId, varIdSize, varIdStr)) return; … … 278 309 CTimer::get("XIOS").suspend(); 279 310 } 311 CATCH_DUMP_STACK 280 312 281 313 void cxios_set_variable_data_k4(const char* varId, int varIdSize, float data, bool* isVarExisted) 314 TRY 282 315 { 283 316 std::string varIdStr; … … 299 332 CTimer::get("XIOS").suspend(); 300 333 } 334 CATCH_DUMP_STACK 301 335 302 336 void cxios_set_variable_data_int(const char* varId, int varIdSize, int data, bool* isVarExisted) 337 TRY 303 338 { 304 339 std::string varIdStr; … … 321 356 CTimer::get("XIOS").suspend(); 322 357 } 358 CATCH_DUMP_STACK 323 359 324 360 void cxios_set_variable_data_logic(const char* varId, int varIdSize, bool data, bool* isVarExisted) 361 TRY 325 362 { 326 363 std::string varIdStr; … … 342 379 CTimer::get("XIOS").suspend(); 343 380 } 381 CATCH_DUMP_STACK 344 382 345 383 void cxios_set_variable_data_char(const char* varId, int varIdSize, const char* data, int dataSizeIn, bool* isVarExisted) 346 { 384 TRY 385 { 347 386 std::string varIdStr, dataStr; 348 387 if (!cstr2string(varId, varIdSize, varIdStr)) return; … … 368 407 CTimer::get("XIOS").suspend(); 369 408 } 370 409 CATCH_DUMP_STACK 371 410 372 411 // ---------------------- Ecriture des données ------------------------------ 373 412 374 413 void cxios_write_data_k80(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 414 TRY 375 415 { 376 416 std::string fieldid_str; … … 387 427 CTimer::get("XIOS").suspend(); 388 428 } 429 CATCH_DUMP_STACK 389 430 390 431 void cxios_write_data_k81(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 432 TRY 391 433 { 392 434 std::string fieldid_str; … … 406 448 CTimer::get("XIOS").suspend(); 407 449 } 450 CATCH_DUMP_STACK 408 451 409 452 void cxios_write_data_k82(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize, int data_Ysize) 453 TRY 410 454 { 411 455 std::string fieldid_str; … … 425 469 CTimer::get("XIOS").suspend(); 426 470 } 471 CATCH_DUMP_STACK 427 472 428 473 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 429 475 { 430 476 std::string fieldid_str; … … 444 490 CTimer::get("XIOS").suspend(); 445 491 } 492 CATCH_DUMP_STACK 446 493 447 494 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 448 496 { 449 497 std::string fieldid_str; … … 463 511 CTimer::get("XIOS").suspend(); 464 512 } 513 CATCH_DUMP_STACK 465 514 466 515 void cxios_write_data_k85(const char* fieldid, int fieldid_size, double* data_k8, 467 516 int data_0size, int data_1size, int data_2size, 468 517 int data_3size, int data_4size) 518 TRY 469 519 { 470 520 std::string fieldid_str; … … 484 534 CTimer::get("XIOS").suspend(); 485 535 } 536 CATCH_DUMP_STACK 486 537 487 538 void cxios_write_data_k86(const char* fieldid, int fieldid_size, double* data_k8, 488 539 int data_0size, int data_1size, int data_2size, 489 540 int data_3size, int data_4size, int data_5size) 541 TRY 490 542 { 491 543 std::string fieldid_str; … … 505 557 CTimer::get("XIOS").suspend(); 506 558 } 559 CATCH_DUMP_STACK 507 560 508 561 void cxios_write_data_k87(const char* fieldid, int fieldid_size, double* data_k8, … … 510 563 int data_3size, int data_4size, int data_5size, 511 564 int data_6size) 565 TRY 512 566 { 513 567 std::string fieldid_str; … … 527 581 CTimer::get("XIOS").suspend(); 528 582 } 583 CATCH_DUMP_STACK 529 584 530 585 void cxios_write_data_k40(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 586 TRY 531 587 { 532 588 std::string fieldid_str; … … 546 602 CTimer::get("XIOS").suspend(); 547 603 } 604 CATCH_DUMP_STACK 548 605 549 606 void cxios_write_data_k41(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 607 TRY 550 608 { 551 609 std::string fieldid_str; … … 567 625 CTimer::get("XIOS").suspend(); 568 626 } 627 CATCH_DUMP_STACK 569 628 570 629 void cxios_write_data_k42(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize, int data_Ysize) 630 TRY 571 631 { 572 632 std::string fieldid_str; … … 588 648 CTimer::get("XIOS").suspend(); 589 649 } 650 CATCH_DUMP_STACK 590 651 591 652 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 592 654 { 593 655 std::string fieldid_str; … … 609 671 CTimer::get("XIOS").suspend(); 610 672 } 673 CATCH_DUMP_STACK 611 674 612 675 void cxios_write_data_k44(const char* fieldid, int fieldid_size, float* data_k4, 613 676 int data_0size, int data_1size, int data_2size, 614 677 int data_3size) 678 TRY 615 679 { 616 680 std::string fieldid_str; … … 632 696 CTimer::get("XIOS").suspend(); 633 697 } 698 CATCH_DUMP_STACK 634 699 635 700 void cxios_write_data_k45(const char* fieldid, int fieldid_size, float* data_k4, 636 701 int data_0size, int data_1size, int data_2size, 637 702 int data_3size, int data_4size) 703 TRY 638 704 { 639 705 std::string fieldid_str; … … 655 721 CTimer::get("XIOS").suspend(); 656 722 } 723 CATCH_DUMP_STACK 657 724 658 725 void cxios_write_data_k46(const char* fieldid, int fieldid_size, float* data_k4, 659 726 int data_0size, int data_1size, int data_2size, 660 727 int data_3size, int data_4size, int data_5size) 728 TRY 661 729 { 662 730 std::string fieldid_str; … … 678 746 CTimer::get("XIOS").suspend(); 679 747 } 748 CATCH_DUMP_STACK 680 749 681 750 void cxios_write_data_k47(const char* fieldid, int fieldid_size, float* data_k4, … … 683 752 int data_3size, int data_4size, int data_5size, 684 753 int data_6size) 754 TRY 685 755 { 686 756 std::string fieldid_str; … … 702 772 CTimer::get("XIOS").suspend(); 703 773 } 774 CATCH_DUMP_STACK 704 775 705 776 // ---------------------- Lecture des données ------------------------------ 706 777 707 778 void cxios_read_data_k80(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 779 TRY 708 780 { 709 781 std::string fieldid_str; … … 723 795 CTimer::get("XIOS").suspend(); 724 796 } 797 CATCH_DUMP_STACK 725 798 726 799 void cxios_read_data_k81(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 800 TRY 727 801 { 728 802 std::string fieldid_str; … … 742 816 CTimer::get("XIOS").suspend(); 743 817 } 818 CATCH_DUMP_STACK 744 819 745 820 void cxios_read_data_k82(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize, int data_Ysize) 821 TRY 746 822 { 747 823 std::string fieldid_str; … … 761 837 CTimer::get("XIOS").suspend(); 762 838 } 839 CATCH_DUMP_STACK 763 840 764 841 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 765 843 { 766 844 std::string fieldid_str; … … 780 858 CTimer::get("XIOS").suspend(); 781 859 } 860 CATCH_DUMP_STACK 782 861 783 862 void cxios_read_data_k84(const char* fieldid, int fieldid_size, double* data_k8, 784 863 int data_0size, int data_1size, int data_2size, 785 864 int data_3size) 865 TRY 786 866 { 787 867 std::string fieldid_str; … … 801 881 CTimer::get("XIOS").suspend(); 802 882 } 883 CATCH_DUMP_STACK 803 884 804 885 void cxios_read_data_k85(const char* fieldid, int fieldid_size, double* data_k8, 805 886 int data_0size, int data_1size, int data_2size, 806 887 int data_3size, int data_4size) 888 TRY 807 889 { 808 890 std::string fieldid_str; … … 822 904 CTimer::get("XIOS").suspend(); 823 905 } 906 CATCH_DUMP_STACK 824 907 825 908 void cxios_read_data_k86(const char* fieldid, int fieldid_size, double* data_k8, 826 909 int data_0size, int data_1size, int data_2size, 827 910 int data_3size, int data_4size, int data_5size) 911 TRY 828 912 { 829 913 std::string fieldid_str; … … 843 927 CTimer::get("XIOS").suspend(); 844 928 } 929 CATCH_DUMP_STACK 845 930 846 931 void cxios_read_data_k87(const char* fieldid, int fieldid_size, double* data_k8, … … 848 933 int data_3size, int data_4size, int data_5size, 849 934 int data_6size) 935 TRY 850 936 { 851 937 std::string fieldid_str; … … 865 951 CTimer::get("XIOS").suspend(); 866 952 } 953 CATCH_DUMP_STACK 867 954 868 955 void cxios_read_data_k40(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 956 TRY 869 957 { 870 958 std::string fieldid_str; … … 886 974 CTimer::get("XIOS").suspend(); 887 975 } 976 CATCH_DUMP_STACK 888 977 889 978 void cxios_read_data_k41(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize) 979 TRY 890 980 { 891 981 std::string fieldid_str; … … 907 997 CTimer::get("XIOS").suspend(); 908 998 } 999 CATCH_DUMP_STACK 909 1000 910 1001 void cxios_read_data_k42(const char* fieldid, int fieldid_size, float* data_k4, int data_Xsize, int data_Ysize) 1002 TRY 911 1003 { 912 1004 std::string fieldid_str; … … 928 1020 CTimer::get("XIOS").suspend(); 929 1021 } 1022 CATCH_DUMP_STACK 930 1023 931 1024 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 932 1026 { 933 1027 std::string fieldid_str; … … 949 1043 CTimer::get("XIOS").suspend(); 950 1044 } 1045 CATCH_DUMP_STACK 951 1046 952 1047 void cxios_read_data_k44(const char* fieldid, int fieldid_size, float* data_k4, 953 1048 int data_0size, int data_1size, int data_2size, 954 1049 int data_3size) 1050 TRY 955 1051 { 956 1052 std::string fieldid_str; … … 972 1068 CTimer::get("XIOS").suspend(); 973 1069 } 1070 CATCH_DUMP_STACK 974 1071 975 1072 void cxios_read_data_k45(const char* fieldid, int fieldid_size, float* data_k4, 976 1073 int data_0size, int data_1size, int data_2size, 977 1074 int data_3size, int data_4size) 1075 TRY 978 1076 { 979 1077 std::string fieldid_str; … … 995 1093 CTimer::get("XIOS").suspend(); 996 1094 } 1095 CATCH_DUMP_STACK 997 1096 998 1097 void cxios_read_data_k46(const char* fieldid, int fieldid_size, float* data_k4, 999 1098 int data_0size, int data_1size, int data_2size, 1000 1099 int data_3size, int data_4size, int data_5size) 1100 TRY 1001 1101 { 1002 1102 std::string fieldid_str; … … 1018 1118 CTimer::get("XIOS").suspend(); 1019 1119 } 1120 CATCH_DUMP_STACK 1020 1121 1021 1122 void cxios_read_data_k47(const char* fieldid, int fieldid_size, float* data_k4, … … 1023 1124 int data_3size, int data_4size, int data_5size, 1024 1125 int data_6size) 1126 TRY 1025 1127 { 1026 1128 std::string fieldid_str; … … 1042 1144 CTimer::get("XIOS").suspend(); 1043 1145 } 1146 CATCH_DUMP_STACK 1044 1147 } // extern "C" -
XIOS/trunk/src/interface/c/icdate.cpp
r1542 r1622 35 35 { 36 36 long long int cxios_date_convert_to_seconds(cxios_date date_c) 37 TRY 37 38 { 38 39 xios::CDate date = xios::CDate(getCalendar("long long int cxios_date_convert_to_seconds(cxios_date date_c)"), … … 41 42 return date; 42 43 } 44 CATCH_DUMP_STACK 43 45 44 46 void cxios_date_convert_to_string(cxios_date date_c, char* str, int str_size) 47 TRY 45 48 { 46 49 xios::CDate date = xios::CDate(getCalendar("void cxios_date_convert_to_string(cxios_date date_c, char* str, int str_size)"), … … 51 54 ERROR("void cxios_date_convert_to_string(cxios_date date_c, char* str, int str_size)", << "Input string is too short"); 52 55 } 56 CATCH_DUMP_STACK 53 57 54 58 cxios_date cxios_date_convert_from_string(const char* str, int str_size) 59 TRY 55 60 { 56 61 std::string date_str; … … 63 68 return { date.getYear(), date.getMonth(), date.getDay(), date.getHour(), date.getMinute(), date.getSecond() }; 64 69 } 70 CATCH_DUMP_STACK 65 71 66 72 cxios_date cxios_date_add_duration(cxios_date date_c, cxios_duration dur_c) 73 TRY 67 74 { 68 75 xios::CDate date = xios::CDate(getCalendar("cxios_date cxios_date_add_duration(cxios_date date_c, cxios_duration dur_c)"), … … 73 80 return { res.getYear(), res.getMonth(), res.getDay(), res.getHour(), res.getMinute(), res.getSecond() }; 74 81 } 82 CATCH_DUMP_STACK 75 83 76 84 cxios_date cxios_date_sub_duration(cxios_date date_c, cxios_duration dur_c) 85 TRY 77 86 { 78 87 xios::CDate date = xios::CDate(getCalendar("cxios_date cxios_date_sub_duration(cxios_date date_c, cxios_duration dur_c)"), … … 84 93 return { res.getYear(), res.getMonth(), res.getDay(), res.getHour(), res.getMinute(), res.getSecond() }; 85 94 } 95 CATCH_DUMP_STACK 86 96 87 97 cxios_duration cxios_date_sub(cxios_date date1_c, cxios_date date2_c) 98 TRY 88 99 { 89 100 xios::CDate date1 = xios::CDate(getCalendar("cxios_duration cxios_date_sub(cxios_date date1_c, cxios_date date2_c)"), … … 96 107 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 97 108 } 109 CATCH_DUMP_STACK 98 110 99 111 bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c) 112 TRY 100 113 { 101 114 xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), … … 107 120 return (date1 == date2); 108 121 } 122 CATCH_DUMP_STACK 109 123 110 124 bool cxios_date_neq(cxios_date date1_c, cxios_date date2_c) 125 TRY 111 126 { 112 127 xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), … … 118 133 return (date1 != date2); 119 134 } 135 CATCH_DUMP_STACK 120 136 121 137 bool cxios_date_lt(cxios_date date1_c, cxios_date date2_c) 138 TRY 122 139 { 123 140 xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), … … 129 146 return (date1 < date2); 130 147 } 148 CATCH_DUMP_STACK 131 149 132 150 bool cxios_date_le(cxios_date date1_c, cxios_date date2_c) 151 TRY 133 152 { 134 153 xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), … … 140 159 return (date1 <= date2); 141 160 } 161 CATCH_DUMP_STACK 142 162 143 163 bool cxios_date_gt(cxios_date date1_c, cxios_date date2_c) 164 TRY 144 165 { 145 166 xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), … … 151 172 return (date1 > date2); 152 173 } 174 CATCH_DUMP_STACK 153 175 154 176 bool cxios_date_ge(cxios_date date1_c, cxios_date date2_c) 177 TRY 155 178 { 156 179 xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), … … 162 185 return (date1 >= date2); 163 186 } 187 CATCH_DUMP_STACK 164 188 165 189 int cxios_date_get_second_of_year(cxios_date date_c) 190 TRY 166 191 { 167 192 xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_second_of_year(cxios_date date_c)"), … … 170 195 return date.getSecondOfYear(); 171 196 } 197 CATCH_DUMP_STACK 172 198 173 199 double cxios_date_get_day_of_year(cxios_date date_c) 200 TRY 174 201 { 175 202 xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_day_of_year(cxios_date date_c)"), … … 178 205 return date.getDayOfYear(); 179 206 } 207 CATCH_DUMP_STACK 180 208 181 209 double cxios_date_get_fraction_of_year(cxios_date date_c) 210 TRY 182 211 { 183 212 xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_fraction_of_year(cxios_date date_c)"), … … 186 215 return date.getFractionOfYear(); 187 216 } 217 CATCH_DUMP_STACK 188 218 189 219 int cxios_date_get_second_of_day(cxios_date date_c) 220 TRY 190 221 { 191 222 xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_second_of_day(cxios_date date_c)"), … … 194 225 return date.getSecondOfDay(); 195 226 } 227 CATCH_DUMP_STACK 196 228 197 229 double cxios_date_get_fraction_of_day(cxios_date date_c) 230 TRY 198 231 { 199 232 xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_fraction_of_day(cxios_date date_c)"), … … 202 235 return date.getFractionOfDay(); 203 236 } 237 CATCH_DUMP_STACK 204 238 } // extern "C" -
XIOS/trunk/src/interface/c/icdomain.cpp
r1542 r1622 29 29 30 30 void cxios_domain_handle_create (XDomainPtr * _ret, const char * _id, int _id_len) 31 TRY 31 32 { 32 33 std::string id; … … 36 37 CTimer::get("XIOS").suspend() ; 37 38 } 39 CATCH_DUMP_STACK 38 40 39 41 void cxios_domaingroup_handle_create (XDomainGroupPtr * _ret, const char * _id, int _id_len) 42 TRY 40 43 { 41 44 std::string id; … … 46 49 CTimer::get("XIOS").suspend() ; 47 50 } 51 CATCH_DUMP_STACK 48 52 49 53 // -------------------- Vérification des identifiants ----------------------- 50 54 51 55 void cxios_domain_valid_id (bool * _ret, const char * _id, int _id_len) 56 TRY 52 57 { 53 58 std::string id; … … 58 63 CTimer::get("XIOS").suspend() ; 59 64 } 65 CATCH_DUMP_STACK 60 66 61 67 void cxios_domaingroup_valid_id (bool * _ret, const char * _id, int _id_len) 68 TRY 62 69 { 63 70 std::string id; … … 67 74 CTimer::get("XIOS").suspend() ; 68 75 } 76 CATCH_DUMP_STACK 69 77 } // extern "C" -
XIOS/trunk/src/interface/c/icduplicate_scalar_to_axis.cpp
r1542 r1622 26 26 // ------------------------ Création des handle ----------------------------- 27 27 void cxios_duplicate_scalar_to_axis_handle_create(XDuplicateScalarToAxisPtr * _ret, const char * _id, int _id_len) 28 TRY 28 29 { 29 30 std::string id; … … 33 34 CTimer::get("XIOS").suspend() ; 34 35 } 36 CATCH_DUMP_STACK 35 37 36 38 // -------------------- Vérification des identifiants ----------------------- 37 39 void cxios_duplicate_scalar_to_axis_valid_id(bool * _ret, const char * _id, int _id_len) 40 TRY 38 41 { 39 42 std::string id; … … 44 47 CTimer::get("XIOS").suspend() ; 45 48 } 49 CATCH_DUMP_STACK 46 50 47 51 } // extern "C" -
XIOS/trunk/src/interface/c/icduration.cpp
r1472 r1622 1 #include "xios.hpp" 2 1 3 #include "icutil.hpp" 2 4 #include "icdate.hpp" … … 6 8 { 7 9 void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size) 10 TRY 8 11 { 9 12 xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); … … 12 15 ERROR("void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size)", << "Input string is too short"); 13 16 } 17 CATCH_DUMP_STACK 14 18 15 19 cxios_duration cxios_duration_convert_from_string(const char* str, int str_size) 20 TRY 16 21 { 17 22 std::string dur_str; … … 23 28 return { dur.year, dur.month, dur.day, dur.hour, dur.minute, dur.second, dur.timestep }; 24 29 } 30 CATCH_DUMP_STACK 25 31 26 32 cxios_duration cxios_duration_add(cxios_duration dur1_c, cxios_duration dur2_c) 33 TRY 27 34 { 28 35 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); … … 32 39 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 33 40 } 41 CATCH_DUMP_STACK 34 42 35 43 cxios_duration cxios_duration_sub(cxios_duration dur1_c, cxios_duration dur2_c) 44 TRY 36 45 { 37 46 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); … … 41 50 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 42 51 } 52 CATCH_DUMP_STACK 43 53 44 54 cxios_duration cxios_duration_mult(double val, cxios_duration dur_c) 55 TRY 45 56 { 46 57 xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); … … 48 59 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 49 60 } 61 CATCH_DUMP_STACK 50 62 51 63 cxios_duration cxios_duration_neg(cxios_duration dur_c) 64 TRY 52 65 { 53 66 xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); … … 55 68 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 56 69 } 70 CATCH_DUMP_STACK 57 71 58 72 bool cxios_duration_eq(cxios_duration dur1_c, cxios_duration dur2_c) 73 TRY 59 74 { 60 75 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); … … 62 77 return (dur1 == dur2); 63 78 } 79 CATCH_DUMP_STACK 64 80 65 81 bool cxios_duration_neq(cxios_duration dur1_c, cxios_duration dur2_c) 82 TRY 66 83 { 67 84 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); … … 69 86 return (dur1 != dur2); 70 87 } 88 CATCH_DUMP_STACK 71 89 } -
XIOS/trunk/src/interface/c/icexpand_domain.cpp
r1542 r1622 27 27 // ------------------------ Création des handle ----------------------------- 28 28 void cxios_expand_domain_handle_create(XExpandDomainPtr * _ret, const char * _id, int _id_len) 29 TRY 29 30 { 30 31 std::string id; … … 34 35 CTimer::get("XIOS").suspend() ; 35 36 } 37 CATCH_DUMP_STACK 36 38 37 39 // -------------------- Vérification des identifiants ----------------------- 38 40 void cxios_expand_domain_valid_id(bool * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 45 48 CTimer::get("XIOS").suspend() ; 46 49 } 50 CATCH_DUMP_STACK 47 51 } // extern "C" -
XIOS/trunk/src/interface/c/icextract_to_axis.cpp
r1542 r1622 26 26 // ------------------------ Création des handle ----------------------------- 27 27 void cxios_extract_domain_to_axis_handle_create(XExtractDomainToAxisPtr * _ret, const char * _id, int _id_len) 28 TRY 28 29 { 29 30 std::string id; … … 33 34 CTimer::get("XIOS").suspend() ; 34 35 } 36 CATCH_DUMP_STACK 35 37 36 38 // -------------------- Vérification des identifiants ----------------------- 37 39 void cxios_extract_domain_to_axis_valid_id(bool * _ret, const char * _id, int _id_len) 40 TRY 38 41 { 39 42 std::string id; … … 44 47 CTimer::get("XIOS").suspend() ; 45 48 } 49 CATCH_DUMP_STACK 46 50 47 51 } // extern "C" -
XIOS/trunk/src/interface/c/icextract_to_scalar.cpp
r1542 r1622 26 26 // ------------------------ Création des handle ----------------------------- 27 27 void cxios_extract_axis_to_scalar_handle_create(XExtractAxisToScalarPtr * _ret, const char * _id, int _id_len) 28 TRY 28 29 { 29 30 std::string id; … … 33 34 CTimer::get("XIOS").suspend() ; 34 35 } 36 CATCH_DUMP_STACK 35 37 36 38 // -------------------- Vérification des identifiants ----------------------- 37 39 void cxios_extract_axis_to_scalar_valid_id(bool * _ret, const char * _id, int _id_len) 40 TRY 38 41 { 39 42 std::string id; … … 44 47 CTimer::get("XIOS").suspend() ; 45 48 } 49 CATCH_DUMP_STACK 46 50 47 51 } // extern "C" -
XIOS/trunk/src/interface/c/icfield.cpp
r1542 r1622 35 35 36 36 void cxios_field_handle_create (XFieldPtr * _ret, const char * _id, int _id_len) 37 TRY 37 38 { 38 39 std::string id; … … 42 43 CTimer::get("XIOS").suspend() ; 43 44 } 45 CATCH_DUMP_STACK 44 46 45 47 void cxios_fieldgroup_handle_create (XFieldGroupPtr * _ret, const char * _id, int _id_len) 48 TRY 46 49 { 47 50 std::string id; … … 51 54 CTimer::get("XIOS").suspend() ; 52 55 } 53 56 CATCH_DUMP_STACK 54 57 55 58 // -------------------- Vérification des identifiants ----------------------- 56 59 57 60 void cxios_field_valid_id (bool * _ret, const char * _id, int _id_len) 61 TRY 58 62 { 59 63 std::string id; … … 63 67 CTimer::get("XIOS").suspend() ; 64 68 } 69 CATCH_DUMP_STACK 65 70 66 71 void cxios_fieldgroup_valid_id (bool * _ret, const char * _id, int _id_len) 72 TRY 67 73 { 68 74 std::string id; … … 72 78 CTimer::get("XIOS").suspend() ; 73 79 } 80 CATCH_DUMP_STACK 74 81 75 82 // ----------------------------------------------------------------------------------------------------- … … 78 85 79 86 void cxios_field_is_active (XFieldPtr field_hdl, bool at_current_timestep, bool* ret) 87 TRY 80 88 { 81 89 CTimer::get("XIOS").resume() ; … … 83 91 CTimer::get("XIOS").suspend() ; 84 92 } 93 CATCH_DUMP_STACK 85 94 86 95 // ----------------------------------------------------------------------------------------------------- … … 88 97 // ----------------------------------------------------------------------------------------------------- 89 98 void cxios_field_get_domain_handle(XDomainPtr * domain_hdl_ret, XFieldPtr field_hdl, int domainIndex) 99 TRY 90 100 { 91 101 CTimer::get("XIOS").resume() ; … … 93 103 CTimer::get("XIOS").suspend(); 94 104 } 105 CATCH_DUMP_STACK 95 106 96 107 void cxios_field_get_axis_handle(XAxisPtr * axis_hdl_ret, XFieldPtr field_hdl, int axisIndex) 108 TRY 97 109 { 98 110 CTimer::get("XIOS").resume() ; … … 100 112 CTimer::get("XIOS").suspend(); 101 113 } 114 CATCH_DUMP_STACK 102 115 103 116 void cxios_field_get_scalar_handle(XScalarPtr * scalar_hdl_ret, XFieldPtr field_hdl, int scalarIndex) 117 TRY 104 118 { 105 119 CTimer::get("XIOS").resume() ; … … 107 121 CTimer::get("XIOS").suspend(); 108 122 } 123 CATCH_DUMP_STACK 109 124 } // extern "C" -
XIOS/trunk/src/interface/c/icfile.cpp
r1542 r1622 28 28 29 29 void cxios_file_handle_create (XFilePtr * _ret, const char * _id, int _id_len) 30 TRY 30 31 { 31 32 std::string id; … … 35 36 CTimer::get("XIOS").suspend() ; 36 37 } 38 CATCH_DUMP_STACK 37 39 38 40 void cxios_filegroup_handle_create (XFileGroupPtr * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 44 47 CTimer::get("XIOS").suspend() ; 45 48 } 49 CATCH_DUMP_STACK 46 50 47 51 // -------------------- Vérification des identifiants ----------------------- 48 52 49 53 void cxios_file_valid_id (bool * _ret, const char * _id, int _id_len) 54 TRY 50 55 { 51 56 std::string id; … … 55 60 CTimer::get("XIOS").suspend() ; 56 61 } 62 CATCH_DUMP_STACK 57 63 58 64 void cxios_filegroup_valid_id (bool * _ret, const char * _id, int _id_len) 65 TRY 59 66 { 60 67 std::string id; … … 64 71 CTimer::get("XIOS").suspend() ; 65 72 } 73 CATCH_DUMP_STACK 66 74 } // extern "C" -
XIOS/trunk/src/interface/c/icgenerate_rectilinear_domain.cpp
r1542 r1622 27 27 // ------------------------ Création des handle ----------------------------- 28 28 void cxios_generate_rectilinear_domain_handle_create(XGenDomainPtr * _ret, const char * _id, int _id_len) 29 TRY 29 30 { 30 31 std::string id; … … 34 35 CTimer::get("XIOS").suspend() ; 35 36 } 37 CATCH_DUMP_STACK 36 38 37 39 // -------------------- Vérification des identifiants ----------------------- 38 40 void cxios_generate_rectilinear_domain_valid_id(bool * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 45 48 CTimer::get("XIOS").suspend() ; 46 49 } 50 CATCH_DUMP_STACK 47 51 } // extern "C" -
XIOS/trunk/src/interface/c/icgrid.cpp
r1542 r1622 27 27 28 28 void cxios_grid_handle_create (XGridPtr * _ret, const char * _id, int _id_len) 29 TRY 29 30 { 30 31 std::string id; … … 34 35 CTimer::get("XIOS").suspend() ; 35 36 } 37 CATCH_DUMP_STACK 36 38 37 39 void cxios_gridgroup_handle_create (XGridGroupPtr * _ret, const char * _id, int _id_len) 40 TRY 38 41 { 39 42 std::string id; … … 43 46 CTimer::get("XIOS").suspend() ; 44 47 } 48 CATCH_DUMP_STACK 45 49 46 50 // -------------------- Vérification des identifiants ----------------------- 47 51 48 52 void cxios_grid_valid_id (bool * _ret, const char * _id, int _id_len) 53 TRY 49 54 { 50 55 std::string id; … … 54 59 CTimer::get("XIOS").suspend() ; 55 60 } 61 CATCH_DUMP_STACK 56 62 57 63 void cxios_gridgroup_valid_id (bool * _ret, const char * _id, int _id_len) 64 TRY 58 65 { 59 66 std::string id; … … 63 70 CTimer::get("XIOS").suspend() ; 64 71 } 72 CATCH_DUMP_STACK 65 73 } // extern "C" -
XIOS/trunk/src/interface/c/icinterpolate.cpp
r1542 r1622 27 27 // ------------------------ Création des handle ----------------------------- 28 28 void cxios_interpolate_domain_handle_create(XInterpolateDomainPtr * _ret, const char * _id, int _id_len) 29 TRY 29 30 { 30 31 std::string id; … … 34 35 CTimer::get("XIOS").suspend() ; 35 36 } 37 CATCH_DUMP_STACK 36 38 37 39 // -------------------- Vérification des identifiants ----------------------- 38 40 void cxios_interpolate_domain_valid_id(bool * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 45 48 CTimer::get("XIOS").suspend() ; 46 49 } 50 CATCH_DUMP_STACK 47 51 48 52 // ------------------------ Création des handle ----------------------------- 49 53 void cxios_interpolate_axis_handle_create(XInterpolateAxisPtr * _ret, const char * _id, int _id_len) 54 TRY 50 55 { 51 56 std::string id; … … 55 60 CTimer::get("XIOS").suspend() ; 56 61 } 62 CATCH_DUMP_STACK 57 63 58 64 // -------------------- Vérification des identifiants ----------------------- 59 65 void cxios_interpolate_axis_valid_id(bool * _ret, const char * _id, int _id_len) 66 TRY 60 67 { 61 68 std::string id; … … 66 73 CTimer::get("XIOS").suspend() ; 67 74 } 75 CATCH_DUMP_STACK 68 76 } // extern "C" -
XIOS/trunk/src/interface/c/icinverse_axis.cpp
r1542 r1622 27 27 // ------------------------ Création des handle ----------------------------- 28 28 void cxios_inverse_axis_handle_create(XInverseAxisPtr * _ret, const char * _id, int _id_len) 29 TRY 29 30 { 30 31 std::string id; … … 34 35 CTimer::get("XIOS").suspend() ; 35 36 } 37 CATCH_DUMP_STACK 36 38 37 39 // -------------------- Vérification des identifiants ----------------------- 38 40 void cxios_inverse_axis_valid_id(bool * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 45 48 CTimer::get("XIOS").suspend() ; 46 49 } 50 CATCH_DUMP_STACK 47 51 } // extern "C" -
XIOS/trunk/src/interface/c/icreduce_axis_to_axis.cpp
r1542 r1622 27 27 // ------------------------ Création des handle ----------------------------- 28 28 void cxios_reduce_axis_to_axis_handle_create(XReduceAxisToAxisPtr * _ret, const char * _id, int _id_len) 29 TRY 29 30 { 30 31 std::string id; … … 34 35 CTimer::get("XIOS").suspend() ; 35 36 } 37 CATCH_DUMP_STACK 36 38 37 39 // -------------------- Vérification des identifiants ----------------------- 38 40 void cxios_reduce_axis_to_axis_valid_id(bool * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 45 48 CTimer::get("XIOS").suspend() ; 46 49 } 50 CATCH_DUMP_STACK 47 51 48 52 } // extern "C" -
XIOS/trunk/src/interface/c/icreduce_scalar_to_scalar.cpp
r1542 r1622 27 27 // ------------------------ Création des handle ----------------------------- 28 28 void cxios_reduce_scalar_to_scalar_handle_create(XReduceScalarToScalarPtr * _ret, const char * _id, int _id_len) 29 TRY 29 30 { 30 31 std::string id; … … 34 35 CTimer::get("XIOS").suspend() ; 35 36 } 37 CATCH_DUMP_STACK 36 38 37 39 // -------------------- Vérification des identifiants ----------------------- 38 40 void cxios_reduce_scalar_to_scalar_valid_id(bool * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 45 48 CTimer::get("XIOS").suspend() ; 46 49 } 50 CATCH_DUMP_STACK 47 51 48 52 } // extern "C" -
XIOS/trunk/src/interface/c/icreduce_to_axis.cpp
r1542 r1622 27 27 // ------------------------ Création des handle ----------------------------- 28 28 void cxios_reduce_domain_to_axis_handle_create(XReduceDomainToAxisPtr * _ret, const char * _id, int _id_len) 29 TRY 29 30 { 30 31 std::string id; … … 34 35 CTimer::get("XIOS").suspend() ; 35 36 } 37 CATCH_DUMP_STACK 36 38 37 39 // -------------------- Vérification des identifiants ----------------------- 38 40 void cxios_reduce_domain_to_axis_valid_id(bool * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 45 48 CTimer::get("XIOS").suspend() ; 46 49 } 50 CATCH_DUMP_STACK 47 51 48 52 } // extern "C" -
XIOS/trunk/src/interface/c/icreduce_to_scalar.cpp
r1542 r1622 27 27 // ------------------------ Création des handle ----------------------------- 28 28 void cxios_reduce_axis_to_scalar_handle_create(XReduceAxisToScalarPtr * _ret, const char * _id, int _id_len) 29 TRY 29 30 { 30 31 std::string id; … … 34 35 CTimer::get("XIOS").suspend() ; 35 36 } 37 CATCH_DUMP_STACK 36 38 37 39 // -------------------- Vérification des identifiants ----------------------- 38 40 void cxios_reduce_axis_to_scalar_valid_id(bool * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 45 48 CTimer::get("XIOS").suspend() ; 46 49 } 50 CATCH_DUMP_STACK 47 51 48 52 void cxios_reduce_domain_to_scalar_handle_create(XReduceDomainToScalarPtr * _ret, const char * _id, int _id_len) 53 TRY 49 54 { 50 55 std::string id; … … 54 59 CTimer::get("XIOS").suspend() ; 55 60 } 61 CATCH_DUMP_STACK 56 62 57 63 // -------------------- Vérification des identifiants ----------------------- 58 64 void cxios_reduce_domain_to_scalar_valid_id(bool * _ret, const char * _id, int _id_len) 65 TRY 59 66 { 60 67 std::string id; … … 65 72 CTimer::get("XIOS").suspend() ; 66 73 } 74 CATCH_DUMP_STACK 67 75 68 76 } // extern "C" -
XIOS/trunk/src/interface/c/icreorder_domain.cpp
r1542 r1622 27 27 // ------------------------ Création des handle ----------------------------- 28 28 void cxios_reorder_domain_handle_create(XReorderDomainPtr * _ret, const char * _id, int _id_len) 29 TRY 29 30 { 30 31 std::string id; … … 34 35 CTimer::get("XIOS").suspend() ; 35 36 } 37 CATCH_DUMP_STACK 36 38 37 39 // -------------------- Vérification des identifiants ----------------------- 38 40 void cxios_reorder_domain_valid_id(bool * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 45 48 CTimer::get("XIOS").suspend() ; 46 49 } 50 CATCH_DUMP_STACK 47 51 } // extern "C" -
XIOS/trunk/src/interface/c/icscalar.cpp
r1542 r1622 28 28 29 29 void cxios_scalar_handle_create (XScalarPtr * _ret, const char * _id, int _id_len) 30 TRY 30 31 { 31 32 std::string id; … … 35 36 CTimer::get("XIOS").suspend() ; 36 37 } 38 CATCH_DUMP_STACK 37 39 38 40 void cxios_scalargroup_handle_create (XScalarGroupPtr * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 44 47 CTimer::get("XIOS").suspend() ; 45 48 } 49 CATCH_DUMP_STACK 46 50 47 51 // -------------------- Vérification des identifiants ----------------------- 48 52 49 53 void cxios_scalar_valid_id (bool * _ret, const char * _id, int _id_len) 54 TRY 50 55 { 51 56 std::string id; … … 56 61 CTimer::get("XIOS").suspend() ; 57 62 } 63 CATCH_DUMP_STACK 58 64 59 65 void cxios_scalargroup_valid_id (bool * _ret, const char * _id, int _id_len) 66 TRY 60 67 { 61 68 std::string id; … … 67 74 68 75 } 76 CATCH_DUMP_STACK 69 77 70 78 } // extern "C" -
XIOS/trunk/src/interface/c/ictemporal_splitting.cpp
r1542 r1622 27 27 // ------------------------ Création des handle ----------------------------- 28 28 void cxios_temporal_splitting_handle_create(XTemporalSplittingPtr * _ret, const char * _id, int _id_len) 29 TRY 29 30 { 30 31 std::string id; … … 34 35 CTimer::get("XIOS").suspend() ; 35 36 } 37 CATCH_DUMP_STACK 36 38 37 39 // -------------------- Vérification des identifiants ----------------------- 38 40 void cxios_temporal_splitting_valid_id(bool * _ret, const char * _id, int _id_len) 41 TRY 39 42 { 40 43 std::string id; … … 45 48 CTimer::get("XIOS").suspend() ; 46 49 } 50 CATCH_DUMP_STACK 47 51 48 52 } // extern "C" -
XIOS/trunk/src/interface/c/icvariable.cpp
r1542 r1622 29 29 30 30 void cxios_variable_handle_create (XVariablePtr * _ret, const char * _id, int _id_len) 31 TRY 31 32 { 32 33 std::string id; … … 36 37 CTimer::get("XIOS").suspend() ; 37 38 } 39 CATCH_DUMP_STACK 38 40 39 41 void cxios_variablegroup_handle_create (XVariableGroupPtr * _ret, const char * _id, int _id_len) 42 TRY 40 43 { 41 44 std::string id; … … 45 48 CTimer::get("XIOS").suspend() ; 46 49 } 50 CATCH_DUMP_STACK 47 51 48 52 // -------------------- Vérification des identifiants ----------------------- 49 53 50 54 void cxios_variable_valid_id (bool * _ret, const char * _id, int _id_len) 55 TRY 51 56 { 52 57 std::string id; … … 57 62 CTimer::get("XIOS").suspend() ; 58 63 } 64 CATCH_DUMP_STACK 59 65 60 66 void cxios_variablegroup_valid_id (bool * _ret, const char * _id, int _id_len) 67 TRY 61 68 { 62 69 std::string id; … … 68 75 69 76 } 77 CATCH_DUMP_STACK 70 78 71 79 } // extern "C" -
XIOS/trunk/src/interface/c/iczoom.cpp
r1542 r1622 28 28 // ------------------------ Création des handle ----------------------------- 29 29 void cxios_zoom_axis_handle_create (XZoomAxisPtr * _ret, const char * _id, int _id_len) 30 TRY 30 31 { 31 32 std::string id; … … 35 36 CTimer::get("XIOS").suspend() ; 36 37 } 38 CATCH_DUMP_STACK 37 39 38 40 // -------------------- Vérification des identifiants ----------------------- 39 41 void cxios_zoom_axis_valid_id (bool * _ret, const char * _id, int _id_len) 42 TRY 40 43 { 41 44 std::string id; … … 46 49 CTimer::get("XIOS").suspend() ; 47 50 } 51 CATCH_DUMP_STACK 48 52 49 53 // ------------------------ Création des handle ----------------------------- 50 54 void cxios_zoom_domain_handle_create(XZoomDomainPtr * _ret, const char * _id, int _id_len) 55 TRY 51 56 { 52 57 std::string id; … … 56 61 CTimer::get("XIOS").suspend() ; 57 62 } 63 CATCH_DUMP_STACK 58 64 59 65 // -------------------- Vérification des identifiants ----------------------- 60 66 void cxios_zoom_domain_valid_id(bool * _ret, const char * _id, int _id_len) 67 TRY 61 68 { 62 69 std::string id; … … 67 74 CTimer::get("XIOS").suspend() ; 68 75 } 76 CATCH_DUMP_STACK 69 77 } // extern "C" -
XIOS/trunk/src/io/nc4_data_input.cpp
r1582 r1622 29 29 30 30 StdSize CNc4DataInput::getFieldNbRecords_(CField* field) 31 TRY 31 32 { 32 33 StdString fieldId = field->getFieldOutputName(); … … 40 41 return 1; 41 42 } 43 CATCH 42 44 43 45 void CNc4DataInput::readFieldData_(CField* field) 46 TRY 44 47 { 45 48 CContext* context = CContext::getCurrent(); … … 121 124 } 122 125 } 126 CATCH 123 127 124 128 void CNc4DataInput::readFieldAttributes_(CField* field, bool readAttributeValues) 129 TRY 125 130 { 126 131 StdString fieldId = field->getFieldOutputName(); … … 248 253 } 249 254 } 255 CATCH 250 256 251 257 /*! … … 258 264 void CNc4DataInput::readDomainAttributeValueFromFile(CDomain* domain, std::list<std::pair<StdString, StdSize> >& dimSizeMap, 259 265 int elementPosition, const StdString& fieldId) 266 TRY 260 267 { 261 268 // There are some optional attributes of a domain to retrieve from file // + lon lat? … … 436 443 domain->fillInLonLat(); 437 444 } 445 CATCH 438 446 439 447 /*! … … 446 454 void CNc4DataInput::readDomainAttributesFromFile(CDomain* domain, std::list<std::pair<StdString, StdSize> >& dimSizeMap, 447 455 int elementPosition, const StdString& fieldId) 456 TRY 448 457 { 449 458 // There are some mandatory attributes of a domain to retrieve from file … … 514 523 } 515 524 } 525 CATCH 516 526 517 527 /*! … … 524 534 void CNc4DataInput::readAxisAttributesFromFile(CAxis* axis, std::list<std::pair<StdString, StdSize> >& dimSizeMap, 525 535 int elementPosition, const StdString& fieldId) 536 TRY 526 537 { 527 538 std::list<std::pair<StdString, StdSize> >::const_iterator itMapN = dimSizeMap.begin(), … … 540 551 axis->n_glo.setValue(itMapN->second); 541 552 } 553 CATCH 542 554 543 555 /*! … … 550 562 void CNc4DataInput::readAxisAttributeValueFromFile(CAxis* axis, std::list<std::pair<StdString, StdSize> >& dimSizeMap, 551 563 int elementPosition, const StdString& fieldId) 564 TRY 552 565 { 553 566 std::list<std::pair<StdString, StdSize> >::const_iterator itMapN = dimSizeMap.begin(), … … 570 583 } 571 584 } 585 CATCH 572 586 573 587 /*! … … 598 612 599 613 void CNc4DataInput::closeFile_(void) 614 TRY 600 615 { 601 616 SuperClassWriter::close(); 602 617 } 618 CATCH 603 619 } // namespace xios -
XIOS/trunk/src/io/nc4_data_output.cpp
r1559 r1622 54 54 55 55 void CNc4DataOutput::writeDomain_(CDomain* domain) 56 TRY 56 57 { 57 58 StdString lonName,latName ; … … 540 541 domain->addRelFile(this->filename); 541 542 } 543 CATCH 542 544 543 545 //-------------------------------------------------------------- -
XIOS/trunk/src/node/axis.cpp
r1566 r1622 48 48 bool CAxis::dummyTransformationMapList_ = CAxis::initializeTransformationMap(CAxis::transformationMapList_); 49 49 bool CAxis::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 50 TRY 50 51 { 51 52 m["zoom_axis"] = TRANS_ZOOM_AXIS; … … 60 61 61 62 } 63 CATCH 62 64 63 65 ///--------------------------------------------------------------- 64 66 65 67 const std::set<StdString> & CAxis::getRelFiles(void) const 68 TRY 66 69 { 67 70 return (this->relFiles); 68 71 } 72 CATCH 69 73 70 74 bool CAxis::IsWritten(const StdString & filename) const 75 TRY 71 76 { 72 77 return (this->relFiles.find(filename) != this->relFiles.end()); 73 78 } 79 CATCH 74 80 75 81 bool CAxis::isWrittenCompressed(const StdString& filename) const 82 TRY 76 83 { 77 84 return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 78 85 } 86 CATCH 79 87 80 88 bool CAxis::isDistributed(void) const 89 TRY 81 90 { 82 91 bool distributed = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) || 83 92 (!this->n.isEmpty() && (this->n != this->n_glo)); 84 // A same stupidcondition to make sure that if there is only one client, axis93 // A condition to make sure that if there is only one client, axis 85 94 // should be considered to be distributed. This should be a temporary solution 86 95 distributed |= (1 == CContext::getCurrent()->client->clientSize); 87 96 return distributed; 88 97 } 98 CATCH 89 99 90 100 /*! … … 94 104 */ 95 105 bool CAxis::isCompressible(void) const 106 TRY 96 107 { 97 108 return isCompressible_; 98 109 } 110 CATCH 99 111 100 112 void CAxis::addRelFile(const StdString & filename) 113 TRY 101 114 { 102 115 this->relFiles.insert(filename); 103 116 } 117 CATCH_DUMP_ATTR 104 118 105 119 void CAxis::addRelFileCompressed(const StdString& filename) 120 TRY 106 121 { 107 122 this->relFilesCompressed.insert(filename); 108 123 } 124 CATCH_DUMP_ATTR 109 125 110 126 //---------------------------------------------------------------- … … 115 131 */ 116 132 int CAxis::getNumberWrittenIndexes(MPI_Comm writtenCom) 133 TRY 117 134 { 118 135 int writtenSize; … … 120 137 return numberWrittenIndexes_[writtenSize]; 121 138 } 139 CATCH_DUMP_ATTR 122 140 123 141 /*! … … 126 144 */ 127 145 int CAxis::getTotalNumberWrittenIndexes(MPI_Comm writtenCom) 146 TRY 128 147 { 129 148 int writtenSize; … … 131 150 return totalNumberWrittenIndexes_[writtenSize]; 132 151 } 152 CATCH_DUMP_ATTR 133 153 134 154 /*! … … 137 157 */ 138 158 int CAxis::getOffsetWrittenIndexes(MPI_Comm writtenCom) 159 TRY 139 160 { 140 161 int writtenSize; … … 142 163 return offsetWrittenIndexes_[writtenSize]; 143 164 } 165 CATCH_DUMP_ATTR 144 166 145 167 CArray<int, 1>& CAxis::getCompressedIndexToWriteOnServer(MPI_Comm writtenCom) 168 TRY 146 169 { 147 170 int writtenSize; … … 149 172 return compressedIndexToWriteOnServer[writtenSize]; 150 173 } 174 CATCH_DUMP_ATTR 175 151 176 //---------------------------------------------------------------- 152 177 … … 158 183 std::map<int, StdSize> CAxis::getAttributesBufferSize(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid, 159 184 CServerDistributionDescription::ServerDistributionType distType) 185 TRY 160 186 { 161 187 … … 221 247 } 222 248 } 223 224 249 return attributesSizes; 225 250 } 251 CATCH_DUMP_ATTR 226 252 227 253 //---------------------------------------------------------------- … … 234 260 235 261 CAxis* CAxis::createAxis() 262 TRY 236 263 { 237 264 CAxis* axis = CAxisGroup::get("axis_definition")->createChild(); 238 265 return axis; 239 266 } 267 CATCH 240 268 241 269 /*! … … 244 272 */ 245 273 void CAxis::checkAttributes(void) 274 TRY 246 275 { 247 276 if (this->n_glo.isEmpty()) … … 285 314 } 286 315 287 // Remove this check because it doe n't make sense in case of a hole or overlapping axes316 // Remove this check because it doesn't make sense in case of a hole or overlapping axes 288 317 if (!this->value.isEmpty()) 289 318 { … … 306 335 } 307 336 } 337 CATCH_DUMP_ATTR 308 338 309 339 /*! … … 311 341 */ 312 342 void CAxis::checkData() 343 TRY 313 344 { 314 345 if (data_begin.isEmpty()) data_begin.setValue(0); … … 331 362 } 332 363 } 364 CATCH_DUMP_ATTR 333 365 334 366 size_t CAxis::getGlobalWrittenSize(void) … … 341 373 */ 342 374 void CAxis::checkMask() 375 TRY 343 376 { 344 377 if (!mask.isEmpty()) … … 360 393 } 361 394 } 395 CATCH_DUMP_ATTR 362 396 363 397 /*! … … 365 399 */ 366 400 void CAxis::checkBounds() 401 TRY 367 402 { 368 403 if (!bounds.isEmpty()) … … 377 412 else hasBounds = false; 378 413 } 414 CATCH_DUMP_ATTR 379 415 380 416 void CAxis::checkLabel() 417 TRY 381 418 { 382 419 if (!label.isEmpty()) … … 391 428 else hasLabel = false; 392 429 } 430 CATCH_DUMP_ATTR 393 431 394 432 /*! … … 396 434 */ 397 435 void CAxis::checkEligibilityForCompressedOutput() 436 TRY 398 437 { 399 438 // We don't check if the mask is valid here, just if a mask has been defined at this point. 400 439 isCompressible_ = !mask.isEmpty(); 401 440 } 441 CATCH_DUMP_ATTR 402 442 403 443 /*! … … 405 445 */ 406 446 bool CAxis::dispatchEvent(CEventServer& event) 447 TRY 407 448 { 408 449 if (SuperClass::dispatchEvent(event)) return true; … … 430 471 } 431 472 } 473 CATCH 432 474 433 475 /*! … … 435 477 */ 436 478 void CAxis::checkAttributesOnClient() 479 TRY 437 480 { 438 481 if (this->areClientAttributesChecked_) return; … … 443 486 this->areClientAttributesChecked_ = true; 444 487 } 488 CATCH_DUMP_ATTR 445 489 446 490 /* … … 450 494 void CAxis::checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid, 451 495 CServerDistributionDescription::ServerDistributionType distType) 496 TRY 452 497 { 453 498 CContext* context=CContext::getCurrent() ; … … 463 508 this->isClientAfterTransformationChecked = true; 464 509 } 510 CATCH_DUMP_ATTR 465 511 466 512 /* … … 473 519 void CAxis::sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 474 520 CServerDistributionDescription::ServerDistributionType distType) 521 TRY 475 522 { 476 523 if (!this->areClientAttributesChecked_) checkAttributesOnClient(); … … 483 530 this->isChecked = true; 484 531 } 532 CATCH_DUMP_ATTR 485 533 486 534 /*! … … 491 539 void CAxis::sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 492 540 CServerDistributionDescription::ServerDistributionType distType) 541 TRY 493 542 { 494 543 sendDistributionAttribute(globalDim, orderPositionInGrid, distType); … … 505 554 } 506 555 } 556 CATCH_DUMP_ATTR 507 557 508 558 /* … … 516 566 void CAxis::computeConnectedClients(const std::vector<int>& globalDim, int orderPositionInGrid, 517 567 CServerDistributionDescription::ServerDistributionType distType) 568 TRY 518 569 { 519 570 CContext* context = CContext::getCurrent(); … … 635 686 } 636 687 } 688 CATCH_DUMP_ATTR 637 689 638 690 /* … … 642 694 */ 643 695 void CAxis::computeWrittenIndex() 696 TRY 644 697 { 645 698 if (computedWrittenIndex_) return; … … 688 741 } 689 742 } 743 CATCH_DUMP_ATTR 690 744 691 745 void CAxis::computeWrittenCompressedIndex(MPI_Comm writtenComm) 746 TRY 692 747 { 693 748 int writtenCommSize; … … 758 813 } 759 814 } 815 CATCH_DUMP_ATTR 760 816 761 817 /*! … … 768 824 void CAxis::sendDistributionAttribute(const std::vector<int>& globalDim, int orderPositionInGrid, 769 825 CServerDistributionDescription::ServerDistributionType distType) 826 TRY 770 827 { 771 828 std::list<CContextClient*>::iterator it; … … 806 863 } 807 864 } 865 CATCH_DUMP_ATTR 808 866 809 867 /* … … 812 870 */ 813 871 void CAxis::recvDistributionAttribute(CEventServer& event) 872 TRY 814 873 { 815 874 CBufferIn* buffer = event.subEvents.begin()->buffer; … … 818 877 get(axisId)->recvDistributionAttribute(*buffer); 819 878 } 879 CATCH 820 880 821 881 /* … … 824 884 */ 825 885 void CAxis::recvDistributionAttribute(CBufferIn& buffer) 886 TRY 826 887 { 827 888 int ni_srv, begin_srv; … … 833 894 begin.setValue(begin_srv); 834 895 } 896 CATCH_DUMP_ATTR 835 897 836 898 /* … … 840 902 */ 841 903 void CAxis::sendNonDistributedAttributes() 904 TRY 842 905 { 843 906 std::list<CContextClient*>::iterator it; … … 893 956 } 894 957 } 958 CATCH_DUMP_ATTR 895 959 896 960 /* … … 899 963 */ 900 964 void CAxis::recvNonDistributedAttributes(CEventServer& event) 965 TRY 901 966 { 902 967 list<CEventServer::SSubEvent>::iterator it; … … 909 974 } 910 975 } 976 CATCH 911 977 912 978 /* … … 916 982 */ 917 983 void CAxis::recvNonDistributedAttributes(int rank, CBufferIn& buffer) 984 TRY 918 985 { 919 986 CArray<int,1> tmp_index, tmp_data_index; … … 957 1024 for (int idx = 0; idx < index.numElements(); ++idx) globalLocalIndexMap_[index(idx)] = idx; 958 1025 } 1026 CATCH_DUMP_ATTR 959 1027 960 1028 /* … … 964 1032 */ 965 1033 void CAxis::sendDistributedAttributes(void) 1034 TRY 966 1035 { 967 1036 int ns, n, i, j, ind, nv, idx; … … 1069 1138 } 1070 1139 } 1140 CATCH_DUMP_ATTR 1071 1141 1072 1142 /* … … 1075 1145 */ 1076 1146 void CAxis::recvDistributedAttributes(CEventServer& event) 1147 TRY 1077 1148 { 1078 1149 string axisId; … … 1090 1161 get(axisId)->recvDistributedAttributes(ranks, buffers); 1091 1162 } 1163 CATCH 1092 1164 1093 1165 /* … … 1097 1169 */ 1098 1170 void CAxis::recvDistributedAttributes(vector<int>& ranks, vector<CBufferIn*> buffers) 1171 TRY 1099 1172 { 1100 1173 int nbReceived = ranks.size(), idx, ind, gloInd, locInd; … … 1219 1292 data_begin.setValue(0); 1220 1293 } 1221 1294 CATCH_DUMP_ATTR 1222 1295 1223 1296 /*! … … 1229 1302 */ 1230 1303 bool CAxis::isEqual(CAxis* obj) 1304 TRY 1231 1305 { 1232 1306 vector<StdString> excludedAttr; … … 1252 1326 return objEqual; 1253 1327 } 1328 CATCH_DUMP_ATTR 1254 1329 1255 1330 /* … … 1259 1334 */ 1260 1335 CTransformation<CAxis>* CAxis::addTransformation(ETranformationType transType, const StdString& id) 1336 TRY 1261 1337 { 1262 1338 transformationMap_.push_back(std::make_pair(transType, CTransformation<CAxis>::createTransformation(transType,id))); 1263 1339 return transformationMap_.back().second; 1264 1340 } 1341 CATCH_DUMP_ATTR 1265 1342 1266 1343 /* … … 1268 1345 */ 1269 1346 bool CAxis::hasTransformation() 1347 TRY 1270 1348 { 1271 1349 return (!transformationMap_.empty()); 1272 1350 } 1351 CATCH_DUMP_ATTR 1273 1352 1274 1353 /* … … 1277 1356 */ 1278 1357 void CAxis::setTransformations(const TransMapTypes& axisTrans) 1358 TRY 1279 1359 { 1280 1360 transformationMap_ = axisTrans; 1281 1361 } 1362 CATCH_DUMP_ATTR 1282 1363 1283 1364 /* … … 1286 1367 */ 1287 1368 CAxis::TransMapTypes CAxis::getAllTransformations(void) 1369 TRY 1288 1370 { 1289 1371 return transformationMap_; 1290 1372 } 1373 CATCH_DUMP_ATTR 1291 1374 1292 1375 /* … … 1295 1378 */ 1296 1379 void CAxis::duplicateTransformation(CAxis* src) 1380 TRY 1297 1381 { 1298 1382 if (src->hasTransformation()) … … 1301 1385 } 1302 1386 } 1387 CATCH_DUMP_ATTR 1303 1388 1304 1389 /*! … … 1306 1391 */ 1307 1392 void CAxis::solveInheritanceTransformation() 1393 TRY 1308 1394 { 1309 1395 if (hasTransformation() || !hasDirectAxisReference()) … … 1322 1408 refAxis[i]->setTransformations(axis->getAllTransformations()); 1323 1409 } 1410 CATCH_DUMP_ATTR 1324 1411 1325 1412 void CAxis::setContextClient(CContextClient* contextClient) 1413 TRY 1326 1414 { 1327 1415 if (clientsSet.find(contextClient)==clientsSet.end()) … … 1330 1418 clientsSet.insert(contextClient); 1331 1419 } 1332 } 1420 } 1421 CATCH_DUMP_ATTR 1333 1422 1334 1423 void CAxis::parse(xml::CXMLNode & node) 1424 TRY 1335 1425 { 1336 1426 SuperClass::parse(node); … … 1363 1453 } 1364 1454 } 1455 CATCH_DUMP_ATTR 1365 1456 1366 1457 DEFINE_REF_FUNC(Axis,axis) -
XIOS/trunk/src/node/context.cpp
r1542 r1622 33 33 , idServer_(), client(0), server(0) 34 34 , allProcessed(false), countChildCtx_(0) 35 35 36 { /* Ne rien faire de plus */ } 36 37 … … 65 66 */ 66 67 CContextGroup* CContext::getRoot(void) 68 TRY 67 69 { 68 70 if (root.get()==NULL) root=std::shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 69 71 return root.get(); 70 72 } 73 CATCH 71 74 72 75 //---------------------------------------------------------------- … … 77 80 */ 78 81 std::shared_ptr<CCalendar> CContext::getCalendar(void) const 82 TRY 79 83 { 80 84 return (this->calendar); 81 85 } 86 CATCH 82 87 83 88 //---------------------------------------------------------------- … … 88 93 */ 89 94 void CContext::setCalendar(std::shared_ptr<CCalendar> newCalendar) 95 TRY 90 96 { 91 97 this->calendar = newCalendar; 92 98 } 99 CATCH_DUMP_ATTR 93 100 94 101 //---------------------------------------------------------------- … … 98 105 */ 99 106 void CContext::parse(xml::CXMLNode & node) 107 TRY 100 108 { 101 109 CContext::SuperClass::parse(node); … … 152 160 } 153 161 } 162 CATCH_DUMP_ATTR 154 163 155 164 //---------------------------------------------------------------- 156 165 //! Show tree structure of context 157 166 void CContext::ShowTree(StdOStream & out) 167 TRY 158 168 { 159 169 StdString currentContextId = CContext::getCurrent() -> getId(); … … 176 186 CContext::setCurrent(currentContextId); 177 187 } 178 188 CATCH 179 189 180 190 //---------------------------------------------------------------- … … 182 192 //! Convert context object into string (to print) 183 193 StdString CContext::toString(void) const 194 TRY 184 195 { 185 196 StdOStringStream oss; … … 201 212 202 213 } 203 204 214 oss << "</" << CContext::GetName() << " >"; 205 206 215 return (oss.str()); 207 216 } 217 CATCH 208 218 209 219 //---------------------------------------------------------------- … … 216 226 */ 217 227 void CContext::solveDescInheritance(bool apply, const CAttributeMap * const UNUSED(parent)) 228 TRY 218 229 { 219 230 #define DECLARE_NODE(Name_, name_) \ … … 223 234 #include "node_type.conf" 224 235 } 236 CATCH_DUMP_ATTR 225 237 226 238 //---------------------------------------------------------------- … … 228 240 //! Verify if all root definition in the context have child. 229 241 bool CContext::hasChild(void) const 242 TRY 230 243 { 231 244 return ( … … 236 249 false); 237 250 } 251 CATCH 238 252 239 253 //---------------------------------------------------------------- 240 254 241 255 void CContext::CleanTree(void) 256 TRY 242 257 { 243 258 #define DECLARE_NODE(Name_, name_) C##Name_##Definition::ClearAllAttributes(); … … 245 260 #include "node_type.conf" 246 261 } 262 CATCH 263 247 264 ///--------------------------------------------------------------- 248 265 249 266 //! Initialize client side 250 267 void CContext::initClient(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtServer /*= 0*/) 268 TRY 251 269 { 252 270 … … 298 316 } 299 317 } 318 CATCH_DUMP_ATTR 300 319 301 320 /*! … … 306 325 */ 307 326 void CContext::setClientServerBuffer(CContextClient* contextClient, bool bufferForWriting) 327 TRY 308 328 { 309 329 // Estimated minimum event size for small events (10 is an arbitrary constant just for safety) … … 352 372 } 353 373 contextClient->setBufferSize(bufferSize, maxEventSize); 354 355 }374 } 375 CATCH_DUMP_ATTR 356 376 357 377 //! Verify whether a context is initialized 358 378 bool CContext::isInitialized(void) 379 TRY 359 380 { 360 381 return hasClient; 361 382 } 383 CATCH_DUMP_ATTR 362 384 363 385 void CContext::initServer(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtClient /*= 0*/) 386 TRY 364 387 { 365 388 hasServer=true; … … 394 417 client = new CContextClient(this,intraCommClient,interCommClient, cxtClient); 395 418 } 419 CATCH_DUMP_ATTR 396 420 397 421 //! Try to send the buffers and receive possible answers 398 422 bool CContext::checkBuffersAndListen(bool enableEventsProcessing /*= true*/) 423 TRY 399 424 { 400 425 bool clientReady, serverFinished; … … 434 459 } 435 460 } 461 CATCH_DUMP_ATTR 436 462 437 463 //! Terminate a context 438 464 void CContext::finalize(void) 465 TRY 439 466 { 440 467 if (hasClient && !hasServer) // For now we only use server level 1 to read data … … 527 554 } 528 555 } 556 CATCH_DUMP_ATTR 529 557 530 558 //! Free internally allocated communicators 531 559 void CContext::freeComms(void) 560 TRY 532 561 { 533 562 for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) … … 535 564 comms.clear(); 536 565 } 566 CATCH_DUMP_ATTR 537 567 538 568 //! Deallocate buffers allocated by clientContexts 539 569 void CContext::releaseClientBuffers(void) 570 TRY 540 571 { 541 572 client->releaseBuffers(); … … 543 574 clientPrimServer[i]->releaseBuffers(); 544 575 } 576 CATCH_DUMP_ATTR 545 577 546 578 void CContext::postProcessingGlobalAttributes() 579 TRY 547 580 { 548 581 if (allProcessed) return; … … 608 641 allProcessed = true; 609 642 } 643 CATCH_DUMP_ATTR 610 644 611 645 void CContext::sendPostProcessingGlobalAttributes() 646 TRY 612 647 { 613 648 // Use correct context client to send message … … 634 669 } 635 670 } 671 CATCH_DUMP_ATTR 636 672 637 673 void CContext::recvPostProcessingGlobalAttributes(CEventServer& event) 674 TRY 638 675 { 639 676 CBufferIn* buffer=event.subEvents.begin()->buffer; … … 642 679 get(id)->recvPostProcessingGlobalAttributes(*buffer); 643 680 } 681 CATCH 644 682 645 683 void CContext::recvPostProcessingGlobalAttributes(CBufferIn& buffer) 684 TRY 646 685 { 647 686 postProcessingGlobalAttributes(); 648 687 } 688 CATCH_DUMP_ATTR 649 689 650 690 /*! … … 657 697 and the active fields (fields will be written onto active files) 658 698 */ 699 659 700 void CContext::closeDefinition(void) 701 TRY 660 702 { 661 703 CTimer::get("Context : close definition").resume() ; … … 688 730 CTimer::get("Context : close definition").suspend() ; 689 731 } 732 CATCH_DUMP_ATTR 690 733 691 734 void CContext::findAllEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 735 TRY 692 736 { 693 737 for (unsigned int i = 0; i < activeFiles.size(); i++) 694 738 (void)activeFiles[i]->getEnabledFields(); 695 739 } 740 CATCH_DUMP_ATTR 696 741 697 742 void CContext::readAttributesOfEnabledFieldsInReadModeFiles() 743 TRY 698 744 { 699 745 for (unsigned int i = 0; i < this->enabledReadModeFiles.size(); ++i) 700 746 (void)this->enabledReadModeFiles[i]->readAttributesOfEnabledFieldsInReadMode(); 701 747 } 748 CATCH_DUMP_ATTR 702 749 703 750 void CContext::sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 751 TRY 704 752 { 705 753 int size = activeFiles.size(); … … 709 757 } 710 758 } 759 CATCH_DUMP_ATTR 711 760 712 761 /*! … … 715 764 */ 716 765 void CContext::sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 766 TRY 717 767 { 718 768 int size = activeFiles.size(); … … 722 772 } 723 773 } 774 CATCH_DUMP_ATTR 724 775 725 776 void CContext::checkGridEnabledFields() 777 TRY 726 778 { 727 779 int size = enabledFiles.size(); … … 731 783 } 732 784 } 785 CATCH_DUMP_ATTR 733 786 734 787 /*! … … 737 790 */ 738 791 void CContext::checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 792 TRY 739 793 { 740 794 int size = activeFiles.size(); … … 744 798 } 745 799 } 800 CATCH_DUMP_ATTR 746 801 747 802 /*! … … 751 806 */ 752 807 void CContext::solveOnlyRefOfEnabledFields(bool sendToServer) 808 TRY 753 809 { 754 810 int size = this->enabledFiles.size(); … … 763 819 } 764 820 } 821 CATCH_DUMP_ATTR 765 822 766 823 /*! … … 771 828 */ 772 829 void CContext::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer) 830 TRY 773 831 { 774 832 int size = this->enabledFiles.size(); … … 778 836 } 779 837 } 838 CATCH_DUMP_ATTR 780 839 781 840 void CContext::buildFilterGraphOfEnabledFields() 841 TRY 782 842 { 783 843 int size = this->enabledFiles.size(); … … 787 847 } 788 848 } 849 CATCH_DUMP_ATTR 789 850 790 851 void CContext::postProcessFilterGraph() 852 TRY 791 853 { 792 854 int size = enabledFiles.size(); … … 796 858 } 797 859 } 860 CATCH_DUMP_ATTR 798 861 799 862 void CContext::startPrefetchingOfEnabledReadModeFiles() 863 TRY 800 864 { 801 865 int size = enabledReadModeFiles.size(); … … 805 869 } 806 870 } 871 CATCH_DUMP_ATTR 807 872 808 873 void CContext::doPreTimestepOperationsForEnabledReadModeFiles() 874 TRY 809 875 { 810 876 int size = enabledReadModeFiles.size(); … … 814 880 } 815 881 } 882 CATCH_DUMP_ATTR 816 883 817 884 void CContext::doPostTimestepOperationsForEnabledReadModeFiles() 885 TRY 818 886 { 819 887 int size = enabledReadModeFiles.size(); … … 823 891 } 824 892 } 893 CATCH_DUMP_ATTR 825 894 826 895 void CContext::findFieldsWithReadAccess(void) 896 TRY 827 897 { 828 898 fieldsWithReadAccess.clear(); … … 838 908 } 839 909 } 910 CATCH_DUMP_ATTR 840 911 841 912 void CContext::solveAllRefOfFieldsWithReadAccess() 913 TRY 842 914 { 843 915 for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i) 844 916 fieldsWithReadAccess[i]->solveAllReferenceEnabledField(false); 845 917 } 918 CATCH_DUMP_ATTR 846 919 847 920 void CContext::buildFilterGraphOfFieldsWithReadAccess() 921 TRY 848 922 { 849 923 for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i) 850 924 fieldsWithReadAccess[i]->buildFilterGraph(garbageCollector, true); 851 925 } 926 CATCH_DUMP_ATTR 852 927 853 928 void CContext::solveAllInheritance(bool apply) 929 TRY 854 930 { 855 931 // Résolution des héritages descendants (cà d des héritages de groupes) … … 874 950 875 951 } 952 CATCH_DUMP_ATTR 876 953 877 954 void CContext::findEnabledFiles(void) 955 TRY 878 956 { 879 957 const std::vector<CFile*> allFiles = CFile::getAll(); … … 924 1002 925 1003 } 1004 CATCH_DUMP_ATTR 926 1005 927 1006 void CContext::distributeFiles(void) 1007 TRY 928 1008 { 929 1009 bool distFileMemory=false ; … … 933 1013 else distributeFileOverBandwith() ; 934 1014 } 935 1015 CATCH_DUMP_ATTR 936 1016 937 1017 void CContext::distributeFileOverBandwith(void) 1018 TRY 938 1019 { 939 1020 double eps=std::numeric_limits<double>::epsilon()*10 ; … … 1015 1096 } 1016 1097 } 1098 CATCH_DUMP_ATTR 1017 1099 1018 1100 void CContext::distributeFileOverMemoryBandwith(void) 1101 TRY 1019 1102 { 1020 1103 // If primary server … … 1107 1190 } 1108 1191 } 1109 1110 1192 CATCH_DUMP_ATTR 1111 1193 1112 1194 /*! … … 1114 1196 */ 1115 1197 void CContext::findEnabledWriteModeFiles(void) 1198 TRY 1116 1199 { 1117 1200 int size = this->enabledFiles.size(); … … 1123 1206 } 1124 1207 } 1208 CATCH_DUMP_ATTR 1125 1209 1126 1210 /*! … … 1128 1212 */ 1129 1213 void CContext::findEnabledReadModeFiles(void) 1214 TRY 1130 1215 { 1131 1216 int size = this->enabledFiles.size(); … … 1136 1221 } 1137 1222 } 1223 CATCH_DUMP_ATTR 1138 1224 1139 1225 void CContext::closeAllFile(void) 1226 TRY 1140 1227 { 1141 1228 std::vector<CFile*>::const_iterator … … 1148 1235 } 1149 1236 } 1237 CATCH_DUMP_ATTR 1150 1238 1151 1239 /*! … … 1157 1245 */ 1158 1246 bool CContext::dispatchEvent(CEventServer& event) 1247 TRY 1159 1248 { 1160 1249 … … 1198 1287 } 1199 1288 } 1289 CATCH 1200 1290 1201 1291 //! Client side: Send a message to server to make it close 1202 1292 void CContext::sendCloseDefinition(void) 1293 TRY 1203 1294 { 1204 1295 // Use correct context client to send message … … 1223 1314 } 1224 1315 } 1316 CATCH_DUMP_ATTR 1225 1317 1226 1318 //! Server side: Receive a message of client announcing a context close 1227 1319 void CContext::recvCloseDefinition(CEventServer& event) 1320 TRY 1228 1321 { 1229 1322 CBufferIn* buffer=event.subEvents.begin()->buffer; … … 1232 1325 get(id)->closeDefinition(); 1233 1326 } 1327 CATCH 1234 1328 1235 1329 //! Client side: Send a message to update calendar in each time step 1236 1330 void CContext::sendUpdateCalendar(int step) 1331 TRY 1237 1332 { 1238 1333 // Use correct context client to send message … … 1258 1353 } 1259 1354 } 1355 CATCH_DUMP_ATTR 1260 1356 1261 1357 //! Server side: Receive a message of client annoucing calendar update 1262 1358 void CContext::recvUpdateCalendar(CEventServer& event) 1359 TRY 1263 1360 { 1264 1361 CBufferIn* buffer=event.subEvents.begin()->buffer; … … 1267 1364 get(id)->recvUpdateCalendar(*buffer); 1268 1365 } 1366 CATCH 1269 1367 1270 1368 //! Server side: Receive a message of client annoucing calendar update 1271 1369 void CContext::recvUpdateCalendar(CBufferIn& buffer) 1370 TRY 1272 1371 { 1273 1372 int step; … … 1279 1378 } 1280 1379 } 1380 CATCH_DUMP_ATTR 1281 1381 1282 1382 //! Client side: Send a message to create header part of netcdf file 1283 1383 void CContext::sendCreateFileHeader(void) 1384 TRY 1284 1385 { 1285 1386 // Use correct context client to send message … … 1306 1407 } 1307 1408 } 1409 CATCH_DUMP_ATTR 1308 1410 1309 1411 //! Server side: Receive a message of client annoucing the creation of header part of netcdf file 1310 1412 void CContext::recvCreateFileHeader(CEventServer& event) 1413 TRY 1311 1414 { 1312 1415 CBufferIn* buffer=event.subEvents.begin()->buffer; … … 1315 1418 get(id)->recvCreateFileHeader(*buffer); 1316 1419 } 1420 CATCH 1317 1421 1318 1422 //! Server side: Receive a message of client annoucing the creation of header part of netcdf file 1319 1423 void CContext::recvCreateFileHeader(CBufferIn& buffer) 1424 TRY 1320 1425 { 1321 1426 if (!hasClient && hasServer) 1322 1427 createFileHeader(); 1323 1428 } 1429 CATCH_DUMP_ATTR 1324 1430 1325 1431 //! Client side: Send a message to do some post processing on server 1326 1432 void CContext::sendProcessingGridOfEnabledFields() 1433 TRY 1327 1434 { 1328 1435 // Use correct context client to send message … … 1348 1455 } 1349 1456 } 1457 CATCH_DUMP_ATTR 1350 1458 1351 1459 //! Server side: Receive a message to do some post processing 1352 1460 void CContext::recvProcessingGridOfEnabledFields(CEventServer& event) 1461 TRY 1353 1462 { 1354 1463 CBufferIn* buffer=event.subEvents.begin()->buffer; … … 1356 1465 *buffer>>id; 1357 1466 } 1467 CATCH 1358 1468 1359 1469 //! Client side: Send a message to do some post processing on server 1360 1470 void CContext::sendPostProcessing() 1471 TRY 1361 1472 { 1362 1473 // Use correct context client to send message … … 1382 1493 } 1383 1494 } 1495 CATCH_DUMP_ATTR 1384 1496 1385 1497 //! Server side: Receive a message to do some post processing 1386 1498 void CContext::recvPostProcessing(CEventServer& event) 1499 TRY 1387 1500 { 1388 1501 CBufferIn* buffer=event.subEvents.begin()->buffer; … … 1391 1504 get(id)->recvPostProcessing(*buffer); 1392 1505 } 1506 CATCH 1393 1507 1394 1508 //! Server side: Receive a message to do some post processing 1395 1509 void CContext::recvPostProcessing(CBufferIn& buffer) 1510 TRY 1396 1511 { 1397 1512 CCalendarWrapper::get(CCalendarWrapper::GetDefName())->createCalendar(); 1398 1513 postProcessing(); 1399 1514 } 1515 CATCH_DUMP_ATTR 1400 1516 1401 1517 const StdString& CContext::getIdServer() 1518 TRY 1402 1519 { 1403 1520 if (hasClient) … … 1409 1526 if (hasServer) return (this->getId()); 1410 1527 } 1528 CATCH_DUMP_ATTR 1411 1529 1412 1530 const StdString& CContext::getIdServer(const int i) 1531 TRY 1413 1532 { 1414 1533 idServer_ = this->getId(); … … 1417 1536 return idServer_; 1418 1537 } 1419 1538 CATCH_DUMP_ATTR 1420 1539 1421 1540 /*! … … 1426 1545 */ 1427 1546 void CContext::postProcessing() 1547 TRY 1428 1548 { 1429 1549 if (isPostProcessed) return; … … 1488 1608 isPostProcessed = true; 1489 1609 } 1610 CATCH_DUMP_ATTR 1490 1611 1491 1612 /*! … … 1498 1619 std::map<int, StdSize> CContext::getAttributesBufferSize(std::map<int, StdSize>& maxEventSize, 1499 1620 CContextClient* contextClient, bool bufferForWriting /*= "false"*/) 1621 TRY 1500 1622 { 1501 1623 // As calendar attributes are sent even if there are no active files or fields, maps are initialized according the size of calendar attributes … … 1529 1651 return attributesSize; 1530 1652 } 1653 CATCH_DUMP_ATTR 1531 1654 1532 1655 /*! … … 1539 1662 std::map<int, StdSize> CContext::getDataBufferSize(std::map<int, StdSize>& maxEventSize, 1540 1663 CContextClient* contextClient, bool bufferForWriting /*= "false"*/) 1664 TRY 1541 1665 { 1542 1666 std::map<int, StdSize> dataSize; … … 1547 1671 for (size_t i = 0; i < numEnabledFiles; ++i) 1548 1672 { 1549 // CFile* file = this->enabledFiles[i];1550 1673 CFile* file = fileList[i]; 1551 1674 if (file->getContextClient() == contextClient) … … 1575 1698 return dataSize; 1576 1699 } 1700 CATCH_DUMP_ATTR 1577 1701 1578 1702 //! Client side: Send infomation of active files (files are enabled to write out) 1579 1703 void CContext::sendEnabledFiles(const std::vector<CFile*>& activeFiles) 1704 TRY 1580 1705 { 1581 1706 int size = activeFiles.size(); … … 1595 1720 } 1596 1721 } 1722 CATCH_DUMP_ATTR 1597 1723 1598 1724 //! Client side: Send information of active fields (ones are written onto files) 1599 1725 void CContext::sendEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 1726 TRY 1600 1727 { 1601 1728 int size = activeFiles.size(); … … 1605 1732 } 1606 1733 } 1734 CATCH_DUMP_ATTR 1607 1735 1608 1736 //! Client side: Check if the defined axis, domains and grids are eligible for compressed indexed output 1609 1737 void CContext::checkAxisDomainsGridsEligibilityForCompressedOutput() 1738 TRY 1610 1739 { 1611 1740 if (!hasClient) return; … … 1623 1752 (*it)->checkEligibilityForCompressedOutput(); 1624 1753 } 1754 CATCH_DUMP_ATTR 1625 1755 1626 1756 //! Client side: Prepare the timeseries by adding the necessary files 1627 1757 void CContext::prepareTimeseries() 1758 TRY 1628 1759 { 1629 1760 if (!hasClient) return; … … 1723 1854 } 1724 1855 } 1856 CATCH_DUMP_ATTR 1725 1857 1726 1858 //! Client side: Send information of reference grid of active fields 1727 1859 void CContext::sendRefGrid(const std::vector<CFile*>& activeFiles) 1860 TRY 1728 1861 { 1729 1862 std::set<StdString> gridIds; … … 1757 1890 } 1758 1891 } 1892 CATCH_DUMP_ATTR 1759 1893 1760 1894 //! Client side: Send information of reference domain, axis and scalar of active fields 1761 1895 void CContext::sendRefDomainsAxisScalars(const std::vector<CFile*>& activeFiles) 1896 TRY 1762 1897 { 1763 1898 std::set<StdString> domainIds, axisIds, scalarIds; … … 1818 1953 } 1819 1954 } 1955 CATCH_DUMP_ATTR 1820 1956 1821 1957 //! Update calendar in each time step 1822 1958 void CContext::updateCalendar(int step) 1959 TRY 1823 1960 { 1824 1961 int prevStep = calendar->getStep(); … … 1850 1987 << "Illegal calendar update: previous step was " << prevStep << ", new step " << step << "is in the past!") 1851 1988 } 1989 CATCH_DUMP_ATTR 1852 1990 1853 1991 void CContext::initReadFiles(void) 1992 TRY 1854 1993 { 1855 1994 vector<CFile*>::const_iterator it; … … 1860 1999 } 1861 2000 } 2001 CATCH_DUMP_ATTR 1862 2002 1863 2003 //! Server side: Create header of netcdf file 1864 2004 void CContext::createFileHeader(void) 2005 TRY 1865 2006 { 1866 2007 vector<CFile*>::const_iterator it; … … 1872 2013 } 1873 2014 } 2015 CATCH_DUMP_ATTR 1874 2016 1875 2017 //! Get current context 1876 2018 CContext* CContext::getCurrent(void) 2019 TRY 1877 2020 { 1878 2021 return CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()).get(); 1879 2022 } 2023 CATCH 1880 2024 1881 2025 /*! … … 1884 2028 */ 1885 2029 void CContext::setCurrent(const string& id) 2030 TRY 1886 2031 { 1887 2032 CObjectFactory::SetCurrentContextId(id); 1888 2033 CGroupFactory::SetCurrentContextId(id); 1889 2034 } 2035 CATCH 1890 2036 1891 2037 /*! … … 1895 2041 */ 1896 2042 CContext* CContext::create(const StdString& id) 2043 TRY 1897 2044 { 1898 2045 CContext::setCurrent(id); … … 1910 2057 return (context); 1911 2058 } 1912 2059 CATCH 1913 2060 1914 2061 //! Server side: Receive a message to do some post processing 1915 2062 void CContext::recvRegistry(CEventServer& event) 2063 TRY 1916 2064 { 1917 2065 CBufferIn* buffer=event.subEvents.begin()->buffer; … … 1920 2068 get(id)->recvRegistry(*buffer); 1921 2069 } 2070 CATCH 1922 2071 1923 2072 void CContext::recvRegistry(CBufferIn& buffer) 2073 TRY 1924 2074 { 1925 2075 if (server->intraCommRank==0) … … 1930 2080 } 1931 2081 } 2082 CATCH_DUMP_ATTR 1932 2083 1933 2084 void CContext::sendRegistry(void) 2085 TRY 1934 2086 { 1935 2087 registryOut->hierarchicalGatherRegistry() ; … … 1957 2109 } 1958 2110 } 2111 CATCH_DUMP_ATTR 1959 2112 1960 2113 /*! … … 1963 2116 */ 1964 2117 bool CContext::isFinalized(void) 2118 TRY 1965 2119 { 1966 2120 return finalized; 1967 2121 } 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 } 1968 2137 1969 2138 } // namespace xios -
XIOS/trunk/src/node/context.hpp
r1542 r1622 91 91 void initServer(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtClient = 0); 92 92 bool isInitialized(void); 93 94 StdString dumpClassAttributes(void); 93 95 94 96 // Put sever or client into loop state … … 143 145 void distributeFileOverMemoryBandwith() ; 144 146 145 146 147 // Send context close definition 147 148 void sendCloseDefinition(void); -
XIOS/trunk/src/node/domain.cpp
r1578 r1622 58 58 59 59 void CDomain::assignMesh(const StdString meshName, const int nvertex) 60 TRY 60 61 { 61 62 mesh = CMesh::getMesh(meshName, nvertex); 62 63 } 64 CATCH_DUMP_ATTR 63 65 64 66 CDomain* CDomain::createDomain() 67 TRY 65 68 { 66 69 CDomain* domain = CDomainGroup::get("domain_definition")->createChild(); 67 70 return domain; 68 71 } 72 CATCH 69 73 70 74 std::map<StdString, ETranformationType> CDomain::transformationMapList_ = std::map<StdString, ETranformationType>(); … … 72 76 73 77 bool CDomain::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 78 TRY 74 79 { 75 80 m["zoom_domain"] = TRANS_ZOOM_DOMAIN; … … 81 86 m["extract_domain"] = TRANS_EXTRACT_DOMAIN; 82 87 } 88 CATCH 83 89 84 90 const std::set<StdString> & CDomain::getRelFiles(void) const 91 TRY 85 92 { 86 93 return (this->relFiles); 87 94 } 88 95 CATCH 89 96 90 97 /*! … … 93 100 */ 94 101 int CDomain::getNumberWrittenIndexes(MPI_Comm writtenCom) 102 TRY 95 103 { 96 104 int writtenSize; … … 98 106 return numberWrittenIndexes_[writtenSize]; 99 107 } 108 CATCH_DUMP_ATTR 100 109 101 110 /*! … … 104 113 */ 105 114 int CDomain::getTotalNumberWrittenIndexes(MPI_Comm writtenCom) 115 TRY 106 116 { 107 117 int writtenSize; … … 109 119 return totalNumberWrittenIndexes_[writtenSize]; 110 120 } 121 CATCH_DUMP_ATTR 111 122 112 123 /*! … … 115 126 */ 116 127 int CDomain::getOffsetWrittenIndexes(MPI_Comm writtenCom) 128 TRY 117 129 { 118 130 int writtenSize; … … 120 132 return offsetWrittenIndexes_[writtenSize]; 121 133 } 134 CATCH_DUMP_ATTR 122 135 123 136 CArray<int, 1>& CDomain::getCompressedIndexToWriteOnServer(MPI_Comm writtenCom) 137 TRY 124 138 { 125 139 int writtenSize; … … 127 141 return compressedIndexToWriteOnServer[writtenSize]; 128 142 } 143 CATCH_DUMP_ATTR 129 144 130 145 //---------------------------------------------------------------- … … 136 151 */ 137 152 std::map<int, StdSize> CDomain::getAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= false*/) 153 TRY 138 154 { 139 155 … … 182 198 return attributesSizes; 183 199 } 200 CATCH_DUMP_ATTR 184 201 185 202 //---------------------------------------------------------------- 186 203 187 204 bool CDomain::isEmpty(void) const 205 TRY 188 206 { 189 207 return ((this->i_index.isEmpty()) || (0 == this->i_index.numElements())); 190 208 } 209 CATCH 191 210 192 211 //---------------------------------------------------------------- 193 212 194 213 bool CDomain::IsWritten(const StdString & filename) const 214 TRY 195 215 { 196 216 return (this->relFiles.find(filename) != this->relFiles.end()); 197 217 } 218 CATCH 198 219 199 220 bool CDomain::isWrittenCompressed(const StdString& filename) const 221 TRY 200 222 { 201 223 return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 202 224 } 225 CATCH 203 226 204 227 //---------------------------------------------------------------- 205 228 206 229 bool CDomain::isDistributed(void) const 230 TRY 207 231 { 208 232 bool distributed = !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) || … … 212 236 return distributed; 213 237 } 238 CATCH 214 239 215 240 //---------------------------------------------------------------- … … 221 246 */ 222 247 bool CDomain::isCompressible(void) const 248 TRY 223 249 { 224 250 return isCompressible_; 225 251 } 252 CATCH 226 253 227 254 void CDomain::addRelFile(const StdString & filename) 255 TRY 228 256 { 229 257 this->relFiles.insert(filename); 230 258 } 259 CATCH_DUMP_ATTR 231 260 232 261 void CDomain::addRelFileCompressed(const StdString& filename) 262 TRY 233 263 { 234 264 this->relFilesCompressed.insert(filename); 235 265 } 266 CATCH_DUMP_ATTR 236 267 237 268 StdString CDomain::GetName(void) { return (StdString("domain")); } … … 246 277 */ 247 278 bool CDomain::distributionAttributesHaveValue() const 279 TRY 248 280 { 249 281 bool hasValues = true; … … 257 289 return hasValues; 258 290 } 291 CATCH 259 292 260 293 /*! … … 266 299 */ 267 300 void CDomain::redistribute(int nbLocalDomain) 301 TRY 268 302 { 269 303 if (this->isRedistributed_) return; … … 428 462 checkDomain(); 429 463 } 464 CATCH_DUMP_ATTR 430 465 431 466 /*! … … 433 468 */ 434 469 void CDomain::fillInLonLat() 470 TRY 435 471 { 436 472 switch (type) … … 450 486 } 451 487 completeLonLatClient() ; 452 453 }488 } 489 CATCH_DUMP_ATTR 454 490 455 491 /*! … … 459 495 */ 460 496 void CDomain::fillInRectilinearLonLat() 497 TRY 461 498 { 462 499 if (!lonvalue_rectilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) … … 527 564 } 528 565 } 566 CATCH_DUMP_ATTR 529 567 530 568 /* … … 533 571 */ 534 572 void CDomain::fillInCurvilinearLonLat() 573 TRY 535 574 { 536 575 if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) … … 575 614 bounds_latvalue_curvilinear_read_from_file.free(); 576 615 } 577 578 }616 } 617 CATCH_DUMP_ATTR 579 618 580 619 /* … … 583 622 */ 584 623 void CDomain::fillInUnstructuredLonLat() 624 TRY 585 625 { 586 626 if (i_index.isEmpty()) … … 634 674 } 635 675 } 676 CATCH_DUMP_ATTR 636 677 637 678 /* … … 639 680 */ 640 681 void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g) 682 TRY 641 683 { 642 684 CContext* context = CContext::getCurrent(); … … 670 712 delete[] nj_g ; 671 713 } 714 CATCH_DUMP_ATTR 672 715 673 716 void CDomain::fillInRectilinearBoundLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 674 717 CArray<double,2>& boundsLon, CArray<double,2>& boundsLat) 675 { 718 TRY 719 { 676 720 int i,j,k; 677 721 … … 772 816 } 773 817 } 818 CATCH_DUMP_ATTR 774 819 775 820 /* … … 777 822 */ 778 823 void CDomain::checkDomain(void) 824 TRY 779 825 { 780 826 if (type.isEmpty()) … … 868 914 } 869 915 } 916 CATCH_DUMP_ATTR 870 917 871 918 size_t CDomain::getGlobalWrittenSize(void) … … 877 924 // Check validity of local domain on using the combination of 3 parameters: ibegin, ni and i_index 878 925 void CDomain::checkLocalIDomain(void) 926 TRY 879 927 { 880 928 // If ibegin and ni are provided then we use them to check the validity of local domain … … 935 983 } 936 984 } 985 CATCH_DUMP_ATTR 937 986 938 987 // Check validity of local domain on using the combination of 3 parameters: jbegin, nj and j_index 939 988 void CDomain::checkLocalJDomain(void) 989 TRY 940 990 { 941 991 // If jbegin and nj are provided then we use them to check the validity of local domain … … 986 1036 } 987 1037 } 1038 CATCH_DUMP_ATTR 988 1039 989 1040 //---------------------------------------------------------------- 990 1041 991 1042 void CDomain::checkMask(void) 1043 TRY 992 1044 { 993 1045 if (!mask_1d.isEmpty() && !mask_2d.isEmpty()) … … 1035 1087 } 1036 1088 } 1089 CATCH_DUMP_ATTR 1037 1090 1038 1091 //---------------------------------------------------------------- 1039 1092 1040 1093 void CDomain::checkDomainData(void) 1094 TRY 1041 1095 { 1042 1096 if (data_dim.isEmpty()) … … 1078 1132 } 1079 1133 } 1134 CATCH_DUMP_ATTR 1080 1135 1081 1136 //---------------------------------------------------------------- 1082 1137 1083 1138 void CDomain::checkCompression(void) 1139 TRY 1084 1140 { 1085 1141 if (!data_i_index.isEmpty()) … … 1148 1204 } 1149 1205 } 1206 CATCH_DUMP_ATTR 1150 1207 1151 1208 //---------------------------------------------------------------- 1152 1209 void CDomain::computeLocalMask(void) 1210 TRY 1153 1211 { 1154 1212 localMask.resize(i_index.numElements()) ; … … 1182 1240 } 1183 1241 } 1242 CATCH_DUMP_ATTR 1184 1243 1185 1244 void CDomain::checkEligibilityForCompressedOutput(void) 1245 TRY 1186 1246 { 1187 1247 // We don't check if the mask or the indexes are valid here, just if they have been defined at this point. 1188 1248 isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !data_i_index.isEmpty(); 1189 1249 } 1250 CATCH_DUMP_ATTR 1190 1251 1191 1252 //---------------------------------------------------------------- … … 1196 1257 */ 1197 1258 void CDomain::completeLonLatClient(void) 1259 TRY 1198 1260 { 1199 1261 bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); … … 1309 1371 } 1310 1372 } 1373 CATCH_DUMP_ATTR 1311 1374 1312 1375 /* … … 1314 1377 */ 1315 1378 void CDomain::convertLonLatValue(void) 1379 TRY 1316 1380 { 1317 1381 bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); … … 1411 1475 } 1412 1476 } 1413 1477 CATCH_DUMP_ATTR 1414 1478 1415 1479 void CDomain::checkBounds(void) 1480 TRY 1416 1481 { 1417 1482 bool hasBoundValues = (0 != bounds_lonvalue.numElements()) || (0 != bounds_latvalue.numElements()); … … 1505 1570 } 1506 1571 } 1572 CATCH_DUMP_ATTR 1507 1573 1508 1574 void CDomain::checkArea(void) 1575 TRY 1509 1576 { 1510 1577 bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements()); … … 1534 1601 } 1535 1602 } 1603 CATCH_DUMP_ATTR 1536 1604 1537 1605 void CDomain::checkLonLat() 1606 TRY 1538 1607 { 1539 1608 if (!hasLonLat) hasLonLat = (!latvalue_1d.isEmpty() && !lonvalue_1d.isEmpty()) || … … 1595 1664 } 1596 1665 } 1666 CATCH_DUMP_ATTR 1597 1667 1598 1668 void CDomain::checkAttributesOnClientAfterTransformation() 1669 TRY 1599 1670 { 1600 1671 CContext* context=CContext::getCurrent() ; … … 1611 1682 this->isClientAfterTransformationChecked = true; 1612 1683 } 1684 CATCH_DUMP_ATTR 1613 1685 1614 1686 //---------------------------------------------------------------- … … 1616 1688 // This function only checks all attributes of current domain 1617 1689 void CDomain::checkAttributesOnClient() 1690 TRY 1618 1691 { 1619 1692 if (this->isClientChecked) return; … … 1641 1714 this->isClientChecked = true; 1642 1715 } 1716 CATCH_DUMP_ATTR 1643 1717 1644 1718 // Send all checked attributes to server 1645 1719 void CDomain::sendCheckedAttributes() 1720 TRY 1646 1721 { 1647 1722 if (!this->isClientChecked) checkAttributesOnClient(); … … 1656 1731 this->isChecked = true; 1657 1732 } 1733 CATCH_DUMP_ATTR 1658 1734 1659 1735 void CDomain::checkAttributes(void) 1736 TRY 1660 1737 { 1661 1738 if (this->isChecked) return; … … 1687 1764 this->isChecked = true; 1688 1765 } 1766 CATCH_DUMP_ATTR 1689 1767 1690 1768 /*! … … 1695 1773 */ 1696 1774 void CDomain::computeConnectedClients() 1775 TRY 1697 1776 { 1698 1777 CContext* context=CContext::getCurrent() ; … … 1799 1878 } 1800 1879 } 1880 CATCH_DUMP_ATTR 1801 1881 1802 1882 /*! … … 1806 1886 */ 1807 1887 void CDomain::computeWrittenIndex() 1888 TRY 1808 1889 { 1809 1890 if (computedWrittenIndex_) return; … … 1900 1981 // } 1901 1982 } 1983 CATCH_DUMP_ATTR 1902 1984 1903 1985 void CDomain::computeWrittenCompressedIndex(MPI_Comm writtenComm) 1986 TRY 1904 1987 { 1905 1988 int writtenCommSize; … … 1969 2052 } 1970 2053 } 2054 CATCH_DUMP_ATTR 1971 2055 1972 2056 /*! … … 1975 2059 */ 1976 2060 void CDomain::sendAttributes() 2061 TRY 1977 2062 { 1978 2063 sendDistributionAttributes(); … … 1983 2068 sendDataIndex(); 1984 2069 } 1985 2070 CATCH 1986 2071 /*! 1987 2072 Send global index from client to connected client(s) 1988 2073 */ 1989 2074 void CDomain::sendIndex() 2075 TRY 1990 2076 { 1991 2077 int ns, n, i, j, ind, nv, idx; … … 2030 2116 } 2031 2117 } 2118 CATCH_DUMP_ATTR 2032 2119 2033 2120 /*! … … 2037 2124 */ 2038 2125 void CDomain::sendDistributionAttributes(void) 2126 TRY 2039 2127 { 2040 2128 std::list<CContextClient*>::iterator it; … … 2083 2171 } 2084 2172 } 2173 CATCH_DUMP_ATTR 2085 2174 2086 2175 /*! … … 2088 2177 */ 2089 2178 void CDomain::sendMask() 2179 TRY 2090 2180 { 2091 2181 int ns, n, i, j, ind, nv, idx; … … 2127 2217 } 2128 2218 } 2219 CATCH_DUMP_ATTR 2129 2220 2130 2221 /*! … … 2132 2223 */ 2133 2224 void CDomain::sendArea() 2225 TRY 2134 2226 { 2135 2227 if (!hasArea) return; … … 2175 2267 } 2176 2268 } 2269 CATCH_DUMP_ATTR 2177 2270 2178 2271 /*! … … 2182 2275 */ 2183 2276 void CDomain::sendLonLat() 2277 TRY 2184 2278 { 2185 2279 if (!hasLonLat) return; … … 2270 2364 } 2271 2365 } 2366 CATCH_DUMP_ATTR 2272 2367 2273 2368 /*! … … 2278 2373 */ 2279 2374 void CDomain::sendDataIndex() 2375 TRY 2280 2376 { 2281 2377 int ns, n, i, j, ind, nv, idx; … … 2346 2442 } 2347 2443 } 2444 CATCH 2348 2445 2349 2446 bool CDomain::dispatchEvent(CEventServer& event) 2447 TRY 2350 2448 { 2351 2449 if (SuperClass::dispatchEvent(event)) return true; … … 2389 2487 } 2390 2488 } 2489 CATCH 2391 2490 2392 2491 /*! … … 2395 2494 */ 2396 2495 void CDomain::recvIndex(CEventServer& event) 2496 TRY 2397 2497 { 2398 2498 string domainId; … … 2408 2508 get(domainId)->recvIndex(rankBuffers); 2409 2509 } 2510 CATCH 2410 2511 2411 2512 /*! … … 2415 2516 */ 2416 2517 void CDomain::recvIndex(std::map<int, CBufferIn*>& rankBuffers) 2518 TRY 2417 2519 { 2418 2520 int nbReceived = rankBuffers.size(), i, ind, index, type_int, iIndex, jIndex; … … 2479 2581 } 2480 2582 } 2583 CATCH 2481 2584 2482 2585 /*! … … 2485 2588 */ 2486 2589 void CDomain::recvDistributionAttributes(CEventServer& event) 2590 TRY 2487 2591 { 2488 2592 CBufferIn* buffer=event.subEvents.begin()->buffer; … … 2491 2595 get(domainId)->recvDistributionAttributes(*buffer); 2492 2596 } 2597 CATCH 2493 2598 2494 2599 /*! … … 2498 2603 */ 2499 2604 void CDomain::recvDistributionAttributes(CBufferIn& buffer) 2605 TRY 2500 2606 { 2501 2607 int ni_tmp, ibegin_tmp, nj_tmp, jbegin_tmp; … … 2513 2619 2514 2620 } 2621 CATCH_DUMP_ATTR 2515 2622 2516 2623 /*! … … 2519 2626 */ 2520 2627 void CDomain::recvMask(CEventServer& event) 2628 TRY 2521 2629 { 2522 2630 string domainId; … … 2532 2640 get(domainId)->recvMask(rankBuffers); 2533 2641 } 2534 2642 CATCH 2535 2643 2536 2644 /*! … … 2539 2647 */ 2540 2648 void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers) 2649 TRY 2541 2650 { 2542 2651 int nbReceived = rankBuffers.size(), i, ind, index, lInd; … … 2582 2691 domainMask=mask_1d ; 2583 2692 } 2693 CATCH_DUMP_ATTR 2584 2694 2585 2695 /*! … … 2588 2698 */ 2589 2699 void CDomain::recvLon(CEventServer& event) 2700 TRY 2590 2701 { 2591 2702 string domainId; … … 2601 2712 get(domainId)->recvLon(rankBuffers); 2602 2713 } 2714 CATCH 2603 2715 2604 2716 /*! … … 2607 2719 */ 2608 2720 void CDomain::recvLon(std::map<int, CBufferIn*>& rankBuffers) 2721 TRY 2609 2722 { 2610 2723 int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; … … 2666 2779 } 2667 2780 } 2781 CATCH_DUMP_ATTR 2668 2782 2669 2783 /*! … … 2672 2786 */ 2673 2787 void CDomain::recvLat(CEventServer& event) 2788 TRY 2674 2789 { 2675 2790 string domainId; … … 2685 2800 get(domainId)->recvLat(rankBuffers); 2686 2801 } 2802 CATCH 2687 2803 2688 2804 /*! … … 2691 2807 */ 2692 2808 void CDomain::recvLat(std::map<int, CBufferIn*>& rankBuffers) 2809 TRY 2693 2810 { 2694 2811 int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; … … 2752 2869 } 2753 2870 } 2871 CATCH_DUMP_ATTR 2754 2872 2755 2873 /*! … … 2758 2876 */ 2759 2877 void CDomain::recvArea(CEventServer& event) 2878 TRY 2760 2879 { 2761 2880 string domainId; … … 2771 2890 get(domainId)->recvArea(rankBuffers); 2772 2891 } 2892 CATCH 2773 2893 2774 2894 /*! … … 2777 2897 */ 2778 2898 void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers) 2899 TRY 2779 2900 { 2780 2901 int nbReceived = rankBuffers.size(), i, ind, index, lInd; … … 2822 2943 } 2823 2944 } 2945 CATCH_DUMP_ATTR 2824 2946 2825 2947 /*! … … 2831 2953 */ 2832 2954 bool CDomain::isEqual(CDomain* obj) 2955 TRY 2833 2956 { 2834 2957 vector<StdString> excludedAttr; … … 2853 2976 return objEqual; 2854 2977 } 2978 CATCH_DUMP_ATTR 2855 2979 2856 2980 /*! … … 2859 2983 */ 2860 2984 void CDomain::recvDataIndex(CEventServer& event) 2985 TRY 2861 2986 { 2862 2987 string domainId; … … 2872 2997 get(domainId)->recvDataIndex(rankBuffers); 2873 2998 } 2999 CATCH 2874 3000 2875 3001 /*! … … 2883 3009 */ 2884 3010 void CDomain::recvDataIndex(std::map<int, CBufferIn*>& rankBuffers) 3011 TRY 2885 3012 { 2886 3013 int nbReceived = rankBuffers.size(), i, ind, index, indexI, indexJ, type_int, lInd; … … 2954 3081 data_jbegin.setValue(0); 2955 3082 } 3083 CATCH_DUMP_ATTR 2956 3084 2957 3085 CTransformation<CDomain>* CDomain::addTransformation(ETranformationType transType, const StdString& id) 3086 TRY 2958 3087 { 2959 3088 transformationMap_.push_back(std::make_pair(transType, CTransformation<CDomain>::createTransformation(transType,id))); 2960 3089 return transformationMap_.back().second; 2961 3090 } 3091 CATCH_DUMP_ATTR 2962 3092 2963 3093 /*! … … 2966 3096 */ 2967 3097 bool CDomain::hasTransformation() 3098 TRY 2968 3099 { 2969 3100 return (!transformationMap_.empty()); 2970 3101 } 3102 CATCH_DUMP_ATTR 2971 3103 2972 3104 /*! … … 2975 3107 */ 2976 3108 void CDomain::setTransformations(const TransMapTypes& domTrans) 3109 TRY 2977 3110 { 2978 3111 transformationMap_ = domTrans; 2979 3112 } 3113 CATCH_DUMP_ATTR 2980 3114 2981 3115 /*! … … 2984 3118 */ 2985 3119 CDomain::TransMapTypes CDomain::getAllTransformations(void) 3120 TRY 2986 3121 { 2987 3122 return transformationMap_; 2988 3123 } 3124 CATCH_DUMP_ATTR 2989 3125 2990 3126 void CDomain::duplicateTransformation(CDomain* src) 3127 TRY 2991 3128 { 2992 3129 if (src->hasTransformation()) … … 2995 3132 } 2996 3133 } 3134 CATCH_DUMP_ATTR 2997 3135 2998 3136 /*! … … 3000 3138 */ 3001 3139 void CDomain::solveInheritanceTransformation() 3140 TRY 3002 3141 { 3003 3142 if (hasTransformation() || !hasDirectDomainReference()) … … 3016 3155 refDomains[i]->setTransformations(domain->getAllTransformations()); 3017 3156 } 3157 CATCH_DUMP_ATTR 3018 3158 3019 3159 void CDomain::setContextClient(CContextClient* contextClient) 3160 TRY 3020 3161 { 3021 3162 if (clientsSet.find(contextClient)==clientsSet.end()) … … 3025 3166 } 3026 3167 } 3168 CATCH_DUMP_ATTR 3027 3169 3028 3170 /*! … … 3032 3174 */ 3033 3175 void CDomain::parse(xml::CXMLNode & node) 3176 TRY 3034 3177 { 3035 3178 SuperClass::parse(node); … … 3062 3205 } 3063 3206 } 3207 CATCH_DUMP_ATTR 3064 3208 //---------------------------------------------------------------- 3065 3209 -
XIOS/trunk/src/node/field.cpp
r1574 r1622 71 71 72 72 void CField::setVirtualVariableGroup(CVariableGroup* newVVariableGroup) 73 TRY 73 74 { 74 75 this->vVariableGroup = newVVariableGroup; 75 76 } 77 CATCH 76 78 77 79 CVariableGroup* CField::getVirtualVariableGroup(void) const 80 TRY 78 81 { 79 82 return this->vVariableGroup; 80 83 } 84 CATCH 81 85 82 86 std::vector<CVariable*> CField::getAllVariables(void) const 87 TRY 83 88 { 84 89 return this->vVariableGroup->getAllChildren(); 85 90 } 91 CATCH 86 92 87 93 void CField::solveDescInheritance(bool apply, const CAttributeMap* const parent) 94 TRY 88 95 { 89 96 SuperClassAttribute::setAttributes(parent, apply); 90 97 this->getVirtualVariableGroup()->solveDescInheritance(apply, NULL); 91 98 } 99 CATCH_DUMP_ATTR 92 100 93 101 //---------------------------------------------------------------- 94 102 95 103 bool CField::dispatchEvent(CEventServer& event) 104 TRY 96 105 { 97 106 if (SuperClass::dispatchEvent(event)) return true; … … 131 140 } 132 141 } 142 CATCH 133 143 134 144 void CField::sendUpdateData(const CArray<double,1>& data) 145 TRY 135 146 { 136 147 CTimer::get("Field : send data").resume(); … … 189 200 CTimer::get("Field : send data").suspend(); 190 201 } 202 CATCH_DUMP_ATTR 191 203 192 204 void CField::recvUpdateData(CEventServer& event) 205 TRY 193 206 { 194 207 std::map<int,CBufferIn*> rankBuffers; … … 207 220 CTimer::get("Field : recv data").suspend(); 208 221 } 222 CATCH 209 223 210 224 void CField::recvUpdateData(std::map<int,CBufferIn*>& rankBuffers) 225 TRY 211 226 { 212 227 CContext* context = CContext::getCurrent(); … … 249 264 recvDataSrv.reset() ; 250 265 } 266 CATCH_DUMP_ATTR 251 267 252 268 void CField::writeUpdateData(const CArray<double,1>& data) 269 TRY 253 270 { 254 271 CContext* context = CContext::getCurrent(); … … 277 294 } 278 295 } 296 CATCH_DUMP_ATTR 279 297 280 298 void CField::writeField(void) 299 TRY 281 300 { 282 301 if (!getRelFile()->isEmptyZone()) … … 290 309 } 291 310 } 311 CATCH_DUMP_ATTR 292 312 293 313 /* … … 299 319 */ 300 320 bool CField::sendReadDataRequest(const CDate& tsDataRequested) 321 TRY 301 322 { 302 323 CContext* context = CContext::getCurrent(); … … 330 351 return !isEOF; 331 352 } 353 CATCH_DUMP_ATTR 332 354 333 355 /*! … … 336 358 */ 337 359 bool CField::sendReadDataRequestIfNeeded(void) 360 TRY 338 361 { 339 362 const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate(); … … 353 376 return dataRequested; 354 377 } 378 CATCH_DUMP_ATTR 355 379 356 380 void CField::recvReadDataRequest(CEventServer& event) 381 TRY 357 382 { 358 383 CBufferIn* buffer = event.subEvents.begin()->buffer; … … 361 386 get(fieldId)->recvReadDataRequest(); 362 387 } 388 CATCH 363 389 364 390 /*! … … 369 395 */ 370 396 void CField::recvReadDataRequest(void) 397 TRY 371 398 { 372 399 CContext* context = CContext::getCurrent(); … … 449 476 } 450 477 } 478 CATCH_DUMP_ATTR 451 479 452 480 /*! … … 456 484 */ 457 485 CField::EReadField CField::readField(void) 486 TRY 458 487 { 459 488 CContext* context = CContext::getCurrent(); … … 508 537 return readState; 509 538 } 539 CATCH_DUMP_ATTR 510 540 511 541 /* … … 516 546 */ 517 547 void CField::recvReadDataReady(CEventServer& event) 548 TRY 518 549 { 519 550 string fieldId; … … 531 562 get(fieldId)->recvReadDataReady(ranks, buffers); 532 563 } 564 CATCH 533 565 534 566 /*! … … 538 570 */ 539 571 void CField::recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers) 572 TRY 540 573 { 541 574 CContext* context = CContext::getCurrent(); … … 574 607 serverSourceFilter->streamDataFromServer(lastDataReceivedFromServer, data); 575 608 } 609 CATCH_DUMP_ATTR 576 610 577 611 void CField::checkForLateDataFromServer(void) 612 TRY 578 613 { 579 614 CContext* context = CContext::getCurrent(); … … 607 642 } 608 643 } 644 CATCH_DUMP_ATTR 609 645 610 646 void CField::checkIfMustAutoTrigger(void) 647 TRY 611 648 { 612 649 mustAutoTrigger = serverSourceFilter ? serverSourceFilter->mustAutoTrigger() : false; 613 650 } 651 CATCH_DUMP_ATTR 614 652 615 653 void CField::autoTriggerIfNeeded(void) 654 TRY 616 655 { 617 656 if (mustAutoTrigger) 618 657 serverSourceFilter->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()); 619 658 } 659 CATCH_DUMP_ATTR 620 660 621 661 //---------------------------------------------------------------- 622 662 623 663 void CField::setRelFile(CFile* _file) 664 TRY 624 665 { 625 666 this->file = _file; 626 667 hasOutputFile = true; 627 668 } 669 CATCH_DUMP_ATTR 628 670 629 671 //---------------------------------------------------------------- … … 636 678 637 679 CGrid* CField::getRelGrid(void) const 680 TRY 638 681 { 639 682 return this->grid; 640 683 } 684 CATCH 641 685 642 686 //---------------------------------------------------------------- 643 687 644 688 CFile* CField::getRelFile(void) const 689 TRY 645 690 { 646 691 return this->file; 647 692 } 693 CATCH 648 694 649 695 int CField::getNStep(void) const 696 TRY 650 697 { 651 698 return this->nstep; 652 699 } 700 CATCH 653 701 654 702 func::CFunctor::ETimeType CField::getOperationTimeType() const 703 TRY 655 704 { 656 705 return operationTimeType; 657 706 } 707 CATCH 658 708 659 709 //---------------------------------------------------------------- 660 710 661 711 void CField::incrementNStep(void) 712 TRY 662 713 { 663 714 this->nstep++; 664 715 } 716 CATCH_DUMP_ATTR 665 717 666 718 void CField::resetNStep(int nstep /*= 0*/) 719 TRY 667 720 { 668 721 this->nstep = nstep; 669 722 } 723 CATCH_DUMP_ATTR 670 724 671 725 void CField::resetNStepMax(void) 726 TRY 672 727 { 673 728 this->nstepMax = 0; 674 729 nstepMaxRead = false; 675 730 } 731 CATCH_DUMP_ATTR 676 732 677 733 //---------------------------------------------------------------- 678 734 679 735 bool CField::isActive(bool atCurrentTimestep /*= false*/) const 736 TRY 680 737 { 681 738 if (clientSourceFilter) … … 689 746 return false; 690 747 } 748 CATCH 691 749 692 750 //---------------------------------------------------------------- 693 751 694 752 bool CField::wasWritten() const 753 TRY 695 754 { 696 755 return written; 697 756 } 757 CATCH 698 758 699 759 void CField::setWritten() 760 TRY 700 761 { 701 762 written = true; 702 763 } 764 CATCH_DUMP_ATTR 703 765 704 766 //---------------------------------------------------------------- 705 767 706 768 bool CField::getUseCompressedOutput() const 769 TRY 707 770 {