1 |
< |
#ifndef __FORTRAN90 |
2 |
< |
#ifndef __SIMERROR_H__ |
3 |
< |
#define __SIMERROR_H__ |
1 |
> |
#ifndef UTILS_SIMERROR_H |
2 |
> |
#define UTILS_SIMERROR_H |
3 |
|
|
4 |
|
#define MAX_SIM_ERROR_MSG_LENGTH 2000 |
5 |
|
|
6 |
< |
#define OOPSE_ERROR 1 |
7 |
< |
#define OOPSE_WARNING 2 |
8 |
< |
#define OOPSE_INFO 3 |
6 |
> |
#define OPENMD_ERROR 1 |
7 |
> |
#define OPENMD_WARNING 2 |
8 |
> |
#define OPENMD_INFO 3 |
9 |
|
|
10 |
|
typedef struct{ |
11 |
|
char errMsg[MAX_SIM_ERROR_MSG_LENGTH]; |
12 |
|
int isFatal; |
13 |
|
int severity; |
15 |
– |
#ifdef IS_MPI |
14 |
|
int isEventLoop; |
17 |
– |
#endif // IS_MPI |
15 |
|
} errorStruct; |
16 |
|
|
17 |
|
extern errorStruct painCave; |
18 |
|
|
22 |
– |
#ifdef IS_MPI |
23 |
– |
|
19 |
|
extern char checkPointMsg[MAX_SIM_ERROR_MSG_LENGTH]; |
20 |
|
|
21 |
|
extern int worldRank; |
27 |
– |
#endif |
22 |
|
|
23 |
|
#ifdef __cplusplus |
24 |
|
extern "C" { |
25 |
< |
#endif // __cplusplus |
25 |
> |
#endif |
26 |
|
|
27 |
< |
int simError( void ); // returns 1 if handled. 0 otherwise. |
27 |
> |
int simError( void ); |
28 |
|
|
29 |
< |
void initSimError( void ); // needed to be called from main before anything |
36 |
< |
// goes wrong. |
29 |
> |
void initSimError( void ); |
30 |
|
|
31 |
< |
#ifdef IS_MPI |
32 |
< |
|
40 |
< |
void MPIcheckPoint( void ); |
41 |
< |
|
42 |
< |
#endif // IS_MPI |
43 |
< |
|
31 |
> |
void errorCheckPoint( void ); |
32 |
> |
|
33 |
|
#ifdef __cplusplus |
34 |
|
} |
35 |
< |
#endif //__cplusplus |
35 |
> |
#endif |
36 |
|
|
37 |
< |
#endif // __SIMERROR_H__ |
49 |
< |
|
50 |
< |
#else // __FORTRAN90 |
51 |
< |
|
52 |
< |
INTEGER, PARAMETER:: OOPSE_ERROR = 1 |
53 |
< |
INTEGER, PARAMETER:: OOPSE_WARNING = 2 |
54 |
< |
INTEGER, PARAMETER:: OOPSE_INFO = 3 |
55 |
< |
INTEGER, PARAMETER:: MAX_SIM_ERROR_MSG_LENGTH = 2000 |
56 |
< |
|
57 |
< |
type, public :: errorStruct |
58 |
< |
PRIVATE |
59 |
< |
SEQUENCE |
60 |
< |
character(len = MAX_SIM_ERROR_MSG_LENGTH) :: errMsg |
61 |
< |
logical :: isFatal |
62 |
< |
integer :: severity |
63 |
< |
#ifdef IS_MPI |
64 |
< |
logical :: isEventLoop; |
65 |
< |
#endif // IS_MPI |
66 |
< |
end type errorStruct |
67 |
< |
|
68 |
< |
type (errorStruct), public, save :: painCave |
69 |
< |
|
70 |
< |
#endif // __FORTRAN90 |
37 |
> |
#endif |