Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do not request status if not requested by caller.
authoragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 1 Dec 2010 22:00:16 +0000 (22:00 +0000)
committeragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 1 Dec 2010 22:00:16 +0000 (22:00 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8838 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/smpi/smpi_base.c

index b80e0fe..be4baca 100644 (file)
@@ -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--;
   }