38 #ifndef MAT_MATINCLUDE
39 #define MAT_MATINCLUDE
64 #define MAT_OMP_INIT enum omp_failType {noFail = 0, standardFail, runtimeFail, matFail}; \
65 volatile omp_failType omp_fail = noFail; \
66 std::exception omp_exce; \
67 std::runtime_error omp_runtime(""); \
68 Failure omp_matFail; \
71 #define MAT_OMP_START try {
72 #define MAT_OMP_END } \
73 catch(Failure & omp_fail_caught) { \
74 omp_fail = matFail; omp_matFail = omp_fail_caught; } \
75 catch(std::runtime_error & omp_runtime_caught) { \
76 omp_fail = runtimeFail; omp_runtime = omp_runtime_caught; } \
77 catch(std::exception & omp_exce_caught) { \
78 omp_fail = standardFail; omp_exce = omp_exce_caught; \
80 #define MAT_OMP_FINALIZE if(omp_fail) \
81 { std::cerr<<"Exception was thrown in OpenMP parallel region\n"; \
83 case standardFail: throw omp_exce; break; \
84 case runtimeFail: throw omp_runtime; break; \
85 case matFail: throw omp_matFail; break; \
86 default: throw Failure("Odd error in omp parallel loop\n");} \
92 #define MAT_OMP_FINALIZE
99 static unsigned int nProcs;
100 static unsigned int matrixParallelLevel;
106 throw Failure(
"mat::Params::getNProcs(): nProcs == 0 Forgot to call setNProcs()?");
115 #ifdef USE_SSE_INTRINSICS
116 Memory_buffer_thread::instance().init_buffers(nProcs);
122 if (matrixParallelLevel == 0)
123 throw Failure(
"mat::Params::getMatrixParallelLevel(): matrixParallelLevel == 0 Forgot to call setMatrixParallelLevel()?");
124 return matrixParallelLevel;
131 matrixParallelLevel = mPL;
146 template<
typename Treal>
148 return template_blas_get_machine_epsilon<Treal>();
151 template<
typename Treal>
153 return getMachineEpsilon<Treal>();
Classes describing debug policies with different debug levels.
The Failure class is used for exception handling.
Code for managing aligned memory buffers, used if SSE intrinsics enabled.
Class used to keep track of the block sizes used at different levels in the hierarchical matrix data ...
Definition: matInclude.h:165
static void getMemUsage(Values &values)
Definition: matInclude.cc:134
static int getNumberFromBuffer(const char *buffer, const char *s)
Definition: matInclude.cc:96
Definition: matInclude.h:96
static void setMatrixParallelLevel(unsigned int const mPL)
Definition: matInclude.h:129
static unsigned int getMatrixParallelLevel()
Definition: matInclude.h:120
static unsigned int getNProcs()
Definition: matInclude.h:103
static void setNProcs(unsigned int const nP)
Definition: matInclude.h:112
Definition: matInclude.h:156
static double get_wall_seconds()
Definition: matInclude.cc:74
void tic()
Definition: matInclude.cc:84
float toc()
Definition: matInclude.cc:88
double ticTime
Definition: matInclude.h:158
Time()
Definition: matInclude.cc:82
Definition: allocate.cc:39
std::string getNormTypeString(normType nType)
Definition: matInclude.cc:62
normType
Definition: matInclude.h:139
@ euclNorm
Definition: matInclude.h:139
@ frobNorm
Definition: matInclude.h:139
@ mixedNorm
Definition: matInclude.h:139
static Treal getMachineEpsilon()
Definition: matInclude.h:147
@ zero
Definition: matInclude.h:138
@ ful
Definition: matInclude.h:138
normType getNormType(const char *normStr)
Definition: matInclude.cc:52
static Treal getRelPrecision()
Definition: matInclude.h:152
Definition: matInclude.h:169
float peak
Definition: matInclude.h:172
Values()
Definition: matInclude.h:173
float res
Definition: matInclude.h:170
float virt
Definition: matInclude.h:171