X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5fbc4068e8a02ebb8b1acc6437ef8f7dc7f66ec2..d0b936ef3c1f05eb3b9b15011ca58c3d55f6901e:/src/smpi/smpi_base.c 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--; } }