Skip to content

Commit

Permalink
Remove the code handling zero count cases in ADAPT.
Browse files Browse the repository at this point in the history
Set request in ibcast.c to empty when the count is 0.

Signed-off-by: Xi Luo <[email protected]>
Signed-off-by: George Bosilca <[email protected]>
  • Loading branch information
dycz0fx authored and jsquyres committed Aug 24, 2020
1 parent c2970a3 commit e59bde9
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 25 deletions.
3 changes: 0 additions & 3 deletions ompi/mca/coll/adapt/coll_adapt_bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
int ompi_coll_adapt_bcast(void *buff, int count, struct ompi_datatype_t *datatype, int root,
struct ompi_communicator_t *comm, mca_coll_base_module_t * module)
{
if (count == 0) {
return MPI_SUCCESS;
}
ompi_request_t *request = NULL;
int err = ompi_coll_adapt_ibcast(buff, count, datatype, root, comm, &request, module);
if( MPI_SUCCESS != err ) {
Expand Down
15 changes: 0 additions & 15 deletions ompi/mca/coll/adapt/coll_adapt_ibcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,21 +329,6 @@ int ompi_coll_adapt_ibcast(void *buff, int count, struct ompi_datatype_t *dataty
struct ompi_communicator_t *comm, ompi_request_t ** request,
mca_coll_base_module_t * module)
{
if (0 == count) {
ompi_request_t *temp_request = OBJ_NEW(ompi_request_t);
OMPI_REQUEST_INIT(temp_request, false);
temp_request->req_type = 0;
temp_request->req_free = ompi_coll_adapt_request_free;
temp_request->req_status.MPI_SOURCE = 0;
temp_request->req_status.MPI_TAG = 0;
temp_request->req_status.MPI_ERROR = 0;
temp_request->req_status._cancelled = 0;
temp_request->req_status._ucount = 0;
ompi_request_complete(temp_request, 1);
*request = temp_request;
return MPI_SUCCESS;
}

OPAL_OUTPUT_VERBOSE((10, mca_coll_adapt_component.adapt_output,
"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",
root, mca_coll_adapt_component.adapt_ibcast_algorithm,
Expand Down
4 changes: 0 additions & 4 deletions ompi/mca/coll/adapt/coll_adapt_ireduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,6 @@ int ompi_coll_adapt_ireduce(const void *sbuf, void *rbuf, int count, struct ompi
struct ompi_op_t *op, int root, struct ompi_communicator_t *comm,
ompi_request_t ** request, mca_coll_base_module_t * module)
{
if (count == 0) {
return MPI_SUCCESS;
}

OPAL_OUTPUT_VERBOSE((10, mca_coll_adapt_component.adapt_output,
"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",
root, mca_coll_adapt_component.adapt_ireduce_algorithm,
Expand Down
3 changes: 0 additions & 3 deletions ompi/mca/coll/adapt/coll_adapt_reduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ int ompi_coll_adapt_reduce(const void *sbuf, void *rbuf, int count, struct ompi_
struct ompi_op_t *op, int root, struct ompi_communicator_t *comm,
mca_coll_base_module_t * module)
{
if (count == 0) {
return MPI_SUCCESS;
}
ompi_request_t *request = NULL;
int err = ompi_coll_adapt_ireduce(sbuf, rbuf, count, dtype, op, root, comm, &request, module);
if( MPI_SUCCESS != err ) {
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/c/ibcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ int MPI_Ibcast(void *buffer, int count, MPI_Datatype datatype,

if ((OMPI_COMM_IS_INTRA(comm) && ompi_comm_size(comm) <= 1) ||
0 == count) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}

Expand Down

0 comments on commit e59bde9

Please sign in to comment.