This source file includes following definitions.
- V_OUTPUT_ERR
- V_OUTPUT
- V_OUTPUT_VERBOSE
- V_OUTPUT
- V_OUTPUT_VERBOSE
1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef PML_V_OUTPUT_H_HAS_BEEN_INCLUDED
14 #define PML_V_OUTPUT_H_HAS_BEEN_INCLUDED
15
16 #include "opal/util/output.h"
17 #include "opal/util/printf.h"
18 #include "opal_stdint.h"
19 #include <stdio.h>
20 #include "pml_v.h"
21
22 BEGIN_C_DECLS
23
24 int ompi_pml_v_output_open(char *output, int verbosity);
25 void ompi_pml_v_output_close(void);
26
27 static inline void V_OUTPUT_ERR(const char *fmt, ... ) __opal_attribute_format__(__printf__, 1, 2);
28 static inline void V_OUTPUT_ERR(const char *fmt, ... )
29 {
30 va_list list;
31 char *str;
32 int ret;
33 va_start(list, fmt);
34 ret = opal_vasprintf(&str, fmt, list);
35 assert(-1 != ret);
36 (void)ret;
37 opal_output(0, "%s", str);
38 free(str);
39 va_end(list);
40 }
41
42
43
44 #if defined(ACCEPT_C99)
45 # define V_OUTPUT(ARGS...) \
46 OPAL_OUTPUT((pml_v_output, __VA_ARGS__))
47 # define V_OUTPUT_VERBOSE(V, ARGS...) \
48 OPAL_OUTPUT_VERBOSE((V, mca_pml_v.output, __VA_ARGS__))
49
50 #elif defined(__GNUC__) && !defined(__STDC__)
51 # define V_OUTPUT(ARGS...) \
52 OPAL_OUTPUT((pml_v_output, ARGS))
53 # define V_OUTPUT_VERBOSE(V, ARGS...) \
54 OPAL_OUTPUT_VERBOSE((V, mca_pml_v.output, ARGS))
55
56 #elif OPAL_ENABLE_DEBUG
57
58 static inline void V_OUTPUT(const char* fmt, ... ) __opal_attribute_format__(__printf__, 1, 2);
59 static inline void V_OUTPUT(const char* fmt, ... )
60 {
61 va_list list;
62 char *str;
63 int ret;
64 va_start(list, fmt);
65 ret = opal_vasprintf(&str, fmt, list);
66 assert(-1 != ret);
67 opal_output(mca_pml_v.output, "%s", str);
68 free(str);
69 va_end(list);
70 }
71 static inline void V_OUTPUT_VERBOSE(int V, const char* fmt, ... ) __opal_attribute_format__(__printf__, 2, 3);
72 static inline void V_OUTPUT_VERBOSE(int V, const char* fmt, ... ) {
73 va_list list;
74 char *str;
75 int ret;
76 va_start(list, fmt);
77 ret = opal_vasprintf(&str, fmt, list);
78 assert(-1 != ret);
79 opal_output_verbose(V, mca_pml_v.output, "%s", str);
80 free(str);
81 va_end(list);
82 }
83
84 #else
85
86 static inline void V_OUTPUT(const char* fmt, ... ) {
87 #if defined(__PGI)
88 va_list list;
89 va_start(list, fmt);
90 va_end(list);
91 #endif
92 }
93 static inline void V_OUTPUT_VERBOSE(int V, const char* fmt, ... ) {
94 #if defined(__PGI)
95 va_list list;
96 va_start(list, fmt);
97 va_end(list);
98 #endif
99 }
100 #endif
101
102 END_C_DECLS
103
104 #endif