escript  Revision_Unversioneddirectory
error.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2010-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 
18 /************************************************************************************/
19 
20 /* Functions for C error handling (and timing)*/
21 
22 /************************************************************************************/
23 
24 
25 #ifndef INC_ESYS_ERROR
26 #define INC_ESYS_ERROR
27 
28 #include "system_dep.h"
29 #include "types.h"
30 
31 #ifdef _OPENMP
32 #include <omp.h>
33 #endif
34 
35 #include <stdio.h> /* For FILENAME_MAX */
36 #define LenString_MAX FILENAME_MAX*2
37 #define LenErrorMsg_MAX LenString_MAX
38 
39 /************************************************************************************/
40 
41 typedef enum {
59 
60 /* interfaces */
61 
62 
64 double Esys_timer(void);
65 
67 bool Esys_checkPtr(void*);
68 
70 void Esys_resetError(void);
71 
73 void Esys_setError(Esys_ErrorCodeType err,__const char* msg);
74 
76 bool Esys_noError(void);
77 
80 
82 char* Esys_getErrorMessage(void);
83 
84 #ifndef _OPENMP
85 int serial_get_max_threads(void);
86 int serial_get_thread_num(void);
87 
88 /* Nasty hack to get 3.2 out */
89 #define omp_get_max_threads serial_get_max_threads
90 #define omp_get_thread_num serial_get_thread_num
91 #endif
92 
93 
94 #endif /* #ifndef INC_ESYS_ERROR */
Definition: error.h:54
Definition: error.h:57
Definition: error.h:48
char * Esys_getErrorMessage(void)
Definition: error.cpp:90
Definition: error.h:49
Definition: error.h:53
Definition: error.h:52
Definition: error.h:42
Definition: error.h:50
Definition: error.h:44
#define ESYSUTILS_DLL_API
Definition: esysUtils/src/system_dep.h:31
bool Esys_noError(void)
Definition: error.cpp:49
Definition: error.h:51
Definition: error.h:56
void Esys_setError(Esys_ErrorCodeType err, __const char *msg)
Definition: error.cpp:38
int serial_get_max_threads(void)
Definition: Esys_MPI.cpp:380
Definition: error.h:43
Esys_ErrorCodeType Esys_getErrorType(void)
Definition: error.cpp:85
Esys_ErrorCodeType
Definition: error.h:41
Definition: error.h:55
bool Esys_checkPtr(void *)
Definition: error.cpp:57
Definition: error.h:45
Definition: error.h:47
void Esys_resetError(void)
Definition: error.cpp:33
double Esys_timer(void)
Definition: error.cpp:67
int serial_get_thread_num(void)
Definition: Esys_MPI.cpp:383
Definition: error.h:46