coll/base: have ompi_coll_base_sendrecv() send/recv zero-bytes messages
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Этот коммит содержится в:
родитель
9a69b20d09
Коммит
5492edd71e
@ -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,7 +29,7 @@
|
||||
#include "ompi/mca/pml/pml.h"
|
||||
#include "coll_base_util.h"
|
||||
|
||||
int ompi_coll_base_sendrecv_nonzero_actual( void* sendbuf, size_t scount,
|
||||
int ompi_coll_base_sendrecv_actual( void* sendbuf, size_t scount,
|
||||
ompi_datatype_t* sdatatype,
|
||||
int dest, int stag,
|
||||
void* recvbuf, size_t rcount,
|
||||
@ -38,7 +38,7 @@ int ompi_coll_base_sendrecv_nonzero_actual( void* sendbuf, size_t scount,
|
||||
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,31 +46,22 @@ 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; }
|
||||
}
|
||||
|
||||
/* 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; }
|
||||
}
|
||||
|
||||
if (0 != rcount && 0 != rtypesize) {
|
||||
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;
|
||||
}
|
||||
|
||||
return (MPI_SUCCESS);
|
||||
|
||||
|
@ -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,7 +36,7 @@ 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,
|
||||
int ompi_coll_base_sendrecv_actual( void* sendbuf, size_t scount,
|
||||
ompi_datatype_t* sdatatype,
|
||||
int dest, int stag,
|
||||
void* recvbuf, size_t rcount,
|
||||
@ -64,7 +64,7 @@ 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,
|
||||
return ompi_coll_base_sendrecv_actual (sendbuf, scount, sdatatype,
|
||||
dest, stag,
|
||||
recvbuf, rcount, rdatatype,
|
||||
source, rtag, comm, status);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user