Warning, file /include/prte/src/mca/odls/base/base.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #ifndef MCA_ODLS_BASE_H
0026 #define MCA_ODLS_BASE_H
0027
0028
0029
0030
0031 #include "prte_config.h"
0032
0033 #include "src/mca/mca.h"
0034 #include "src/mca/base/pmix_mca_base_framework.h"
0035 #include "src/mca/iof/base/iof_base_setup.h"
0036 #include "src/mca/odls/odls.h"
0037
0038 BEGIN_C_DECLS
0039
0040
0041
0042
0043
0044 typedef struct {
0045
0046 int output;
0047
0048 pmix_list_t xterm_ranks;
0049
0050 char **xtermcmd;
0051
0052 int max_threads;
0053 int num_threads;
0054 int cutoff;
0055 prte_event_base_t **ev_bases;
0056 char **ev_threads;
0057 int next_base;
0058 bool signal_direct_children_only;
0059 pmix_lock_t lock;
0060 char *exec_agent;
0061 } prte_odls_globals_t;
0062
0063 PRTE_EXPORT extern prte_odls_globals_t prte_odls_globals;
0064
0065
0066
0067
0068 PRTE_EXPORT extern pmix_mca_base_framework_t prte_odls_base_framework;
0069
0070
0071
0072 PRTE_EXPORT int prte_odls_base_select(void);
0073
0074
0075
0076
0077
0078
0079 PRTE_EXPORT int prte_odls_base_default_get_add_procs_data(pmix_data_buffer_t *data,
0080 pmix_nspace_t job);
0081
0082 PRTE_EXPORT int prte_odls_base_default_construct_child_list(pmix_data_buffer_t *data,
0083 pmix_nspace_t *job);
0084
0085 PRTE_EXPORT void prte_odls_base_spawn_proc(int fd, short sd, void *cbdata);
0086
0087
0088 typedef int (*prte_odls_base_fork_local_proc_fn_t)(void *cd);
0089
0090
0091 typedef struct {
0092 pmix_object_t super;
0093 prte_event_t ev;
0094 char *cmd;
0095 char *wdir;
0096 char **argv;
0097 char **env;
0098 prte_job_t *jdata;
0099 prte_app_context_t *app;
0100 prte_proc_t *child;
0101 bool index_argv;
0102 prte_iof_base_io_conf_t opts;
0103 prte_odls_base_fork_local_proc_fn_t fork_local;
0104 } prte_odls_spawn_caddy_t;
0105 PMIX_CLASS_DECLARATION(prte_odls_spawn_caddy_t);
0106
0107
0108 typedef struct {
0109 pmix_object_t object;
0110 prte_event_t *ev;
0111 pmix_nspace_t job;
0112 prte_odls_base_fork_local_proc_fn_t fork_local;
0113 int retries;
0114 } prte_odls_launch_local_t;
0115 PRTE_EXPORT PMIX_CLASS_DECLARATION(prte_odls_launch_local_t);
0116
0117 #define PRTE_ACTIVATE_LOCAL_LAUNCH(j, f) \
0118 do { \
0119 prte_odls_launch_local_t *ll; \
0120 ll = PMIX_NEW(prte_odls_launch_local_t); \
0121 PMIX_LOAD_NSPACE(ll->job, (j)); \
0122 ll->fork_local = (f); \
0123 prte_event_set(prte_event_base, ll->ev, -1, PRTE_EV_WRITE, \
0124 prte_odls_base_default_launch_local, ll); \
0125 prte_event_active(ll->ev, PRTE_EV_WRITE, 1); \
0126 } while (0);
0127
0128 PRTE_EXPORT void prte_odls_base_default_launch_local(int fd, short sd, void *cbdata);
0129
0130 PRTE_EXPORT void prte_odls_base_default_wait_local_proc(int fd, short sd, void *cbdata);
0131
0132
0133 typedef int (*prte_odls_base_signal_local_fn_t)(pid_t pid, int signum);
0134
0135 PRTE_EXPORT int
0136 prte_odls_base_default_signal_local_procs(const pmix_proc_t *proc, int32_t signal,
0137 prte_odls_base_signal_local_fn_t signal_local);
0138
0139
0140 typedef int (*prte_odls_base_kill_local_fn_t)(pid_t pid, int signum);
0141
0142
0143 typedef bool (*prte_odls_base_child_died_fn_t)(prte_proc_t *child);
0144
0145 PRTE_EXPORT int prte_odls_base_default_kill_local_procs(pmix_pointer_array_t *procs,
0146 prte_odls_base_kill_local_fn_t kill_local);
0147
0148 PRTE_EXPORT int prte_odls_base_default_restart_proc(prte_proc_t *child,
0149 prte_odls_base_fork_local_proc_fn_t fork_local);
0150
0151
0152
0153
0154 PRTE_EXPORT int prte_odls_base_preload_files_app_context(prte_app_context_t *context);
0155
0156 PRTE_EXPORT void prte_odls_base_start_threads(prte_job_t *jdata);
0157
0158 PRTE_EXPORT void prte_odls_base_harvest_threads(void);
0159
0160 #define PRTE_ODLS_SET_ERROR(ns, s, j) \
0161 do { \
0162 int _idx; \
0163 prte_proc_t *_cld; \
0164 unsigned int _j = (unsigned int)j; \
0165 for (_idx = 0; _idx < prte_local_children->size; _idx++) { \
0166 _cld = (prte_proc_t *) pmix_pointer_array_get_item(prte_local_children, _idx); \
0167 if (NULL == _cld) { \
0168 continue; \
0169 } \
0170 if (PMIX_CHECK_NSPACE(ns, _cld->name.nspace) && \
0171 (UINT_MAX == _j || _j == _cld->app_idx)) { \
0172 _cld->exit_code = s; \
0173 PRTE_ACTIVATE_PROC_STATE(&_cld->name, PRTE_PROC_STATE_FAILED_TO_LAUNCH); \
0174 } \
0175 } \
0176 } while(0)
0177
0178 END_C_DECLS
0179 #endif