[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1rc2-122-gd389a53

mysql vizuser noreply at mpich.org
Tue Dec 31 10:13:13 CST 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  d389a53484b975edbe7ba04d67d3d6bf73104827 (commit)
      from  1eb07c6e38c48e7d83649ed7a41630d1a9f98912 (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/d389a53484b975edbe7ba04d67d3d6bf73104827

commit d389a53484b975edbe7ba04d67d3d6bf73104827
Author: Haizhu Liu <haizhu at us.ibm.com>
Date:   Sun Oct 27 19:19:48 2013 -0400

    PAMID support of request based rma functions
    
    - add check epoch
    - changes after intergrating Sameer's get_accumulate
    - update to remove dependency on mpid data structure
    
    (ibm) F189038
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>
    
    Minor modifications by Pavan to minimize the changes in
    mpir_request.c, and to reduce duplication.  Collective requests and
    RMA requests are handled the same way.
    
    Signed-off-by: Pavan Balaji <balaji at mcs.anl.gov>

diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 9716a70..5f1bfc8 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -1424,6 +1424,7 @@ typedef enum MPID_Request_kind_t {
     MPID_UREQUEST,
     MPID_COLL_REQUEST,
     MPID_REQUEST_MPROBE, /* see NOTE-R1 */
+    MPID_WIN_REQUEST,
     MPID_LAST_REQUEST_KIND
 #ifdef MPID_DEV_REQUEST_KIND_DECL
     , MPID_DEV_REQUEST_KIND_DECL
diff --git a/src/mpi/pt2pt/mpir_request.c b/src/mpi/pt2pt/mpir_request.c
index 22d9154..121d0e7 100644
--- a/src/mpi/pt2pt/mpir_request.c
+++ b/src/mpi/pt2pt/mpir_request.c
@@ -214,6 +214,7 @@ int MPIR_Request_complete(MPI_Request * request, MPID_Request * request_ptr,
 	}
 
         case MPID_COLL_REQUEST:
+        case MPID_WIN_REQUEST:
         {
             MPIR_Request_extract_status(request_ptr, status);
             MPID_Request_release(request_ptr);
diff --git a/src/mpid/pamid/include/mpidi_datatypes.h b/src/mpid/pamid/include/mpidi_datatypes.h
index 1b4dee8..2b7ae56 100644
--- a/src/mpid/pamid/include/mpidi_datatypes.h
+++ b/src/mpid/pamid/include/mpidi_datatypes.h
@@ -295,6 +295,7 @@ struct MPIDI_Request
   int   idx;
   int   PR_idx;
 #endif
+  struct MPIDI_Win_request   *win_req; /* anchor of request based rma handle so as to free it properly when wait is called */
 };
 
 typedef void* fast_query_t;
@@ -489,6 +490,9 @@ struct MPIDI_Win
       } local;
     } lock;
   } sync;
