[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.0.4-438-g7ddfa17

mysql vizuser noreply at mpich.org
Tue Aug 6 12:37:15 CDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  7ddfa17b5b811025293fadf000e7c5bbc6c32066 (commit)
      from  9a742ca5ec305b0654b5619be2f4ee86bdcb8047 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/7ddfa17b5b811025293fadf000e7c5bbc6c32066

commit 7ddfa17b5b811025293fadf000e7c5bbc6c32066
Author: Sameer Kumar <sameerk at us.ibm.com>
Date:   Thu Aug 1 05:12:43 2013 -0500

    Trac 665. Memory leak fix for MPI RMA.

diff --git a/src/mpid/pamid/src/onesided/mpid_1s.c b/src/mpid/pamid/src/onesided/mpid_1s.c
index 784d9a6..1353662 100644
--- a/src/mpid/pamid/src/onesided/mpid_1s.c
+++ b/src/mpid/pamid/src/onesided/mpid_1s.c
@@ -29,10 +29,10 @@ MPIDI_Win_DoneCB(pami_context_t  context,
 {
   MPIDI_Win_request *req = (MPIDI_Win_request*)cookie;
   ++req->win->mpid.sync.complete;
+  ++req->origin.completed;
 
   if ((req->buffer_free) && (req->type == MPIDI_WIN_REQUEST_GET))
     {
-      ++req->origin.completed;
       if (req->origin.completed == req->target.dt.num_contig)
         {
           int mpi_errno;
@@ -49,7 +49,8 @@ MPIDI_Win_DoneCB(pami_context_t  context,
         }
     }
 
-  if (req->win->mpid.sync.total == req->win->mpid.sync.complete)
+  //if (req->win->mpid.sync.total == req->win->mpid.sync.complete)
+  if (req->origin.completed == req->target.dt.num_contig)
     {
       if (req->buffer_free)
         MPIU_Free(req->buffer);
diff --git a/src/mpid/pamid/src/onesided/mpid_win_accumulate.c b/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
index b34c083..287c7eb 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
@@ -107,7 +107,12 @@ MPIDI_Accumulate(pami_context_t   context,
     TRACE_ERR("  Sub     index=%u  bytes=%zu  l-offset=%zu  r-addr=%p  l-buf=%p  *(int*)buf=0x%08x  *(double*)buf=%g\n",
               req->state.index, params.send.data.iov_len, req->state.local_offset, req->accum_headers[req->state.index].addr, buf, *ibuf, *dbuf);
 #endif
-      if (sync->total - sync->complete == 1) {
+
+    /** sync->total will be updated with every RMA and the complete
+	will not change till that RMA has completed. In the meanwhile
+	the rest of the RMAs will have memory leaks */
+      if (req->target.dt.num_contig - req->state.index == 1) {
+      //if (sync->total - sync->complete == 1) {
           map=NULL;
           if (req->target.dt.map != &req->target.dt.__map) {
               map=(void *) req->target.dt.map;
diff --git a/src/mpid/pamid/src/onesided/mpid_win_get.c b/src/mpid/pamid/src/onesided/mpid_win_get.c
index 79a1c0b..7d3c4e5 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_get.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_get.c
@@ -99,7 +99,12 @@ MPIDI_Get_use_pami_rget(pami_context_t context, MPIDI_Win_request * req, int *fr
     unsigned* buf = (unsigned*)(req->buffer + params.rdma.local.offset);
 #endif
     TRACE_ERR("  Sub     index=%u  bytes=%zu  l-offset=%zu  r-offset=%zu  buf=%p  *(int*)buf=0x%08x\n", req->state.index, params.rma.bytes, params.rdma.local.offset, params.rdma.remote.offset, buf, *buf);
-      if (sync->total - sync->complete == 1) {
+
+    /** sync->total will be updated with every RMA and the complete
+	will not change till that RMA has completed. In the meanwhile
+	the rest of the RMAs will have memory leaks */
+    if (req->target.dt.num_contig - req->state.index == 1) {
+    //if (sync->total - sync->complete == 1) {
           map=NULL;
           if (req->target.dt.map != &req->target.dt.__map) {
               map=(void *) req->target.dt.map;
@@ -164,7 +169,12 @@ MPIDI_Get_use_pami_get(pami_context_t context, MPIDI_Win_request * req, int *fre
 #endif
     TRACE_ERR("  Sub     index=%u  bytes=%zu  l-offset=%zu  r-offset=%zu  buf=%p  *(int*)buf=0x%08x\n",
 	      req->state.index, params.rma.bytes, params.rdma.local.offset, params.rdma.remote.offset, buf, *buf);
-    if (sync->total - sync->complete == 1) {
+    
+    /** sync->total will be updated with every RMA and the complete
+	will not change till that RMA has completed. In the meanwhile
+	the rest of the RMAs will have memory leaks */
+    if (req->target.dt.num_contig - req->state.index == 1) {
+    //if (sync->total - sync->complete == 1) {
         map=NULL;
         if (req->target.dt.map != &req->target.dt.__map) {
             map=(void *) req->target.dt.map;
diff --git a/src/mpid/pamid/src/onesided/mpid_win_put.c b/src/mpid/pamid/src/onesided/mpid_win_put.c
index ecfd444..9995386 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_put.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_put.c
@@ -101,7 +101,12 @@ MPIDI_Put_use_pami_rput(pami_context_t context, MPIDI_Win_request * req,int *fre
 #endif
     TRACE_ERR("  Sub     index=%u  bytes=%zu  l-offset=%zu  r-offset=%zu  buf=%p  *(int*)buf=0x%08x\n",
 	      req->state.index, params.rma.bytes, params.rdma.local.offset, params.rdma.remote.offset, buf, *buf);
-    if (sync->total - sync->complete == 1) {
+
+    /** sync->total will be updated with every RMA and the complete
+	will not change till that RMA has completed. In the meanwhile
+	the rest of the RMAs will have memory leaks */
+    if (req->target.dt.num_contig - req->state.index == 1) {
+    //if (sync->total - sync->complete == 1) {
          map=NULL;
          if (req->target.dt.map != &req->target.dt.__map) {
              map=(void *) req->target.dt.map;
@@ -166,7 +171,11 @@ MPIDI_Put_use_pami_put(pami_context_t   context, MPIDI_Win_request * req,int *fr
 #endif
     TRACE_ERR("  Sub     index=%u  bytes=%zu  l-offset=%zu  r-offset=%zu  buf=%p  *(int*)buf=0x%08x\n",
 	      req->state.index, params.rma.bytes, params.addr.local, params.addr.remote, buf, *buf);
-    if (sync->total - sync->complete == 1) {
+
+    /** sync->total will be updated with every RMA and the complete
+	will not change till that RMA has completed. In the meanwhile
+	the rest of the RMAs will have memory leaks */
+    if (req->target.dt.num_contig - req->state.index == 1) {
         map=NULL;
         if (req->target.dt.map != &req->target.dt.__map) {
             map=(void *) req->target.dt.map;
@@ -338,7 +347,6 @@ MPID_Put(void         *origin_addr,
   MPIDI_Win_datatype_map(&req->target.dt);
   win->mpid.sync.total += req->target.dt.num_contig;
 
-
   /* The pamid one-sided design requires context post in order to handle the
    * case where the number of pending rma operation exceeds the
    * 'PAMID_RMA_PENDING' threshold. When there are too many pending requests the
@@ -351,7 +359,8 @@ MPID_Put(void         *origin_addr,
    *        the rma pending threshold has been reached. This would result in
    *        better latency for one-sided operations.
    */
-  PAMI_Context_post(MPIDI_Context[0], &req->post_request, MPIDI_Put, req);
+  PAMI_Context_post(MPIDI_Context[0], &req->post_request, MPIDI_Put, req);  
+  //MPIDI_Put(MPIDI_Context[0], req);
 
 fn_fail:
   return mpi_errno;

-----------------------------------------------------------------------

Summary of changes:
 src/mpid/pamid/src/onesided/mpid_1s.c             |    5 +++--
 src/mpid/pamid/src/onesided/mpid_win_accumulate.c |    7 ++++++-
 src/mpid/pamid/src/onesided/mpid_win_get.c        |   14 ++++++++++++--
 src/mpid/pamid/src/onesided/mpid_win_put.c        |   17 +++++++++++++----
 4 files changed, 34 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list