16 #ifndef GHOST_HAVE_ZOLTAN
122 #define GHOST_CALL_RETURN(call) {\
123 ghost_error macroerr = GHOST_SUCCESS;\
124 GHOST_CALL(call,macroerr);\
125 if (macroerr != GHOST_SUCCESS) {\
140 #define GHOST_CALL_GOTO(call,label,__err) {\
141 GHOST_CALL(call,__err);\
142 if (__err != GHOST_SUCCESS) {\
155 #define GHOST_CALL(call,__err) {\
157 if (__err != GHOST_SUCCESS) {\
158 GHOST_LOG(GHOST_ERROR,GHOST_ANSI_COLOR_RED,"%s",ghost_error_string((ghost_error)__err));\
162 #define MPI_CALL_RETURN(call) {\
163 ghost_error macroerr = GHOST_SUCCESS;\
164 MPI_CALL(call,macroerr);\
165 if (macroerr != GHOST_SUCCESS) {\
170 #define MPI_CALL_GOTO(call,label,__err) {\
171 MPI_CALL(call,__err);\
172 if (__err != GHOST_SUCCESS) {\
177 #define MPI_CALL(call,__err) {\
178 int mpicallmacroerr = call;\
179 if (mpicallmacroerr != MPI_SUCCESS) {\
180 char errstr[MPI_MAX_ERROR_STRING];\
182 MPI_Error_string(mpicallmacroerr,errstr,&strlen);\
183 GHOST_ERROR_LOG("MPI Error: %s",errstr);\
184 ghost_errorhandler h = ghost_errorhandler_get(GHOST_ERR_MPI);\
186 h((void *)&mpicallmacroerr);\
188 __err = GHOST_ERR_MPI;\
190 __err = GHOST_SUCCESS;\
194 #define HWLOC_CALL_RETURN(call) {\
195 ghost_error macroerr = GHOST_SUCCESS;\
196 HWLOC_CALL(call,macroerr);\
197 if (macroerr != GHOST_SUCCESS) {\
202 #define HWLOC_CALL_GOTO(call,label,__err) {\
203 HWLOC_CALL(call,__err);\
204 if (__err != GHOST_SUCCESS) {\
209 #define HWLOC_CALL(call,__err) {\
210 int __hwlocerr = call;\
212 GHOST_ERROR_LOG("HWLOC Error: %d",__hwlocerr);\
213 ghost_errorhandler h = ghost_errorhandler_get(GHOST_ERR_HWLOC);\
215 h((void *)&__hwlocerr);\
217 __err = GHOST_ERR_HWLOC;\
219 __err = GHOST_SUCCESS;\
223 #define CUDA_CALL_RETURN(call) {\
224 ghost_error macroerr = GHOST_SUCCESS;\
225 CUDA_CALL(call,macroerr);\
226 if (macroerr != GHOST_SUCCESS) {\
231 #define CUDA_CALL_GOTO(call,label,__err) {\
232 CUDA_CALL(call,__err);\
233 if (__err != GHOST_SUCCESS) {\
238 #define CUDA_CALL(call,__err) {\
239 cudaError_t __cuerr = call;\
240 if (__cuerr != cudaSuccess) {\
241 GHOST_ERROR_LOG("CUDA Error: %s (%d)",cudaGetErrorString(__cuerr),(int)__cuerr);\
242 ghost_errorhandler h = ghost_errorhandler_get(GHOST_ERR_CUDA);\
244 h((void *)&__cuerr);\
246 __err = GHOST_ERR_CUDA;\
248 __err = GHOST_SUCCESS;\
252 #define CUBLAS_CALL_RETURN(call) {\
253 ghost_error macroerr = GHOST_SUCCESS;\
254 CUBLAS_CALL(call,macroerr);\
255 if (macroerr != GHOST_SUCCESS) {\
260 #define CUBLAS_CALL_GOTO(call,label,__err) {\
261 CUBLAS_CALL(call,__err);\
262 if (__err != GHOST_SUCCESS) {\
267 #define CUBLAS_CALL(call,__err) {\
268 cublasStatus_t err = call;\
269 if (err != CUBLAS_STATUS_SUCCESS) {\
271 case CUBLAS_STATUS_NOT_INITIALIZED:\
272 GHOST_ERROR_LOG("CUBLAS error: CUBLAS_STATUS_NOT_INITIALIZED");\
274 case CUBLAS_STATUS_ALLOC_FAILED:\
275 GHOST_ERROR_LOG("CUBLAS error: CUBLAS_STATUS_ALLOC_FAILED");\
277 case CUBLAS_STATUS_INVALID_VALUE:\
278 GHOST_ERROR_LOG("CUBLAS error: CUBLAS_STATUS_INVALID_VALUE");\
280 case CUBLAS_STATUS_ARCH_MISMATCH:\
281 GHOST_ERROR_LOG("CUBLAS error: CUBLAS_STATUS_ARCH_MISMATCH");\
283 case CUBLAS_STATUS_MAPPING_ERROR:\
284 GHOST_ERROR_LOG("CUBLAS error: CUBLAS_STATUS_MAPPING_ERROR");\
286 case CUBLAS_STATUS_EXECUTION_FAILED:\
287 GHOST_ERROR_LOG("CUBLAS error: CUBLAS_STATUS_EXECUTION_FAILED");\
289 case CUBLAS_STATUS_INTERNAL_ERROR:\
290 GHOST_ERROR_LOG("CUBLAS error: CUBLAS_STATUS_INTERNAL_ERROR");\
292 case CUBLAS_STATUS_NOT_SUPPORTED:\
293 GHOST_ERROR_LOG("CUBLAS error: CUBLAS_STATUS_NOT_SUPPORTED");\
295 case CUBLAS_STATUS_LICENSE_ERROR:\
296 GHOST_ERROR_LOG("CUBLAS error: CUBLAS_STATUS_LICENSE_ERROR");\
299 GHOST_ERROR_LOG("CUBLAS error: Unknown CUBLAS error");\
302 ghost_errorhandler h = ghost_errorhandler_get(GHOST_ERR_CUBLAS);\
306 __err = GHOST_ERR_CUBLAS;\
308 __err = GHOST_SUCCESS;\
312 #define CURAND_CALL_RETURN(call) {\
313 ghost_error macroerr = GHOST_SUCCESS;\
314 CURAND_CALL(call,macroerr);\
315 if (macroerr != GHOST_SUCCESS) {\
320 #define CURAND_CALL_GOTO(call,label,__err) {\
321 CURAND_CALL(call,__err);\
322 if (__err != GHOST_SUCCESS) {\
327 #define CURAND_CALL(call,__err) {\
328 curandStatus_t err = call;\
329 if (err != CURAND_STATUS_SUCCESS) {\
330 GHOST_ERROR_LOG("CURAND Error: %d",(int)err);\
331 ghost_errorhandler h = ghost_errorhandler_get(GHOST_ERR_CURAND);\
335 __err = GHOST_ERR_CURAND;\
337 __err = GHOST_SUCCESS;\
341 #define CUSPARSE_CALL_RETURN(call) {\
342 ghost_error macroerr = GHOST_SUCCESS;\
343 CUSPARSE_CALL(call,macroerr);\
344 if (macroerr != GHOST_SUCCESS) {\
349 #define CUSPARSE_CALL_GOTO(call,label,__err) {\
350 CUSPARSE_CALL(call,__err);\
351 if (__err != GHOST_SUCCESS) {\
356 #define CUSPARSE_CALL(call,__err) {\
357 cusparseStatus_t err = call;\
358 if (err != CUSPARSE_STATUS_SUCCESS) {\
359 GHOST_ERROR_LOG("CUSPARSE Error: %d",(int)err);\
360 ghost_errorhandler h = ghost_errorhandler_get(GHOST_ERR_CUSPARSE);\
364 __err = GHOST_ERR_CUSPARSE;\
366 __err = GHOST_SUCCESS;\
370 #define SCOTCH_CALL_RETURN(call) {\
371 ghost_error macroerr = GHOST_SUCCESS;\
372 SCOTCH_CALL(call,macroerr);\
373 if (macroerr != GHOST_SUCCESS) {\
378 #define SCOTCH_CALL_GOTO(call,label,__err) {\
379 SCOTCH_CALL(call,__err);\
380 if (__err != GHOST_SUCCESS) {\
385 #define SCOTCH_CALL(call,__err) {\
388 GHOST_ERROR_LOG("SCOTCH Error: %d",err);\
389 ghost_errorhandler h = ghost_errorhandler_get(GHOST_ERR_SCOTCH);\
393 __err = GHOST_ERR_SCOTCH;\
395 __err = GHOST_SUCCESS;\
399 #define COLPACK_CALL_RETURN(call) {\
400 ghost_error macroerr = GHOST_SUCCESS;\
401 COLPACK_CALL(call,macroerr);\
402 if (macroerr != GHOST_SUCCESS) {\
407 #define COLPACK_CALL_GOTO(call,label,__err) {\
408 COLPACK_CALL(call,__err);\
409 if (__err != GHOST_SUCCESS) {\
414 #define COLPACK_CALL(call,__err) {\
417 GHOST_ERROR_LOG("ColPack Error: %d",err);\
418 ghost_errorhandler h = ghost_errorhandler_get(GHOST_ERR_COLPACK);\
422 __err = GHOST_ERR_COLPACK;\
424 __err = GHOST_SUCCESS;\
428 #define ZOLTAN_CALL_RETURN(call) {\
429 ghost_error macroerr = GHOST_SUCCESS;\
430 ZOLTAN_CALL(call,macroerr);\
431 if (macroerr != GHOST_SUCCESS) {\
436 #define ZOLTAN_CALL_GOTO(call,label,__err) {\
437 ZOLTAN_CALL(call,__err);\
438 if (__err != GHOST_SUCCESS) {\
443 #define ZOLTAN_CALL(call,__err) {\
445 if (err != ZOLTAN_OK) {\
446 GHOST_ERROR_LOG("Zoltan Error: %d",err);\
447 ghost_errorhandler h = ghost_errorhandler_get(GHOST_ERR_ZOLTAN);\
451 __err = GHOST_ERR_ZOLTAN;\
453 __err = GHOST_SUCCESS;\
457 #define BLAS_CALL_RETURN(call) {\
458 ghost_error macroerr = GHOST_SUCCESS;\
459 BLAS_CALL(call,macroerr);\
460 if (macroerr != GHOST_SUCCESS) {\
465 #define BLAS_CALL_GOTO(call,label,__err) {\
466 BLAS_CALL(call,__err);\
467 if (__err != GHOST_SUCCESS) {\
472 #define BLAS_CALL(call,__err) {\
474 int err = ghost_blas_err_pop();\
476 GHOST_ERROR_LOG("BLAS Error: %d",err);\
477 ghost_errorhandler h = ghost_errorhandler_get(GHOST_ERR_BLAS);\
481 __err = GHOST_ERR_BLAS;\
483 __err = GHOST_SUCCESS;\
No error occured.
Definition: error.h:27
An error in a CUSPARSE call occured.
Definition: error.h:47
An error in a Hwloc call occured.
Definition: error.h:55
An error during I/O occured.
Definition: error.h:75
An unknown error occured.
Definition: error.h:67
An error in a ColPack call occured.
Definition: error.h:83
An error in a BLAS call occured.
Definition: error.h:103
Functionality for user-defined error handlers.
ghost_error
Error return type.
Definition: error.h:23
An error in an MPI call occured.
Definition: error.h:35
One or more of the arguments are invalid.
Definition: error.h:31
An error in Red-Black splitting occured.
Definition: error.h:95
An error in a LAPACK call occured.
Definition: error.h:99
An error in a Zoltan call occured.
Definition: error.h:63
char * ghost_error_string(ghost_error e)
Get a string of the GHOST error.
Definition: error.c:4
An error in a CURAND call occured.
Definition: error.h:51
ERROR if the matrix is not colored.
Definition: error.h:91
An error with datatypes occured.
Definition: error.h:79
The function is not (yet) implemented.
Definition: error.h:71
An error in Block coloring occured.
Definition: error.h:87
An error in a CUDA call occured.
Definition: error.h:39
An error in a CUBLAS call occured.
Definition: error.h:43
An error in a SCOTCH call occured.
Definition: error.h:59