source:
issm/oecreview/Archive/14312-15392/ISSM-14913-14914.diff
Last change on this file was 15393, checked in by , 12 years ago | |
---|---|
File size: 15.4 KB |
-
../trunk-jpl/src/c/include/macros.h
1 /* \file macros.h2 * \brief: global macros used in the whole code3 */4 5 /*Header {{{*/6 #ifndef _MACROS_H_7 #define _MACROS_H_8 9 #include <iostream>10 #include <sstream>11 #include <iomanip>12 #include "./typedefs.h"13 14 #ifdef HAVE_CONFIG_H15 #include <config.h>16 #else17 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"18 #endif19 /*}}}*/20 21 /*Exceptions: */22 /* _assert_ {{{*/23 /*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/24 #ifdef _ISSM_DEBUG_25 #define _assert_(statement)\26 if (!(statement)) _error_("Assertion \""<<#statement<<"\" failed, please report bug to "<<PACKAGE_BUGREPORT)27 #else28 #define _assert_(ignore)\29 ((void) 0)30 #endif31 /*}}}*/32 /* _error_ {{{*/33 /*new Error exception macro*/34 #ifdef _INTEL_WIN_35 #define _error_(StreamArgs)\36 do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \37 aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \38 throw ErrorException(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)39 #else40 #define _error_(StreamArgs)\41 do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \42 aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \43 throw ErrorException(__FILE__,__func__,__LINE__,aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)44 #endif45 /*}}}*/46 /* ExceptionTrapBegin/ExceptionTrapEnd {{{*/47 48 /*The following macros hide the error exception handling in a matlab module. Just put49 * ExceptionTrapBegin(); and ExceptionTrapEnd(); at the beginning and end of a module, and c++ exceptions50 * will be trapped. Really nifty!*/51 52 #define ExceptionTrapBegin(); \53 try{54 55 #define ExceptionTrapEnd(); }\56 catch(ErrorException &exception){\57 exception.Report();\58 return 0;\59 }\60 catch (exception& e) {\61 _printf_(true,"Standard exception: %s\n",e.what());\62 return 0;\63 }\64 catch(...){\65 _printf_(true,"An unexpected error occurred");\66 return 0;\67 }68 /*}}}*/69 70 #endif -
../trunk-jpl/src/c/include/include.h
5 5 #ifndef _INCLUDEGLOBAL_H_ 6 6 #define _INCLUDEGLOBAL_H_ 7 7 8 #include "./macros.h"9 8 #include "./typedefs.h" 10 9 #include "./types.h" 11 10 -
../trunk-jpl/src/c/shared/Exceptions/exceptions.h
6 6 * own exceptions 7 7 */ 8 8 9 #ifndef MY_EXCEPTIONS_H_10 #define MY_EXCEPTIONS_H_9 #ifndef _MY_EXCEPTIONS_H_ 10 #define _MY_EXCEPTIONS_H_ 11 11 12 12 #include <exception> 13 13 #include <string> 14 #include <iostream> 15 #include <sstream> 16 #include <iomanip> 17 14 18 using namespace std; 15 19 16 /*We derive our classes from the c++ exception class: */ 17 class ErrorException: public exception { 20 #ifdef HAVE_CONFIG_H 21 #include <config.h> 22 #else 23 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 24 #endif 18 25 26 /*macros: */ 27 /* _assert_ {{{*/ 28 /*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/ 29 #ifdef _ISSM_DEBUG_ 30 #define _assert_(statement)\ 31 if (!(statement)) _error_("Assertion \""<<#statement<<"\" failed, please report bug to "<<PACKAGE_BUGREPORT) 32 #else 33 #define _assert_(ignore)\ 34 ((void) 0) 35 #endif 36 /*}}}*/ 37 /* _error_ {{{*/ 38 /*new Error exception macro*/ 39 #ifdef _INTEL_WIN_ 40 #define _error_(StreamArgs)\ 41 do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \ 42 aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \ 43 throw ErrorException(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0) 44 #else 45 #define _error_(StreamArgs)\ 46 do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \ 47 aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \ 48 throw ErrorException(__FILE__,__func__,__LINE__,aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0) 49 #endif 50 /*}}}*/ 51 /* ExceptionTrapBegin/ExceptionTrapEnd {{{*/ 52 53 /*The following macros hide the error exception handling in a matlab module. Just put 54 * ExceptionTrapBegin(); and ExceptionTrapEnd(); at the beginning and end of a module, and c++ exceptions 55 * will be trapped. Really nifty!*/ 56 57 #define ExceptionTrapBegin(); \ 58 try{ 59 60 #define ExceptionTrapEnd(); }\ 61 catch(ErrorException &exception){\ 62 exception.Report();\ 63 return 0;\ 64 }\ 65 catch (exception& e) {\ 66 _printf_(true,"Standard exception: %s\n",e.what());\ 67 return 0;\ 68 }\ 69 catch(...){\ 70 _printf_(true,"An unexpected error occurred");\ 71 return 0;\ 72 } 73 /*}}}*/ 74 75 /*ISSM exception class: */ 76 class ErrorException: public exception { /*{{{*/ 77 19 78 string what_str; 20 79 string function_name; 21 80 string file_name; … … 31 90 const char* PythonReport() const; 32 91 33 92 }; 93 /*}}}*/ 34 94 35 95 char* exprintf(const char* format,...); 96 36 97 #endif 98 99 -
../trunk-jpl/src/c/shared/Numerics/Synchronize.sh
26 26 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 27 27 #endif 28 28 #include "./Verbosity.h" 29 #include "../../include/macros.h"30 29 #include "../Exceptions/exceptions.h" 31 30 /*}}}*/ 32 31 -
../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp
15 15 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 16 16 #endif 17 17 #include "./Verbosity.h" 18 #include "../../include/macros.h"19 18 #include "../Exceptions/exceptions.h" 20 19 /*}}}*/ 21 20 -
../trunk-jpl/src/c/shared/Sorting/binary_search.cpp
8 8 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 9 9 #endif 10 10 11 #include "../../include/macros.h"12 11 #include "../Exceptions/exceptions.h" 13 12 #include <stdio.h> 14 13 -
../trunk-jpl/src/c/shared/Elements/PrintArrays.cpp
1 1 2 2 #include "./elements.h" 3 #include "../../include/macros.h"4 3 using namespace std; 5 4 6 5 void printarray(IssmPDouble* array,int lines,int cols){ -
../trunk-jpl/src/c/io/Comm/IssmComm.cpp
10 10 11 11 #include "./IssmComm.h" 12 12 #include "../../include/types.h" 13 #include "../../include/macros.h"14 13 #include "../../shared/Exceptions/exceptions.h" 15 14 16 15 void IssmComm::SetComm(COMM incomm){ /*{{{*/ -
../trunk-jpl/src/c/toolkits/mumps/MpiDenseMumpsSolve.cpp
10 10 #endif 11 11 12 12 #include "../../include/types.h" 13 #include "../../include/macros.h"14 13 #include "../../shared/MemOps/MemOps.h" 15 14 #include "../../shared/Exceptions/exceptions.h" 16 15 #include "../../io/Comm/Comm.h" -
../trunk-jpl/src/c/toolkits/issm/IssmVec.h
16 16 #include "../../EnumDefinitions/EnumDefinitions.h" 17 17 #include "../../shared/Exceptions/exceptions.h" 18 18 #include "../../shared/MemOps/MemOps.h" 19 #include "../../include/macros.h"20 19 #include "./IssmToolkitUtils.h" 21 20 #include <math.h> 22 21 /*}}}*/ -
../trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h
20 20 #include "../../shared/Exceptions/exceptions.h" 21 21 #include "../../shared/MemOps/MemOps.h" 22 22 #include "../../io/Print/Print.h" 23 #include "../../include/macros.h"24 23 #include "../../toolkits/gsl/gslincludes.h" 25 24 26 25 #include <math.h> -
../trunk-jpl/src/c/toolkits/issm/IssmMat.h
15 15 16 16 #include "../../shared/Exceptions/exceptions.h" 17 17 #include "../../shared/MemOps/MemOps.h" 18 #include "../../include/macros.h"19 18 #include "../../classes/ToolkitOptions.h" 20 19 #include "../../io/Comm/Comm.h" 21 20 #include "../../EnumDefinitions/EnumDefinitions.h" -
../trunk-jpl/src/c/toolkits/issm/IssmToolkitUtils.cpp
12 12 13 13 #include "../../shared/MemOps/MemOps.h" 14 14 #include "../../io/Comm/Comm.h" 15 #include "../../include/macros.h"16 15 #include "../../classes/ToolkitOptions.h" 17 16 #include "../../EnumDefinitions/EnumDefinitions.h" 18 17 #include "../../shared/Exceptions/exceptions.h" -
../trunk-jpl/src/c/toolkits/issm/IssmAbsVec.h
20 20 21 21 #include "../../shared/Exceptions/exceptions.h" 22 22 #include "../../shared/MemOps/MemOps.h" 23 #include "../../include/macros.h"24 23 #include <math.h> 25 24 26 25 /*}}}*/ -
../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h
19 19 20 20 #include "../../shared/Exceptions/exceptions.h" 21 21 #include "../../shared/MemOps/MemOps.h" 22 #include "../../include/macros.h"23 22 #include "../../io/io.h" 24 23 #ifdef _HAVE_MPI_ 25 24 #include "../mpi/mpiincludes.h" -
../trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h
19 19 20 20 #include "../../shared/Exceptions/exceptions.h" 21 21 #include "../../shared/MemOps/MemOps.h" 22 #include "../../include/macros.h"23 22 #include "../../Container/DataSet.h" 24 23 #include "../../io/Comm/Comm.h" 25 24 #include "../../classes/objects/Bucket.h" -
../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h
19 19 #include "../../shared/Exceptions/exceptions.h" 20 20 #include "../../io/Print/Print.h" 21 21 #include "../../shared/MemOps/MemOps.h" 22 #include "../../include/macros.h"23 22 #include <math.h> 24 23 25 24 /*}}}*/ -
../trunk-jpl/src/c/toolkits/issm/IssmAbsMat.h
20 20 21 21 #include "../../shared/Exceptions/exceptions.h" 22 22 #include "../../shared/MemOps/MemOps.h" 23 #include "../../include/macros.h"24 23 #include "./IssmAbsVec.h" 25 24 26 25 /*}}}*/ -
../trunk-jpl/src/c/Makefile.am
20 20 #Core sources{{{ 21 21 core_sources = ./issm.h\ 22 22 ./issm-binding.h\ 23 ./include/macros.h\24 23 ./include/typedefs.h\ 25 24 ./include/types.h\ 26 25 ./include/include.h\ -
../trunk-jpl/src/c/classes/DofIndexing.cpp
14 14 #include "../include/types.h" 15 15 #include "../include/typedefs.h" 16 16 #include "../io/Print/Print.h" 17 #include "../include/macros.h"18 17 #include "../shared/Exceptions/exceptions.h" 19 18 #include "../shared/MemOps/MemOps.h" 20 19 #include "../EnumDefinitions/EnumDefinitions.h" -
../trunk-jpl/src/c/classes/gauss/GaussTria.cpp
3 3 */ 4 4 5 5 #include "./GaussTria.h" 6 #include "../../include/macros.h"7 6 #include "../../io/Print/Print.h" 8 7 #include "../../shared/Exceptions/exceptions.h" 9 8 #include "../../shared/MemOps/MemOps.h" -
../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
4 4 5 5 #include "./GaussPenta.h" 6 6 #include "./GaussTria.h" 7 #include "../../include/macros.h"8 7 #include "../../io/Print/Print.h" 8 #include "../../include/typedefs.h" 9 9 #include "../../shared/Exceptions/exceptions.h" 10 10 #include "../../shared/MemOps/MemOps.h" 11 11 #include "../../shared/Numerics/GaussPoints.h" -
../trunk-jpl/src/c/classes/ToolkitOptions.cpp
11 11 #include <string.h> 12 12 #include "./ToolkitOptions.h" 13 13 #include "../include/types.h" 14 #include "../include/macros.h"15 14 #include "../shared/Exceptions/exceptions.h" 16 15 #include "../shared/MemOps/MemOps.h" 17 16 -
../trunk-jpl/src/c/classes/objects/Bucket.h
9 9 /*{{{*/ 10 10 #include "./Object.h" 11 11 #include "../../shared/MemOps/MemOps.h" 12 #include "../../include/macros.h"13 12 #include "../../Container/DataSet.h" 14 13 #include "../../toolkits/toolkitsenums.h" 15 14 /*}}}*/ -
../trunk-jpl/src/c/classes/bamg/include.h
5 5 #ifndef _INCLUDE2_H_ 6 6 #define _INCLUDE2_H_ 7 7 8 #include "../../include/macros.h"9 8 #include "./macros.h" 10 9 #include "./typedefs.h" 11 10
Note:
See TracBrowser
for help on using the repository browser.