1
1

Have ompi_info also output where the value was set from (default,

environment, file, or API override).

Refs trac:1397

This commit was SVN r18943.

The following Trac tickets were found above:
  Ticket 1397 --> https://svn.open-mpi.org/trac/ompi/ticket/1397
Этот коммит содержится в:
Jeff Squyres 2008-07-18 10:52:21 +00:00
родитель 9c080b27d6
Коммит e28f71f6e6

Просмотреть файл

@ -149,6 +149,7 @@ void ompi_info::show_mca_params(opal_list_t *info,
char *value_string, empty[] = "\0";
string message, content, tmp;
int value_int, j;
mca_base_param_source_t source;
for (i = opal_list_get_first(info); i != opal_list_get_last(info);
i = opal_list_get_next(i)) {
@ -160,6 +161,12 @@ void ompi_info::show_mca_params(opal_list_t *info,
(NULL != p->mbpp_component_name &&
component == p->mbpp_component_name)) {
// Find the source of the value
if (OPAL_SUCCESS !=
mca_base_param_lookup_source(p->mbpp_index, &source)) {
continue;
}
// Make a string for the default value. Invoke a
// lookup because it may transform the string ("~/" ->
// "<home dir>/") or get the value from the
@ -205,6 +212,25 @@ void ompi_info::show_mca_params(opal_list_t *info,
content += "\"";
}
// Indicate where the param was set from
content += ", data source: ";
switch(source) {
case MCA_BASE_PARAM_SOURCE_DEFAULT:
content += "default value";
break;
case MCA_BASE_PARAM_SOURCE_ENV:
content += "environment";
break;
case MCA_BASE_PARAM_SOURCE_FILE:
content += "file";
break;
case MCA_BASE_PARAM_SOURCE_OVERRIDE:
content += "API override";
break;
default:
break;
}
// Is this parameter deprecated?
if (p->mbpp_deprecated) {
content += ", deprecated";
@ -258,6 +284,28 @@ void ompi_info::show_mca_params(opal_list_t *info,
content = value_string;
out(message, message, content);
// Indicate where the param was set from
message = tmp;
message += "data_source";
switch(source) {
case MCA_BASE_PARAM_SOURCE_DEFAULT:
content = "default value";
break;
case MCA_BASE_PARAM_SOURCE_ENV:
content = "environment";
break;
case MCA_BASE_PARAM_SOURCE_FILE:
content = "file";
break;
case MCA_BASE_PARAM_SOURCE_OVERRIDE:
content = "API override";
break;
default:
break;
}
out(message, message, content);
// Output whether it's read only or writable
message = tmp;