diff --git a/ompi/mca/coll/base/coll_base_util.c b/ompi/mca/coll/base/coll_base_util.c index 338146d404..68a160214c 100644 --- a/ompi/mca/coll/base/coll_base_util.c +++ b/ompi/mca/coll/base/coll_base_util.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -29,16 +29,16 @@ #include "ompi/mca/pml/pml.h" #include "coll_base_util.h" -int ompi_coll_base_sendrecv_nonzero_actual( void* sendbuf, size_t scount, - ompi_datatype_t* sdatatype, - int dest, int stag, - void* recvbuf, size_t rcount, - ompi_datatype_t* rdatatype, - int source, int rtag, - struct ompi_communicator_t* comm, - ompi_status_public_t* status ) +int ompi_coll_base_sendrecv_actual( void* sendbuf, size_t scount, + ompi_datatype_t* sdatatype, + int dest, int stag, + void* recvbuf, size_t rcount, + ompi_datatype_t* rdatatype, + int source, int rtag, + struct ompi_communicator_t* comm, + ompi_status_public_t* status ) -{ /* post receive first, then send, then waitall... should be fast (I hope) */ +{ /* post receive first, then send, then wait... should be fast (I hope) */ int err, line = 0; size_t rtypesize, stypesize; ompi_request_t *req; @@ -46,30 +46,21 @@ int ompi_coll_base_sendrecv_nonzero_actual( void* sendbuf, size_t scount, /* post new irecv */ ompi_datatype_type_size(rdatatype, &rtypesize); - if (0 != rcount && 0 != rtypesize) { - err = MCA_PML_CALL(irecv( recvbuf, rcount, rdatatype, source, rtag, - comm, &req)); - if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } - } + err = MCA_PML_CALL(irecv( recvbuf, rcount, rdatatype, source, rtag, + comm, &req)); + if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } /* send data to children */ ompi_datatype_type_size(sdatatype, &stypesize); - if (0 != scount && 0 != stypesize) { - err = MCA_PML_CALL(send( sendbuf, scount, sdatatype, dest, stag, - MCA_PML_BASE_SEND_STANDARD, comm)); - if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } - } + err = MCA_PML_CALL(send( sendbuf, scount, sdatatype, dest, stag, + MCA_PML_BASE_SEND_STANDARD, comm)); + if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } - if (0 != rcount && 0 != rtypesize) { - err = ompi_request_wait( &req, &rstatus); - if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } + err = ompi_request_wait( &req, &rstatus); + if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } - if (MPI_STATUS_IGNORE != status) { - *status = rstatus; - } - } else { - if( MPI_STATUS_IGNORE != status ) - *status = ompi_status_empty; + if (MPI_STATUS_IGNORE != status) { + *status = rstatus; } return (MPI_SUCCESS); diff --git a/ompi/mca/coll/base/coll_base_util.h b/ompi/mca/coll/base/coll_base_util.h index 12523d337f..9e053deae2 100644 --- a/ompi/mca/coll/base/coll_base_util.h +++ b/ompi/mca/coll/base/coll_base_util.h @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2014 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -36,14 +36,14 @@ BEGIN_C_DECLS * If one of the communications results in a zero-byte message the * communication is ignored, and no message will cross to the peer. */ -int ompi_coll_base_sendrecv_nonzero_actual( void* sendbuf, size_t scount, - ompi_datatype_t* sdatatype, - int dest, int stag, - void* recvbuf, size_t rcount, - ompi_datatype_t* rdatatype, - int source, int rtag, - struct ompi_communicator_t* comm, - ompi_status_public_t* status ); +int ompi_coll_base_sendrecv_actual( void* sendbuf, size_t scount, + ompi_datatype_t* sdatatype, + int dest, int stag, + void* recvbuf, size_t rcount, + ompi_datatype_t* rdatatype, + int source, int rtag, + struct ompi_communicator_t* comm, + ompi_status_public_t* status ); /** @@ -64,10 +64,10 @@ ompi_coll_base_sendrecv( void* sendbuf, size_t scount, ompi_datatype_t* sdatatyp return (int) ompi_datatype_sndrcv(sendbuf, (int32_t) scount, sdatatype, recvbuf, (int32_t) rcount, rdatatype); } - return ompi_coll_base_sendrecv_nonzero_actual (sendbuf, scount, sdatatype, - dest, stag, - recvbuf, rcount, rdatatype, - source, rtag, comm, status); + return ompi_coll_base_sendrecv_actual (sendbuf, scount, sdatatype, + dest, stag, + recvbuf, rcount, rdatatype, + source, rtag, comm, status); } END_C_DECLS