From d0b936ef3c1f05eb3b9b15011ca58c3d55f6901e Mon Sep 17 00:00:00 2001 From: pini Date: Tue, 30 Nov 2010 16:14:54 +0000 Subject: [PATCH] Bugfix: statuses were wrongly accessed. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8768 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/smpi/smpi_base.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 688a805edf..b80e0feb96 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -286,10 +286,11 @@ int smpi_mpi_waitany(int count, MPI_Request requests[], void smpi_mpi_waitall(int count, MPI_Request requests[], MPI_Status status[]) { - int index; + int index, c; MPI_Status stat; - while (count > 0) { + c = count; + while (c > 0) { index = smpi_mpi_waitany(count, requests, &stat); if (index == MPI_UNDEFINED) { break; @@ -297,11 +298,7 @@ void smpi_mpi_waitall(int count, MPI_Request requests[], if (status != MPI_STATUS_IGNORE) { memcpy(&status[index], &stat, sizeof(stat)); } - // FIXME: check this -v - // Move the last request to the found position - requests[index] = requests[count - 1]; - requests[count - 1] = MPI_REQUEST_NULL; - count--; + c--; } } -- 2.20.1