1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #ifndef PMIX_PNET_BASE_H_
25 #define PMIX_PNET_BASE_H_
26
27 #include <src/include/pmix_config.h>
28
29
30 #ifdef HAVE_SYS_TIME_H
31 #include <sys/time.h>
32 #endif
33 #ifdef HAVE_STRING_H
34 #include <string.h>
35 #endif
36
37 #include "src/class/pmix_list.h"
38 #include "src/class/pmix_pointer_array.h"
39 #include "src/mca/mca.h"
40 #include "src/mca/base/pmix_mca_base_framework.h"
41
42 #include "src/mca/pnet/pnet.h"
43
44
45 BEGIN_C_DECLS
46
47
48
49
50 PMIX_EXPORT extern pmix_mca_base_framework_t pmix_pnet_base_framework;
51
52
53
54
55
56
57 PMIX_EXPORT pmix_status_t pmix_pnet_base_select(void);
58
59
60
61
62 struct pmix_pnet_base_active_module_t {
63 pmix_list_item_t super;
64 int pri;
65 pmix_pnet_module_t *module;
66 pmix_pnet_base_component_t *component;
67 };
68 typedef struct pmix_pnet_base_active_module_t pmix_pnet_base_active_module_t;
69 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_pnet_base_active_module_t);
70
71 typedef struct {
72 pmix_list_item_t super;
73 char *nspace;
74 pmix_rank_t *ranks;
75 size_t np;
76 } pmix_pnet_local_procs_t;
77 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_pnet_local_procs_t);
78
79 typedef struct {
80 pmix_list_item_t super;
81 char *name;
82 pmix_list_t resources;
83 }pmix_pnet_resource_t;
84 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_pnet_resource_t);
85
86 typedef struct {
87 pmix_list_item_t super;
88 size_t index;
89 char *name;
90 pmix_list_t local_jobs;
91 pmix_list_t resources;
92 } pmix_pnet_node_t;
93 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_pnet_node_t);
94
95 typedef struct {
96 pmix_list_item_t super;
97 char *nspace;
98 pmix_pointer_array_t nodes;
99 } pmix_pnet_job_t;
100 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_pnet_job_t);
101
102
103 struct pmix_pnet_globals_t {
104 pmix_lock_t lock;
105 pmix_list_t actives;
106 bool initialized;
107 pmix_list_t jobs;
108 pmix_list_t nodes;
109 };
110 typedef struct pmix_pnet_globals_t pmix_pnet_globals_t;
111
112 PMIX_EXPORT extern pmix_pnet_globals_t pmix_pnet_globals;
113
114 PMIX_EXPORT pmix_status_t pmix_pnet_base_allocate(char *nspace,
115 pmix_info_t info[], size_t ninfo,
116 pmix_list_t *ilist);
117 PMIX_EXPORT pmix_status_t pmix_pnet_base_setup_local_network(char *nspace,
118 pmix_info_t info[],
119 size_t ninfo);
120 PMIX_EXPORT pmix_status_t pmix_pnet_base_setup_fork(const pmix_proc_t *peer, char ***env);
121 PMIX_EXPORT void pmix_pnet_base_child_finalized(pmix_proc_t *peer);
122 PMIX_EXPORT void pmix_pnet_base_local_app_finalized(pmix_namespace_t *nptr);
123 PMIX_EXPORT void pmix_pnet_base_deregister_nspace(char *nspace);
124 PMIX_EXPORT void pmix_pnet_base_collect_inventory(pmix_info_t directives[], size_t ndirs,
125 pmix_inventory_cbfunc_t cbfunc,
126 void *cbdata);
127 PMIX_EXPORT void pmix_pnet_base_deliver_inventory(pmix_info_t info[], size_t ninfo,
128 pmix_info_t directives[], size_t ndirs,
129 pmix_op_cbfunc_t cbfunc, void *cbdata);
130 PMIX_EXPORT pmix_status_t pmix_pnet_base_harvest_envars(char **incvars, char **excvars,
131 pmix_list_t *ilist);
132
133 END_C_DECLS
134
135 #endif