1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
4 * University Research and Technology
5 * Corporation. All rights reserved.
6 * Copyright (c) 2004-2005 The University of Tennessee and The University
7 * of Tennessee Research Foundation. All rights
8 * reserved.
9 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10 * University of Stuttgart. All rights reserved.
11 * Copyright (c) 2004-2005 The Regents of the University of California.
12 * All rights reserved.
13 * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
14 * Copyright (c) 2012-2015 Los Alamos National Security, Inc. All rights
15 * reserved.
16 * $COPYRIGHT$
17 *
18 * Additional copyrights may follow
19 *
20 * $HEADER$
21 */
22
23
24 #include "orte_config.h"
25 #include "orte/constants.h"
26
27 #include <string.h>
28
29 #include "orte/mca/mca.h"
30 #include "opal/mca/base/base.h"
31 #include "opal/util/output.h"
32
33 #include "orte/mca/errmgr/base/base.h"
34 #include "orte/mca/errmgr/base/errmgr_private.h"
35
36 int orte_errmgr_base_select(void)
37 {
38 int exit_status = OPAL_SUCCESS;
39 orte_errmgr_base_component_t *best_component = NULL;
40 orte_errmgr_base_module_t *best_module = NULL;
41
42 /*
43 * Select the best component
44 */
45 if( OPAL_SUCCESS != mca_base_select("errmgr", orte_errmgr_base_framework.framework_output,
46 &orte_errmgr_base_framework.framework_components,
47 (mca_base_module_t **) &best_module,
48 (mca_base_component_t **) &best_component, NULL) ) {
49 /* This will only happen if no component was selected */
50 exit_status = ORTE_ERROR;
51 goto cleanup;
52 }
53
54 /* Save the winner */
55 orte_errmgr = *best_module;
56
57 /* Initialize the winner */
58 if (NULL != best_module) {
59 if (OPAL_SUCCESS != orte_errmgr.init()) {
60 exit_status = OPAL_ERROR;
61 goto cleanup;
62 }
63 }
64
65 cleanup:
66 return exit_status;
67 }