1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2004-2008 The Trustees of Indiana University.
4 * All rights reserved.
5 * Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
6 * All rights reserved.
7 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
8 * University of Stuttgart. All rights reserved.
9 * Copyright (c) 2004-2005 The Regents of the University of California.
10 * All rights reserved.
11 * Copyright (c) 2012-2015 Los Alamos National Security, LLC.
12 * All rights reserved
13 * $COPYRIGHT$
14 *
15 * Additional copyrights may follow
16 *
17 * $HEADER$
18 */
19
20 #include "orte_config.h"
21
22 #include <string.h>
23
24 #include "orte/constants.h"
25
26 #include "orte/mca/mca.h"
27 #include "opal/util/output.h"
28 #include "opal/mca/base/base.h"
29
30 #include "orte/mca/filem/filem.h"
31 #include "orte/mca/filem/base/base.h"
32
33
34 int orte_filem_base_select(void)
35 {
36 int exit_status = ORTE_SUCCESS;
37 orte_filem_base_component_t *best_component = NULL;
38 orte_filem_base_module_t *best_module = NULL;
39
40 /*
41 * Select the best component
42 */
43 if( OPAL_SUCCESS != mca_base_select("filem", orte_filem_base_framework.framework_output,
44 &orte_filem_base_framework.framework_components,
45 (mca_base_module_t **) &best_module,
46 (mca_base_component_t **) &best_component, NULL) ) {
47 /* It is okay to not select anything - we'll just retain
48 * the default none module
49 */
50 return ORTE_SUCCESS;
51 }
52
53 /* Save the winner */
54 orte_filem = *best_module;
55
56 /* Initialize the winner */
57 if (NULL != orte_filem.filem_init) {
58 if (ORTE_SUCCESS != orte_filem.filem_init()) {
59 exit_status = ORTE_ERROR;
60 }
61 }
62
63 return exit_status;
64 }