1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2004-2007 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) 2007 Sun Microsystems, Inc. All rights reserved.
14 * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
15 * reserved.
16 * Copyright (c) 2016 Intel, Inc. All rights reserved.
17 * $COPYRIGHT$
18 *
19 * Additional copyrights may follow
20 *
21 * $HEADER$
22 */
23
24 #include "orte_config.h"
25
26 #include "opal/mca/base/base.h"
27 #include "opal/util/output.h"
28 #include "opal/mca/event/event.h"
29
30 #include "orte/util/proc_info.h"
31
32 #include "orte/mca/iof/base/base.h"
33 #include "iof_hnp.h"
34
35 /*
36 * Local functions
37 */
38 static int orte_iof_hnp_open(void);
39 static int orte_iof_hnp_close(void);
40 static int orte_iof_hnp_query(mca_base_module_t **module, int *priority);
41
42 /*
43 * Public string showing the iof hnp component version number
44 */
45 const char *mca_iof_hnp_component_version_string =
46 "Open MPI hnp iof MCA component version " ORTE_VERSION;
47
48 orte_iof_hnp_component_t mca_iof_hnp_component = {
49 {
50 /* First, the mca_base_component_t struct containing meta
51 information about the component itself */
52
53 .iof_version = {
54 ORTE_IOF_BASE_VERSION_2_0_0,
55
56 .mca_component_name = "hnp",
57 MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
58 ORTE_RELEASE_VERSION),
59
60 /* Component open, close, and query functions */
61 .mca_open_component = orte_iof_hnp_open,
62 .mca_close_component = orte_iof_hnp_close,
63 .mca_query_component = orte_iof_hnp_query,
64 },
65 .iof_data = {
66 /* The component is checkpoint ready */
67 MCA_BASE_METADATA_PARAM_CHECKPOINT
68 },
69 }
70 };
71
72 /**
73 * component open/close/init function
74 */
75 static int orte_iof_hnp_open(void)
76 {
77 /* Nothing to do */
78 return ORTE_SUCCESS;
79 }
80
81
82 static int orte_iof_hnp_close(void)
83 {
84 return ORTE_SUCCESS;
85 }
86
87 /**
88 * Module query
89 */
90
91 static int orte_iof_hnp_query(mca_base_module_t **module, int *priority)
92 {
93 /* if we are not the HNP, then don't use this module */
94 if (!ORTE_PROC_IS_HNP && !ORTE_PROC_IS_MASTER) {
95 *priority = -1;
96 *module = NULL;
97 return ORTE_ERROR;
98 }
99
100 *priority = 100;
101 *module = (mca_base_module_t *) &orte_iof_hnp_module;
102
103 return ORTE_SUCCESS;
104 }