+
+  int request_based;          /* flag for request based rma */
+  struct MPID_Request *rreq;  /* anchor of MPID_Request for request based rma */
 };
 
 /**
diff --git a/src/mpid/pamid/include/mpidi_thread.h b/src/mpid/pamid/include/mpidi_thread.h
index 5237742..5f3fb7e 100644
--- a/src/mpid/pamid/include/mpidi_thread.h
+++ b/src/mpid/pamid/include/mpidi_thread.h
@@ -100,8 +100,8 @@
 #define MPIU_THREAD_CS_INITFLAG_EXIT(_context)
 #define MPIU_THREAD_CS_MEMALLOC_ENTER(_context)
 #define MPIU_THREAD_CS_MEMALLOC_EXIT(_context)
-#define MPIU_THREAD_CS_MPI_OBJ_ENTER(_context)
-#define MPIU_THREAD_CS_MPI_OBJ_EXIT(_context)
+#define MPIU_THREAD_CS_MPI_OBJ_ENTER(_context)      MPIDI_CS_ENTER(5)
+#define MPIU_THREAD_CS_MPI_OBJ_EXIT(_context)       MPIDI_CS_EXIT(5)
 #define MPIU_THREAD_CS_MSGQUEUE_ENTER(_context)
 #define MPIU_THREAD_CS_MSGQUEUE_EXIT(_context)
 #define MPIU_THREAD_CS_PAMI_ENTER(_context)
diff --git a/src/mpid/pamid/src/misc/mpid_unimpl.c b/src/mpid/pamid/src/misc/mpid_unimpl.c
index 03e9783..6c6dea4 100644
--- a/src/mpid/pamid/src/misc/mpid_unimpl.c
+++ b/src/mpid/pamid/src/misc/mpid_unimpl.c
@@ -99,15 +99,6 @@ int MPID_Win_allocate_shared(MPI_Aint size, int disp_unit, MPID_Info *info_ptr,
   return 0;
 }
 
-int MPID_Rput(const void *origin_addr, int origin_count,
-              MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
-              int target_count, MPI_Datatype target_datatype, MPID_Win *win,
-              MPID_Request **request)
-{
-  MPID_abort();
-  return 0;
-}
-
 
 int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
                           void *result_addr, MPI_Datatype datatype, int target_rank,
@@ -117,24 +108,6 @@ int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
   return 0;
 }
 
-int MPID_Raccumulate(const void *origin_addr, int origin_count,
-                     MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
-                     int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win *win,
-                     MPID_Request **request)
-{
-  MPID_abort();
-  return 0;
-}
-
-int MPID_Rget_accumulate(const void *origin_addr, int origin_count,
-                         MPI_Datatype origin_datatype, void *result_addr, int result_count,
-                         MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
-                         int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win *win,
-                         MPID_Request **request)
-{
-  MPID_abort();
-  return 0;
-}
 
 int MPID_Fetch_and_op(const void *origin_addr, void *result_addr,
                       MPI_Datatype datatype, int target_rank, MPI_Aint target_disp,
@@ -152,13 +125,3 @@ int MPID_Win_shared_query(MPID_Win *win, int rank, MPI_Aint *size, int *disp_uni
 }
 
 
-int MPID_Rget(void *origin_addr, int origin_count,
-              MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
-              int target_count, MPI_Datatype target_datatype, MPID_Win *win,
-              MPID_Request **request)
-{
-  MPID_abort();
-  return 0;
-}
-
-
diff --git a/src/mpid/pamid/src/mpid_request.h b/src/mpid/pamid/src/mpid_request.h
index 86dea52..72a2ce6 100644
--- a/src/mpid/pamid/src/mpid_request.h
+++ b/src/mpid/pamid/src/mpid_request.h
@@ -265,6 +265,7 @@ MPID_Request_release_inline(MPID_Request *req)
   MPIU_Object_release_ref(req, &count);
   MPID_assert(count >= 0);
 
+
   if (count == 0)
   {
     MPID_assert(MPID_cc_is_complete(&req->cc));
@@ -275,6 +276,7 @@ MPID_Request_release_inline(MPID_Request *req)
     if (req->mpid.uebuf_malloc== mpiuMalloc) {
         MPIU_Free(req->mpid.uebuf);
     }
+    if(req->mpid.win_req)       MPIU_Free(req->mpid.win_req);
 #if TOKEN_FLOW_CONTROL
     else if (req->mpid.uebuf_malloc == mpidiBufMM) {
         MPIU_THREAD_CS_ENTER(MSGQUEUE,0);
diff --git a/src/mpid/pamid/src/onesided/Makefile.mk b/src/mpid/pamid/src/onesided/Makefile.mk
index 901e6ab..3497b71 100644
--- a/src/mpid/pamid/src/onesided/Makefile.mk
+++ b/src/mpid/pamid/src/onesided/Makefile.mk
@@ -45,6 +45,7 @@ lib_lib at MPILIBNAME@_la_SOURCES +=                                    \
   src/mpid/pamid/src/onesided/mpid_win_sync.c                        \
   src/mpid/pamid/src/onesided/mpid_win_get_info.c                    \
   src/mpid/pamid/src/onesided/mpid_win_set_info.c                    \
+  src/mpid/pamid/src/onesided/mpid_win_reqops.c                      \
   src/mpid/pamid/src/onesided/mpidi_win_control.c
 
 
diff --git a/src/mpid/pamid/src/onesided/mpid_1s.c b/src/mpid/pamid/src/onesided/mpid_1s.c
index ca9f8dc..7398174 100644
--- a/src/mpid/pamid/src/onesided/mpid_1s.c
+++ b/src/mpid/pamid/src/onesided/mpid_1s.c
@@ -56,6 +56,10 @@ MPIDI_Win_DoneCB(pami_context_t  context,
   if (req->origin.completed == req->target.dt.num_contig)
     {
       req->win->mpid.origin[target_rank].nCompleted++;
+	if(req->req_handle) {
+          MPID_cc_set(req->req_handle->cc_ptr, 0);
+        }
+
       if (req->buffer_free) {
           MPIU_Free(req->buffer);
           MPIU_Free(req->user_buffer);
@@ -63,7 +67,9 @@ MPIDI_Win_DoneCB(pami_context_t  context,
       }
       if (req->accum_headers)
         MPIU_Free(req->accum_headers);
-      MPIU_Free(req);
+
+      if( (req->type != MPIDI_WIN_REQUEST_RPUT) && (req->type != MPIDI_WIN_REQUEST_RGET) && (req->type != MPIDI_WIN_REQUEST_RACCUMULATE) && (req->type != MPIDI_WIN_REQUEST_RGET_ACCUMULATE) )
+        MPIU_Free(req);
     }
   MPIDI_Progress_signal();
 }
diff --git a/src/mpid/pamid/src/onesided/mpid_win_accumulate.c b/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
index ecdcf14..4f70997 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
@@ -173,7 +173,13 @@ MPID_Accumulate(void         *origin_addr,
   MPIDI_Win_request *req = MPIU_Calloc0(1, MPIDI_Win_request);
   *req = zero_req;
   req->win          = win;
-  req->type         = MPIDI_WIN_REQUEST_ACCUMULATE;
+  if(win->mpid.request_based != 1)
+    req->type         = MPIDI_WIN_REQUEST_ACCUMULATE;
+  else {
+    req->type         = MPIDI_WIN_REQUEST_RACCUMULATE;
+    req->req_handle   = win->mpid.rreq;
+    req->req_handle->mpid.win_req = req;
+  }
 
   if(win->mpid.sync.origin_epoch_type == win->mpid.sync.target_epoch_type &&
      win->mpid.sync.origin_epoch_type == MPID_EPOTYPE_REFENCE){
@@ -188,7 +194,6 @@ MPID_Accumulate(void         *origin_addr,
   }
 
   req->offset = target_disp * win->mpid.info[target_rank].disp_unit;
-  win->mpid.origin[target_rank].nStarted++; 
 
   if (origin_datatype == MPI_DOUBLE_INT)
     {
@@ -241,10 +246,13 @@ MPID_Accumulate(void         *origin_addr,
   if ( (req->origin.dt.size == 0) ||
        (target_rank == MPI_PROC_NULL))
     {
-      win->mpid.origin[target_rank].nCompleted++;
-      MPIU_Free(req);
+      if(req->req_handle)
+        MPID_cc_set(req->req_handle->cc_ptr, 0);
+      else
+        MPIU_Free(req);
       return MPI_SUCCESS;
     }
+  win->mpid.origin[target_rank].nStarted++; 
 
   req->target.rank = target_rank;
 
diff --git a/src/mpid/pamid/src/onesided/mpid_win_get.c b/src/mpid/pamid/src/onesided/mpid_win_get.c
index ce40242..fd8ea46 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_get.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_get.c
@@ -216,7 +216,13 @@ MPID_Get(void         *origin_addr,
   MPIDI_Win_request *req = MPIU_Calloc0(1, MPIDI_Win_request);
   *req = zero_req;
   req->win          = win;
-  req->type         = MPIDI_WIN_REQUEST_GET;
+  if(win->mpid.request_based != 1) 
+    req->type         = MPIDI_WIN_REQUEST_GET;
+  else {
+    req->req_handle   = win->mpid.rreq;
+    req->type         = MPIDI_WIN_REQUEST_RGET;
+    req->req_handle->mpid.win_req = req;
+  }
 
   if(win->mpid.sync.origin_epoch_type == win->mpid.sync.target_epoch_type &&
      win->mpid.sync.origin_epoch_type == MPID_EPOTYPE_REFENCE){
@@ -231,7 +237,6 @@ MPID_Get(void         *origin_addr,
   }
 
   req->offset = target_disp * win->mpid.info[target_rank].disp_unit;
-  win->mpid.origin[target_rank].nStarted++;
 
   MPIDI_Win_datatype_basic(origin_count,
                            origin_datatype,
@@ -248,16 +253,23 @@ MPID_Get(void         *origin_addr,
   if ( (req->origin.dt.size == 0) ||
        (target_rank == MPI_PROC_NULL))
     {
-      MPIU_Free(req);
+      if(req->req_handle)
+         MPID_cc_set(req->req_handle->cc_ptr, 0);
+      else
+         MPIU_Free(req);
       return MPI_SUCCESS;
     }
+  win->mpid.origin[target_rank].nStarted++;
 
   /* If the get is a local operation, do it here */
   if (target_rank == win->comm_ptr->rank)
     {
       size_t offset = req->offset;
-      req->win->mpid.origin[target_rank].nCompleted++;
-      MPIU_Free(req);
+      win->mpid.origin[target_rank].nCompleted++;
+      if(req->req_handle)
+        MPID_cc_set(req->req_handle->cc_ptr, 0);
+      else
+        MPIU_Free(req);
       return MPIR_Localcopy(win->base + offset,
                             target_count,
                             target_datatype,
diff --git a/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c b/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c
index 085f3ce..b8779e1 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c
@@ -161,11 +161,18 @@ MPIDI_Win_GetAccDoneCB(pami_context_t  context,
   if (req->origin.completed == 
       (req->result_num_contig + req->target.dt.num_contig))
     {
-      if (req->buffer_free)
-        MPIU_Free(req->buffer);
+      if(req->req_handle)
+          MPID_cc_set(req->req_handle->cc_ptr, 0);
+
+      if (req->buffer_free) {
+          MPIU_Free(req->buffer);
+          req->buffer_free = 0;
+      }
       if (req->accum_headers)
         MPIU_Free(req->accum_headers);
-      MPIU_Free (req);
+
+      if( req->type != MPIDI_WIN_REQUEST_RGET_ACCUMULATE )
+        MPIU_Free(req);
     }
   MPIDI_Progress_signal();
 }
@@ -323,7 +330,13 @@ MPID_Get_accumulate(const void   * origin_addr,
   MPIDI_Win_request *req;
   req = MPIU_Calloc0(1, MPIDI_Win_request);
   req->win      = win;
-  req->type     = MPIDI_WIN_REQUEST_ACCUMULATE,
+  if(win->mpid.request_based != 1) 
+    req->type         = MPIDI_WIN_REQUEST_GET_ACCUMULATE;
+  else {
+    req->req_handle   = win->mpid.rreq;
+    req->type         = MPIDI_WIN_REQUEST_RGET_ACCUMULATE;
+    req->req_handle->mpid.win_req = req;
+  }
   req->offset   = target_disp*win->mpid.info[target_rank].disp_unit;
 #ifdef __BGQ__
   /* PAMI limitation as it doesnt permit VA of 0 to be passed into
@@ -397,7 +410,10 @@ MPID_Get_accumulate(const void   * origin_addr,
   if ( (req->origin.dt.size == 0) ||
        (target_rank == MPI_PROC_NULL))
     {
-      MPIU_Free (req);
+      if(req->req_handle)
+         MPID_cc_set(req->req_handle->cc_ptr, 0);
+      else
+         MPIU_Free(req);
       return MPI_SUCCESS;
     }
 
diff --git a/src/mpid/pamid/src/onesided/mpid_win_put.c b/src/mpid/pamid/src/onesided/mpid_win_put.c
index 70564fb..7132783 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_put.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_put.c
@@ -229,7 +229,13 @@ MPID_Put(void         *origin_addr,
   MPIDI_Win_request *req = MPIU_Calloc0(1, MPIDI_Win_request);
   *req = zero_req;
   req->win          = win;
-  req->type         = MPIDI_WIN_REQUEST_PUT;
+  if(win->mpid.request_based != 1) 
+    req->type         = MPIDI_WIN_REQUEST_PUT;
+  else {
+    req->req_handle   = win->mpid.rreq;
+    req->type         = MPIDI_WIN_REQUEST_RPUT;
+    req->req_handle->mpid.win_req = req;
+  }
 
   if(win->mpid.sync.origin_epoch_type == win->mpid.sync.target_epoch_type &&
      win->mpid.sync.origin_epoch_type == MPID_EPOTYPE_REFENCE){
@@ -262,7 +268,10 @@ MPID_Put(void         *origin_addr,
   if ( (req->origin.dt.size == 0) ||
        (target_rank == MPI_PROC_NULL))
     {
-      MPIU_Free(req);
+      if(req->req_handle)
+       MPID_cc_set(req->req_handle->cc_ptr, 0);
+      else
+       MPIU_Free(req);
       return MPI_SUCCESS;
     }
 
@@ -273,7 +282,10 @@ MPID_Put(void         *origin_addr,
     {
       size_t offset = req->offset;
       win->mpid.origin[target_rank].nCompleted++;
-      MPIU_Free(req);
+      if(req->req_handle)
+        MPID_cc_set(req->req_handle->cc_ptr, 0);
+      else
+        MPIU_Free(req);
       return MPIR_Localcopy(origin_addr,
                             origin_count,
                             origin_datatype,
diff --git a/src/mpid/pamid/src/onesided/mpid_win_reqops.c b/src/mpid/pamid/src/onesided/mpid_win_reqops.c
new file mode 100644
index 0000000..129d5c8
--- /dev/null
+++ b/src/mpid/pamid/src/onesided/mpid_win_reqops.c
@@ -0,0 +1,278 @@
+/* begin_generated_IBM_copyright_prolog                             */
+/*                                                                  */
+/* This is an automatically generated copyright prolog.             */
+/* After initializing,  DO NOT MODIFY OR MOVE                       */
+/*  --------------------------------------------------------------- */
+/* Licensed Materials - Property of IBM                             */
+/* Blue Gene/Q 5765-PER 5765-PRP                                    */
+/*                                                                  */
+/* (C) Copyright IBM Corp. 2011, 2012 All Rights Reserved           */
+/* US Government Users Restricted Rights -                          */
+/* Use, duplication, or disclosure restricted                       */
+/* by GSA ADP Schedule Contract with IBM Corp.                      */
+/*                                                                  */
+/*  --------------------------------------------------------------- */
+/*                                                                  */
+/* end_generated_IBM_copyright_prolog                               */
+/*  (C)Copyright IBM Corp.  2007, 2011  */
+/**
+ * \file src/onesided/mpid_win_reqops.c
+ * \brief ???
+ */
+#include "mpidi_onesided.h"
+
+
+/**
+ * \brief MPI-PAMI glue for MPI_PUT function
+ *
+ * \param[in] origin_addr      Source buffer
+ * \param[in] origin_count     Number of datatype elements
+ * \param[in] origin_datatype  Source datatype
+ * \param[in] target_rank      Destination rank (target)
+ * \param[in] target_disp      Displacement factor in target buffer
+ * \param[in] target_count     Number of target datatype elements
+ * \param[in] target_datatype  Destination datatype
+ * \param[in] win              Window
+ * \return MPI_SUCCESS
+ */
+#undef FUNCNAME
+#define FUNCNAME MPID_Rput
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int
+MPID_Rput(const void  *origin_addr,
+         int           origin_count,
+         MPI_Datatype  origin_datatype,
+         int           target_rank,
+         MPI_Aint      target_disp,
+         int           target_count,
+         MPI_Datatype  target_datatype,
+         MPID_Win     *win,
+         MPID_Request **request)
+{
+    int mpi_errno = MPI_SUCCESS;
+    MPID_Datatype *dtp;
+    int dt_contig ATTRIBUTE((unused));
+    MPI_Aint dt_true_lb ATTRIBUTE((unused));
+    MPIDI_msg_sz_t data_sz;
+
+    if(win->mpid.sync.origin_epoch_type != MPID_EPOTYPE_LOCK &&
+       win->mpid.sync.origin_epoch_type != MPID_EPOTYPE_LOCK_ALL){
+      MPIU_ERR_SETANDSTMT(mpi_errno, MPI_ERR_RMA_SYNC,
+                          return mpi_errno, "**rmasync");
+    }
+  
+    MPIDI_Datatype_get_info(origin_count, origin_datatype,
+                            dt_contig, data_sz, dtp, dt_true_lb);
+
+    MPID_Request *rreq = MPIDI_Request_create2();
+    *request = rreq;
+    rreq->kind = MPID_WIN_REQUEST;
+    win->mpid.rreq = rreq;
+    win->mpid.request_based = 1;
+
+    /* Enqueue or perform the RMA operation */
+    mpi_errno = MPID_Put(origin_addr, origin_count,
+                         origin_datatype, target_rank,
+                         target_disp, target_count,
+                         target_datatype, win);
+    MPID_assert(mpi_errno == MPI_SUCCESS);
+
+}
+
+
+/**
+ * \brief MPI-PAMI glue for MPI_GET function
+ *
+ * \param[in] origin_addr      Source buffer
+ * \param[in] origin_count     Number of datatype elements
+ * \param[in] origin_datatype  Source datatype
+ * \param[in] target_rank      Destination rank (target)
+ * \param[in] target_disp      Displacement factor in target buffer
+ * \param[in] target_count     Number of target datatype elements
+ * \param[in] target_datatype  Destination datatype
+ * \param[in] win              Window
+ * \return MPI_SUCCESS
+ */
+#undef FUNCNAME
+#define FUNCNAME MPID_Rget
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int
+MPID_Rget(void         *origin_addr,
+         int           origin_count,
+         MPI_Datatype  origin_datatype,
+         int           target_rank,
+         MPI_Aint      target_disp,
+         int           target_count,
+         MPI_Datatype  target_datatype,
+         MPID_Win     *win,
+         MPID_Request **request)
+{
+    int mpi_errno = MPI_SUCCESS;
+    int dt_contig ATTRIBUTE((unused));
+    MPID_Datatype *dtp;
+    MPI_Aint dt_true_lb ATTRIBUTE((unused));
+    MPIDI_msg_sz_t data_sz;
+
+    if(win->mpid.sync.origin_epoch_type != MPID_EPOTYPE_LOCK &&
+       win->mpid.sync.origin_epoch_type != MPID_EPOTYPE_LOCK_ALL){
+      MPIU_ERR_SETANDSTMT(mpi_errno, MPI_ERR_RMA_SYNC,
+                          return mpi_errno, "**rmasync");
+    }
+
+    MPIDI_Datatype_get_info(origin_count, origin_datatype,
+                            dt_contig, data_sz, dtp, dt_true_lb);
+    
+    MPID_Request *rreq = MPIDI_Request_create2();
+    rreq->kind = MPID_WIN_REQUEST;
+    *request = rreq;
+    win->mpid.rreq = rreq;
+    win->mpid.request_based = 1;
+
+    mpi_errno = MPID_Get(origin_addr, origin_count,
+                         origin_datatype, target_rank,
+                         target_disp, target_count,
+                         target_datatype, win);
+    MPID_assert(mpi_errno == MPI_SUCCESS);
+}
+
+/**
+ * \brief MPI-PAMI glue for MPI_ACCUMULATE function
+ *
+ * According to the MPI Specification:
+ *
+ *        Each datatype argument must be a predefined datatype or
+ *        a derived datatype, where all basic components are of the
+ *        same predefined datatype. Both datatype arguments must be
+ *        constructed from the same predefined datatype.
+ *
+ * \param[in] origin_addr      Source buffer
+ * \param[in] origin_count     Number of datatype elements
+ * \param[in] origin_datatype  Source datatype
+ * \param[in] target_rank      Destination rank (target)
+ * \param[in] target_disp      Displacement factor in target buffer
+ * \param[in] target_count     Number of target datatype elements
+ * \param[in] target_datatype  Destination datatype
+ * \param[in] op               Operand to perform
+ * \param[in] win              Window
+ * \return MPI_SUCCESS
+ */
+#undef FUNCNAME
+#define FUNCNAME MPID_Raccumulate
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int
+MPID_Raccumulate(const void         *origin_addr,
+                int           origin_count,
+                MPI_Datatype  origin_datatype,
+                int           target_rank,
+                MPI_Aint      target_disp,
+                int           target_count,
+                MPI_Datatype  target_datatype,
+                MPI_Op        op,
+                MPID_Win     *win,
+                MPID_Request **request)
+{
+    int mpi_errno = MPI_SUCCESS;
+    int dt_contig ATTRIBUTE((unused));
+    MPID_Datatype *dtp;
+    MPIDI_msg_sz_t data_sz;
+    MPI_Aint dt_true_lb ATTRIBUTE((unused));
+
+    if(win->mpid.sync.origin_epoch_type != MPID_EPOTYPE_LOCK &&
+       win->mpid.sync.origin_epoch_type != MPID_EPOTYPE_LOCK_ALL){
+      MPIU_ERR_SETANDSTMT(mpi_errno, MPI_ERR_RMA_SYNC,
+                          return mpi_errno, "**rmasync");
+    }
+
+    MPIDI_Datatype_get_info(origin_count, origin_datatype,
+                            dt_contig, data_sz, dtp, dt_true_lb);
+
+    MPID_Request *rreq = MPIDI_Request_create2();
+    rreq->kind = MPID_WIN_REQUEST;
+    *request = rreq;
+    win->mpid.rreq = rreq;
+    win->mpid.request_based = 1;
+
+    /* Enqueue or perform the RMA operation */
+    mpi_errno = MPID_Accumulate(origin_addr, origin_count,
+                                origin_datatype, target_rank,
+                                target_disp, target_count,
+                                target_datatype, op, win);
+    MPID_assert(mpi_errno == MPI_SUCCESS);
+
+}
+
+
+/**
+ * \brief MPI-PAMI glue for MPI_ACCUMULATE function
+ *
+ * According to the MPI Specification:
+ *
+ *        Each datatype argument must be a predefined datatype or
+ *        a derived datatype, where all basic components are of the
+ *        same predefined datatype. Both datatype arguments must be
+ *        constructed from the same predefined datatype.
+ *
+ * \param[in] origin_addr      Source buffer
+ * \param[in] origin_count     Number of datatype elements
+ * \param[in] origin_datatype  Source datatype
+ * \param[in] target_rank      Destination rank (target)
+ * \param[in] target_disp      Displacement factor in target buffer
+ * \param[in] target_count     Number of target datatype elements
+ * \param[in] target_datatype  Destination datatype
+ * \param[in] op               Operand to perform
+ * \param[in] win              Window
+ * \return MPI_SUCCESS
+ */
+#undef FUNCNAME
+#define FUNCNAME MPID_Rget_accumulate
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int
+MPID_Rget_accumulate(const void         *origin_addr,
+                int           origin_count,
+                MPI_Datatype  origin_datatype,
+                void         *result_addr,
+                int           result_count,
+                MPI_Datatype  result_datatype,
+                int           target_rank,
+                MPI_Aint      target_disp,
+                int           target_count,
+                MPI_Datatype  target_datatype,
+                MPI_Op        op,
+                MPID_Win     *win,
+		MPID_Request **request)
+{
+
+    int mpi_errno = MPI_SUCCESS;
+    MPID_Datatype *dtp;
+    int dt_contig ATTRIBUTE((unused));
+    MPIDI_msg_sz_t data_sz;
+    MPI_Aint dt_true_lb ATTRIBUTE((unused));
+
+    if(win->mpid.sync.origin_epoch_type != MPID_EPOTYPE_LOCK &&
+       win->mpid.sync.origin_epoch_type != MPID_EPOTYPE_LOCK_ALL){
+      MPIU_ERR_SETANDSTMT(mpi_errno, MPI_ERR_RMA_SYNC,
+                          return mpi_errno, "**rmasync");
+    }
+
+    MPIDI_Datatype_get_info(origin_count, origin_datatype,
+                            dt_contig, data_sz, dtp, dt_true_lb);
+    MPID_Request *rreq = MPIDI_Request_create2();
+    rreq->kind = MPID_WIN_REQUEST;
+    *request = rreq;
+    win->mpid.rreq = rreq;
+    win->mpid.request_based = 1;
+
+    /* Enqueue or perform the RMA operation */
+    mpi_errno = MPID_Get_accumulate(origin_addr, origin_count,
+                                    origin_datatype, result_addr,
+                                    result_count, result_datatype,
+                                    target_rank, target_disp,
+                                    target_count, target_datatype,
+                                    op, win);
+    MPID_assert(mpi_errno == MPI_SUCCESS);
+}
+
diff --git a/src/mpid/pamid/src/onesided/mpidi_onesided.h b/src/mpid/pamid/src/onesided/mpidi_onesided.h
index e29b1e7..79d2981 100644
--- a/src/mpid/pamid/src/onesided/mpidi_onesided.h
+++ b/src/mpid/pamid/src/onesided/mpidi_onesided.h
@@ -52,6 +52,11 @@ typedef enum
     MPIDI_WIN_REQUEST_ACCUMULATE,
     MPIDI_WIN_REQUEST_GET,
     MPIDI_WIN_REQUEST_PUT,
+    MPIDI_WIN_REQUEST_GET_ACCUMULATE,
+    MPIDI_WIN_REQUEST_RACCUMULATE,
+    MPIDI_WIN_REQUEST_RGET,
+    MPIDI_WIN_REQUEST_RPUT,
+    MPIDI_WIN_REQUEST_RGET_ACCUMULATE,
   } MPIDI_Win_requesttype_t;
 
 typedef enum
@@ -180,6 +185,8 @@ typedef struct _mpidi_win_request
   MPI_Op     op;
   int        result_num_contig;   
 
+  int request_based;            /* flag for request based rma */
+  MPID_Request *req_handle;     /* anchor of MPID_Request struc for request based rma*/
 } MPIDI_Win_request;
 
 MPIDI_Win_request  zero_req;    /* used for init. request structure to 0 */

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

Summary of changes:
 src/include/mpiimpl.h                              |    1 +
 src/mpi/pt2pt/mpir_request.c                       |    1 +
 src/mpid/pamid/include/mpidi_datatypes.h           |    4 +
 src/mpid/pamid/include/mpidi_thread.h              |    4 +-
 src/mpid/pamid/src/misc/mpid_unimpl.c              |   37 ---
 src/mpid/pamid/src/mpid_request.h                  |    2 +
 src/mpid/pamid/src/onesided/Makefile.mk            |    1 +
 src/mpid/pamid/src/onesided/mpid_1s.c              |    8 +-
 src/mpid/pamid/src/onesided/mpid_win_accumulate.c  |   16 +-
 src/mpid/pamid/src/onesided/mpid_win_get.c         |   22 ++-
 .../pamid/src/onesided/mpid_win_get_accumulate.c   |   26 ++-
 src/mpid/pamid/src/onesided/mpid_win_put.c         |   18 +-
 src/mpid/pamid/src/onesided/mpid_win_reqops.c      |  278 ++++++++++++++++++++
 src/mpid/pamid/src/onesided/mpidi_onesided.h       |    7 +
 14 files changed, 368 insertions(+), 57 deletions(-)
 create mode 100644 src/mpid/pamid/src/onesided/mpid_win_reqops.c


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list