36 #ifndef MAT_MATINCLUDE
37 #define MAT_MATINCLUDE
60 #define MAT_OMP_INIT enum omp_failType {noFail = 0, standardFail, runtimeFail, matFail}; \
61 volatile omp_failType omp_fail = noFail; \
62 std::exception omp_exce; \
63 std::runtime_error omp_runtime(""); \
64 Failure omp_matFail; \
67 #define MAT_OMP_START try {
68 #define MAT_OMP_END } \
69 catch(Failure & omp_fail_caught) { \
70 omp_fail = matFail; omp_matFail = omp_fail_caught; } \
71 catch(std::runtime_error & omp_runtime_caught) { \
72 omp_fail = runtimeFail; omp_runtime = omp_runtime_caught; } \
73 catch(std::exception & omp_exce_caught) { \
74 omp_fail = standardFail; omp_exce = omp_exce_caught; \
76 #define MAT_OMP_FINALIZE if(omp_fail) \
77 { std::cerr<<"Exception was thrown in OpenMP parallel region\n"; \
79 case standardFail: throw omp_exce; break; \
80 case runtimeFail: throw omp_runtime; break; \
81 case matFail: throw omp_matFail; break; \
82 default: throw Failure("Odd error in omp parallel loop\n");} \
88 #define MAT_OMP_FINALIZE
95 static unsigned int nProcs;
96 static unsigned int matrixParallelLevel;
102 throw Failure(
"mat::Params::getNProcs(): nProcs == 0 Forgot to call setNProcs()?");
111 #ifdef USE_SSE_INTRINSICS
112 Memory_buffer_thread::instance().init_buffers(nProcs);
118 if (matrixParallelLevel == 0)
119 throw Failure(
"mat::Params::getMatrixParallelLevel(): matrixParallelLevel == 0 Forgot to call setMatrixParallelLevel()?");
120 return matrixParallelLevel;
127 matrixParallelLevel = mPL;
140 template<
typename Treal>
142 throw Failure(
"getPrecision() : The used type is not supported by"
147 return std::numeric_limits<long double>::epsilon();
151 return std::numeric_limits<double>::epsilon();
155 return std::numeric_limits<float>::epsilon();
static Treal getRelPrecision()
Definition: matInclude.h:141
static void setMatrixParallelLevel(unsigned int const mPL)
Definition: matInclude.h:125
std::string getNormTypeString(normType nType)
Definition: matInclude.cc:55
static void setNProcs(unsigned int const nP)
Definition: matInclude.h:108
float peak
Definition: matInclude.h:174
Definition: matInclude.h:167
double ticTime
Definition: matInclude.h:160
void tic()
Definition: matInclude.cc:77
Values()
Definition: matInclude.h:175
Classes describing debug policies with different debug levels.
double getRelPrecision< double >()
Definition: matInclude.h:150
Definition: matInclude.h:92
Definition: matInclude.h:158
float toc()
Definition: matInclude.cc:81
Definition: matInclude.h:134
float res
Definition: matInclude.h:172
long double getRelPrecision< long double >()
Definition: matInclude.h:146
Definition: matInclude.h:135
float getRelPrecision< float >()
Definition: matInclude.h:154
float virt
Definition: matInclude.h:173
static void getMemUsage(Values &values)
Definition: matInclude.cc:127
Definition: matInclude.h:135
static unsigned int getMatrixParallelLevel()
Definition: matInclude.h:116
Definition: matInclude.h:134
static int getNumberFromBuffer(const char *buffer, const char *s)
Definition: matInclude.cc:89
static double get_wall_seconds()
Definition: matInclude.cc:67
static unsigned int getNProcs()
Definition: matInclude.h:99
Time()
Definition: matInclude.cc:75
Definition: matInclude.h:135
Definition: matInclude.h:171
normType getNormType(const char *normStr)
Definition: matInclude.cc:45
normType
Definition: matInclude.h:135