OpenMPI  0.1.1
btl_base_error.h
1 /*
2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2011 The University of Tennessee and The University
6  * of Tennessee Research Foundation. All rights
7  * reserved.
8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9  * University of Stuttgart. All rights reserved.
10  * Copyright (c) 2004-2005 The Regents of the University of California.
11  * All rights reserved.
12  * Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved.
13  * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
14  * $COPYRIGHT$
15  *
16  * Additional copyrights may follow
17  *
18  * $HEADER$
19  */
20 
21 #ifndef MCA_BTL_BASE_ERROR_H
22 #define MCA_BTL_BASE_ERROR_H
23 
24 #include "ompi_config.h"
25 
26 #include <errno.h>
27 #include <stdio.h>
28 
29 #include "orte/util/proc_info.h"
30 #include "orte/util/name_fns.h"
32 
33 OMPI_DECLSPEC extern int mca_btl_base_verbose;
34 
35 OMPI_DECLSPEC extern int mca_btl_base_err(const char*, ...) __opal_attribute_format__(__printf__, 1, 2);
36 OMPI_DECLSPEC extern int mca_btl_base_out(const char*, ...) __opal_attribute_format__(__printf__, 1, 2);
37 
38 #define BTL_OUTPUT(args) \
39 do { \
40  mca_btl_base_out("[%s]%s[%s:%d:%s] ", \
41  orte_process_info.nodename, \
42  ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
43  __FILE__, __LINE__, __func__); \
44  mca_btl_base_out args; \
45  mca_btl_base_out("\n"); \
46 } while(0);
47 
48 
49 #define BTL_ERROR(args) \
50 do { \
51  mca_btl_base_err("[%s]%s[%s:%d:%s] ", \
52  orte_process_info.nodename, \
53  ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
54  __FILE__, __LINE__, __func__); \
55  mca_btl_base_err args; \
56  mca_btl_base_err("\n"); \
57 } while(0);
58 
59 #define BTL_PEER_ERROR(proc, args) \
60 do { \
61  mca_btl_base_err("%s[%s:%d:%s] from %s ", \
62  ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
63  __FILE__, __LINE__, __func__, \
64  orte_process_info.nodename); \
65  if(proc && proc->proc_hostname) { \
66  mca_btl_base_err("to: %s ", proc->proc_hostname); \
67  } \
68  mca_btl_base_err args; \
69  mca_btl_base_err("\n"); \
70 } while(0);
71 
72 
73 #if OPAL_ENABLE_DEBUG
74 #define BTL_VERBOSE(args) \
75 do { \
76  if(mca_btl_base_verbose > 0) { \
77  mca_btl_base_err("[%s]%s[%s:%d:%s] ", \
78  orte_process_info.nodename, \
79  ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
80  __FILE__, __LINE__, __func__); \
81  mca_btl_base_err args; \
82  mca_btl_base_err("\n"); \
83  } \
84 } while(0);
85 #else
86 #define BTL_VERBOSE(args)
87 #endif
88 
89 #endif
90 
91 
92 BEGIN_C_DECLS
93 
94 OMPI_DECLSPEC extern void mca_btl_base_error_no_nics(const char* transport,
95  const char* nic_name);
96 
97 END_C_DECLS
Populates global structure with process-specific information.
Populates global structure with system-specific information.
Global params for OpenRTE.