From: agiersch Date: Wed, 1 Dec 2010 22:00:16 +0000 (+0000) Subject: Do not request status if not requested by caller. X-Git-Tag: v3.6_beta2~1074 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/488566dad1ae2b42f26a8e291824ff9b16a976f7 Do not request status if not requested by caller. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8838 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index b80e0feb96..be4baca112 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -288,15 +288,16 @@ void smpi_mpi_waitall(int count, MPI_Request requests[], { int index, c; 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, &stat); + index = smpi_mpi_waitany(count, requests, pstat); if (index == MPI_UNDEFINED) { break; } if (status != MPI_STATUS_IGNORE) { - memcpy(&status[index], &stat, sizeof(stat)); + memcpy(&status[index], pstat, sizeof *pstat); } c--; }