Skip to content

Commit ce00824

Browse files
author
rhc54
committed
Merge pull request open-mpi#924 from jladd-mlnx/topic/add-allgatherv-reduce-v1.10
Adding entry points for Allgatherv, iAllgatherv, Reduce, and iReduce.
2 parents bd39acc + a949777 commit ce00824

File tree

3 files changed

+273
-9
lines changed

3 files changed

+273
-9
lines changed

ompi/mca/coll/hcoll/coll_hcoll.h

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,12 @@ struct mca_coll_hcoll_module_t {
130130
mca_coll_base_module_t *previous_ibarrier_module;
131131
mca_coll_base_module_iallgather_fn_t previous_iallgather;
132132
mca_coll_base_module_t *previous_iallgather_module;
133+
mca_coll_base_module_iallgatherv_fn_t previous_iallgatherv;
134+
mca_coll_base_module_t *previous_iallgatherv_module;
133135
mca_coll_base_module_iallreduce_fn_t previous_iallreduce;
134136
mca_coll_base_module_t *previous_iallreduce_module;
137+
mca_coll_base_module_ireduce_fn_t previous_ireduce;
138+
mca_coll_base_module_t *previous_ireduce_module;
135139
mca_coll_base_module_igatherv_fn_t previous_igatherv;
136140
mca_coll_base_module_t *previous_igatherv_module;
137141
mca_coll_base_module_ialltoall_fn_t previous_ialltoall;
@@ -168,7 +172,15 @@ int mca_coll_hcoll_allgather(void *sbuf, int scount,
168172
struct ompi_communicator_t *comm,
169173
mca_coll_base_module_t *module);
170174

171-
int mca_coll_hcoll_gather(void *sbuf, int scount,
175+
int mca_coll_hcoll_allgatherv(const void *sbuf, int scount,
176+
struct ompi_datatype_t *sdtype,
177+
void *rbuf, const int *rcount,
178+
const int *displs,
179+
struct ompi_datatype_t *rdtype,
180+
struct ompi_communicator_t *comm,
181+
mca_coll_base_module_t *module);
182+
183+
int mca_coll_hcoll_gather(const void *sbuf, int scount,
172184
struct ompi_datatype_t *sdtype,
173185
void *rbuf, int rcount,
174186
struct ompi_datatype_t *rdtype,
@@ -183,7 +195,14 @@ int mca_coll_hcoll_allreduce(void *sbuf, void *rbuf, int count,
183195
struct ompi_communicator_t *comm,
184196
mca_coll_base_module_t *module);
185197

186-
int mca_coll_hcoll_alltoall(void *sbuf, int scount,
198+
int mca_coll_hcoll_reduce(const void *sbuf, void *rbuf, int count,
199+
struct ompi_datatype_t *dtype,
200+
struct ompi_op_t *op,
201+
int root,
202+
struct ompi_communicator_t *comm,
203+
mca_coll_base_module_t *module);
204+
205+
int mca_coll_hcoll_alltoall(const void *sbuf, int scount,
187206
struct ompi_datatype_t *sdtype,
188207
void* rbuf, int rcount,
189208
struct ompi_datatype_t *rdtype,
@@ -225,14 +244,31 @@ int mca_coll_hcoll_iallgather(void *sbuf, int scount,
225244
ompi_request_t** request,
226245
mca_coll_base_module_t *module);
227246

228-
int mca_coll_hcoll_iallreduce(void *sbuf, void *rbuf, int count,
247+
int mca_coll_hcoll_iallgatherv(const void *sbuf, int scount,
248+
struct ompi_datatype_t *sdtype,
249+
void *rbuf, const int *rcount,
250+
const int *displs,
251+
struct ompi_datatype_t *rdtype,
252+
struct ompi_communicator_t *comm,
253+
ompi_request_t** request,
254+
mca_coll_base_module_t *module);
255+
256+
int mca_coll_hcoll_iallreduce(const void *sbuf, void *rbuf, int count,
257+
struct ompi_datatype_t *dtype,
258+
struct ompi_op_t *op,
259+
struct ompi_communicator_t *comm,
260+
ompi_request_t** request,
261+
mca_coll_base_module_t *module);
262+
263+
int mca_coll_hcoll_ireduce(const void *sbuf, void *rbuf, int count,
229264
struct ompi_datatype_t *dtype,
230265
struct ompi_op_t *op,
266+
int root,
231267
struct ompi_communicator_t *comm,
232268
ompi_request_t** request,
233269
mca_coll_base_module_t *module);
234270

235-
int mca_coll_hcoll_ialltoall(void *sbuf, int scount,
271+
int mca_coll_hcoll_ialltoall(const void *sbuf, int scount,
236272
struct ompi_datatype_t *sdtype,
237273
void* rbuf, int rcount,
238274
struct ompi_datatype_t *rdtype,
@@ -250,7 +286,7 @@ int mca_coll_hcoll_ialltoallv(void *sbuf, int *scounts,
250286
ompi_request_t **req,
251287
mca_coll_base_module_t *module);
252288

253-
int mca_coll_hcoll_igatherv(void* sbuf, int scount,
289+
int mca_coll_hcoll_igatherv(const void* sbuf, int scount,
254290
struct ompi_datatype_t *sdtype,
255291
void* rbuf, int *rcounts, int *displs,
256292
struct ompi_datatype_t *rdtype,

ompi/mca/coll/hcoll/coll_hcoll_module.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,15 @@ static void mca_coll_hcoll_module_clear(mca_coll_hcoll_module_t *hcoll_module)
4141
hcoll_module->previous_alltoall = NULL;
4242
hcoll_module->previous_alltoallv = NULL;
4343
hcoll_module->previous_alltoallw = NULL;
44+
hcoll_module->previous_reduce = NULL;
4445
hcoll_module->previous_reduce_scatter = NULL;
4546
hcoll_module->previous_ibarrier = NULL;
4647
hcoll_module->previous_ibcast = NULL;
4748
hcoll_module->previous_iallreduce = NULL;
4849
hcoll_module->previous_iallgather = NULL;
50+
hcoll_module->previous_iallgatherv = NULL;
4951
hcoll_module->previous_igatherv = NULL;
52+
hcoll_module->previous_ireduce = NULL;
5053
}
5154

5255
static void mca_coll_hcoll_module_construct(mca_coll_hcoll_module_t *hcoll_module)
@@ -80,17 +83,21 @@ static void mca_coll_hcoll_module_destruct(mca_coll_hcoll_module_t *hcoll_module
8083
OBJ_RELEASE(hcoll_module->previous_bcast_module);
8184
OBJ_RELEASE(hcoll_module->previous_allreduce_module);
8285
OBJ_RELEASE(hcoll_module->previous_allgather_module);
86+
OBJ_RELEASE(hcoll_module->previous_allgatherv_module);
8387
OBJ_RELEASE(hcoll_module->previous_gatherv_module);
8488
OBJ_RELEASE(hcoll_module->previous_alltoall_module);
8589
OBJ_RELEASE(hcoll_module->previous_alltoallv_module);
90+
OBJ_RELEASE(hcoll_module->previous_reduce_module);
8691

8792
OBJ_RELEASE(hcoll_module->previous_ibarrier_module);
8893
OBJ_RELEASE(hcoll_module->previous_ibcast_module);
8994
OBJ_RELEASE(hcoll_module->previous_iallreduce_module);
9095
OBJ_RELEASE(hcoll_module->previous_iallgather_module);
96+
OBJ_RELEASE(hcoll_module->previous_iallgatherv_module);
9197
OBJ_RELEASE(hcoll_module->previous_igatherv_module);
9298
OBJ_RELEASE(hcoll_module->previous_ialltoall_module);
9399
OBJ_RELEASE(hcoll_module->previous_ialltoallv_module);
100+
OBJ_RELEASE(hcoll_module->previous_ireduce_module);
94101

95102
/*
96103
OBJ_RELEASE(hcoll_module->previous_allgatherv_module);
@@ -127,15 +134,19 @@ static int mca_coll_hcoll_save_coll_handlers(mca_coll_hcoll_module_t *hcoll_modu
127134
HCOL_SAVE_PREV_COLL_API(barrier);
128135
HCOL_SAVE_PREV_COLL_API(bcast);
129136
HCOL_SAVE_PREV_COLL_API(allreduce);
137+
HCOL_SAVE_PREV_COLL_API(reduce);
130138
HCOL_SAVE_PREV_COLL_API(allgather);
139+
HCOL_SAVE_PREV_COLL_API(allgatherv);
131140
HCOL_SAVE_PREV_COLL_API(gatherv);
132141
HCOL_SAVE_PREV_COLL_API(alltoall);
133142
HCOL_SAVE_PREV_COLL_API(alltoallv);
134143

135144
HCOL_SAVE_PREV_COLL_API(ibarrier);
136145
HCOL_SAVE_PREV_COLL_API(ibcast);
137146
HCOL_SAVE_PREV_COLL_API(iallreduce);
147+
HCOL_SAVE_PREV_COLL_API(ireduce);
138148
HCOL_SAVE_PREV_COLL_API(iallgather);
149+
HCOL_SAVE_PREV_COLL_API(iallgatherv);
139150
HCOL_SAVE_PREV_COLL_API(igatherv);
140151
HCOL_SAVE_PREV_COLL_API(ialltoall);
141152
HCOL_SAVE_PREV_COLL_API(ialltoallv);
@@ -312,14 +323,26 @@ mca_coll_hcoll_comm_query(struct ompi_communicator_t *comm, int *priority)
312323
hcoll_module->super.coll_barrier = hcoll_collectives.coll_barrier ? mca_coll_hcoll_barrier : NULL;
313324
hcoll_module->super.coll_bcast = hcoll_collectives.coll_bcast ? mca_coll_hcoll_bcast : NULL;
314325
hcoll_module->super.coll_allgather = hcoll_collectives.coll_allgather ? mca_coll_hcoll_allgather : NULL;
326+
hcoll_module->super.coll_allgatherv = hcoll_collectives.coll_allgatherv ? mca_coll_hcoll_allgatherv : NULL;
315327
hcoll_module->super.coll_allreduce = hcoll_collectives.coll_allreduce ? mca_coll_hcoll_allreduce : NULL;
316328
hcoll_module->super.coll_alltoall = hcoll_collectives.coll_alltoall ? mca_coll_hcoll_alltoall : NULL;
317329
hcoll_module->super.coll_alltoallv = hcoll_collectives.coll_alltoallv ? mca_coll_hcoll_alltoallv : NULL;
318330
hcoll_module->super.coll_gatherv = hcoll_collectives.coll_gatherv ? mca_coll_hcoll_gatherv : NULL;
331+
hcoll_module->super.coll_reduce = hcoll_collectives.coll_reduce ? mca_coll_hcoll_reduce : NULL;
319332
hcoll_module->super.coll_ibarrier = hcoll_collectives.coll_ibarrier ? mca_coll_hcoll_ibarrier : NULL;
320333
hcoll_module->super.coll_ibcast = hcoll_collectives.coll_ibcast ? mca_coll_hcoll_ibcast : NULL;
321334
hcoll_module->super.coll_iallgather = hcoll_collectives.coll_iallgather ? mca_coll_hcoll_iallgather : NULL;
335+
#if HCOLL_API >= HCOLL_VERSION(3,5)
336+
hcoll_module->super.coll_iallgatherv = hcoll_collectives.coll_iallgatherv ? mca_coll_hcoll_iallgatherv : NULL;
337+
#else
338+
hcoll_module->super.coll_iallgatherv = NULL;
339+
#endif
322340
hcoll_module->super.coll_iallreduce = hcoll_collectives.coll_iallreduce ? mca_coll_hcoll_iallreduce : NULL;
341+
#if HCOLL_API >= HCOLL_VERSION(3,5)
342+
hcoll_module->super.coll_ireduce = hcoll_collectives.coll_ireduce ? mca_coll_hcoll_ireduce : NULL;
343+
#else
344+
hcoll_module->super.coll_ireduce = NULL;
345+
#endif
323346
hcoll_module->super.coll_gather = /*hcoll_collectives.coll_gather ? mca_coll_hcoll_gather :*/ NULL;
324347
hcoll_module->super.coll_igatherv = hcoll_collectives.coll_igatherv ? mca_coll_hcoll_igatherv : NULL;
325348
hcoll_module->super.coll_ialltoall = /*hcoll_collectives.coll_ialltoall ? mca_coll_hcoll_ialltoall : */ NULL;

0 commit comments

Comments
 (0)