ESYS13
Revision_
|
00001 00002 /******************************************************* 00003 * 00004 * Copyright (c) 2010-2012 by University of Queensland 00005 * Earth Systems Science Computational Center (ESSCC) 00006 * http://www.uq.edu.au/esscc 00007 * 00008 * Primary Business: Queensland, Australia 00009 * Licensed under the Open Software License version 3.0 00010 * http://www.opensource.org/licenses/osl-3.0.php 00011 * 00012 *******************************************************/ 00013 00014 00015 /**************************************************************/ 00016 00017 /* Functions for C error handling (and timing)*/ 00018 00019 /**************************************************************/ 00020 00021 00022 #ifndef INC_ESYS_ERROR 00023 #define INC_ESYS_ERROR 00024 00025 #include "system_dep.h" 00026 #include "types.h" 00027 00028 #ifdef _OPENMP 00029 #include <omp.h> 00030 #endif 00031 00032 #include <stdio.h> /* For FILENAME_MAX */ 00033 #define LenString_MAX FILENAME_MAX*2 00034 #define LenErrorMsg_MAX LenString_MAX 00035 00036 /**************************************************************/ 00037 00038 typedef enum { 00039 NO_ERROR, 00040 WARNING, 00041 DIVERGED, 00042 VALUE_ERROR, 00043 TYPE_ERROR, 00044 MEMORY_ERROR, 00045 IO_ERROR, 00046 ZERO_DIVISION_ERROR, 00047 EOF_ERROR, 00048 FLOATING_POINT_ERROR, 00049 INDEX_ERROR, 00050 OS_ERROR, 00051 OVERFLOW_ERROR, 00052 SYSTEM_ERROR, 00053 ESYS_MPI_ERROR, 00054 NO_PROGRESS_ERROR 00055 } Esys_ErrorCodeType; 00056 00057 /* interfaces */ 00058 00059 00060 ESYSUTILS_DLL_API 00061 double Esys_timer(void); 00062 00063 ESYSUTILS_DLL_API 00064 bool_t Esys_checkPtr(void*); 00065 00066 ESYSUTILS_DLL_API 00067 void Esys_resetError(void); 00068 00069 ESYSUTILS_DLL_API 00070 void Esys_setError(Esys_ErrorCodeType err,__const char* msg); 00071 00072 ESYSUTILS_DLL_API 00073 bool_t Esys_noError(void); 00074 00075 ESYSUTILS_DLL_API 00076 Esys_ErrorCodeType Esys_getErrorType(void); 00077 00078 ESYSUTILS_DLL_API 00079 char* Esys_getErrorMessage(void); 00080 00081 #ifndef _OPENMP 00082 int serial_get_max_threads(void); 00083 int serial_get_thread_num(void); 00084 00085 /* Nasty hack to get 3.2 out */ 00086 #define omp_get_max_threads serial_get_max_threads 00087 #define omp_get_thread_num serial_get_thread_num 00088 #endif 00089 00090 00091 #endif /* #ifndef INC_PASO */