From 9ad959d48fa6a513def7651fbcc70f50ad0f0c04 Mon Sep 17 00:00:00 2001 From: pini Date: Sat, 13 Mar 2010 16:23:47 +0000 Subject: [PATCH 1/1] Bugfix to dirty cleanup of SIMIX from SMPI. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7242 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/include/simix/simix.h | 1 + src/simix/private.h | 1 - src/smpi/smpi_base.c | 3 +++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/include/simix/simix.h b/src/include/simix/simix.h index 7c965fe302..631ab6881b 100644 --- a/src/include/simix/simix.h +++ b/src/include/simix/simix.h @@ -207,6 +207,7 @@ XBT_PUBLIC(void*) SIMIX_rdv_get_data(smx_rdv_t rdv); /*****Communication Requests*****/ XBT_INLINE XBT_PUBLIC(void) SIMIX_communication_cancel(smx_comm_t comm); +XBT_PUBLIC(void) SIMIX_communication_destroy(smx_comm_t comm); XBT_PUBLIC(double) SIMIX_communication_get_remains(smx_comm_t comm); XBT_PUBLIC(void *) SIMIX_communication_get_data(smx_comm_t comm); diff --git a/src/simix/private.h b/src/simix/private.h index b130cf9337..195a77db88 100644 --- a/src/simix/private.h +++ b/src/simix/private.h @@ -164,7 +164,6 @@ typedef struct s_smx_comm { void SIMIX_network_copy_data(smx_comm_t comm); smx_comm_t SIMIX_communication_new(smx_comm_type_t type); -void SIMIX_communication_destroy(smx_comm_t comm); static inline void SIMIX_communication_use(smx_comm_t comm); static inline void SIMIX_communication_wait_for_completion(smx_comm_t comm, double timeout); static inline void SIMIX_rdv_push(smx_rdv_t rdv, smx_comm_t comm); diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 333c590c91..f64a3d9f53 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -163,6 +163,8 @@ void smpi_mpi_wait(MPI_Request* request, MPI_Status* status) { // data is null if receiver waits before sender enters the rdv if(data == MPI_REQUEST_NULL || data->complete == 0) { SIMIX_network_wait((*request)->pair, -1.0); + } else { + SIMIX_communication_destroy((*request)->pair); } finish_wait(request, status); } @@ -181,6 +183,7 @@ int smpi_mpi_waitany(int count, MPI_Request requests[], MPI_Status* status) { data = (MPI_Request)SIMIX_communication_get_data(requests[i]->pair); if(data != MPI_REQUEST_NULL && data->complete == 1) { index = i; + SIMIX_communication_destroy(requests[index]->pair); // always succeeds (but cleans the simix layer) break; } } -- 2.20.1