SIONlib  2.0.0-rc.1
Scalable I/O library for parallel access to task-local files
sion_debug.h
1 /****************************************************************************
2 ** SIONLIB http://www.fz-juelich.de/jsc/sionlib **
3 *****************************************************************************
4 ** Copyright (c) 2008-2018 **
5 ** Forschungszentrum Juelich, Juelich Supercomputing Centre **
6 ** **
7 ** See the file COPYRIGHT in the package base directory for details **
8 ****************************************************************************/
9 
38 #ifndef SION_SION_DEBUG_H
39 #define SION_SION_DEBUG_H
40 
41 #include <stdio.h>
42 
43 #include "sion_printts.h"
44 
45 #define _SION_DEFAULT_RANK -1
46 #ifdef DPRINTF
47 #undef ONLY_DEBUG
48 #undef DPRINTF
49 #undef DPRINTFP
50 #undef DPRINTTS
51 #undef DPRINTFTS2
52 #endif
53 #ifdef SION_DEBUG
54 #define ONLY_DEBUG(A) A
55 #define DPRINTF(A) sion_dprintf A
56 #define DPRINTFP(A) sion_dprintfp A
57 #define DPRINTFTS(rank, desc) \
58  sion_dprintfp(128, "TIMING", rank, " step=%-40s timestamp=%18.8f\n", \
59  desc, _sion_get_time())
60 #define DPRINTFTS2(rank, desc) \
61  sion_dprintfp(256, "TIMING", rank, " step=%-40s timestamp=%18.8f\n", \
62  desc, _sion_get_time())
63 #else
64 #define ONLY_DEBUG(A)
65 #define DPRINTF(A)
66 #define DPRINTFP(A)
67 #define DPRINTFTS(A, B)
68 #define DPRINTFTS2(A, B)
69 #endif
70 
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 
81 int _sion_debug_init(void);
82 
87 int sion_dprintf(int mask, const char *format, ...);
88 
93 int sion_dprintfp(int mask, const char *callfunction, int rank, const char *format, ...);
94 int sion_isdebug(void);
95 
102 void sion_debug_on(int mask, const char *filename);
103 void sion_debug_off(void);
104 
108 FILE *sion_get_dfile(void);
109 
113 void sion_dclose(void);
114 
115 void _sion_debug_set_lock_cb(void (*set_lock)(void), void (*unset_lock)(void));
116 
117 int _sion_debug_set_query_thread_num_function(int (*get_thread_num)(void));
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif