Skip to content

Commit 1055d54

Browse files
committed
mca/base: use standard verbosity levels
master commit open-mpi/ompi@0a968de Signed-off-by: Nathan Hjelm <[email protected]>
1 parent d1972b9 commit 1055d54

File tree

7 files changed

+89
-83
lines changed

7 files changed

+89
-83
lines changed

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
}

opal/mca/base/mca_base_components_select.c

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
33
* University Research and Technology
44
* Corporation. All rights reserved.
5+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
6+
* reserved.
57
* $COPYRIGHT$
68
*
79
* Additional copyrights may follow
@@ -40,9 +42,9 @@ int mca_base_select(const char *type_name, int output_id,
4042
*best_module = NULL;
4143
*best_component = NULL;
4244

43-
opal_output_verbose(10, output_id,
44-
"mca:base:select: Auto-selecting %s components",
45-
type_name);
45+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
46+
"mca:base:select: Auto-selecting %s components",
47+
type_name);
4648

4749
/*
4850
* Traverse the list of available components.
@@ -55,37 +57,37 @@ int mca_base_select(const char *type_name, int output_id,
5557
* If there is a query function then use it.
5658
*/
5759
if (NULL == component->mca_query_component) {
58-
opal_output_verbose(5, output_id,
59-
"mca:base:select:(%5s) Skipping component [%s]. It does not implement a query function",
60-
type_name, component->mca_component_name );
60+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
61+
"mca:base:select:(%5s) Skipping component [%s]. It does not implement a query function",
62+
type_name, component->mca_component_name );
6163
continue;
6264
}
6365

6466
/*
6567
* Query this component for the module and priority
6668
*/
67-
opal_output_verbose(5, output_id,
68-
"mca:base:select:(%5s) Querying component [%s]",
69-
type_name, component->mca_component_name);
69+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
70+
"mca:base:select:(%5s) Querying component [%s]",
71+
type_name, component->mca_component_name);
7072

7173
component->mca_query_component(&module, &priority);
7274

7375
/*
7476
* If no module was returned, then skip component
7577
*/
7678
if (NULL == module) {
77-
opal_output_verbose(5, output_id,
78-
"mca:base:select:(%5s) Skipping component [%s]. Query failed to return a module",
79-
type_name, component->mca_component_name );
79+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
80+
"mca:base:select:(%5s) Skipping component [%s]. Query failed to return a module",
81+
type_name, component->mca_component_name );
8082
continue;
8183
}
8284

8385
/*
8486
* Determine if this is the best module we have seen by looking the priority
8587
*/
86-
opal_output_verbose(5, output_id,
87-
"mca:base:select:(%5s) Query of component [%s] set priority to %d",
88-
type_name, component->mca_component_name, priority);
88+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
89+
"mca:base:select:(%5s) Query of component [%s] set priority to %d",
90+
type_name, component->mca_component_name, priority);
8991
if (priority > best_priority) {
9092
best_priority = priority;
9193
*best_component = component;
@@ -99,7 +101,7 @@ int mca_base_select(const char *type_name, int output_id,
99101
* Make sure we found something in the process.
100102
*/
101103
if (NULL == *best_component) {
102-
opal_output_verbose(5, output_id,
104+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
103105
"mca:base:select:(%5s) No component selected!",
104106
type_name);
105107
/*
@@ -111,9 +113,9 @@ int mca_base_select(const char *type_name, int output_id,
111113
return OPAL_ERR_NOT_FOUND;
112114
}
113115

114-
opal_output_verbose(5, output_id,
115-
"mca:base:select:(%5s) Selected component [%s]",
116-
type_name, (*best_component)->mca_component_name);
116+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
117+
"mca:base:select:(%5s) Selected component [%s]",
118+
type_name, (*best_component)->mca_component_name);
117119

118120
/*
119121
* Close the non-selected components

opal/mca/base/mca_base_open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ int mca_base_open(void)
140140
gethostname(hostname, 64);
141141
asprintf(&lds.lds_prefix, "[%s:%05d] ", hostname, getpid());
142142
opal_output_reopen(0, &lds);
143-
opal_output_verbose(5, 0, "mca: base: opening components");
143+
opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, 0, "mca: base: opening components");
144144
free(lds.lds_prefix);
145145

146146
/* Open up the component repository */

0 commit comments

Comments
 (0)