1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
4 * University Research and Technology
5 * Corporation. All rights reserved.
6 * Copyright (c) 2004-2006 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) 2015 Los Alamos National Security, LLC. All rights
14 * reserved.
15 * Copyright (c) 2017 Intel, Inc. All rights reserved.
16 * $COPYRIGHT$
17 *
18 * Additional copyrights may follow
19 *
20 * $HEADER$
21 *
22 * These symbols are in a file by themselves to provide nice linker
23 * semantics. Since linkers generally pull in symbols by object
24 * files, keeping these symbols as the only symbols in this file
25 * prevents utility programs such as "ompi_info" from having to import
26 * entire components just to query their version and parameters.
27 */
28
29 #include "orte_config.h"
30 #include "orte/constants.h"
31
32 #include <stdlib.h>
33 #ifdef HAVE_UNISTD_H
34 #include <unistd.h>
35 #endif
36 #include <ctype.h>
37
38 #include "orte/mca/mca.h"
39 #include "opal/mca/base/base.h"
40
41 #include "orte/mca/odls/odls.h"
42 #include "orte/mca/odls/base/odls_private.h"
43 #include "orte/mca/odls/pspawn/odls_pspawn.h"
44
45 /*
46 * Instantiate the public struct with all of our public information
47 * and pointers to our public functions in it
48 */
49
50 static int component_open(void);
51 static int component_close(void);
52 static int component_query(mca_base_module_t **module, int *priority);
53
54
55 orte_odls_base_component_t mca_odls_pspawn_component = {
56 /* First, the mca_component_t struct containing meta information
57 about the component itself */
58 .version = {
59 ORTE_ODLS_BASE_VERSION_2_0_0,
60 /* Component name and version */
61 .mca_component_name = "pspawn",
62 MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
63 ORTE_RELEASE_VERSION),
64
65 /* Component open and close functions */
66 .mca_open_component = component_open,
67 .mca_close_component = component_close,
68 .mca_query_component = component_query,
69 },
70 .base_data = {
71 /* The component is checkpoint ready */
72 MCA_BASE_METADATA_PARAM_CHECKPOINT
73 },
74 };
75
76
77
78 static int component_open(void)
79 {
80 return ORTE_SUCCESS;
81 }
82
83 static int component_query(mca_base_module_t **module, int *priority)
84 {
85 /* the base open/select logic protects us against operation when
86 * we are NOT in a daemon, so we don't have to check that here
87 */
88
89 /* we have built some logic into the configure.m4 file that checks
90 * to see if we have "posix_spawn" support and only builds this component
91 * if we do. Hence, we only get here if we CAN build - in which
92 * case, we only should be considered for selection if specified
93 */
94 *priority = 1; /* let others override us */
95 *module = (mca_base_module_t *) &orte_odls_pspawn_module;
96 return ORTE_SUCCESS;
97 }
98
99
100 static int component_close(void)
101 {
102 return ORTE_SUCCESS;
103 }