Types, functions and macros for error handling.
More...
#include <string.h>
#include "log.h"
#include "errorhandler.h"
Go to the source code of this file.
|
#define | ZOLTAN_OK 0 |
|
#define | GHOST_CALL_RETURN(call) |
| This macro should be used for calling a GHOST function inside a function which itself returns a ghost_error. It calls the function and in case of an error logs the error message and returns the according ghost_error which was return by the called function. More...
|
|
#define | GHOST_CALL_GOTO(call, label, __err) |
| This macro should be used for calling a GHOST function inside a function which itself returns a ghost_error but needs to do some clean up before returning.. It calls the function. In case of an error it logs the error message, sets the parameter __err to the occured ghost_error and jumps (goto) to the defined parameter label. More...
|
|
#define | GHOST_CALL(call, __err) |
| This macro should be used for calling a GHOST function inside another function. The parameter __err will be set to the error which occured in the call. This macro is probably not very useful by itself, cf. GHOST_CALL_GOTO and GHOST_CALL_RETURN instead. More...
|
|
#define | MPI_CALL_RETURN(call) |
|
#define | MPI_CALL_GOTO(call, label, __err) |
|
#define | MPI_CALL(call, __err) |
|
#define | HWLOC_CALL_RETURN(call) |
|
#define | HWLOC_CALL_GOTO(call, label, __err) |
|
#define | HWLOC_CALL(call, __err) |
|
#define | CUDA_CALL_RETURN(call) |
|
#define | CUDA_CALL_GOTO(call, label, __err) |
|
#define | CUDA_CALL(call, __err) |
|
#define | CUBLAS_CALL_RETURN(call) |
|
#define | CUBLAS_CALL_GOTO(call, label, __err) |
|
#define | CUBLAS_CALL(call, __err) |
|
#define | CURAND_CALL_RETURN(call) |
|
#define | CURAND_CALL_GOTO(call, label, __err) |
|
#define | CURAND_CALL(call, __err) |
|
#define | CUSPARSE_CALL_RETURN(call) |
|
#define | CUSPARSE_CALL_GOTO(call, label, __err) |
|
#define | CUSPARSE_CALL(call, __err) |
|
#define | SCOTCH_CALL_RETURN(call) |
|
#define | SCOTCH_CALL_GOTO(call, label, __err) |
|
#define | SCOTCH_CALL(call, __err) |
|
#define | COLPACK_CALL_RETURN(call) |
|
#define | COLPACK_CALL_GOTO(call, label, __err) |
|
#define | COLPACK_CALL(call, __err) |
|
#define | ZOLTAN_CALL_RETURN(call) |
|
#define | ZOLTAN_CALL_GOTO(call, label, __err) |
|
#define | ZOLTAN_CALL(call, __err) |
|
#define | BLAS_CALL_RETURN(call) |
|
#define | BLAS_CALL_GOTO(call, label, __err) |
|
#define | BLAS_CALL(call, __err) |
|
|
enum | ghost_error {
GHOST_SUCCESS,
GHOST_ERR_INVALID_ARG,
GHOST_ERR_MPI,
GHOST_ERR_CUDA,
GHOST_ERR_CUBLAS,
GHOST_ERR_CUSPARSE,
GHOST_ERR_CURAND,
GHOST_ERR_HWLOC,
GHOST_ERR_SCOTCH,
GHOST_ERR_ZOLTAN,
GHOST_ERR_UNKNOWN,
GHOST_ERR_NOT_IMPLEMENTED,
GHOST_ERR_IO,
GHOST_ERR_DATATYPE,
GHOST_ERR_COLPACK,
GHOST_ERR_BLOCKCOLOR,
GHOST_ERR_NOT_COLORED,
GHOST_ERR_RED_BLACK,
GHOST_ERR_LAPACK,
GHOST_ERR_BLAS,
GHOST_ERR_COMPATIBILITY
} |
| Error return type. More...
|
|
Types, functions and macros for error handling.
- Author
- Moritz Kreutzer morit.nosp@m.z.kr.nosp@m.eutze.nosp@m.r@fa.nosp@m.u.de
#define BLAS_CALL |
( |
|
call, |
|
|
|
__err |
|
) |
| |
Value:{\
call;\
if (h) {\
h((void *)&err);\
}\
} else {\
}\
}\
#define GHOST_ERROR_LOG(...)
Definition: log.h:125
No error occured.
Definition: error.h:27
An error in a BLAS call occured.
Definition: error.h:103
int ghost_blas_err_pop()
Definition: blas_util.c:26
void *(* ghost_errorhandler)(void *error)
Definition: errorhandler.h:11
ghost_errorhandler ghost_errorhandler_get(ghost_error e)
Get the handler of a given GHOST error.
Definition: errorhandler.cpp:9
#define BLAS_CALL_GOTO |
( |
|
call, |
|
|
|
label, |
|
|
|
__err |
|
) |
| |
Value:
goto label;\
}\
}\
#define BLAS_CALL(call, __err)
Definition: error.h:472
No error occured.
Definition: error.h:27
#define BLAS_CALL_RETURN |
( |
|
call | ) |
|
Value:
return macroerr;\
}\
}\
#define BLAS_CALL(call, __err)
Definition: error.h:472
No error occured.
Definition: error.h:27
ghost_error
Error return type.
Definition: error.h:23
#define COLPACK_CALL |
( |
|
call, |
|
|
|
__err |
|
) |
| |
Value:{\
int err = call;\
if (h) {\
h((void *)&err);\
}\
} else {\
}\
}\
#define GHOST_ERROR_LOG(...)
Definition: log.h:125
No error occured.
Definition: error.h:27
An error in a ColPack call occured.
Definition: error.h:83
void *(* ghost_errorhandler)(void *error)
Definition: errorhandler.h:11
ghost_errorhandler ghost_errorhandler_get(ghost_error e)
Get the handler of a given GHOST error.
Definition: errorhandler.cpp:9
#define COLPACK_CALL_GOTO |
( |
|
call, |
|
|
|
label, |
|
|
|
__err |
|
) |
| |
Value:
goto label;\
}\
}\
No error occured.
Definition: error.h:27
#define COLPACK_CALL(call, __err)
Definition: error.h:414
#define COLPACK_CALL_RETURN |
( |
|
call | ) |
|
Value:
return macroerr;\
}\
}\
No error occured.
Definition: error.h:27
#define COLPACK_CALL(call, __err)
Definition: error.h:414
ghost_error
Error return type.
Definition: error.h:23
#define CUBLAS_CALL |
( |
|
call, |
|
|
|
__err |
|
) |
| |
#define CUBLAS_CALL_GOTO |
( |
|
call, |
|
|
|
label, |
|
|
|
__err |
|
) |
| |
Value:
goto label;\
}\
}\
No error occured.
Definition: error.h:27
#define CUBLAS_CALL(call, __err)
Definition: error.h:267
#define CUBLAS_CALL_RETURN |
( |
|
call | ) |
|
Value:
return macroerr;\
}\
}\
No error occured.
Definition: error.h:27
ghost_error
Error return type.
Definition: error.h:23
#define CUBLAS_CALL(call, __err)
Definition: error.h:267
#define CUDA_CALL |
( |
|
call, |
|
|
|
__err |
|
) |
| |
Value:{\
cudaError_t __cuerr = call;\
if (__cuerr != cudaSuccess) {
\
GHOST_ERROR_LOG(
"CUDA Error: %s (%d)",cudaGetErrorString(__cuerr),(
int)__cuerr);
\
if (h) {\
h((void *)&__cuerr);\
}\
} else {\
}\
}\
#define GHOST_ERROR_LOG(...)
Definition: log.h:125
No error occured.
Definition: error.h:27
void *(* ghost_errorhandler)(void *error)
Definition: errorhandler.h:11
An error in a CUDA call occured.
Definition: error.h:39
ghost_errorhandler ghost_errorhandler_get(ghost_error e)
Get the handler of a given GHOST error.
Definition: errorhandler.cpp:9
#define CUDA_CALL_GOTO |
( |
|
call, |
|
|
|
label, |
|
|
|
__err |
|
) |
| |
Value:
goto label;\
}\
}\
#define CUDA_CALL(call, __err)
Definition: error.h:238
No error occured.
Definition: error.h:27
#define CUDA_CALL_RETURN |
( |
|
call | ) |
|
Value:
return macroerr;\
}\
}\
#define CUDA_CALL(call, __err)
Definition: error.h:238
No error occured.
Definition: error.h:27
ghost_error
Error return type.
Definition: error.h:23
#define CURAND_CALL |
( |
|
call, |
|
|
|
__err |
|
) |
| |
Value:{\
curandStatus_t err = call;\
if (err != CURAND_STATUS_SUCCESS) {
\
if (h) {\
h((void *)&err);\
}\
} else {\
}\
}\
#define GHOST_ERROR_LOG(...)
Definition: log.h:125
No error occured.
Definition: error.h:27
An error in a CURAND call occured.
Definition: error.h:51
void *(* ghost_errorhandler)(void *error)
Definition: errorhandler.h:11
ghost_errorhandler ghost_errorhandler_get(ghost_error e)
Get the handler of a given GHOST error.
Definition: errorhandler.cpp:9
#define CURAND_CALL_GOTO |
( |
|
call, |
|
|
|
label, |
|
|
|
__err |
|
) |
| |
Value:
goto label;\
}\
}\
#define CURAND_CALL(call, __err)
Definition: error.h:327
No error occured.
Definition: error.h:27
#define CURAND_CALL_RETURN |
( |
|
call | ) |
|
Value:
return macroerr;\
}\
}\
#define CURAND_CALL(call, __err)
Definition: error.h:327
No error occured.
Definition: error.h:27
ghost_error
Error return type.
Definition: error.h:23
#define CUSPARSE_CALL |
( |
|
call, |
|
|
|
__err |
|
) |
| |
Value:{\
cusparseStatus_t err = call;\
if (err != CUSPARSE_STATUS_SUCCESS) {
\
if (h) {\
h((void *)&err);\
}\
} else {\
}\
}\
#define GHOST_ERROR_LOG(...)
Definition: log.h:125
No error occured.
Definition: error.h:27
An error in a CUSPARSE call occured.
Definition: error.h:47
void *(* ghost_errorhandler)(void *error)
Definition: errorhandler.h:11
ghost_errorhandler ghost_errorhandler_get(ghost_error e)
Get the handler of a given GHOST error.
Definition: errorhandler.cpp:9
#define CUSPARSE_CALL_GOTO |
( |
|
call, |
|
|
|
label, |
|
|
|
__err |
|
) |
| |
Value:
goto label;\
}\
}\
No error occured.
Definition: error.h:27
#define CUSPARSE_CALL(call, __err)
Definition: error.h:356
#define CUSPARSE_CALL_RETURN |
( |
|
call | ) |
|
Value:
return macroerr;\
}\
}\
No error occured.
Definition: error.h:27
ghost_error
Error return type.
Definition: error.h:23
#define CUSPARSE_CALL(call, __err)
Definition: error.h:356
#define GHOST_CALL |
( |
|
call, |
|
|
|
__err |
|
) |
| |
Value:{\
__err = call;\
}\
}\
No error occured.
Definition: error.h:27
#define GHOST_ANSI_COLOR_RED
Definition: log.h:27
#define GHOST_LOG(type, color,...)
Definition: log.h:105
ghost_error
Error return type.
Definition: error.h:23
char * ghost_error_string(ghost_error e)
Get a string of the GHOST error.
Definition: error.c:4
This macro should be used for calling a GHOST function inside another function. The parameter __err will be set to the error which occured in the call. This macro is probably not very useful by itself, cf. GHOST_CALL_GOTO and GHOST_CALL_RETURN instead.
- Parameters
-
call | The function call. |
__err | A defined ghost_error variable which will be set to the error returned by the calling function. |
#define GHOST_CALL_GOTO |
( |
|
call, |
|
|
|
label, |
|
|
|
__err |
|
) |
| |
Value:
goto label;\
}\
}\
No error occured.
Definition: error.h:27
#define GHOST_CALL(call, __err)
This macro should be used for calling a GHOST function inside another function. The parameter __err w...
Definition: error.h:155
This macro should be used for calling a GHOST function inside a function which itself returns a ghost_error but needs to do some clean up before returning.. It calls the function. In case of an error it logs the error message, sets the parameter __err to the occured ghost_error and jumps (goto) to the defined parameter label.
- Parameters
-
call | The function call. |
label | The jump label where clean up is performed. |
__err | A defined ghost_error variable which will be set to the error returned by the calling function. |
#define GHOST_CALL_RETURN |
( |
|
call | ) |
|
Value:
return macroerr;\
}\
}\
No error occured.
Definition: error.h:27
#define GHOST_CALL(call, __err)
This macro should be used for calling a GHOST function inside another function. The parameter __err w...
Definition: error.h:155
ghost_error
Error return type.
Definition: error.h:23
This macro should be used for calling a GHOST function inside a function which itself returns a ghost_error. It calls the function and in case of an error logs the error message and returns the according ghost_error which was return by the called function.
- Parameters
-
call | The complete function call. |
- Returns
- A ghost_error in case the function return an error.
#define HWLOC_CALL |
( |
|
call, |
|
|
|
__err |
|
) |
| |
Value:{\
int __hwlocerr = call;\
if (h) {\
h((void *)&__hwlocerr);\
}\
} else {\
}\
}\
#define GHOST_ERROR_LOG(...)
Definition: log.h:125
No error occured.
Definition: error.h:27
An error in a Hwloc call occured.
Definition: error.h:55
void *(* ghost_errorhandler)(void *error)
Definition: errorhandler.h:11
ghost_errorhandler ghost_errorhandler_get(ghost_error e)
Get the handler of a given GHOST error.
Definition: errorhandler.cpp:9
#define HWLOC_CALL_GOTO |
( |
|
call, |
|
|
|
label, |
|
|
|
__err |
|
) |
| |
Value:
goto label;\
}\
}\
No error occured.
Definition: error.h:27
#define HWLOC_CALL(call, __err)
Definition: error.h:209
#define HWLOC_CALL_RETURN |
( |
|
call | ) |
|
Value:
return macroerr;\
}\
}\
No error occured.
Definition: error.h:27
ghost_error
Error return type.
Definition: error.h:23
#define HWLOC_CALL(call, __err)
Definition: error.h:209
#define MPI_CALL |
( |
|
call, |
|
|
|
__err |
|
) |
| |
Value:{\
int mpicallmacroerr = call;\
if (mpicallmacroerr != MPI_SUCCESS) {\
char errstr[MPI_MAX_ERROR_STRING];\
int strlen;\
MPI_Error_string(mpicallmacroerr,errstr,&strlen);
\
if (h) {\
h((void *)&mpicallmacroerr);\
}\
} else {\
}\
}\
#define GHOST_ERROR_LOG(...)
Definition: log.h:125
No error occured.
Definition: error.h:27
An error in an MPI call occured.
Definition: error.h:35
void *(* ghost_errorhandler)(void *error)
Definition: errorhandler.h:11
ghost_errorhandler ghost_errorhandler_get(ghost_error e)
Get the handler of a given GHOST error.
Definition: errorhandler.cpp:9
#define MPI_CALL_GOTO |
( |
|
call, |
|
|
|
label, |
|
|
|
__err |
|
) |
| |
Value:
goto label;\
}\
}\
No error occured.
Definition: error.h:27
#define MPI_CALL(call, __err)
Definition: error.h:177
#define MPI_CALL_RETURN |
( |
|
call | ) |
|
Value:
return macroerr;\
}\
}\
No error occured.
Definition: error.h:27
#define MPI_CALL(call, __err)
Definition: error.h:177
ghost_error
Error return type.
Definition: error.h:23
#define SCOTCH_CALL |
( |
|
call, |
|
|
|
__err |
|
) |
| |
Value:{\
int err = call;\
if (h) {\
h((void *)&err);\
}\
} else {\
}\
}\
#define GHOST_ERROR_LOG(...)
Definition: log.h:125
No error occured.
Definition: error.h:27
void *(* ghost_errorhandler)(void *error)
Definition: errorhandler.h:11
ghost_errorhandler ghost_errorhandler_get(ghost_error e)
Get the handler of a given GHOST error.
Definition: errorhandler.cpp:9
An error in a SCOTCH call occured.
Definition: error.h:59
#define SCOTCH_CALL_GOTO |
( |
|
call, |
|
|
|
label, |
|
|
|
__err |
|
) |
| |
Value:
goto label;\
}\
}\
No error occured.
Definition: error.h:27
#define SCOTCH_CALL(call, __err)
Definition: error.h:385
#define SCOTCH_CALL_RETURN |
( |
|
call | ) |
|
Value:
return macroerr;\
}\
}\
No error occured.
Definition: error.h:27
ghost_error
Error return type.
Definition: error.h:23
#define SCOTCH_CALL(call, __err)
Definition: error.h:385
#define ZOLTAN_CALL |
( |
|
call, |
|
|
|
__err |
|
) |
| |
Value:{\
int err = call;\
if (h) {\
h((void *)&err);\
}\
} else {\
}\
}\
#define GHOST_ERROR_LOG(...)
Definition: log.h:125
No error occured.
Definition: error.h:27
An error in a Zoltan call occured.
Definition: error.h:63
void *(* ghost_errorhandler)(void *error)
Definition: errorhandler.h:11
ghost_errorhandler ghost_errorhandler_get(ghost_error e)
Get the handler of a given GHOST error.
Definition: errorhandler.cpp:9
#define ZOLTAN_OK
Definition: error.h:17
#define ZOLTAN_CALL_GOTO |
( |
|
call, |
|
|
|
label, |
|
|
|
__err |
|
) |
| |
Value:
goto label;\
}\
}\
No error occured.
Definition: error.h:27
#define ZOLTAN_CALL(call, __err)
Definition: error.h:443
#define ZOLTAN_CALL_RETURN |
( |
|
call | ) |
|
Value:
return macroerr;\
}\
}\
No error occured.
Definition: error.h:27
ghost_error
Error return type.
Definition: error.h:23
#define ZOLTAN_CALL(call, __err)
Definition: error.h:443
Error return type.
Enumerator |
---|
GHOST_SUCCESS |
No error occured.
|
GHOST_ERR_INVALID_ARG |
One or more of the arguments are invalid.
|
GHOST_ERR_MPI |
An error in an MPI call occured.
|
GHOST_ERR_CUDA |
An error in a CUDA call occured.
|
GHOST_ERR_CUBLAS |
An error in a CUBLAS call occured.
|
GHOST_ERR_CUSPARSE |
An error in a CUSPARSE call occured.
|
GHOST_ERR_CURAND |
An error in a CURAND call occured.
|
GHOST_ERR_HWLOC |
An error in a Hwloc call occured.
|
GHOST_ERR_SCOTCH |
An error in a SCOTCH call occured.
|
GHOST_ERR_ZOLTAN |
An error in a Zoltan call occured.
|
GHOST_ERR_UNKNOWN |
An unknown error occured.
|
GHOST_ERR_NOT_IMPLEMENTED |
The function is not (yet) implemented.
|
GHOST_ERR_IO |
An error during I/O occured.
|
GHOST_ERR_DATATYPE |
An error with datatypes occured.
|
GHOST_ERR_COLPACK |
An error in a ColPack call occured.
|
GHOST_ERR_BLOCKCOLOR |
An error in Block coloring occured.
|
GHOST_ERR_NOT_COLORED |
ERROR if the matrix is not colored.
|
GHOST_ERR_RED_BLACK |
An error in Red-Black splitting occured.
|
GHOST_ERR_LAPACK |
An error in a LAPACK call occured.
|
GHOST_ERR_BLAS |
An error in a BLAS call occured.
|
GHOST_ERR_COMPATIBILITY |
brief Incompatibly permuted sparsemat and/or densemat.
|