1
1
openmpi/opal/runtime/opal_info_support.h

114 строки
4.0 KiB
C
Исходник Обычный вид История

/*
* Copyright (c) 2012-2013 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_framework_params(opal_pointer_array_t *component_map);
OPAL_DECLSPEC void opal_info_close_components(void);
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-12 00:47:24 +04:00
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);
MCA/base: Add new MCA variable system Features: - Support for an override parameter file (openmpi-mca-param-override.conf). Variable values in this file can not be overridden by any file or environment value. - Support for boolean, unsigned, and unsigned long long variables. - Support for true/false values. - Support for enumerations on integer variables. - Support for MPIT scope, verbosity, and binding. - Support for command line source. - Support for setting variable source via the environment using OMPI_MCA_SOURCE_<var name>=source (either command or file:filename) - Cleaner API. - Support for variable groups (equivalent to MPIT categories). Notes: - Variables must be created with a backing store (char **, int *, or bool *) that must live at least as long as the variable. - Creating a variable with the MCA_BASE_VAR_FLAG_SETTABLE enables the use of mca_base_var_set_value() to change the value. - String values are duplicated when the variable is registered. It is up to the caller to free the original value if necessary. The new value will be freed by the mca_base_var system and must not be freed by the user. - Variables with constant scope may not be settable. - Variable groups (and all associated variables) are deregistered when the component is closed or the component repository item is freed. This prevents a segmentation fault from accessing a variable after its component is unloaded. - After some discussion we decided we should remove the automatic registration of component priority variables. Few component actually made use of this feature. - The enumerator interface was updated to be general enough to handle future uses of the interface. - The code to generate ompi_info output has been moved into the MCA variable system. See mca_base_var_dump(). opal: update core and components to mca_base_var system orte: update core and components to mca_base_var system ompi: update core and components to mca_base_var system This commit also modifies the rmaps framework. The following variables were moved from ppr and lama: rmaps_base_pernode, rmaps_base_n_pernode, rmaps_base_n_persocket. Both lama and ppr create synonyms for these variables. This commit was SVN r28236.
2013-03-28 01:09:41 +04:00
OPAL_DECLSPEC void opal_info_show_mca_params(const char *type,
const char *component,
mca_base_var_info_lvl_t max_level,
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);
OPAL_DECLSPEC int opal_info_register_project_frameworks (const char *project_name,
mca_base_framework_t **frameworks,
opal_pointer_array_t *component_map);
END_C_DECLS
#endif