1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #ifndef MCA_TOPO_H
28 #define MCA_TOPO_H
29
30 #include "ompi_config.h"
31
32 #include "ompi/mca/mca.h"
33 #include "opal/mca/base/base.h"
34 #include "ompi/communicator/communicator.h"
35
36
37 struct ompi_proc_t;
38 typedef struct mca_topo_base_module_t mca_topo_base_module_t;
39
40
41
42
43 typedef int (*mca_topo_base_component_init_query_2_2_0_fn_t)
44 (bool enable_progress_threads,
45 bool enable_mpi_threads);
46
47
48
49
50
51 typedef struct mca_topo_base_module_t*
52 (*mca_topo_base_component_comm_query_2_2_0_fn_t)
53 (const ompi_communicator_t *comm, int *priority, uint32_t type);
54
55
56
57
58 typedef struct mca_topo_base_component_2_2_0_t {
59 mca_base_component_t topoc_version;
60 mca_base_component_data_t topoc_data;
61
62 mca_topo_base_component_init_query_2_2_0_fn_t topoc_init_query;
63 mca_topo_base_component_comm_query_2_2_0_fn_t topoc_comm_query;
64 } mca_topo_base_component_2_2_0_t;
65 typedef mca_topo_base_component_2_2_0_t mca_topo_base_component_t;
66
67
68
69
70 typedef struct mca_topo_base_comm_graph_2_2_0_t {
71
72
73 opal_object_t super;
74 int nnodes;
75 int *index;
76 int *edges;
77 } mca_topo_base_comm_graph_2_2_0_t;
78 typedef mca_topo_base_comm_graph_2_2_0_t mca_topo_base_comm_graph_t;
79
80 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_topo_base_comm_graph_2_2_0_t);
81
82
83
84
85 typedef struct mca_topo_base_comm_cart_2_2_0_t {
86
87
88 opal_object_t super;
89 int ndims;
90 int *dims;
91 int *periods;
92 int *coords;
93 } mca_topo_base_comm_cart_2_2_0_t;
94 typedef mca_topo_base_comm_cart_2_2_0_t mca_topo_base_comm_cart_t;
95
96 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_topo_base_comm_cart_2_2_0_t);
97
98
99
100
101 typedef struct mca_topo_base_comm_dist_graph_2_2_0_t {
102
103
104 opal_object_t super;
105 int *in;
106 int *inw;
107 int *out;
108 int *outw;
109 int indegree, outdegree;
110 bool weighted;
111 } mca_topo_base_comm_dist_graph_2_2_0_t;
112 typedef mca_topo_base_comm_dist_graph_2_2_0_t mca_topo_base_comm_dist_graph_t;
113
114 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_topo_base_comm_dist_graph_2_2_0_t);
115
116
117
118
119
120
121
122 typedef union mca_topo_base_comm_cgd_union_2_2_0_t {
123 mca_topo_base_comm_graph_2_2_0_t* graph;
124 mca_topo_base_comm_cart_2_2_0_t* cart;
125 mca_topo_base_comm_dist_graph_2_2_0_t* dist_graph;
126 } mca_topo_base_comm_cgd_union_2_2_0_t;
127 typedef mca_topo_base_comm_cgd_union_2_2_0_t mca_topo_base_comm_cgd_union_t;
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148 typedef int (*mca_topo_base_module_cart_coords_fn_t)
149 (struct ompi_communicator_t *comm,
150 int rank,
151 int maxdims,
152 int *coords);
153
154
155 typedef int (*mca_topo_base_module_cart_create_fn_t)
156 (mca_topo_base_module_t *topo_module,
157 ompi_communicator_t* old_comm,
158 int ndims,
159 const int *dims,
160 const int *periods,
161 bool reorder,
162 ompi_communicator_t** comm_topo);
163
164
165 typedef int (*mca_topo_base_module_cart_get_fn_t)
166 (struct ompi_communicator_t *comm,
167 int maxdims,
168 int *dims,
169 int *periods,
170 int *coords);
171
172
173 typedef int (*mca_topo_base_module_cartdim_get_fn_t)
174 (struct ompi_communicator_t *comm,
175 int *ndims);
176
177
178 typedef int (*mca_topo_base_module_cart_map_fn_t)
179 (struct ompi_communicator_t *comm,
180 int ndims,
181 const int *dims,
182 const int *periods,
183 int *newrank);
184
185
186 typedef int (*mca_topo_base_module_cart_rank_fn_t)
187 (struct ompi_communicator_t *comm,
188 const int *coords,
189 int *rank);
190
191
192 typedef int (*mca_topo_base_module_cart_shift_fn_t)
193 (struct ompi_communicator_t *comm,
194 int direction,
195 int disp,
196 int *rank_source,
197 int *rank_dest);
198
199
200 typedef int (*mca_topo_base_module_cart_sub_fn_t)
201 (struct ompi_communicator_t *comm,
202 const int *remain_dims,
203 struct ompi_communicator_t ** new_comm);
204
205
206 typedef int (*mca_topo_base_module_graph_create_fn_t)
207 (mca_topo_base_module_t *topo_module,
208 ompi_communicator_t* old_comm,
209 int nnodes,
210 const int *index,
211 const int *edges,
212 bool reorder,
213 ompi_communicator_t** new_comm);
214
215
216 typedef int (*mca_topo_base_module_graph_get_fn_t)
217 (struct ompi_communicator_t *comm,
218 int maxindex,
219 int maxedges,
220 int *index,
221 int *edges);
222
223
224 typedef int (*mca_topo_base_module_graph_map_fn_t)
225 (struct ompi_communicator_t *comm,
226 int nnodes,
227 const int *index,
228 const int *edges,
229 int *newrank);
230
231
232 typedef int (*mca_topo_base_module_graphdims_get_fn_t)
233 (struct ompi_communicator_t *comm,
234 int *nnodes,
235 int *nnedges);
236
237
238 typedef int (*mca_topo_base_module_graph_neighbors_fn_t)
239 (struct ompi_communicator_t *comm,
240 int rank,
241 int maxneighbors,
242 int *neighbors);
243
244
245 typedef int (*mca_topo_base_module_graph_neighbors_count_fn_t)
246 (struct ompi_communicator_t *comm,
247 int rank,
248 int *nneighbors);
249
250
251 typedef int (*mca_topo_base_module_dist_graph_create_fn_t)
252 (struct mca_topo_base_module_t* module,
253 struct ompi_communicator_t *old_comm,
254 int n, const int nodes[],
255 const int degrees[], const int targets[], const int weights[],
256 struct opal_info_t *info, int reorder,
257 struct ompi_communicator_t **new_comm);
258
259
260 typedef int (*mca_topo_base_module_dist_graph_create_adjacent_fn_t)
261 (struct mca_topo_base_module_t* module,
262 ompi_communicator_t *comm_old,
263 int indegree, const int sources[],
264 const int sourceweights[],
265 int outdegree,
266 const int destinations[],
267 const int destweights[],
268 struct opal_info_t *info, int reorder,
269 ompi_communicator_t **comm_dist_graph);
270
271
272 typedef int (*mca_topo_base_module_dist_graph_neighbors_fn_t)
273 (struct ompi_communicator_t *comm,
274 int maxindegree,
275 int sources[], int sourceweights[],
276 int maxoutdegree, int destinations[],
277 int destweights[]);
278
279
280 typedef int (*mca_topo_base_module_dist_graph_neighbors_count_fn_t)
281 (struct ompi_communicator_t *comm,
282 int *inneighbors, int *outneighbors, int *weighted);
283
284
285
286
287
288
289
290
291
292
293
294 typedef struct mca_topo_base_cart_module_2_2_0_t {
295 mca_topo_base_module_cart_coords_fn_t cart_coords;
296 mca_topo_base_module_cart_create_fn_t cart_create;
297 mca_topo_base_module_cart_get_fn_t cart_get;
298 mca_topo_base_module_cartdim_get_fn_t cartdim_get;
299 mca_topo_base_module_cart_map_fn_t cart_map;
300 mca_topo_base_module_cart_rank_fn_t cart_rank;
301 mca_topo_base_module_cart_shift_fn_t cart_shift;
302 mca_topo_base_module_cart_sub_fn_t cart_sub;
303 } mca_topo_base_cart_module_2_2_0_t;
304
305 typedef struct mca_topo_base_graph_module_2_2_0_t {
306 mca_topo_base_module_graph_create_fn_t graph_create;
307 mca_topo_base_module_graph_get_fn_t graph_get;
308 mca_topo_base_module_graph_map_fn_t graph_map;
309 mca_topo_base_module_graphdims_get_fn_t graphdims_get;
310 mca_topo_base_module_graph_neighbors_fn_t graph_neighbors;
311 mca_topo_base_module_graph_neighbors_count_fn_t graph_neighbors_count;
312 } mca_topo_base_graph_module_2_2_0_t;
313
314 typedef struct mca_topo_base_dist_graph_module_2_2_0_t {
315 mca_topo_base_module_dist_graph_create_fn_t dist_graph_create;
316 mca_topo_base_module_dist_graph_create_adjacent_fn_t dist_graph_create_adjacent;
317 mca_topo_base_module_dist_graph_neighbors_fn_t dist_graph_neighbors;
318 mca_topo_base_module_dist_graph_neighbors_count_fn_t dist_graph_neighbors_count;
319 } mca_topo_base_dist_graph_module_2_2_0_t;
320
321 struct mca_topo_base_module_t {
322
323
324 opal_object_t super;
325
326 uint32_t type;
327 bool reorder;
328 mca_topo_base_component_t* topo_component;
329
330
331 union {
332 mca_topo_base_cart_module_2_2_0_t cart;
333 mca_topo_base_graph_module_2_2_0_t graph;
334 mca_topo_base_dist_graph_module_2_2_0_t dist_graph;
335 } topo;
336
337
338
339
340 mca_topo_base_comm_cgd_union_t mtc;
341 };
342
343 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_topo_base_module_t);
344
345
346
347
348
349
350 #define MCA_TOPO_BASE_VERSION_2_2_0 \
351 OMPI_MCA_BASE_VERSION_2_1_0("topo", 2, 2, 0)
352
353 #endif