From d61adf0b3725230ab5f89e2c8daa263449c6baf0 Mon Sep 17 00:00:00 2001 From: pini Date: Mon, 24 Jan 2011 16:17:40 +0000 Subject: [PATCH] Use a linear sweep waitall when MC is enabled. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9484 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/smpi/smpi_base.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 16eaeb94ac..6822762096 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -6,6 +6,7 @@ #include "private.h" #include "xbt/time.h" +#include "mc/mc.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_base, smpi, "Logging specific to SMPI (base)"); @@ -313,16 +314,19 @@ void smpi_mpi_waitall(int count, MPI_Request requests[], MPI_Status stat; MPI_Status *pstat = status == MPI_STATUS_IGNORE ? MPI_STATUS_IGNORE : &stat; - c = count; - while(c > 0) { - index = smpi_mpi_waitany(count, requests, pstat); - if(index == MPI_UNDEFINED) { - break; + for(c = 0; c < count; c++) { + if(MC_IS_ENABLED) { + smpi_mpi_wait(&requests[c], pstat); + index = c; + } else { + index = smpi_mpi_waitany(count, requests, pstat); + if(index == MPI_UNDEFINED) { + break; + } } if(status != MPI_STATUS_IGNORE) { - memcpy(&status[index], pstat, sizeof *pstat); + memcpy(&status[index], pstat, sizeof(*pstat)); } - c--; } } -- 2.20.1