1
1

Combination of some changes by both Jeff and I. Few minor cleanups to the code (e.g., allow options to show-mca-params to be either case), and an enhancement that allows the user to specify multiple options separated by commas (e.g., "env,api").

This commit was SVN r19124.
Этот коммит содержится в:
Ralph Castain 2008-08-02 00:43:27 +00:00
родитель 5b2f53a069
Коммит fdde3de903
4 изменённых файлов: 40 добавлений и 14 удалений

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

@ -31,6 +31,7 @@
#include "ompi/datatype/datatype.h"
#include "orte/util/show_help.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/util/argv.h"
/*
* Global variables
@ -140,23 +141,40 @@ int ompi_mpi_register_params(void)
/* Whether or not to print all MCA parameters in MPI_INIT */
mca_base_param_reg_string_name("mpi", "show_mca_params",
"Whether to show all MCA parameter values during MPI_INIT or not (good for reproducability of MPI jobs "
"for debug purposes). Accepted values are all, default, file, api, and enviro",
"for debug purposes). Accepted values are all, default, file, api, and enviro - or a comma "
"delimited combination of them",
false, false, NULL, &param);
if (NULL != param) {
char **args;
int i;
ompi_mpi_show_mca_params = true;
if (0 == strcmp(param, "all")) {
args = opal_argv_split(param, ',');
if (NULL == args) {
opal_output(0, "WARNING: could not parse mpi_show_mca_params request - defaulting to show \"all\"");
show_default_mca_params = true;
show_file_mca_params = true;
show_enviro_mca_params = true;
show_override_mca_params = true;
} else if (0 == strcmp(param, "default")) {
show_default_mca_params = true;
} else if (0 == strcmp(param, "file")) {
show_file_mca_params = true;
} else if (0 == strcmp(param, "enviro")) {
show_enviro_mca_params = true;
} else if (0 == strcmp(param, "api")) {
show_override_mca_params = true;
} else {
for (i=0; NULL != args[i]; i++) {
if (0 == strcasecmp(args[i], "all") || 0 == strcmp(args[i], "1")) {
show_default_mca_params = true;
show_file_mca_params = true;
show_enviro_mca_params = true;
show_override_mca_params = true;
} else if (0 == strcasecmp(args[i], "default")) {
show_default_mca_params = true;
} else if (0 == strcasecmp(args[i], "file")) {
show_file_mca_params = true;
} else if (0 == strcasecmp(args[i], "enviro") ||
0 == strcasecmp(args[i], "env")) {
show_enviro_mca_params = true;
} else if (0 == strcasecmp(args[i], "api")) {
show_override_mca_params = true;
}
}
opal_argv_free(args);
}
}
@ -319,6 +337,11 @@ int ompi_show_all_mca_params(int32_t rank, int requested, char *nodename) {
i = opal_list_get_next(i)) {
item = (mca_base_param_info_t*) i;
/* If this is an internal param, don't print it */
if (item->mbpp_internal) {
continue;
}
/* get the source - where the param was last set */
if (OPAL_SUCCESS !=
mca_base_param_lookup_source(item->mbpp_index, &source, &src_file)) {

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

@ -299,9 +299,8 @@ void ompi_info::show_mca_params(opal_list_t *info,
content = "environment";
break;
case MCA_BASE_PARAM_SOURCE_FILE:
content = "file [";
content = "file:";
content += src_file;
content += "]";
break;
case MCA_BASE_PARAM_SOURCE_OVERRIDE:
content = "API override";

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

@ -750,6 +750,7 @@ int mca_base_param_dump(opal_list_t **info, bool internal)
p->mbpp_param_name = array[i].mbp_param_name;
p->mbpp_full_name = array[i].mbp_full_name;
p->mbpp_deprecated = array[i].mbp_deprecated;
p->mbpp_internal = array[i].mbp_internal;
p->mbpp_read_only = array[i].mbp_read_only;
p->mbpp_type = array[i].mbp_type;
p->mbpp_help_msg = array[i].mbp_help_msg;
@ -784,6 +785,7 @@ int mca_base_param_dump(opal_list_t **info, bool internal)
q->mbpp_full_name = si->si_full_name;
q->mbpp_deprecated = si->si_deprecated ||
array[i].mbp_deprecated;
q->mbpp_internal = array[i].mbp_internal;
q->mbpp_read_only = array[i].mbp_read_only;
q->mbpp_type = array[i].mbp_type;
q->mbpp_help_msg = array[i].mbp_help_msg;

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

@ -118,7 +118,7 @@ struct mca_base_param_info_t {
/** Full, assembled parameter name */
char *mbpp_full_name;
/** Is this value deprecated? */
/** Is this parameter deprecated? */
bool mbpp_deprecated;
/** Array of pointers of synonyms of this parameter */
@ -129,7 +129,9 @@ struct mca_base_param_info_t {
param is a synonym of (or NULL) */
struct mca_base_param_info_t *mbpp_synonym_parent;
/** Is this value changable? */
/** Is this parameter internal? */
bool mbpp_internal;
/** Is this parameter changable? */
bool mbpp_read_only;
/** Help message associated with this parameter */
char *mbpp_help_msg;