SIONlib  1.7.1
Scalable I/O library for parallel access to task-local files
sion_debug.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** SIONLIB http://www.fz-juelich.de/jsc/sionlib **
3 *****************************************************************************
4 ** Copyright (c) 2008-2016 **
5 ** Forschungszentrum Juelich, Juelich Supercomputing Centre **
6 ** **
7 ** See the file COPYRIGHT in the package base directory for details **
8 ****************************************************************************/
9 
14 #ifndef SION_SION_DEBUG_H
15 #define SION_SION_DEBUG_H
16 
17 #define _SION_DEFAULT_RANK -1
18 #ifdef DPRINTF
19 #undef ONLY_DEBUG
20 #undef DPRINTF
21 #undef DPRINTFP
22 #undef DPRINTTS
23 #undef DPRINTFTS2
24 #endif
25 #ifdef SION_DEBUG
26 #define ONLY_DEBUG(A) A
27 #define DPRINTF(A) sion_dprintf A
28 #define DPRINTFP(A) sion_dprintfp A
29 #define DPRINTFTS(rank,desc) sion_dprintfp(128,"TIMING",rank," step=%-40s timestamp=%18.8f\n",desc,_sion_get_time())
30 #define DPRINTFTS2(rank,desc) sion_dprintfp(256,"TIMING",rank," step=%-40s timestamp=%18.8f\n",desc,_sion_get_time())
31 #else
32 #define ONLY_DEBUG(A)
33 #define DPRINTF(A)
34 #define DPRINTFP(A)
35 #define DPRINTFTS(A,B)
36 #define DPRINTFTS2(A,B)
37 #endif
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 
44 int _sion_debug_init(void);
45 int sion_dprintf(int mask, const char *format, ...);
46 int sion_dprintfp(int mask, const char *callfunction, int rank, const char *format, ...);
47 int sion_isdebug(void);
48 void sion_debug_on(int mask, const char *filename);
49 void sion_debug_off(void);
50 FILE *sion_get_dfile(void);
51 void sion_dclose(void);
52 
53 void _sion_debug_set_lock_cb(void (*set_lock)(), void (*unset_lock)());
54 
55 int _sion_debug_set_query_thread_num_function( int (*get_thread_num)() );
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif
int _sion_debug_init(void)
initialize the debug environment
Definition: sion_debug.c:369
int sion_dprintfp(int mask, const char *callfunction, int rank, const char *format,...)
Print debugging info formating the message like printf and including the name of the calling function...
Definition: sion_debug.c:203
int sion_dprintf(int mask, const char *format,...)
Print debugging info formating the message like printf.
Definition: sion_debug.c:177
FILE * sion_get_dfile(void)
Definition: sion_debug.c:275
void sion_dclose(void)
Definition: sion_debug.c:287
void sion_debug_on(int mask, const char *filename)
sets debug mode.
Definition: sion_debug.c:313