1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #ifndef MCA_BTL_BASE_ERROR_H
25 #define MCA_BTL_BASE_ERROR_H
26
27 #include "opal_config.h"
28
29 #include <errno.h>
30 #include <stdio.h>
31
32 #include "opal/util/proc.h"
33
34 OPAL_DECLSPEC extern int mca_btl_base_verbose;
35
36 OPAL_DECLSPEC extern int mca_btl_base_err(const char*, ...) __opal_attribute_format__(__printf__, 1, 2);
37 OPAL_DECLSPEC extern int mca_btl_base_out(const char*, ...) __opal_attribute_format__(__printf__, 1, 2);
38
39 #define BTL_OUTPUT(args) \
40 do { \
41 mca_btl_base_out("[%s]%s[%s:%d:%s] ", \
42 opal_process_info.nodename, \
43 OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \
44 __FILE__, __LINE__, __func__); \
45 mca_btl_base_out args; \
46 mca_btl_base_out("\n"); \
47 } while(0);
48
49
50 #define BTL_ERROR(args) \
51 do { \
52 mca_btl_base_err("[%s]%s[%s:%d:%s] ", \
53 opal_process_info.nodename, \
54 OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \
55 __FILE__, __LINE__, __func__); \
56 mca_btl_base_err args; \
57 mca_btl_base_err("\n"); \
58 } while(0);
59
60 #define BTL_PEER_ERROR(proc, args) \
61 do { \
62 mca_btl_base_err("%s[%s:%d:%s] from %s ", \
63 OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \
64 __FILE__, __LINE__, __func__, \
65 opal_process_info.nodename); \
66 if (proc) { \
67 mca_btl_base_err("to: %s ", \
68 opal_get_proc_hostname(proc)); \
69 } \
70 mca_btl_base_err args; \
71 mca_btl_base_err("\n"); \
72 } while(0);
73
74
75 #if OPAL_ENABLE_DEBUG
76 #define BTL_VERBOSE(args) \
77 do { \
78 if(mca_btl_base_verbose > 0) { \
79 mca_btl_base_err("[%s]%s[%s:%d:%s] ", \
80 opal_process_info.nodename, \
81 OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \
82 __FILE__, __LINE__, __func__); \
83 mca_btl_base_err args; \
84 mca_btl_base_err("\n"); \
85 } \
86 } while(0);
87 #else
88 #define BTL_VERBOSE(args)
89 #endif
90
91 #endif
92
93
94 BEGIN_C_DECLS
95
96 OPAL_DECLSPEC extern void mca_btl_base_error_no_nics(const char* transport,
97 const char* nic_name);
98
99 END_C_DECLS