This source file includes following definitions.
- ompi_coll_base_free_reqs
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
28 #ifndef MCA_COLL_BASE_EXPORT_H
29 #define MCA_COLL_BASE_EXPORT_H
30
31 #include "ompi_config.h"
32
33 #include "ompi/mca/coll/base/base.h"
34 #include "ompi/mca/mca.h"
35 #include "ompi/mca/coll/coll.h"
36 #include "ompi/info/info.h"
37 #include "ompi/request/request.h"
38
39
40 #include "coll_base_topo.h"
41
42
43 typedef enum COLLTYPE {
44 ALLGATHER = 0,
45 ALLGATHERV,
46 ALLREDUCE,
47 ALLTOALL,
48 ALLTOALLV,
49 ALLTOALLW,
50 BARRIER,
51 BCAST,
52 EXSCAN,
53 GATHER,
54 GATHERV,
55 REDUCE,
56 REDUCESCATTER,
57 REDUCESCATTERBLOCK,
58 SCAN,
59 SCATTER,
60 SCATTERV,
61 NEIGHBOR_ALLGATHER,
62 NEIGHBOR_ALLGATHERV,
63 NEIGHBOR_ALLTOALL,
64 NEIGHBOR_ALLTOALLV,
65 NEIGHBOR_ALLTOALLW,
66 COLLCOUNT
67 } COLLTYPE_T;
68
69
70 #define ALLGATHER_BASE_ARGS const void *sendbuf, int sendcount, struct ompi_datatype_t *sendtype, void *recvbuf, int recvcount, struct ompi_datatype_t *recvtype, struct ompi_communicator_t *comm
71 #define ALLGATHERV_BASE_ARGS const void *sendbuf, int sendcount, struct ompi_datatype_t *sendtype, void *recvbuf, const int recvcounts[], const int displs[], struct ompi_datatype_t *recvtype, struct ompi_communicator_t *comm
72 #define ALLREDUCE_BASE_ARGS const void *sendbuf, void *recvbuf, int count, struct ompi_datatype_t *datatype, struct ompi_op_t *op, struct ompi_communicator_t *comm
73 #define ALLTOALL_BASE_ARGS const void *sendbuf, int sendcount, struct ompi_datatype_t *sendtype, void *recvbuf, int recvcount, struct ompi_datatype_t *recvtype, struct ompi_communicator_t *comm
74 #define ALLTOALLV_BASE_ARGS const void *sendbuf, const int sendcounts[], const int sdispls[], struct ompi_datatype_t *sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], struct ompi_datatype_t *recvtype, struct ompi_communicator_t *comm
75 #define ALLTOALLW_BASE_ARGS const void *sendbuf, const int sendcounts[], const int sdispls[], struct ompi_datatype_t * const sendtypes[], void *recvbuf, const int recvcounts[], const int rdispls[], struct ompi_datatype_t * const recvtypes[], struct ompi_communicator_t *comm
76 #define BARRIER_BASE_ARGS struct ompi_communicator_t *comm
77 #define BCAST_BASE_ARGS void *buffer, int count, struct ompi_datatype_t *datatype, int root, struct ompi_communicator_t *comm
78 #define EXSCAN_BASE_ARGS const void *sendbuf, void *recvbuf, int count, struct ompi_datatype_t *datatype, struct ompi_op_t *op, struct ompi_communicator_t *comm
79 #define GATHER_BASE_ARGS const void *sendbuf, int sendcount, struct ompi_datatype_t *sendtype, void *recvbuf, int recvcount, struct ompi_datatype_t *recvtype, int root, struct ompi_communicator_t *comm
80 #define GATHERV_BASE_ARGS const void *sendbuf, int sendcount, struct ompi_datatype_t *sendtype, void *recvbuf, const int recvcounts[], const int displs[], struct ompi_datatype_t *recvtype, int root, struct ompi_communicator_t *comm
81 #define REDUCE_BASE_ARGS const void *sendbuf, void *recvbuf, int count, struct ompi_datatype_t *datatype, struct ompi_op_t *op, int root, struct ompi_communicator_t *comm
82 #define REDUCESCATTER_BASE_ARGS const void *sendbuf, void *recvbuf, const int recvcounts[], struct ompi_datatype_t *datatype, struct ompi_op_t *op, struct ompi_communicator_t *comm
83 #define REDUCESCATTERBLOCK_BASE_ARGS const void *sendbuf, void *recvbuf, int recvcount, struct ompi_datatype_t *datatype, struct ompi_op_t *op, struct ompi_communicator_t *comm
84 #define SCAN_BASE_ARGS const void *sendbuf, void *recvbuf, int count, struct ompi_datatype_t *datatype, struct ompi_op_t *op, struct ompi_communicator_t *comm
85 #define SCATTER_BASE_ARGS const void *sendbuf, int sendcount, struct ompi_datatype_t *sendtype, void *recvbuf, int recvcount, struct ompi_datatype_t *recvtype, int root, struct ompi_communicator_t *comm
86 #define SCATTERV_BASE_ARGS const void *sendbuf, const int sendcounts[], const int displs[], struct ompi_datatype_t *sendtype, void *recvbuf, int recvcount, struct ompi_datatype_t *recvtype, int root, struct ompi_communicator_t *comm
87 #define NEIGHBOR_ALLGATHER_BASE_ARGS const void *sendbuf, int sendcount, struct ompi_datatype_t *sendtype, void *recvbuf, int recvcount, struct ompi_datatype_t *recvtype, struct ompi_communicator_t *comm
88 #define NEIGHBOR_ALLGATHERV_BASE_ARGS const void *sendbuf, int sendcount, struct ompi_datatype_t *sendtype, void *recvbuf, const int recvcounts[], const int displs[], struct ompi_datatype_t *recvtype, struct ompi_communicator_t *comm
89 #define NEIGHBOR_ALLTOALL_BASE_ARGS const void *sendbuf, int sendcount, struct ompi_datatype_t *sendtype, void *recvbuf, int recvcount, struct ompi_datatype_t *recvtype, struct ompi_communicator_t *comm
90 #define NEIGHBOR_ALLTOALLV_BASE_ARGS const void *sendbuf, const int sendcounts[], const int sdispls[], struct ompi_datatype_t *sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], struct ompi_datatype_t *recvtype, struct ompi_communicator_t *comm
91 #define NEIGHBOR_ALLTOALLW_BASE_ARGS const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], struct ompi_datatype_t * const sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], struct ompi_datatype_t * const recvtypes[], struct ompi_communicator_t *comm
92
93 #define ALLGATHER_ARGS ALLGATHER_BASE_ARGS, mca_coll_base_module_t *module
94 #define ALLGATHERV_ARGS ALLGATHERV_BASE_ARGS, mca_coll_base_module_t *module
95 #define ALLREDUCE_ARGS ALLREDUCE_BASE_ARGS, mca_coll_base_module_t *module
96 #define ALLTOALL_ARGS ALLTOALL_BASE_ARGS, mca_coll_base_module_t *module
97 #define ALLTOALLV_ARGS ALLTOALLV_BASE_ARGS, mca_coll_base_module_t *module
98 #define ALLTOALLW_ARGS ALLTOALLW_BASE_ARGS, mca_coll_base_module_t *module
99 #define BARRIER_ARGS BARRIER_BASE_ARGS, mca_coll_base_module_t *module
100 #define BCAST_ARGS BCAST_BASE_ARGS, mca_coll_base_module_t *module
101 #define EXSCAN_ARGS EXSCAN_BASE_ARGS, mca_coll_base_module_t *module
102 #define GATHER_ARGS GATHER_BASE_ARGS, mca_coll_base_module_t *module
103 #define GATHERV_ARGS GATHERV_BASE_ARGS, mca_coll_base_module_t *module
104 #define REDUCE_ARGS REDUCE_BASE_ARGS, mca_coll_base_module_t *module
105 #define REDUCESCATTER_ARGS REDUCESCATTER_BASE_ARGS, mca_coll_base_module_t *module
106 #define REDUCESCATTERBLOCK_ARGS REDUCESCATTERBLOCK_BASE_ARGS, mca_coll_base_module_t *module
107 #define SCAN_ARGS SCAN_BASE_ARGS, mca_coll_base_module_t *module
108 #define SCATTER_ARGS SCATTER_BASE_ARGS, mca_coll_base_module_t *module
109 #define SCATTERV_ARGS SCATTERV_BASE_ARGS, mca_coll_base_module_t *module
110 #define NEIGHBOR_ALLGATHER_ARGS NEIGHBOR_ALLGATHER_BASE_ARGS, mca_coll_base_module_t *module
111 #define NEIGHBOR_ALLGATHERV_ARGS NEIGHBOR_ALLGATHERV_BASE_ARGS, mca_coll_base_module_t *module
112 #define NEIGHBOR_ALLTOALL_ARGS NEIGHBOR_ALLTOALL_BASE_ARGS, mca_coll_base_module_t *module
113 #define NEIGHBOR_ALLTOALLV_ARGS NEIGHBOR_ALLTOALLV_BASE_ARGS, mca_coll_base_module_t *module
114 #define NEIGHBOR_ALLTOALLW_ARGS NEIGHBOR_ALLTOALLW_BASE_ARGS, mca_coll_base_module_t *module
115
116 #define IALLGATHER_ARGS ALLGATHER_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
117 #define IALLGATHERV_ARGS ALLGATHERV_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
118 #define IALLREDUCE_ARGS ALLREDUCE_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
119 #define IALLTOALL_ARGS ALLTOALL_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
120 #define IALLTOALLV_ARGS ALLTOALLV_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
121 #define IALLTOALLW_ARGS ALLTOALLW_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
122 #define IBARRIER_ARGS BARRIER_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
123 #define IBCAST_ARGS BCAST_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
124 #define IEXSCAN_ARGS EXSCAN_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
125 #define IGATHER_ARGS GATHER_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
126 #define IGATHERV_ARGS GATHERV_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
127 #define IREDUCE_ARGS REDUCE_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
128 #define IREDUCESCATTER_ARGS REDUCESCATTER_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
129 #define IREDUCESCATTERBLOCK_ARGS REDUCESCATTERBLOCK_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
130 #define ISCAN_ARGS SCAN_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
131 #define ISCATTER_ARGS SCATTER_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
132 #define ISCATTERV_ARGS SCATTERV_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
133 #define INEIGHBOR_ALLGATHER_ARGS NEIGHBOR_ALLGATHER_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
134 #define INEIGHBOR_ALLGATHERV_ARGS NEIGHBOR_ALLGATHERV_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
135 #define INEIGHBOR_ALLTOALL_ARGS NEIGHBOR_ALLTOALL_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
136 #define INEIGHBOR_ALLTOALLV_ARGS NEIGHBOR_ALLTOALLV_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
137 #define INEIGHBOR_ALLTOALLW_ARGS NEIGHBOR_ALLTOALLW_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module
138
139 #define ALLGATHER_INIT_ARGS ALLGATHER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
140 #define ALLGATHERV_INIT_ARGS ALLGATHERV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
141 #define ALLREDUCE_INIT_ARGS ALLREDUCE_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
142 #define ALLTOALL_INIT_ARGS ALLTOALL_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
143 #define ALLTOALLV_INIT_ARGS ALLTOALLV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
144 #define ALLTOALLW_INIT_ARGS ALLTOALLW_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
145 #define BARRIER_INIT_ARGS BARRIER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
146 #define BCAST_INIT_ARGS BCAST_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
147 #define EXSCAN_INIT_ARGS EXSCAN_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
148 #define GATHER_INIT_ARGS GATHER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
149 #define GATHERV_INIT_ARGS GATHERV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
150 #define REDUCE_INIT_ARGS REDUCE_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
151 #define REDUCESCATTER_INIT_ARGS REDUCESCATTER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
152 #define REDUCESCATTERBLOCK_INIT_ARGS REDUCESCATTERBLOCK_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
153 #define SCAN_INIT_ARGS SCAN_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
154 #define SCATTER_INIT_ARGS SCATTER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
155 #define SCATTERV_INIT_ARGS SCATTERV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
156 #define NEIGHBOR_ALLGATHER_INIT_ARGS NEIGHBOR_ALLGATHER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
157 #define NEIGHBOR_ALLGATHERV_INIT_ARGS NEIGHBOR_ALLGATHERV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
158 #define NEIGHBOR_ALLTOALL_INIT_ARGS NEIGHBOR_ALLTOALL_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
159 #define NEIGHBOR_ALLTOALLV_INIT_ARGS NEIGHBOR_ALLTOALLV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
160 #define NEIGHBOR_ALLTOALLW_INIT_ARGS NEIGHBOR_ALLTOALLW_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module
161
162 #define ALLGATHER_BASE_ARG_NAMES sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm
163 #define ALLGATHERV_BASE_ARG_NAMES sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm
164 #define ALLREDUCE_BASE_ARG_NAMES sendbuf, recvbuf, count, datatype, op, comm
165 #define ALLTOALL_BASE_ARG_NAMES sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm
166 #define ALLTOALLV_BASE_ARG_NAMES sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm
167 #define ALLTOALLW_BASE_ARG_NAMES sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm
168 #define BARRIER_BASE_ARG_NAMES comm
169 #define BCAST_BASE_ARG_NAMES buffer, count, datatype, root, comm
170 #define EXSCAN_BASE_ARG_NAMES sendbuf, recvbuf, count, datatype, op, comm
171 #define GATHER_BASE_ARG_NAMES sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm
172 #define GATHERV_BASE_ARG_NAMES sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm
173 #define REDUCE_BASE_ARG_NAMES sendbuf, recvbuf, count, datatype, op, root, comm
174 #define REDUCESCATTER_BASE_ARG_NAMES sendbuf, recvbuf, recvcounts, datatype, op, comm
175 #define REDUCESCATTERBLOCK_BASE_ARG_NAMES sendbuf, recvbuf, recvcount, datatype, op, comm
176 #define SCAN_BASE_ARG_NAMES sendbuf, recvbuf, count, datatype, op, comm
177 #define SCATTER_BASE_ARG_NAMES sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm
178 #define SCATTERV_BASE_ARG_NAMES sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm
179 #define NEIGHBOR_ALLGATHER_BASE_ARG_NAMES sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm
180 #define NEIGHBOR_ALLGATHERV_BASE_ARG_NAMES sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm
181 #define NEIGHBOR_ALLTOALL_BASE_ARG_NAMES sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm
182 #define NEIGHBOR_ALLTOALLV_BASE_ARG_NAMES sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm
183 #define NEIGHBOR_ALLTOALLW_BASE_ARG_NAMES sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm
184
185
186 BEGIN_C_DECLS
187
188
189 int ompi_coll_base_allgather_intra_bruck(ALLGATHER_ARGS);
190 int ompi_coll_base_allgather_intra_recursivedoubling(ALLGATHER_ARGS);
191 int ompi_coll_base_allgather_intra_ring(ALLGATHER_ARGS);
192 int ompi_coll_base_allgather_intra_neighborexchange(ALLGATHER_ARGS);
193 int ompi_coll_base_allgather_intra_basic_linear(ALLGATHER_ARGS);
194 int ompi_coll_base_allgather_intra_two_procs(ALLGATHER_ARGS);
195
196
197 int ompi_coll_base_allgatherv_intra_bruck(ALLGATHERV_ARGS);
198 int ompi_coll_base_allgatherv_intra_ring(ALLGATHERV_ARGS);
199 int ompi_coll_base_allgatherv_intra_neighborexchange(ALLGATHERV_ARGS);
200 int ompi_coll_base_allgatherv_intra_basic_default(ALLGATHERV_ARGS);
201 int ompi_coll_base_allgatherv_intra_two_procs(ALLGATHERV_ARGS);
202
203
204 int ompi_coll_base_allreduce_intra_nonoverlapping(ALLREDUCE_ARGS);
205 int ompi_coll_base_allreduce_intra_recursivedoubling(ALLREDUCE_ARGS);
206 int ompi_coll_base_allreduce_intra_ring(ALLREDUCE_ARGS);
207 int ompi_coll_base_allreduce_intra_ring_segmented(ALLREDUCE_ARGS, uint32_t segsize);
208 int ompi_coll_base_allreduce_intra_basic_linear(ALLREDUCE_ARGS);
209 int ompi_coll_base_allreduce_intra_redscat_allgather(ALLREDUCE_ARGS);
210
211
212 int ompi_coll_base_alltoall_intra_pairwise(ALLTOALL_ARGS);
213 int ompi_coll_base_alltoall_intra_bruck(ALLTOALL_ARGS);
214 int ompi_coll_base_alltoall_intra_basic_linear(ALLTOALL_ARGS);
215 int ompi_coll_base_alltoall_intra_linear_sync(ALLTOALL_ARGS, int max_requests);
216 int ompi_coll_base_alltoall_intra_two_procs(ALLTOALL_ARGS);
217 int mca_coll_base_alltoall_intra_basic_inplace(const void *rbuf, int rcount,
218 struct ompi_datatype_t *rdtype,
219 struct ompi_communicator_t *comm,
220 mca_coll_base_module_t *module);
221
222
223 int ompi_coll_base_alltoallv_intra_pairwise(ALLTOALLV_ARGS);
224 int ompi_coll_base_alltoallv_intra_basic_linear(ALLTOALLV_ARGS);
225 int mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts, const int *rdisps,
226 struct ompi_datatype_t *rdtype,
227 struct ompi_communicator_t *comm,
228 mca_coll_base_module_t *module);
229
230
231
232
233 int ompi_coll_base_barrier_intra_doublering(BARRIER_ARGS);
234 int ompi_coll_base_barrier_intra_recursivedoubling(BARRIER_ARGS);
235 int ompi_coll_base_barrier_intra_bruck(BARRIER_ARGS);
236 int ompi_coll_base_barrier_intra_two_procs(BARRIER_ARGS);
237 int ompi_coll_base_barrier_intra_tree(BARRIER_ARGS);
238 int ompi_coll_base_barrier_intra_basic_linear(BARRIER_ARGS);
239
240
241 int ompi_coll_base_bcast_intra_generic(BCAST_ARGS, uint32_t count_by_segment, ompi_coll_tree_t* tree);
242 int ompi_coll_base_bcast_intra_basic_linear(BCAST_ARGS);
243 int ompi_coll_base_bcast_intra_chain(BCAST_ARGS, uint32_t segsize, int32_t chains);
244 int ompi_coll_base_bcast_intra_pipeline(BCAST_ARGS, uint32_t segsize);
245 int ompi_coll_base_bcast_intra_binomial(BCAST_ARGS, uint32_t segsize);
246 int ompi_coll_base_bcast_intra_bintree(BCAST_ARGS, uint32_t segsize);
247 int ompi_coll_base_bcast_intra_split_bintree(BCAST_ARGS, uint32_t segsize);
248 int ompi_coll_base_bcast_intra_knomial(BCAST_ARGS, uint32_t segsize, int radix);
249 int ompi_coll_base_bcast_intra_scatter_allgather(BCAST_ARGS, uint32_t segsize);
250 int ompi_coll_base_bcast_intra_scatter_allgather_ring(BCAST_ARGS, uint32_t segsize);
251
252
253 int ompi_coll_base_exscan_intra_recursivedoubling(EXSCAN_ARGS);
254 int ompi_coll_base_exscan_intra_linear(EXSCAN_ARGS);
255 int ompi_coll_base_exscan_intra_recursivedoubling(EXSCAN_ARGS);
256
257
258 int ompi_coll_base_gather_intra_basic_linear(GATHER_ARGS);
259 int ompi_coll_base_gather_intra_binomial(GATHER_ARGS);
260 int ompi_coll_base_gather_intra_linear_sync(GATHER_ARGS, int first_segment_size);
261
262
263
264
265 int ompi_coll_base_reduce_generic(REDUCE_ARGS, ompi_coll_tree_t* tree, int count_by_segment, int max_outstanding_reqs);
266 int ompi_coll_base_reduce_intra_basic_linear(REDUCE_ARGS);
267 int ompi_coll_base_reduce_intra_chain(REDUCE_ARGS, uint32_t segsize, int fanout, int max_outstanding_reqs );
268 int ompi_coll_base_reduce_intra_pipeline(REDUCE_ARGS, uint32_t segsize, int max_outstanding_reqs );
269 int ompi_coll_base_reduce_intra_binary(REDUCE_ARGS, uint32_t segsize, int max_outstanding_reqs );
270 int ompi_coll_base_reduce_intra_binomial(REDUCE_ARGS, uint32_t segsize, int max_outstanding_reqs );
271 int ompi_coll_base_reduce_intra_in_order_binary(REDUCE_ARGS, uint32_t segsize, int max_outstanding_reqs );
272 int ompi_coll_base_reduce_intra_redscat_gather(REDUCE_ARGS);
273
274
275 int ompi_coll_base_reduce_scatter_intra_nonoverlapping(REDUCESCATTER_ARGS);
276 int ompi_coll_base_reduce_scatter_intra_basic_recursivehalving(REDUCESCATTER_ARGS);
277 int ompi_coll_base_reduce_scatter_intra_ring(REDUCESCATTER_ARGS);
278 int ompi_coll_base_reduce_scatter_intra_butterfly(REDUCESCATTER_ARGS);
279
280
281 int ompi_coll_base_reduce_scatter_block_basic_linear(REDUCESCATTERBLOCK_ARGS);
282 int ompi_coll_base_reduce_scatter_block_intra_recursivedoubling(REDUCESCATTERBLOCK_ARGS);
283 int ompi_coll_base_reduce_scatter_block_intra_recursivehalving(REDUCESCATTERBLOCK_ARGS);
284 int ompi_coll_base_reduce_scatter_block_intra_butterfly(REDUCESCATTERBLOCK_ARGS);
285
286
287 int ompi_coll_base_scan_intra_recursivedoubling(SCAN_ARGS);
288 int ompi_coll_base_scan_intra_linear(SCAN_ARGS);
289 int ompi_coll_base_scan_intra_recursivedoubling(SCAN_ARGS);
290
291
292 int ompi_coll_base_scatter_intra_basic_linear(SCATTER_ARGS);
293 int ompi_coll_base_scatter_intra_binomial(SCATTER_ARGS);
294
295
296
297
298 int mca_coll_base_reduce_local(const void *inbuf, void *inoutbuf, int count,
299 struct ompi_datatype_t * dtype, struct ompi_op_t * op,
300 mca_coll_base_module_t *module);
301
302 END_C_DECLS
303
304 #define COLL_BASE_UPDATE_BINTREE( OMPI_COMM, BASE_MODULE, ROOT ) \
305 do { \
306 mca_coll_base_comm_t* coll_comm = (BASE_MODULE)->base_data; \
307 if( !( (coll_comm->cached_bintree) \
308 && (coll_comm->cached_bintree_root == (ROOT)) ) ) { \
309 if( coll_comm->cached_bintree ) { \
310 ompi_coll_base_topo_destroy_tree( &(coll_comm->cached_bintree) ); \
311 } \
312 coll_comm->cached_bintree = ompi_coll_base_topo_build_tree(2,(OMPI_COMM),(ROOT)); \
313 coll_comm->cached_bintree_root = (ROOT); \
314 } \
315 } while (0)
316
317 #define COLL_BASE_UPDATE_BMTREE( OMPI_COMM, BASE_MODULE, ROOT ) \
318 do { \
319 mca_coll_base_comm_t* coll_comm = (BASE_MODULE)->base_data; \
320 if( !( (coll_comm->cached_bmtree) \
321 && (coll_comm->cached_bmtree_root == (ROOT)) ) ) { \
322 if( coll_comm->cached_bmtree ) { \
323 ompi_coll_base_topo_destroy_tree( &(coll_comm->cached_bmtree) ); \
324 } \
325 coll_comm->cached_bmtree = ompi_coll_base_topo_build_bmtree( (OMPI_COMM), (ROOT) ); \
326 coll_comm->cached_bmtree_root = (ROOT); \
327 } \
328 } while (0)
329
330 #define COLL_BASE_UPDATE_IN_ORDER_BMTREE( OMPI_COMM, BASE_MODULE, ROOT ) \
331 do { \
332 mca_coll_base_comm_t* coll_comm = (BASE_MODULE)->base_data; \
333 if( !( (coll_comm->cached_in_order_bmtree) \
334 && (coll_comm->cached_in_order_bmtree_root == (ROOT)) ) ) { \
335 if( coll_comm->cached_in_order_bmtree ) { \
336 ompi_coll_base_topo_destroy_tree( &(coll_comm->cached_in_order_bmtree) ); \
337 } \
338 coll_comm->cached_in_order_bmtree = ompi_coll_base_topo_build_in_order_bmtree( (OMPI_COMM), (ROOT) ); \
339 coll_comm->cached_in_order_bmtree_root = (ROOT); \
340 } \
341 } while (0)
342
343 #define COLL_BASE_UPDATE_KMTREE(OMPI_COMM, BASE_MODULE, ROOT, RADIX) \
344 do { \
345 mca_coll_base_comm_t* coll_comm = (BASE_MODULE)->base_data; \
346 if (!((coll_comm->cached_kmtree) \
347 && (coll_comm->cached_kmtree_root == (ROOT)) \
348 && (coll_comm->cached_kmtree_radix == (RADIX)))) \
349 { \
350 if (coll_comm->cached_kmtree ) { \
351 ompi_coll_base_topo_destroy_tree(&(coll_comm->cached_kmtree)); \
352 } \
353 coll_comm->cached_kmtree = ompi_coll_base_topo_build_kmtree((OMPI_COMM), (ROOT), (RADIX)); \
354 coll_comm->cached_kmtree_root = (ROOT); \
355 coll_comm->cached_kmtree_radix = (RADIX); \
356 } \
357 } while (0)
358
359 #define COLL_BASE_UPDATE_PIPELINE( OMPI_COMM, BASE_MODULE, ROOT ) \
360 do { \
361 mca_coll_base_comm_t* coll_comm = (BASE_MODULE)->base_data; \
362 if( !( (coll_comm->cached_pipeline) \
363 && (coll_comm->cached_pipeline_root == (ROOT)) ) ) { \
364 if (coll_comm->cached_pipeline) { \
365 ompi_coll_base_topo_destroy_tree( &(coll_comm->cached_pipeline) ); \
366 } \
367 coll_comm->cached_pipeline = ompi_coll_base_topo_build_chain( 1, (OMPI_COMM), (ROOT) ); \
368 coll_comm->cached_pipeline_root = (ROOT); \
369 } \
370 } while (0)
371
372 #define COLL_BASE_UPDATE_CHAIN( OMPI_COMM, BASE_MODULE, ROOT, FANOUT ) \
373 do { \
374 mca_coll_base_comm_t* coll_comm = (BASE_MODULE)->base_data; \
375 if( !( (coll_comm->cached_chain) \
376 && (coll_comm->cached_chain_root == (ROOT)) \
377 && (coll_comm->cached_chain_fanout == (FANOUT)) ) ) { \
378 if( coll_comm->cached_chain) { \
379 ompi_coll_base_topo_destroy_tree( &(coll_comm->cached_chain) ); \
380 } \
381 coll_comm->cached_chain = ompi_coll_base_topo_build_chain((FANOUT), (OMPI_COMM), (ROOT)); \
382 coll_comm->cached_chain_root = (ROOT); \
383 coll_comm->cached_chain_fanout = (FANOUT); \
384 } \
385 } while (0)
386
387 #define COLL_BASE_UPDATE_IN_ORDER_BINTREE( OMPI_COMM, BASE_MODULE ) \
388 do { \
389 mca_coll_base_comm_t* coll_comm = (BASE_MODULE)->base_data; \
390 if( !(coll_comm->cached_in_order_bintree) ) { \
391 \
392 \
393 coll_comm->cached_in_order_bintree = \
394 ompi_coll_base_topo_build_in_order_bintree((OMPI_COMM)); \
395 } \
396 } while (0)
397
398
399
400
401
402
403
404
405 #define COLL_BASE_COMPUTED_SEGCOUNT(SEGSIZE, TYPELNG, SEGCOUNT) \
406 if( ((SEGSIZE) >= (TYPELNG)) && \
407 ((SEGSIZE) < ((TYPELNG) * (SEGCOUNT))) ) { \
408 size_t residual; \
409 (SEGCOUNT) = (int)((SEGSIZE) / (TYPELNG)); \
410 residual = (SEGSIZE) - (SEGCOUNT) * (TYPELNG); \
411 if( residual > ((TYPELNG) >> 1) ) \
412 (SEGCOUNT)++; \
413 } \
414
415
416
417
418
419
420
421
422
423
424
425
426 #define COLL_BASE_COMPUTE_BLOCKCOUNT( COUNT, NUM_BLOCKS, SPLIT_INDEX, \
427 EARLY_BLOCK_COUNT, LATE_BLOCK_COUNT ) \
428 EARLY_BLOCK_COUNT = LATE_BLOCK_COUNT = COUNT / NUM_BLOCKS; \
429 SPLIT_INDEX = COUNT % NUM_BLOCKS; \
430 if (0 != SPLIT_INDEX) { \
431 EARLY_BLOCK_COUNT = EARLY_BLOCK_COUNT + 1; \
432 } \
433
434
435
436
437
438 struct mca_coll_base_comm_t {
439 opal_object_t super;
440
441
442
443
444
445
446
447
448
449 ompi_request_t **mcct_reqs;
450 int mcct_num_reqs;
451
452
453
454
455
456
457
458
459
460
461 ompi_coll_tree_t *cached_ntree;
462 int cached_ntree_root;
463 int cached_ntree_fanout;
464
465
466 ompi_coll_tree_t *cached_bintree;
467 int cached_bintree_root;
468
469
470 ompi_coll_tree_t *cached_bmtree;
471 int cached_bmtree_root;
472
473
474 ompi_coll_tree_t *cached_in_order_bmtree;
475 int cached_in_order_bmtree_root;
476
477
478 ompi_coll_tree_t *cached_kmtree;
479 int cached_kmtree_root;
480 int cached_kmtree_radix;
481
482
483 ompi_coll_tree_t *cached_chain;
484 int cached_chain_root;
485 int cached_chain_fanout;
486
487
488 ompi_coll_tree_t *cached_pipeline;
489 int cached_pipeline_root;
490
491
492 ompi_coll_tree_t *cached_in_order_bintree;
493 };
494 typedef struct mca_coll_base_comm_t mca_coll_base_comm_t;
495 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_coll_base_comm_t);
496
497
498
499
500
501
502
503
504 static inline void ompi_coll_base_free_reqs(ompi_request_t **reqs, int count)
505 {
506 if (OPAL_UNLIKELY(NULL == reqs)) {
507 return;
508 }
509
510 for (int i = 0; i < count; ++i) {
511 if( MPI_REQUEST_NULL != reqs[i] ) {
512 ompi_request_free(&reqs[i]);
513 }
514 }
515 }
516
517
518
519
520
521 ompi_request_t** ompi_coll_base_comm_get_reqs(mca_coll_base_comm_t* data, int nreqs);
522
523 #endif