From: Arnaud Giersch Date: Mon, 18 Feb 2013 20:34:33 +0000 (+0100) Subject: Move test outside the loop. X-Git-Tag: v3_9_90~491^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/dea9e2082cf825036672c33ca943620826e9bf7a?hp=ece04558b837066e1020da44442f97782e3cb71c Move test outside the loop. --- diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 84e314ce45..150cdfb0e5 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -767,16 +767,15 @@ int smpi_mpi_waitall(int count, MPI_Request requests[], int index, c; MPI_Status stat; MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat; - int retvalue=MPI_SUCCESS; + int retvalue = MPI_SUCCESS; //tag invalid requests in the set - for(c = 0; c < count; c++) { - if(requests[c]==MPI_REQUEST_NULL || requests[c]->dst == MPI_PROC_NULL ){ - if(status != MPI_STATUSES_IGNORE) + if (status != MPI_STATUSES_IGNORE) { + for (c = 0; c < count; c++) { + if (requests[c] == MPI_REQUEST_NULL || requests[c]->dst == MPI_PROC_NULL) { smpi_empty_status(&status[c]); - }else if(requests[c]->src == MPI_PROC_NULL ){ - if(status != MPI_STATUSES_IGNORE) { + } else if (requests[c]->src == MPI_PROC_NULL) { smpi_empty_status(&status[c]); - status[c].MPI_SOURCE=MPI_PROC_NULL; + status[c].MPI_SOURCE = MPI_PROC_NULL; } } }