Skip to content

Commit 64a1518

Browse files
authored
Merge pull request #2199 from vspetrov/coll_hcoll_ialltoallv
coll/hcoll: ialltoallv interface
2 parents 9389de4 + 9747a9e commit 64a1518

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(const void *sbuf, int *scounts,
293294
int *sdisps,
294295
struct ompi_datatype_t *sdtype,
@@ -298,6 +299,7 @@ int mca_coll_hcoll_ialltoallv(const 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
@@ -684,3 +684,41 @@ int mca_coll_hcoll_igatherv(const void* sbuf, int scount,
684684

685685
}
686686

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

0 commit comments

Comments
 (0)