From: Frederic Suter Date: Thu, 1 Sep 2016 18:35:06 +0000 (+0200) Subject: fix rma X-Git-Tag: v3_14~452 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9dbd9349f2135984825b4e0c714dc609d5fae59d fix rma --- diff --git a/src/smpi/smpi_rma.cpp b/src/smpi/smpi_rma.cpp index c15a1aa5d6..21f3e02ea0 100644 --- a/src/smpi/smpi_rma.cpp +++ b/src/smpi/smpi_rma.cpp @@ -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(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;