Skip to content

Commit ca50d23

Browse files
author
Valentin Petrov
committed
coll/hcoll: ialltoallv interface
Signed-off-by: Valentin Petrov <[email protected]>
1 parent eba780d commit ca50d23

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

ompi/mca/coll/hcoll/coll_hcoll.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ int mca_coll_hcoll_ialltoall(const void *sbuf, int scount,
289289
ompi_request_t **req,
290290
mca_coll_base_module_t *module);
291291

292+
#if HCOLL_API >= HCOLL_VERSION(3,7)
292293
int mca_coll_hcoll_ialltoallv(void *sbuf, int *scounts,
293294
int *sdisps,
294295
struct ompi_datatype_t *sdtype,
@@ -298,6 +299,7 @@ int mca_coll_hcoll_ialltoallv(void *sbuf, int *scounts,
298299
struct ompi_communicator_t *comm,
299300
ompi_request_t **req,
300301
mca_coll_base_module_t *module);
302+
#endif
301303

302304
int mca_coll_hcoll_igatherv(const void* sbuf, int scount,
303305
struct ompi_datatype_t *sdtype,

ompi/mca/coll/hcoll/coll_hcoll_module.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,11 @@ mca_coll_hcoll_comm_query(struct ompi_communicator_t *comm, int *priority)
399399
hcoll_module->super.coll_gather = /*hcoll_collectives.coll_gather ? mca_coll_hcoll_gather :*/ NULL;
400400
hcoll_module->super.coll_igatherv = hcoll_collectives.coll_igatherv ? mca_coll_hcoll_igatherv : NULL;
401401
hcoll_module->super.coll_ialltoall = /*hcoll_collectives.coll_ialltoall ? mca_coll_hcoll_ialltoall : */ NULL;
402-
hcoll_module->super.coll_ialltoallv = /*hcoll_collectives.coll_ialltoallv ? mca_coll_hcoll_ialltoallv : */ NULL;
403-
402+
#if HCOLL_API >= HCOLL_VERSION(3,7)
403+
hcoll_module->super.coll_ialltoallv = hcoll_collectives.coll_ialltoallv ? mca_coll_hcoll_ialltoallv : NULL;
404+
#else
405+
hcoll_module->super.coll_ialltoallv = NULL;
406+
#endif
404407
*priority = cm->hcoll_priority;
405408
module = &hcoll_module->super;
406409

ompi/mca/coll/hcoll/coll_hcoll_ops.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,3 +685,41 @@ int mca_coll_hcoll_igatherv(const void* sbuf, int scount,
685685

686686
}
687687

688+
689+
#if HCOLL_API >= HCOLL_VERSION(3,7)
690+
int mca_coll_hcoll_ialltoallv(void *sbuf, int *scounts, int *sdisps,
691+
struct ompi_datatype_t *sdtype,
692+
void *rbuf, int *rcounts, int *rdisps,
693+
struct ompi_datatype_t *rdtype,
694+
struct ompi_communicator_t *comm,
695+
ompi_request_t ** request,
696+
mca_coll_base_module_t *module)
697+
{
698+
dte_data_representation_t stype;
699+
dte_data_representation_t rtype;
700+
int rc;
701+
HCOL_VERBOSE(20,"RUNNING HCOL IALLTOALLV");
702+
mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
703+
stype = ompi_dtype_2_hcoll_dtype(sdtype, NO_DERIVED);
704+
rtype = ompi_dtype_2_hcoll_dtype(rdtype, NO_DERIVED);
705+
if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
706+
HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback ialltoallv;",
707+
sdtype->super.name,
708+
rdtype->super.name);
709+
rc = hcoll_module->previous_ialltoallv(sbuf, scounts, sdisps, sdtype,
710+
rbuf, rcounts, rdisps, rdtype,
711+
comm, request, hcoll_module->previous_alltoallv_module);
712+
return rc;
713+
}
714+
rc = hcoll_collectives.coll_ialltoallv((void *)sbuf, (int *)scounts, (int *)sdisps, stype,
715+
rbuf, (int *)rcounts, (int *)rdisps, rtype,
716+
hcoll_module->hcoll_context, (void**)request);
717+
if (HCOLL_SUCCESS != rc){
718+
HCOL_VERBOSE(20,"RUNNING FALLBACK IALLTOALLV");
719+
rc = hcoll_module->previous_ialltoallv(sbuf, scounts, sdisps, sdtype,
720+
rbuf, rcounts, rdisps, rdtype,
721+
comm, request, hcoll_module->previous_alltoallv_module);
722+
}
723+
return rc;
724+
}
725+
#endif

0 commit comments

Comments
 (0)