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-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) 2015 Los Alamos National Security, LLC. All rights
14 * reserved.
15 * $COPYRIGHT$
16 *
17 * Additional copyrights may follow
18 *
19 * $HEADER$
20 *
21 * These symbols are in a file by themselves to provide nice linker
22 * semantics. Since linkers generally pull in symbols by object
23 * files, keeping these symbols as the only symbols in this file
24 * prevents utility programs such as "ompi_info" from having to import
25 * entire components just to query their version and parameters.
26 */
27
28 #include "orte_config.h"
29 #include "orte/constants.h"
30
31 #include "orte/util/proc_info.h"
32
33 #include "orte/mca/ess/ess.h"
34 #include "orte/mca/ess/tm/ess_tm.h"
35
36 extern orte_ess_base_module_t orte_ess_tm_module;
37
38 /*
39 * Instantiate the public struct with all of our public information
40 * and pointers to our public functions in it
41 */
42 orte_ess_base_component_t mca_ess_tm_component = {
43 .base_version = {
44 ORTE_ESS_BASE_VERSION_3_0_0,
45
46 /* Component name and version */
47 .mca_component_name = "tm",
48 MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
49 ORTE_RELEASE_VERSION),
50
51 /* Component open and close functions */
52 .mca_open_component = orte_ess_tm_component_open,
53 .mca_close_component = orte_ess_tm_component_close,
54 .mca_query_component = orte_ess_tm_component_query,
55 },
56 .base_data = {
57 /* The component is checkpoint ready */
58 MCA_BASE_METADATA_PARAM_CHECKPOINT
59 },
60 };
61
62
63 int
64 orte_ess_tm_component_open(void)
65 {
66 return ORTE_SUCCESS;
67 }
68
69
70 int orte_ess_tm_component_query(mca_base_module_t **module, int *priority)
71 {
72 /* Are we running under a TM job? Were
73 * we given a path back to the HNP? If the
74 * answer to both is "yes", then we were launched
75 * by mpirun in a tm world
76 */
77
78 if (ORTE_PROC_IS_DAEMON &&
79 NULL != getenv("PBS_JOBID") &&
80 NULL != orte_process_info.my_hnp_uri) {
81 *priority = 30;
82 *module = (mca_base_module_t *)&orte_ess_tm_module;
83 return ORTE_SUCCESS;
84 }
85
86 /* Sadly, no */
87 *priority = -1;
88 *module = NULL;
89 return ORTE_ERROR;
90 }
91
92
93 int
94 orte_ess_tm_component_close(void)
95 {
96 return ORTE_SUCCESS;
97 }
98