From 4777522533e6b8879482d71969295f683d6112dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Castelli?= Date: Wed, 14 May 2014 17:49:44 +0200 Subject: [PATCH] Fix a bug in SMPI that leads to a segfault when one of the request in MPI_StartAll is MPI_REQUEST_NULL --- src/smpi/smpi_pmpi.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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; -- 2.20.1