Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix rma
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 1 Sep 2016 18:35:06 +0000 (20:35 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 1 Sep 2016 18:35:06 +0000 (20:35 +0200)
src/smpi/smpi_rma.cpp

index c15a1aa..21f3e02 100644 (file)
@@ -1,4 +1,3 @@
-
 /* Copyright (c) 2007-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
@@ -118,7 +117,7 @@ int smpi_mpi_win_fence( int assert,  MPI_Win win){
     int size = static_cast<int>(reqs->size());
     // start all requests that have been prepared by another process
     for(auto req: *reqs){
-      if (req->flags & PREPARED) 
+      if (req && (req->flags & PREPARED))
         smpi_mpi_start(req);
     }
 
@@ -341,13 +340,13 @@ int smpi_mpi_win_complete(MPI_Win win){
   XBT_DEBUG("Win_complete - Finishing %d RMA calls", size);
   // start all requests that have been prepared by another process
   for (auto req: *reqqs){
-    if (req->flags & PREPARED) 
+    if (req && (req->flags & PREPARED))
       smpi_mpi_start(req);
   }
 
   MPI_Request* treqs = &(*reqqs)[0];
   smpi_mpi_waitall(size,treqs,MPI_STATUSES_IGNORE);
-  delete reqqs;
+  reqqs->clear();
   smpi_group_unuse(win->group);
   win->opened--; //we're closed for business !
   return MPI_SUCCESS;
@@ -384,13 +383,13 @@ int smpi_mpi_win_wait(MPI_Win win){
 
   // start all requests that have been prepared by another process
   for(auto req: *reqqs){
-    if (req->flags & PREPARED) 
+    if (req && (req->flags & PREPARED))
       smpi_mpi_start(req);
   }
 
   MPI_Request* treqs = &(*reqqs)[0];
   smpi_mpi_waitall(size,treqs,MPI_STATUSES_IGNORE);
-  delete reqqs;
+  reqqs->clear();
   smpi_group_unuse(win->group);
   win->opened--; //we're opened for business !
   return MPI_SUCCESS;