From 55a9b9fe5663cb2fe2398c14f0e9b11d4a31e3b3 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Thu, 6 Feb 2014 17:59:15 +0100 Subject: [PATCH] fix some SMPI+MC bugs --- src/simix/smx_network.c | 2 +- src/smpi/smpi_base.c | 3 +-- src/smpi/smpi_global.c | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/simix/smx_network.c b/src/simix/smx_network.c index 0de05fa5d7..ab44443d27 100644 --- a/src/simix/smx_network.c +++ b/src/simix/smx_network.c @@ -445,7 +445,7 @@ smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv, if (MC_is_active()) { other_action->state = SIMIX_RUNNING; - return other_action; + return (detached ? NULL : other_action); } SIMIX_comm_start(other_action); diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 9109101f17..2d6a64bbce 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -764,12 +764,11 @@ void smpi_mpi_wait(MPI_Request * request, MPI_Status * status) if ((*request)->action != NULL) { // this is not a detached send simcall_comm_wait((*request)->action, -1.0); - } - #ifdef HAVE_MC if(MC_is_active()) (*request)->action->comm.dst_data = NULL; // dangling pointer : dst_data is freed with a wait, need to set it to NULL for system state comparison #endif + } finish_wait(request, status); *request = MPI_REQUEST_NULL; diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index 0339c33323..0ff30a4c9c 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -100,6 +100,7 @@ void smpi_process_destroy(void) void smpi_process_finalize(void) { // wait for all pending asynchronous comms to finish + if(!MC_is_active()) while (SIMIX_process_has_pending_comms(SIMIX_process_self())) { simcall_process_sleep(0.01); } -- 2.20.1