From: Stéphane Castelli Date: Wed, 14 May 2014 15:49:44 +0000 (+0200) Subject: Fix a bug in SMPI that leads to a segfault when one of the request in MPI_StartAll... X-Git-Tag: v3_11~76 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4777522533e6b8879482d71969295f683d6112dc?hp=e64ead1c56281b590f80a1eb71d974e76434f0ee Fix a bug in SMPI that leads to a segfault when one of the request in MPI_StartAll is MPI_REQUEST_NULL --- diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index 63e69db0f8..367176d3eb 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -923,7 +923,7 @@ int PMPI_Start(MPI_Request * request) smpi_bench_end(); if (request == NULL || *request == MPI_REQUEST_NULL) { - retval = MPI_ERR_ARG; + retval = MPI_ERR_REQUEST; } else { smpi_mpi_start(*request); retval = MPI_SUCCESS; @@ -935,13 +935,20 @@ int PMPI_Start(MPI_Request * request) int PMPI_Startall(int count, MPI_Request * requests) { int retval = 0; - + int i = 0; smpi_bench_end(); if (requests == NULL) { retval = MPI_ERR_ARG; } else { - smpi_mpi_startall(count, requests); - retval = MPI_SUCCESS; + for (i = 0 ; i < count ; i++) { + if(requests[i] == MPI_REQUEST_NULL) { + retval = MPI_ERR_REQUEST; + } + } + if(retval != MPI_ERR_REQUEST) { + smpi_mpi_startall(count, requests); + retval = MPI_SUCCESS; + } } smpi_bench_begin(); return retval;