2
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
3
* University Research and Technology
4
* Corporation. All rights reserved.
5
* Copyright (c) 2004-2005 The University of Tennessee and The University
6
* of Tennessee Research Foundation. All rights
8
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9
* University of Stuttgart. All rights reserved.
10
* Copyright (c) 2004-2005 The Regents of the University of California.
11
* All rights reserved.
14
* Additional copyrights may follow
21
#ifndef MCA_PLS_BASE_H
22
#define MCA_PLS_BASE_H
27
#include "orte_config.h"
28
#include "opal/mca/mca.h"
29
#include "orte/mca/pls/pls.h"
30
#include "orte/mca/ras/base/ras_base_node.h"
33
#if defined(c_plusplus) || defined(__cplusplus)
38
* Struct to hold data globale to the pls framework
40
typedef struct orte_pls_base_t {
41
/** Verbose/debug output stream */
43
/** List of opened components */
44
opal_list_t pls_opened;
45
/** Whether the list of opened components is valid */
46
bool pls_opened_valid;
47
/** Sorted list of available components (highest priority first) */
48
opal_list_t pls_available;
49
/** Whether the list of available components is valid */
50
bool pls_available_valid;
54
* Global instance of pls-wide framework data
56
OMPI_DECLSPEC extern orte_pls_base_t orte_pls_base;
59
* pls component/module/priority tuple
61
struct orte_pls_base_cmp_t {
63
opal_list_item_t super;
65
orte_pls_base_component_t *component;
67
orte_pls_base_module_t* module;
68
/** This component's priority */
71
/** Convenience typedef */
72
typedef struct orte_pls_base_cmp_t orte_pls_base_cmp_t;
73
/** Class declaration */
74
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(orte_pls_base_cmp_t);
77
* Global functions for MCA overall collective open and close
81
* Open the pls framework
83
OMPI_DECLSPEC int orte_pls_base_open(void);
87
OMPI_DECLSPEC orte_pls_base_module_t *orte_pls_base_select(char *preferred);
89
* Close the pls framework
91
OMPI_DECLSPEC int orte_pls_base_finalize(void);
92
OMPI_DECLSPEC int orte_pls_base_close(void);
94
* Utility routine to get/set procesS pid
96
OMPI_DECLSPEC int orte_pls_base_set_proc_pid(const orte_process_name_t*, pid_t);
97
OMPI_DECLSPEC int orte_pls_base_get_proc_pid(const orte_process_name_t*, pid_t*);
99
* Utility routine to retreive all process pids w/in a specified job.
101
OMPI_DECLSPEC int orte_pls_base_get_proc_pids(orte_jobid_t jobid, pid_t** pids, size_t* num_pids);
103
* Utility routine to get/set daemon pid
105
OMPI_DECLSPEC int orte_pls_base_set_node_pid(orte_cellid_t cellid, char* node_name, orte_jobid_t jobid, pid_t pid);
106
OMPI_DECLSPEC int orte_pls_base_get_node_pids(orte_jobid_t jobid, pid_t** pids, size_t* num_pids);
109
* Utility routine to set progress engine schedule
111
OMPI_DECLSPEC int orte_pls_base_set_progress_sched(int sched);
115
* Utilities for pls components that use proxy daemons
117
int orte_pls_base_proxy_set_node_name(orte_ras_node_t* node,
119
orte_process_name_t* name);
120
int orte_pls_base_proxy_mca_argv(int *argc, char ***argv);
121
int orte_pls_base_proxy_terminate_job(orte_jobid_t jobid);
122
int orte_pls_base_proxy_terminate_proc(const orte_process_name_t *proc);
125
* Check that the cwd in an app context exists and is accessible.
126
* If the user specified the cwd and we can chdir to it, print an
127
* error and fail. If the user didn't specify it (i.e., it's a
128
* default), then see if chdir($HOME) would succeed.
130
* If either chdir() would succeed and do_chdir is true, then
131
* actually do the chdir().
133
* If we fall back to the chdir($HOME), set context->cwd to be a
134
* string pointing to the home directory name (owned by the
135
* context; safe to free at destruction).
137
int orte_pls_base_check_context_cwd(orte_app_context_t *context,
141
* Check that the app exists and is executable. If it is not,
142
* print and error and fail. If it is, and if the app was a naked
143
* executable (i.e., no relative or absolute path), replace the
144
* app with the string containing the absolute pathname to the
145
* exectuable (owned by the context; safe to free at destruction).
147
int orte_pls_base_check_context_app(orte_app_context_t *context);
148
#if defined(c_plusplus) || defined(__cplusplus)