X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1d2a442708064da9020cf0574bc35ba0b6f712e6..9ad959d48fa6a513def7651fbcc70f50ad0f0c04:/src/smpi/smpi_base.c diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 380f9dbe2e..f64a3d9f53 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -20,10 +20,10 @@ void smpi_process_init(int* argc, char*** argv) { proc = SIMIX_process_self(); index = atoi((*argv)[1]); - free((*argv)[1]); data = smpi_process_remote_data(index); SIMIX_process_set_data(proc, data); if (*argc > 2) { + free((*argv)[1]); memmove(&(*argv)[1], &(*argv)[2], sizeof(char *) * (*argc - 2)); (*argv)[(*argc) - 1] = NULL; } @@ -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; } }