From 488566dad1ae2b42f26a8e291824ff9b16a976f7 Mon Sep 17 00:00:00 2001 From: agiersch Date: Wed, 1 Dec 2010 22:00:16 +0000 Subject: [PATCH] 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 --- src/smpi/smpi_base.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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--; } -- 2.20.1