Skip to content

Commit e59bde9

Browse files
dycz0fxjsquyres
authored andcommitted
Remove the code handling zero count cases in ADAPT.
Set request in ibcast.c to empty when the count is 0. Signed-off-by: Xi Luo <xluo12@vols.utk.edu> Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
1 parent c2970a3 commit e59bde9

File tree

5 files changed

+1
-25
lines changed

5 files changed

+1
-25
lines changed

ompi/mca/coll/adapt/coll_adapt_bcast.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
int ompi_coll_adapt_bcast(void *buff, int count, struct ompi_datatype_t *datatype, int root,
1616
struct ompi_communicator_t *comm, mca_coll_base_module_t * module)
1717
{
18-
if (count == 0) {
19-
return MPI_SUCCESS;
20-
}
2118
ompi_request_t *request = NULL;
2219
int err = ompi_coll_adapt_ibcast(buff, count, datatype, root, comm, &request, module);
2320
if( MPI_SUCCESS != err ) {

ompi/mca/coll/adapt/coll_adapt_ibcast.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -329,21 +329,6 @@ int ompi_coll_adapt_ibcast(void *buff, int count, struct ompi_datatype_t *dataty
329329
struct ompi_communicator_t *comm, ompi_request_t ** request,
330330
mca_coll_base_module_t * module)
331331
{
332-
if (0 == count) {
333-
ompi_request_t *temp_request = OBJ_NEW(ompi_request_t);
334-
OMPI_REQUEST_INIT(temp_request, false);
335-
temp_request->req_type = 0;
336-
temp_request->req_free = ompi_coll_adapt_request_free;
337-
temp_request->req_status.MPI_SOURCE = 0;
338-
temp_request->req_status.MPI_TAG = 0;
339-
temp_request->req_status.MPI_ERROR = 0;
340-
temp_request->req_status._cancelled = 0;
341-
temp_request->req_status._ucount = 0;
342-
ompi_request_complete(temp_request, 1);
343-
*request = temp_request;
344-
return MPI_SUCCESS;
345-
}
346-
347332
OPAL_OUTPUT_VERBOSE((10, mca_coll_adapt_component.adapt_output,
348333
"ibcast root %d, algorithm %d, coll_adapt_ibcast_segment_size %zu, coll_adapt_ibcast_max_send_requests %d, coll_adapt_ibcast_max_recv_requests %d\n",
349334
root, mca_coll_adapt_component.adapt_ibcast_algorithm,

ompi/mca/coll/adapt/coll_adapt_ireduce.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,6 @@ int ompi_coll_adapt_ireduce(const void *sbuf, void *rbuf, int count, struct ompi
521521
struct ompi_op_t *op, int root, struct ompi_communicator_t *comm,
522522
ompi_request_t ** request, mca_coll_base_module_t * module)
523523
{
524-
if (count == 0) {
525-
return MPI_SUCCESS;
526-
}
527-
528524
OPAL_OUTPUT_VERBOSE((10, mca_coll_adapt_component.adapt_output,
529525
"ireduce root %d, algorithm %d, coll_adapt_ireduce_segment_size %zu, coll_adapt_ireduce_max_send_requests %d, coll_adapt_ireduce_max_recv_requests %d\n",
530526
root, mca_coll_adapt_component.adapt_ireduce_algorithm,

ompi/mca/coll/adapt/coll_adapt_reduce.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ int ompi_coll_adapt_reduce(const void *sbuf, void *rbuf, int count, struct ompi_
1717
struct ompi_op_t *op, int root, struct ompi_communicator_t *comm,
1818
mca_coll_base_module_t * module)
1919
{
20-
if (count == 0) {
21-
return MPI_SUCCESS;
22-
}
2320
ompi_request_t *request = NULL;
2421
int err = ompi_coll_adapt_ireduce(sbuf, rbuf, count, dtype, op, root, comm, &request, module);
2522
if( MPI_SUCCESS != err ) {

ompi/mpi/c/ibcast.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ int MPI_Ibcast(void *buffer, int count, MPI_Datatype datatype,
100100

101101
if ((OMPI_COMM_IS_INTRA(comm) && ompi_comm_size(comm) <= 1) ||
102102
0 == count) {
103+
*request = &ompi_request_empty;
103104
return MPI_SUCCESS;
104105
}
105106

0 commit comments

Comments
 (0)