X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/adbdcbddadcbd685b72259874d1ebfd9cbbcc497..8bf7ffc43ad5507982e924a7f05bbb13c89965cb:/src/smpi/mpi/smpi_request.cpp diff --git a/src/smpi/mpi/smpi_request.cpp b/src/smpi/mpi/smpi_request.cpp index 86130def39..64008cd40c 100644 --- a/src/smpi/mpi/smpi_request.cpp +++ b/src/smpi/mpi/smpi_request.cpp @@ -439,6 +439,29 @@ void Request::sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype } } +void Request::isendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,int dst, int sendtag, + void *recvbuf, int recvcount, MPI_Datatype recvtype, int src, int recvtag, + MPI_Comm comm, MPI_Request* request) +{ + aid_t source = MPI_PROC_NULL; + if (src == MPI_ANY_SOURCE) + source = MPI_ANY_SOURCE; + else if (src != MPI_PROC_NULL) + source = comm->group()->actor(src); + aid_t destination = dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL; + + (*request) = new Request( nullptr, 0, MPI_BYTE, + src,dst, sendtag, comm, MPI_REQ_PERSISTENT|MPI_REQ_NBC); + std::vector requests; + if (aid_t myid = simgrid::s4u::this_actor::get_pid(); (destination == myid) && (source == myid)) { + Datatype::copy(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype); + return; + } + requests.push_back(isend_init(sendbuf, sendcount, sendtype, dst, sendtag, comm)); + requests.push_back(irecv_init(recvbuf, recvcount, recvtype, src, recvtag, comm)); + (*request)->start_nbc_requests(requests); +} + void Request::start() { s4u::Mailbox* mailbox;