1
1
openmpi/opal/runtime/opal_info_support.h
Jeff Squyres fb2e543a57 Refs trac:3275.
We ran into a case where the OMPI SVN trunk grew a new acceptable MCA
parameter value, but this new value was not accepted on the v1.6
branch (hwloc_base_mem_bind_failure_action -- on the trunk it accepts
the value "silent", but on the older v1.6 branch, it doesn't).  If you
set "hwloc_base_mem_bind_failure_action=silent" in the default MCA
params file and then accidentally ran with the v1.6 branch, every OMPI
executable (including ompi_info) just failed because hwloc_base_open()
would say "hey, 'silent' is not a valid value for
hwloc_base_mem_bind_failure_action!".  Kaboom.

The only problem is that it didn't give you any indication of where
this value was being set.  Quite maddening, from a user perspective.

So we changed the ompi_info handles this case.  If any framework open
function return OMPI_ERR_BAD_PARAM (either because its base MCA params
got a bad value or because one of its component register/open
functions return OMPI_ERR_BAD_PARAM), ompi_info will stop, print out
a warning that it received and error, and then dump out the parameters
that it has received so far in the framework that had a problem.

At a minimum, this will show the user the MCA param that had an error
(it's usually the last one), and ''where it was set from'' (so that
they can go fix it).  

We updated ompi_info to check for O???_ERR_BAD_PARAM from each from
the framework opens.  Also updated the doxygen docs in mca.h for this
O???_BAD_PARAM behavior.  And we noticed that mca.h had MCA_SUCCESS
and MCA_ERR_??? codes.  Why?  I think we used them in exactly one
place in the code base (mca_base_components_open.c).  So we deleted
those and just used the normal OPAL_* codes instead.

While we were doing this, we also cleaned up a little memory
management during ompi_info/orte-info/opal-info finalization.
Valgrind still reports a truckload of memory still in use at ompi_info
termination, but they mostly look to be components not freeing
memory/resources properly (and outside the scope of this fix).

This commit was SVN r27306.

The following Trac tickets were found above:
  Ticket 3275 --> https://svn.open-mpi.org/trac/ompi/ticket/3275
2012-09-11 20:47:24 +00:00

111 строки
3.8 KiB
C

/*
* Copyright (c) 2012 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file **/
#ifndef OPAL_INFO_REGISTER_H
#define OPAL_INFO_REGISTER_H
#include "opal_config.h"
#include "opal/class/opal_list.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/util/cmd_line.h"
#include "opal/mca/base/base.h"
BEGIN_C_DECLS
OPAL_DECLSPEC extern const char *opal_info_path_prefix;
OPAL_DECLSPEC extern const char *opal_info_type_all;
OPAL_DECLSPEC extern const char *opal_info_type_opal;
OPAL_DECLSPEC extern const char *opal_info_component_all;
extern const char *opal_info_param_all;
OPAL_DECLSPEC extern const char *opal_info_ver_full;
extern const char *opal_info_ver_major;
extern const char *opal_info_ver_minor;
extern const char *opal_info_ver_release;
extern const char *opal_info_ver_greek;
extern const char *opal_info_ver_repo;
OPAL_DECLSPEC extern const char *opal_info_ver_all;
extern const char *opal_info_ver_mca;
extern const char *opal_info_ver_type;
extern const char *opal_info_ver_component;
/*
* Component-related functions
*/
typedef struct {
opal_list_item_t super;
char *type;
opal_list_t *components;
} opal_info_component_map_t;
OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_info_component_map_t);
OPAL_DECLSPEC int opal_info_init(int argc, char **argv,
opal_cmd_line_t *opal_info_cmd_line);
OPAL_DECLSPEC void opal_info_finalize(void);
OPAL_DECLSPEC void opal_info_register_types(opal_pointer_array_t *mca_types);
OPAL_DECLSPEC int opal_info_register_components(opal_pointer_array_t *mca_types,
opal_pointer_array_t *component_map);
OPAL_DECLSPEC void opal_info_close_components(void);
OPAL_DECLSPEC void opal_info_err_params(opal_pointer_array_t *component_map);
OPAL_DECLSPEC void opal_info_do_params(bool want_all_in, bool want_internal,
opal_pointer_array_t *mca_type,
opal_cmd_line_t *opal_info_cmd_line);
OPAL_DECLSPEC void opal_info_show_path(const char *type, const char *value);
OPAL_DECLSPEC void opal_info_do_path(bool want_all, opal_cmd_line_t *cmd_line);
OPAL_DECLSPEC void opal_info_show_mca_params(opal_list_t *info,
const char *type,
const char *component,
bool want_internal);
OPAL_DECLSPEC void opal_info_show_mca_version(const mca_base_component_t *component,
const char *scope, const char *ver_type);
OPAL_DECLSPEC void opal_info_show_component_version(opal_pointer_array_t *mca_types,
opal_pointer_array_t *component_map,
const char *type_name,
const char *component_name,
const char *scope, const char *ver_type);
OPAL_DECLSPEC char *opal_info_make_version_str(const char *scope,
int major, int minor, int release,
const char *greek,
bool want_repo, const char *repo);
OPAL_DECLSPEC void opal_info_show_opal_version(const char *scope);
OPAL_DECLSPEC void opal_info_do_arch(void);
OPAL_DECLSPEC void opal_info_do_hostname(void);
OPAL_DECLSPEC void opal_info_out(const char *pretty_message, const char *plain_message, const char *value);
OPAL_DECLSPEC void opal_info_out_int(const char *pretty_message,
const char *plain_message,
int value);
END_C_DECLS
#endif