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