2005-01-21 17:49:14 +00:00
|
|
|
/*
|
2010-03-23 21:28:02 +00:00
|
|
|
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
|
2005-11-05 19:57:48 +00:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-01-21 17:49:14 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2012-06-27 01:28:28 +00:00
|
|
|
* Copyright (c) 2010-2011 Oak Ridge National Labs. All rights reserved.
|
2012-04-06 14:23:13 +00:00
|
|
|
* Copyright (c) 2011 Los Alamos National Security, LLC.
|
|
|
|
* All rights reserved.
|
2005-01-21 17:49:14 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
#include "orte_config.h"
|
2008-02-28 01:57:57 +00:00
|
|
|
#include "orte/constants.h"
|
2005-01-21 17:49:14 +00:00
|
|
|
|
2010-03-23 21:28:02 +00:00
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
#include <string.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
2010-03-23 21:28:02 +00:00
|
|
|
|
|
|
|
#include "opal/util/opal_environ.h"
|
|
|
|
#include "opal/util/output.h"
|
2005-09-19 15:29:14 +00:00
|
|
|
#include "opal/util/trace.h"
|
2009-02-14 02:26:12 +00:00
|
|
|
#include "opal/util/output.h"
|
2005-01-21 17:49:14 +00:00
|
|
|
|
2010-04-28 04:06:57 +00:00
|
|
|
#include "orte/util/show_help.h"
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/mca/errmgr/base/base.h"
|
2006-09-14 21:29:51 +00:00
|
|
|
#include "orte/mca/errmgr/base/errmgr_private.h"
|
2005-01-21 17:49:14 +00:00
|
|
|
|
2005-07-04 18:24:58 +00:00
|
|
|
#include "orte/mca/errmgr/base/static-components.h"
|
2005-01-21 17:49:14 +00:00
|
|
|
|
|
|
|
/*
|
2010-03-23 21:28:02 +00:00
|
|
|
* Globals
|
2005-01-21 17:49:14 +00:00
|
|
|
*/
|
2010-03-23 21:28:02 +00:00
|
|
|
opal_list_t orte_errmgr_base_components_available;
|
2005-01-21 17:49:14 +00:00
|
|
|
|
2010-04-26 22:15:57 +00:00
|
|
|
orte_errmgr_base_t orte_errmgr_base;
|
|
|
|
|
2010-08-19 13:09:20 +00:00
|
|
|
orte_errmgr_base_component_t orte_errmgr_base_selected_component;
|
|
|
|
|
2011-06-23 20:38:02 +00:00
|
|
|
orte_errmgr_fault_callback_t *fault_cbfunc;
|
|
|
|
|
2010-03-23 21:28:02 +00:00
|
|
|
/* Public module provides a wrapper around previous functions */
|
2011-08-18 16:24:45 +00:00
|
|
|
orte_errmgr_base_module_t orte_errmgr_default_fns = {
|
2010-08-19 13:09:20 +00:00
|
|
|
NULL, /* init */
|
|
|
|
NULL, /* finalize */
|
2010-04-05 22:59:21 +00:00
|
|
|
orte_errmgr_base_log,
|
2010-08-19 13:09:20 +00:00
|
|
|
orte_errmgr_base_abort,
|
2011-06-15 13:10:13 +00:00
|
|
|
orte_errmgr_base_abort_peers,
|
2010-08-19 13:09:20 +00:00
|
|
|
NULL, /* predicted_fault */
|
|
|
|
NULL, /* suggest_map_targets */
|
2011-02-18 02:48:12 +00:00
|
|
|
NULL, /* ft_event */
|
2012-06-27 01:28:28 +00:00
|
|
|
orte_errmgr_base_register_migration_warning
|
2010-03-23 21:28:02 +00:00
|
|
|
};
|
2011-10-14 18:45:11 +00:00
|
|
|
/* NOTE: ABSOLUTELY MUST initialize this
|
|
|
|
* struct to include the log function as it
|
|
|
|
* gets called even if the errmgr hasn't been
|
|
|
|
* opened yet due to error
|
|
|
|
*/
|
|
|
|
orte_errmgr_base_module_t orte_errmgr = {
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
orte_errmgr_base_log,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
};
|
2005-01-21 17:49:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function for finding and opening either all MCA components, or the one
|
|
|
|
* that was specifically requested via a MCA parameter.
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_errmgr_base_open(void)
|
2005-01-21 17:49:14 +00:00
|
|
|
{
|
2005-09-19 15:29:14 +00:00
|
|
|
OPAL_TRACE(5);
|
2005-03-24 20:23:15 +00:00
|
|
|
|
2010-03-23 21:28:02 +00:00
|
|
|
/* Only pass this way once */
|
2010-04-26 22:15:57 +00:00
|
|
|
if( orte_errmgr_base.initialized ) {
|
2010-03-23 21:28:02 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2010-04-26 22:15:57 +00:00
|
|
|
orte_errmgr_base.output = opal_output_open(NULL);
|
2010-03-23 21:28:02 +00:00
|
|
|
|
2011-08-18 16:24:45 +00:00
|
|
|
/* load the default fns */
|
|
|
|
orte_errmgr = orte_errmgr_default_fns;
|
|
|
|
|
2010-03-23 21:28:02 +00:00
|
|
|
/*
|
|
|
|
* Open up all available components
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS !=
|
|
|
|
mca_base_components_open("errmgr",
|
2010-04-26 22:15:57 +00:00
|
|
|
orte_errmgr_base.output,
|
2010-03-23 21:28:02 +00:00
|
|
|
mca_errmgr_base_static_components,
|
|
|
|
&orte_errmgr_base_components_available,
|
|
|
|
true)) {
|
|
|
|
return ORTE_ERROR;
|
2005-03-14 20:57:21 +00:00
|
|
|
}
|
|
|
|
|
2010-04-26 22:15:57 +00:00
|
|
|
orte_errmgr_base.initialized = true;
|
2005-08-15 18:25:35 +00:00
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
2005-01-21 17:49:14 +00:00
|
|
|
}
|