Skip to content

Commit bb038db

Browse files
authored
Merge pull request #13071 from janjust/v5.0.x-prs
v5.0.x: update platform file, and fix a UCC fallback issue
2 parents f90b18e + 6c0f36c commit bb038db

17 files changed

+69
-83
lines changed

contrib/platform/mellanox/optimized

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
enable_mca_no_build=coll-ml,btl-uct
22
enable_debug_symbols=yes
3-
enable_orterun_prefix_by_default=yes
3+
enable_mpirun_prefix_by_default=yes
44
with_devel_headers=yes
55
enable_oshmem=yes
66
enable_oshmem_fortran=yes

ompi/mca/coll/ucc/coll_ucc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ BEGIN_C_DECLS
4040
"iallgatherv,ireduce,igather,igatherv,ireduce_scatter_block,"\
4141
"ireduce_scatter,iscatterv,iscatter"
4242

43+
#define mca_coll_ucc_call_previous(__api, ucc_module, ...) \
44+
(ucc_module->previous_ ## __api == NULL ? \
45+
UCC_ERR_NOT_SUPPORTED : \
46+
ucc_module->previous_ ## __api (__VA_ARGS__, ucc_module->previous_ ## __api ## _module))
47+
4348
typedef struct mca_coll_ucc_req {
4449
ompi_request_t super;
4550
ucc_coll_req_h ucc_req;

ompi/mca/coll/ucc/coll_ucc_allgather.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ int mca_coll_ucc_allgather(const void *sbuf, int scount, struct ompi_datatype_t
7777
return OMPI_SUCCESS;
7878
fallback:
7979
UCC_VERBOSE(3, "running fallback allgather");
80-
return ucc_module->previous_allgather(sbuf, scount, sdtype, rbuf, rcount, rdtype,
81-
comm, ucc_module->previous_allgather_module);
80+
81+
return mca_coll_ucc_call_previous(allgather, ucc_module,
82+
sbuf, scount, sdtype, rbuf, rcount, rdtype, comm);
8283
}
8384

8485
int mca_coll_ucc_iallgather(const void *sbuf, int scount, struct ompi_datatype_t *sdtype,
@@ -104,6 +105,7 @@ int mca_coll_ucc_iallgather(const void *sbuf, int scount, struct ompi_datatype_t
104105
if (coll_req) {
105106
mca_coll_ucc_req_free((ompi_request_t **)&coll_req);
106107
}
107-
return ucc_module->previous_iallgather(sbuf, scount, sdtype, rbuf, rcount, rdtype,
108-
comm, request, ucc_module->previous_iallgather_module);
108+
109+
return mca_coll_ucc_call_previous(iallgather, ucc_module,
110+
sbuf, scount, sdtype, rbuf, rcount, rdtype, comm, request);
109111
}

ompi/mca/coll/ucc/coll_ucc_allgatherv.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ int mca_coll_ucc_allgatherv(const void *sbuf, int scount,
7878
return OMPI_SUCCESS;
7979
fallback:
8080
UCC_VERBOSE(3, "running fallback allgatherv");
81-
return ucc_module->previous_allgatherv(sbuf, scount, sdtype,
82-
rbuf, rcounts, rdisps, rdtype,
83-
comm, ucc_module->previous_allgatherv_module);
81+
return mca_coll_ucc_call_previous(allgatherv, ucc_module,
82+
sbuf, scount, sdtype, rbuf, rcounts, rdisps, rdtype, comm);
8483
}
8584

8685
int mca_coll_ucc_iallgatherv(const void *sbuf, int scount,
@@ -108,7 +107,6 @@ int mca_coll_ucc_iallgatherv(const void *sbuf, int scount,
108107
if (coll_req) {
109108
mca_coll_ucc_req_free((ompi_request_t **)&coll_req);
110109
}
111-
return ucc_module->previous_iallgatherv(sbuf, scount, sdtype,
112-
rbuf, rcounts, rdisps, rdtype,
113-
comm, request, ucc_module->previous_iallgatherv_module);
110+
return mca_coll_ucc_call_previous(iallgatherv, ucc_module,
111+
sbuf, scount, sdtype, rbuf, rcounts, rdisps, rdtype, comm, request);
114112
}

ompi/mca/coll/ucc/coll_ucc_allreduce.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ int mca_coll_ucc_allreduce(const void *sbuf, void *rbuf, int count,
7474
return OMPI_SUCCESS;
7575
fallback:
7676
UCC_VERBOSE(3, "running fallback allreduce");
77-
return ucc_module->previous_allreduce(sbuf, rbuf, count, dtype, op,
78-
comm, ucc_module->previous_allreduce_module);
77+
return mca_coll_ucc_call_previous(allreduce, ucc_module,
78+
sbuf, rbuf, count, dtype, op, comm);
7979
}
8080

8181
int mca_coll_ucc_iallreduce(const void *sbuf, void *rbuf, int count,
@@ -100,6 +100,6 @@ int mca_coll_ucc_iallreduce(const void *sbuf, void *rbuf, int count,
100100
if (coll_req) {
101101
mca_coll_ucc_req_free((ompi_request_t **)&coll_req);
102102
}
103-
return ucc_module->previous_iallreduce(sbuf, rbuf, count, dtype, op,
104-
comm, request, ucc_module->previous_iallreduce_module);
103+
return mca_coll_ucc_call_previous(iallreduce, ucc_module,
104+
sbuf, rbuf, count, dtype, op, comm, request);
105105
}

ompi/mca/coll/ucc/coll_ucc_alltoall.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ int mca_coll_ucc_alltoall(const void *sbuf, int scount, struct ompi_datatype_t *
7777
return OMPI_SUCCESS;
7878
fallback:
7979
UCC_VERBOSE(3, "running fallback alltoall");
80-
return ucc_module->previous_alltoall(sbuf, scount, sdtype, rbuf, rcount, rdtype,
81-
comm, ucc_module->previous_alltoall_module);
80+
return mca_coll_ucc_call_previous(alltoall, ucc_module,
81+
sbuf, scount, sdtype, rbuf, rcount, rdtype, comm);
8282
}
8383

8484
int mca_coll_ucc_ialltoall(const void *sbuf, int scount, struct ompi_datatype_t *sdtype,
@@ -104,6 +104,6 @@ int mca_coll_ucc_ialltoall(const void *sbuf, int scount, struct ompi_datatype_t
104104
if (coll_req) {
105105
mca_coll_ucc_req_free((ompi_request_t **)&coll_req);
106106
}
107-
return ucc_module->previous_ialltoall(sbuf, scount, sdtype, rbuf, rcount, rdtype,
108-
comm, request, ucc_module->previous_ialltoall_module);
107+
return mca_coll_ucc_call_previous(ialltoall, ucc_module,
108+
sbuf, scount, sdtype, rbuf, rcount, rdtype, comm, request);
109109
}

ompi/mca/coll/ucc/coll_ucc_alltoallv.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ int mca_coll_ucc_alltoallv(const void *sbuf, const int *scounts,
7979
return OMPI_SUCCESS;
8080
fallback:
8181
UCC_VERBOSE(3, "running fallback alltoallv");
82-
return ucc_module->previous_alltoallv(sbuf, scounts, sdisps, sdtype,
83-
rbuf, rcounts, rdisps, rdtype,
84-
comm, ucc_module->previous_alltoallv_module);
82+
return mca_coll_ucc_call_previous(alltoallv, ucc_module,
83+
sbuf, scounts, sdisps, sdtype, rbuf, rcounts, rdisps, rdtype, comm);
8584
}
8685

8786
int mca_coll_ucc_ialltoallv(const void *sbuf, const int *scounts,
@@ -109,7 +108,6 @@ int mca_coll_ucc_ialltoallv(const void *sbuf, const int *scounts,
109108
if (coll_req) {
110109
mca_coll_ucc_req_free((ompi_request_t **)&coll_req);
111110
}
112-
return ucc_module->previous_ialltoallv(sbuf, scounts, sdisps, sdtype,
113-
rbuf, rcounts, rdisps, rdtype,
114-
comm, request, ucc_module->previous_ialltoallv_module);
111+
return mca_coll_ucc_call_previous(ialltoallv, ucc_module,
112+
sbuf, scounts, sdisps, sdtype, rbuf, rcounts, rdisps, rdtype, comm, request);
115113
}

ompi/mca/coll/ucc/coll_ucc_barrier.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int mca_coll_ucc_barrier(struct ompi_communicator_t *comm,
3636
return OMPI_SUCCESS;
3737
fallback:
3838
UCC_VERBOSE(3, "running fallback barrier");
39-
return ucc_module->previous_barrier(comm, ucc_module->previous_barrier_module);
39+
return mca_coll_ucc_call_previous(barrier, ucc_module, comm);
4040
}
4141

4242
int mca_coll_ucc_ibarrier(struct ompi_communicator_t *comm,
@@ -58,6 +58,5 @@ int mca_coll_ucc_ibarrier(struct ompi_communicator_t *comm,
5858
if (coll_req) {
5959
mca_coll_ucc_req_free((ompi_request_t **)&coll_req);
6060
}
61-
return ucc_module->previous_ibarrier(comm, request,
62-
ucc_module->previous_ibarrier_module);
61+
return mca_coll_ucc_call_previous(ibarrier, ucc_module, comm, request);
6362
}

ompi/mca/coll/ucc/coll_ucc_bcast.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ int mca_coll_ucc_bcast(void *buf, int count, struct ompi_datatype_t *dtype,
5151
return OMPI_SUCCESS;
5252
fallback:
5353
UCC_VERBOSE(3, "running fallback bcast");
54-
return ucc_module->previous_bcast(buf, count, dtype, root,
55-
comm, ucc_module->previous_bcast_module);
54+
return mca_coll_ucc_call_previous(bcast, ucc_module,
55+
buf, count, dtype, root, comm);
56+
5657
}
5758

5859
int mca_coll_ucc_ibcast(void *buf, int count, struct ompi_datatype_t *dtype,
@@ -76,6 +77,6 @@ int mca_coll_ucc_ibcast(void *buf, int count, struct ompi_datatype_t *dtype,
7677
if (coll_req) {
7778
mca_coll_ucc_req_free((ompi_request_t **)&coll_req);
7879
}
79-
return ucc_module->previous_ibcast(buf, count, dtype, root,
80-
comm, request, ucc_module->previous_ibcast_module);
80+
return mca_coll_ucc_call_previous(ibcast, ucc_module,
81+
buf, count, dtype, root, comm, request);
8182
}

ompi/mca/coll/ucc/coll_ucc_gather.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ int mca_coll_ucc_gather(const void *sbuf, int scount, struct ompi_datatype_t *sd
9191
return OMPI_SUCCESS;
9292
fallback:
9393
UCC_VERBOSE(3, "running fallback gather");
94-
return ucc_module->previous_gather(sbuf, scount, sdtype, rbuf, rcount,
95-
rdtype, root, comm,
96-
ucc_module->previous_gather_module);
94+
return mca_coll_ucc_call_previous(gather, ucc_module,
95+
sbuf, scount, sdtype, rbuf, rcount, rdtype, root, comm);
9796
}
9897

9998
int mca_coll_ucc_igather(const void *sbuf, int scount, struct ompi_datatype_t *sdtype,
@@ -119,7 +118,6 @@ int mca_coll_ucc_igather(const void *sbuf, int scount, struct ompi_datatype_t *s
119118
if (coll_req) {
120119
mca_coll_ucc_req_free((ompi_request_t **)&coll_req);
121120
}
122-
return ucc_module->previous_igather(sbuf, scount, sdtype, rbuf, rcount,
123-
rdtype, root, comm, request,
124-
ucc_module->previous_igather_module);
121+
return mca_coll_ucc_call_previous(igather, ucc_module,
122+
sbuf, scount, sdtype, rbuf, rcount, rdtype, root, comm, request);
125123
}

0 commit comments

Comments
 (0)