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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* 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.
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -29,16 +29,16 @@
|
|||||||
#include "ompi/mca/pml/pml.h"
|
#include "ompi/mca/pml/pml.h"
|
||||||
#include "coll_base_util.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,
|
ompi_datatype_t* sdatatype,
|
||||||
int dest, int stag,
|
int dest, int stag,
|
||||||
void* recvbuf, size_t rcount,
|
void* recvbuf, size_t rcount,
|
||||||
ompi_datatype_t* rdatatype,
|
ompi_datatype_t* rdatatype,
|
||||||
int source, int rtag,
|
int source, int rtag,
|
||||||
struct ompi_communicator_t* comm,
|
struct ompi_communicator_t* comm,
|
||||||
ompi_status_public_t* status )
|
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;
|
int err, line = 0;
|
||||||
size_t rtypesize, stypesize;
|
size_t rtypesize, stypesize;
|
||||||
ompi_request_t *req;
|
ompi_request_t *req;
|
||||||
@ -46,30 +46,21 @@ int ompi_coll_base_sendrecv_nonzero_actual( void* sendbuf, size_t scount,
|
|||||||
|
|
||||||
/* post new irecv */
|
/* post new irecv */
|
||||||
ompi_datatype_type_size(rdatatype, &rtypesize);
|
ompi_datatype_type_size(rdatatype, &rtypesize);
|
||||||
if (0 != rcount && 0 != rtypesize) {
|
err = MCA_PML_CALL(irecv( recvbuf, rcount, rdatatype, source, rtag,
|
||||||
err = MCA_PML_CALL(irecv( recvbuf, rcount, rdatatype, source, rtag,
|
comm, &req));
|
||||||
comm, &req));
|
if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; }
|
||||||
if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* send data to children */
|
/* send data to children */
|
||||||
ompi_datatype_type_size(sdatatype, &stypesize);
|
ompi_datatype_type_size(sdatatype, &stypesize);
|
||||||
if (0 != scount && 0 != stypesize) {
|
err = MCA_PML_CALL(send( sendbuf, scount, sdatatype, dest, stag,
|
||||||
err = MCA_PML_CALL(send( sendbuf, scount, sdatatype, dest, stag,
|
MCA_PML_BASE_SEND_STANDARD, comm));
|
||||||
MCA_PML_BASE_SEND_STANDARD, comm));
|
if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; }
|
||||||
if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; }
|
|
||||||
}
|
|
||||||
|
|
||||||
if (0 != rcount && 0 != rtypesize) {
|
err = ompi_request_wait( &req, &rstatus);
|
||||||
err = ompi_request_wait( &req, &rstatus);
|
if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; }
|
||||||
if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; }
|
|
||||||
|
|
||||||
if (MPI_STATUS_IGNORE != status) {
|
if (MPI_STATUS_IGNORE != status) {
|
||||||
*status = rstatus;
|
*status = rstatus;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if( MPI_STATUS_IGNORE != status )
|
|
||||||
*status = ompi_status_empty;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (MPI_SUCCESS);
|
return (MPI_SUCCESS);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* 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.
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -36,14 +36,14 @@ BEGIN_C_DECLS
|
|||||||
* If one of the communications results in a zero-byte message the
|
* If one of the communications results in a zero-byte message the
|
||||||
* communication is ignored, and no message will cross to the peer.
|
* 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,
|
ompi_datatype_t* sdatatype,
|
||||||
int dest, int stag,
|
int dest, int stag,
|
||||||
void* recvbuf, size_t rcount,
|
void* recvbuf, size_t rcount,
|
||||||
ompi_datatype_t* rdatatype,
|
ompi_datatype_t* rdatatype,
|
||||||
int source, int rtag,
|
int source, int rtag,
|
||||||
struct ompi_communicator_t* comm,
|
struct ompi_communicator_t* comm,
|
||||||
ompi_status_public_t* status );
|
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,
|
return (int) ompi_datatype_sndrcv(sendbuf, (int32_t) scount, sdatatype,
|
||||||
recvbuf, (int32_t) rcount, rdatatype);
|
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,
|
dest, stag,
|
||||||
recvbuf, rcount, rdatatype,
|
recvbuf, rcount, rdatatype,
|
||||||
source, rtag, comm, status);
|
source, rtag, comm, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_C_DECLS
|
END_C_DECLS
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user