Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit f44bf6a

Browse files
committed
Merge pull request #518 from hjelmn/v2.x_standardize_verbosity
v2.x standardize verbosity
2 parents 2412f5d + 1055d54 commit f44bf6a

13 files changed

+249
-94
lines changed

ompi/mca/bml/r2/bml_r2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static int mca_bml_r2_add_procs( size_t nprocs,
284284
/* skip this btl if the exclusivity is less than the previous only if the btl does not provide full rdma (for one-sided) */
285285
if(bml_btl->btl->btl_exclusivity > btl->btl_exclusivity && ((btl_flags & MCA_BTL_FLAGS_RDMA) != MCA_BTL_FLAGS_RDMA)) {
286286
btl->btl_del_procs(btl, 1, (opal_proc_t**)&proc, &btl_endpoints[p]);
287-
opal_output_verbose(20, opal_btl_base_framework.framework_output,
287+
opal_output_verbose(MCA_BASE_VERBOSE_INFO, ompi_bml_base_framework.framework_output,
288288
"mca: bml: Not using %s btl to %s on node %s "
289289
"because %s btl has higher exclusivity (%d > %d)",
290290
btl->btl_component->btl_version.mca_component_name,
@@ -295,7 +295,7 @@ static int mca_bml_r2_add_procs( size_t nprocs,
295295
continue;
296296
}
297297
}
298-
opal_output_verbose(1, opal_btl_base_framework.framework_output,
298+
opal_output_verbose(MCA_BASE_VERBOSE_INFO, ompi_bml_base_framework.framework_output,
299299
"mca: bml: Using %s btl to %s on node %s",
300300
btl->btl_component->btl_version.mca_component_name,
301301
OMPI_NAME_PRINT(&proc->super.proc_name),

opal/mca/base/base.h

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
1313
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
14-
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
14+
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
1515
* reserved.
1616
* $COPYRIGHT$
1717
*
@@ -69,6 +69,30 @@ OPAL_DECLSPEC extern bool mca_base_component_disable_dlopen;
6969
OPAL_DECLSPEC extern char *mca_base_system_default_path;
7070
OPAL_DECLSPEC extern char *mca_base_user_default_path;
7171

72+
/*
73+
* Standard verbosity levels
74+
*/
75+
enum {
76+
/** total silence */
77+
MCA_BASE_VERBOSE_NONE = -1,
78+
/** only errors are printed */
79+
MCA_BASE_VERBOSE_ERROR = 0,
80+
/** emit messages about component selection, open, and unloading */
81+
MCA_BASE_VERBOSE_COMPONENT = 10,
82+
/** also emit warnings */
83+
MCA_BASE_VERBOSE_WARN = 20,
84+
/** also emit general, user-relevant information, such as rationale as to why certain choices
85+
* or code paths were taken, information gleaned from probing the local system, etc. */
86+
MCA_BASE_VERBOSE_INFO = 40,
87+
/** also emit relevant tracing information (e.g., which functions were invoked /
88+
* call stack entry/exit info) */
89+
MCA_BASE_VERBOSE_TRACE = 60,
90+
/** also emit Open MPI-developer-level (i.e,. highly detailed) information */
91+
MCA_BASE_VERBOSE_DEBUG = 80,
92+
/** also output anything else that might be useful */
93+
MCA_BASE_VERBOSE_MAX = 100,
94+
};
95+
7296
/*
7397
* Public functions
7498
*/

opal/mca/base/mca_base_component_find.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
1515
* Copyright (c) 2015 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
17+
* Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights
18+
* reserved.
1719
* $COPYRIGHT$
1820
*
1921
* Additional copyrights may follow
@@ -133,8 +135,8 @@ int mca_base_component_find (const char *directory, mca_base_framework_t *framew
133135
find_dyn_components(directory, framework, (const char**)requested_component_names,
134136
include_mode);
135137
} else {
136-
opal_output_verbose(40, 0,
137-
"mca: base: component_find: dso loading for %s MCA components disabled",
138+
opal_output_verbose (MCA_BASE_VERBOSE_INFO, 0,
139+
"mca: base: component_find: dso loading for %s MCA components disabled",
138140
framework->framework_name);
139141
}
140142
#endif
@@ -193,11 +195,11 @@ int mca_base_components_filter (mca_base_framework_t *framework, uint32_t filter
193195
if (!can_use || (filter_flags & dummy->data.param_field) != filter_flags) {
194196
if (can_use && (filter_flags & MCA_BASE_METADATA_PARAM_CHECKPOINT) &&
195197
!(MCA_BASE_METADATA_PARAM_CHECKPOINT & dummy->data.param_field)) {
196-
opal_output_verbose(10, output_id,
197-
"mca: base: components_filter: "
198-
"(%s) Component %s is *NOT* Checkpointable - Disabled",
199-
component->reserved,
200-
component->mca_component_name);
198+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
199+
"mca: base: components_filter: "
200+
"(%s) Component %s is *NOT* Checkpointable - Disabled",
201+
component->reserved,
202+
component->mca_component_name);
201203
}
202204

203205
opal_list_remove_item (components, &cli->super);
@@ -206,11 +208,11 @@ int mca_base_components_filter (mca_base_framework_t *framework, uint32_t filter
206208

207209
OBJ_RELEASE(cli);
208210
} else if (filter_flags & MCA_BASE_METADATA_PARAM_CHECKPOINT) {
209-
opal_output_verbose(10, output_id,
210-
"mca: base: components_filter: "
211-
"(%s) Component %s is Checkpointable",
212-
component->reserved,
213-
component->mca_component_name);
211+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
212+
"mca: base: components_filter: "
213+
"(%s) Component %s is Checkpointable",
214+
component->reserved,
215+
component->mca_component_name);
214216
}
215217
}
216218

opal/mca/base/mca_base_component_repository.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@ int mca_base_component_repository_open (mca_base_framework_t *framework,
314314
char *struct_name = NULL;
315315
int vl, ret;
316316

317-
opal_output_verbose(40, 0, "mca_base_component_repository_open: examining dynamic %s MCA component \"%s\" at path %s",
318-
ri->ri_type, ri->ri_name, ri->ri_path);
317+
opal_output_verbose(MCA_BASE_VERBOSE_INFO, 0, "mca_base_component_repository_open: examining dynamic "
318+
"%s MCA component \"%s\" at path %s", ri->ri_type, ri->ri_name, ri->ri_path);
319319

320-
vl = mca_base_component_show_load_errors ? 0 : 40;
320+
vl = mca_base_component_show_load_errors ? MCA_BASE_VERBOSE_ERROR : MCA_BASE_VERBOSE_INFO;
321321

322322
/* Ensure that this component is not already loaded (should only happen
323323
if it was statically loaded). It's an error if it's already
@@ -327,7 +327,7 @@ int mca_base_component_repository_open (mca_base_framework_t *framework,
327327

328328
OPAL_LIST_FOREACH(mitem, &framework->framework_components, mca_base_component_list_item_t) {
329329
if (0 == strcmp(mitem->cli_component->mca_component_name, ri->ri_name)) {
330-
opal_output_verbose(40, 0, "mca_base_component_repository_open: already loaded (ignored)");
330+
opal_output_verbose (MCA_BASE_VERBOSE_INFO, 0, "mca_base_component_repository_open: already loaded (ignored)");
331331
return OPAL_ERR_BAD_PARAM;
332332
}
333333
}
@@ -336,7 +336,7 @@ int mca_base_component_repository_open (mca_base_framework_t *framework,
336336
mitem = NULL;
337337

338338
if (NULL != ri->ri_dlhandle) {
339-
opal_output_verbose(40, 0, "mca_base_component_repository_open: already loaded. returning cached component");
339+
opal_output_verbose (MCA_BASE_VERBOSE_INFO, 0, "mca_base_component_repository_open: already loaded. returning cached component");
340340
mitem = OBJ_NEW(mca_base_component_list_item_t);
341341
if (NULL == mitem) {
342342
return OPAL_ERR_OUT_OF_RESOURCE;
@@ -445,8 +445,8 @@ int mca_base_component_repository_open (mca_base_framework_t *framework,
445445
ri->ri_component_struct = mitem->cli_component = component_struct;
446446
opal_list_append(&framework->framework_components, &mitem->super);
447447

448-
opal_output_verbose(40, 0, "mca_base_component_repository_open: opened dynamic %s MCA component \"%s\"",
449-
ri->ri_type, ri->ri_name);
448+
opal_output_verbose (MCA_BASE_VERBOSE_INFO, 0, "mca_base_component_repository_open: opened dynamic %s MCA "
449+
"component \"%s\"", ri->ri_type, ri->ri_name);
450450

451451
return OPAL_SUCCESS;
452452
} while (0);

opal/mca/base/mca_base_components_close.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2006 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
13+
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
1414
* reserved.
1515
* $COPYRIGHT$
1616
*
@@ -33,9 +33,9 @@ void mca_base_component_unload (const mca_base_component_t *component, int outpu
3333
int ret;
3434

3535
/* Unload */
36-
opal_output_verbose(10, output_id,
37-
"mca: base: close: unloading component %s",
38-
component->mca_component_name);
36+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
37+
"mca: base: close: unloading component %s",
38+
component->mca_component_name);
3939

4040
ret = mca_base_var_group_find (component->mca_project_name, component->mca_type_name,
4141
component->mca_component_name);
@@ -51,9 +51,9 @@ void mca_base_component_close (const mca_base_component_t *component, int output
5151
/* Close */
5252
if (NULL != component->mca_close_component) {
5353
component->mca_close_component();
54-
opal_output_verbose(10, output_id,
55-
"mca: base: close: component %s closed",
56-
component->mca_component_name);
54+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
55+
"mca: base: close: component %s closed",
56+
component->mca_component_name);
5757
}
5858

5959
mca_base_component_unload (component, output_id);

opal/mca/base/mca_base_components_open.c

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -109,26 +109,26 @@ static int open_components(mca_base_framework_t *framework)
109109
}
110110

111111
/* Announce */
112-
opal_output_verbose(10, output_id, "mca: base: components_open: opening %s components",
113-
framework->framework_name);
114-
112+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id, "mca: base: components_open: opening %s components",
113+
framework->framework_name);
114+
115115
/* Traverse the list of components */
116116
OPAL_LIST_FOREACH_SAFE(cli, next, components, mca_base_component_list_item_t) {
117117
const mca_base_component_t *component = cli->cli_component;
118-
119-
opal_output_verbose(10, output_id,
120-
"mca: base: components_open: found loaded component %s",
121-
component->mca_component_name);
118+
119+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
120+
"mca: base: components_open: found loaded component %s",
121+
component->mca_component_name);
122122

123123
if (NULL != component->mca_open_component) {
124124
/* Call open if register didn't call it already */
125125
ret = component->mca_open_component();
126126

127127
if (OPAL_SUCCESS == ret) {
128-
opal_output_verbose(10, output_id,
129-
"mca: base: components_open: "
130-
"component %s open function successful",
131-
component->mca_component_name);
128+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
129+
"mca: base: components_open: "
130+
"component %s open function successful",
131+
component->mca_component_name);
132132
} else {
133133
if (OPAL_ERR_NOT_AVAILABLE != ret) {
134134
/* If the component returns OPAL_ERR_NOT_AVAILABLE,
@@ -143,15 +143,16 @@ static int open_components(mca_base_framework_t *framework)
143143
expected. */
144144

145145
if (mca_base_component_show_load_errors) {
146-
opal_output(0, "mca: base: components_open: "
147-
"component %s / %s open function failed",
148-
component->mca_type_name,
149-
component->mca_component_name);
146+
opal_output_verbose (MCA_BASE_VERBOSE_ERROR, output_id,
147+
"mca: base: components_open: component %s "
148+
"/ %s open function failed",
149+
component->mca_type_name,
150+
component->mca_component_name);
150151
}
151-
opal_output_verbose(10, output_id,
152-
"mca: base: components_open: "
153-
"component %s open function failed",
154-
component->mca_component_name);
152+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
153+
"mca: base: components_open: "
154+
"component %s open function failed",
155+
component->mca_component_name);
155156
}
156157

157158
mca_base_component_close (component, output_id);

opal/mca/base/mca_base_components_register.c

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,25 @@ static int register_components(mca_base_framework_t *framework)
7676
int output_id = framework->framework_output;
7777

7878
/* Announce */
79-
opal_output_verbose(10, output_id,
80-
"mca: base: components_register: registering framework %s components",
81-
framework->framework_name);
82-
79+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
80+
"mca: base: components_register: registering framework %s components",
81+
framework->framework_name);
82+
8383
/* Traverse the list of found components */
8484

8585
OPAL_LIST_FOREACH_SAFE(cli, next, &framework->framework_components, mca_base_component_list_item_t) {
8686
component = (mca_base_component_t *)cli->cli_component;
8787

88-
opal_output_verbose(10, output_id,
88+
opal_output_verbose(MCA_BASE_VERBOSE_COMPONENT, output_id,
8989
"mca: base: components_register: found loaded component %s",
9090
component->mca_component_name);
9191

9292
/* Call the component's MCA parameter registration function (or open if register doesn't exist) */
9393
if (NULL == component->mca_register_component_params) {
94-
opal_output_verbose(10, output_id,
95-
"mca: base: components_register: "
96-
"component %s has no register or open function",
97-
component->mca_component_name);
94+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
95+
"mca: base: components_register: "
96+
"component %s has no register or open function",
97+
component->mca_component_name);
9898
ret = OPAL_SUCCESS;
9999
} else {
100100
ret = component->mca_register_component_params();
@@ -114,16 +114,17 @@ static int register_components(mca_base_framework_t *framework)
114114
expected. */
115115

116116
if (mca_base_component_show_load_errors) {
117-
opal_output(0, "mca: base: components_register: "
118-
"component %s / %s register function failed",
119-
component->mca_type_name,
120-
component->mca_component_name);
117+
opal_output_verbose (MCA_BASE_VERBOSE_ERROR, output_id,
118+
"mca: base: components_register: component %s "
119+
"/ %s register function failed",
120+
component->mca_type_name,
121+
component->mca_component_name);
121122
}
122123

123-
opal_output_verbose(10, output_id,
124-
"mca: base: components_register: "
125-
"component %s register function failed",
126-
component->mca_component_name);
124+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
125+
"mca: base: components_register: "
126+
"component %s register function failed",
127+
component->mca_component_name);
127128
}
128129

129130
opal_list_remove_item (&framework->framework_components, &cli->super);
@@ -134,7 +135,7 @@ static int register_components(mca_base_framework_t *framework)
134135
}
135136

136137
if (NULL != component->mca_register_component_params) {
137-
opal_output_verbose (10, output_id, "mca: base: components_register: "
138+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id, "mca: base: components_register: "
138139
"component %s register function successful",
139140
component->mca_component_name);
140141
}

0 commit comments

Comments
 (0)