2013-04-24 19:59:23 +04:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2012-06-28 22:23:34 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2011 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2015-06-24 06:59:57 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2012-06-28 22:23:34 +04:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2014-10-02 18:31:47 +04:00
|
|
|
* Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved.
|
2015-04-07 23:42:35 +03:00
|
|
|
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
|
2012-06-28 22:23:34 +04:00
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2011-2012 University of Houston. All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2012-06-28 22:23:34 +04:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2012-06-28 22:23:34 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/constants.h"
|
|
|
|
#include "orte/types.h"
|
|
|
|
|
|
|
|
#include "opal/class/opal_pointer_array.h"
|
2013-03-28 01:17:31 +04:00
|
|
|
#include "opal/util/argv.h"
|
2012-06-28 22:23:34 +04:00
|
|
|
#include "opal/runtime/opal_info_support.h"
|
|
|
|
|
2013-03-28 01:17:31 +04:00
|
|
|
#include "orte/include/orte/frameworks.h"
|
2012-06-28 22:23:34 +04:00
|
|
|
#include "orte/util/proc_info.h"
|
|
|
|
#include "orte/runtime/runtime.h"
|
2013-03-28 01:17:31 +04:00
|
|
|
#include "orte/runtime/orte_globals.h"
|
2012-06-28 22:23:34 +04:00
|
|
|
|
|
|
|
#include "orte/runtime/orte_info_support.h"
|
|
|
|
|
|
|
|
const char *orte_info_type_orte = "orte";
|
|
|
|
|
2015-04-07 23:42:35 +03:00
|
|
|
static int orte_info_registered = 0;
|
2013-04-24 19:59:23 +04:00
|
|
|
|
2012-06-28 22:23:34 +04:00
|
|
|
void orte_info_register_types(opal_pointer_array_t *mca_types)
|
|
|
|
{
|
2013-03-28 01:17:31 +04:00
|
|
|
int i;
|
|
|
|
|
|
|
|
/* add the top-level type */
|
2012-06-28 22:23:34 +04:00
|
|
|
opal_pointer_array_add(mca_types, "orte");
|
2013-03-28 01:17:31 +04:00
|
|
|
|
|
|
|
/* push all the types found by autogen */
|
|
|
|
for (i=0; NULL != orte_frameworks[i]; i++) {
|
|
|
|
opal_pointer_array_add(mca_types, orte_frameworks[i]->framework_name);
|
|
|
|
}
|
2012-06-28 22:23:34 +04:00
|
|
|
}
|
|
|
|
|
2013-04-24 19:59:23 +04:00
|
|
|
int orte_info_register_framework_params(opal_pointer_array_t *component_map)
|
|
|
|
{
|
2013-03-28 01:14:43 +04:00
|
|
|
int rc;
|
|
|
|
|
2015-04-07 23:42:35 +03:00
|
|
|
if (orte_info_registered++) {
|
2013-04-24 19:59:23 +04:00
|
|
|
return ORTE_SUCCESS;
|
2013-03-28 01:14:43 +04:00
|
|
|
}
|
|
|
|
|
2012-06-28 22:23:34 +04:00
|
|
|
/* Register the ORTE layer's MCA parameters */
|
2015-06-24 06:59:57 +03:00
|
|
|
|
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
|
|
|
if (ORTE_SUCCESS != (rc = orte_register_params()) &&
|
|
|
|
ORTE_ERR_BAD_PARAM != rc) {
|
2013-04-24 19:59:23 +04:00
|
|
|
fprintf(stderr, "orte_info_register: orte_register_params failed\n");
|
|
|
|
return rc;
|
2012-06-28 22:23:34 +04:00
|
|
|
}
|
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
|
|
|
|
2013-04-24 19:59:23 +04:00
|
|
|
rc = opal_info_register_framework_params(component_map);
|
|
|
|
if (OPAL_SUCCESS != rc) {
|
|
|
|
return rc;
|
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
|
|
|
}
|
|
|
|
|
2013-04-24 19:59:23 +04:00
|
|
|
return opal_info_register_project_frameworks("orte", orte_frameworks, component_map);
|
2012-06-28 22:23:34 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void orte_info_close_components(void)
|
|
|
|
{
|
2013-03-28 01:17:31 +04:00
|
|
|
int i;
|
|
|
|
|
2015-04-07 23:42:35 +03:00
|
|
|
assert (orte_info_registered);
|
|
|
|
if (--orte_info_registered) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-03-28 01:17:31 +04:00
|
|
|
for (i=0; NULL != orte_frameworks[i]; i++) {
|
|
|
|
(void) mca_base_framework_close(orte_frameworks[i]);
|
|
|
|
}
|
2015-04-07 23:42:35 +03:00
|
|
|
|
|
|
|
opal_info_close_components ();
|
2012-06-28 22:23:34 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void orte_info_show_orte_version(const char *scope)
|
|
|
|
{
|
|
|
|
char *tmp, *tmp2;
|
|
|
|
|
|
|
|
asprintf(&tmp, "%s:version:full", orte_info_type_orte);
|
2015-06-24 06:59:57 +03:00
|
|
|
tmp2 = opal_info_make_version_str(scope,
|
|
|
|
ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
|
|
|
|
ORTE_RELEASE_VERSION,
|
2012-06-28 22:23:34 +04:00
|
|
|
ORTE_GREEK_VERSION,
|
2014-10-02 18:31:47 +04:00
|
|
|
ORTE_REPO_REV);
|
2012-06-28 22:23:34 +04:00
|
|
|
opal_info_out("Open RTE", tmp, tmp2);
|
|
|
|
free(tmp);
|
|
|
|
free(tmp2);
|
|
|
|
asprintf(&tmp, "%s:version:repo", orte_info_type_orte);
|
|
|
|
opal_info_out("Open RTE repo revision", tmp, ORTE_REPO_REV);
|
|
|
|
free(tmp);
|
|
|
|
asprintf(&tmp, "%s:version:release_date", orte_info_type_orte);
|
|
|
|
opal_info_out("Open RTE release date", tmp, ORTE_RELEASE_DATE);
|
|
|
|
free(tmp);
|
|
|
|
}
|
|
|
|
|