Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bugfix to dirty cleanup of SIMIX from SMPI.
authorpini <pini@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 13 Mar 2010 16:23:47 +0000 (16:23 +0000)
committerpini <pini@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 13 Mar 2010 16:23:47 +0000 (16:23 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7242 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/include/simix/simix.h
src/simix/private.h
src/smpi/smpi_base.c

index 7c965fe..631ab68 100644 (file)
@@ -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);
 
 /*****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);
 
 XBT_PUBLIC(double) SIMIX_communication_get_remains(smx_comm_t comm);
 XBT_PUBLIC(void *) SIMIX_communication_get_data(smx_comm_t comm);
 
index b130cf9..195a77d 100644 (file)
@@ -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_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);
 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);
index 333c590..f64a3d9 100644 (file)
@@ -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);
   // 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);
 }
   }
   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;
         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;
         }
       }
           break;
         }
       }