X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/df18faac51d5f0b3ae8aa7d00bee5740c066aa81..5b12ffc140d1ca5f0014fbbe6196712933298939:/src/smpi/smpi_base.c diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 065bf7c758..d6e2514f65 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -14,6 +14,7 @@ XBT_LOG_EXTERNAL_CATEGORY(smpi_sender); XBT_LOG_EXTERNAL_CATEGORY(smpi_util); #define EAGER_LIMIT 65536 +#define RDV_TAG (-10) void smpi_process_init(int* argc, char*** argv) { int index; @@ -42,11 +43,15 @@ void smpi_process_destroy(void) { /* MPI Low level calls */ MPI_Request smpi_mpi_isend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) { MPI_Request request; + MPI_Request rdv[2]; size_t size = smpi_datatype_size(datatype) * count; if (size > EAGER_LIMIT) { /* Warning: this (zero-length synchronous) call will come back here with size == 0 */ - smpi_mpi_send (NULL, 0, MPI_BYTE, dst, tag, comm); + DEBUG1("RDV send to %d", dst); + rdv[0] = smpi_mpi_isend(NULL, 0, MPI_BYTE, dst, RDV_TAG, comm); + rdv[1] = smpi_mpi_irecv(NULL, 0, MPI_BYTE, dst, RDV_TAG, comm); + smpi_mpi_waitall(2, rdv, MPI_STATUS_IGNORE); } request = xbt_new(s_smpi_mpi_request_t, 1); request->comm = comm; @@ -63,11 +68,15 @@ MPI_Request smpi_mpi_isend(void* buf, int count, MPI_Datatype datatype, int dst, MPI_Request smpi_mpi_irecv(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm) { MPI_Request request; + MPI_Request rdv[2]; size_t size = smpi_datatype_size(datatype) * count; if (size > EAGER_LIMIT) { /* Warning: this (zero-length synchronous) call will come back here with size == 0 */ - smpi_mpi_recv (NULL, 0, MPI_BYTE, src, tag, comm, MPI_STATUS_IGNORE); + DEBUG1("RDV recv from %d", src); + rdv[0] = smpi_mpi_irecv(NULL, 0, MPI_BYTE, src, RDV_TAG, comm); + rdv[1] = smpi_mpi_isend(NULL, 0, MPI_BYTE, src, RDV_TAG, comm); + smpi_mpi_waitall(2, rdv, MPI_STATUS_IGNORE); } request = xbt_new(s_smpi_mpi_request_t, 1); request->comm = comm;