From dea9e2082cf825036672c33ca943620826e9bf7a Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 18 Feb 2013 21:34:33 +0100 Subject: [PATCH] Move test outside the loop. --- src/smpi/smpi_base.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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; } } } -- 2.20.1