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 #ifndef MCA_TOPO_BASE_H
27 #define MCA_TOPO_BASE_H
28
29 #include "ompi_config.h"
30
31 #include "opal/class/opal_list.h"
32 #include "ompi/mca/mca.h"
33 #include "ompi/mca/topo/topo.h"
34 #include "ompi/proc/proc.h"
35 #include "ompi/communicator/communicator.h"
36 #include "ompi/info/info.h"
37
38
39
40
41
42 BEGIN_C_DECLS
43
44
45 OMPI_DECLSPEC int mca_topo_base_lazy_init(void);
46
47
48
49
50 OMPI_DECLSPEC extern mca_base_framework_t ompi_topo_base_framework;
51
52
53 OMPI_DECLSPEC int
54 mca_topo_base_comm_select(const ompi_communicator_t* comm,
55 mca_topo_base_module_t* preferred_module,
56 mca_topo_base_module_t** selected_module,
57 uint32_t type);
58
59
60 OMPI_DECLSPEC int
61 mca_topo_base_find_available(bool enable_progress_threads,
62 bool enable_mpi_threads);
63
64
65
66
67
68
69
70
71
72
73 OMPI_DECLSPEC int
74 mca_topo_base_cart_create(mca_topo_base_module_t *topo_module,
75 ompi_communicator_t* old_comm,
76 int ndims,
77 const int *dims,
78 const int *periods,
79 bool reorder,
80 ompi_communicator_t** comm_topo);
81
82 OMPI_DECLSPEC int
83 mca_topo_base_cart_coords(ompi_communicator_t *comm,
84 int rank,
85 int maxdims,
86 int *coords);
87
88 OMPI_DECLSPEC int
89 mca_topo_base_cartdim_get(ompi_communicator_t *comm,
90 int *ndims);
91
92 OMPI_DECLSPEC int
93 mca_topo_base_cart_get(ompi_communicator_t *comm,
94 int maxdims,
95 int *dims,
96 int *periods,
97 int *coords);
98
99 OMPI_DECLSPEC int
100 mca_topo_base_cart_map(ompi_communicator_t * comm,
101 int ndims,
102 const int *dims, const int *periods, int *newrank);
103
104 OMPI_DECLSPEC int
105 mca_topo_base_cart_rank(ompi_communicator_t *comm,
106 const int *coords,
107 int *rank);
108
109 OMPI_DECLSPEC int
110 mca_topo_base_cart_shift(ompi_communicator_t *comm,
111 int direction,
112 int disp,
113 int *rank_source,
114 int *rank_dest);
115
116 OMPI_DECLSPEC int
117 mca_topo_base_cart_sub(ompi_communicator_t *comm,
118 const int *remain_dims,
119 ompi_communicator_t **new_comm);
120
121 OMPI_DECLSPEC int
122 mca_topo_base_graphdims_get(ompi_communicator_t *comm,
123 int *nodes,
124 int *nedges);
125
126 OMPI_DECLSPEC int
127 mca_topo_base_graph_create(mca_topo_base_module_t *topo_module,
128 ompi_communicator_t* old_comm,
129 int nnodes,
130 const int *index,
131 const int *edges,
132 bool reorder,
133 ompi_communicator_t** new_comm);
134
135 OMPI_DECLSPEC int
136 mca_topo_base_graph_get(ompi_communicator_t *comm,
137 int maxindex,
138 int maxedges,
139 int *index,
140 int *edges);
141
142 OMPI_DECLSPEC int
143 mca_topo_base_graph_map(ompi_communicator_t * comm,
144 int nnodes,
145 const int *index, const int *edges, int *newrank);
146
147 OMPI_DECLSPEC int
148 mca_topo_base_graph_neighbors(ompi_communicator_t *comm,
149 int rank,
150 int maxneighbors,
151 int *neighbors);
152
153 OMPI_DECLSPEC int
154 mca_topo_base_graph_neighbors_count(ompi_communicator_t *comm,
155 int rank,
156 int *nneighbors);
157
158
159
160
161
162 OMPI_DECLSPEC int
163 mca_topo_base_dist_graph_distribute(mca_topo_base_module_t* module,
164 ompi_communicator_t *comm,
165 int n, const int nodes[],
166 const int degrees[], const int targets[],
167 const int weights[],
168 mca_topo_base_comm_dist_graph_2_2_0_t** ptopo);
169
170 OMPI_DECLSPEC int
171 mca_topo_base_dist_graph_create(mca_topo_base_module_t* module,
172 ompi_communicator_t *old_comm,
173 int n, const int nodes[],
174 const int degrees[], const int targets[], const int weights[],
175 opal_info_t *info, int reorder,
176 ompi_communicator_t **new_comm);
177
178 OMPI_DECLSPEC int
179 mca_topo_base_dist_graph_create_adjacent(mca_topo_base_module_t* module,
180 ompi_communicator_t *old_comm,
181 int indegree, const int sources[],
182 const int sourceweights[], int outdegree,
183 const int destinations[], const int destweights[],
184 opal_info_t *info, int reorder,
185 ompi_communicator_t **comm_dist_graph);
186
187 OMPI_DECLSPEC int
188 mca_topo_base_dist_graph_neighbors(ompi_communicator_t *comm,
189 int maxindegree,
190 int sources[], int sourceweights[],
191 int maxoutdegree, int destinations[],
192 int destweights[]);
193
194 OMPI_DECLSPEC int
195 mca_topo_base_dist_graph_neighbors_count(ompi_communicator_t *comm,
196 int *inneighbors, int *outneighbors, int *weighted);
197
198
199 int mca_topo_base_neighbor_count (ompi_communicator_t *comm, int *indegree, int *outdegree);
200
201 END_C_DECLS
202
203 #endif