X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ece04558b837066e1020da44442f97782e3cb71c..c6cb5a5160dfee6fbc85503a97eb59408853e494:/src/smpi/smpi_base.c diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 84e314ce45..8cb1cc8420 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -767,33 +767,31 @@ 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; } } } for(c = 0; c < count; c++) { - if(MC_is_active()) { - smpi_mpi_wait(&requests[c], pstat); - index = c; - } else { - index = smpi_mpi_waitany(count, requests, pstat); - if(index == MPI_UNDEFINED) { - break; - } - if (status != MPI_STATUSES_IGNORE) { - status[index] = *pstat; - if (status[index].MPI_ERROR == MPI_ERR_TRUNCATE) - retvalue = MPI_ERR_IN_STATUS; - } + if (MC_is_active()) { + smpi_mpi_wait(&requests[c], pstat); + index = c; + } else { + index = smpi_mpi_waitany(count, requests, pstat); + if (index == MPI_UNDEFINED) + break; + } + if (status != MPI_STATUSES_IGNORE) { + status[index] = *pstat; + if (status[index].MPI_ERROR == MPI_ERR_TRUNCATE) + retvalue = MPI_ERR_IN_STATUS; } }