[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1.2-66-g658ff0d

Service Account noreply at mpich.org
Mon Aug 4 12:28:32 CDT 2014


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  658ff0d92533793bf453fc079e2b96cf576ac1f4 (commit)
       via  6b7f60e76177def5f603f04ffe79c17b495f144d (commit)
       via  2caecaceac3bbe87720e9c1eb4a65bfea64ace32 (commit)
       via  11314276d9c0cc0aadd199745b99bf063b1e38ed (commit)
       via  3ac6a32ea03936403111d43956168361ab9ffcdc (commit)
      from  122dbd96b2df6e517fe1589fac0133d1bc381db6 (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/658ff0d92533793bf453fc079e2b96cf576ac1f4

commit 658ff0d92533793bf453fc079e2b96cf576ac1f4
Author: Michael Blocksome <blocksom at us.ibm.com>
Date:   Fri Aug 1 13:09:59 2014 -0500

    pamid: fix MPI_MODE_NOPRECEDE assertion
    
    The user assertion 'MPI_MODE_NOPRECEDE' for MPI_Win_fence() does not
    require the mpi implementation to abort if the current epoch is not
    MPID_EPOTYPE_NONE.
    
    From the MPI 3.0 standard,
    
      page 441:
    
        "A fence call usually entails a barrier synchronization: a
         process completes a call to MPI_WIN_FENCE only after all other
         processes in the group entered their matching call. However, a
         call to MPI_WIN_FENCE that is known not to end any epoch (in
         particular, a call with assert equal to MPI_MODE_NOPRECEDE)
         does not necessarily act as a barrier."
    
      page 452:
    
        "MPI_MODE_NOPRECEDE — the fence does not complete any sequence
         of locally issued RMA calls. If this assertion is given by any
         process in the window group, then it must be given by all
         processes in the group"
    
    Signed-off-by: Su Huang <suhuang at us.ibm.com>

diff --git a/src/mpid/pamid/src/onesided/mpid_win_fence.c b/src/mpid/pamid/src/onesided/mpid_win_fence.c
index a2245ab..17bb022 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_fence.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_fence.c
@@ -34,14 +34,6 @@ MPID_Win_fence(int       assert,
                         return mpi_errno, "**rmasync");
   }
 
-  if ((assert & MPI_MODE_NOPRECEDE) &&
-            win->mpid.sync.origin_epoch_type != MPID_EPOTYPE_NONE) {
-        /* --BEGIN ERROR HANDLING-- */
-        MPIU_ERR_SETANDSTMT(mpi_errno, MPI_ERR_RMA_SYNC,
-                return mpi_errno, "**rmasync");
-        /* --END ERROR HANDLING-- */
-  }
-
   if (!(assert & MPI_MODE_NOPRECEDE) &&
             win->mpid.sync.origin_epoch_type != MPID_EPOTYPE_FENCE &&
             win->mpid.sync.origin_epoch_type != MPID_EPOTYPE_REFENCE &&
@@ -69,6 +61,10 @@ MPID_Win_fence(int       assert,
     win->mpid.sync.target_epoch_type = MPID_EPOTYPE_REFENCE;
   }
 
-  mpi_errno = MPIR_Barrier_impl(win->comm_ptr, &mpi_errno);
+  if (!(assert & MPI_MODE_NOPRECEDE))
+    {
+      mpi_errno = MPIR_Barrier_impl(win->comm_ptr, &mpi_errno);
+    }
+
   return mpi_errno;
 }

http://git.mpich.org/mpich.git/commitdiff/6b7f60e76177def5f603f04ffe79c17b495f144d

commit 6b7f60e76177def5f603f04ffe79c17b495f144d
Author: Michael Blocksome <blocksom at us.ibm.com>
Date:   Fri Aug 1 12:26:40 2014 -0500

    pamid: do not create memregions for shared memory windows
    
    Signed-off-by: Su Huang <suhuang at us.ibm.com>

diff --git a/src/mpid/pamid/src/onesided/mpid_win_create.c b/src/mpid/pamid/src/onesided/mpid_win_create.c
index 20ce66a..15f5e60 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_create.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_create.c
@@ -104,41 +104,43 @@ MPIDI_Win_init( MPI_Aint length,
 int
 MPIDI_Win_allgather( MPI_Aint size, MPID_Win **win_ptr )
 {
-    int mpi_errno = MPI_SUCCESS;
-    MPID_Win *win;
-    int rank;
-    MPID_Comm *comm_ptr;
-    size_t length_out = 0;
-    pami_result_t rc;
-    MPIDI_Win_info  *winfo;
-    static char FCNAME[] = "MPIDI_Win_allgather";
+  int mpi_errno = MPI_SUCCESS;
+  MPID_Win *win;
+  int rank;
+  MPID_Comm *comm_ptr;
+  size_t length_out = 0;
+  pami_result_t rc;
+  MPIDI_Win_info  *winfo;
+  static char FCNAME[] = "MPIDI_Win_allgather";
 
   win = *win_ptr;
   comm_ptr = win->comm_ptr;
   rank = comm_ptr->rank;
   winfo = &win->mpid.info[rank];
-  /* --------------------------------------- */
-  /*  Setup the PAMI sections of the window  */
-  /* --------------------------------------- */
-#ifdef USE_PAMI_RDMA
-  if (size != 0)
-    {
-      rc = PAMI_Memregion_create(MPIDI_Context[0], win->mpid.info[rank].base_addr, win->mpid.info[rank].base_size, &length_out, &winfo->memregion);
 
-      MPIU_ERR_CHKANDJUMP((rc != PAMI_SUCCESS), mpi_errno, MPI_ERR_OTHER, "**nomem");
-      MPIU_ERR_CHKANDJUMP((win->size < length_out), mpi_errno, MPI_ERR_OTHER, "**nomem");
-    }
-#else
-  if ( (!MPIDI_Process.mp_s_use_pami_get) && (size != 0) )
+  if (size != 0 && win->create_flavor != MPI_WIN_FLAVOR_SHARED)
     {
-      rc = PAMI_Memregion_create(MPIDI_Context[0], win->mpid.info[rank].base_addr, win->mpid.info[rank].base_size, &length_out, &winfo->memregion);
-      if(rc == PAMI_SUCCESS)
+#ifndef USE_PAMI_RDMA
+      if (!MPIDI_Process.mp_s_use_pami_get)
         {
-          winfo->memregion_used = 1;
-          MPID_assert(win->size == length_out);
+#endif
+          /* --------------------------------------- */
+          /*  Setup the PAMI sections of the window  */
+          /* --------------------------------------- */
+          rc = PAMI_Memregion_create(MPIDI_Context[0], win->mpid.info[rank].base_addr, win->mpid.info[rank].base_size, &length_out, &winfo->memregion);
+#ifdef USE_PAMI_RDMA
+          MPIU_ERR_CHKANDJUMP((rc != PAMI_SUCCESS), mpi_errno, MPI_ERR_OTHER, "**nomem");
+          MPIU_ERR_CHKANDJUMP((win->size < length_out), mpi_errno, MPI_ERR_OTHER, "**nomem");
+#else
+          if (rc == PAMI_SUCCESS)
+            {
+              winfo->memregion_used = 1;
+              MPID_assert(win->size == length_out);
+            }
         }
-    }
 #endif
+    }
+
   mpi_errno = MPIR_Allgather_impl(MPI_IN_PLACE,
                                   0,
                                   MPI_DATATYPE_NULL,

http://git.mpich.org/mpich.git/commitdiff/2caecaceac3bbe87720e9c1eb4a65bfea64ace32

commit 2caecaceac3bbe87720e9c1eb4a65bfea64ace32
Author: Su Huang <suhuang at us.ibm.com>
Date:   Wed Jul 23 12:55:03 2014 -0400

    pamid: MPI_Get coredump in __memcpy_power7 when >1 tasks per node (LE)
    
    Set the correct base address assignment during the window creation.
    
    (ibm) D198762
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/src/onesided/mpid_win_allocate_shared.c b/src/mpid/pamid/src/onesided/mpid_win_allocate_shared.c
index cfd08a7..d521a26 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_allocate_shared.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_allocate_shared.c
@@ -412,17 +412,11 @@ MPID_getSharedSegment(MPI_Aint     size,
 #endif
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
 
+        /* assign base address here                                                    */
         /* compute the base addresses of each process within the shared memory segment */
+        /* will be done after MPI_Allgather in MID_Win_allocate_shared                 */
         win->base = (void *) ((long) win->mpid.shm->base_addr + (long ) MPIDI_ROUND_UP_PAGESIZE((sizeof(MPIDI_Win_shm_ctrl_t) + ((comm_size+1) * sizeof(void *))),pageSize));
 
-        for (i = 0; i < comm_size; ++i) {
-            win->mpid.info[i].base_addr =
-                (void *) ((uintptr_t)win->mpid.info[i].base_addr + (uintptr_t)win->base);
-        }
-
-        for (i = 0; i < comm_size; ++i) {
-            if (size_array[i] == 0) win->mpid.info[i].base_addr = NULL;
-        }
 
         MPIU_Free(size_array);
 
@@ -492,7 +486,7 @@ MPID_Win_allocate_shared(MPI_Aint     size,
   int mpi_errno  = MPI_SUCCESS;
   int onNode     = 0;
   MPID_Win    *win = NULL;
-  int rank;
+  int rank, prev_size;
 
   MPIDI_Win_info  *winfo;
   int         comm_size,i;
@@ -526,6 +520,29 @@ MPID_Win_allocate_shared(MPI_Aint     size,
   if (mpi_errno != MPI_SUCCESS)
       return mpi_errno;
 
+  win->mpid.info[0].base_addr = win->base;
+  char *cur_base = win->base;
+  prev_size=win->mpid.info[0].base_size;
+  for (i = 1; i < comm_size; ++i) {
+       if (win->mpid.info[i].base_size) {
+            if (prev_size) {
+               if (noncontig) {
+                  /* Round up to next page size */
+                   win->mpid.info[i].base_addr =
+                  (void *) ((MPI_Aint) cur_base + (MPI_Aint) MPIDI_ROUND_UP_PAGESIZE(prev_size,pageSize));
+               } else {
+                    win->mpid.info[i].base_addr = (void *) ((MPI_Aint) cur_base + (MPI_Aint) prev_size);
+               }
+            } else
+                    win->mpid.info[i].base_addr = (void *) ((MPI_Aint) cur_base);
+              prev_size=win->mpid.info[i].base_size;
+              cur_base = win->mpid.info[i].base_addr;
+        } else {
+                 win->mpid.info[i].base_addr = NULL;
+        }
+  }
+
+
   *(void**) base_ptr = (void *) win->mpid.info[rank].base_addr;
 
   mpi_errno = MPIR_Barrier_impl(comm_ptr, &mpi_errno);

http://git.mpich.org/mpich.git/commitdiff/11314276d9c0cc0aadd199745b99bf063b1e38ed

commit 11314276d9c0cc0aadd199745b99bf063b1e38ed
Author: Su Huang <suhuang at us.ibm.com>
Date:   Wed Jul 23 12:55:03 2014 -0400

    pamid: shared memory optimization for put operation
    
    A shared window put operation can be completed by the
    rank that initiates the operation.
    
    (ibm) D198762
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/src/onesided/mpid_win_put.c b/src/mpid/pamid/src/onesided/mpid_win_put.c
index d395792..9cbcc05 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_put.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_put.c
@@ -264,14 +264,18 @@ MPID_Put(const void   *origin_addr,
     }
 
 
-  if (target_rank == win->comm_ptr->rank)
+  if ((target_rank == win->comm_ptr->rank) || (win->create_flavor == MPI_WIN_FLAVOR_SHARED))
      {
        size_t offset = req->offset;
+       if (target_rank == win->comm_ptr->rank)
+           target_addr = win->base + req->offset;
+       else
+           target_addr = win->mpid.info[target_rank].base_addr + req->offset;
 
        mpi_errno = MPIR_Localcopy(origin_addr,
                                   origin_count,
                                   origin_datatype,
-                                  win->base + offset,
+                                  target_addr,
                                   target_count,
                                   target_datatype);
 
diff --git a/src/mpid/pamid/src/onesided/mpid_win_shared_query.c b/src/mpid/pamid/src/onesided/mpid_win_shared_query.c
index 55ca3a0..bfcea9f 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_shared_query.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_shared_query.c
@@ -52,11 +52,13 @@ MPID_Win_shared_query(MPID_Win *win, int rank, MPI_Aint *size,
               break;
           }
       }
+      *((void **) base_ptr) = win->base; /* return the begin. address of shared segment */
     } else {
+        *((void **) base_ptr) = win->mpid.info[rank].base_addr; /* return the begin. address of the rank */
         *size                 = win->mpid.info[rank].base_size;
         *disp_unit            = win->mpid.info[rank].disp_unit;
     }
-    *((void **) base_ptr) = win->base; /* should return the begin. address of shared segment */
+
 
     return mpi_errno;
 }

http://git.mpich.org/mpich.git/commitdiff/3ac6a32ea03936403111d43956168361ab9ffcdc

commit 3ac6a32ea03936403111d43956168361ab9ffcdc
Author: Su Huang <suhuang at us.ibm.com>
Date:   Wed Jul 23 12:55:03 2014 -0400

    pamid: shared mutex macro updates
    
    (ibm) D198762
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/src/onesided/mpidi_onesided.h b/src/mpid/pamid/src/onesided/mpidi_onesided.h
index 0a2e201..0b324cc 100644
--- a/src/mpid/pamid/src/onesided/mpidi_onesided.h
+++ b/src/mpid/pamid/src/onesided/mpidi_onesided.h
@@ -37,24 +37,24 @@ pami_rmw_t   zero_rmw_parms;
 #define MPIDI_QUICKSLEEP     usleep(1);
 #define MAX_NUM_CTRLSEND  1024          /* no more than 1024 outstanding control sends */
 
-#define MPIDI_SHM_MUTEX_LOCK(win)                                                          \
+#define MPIDI_SHM_MUTEX_LOCK(win) {                                                        \
     int mpi_errno=0;                                                                       \
     do {                                                                                   \
         pthread_mutex_t *shm_mutex = (pthread_mutex_t *) &win->mpid.shm->ctrl->mutex_lock; \
         int rval = pthread_mutex_lock(shm_mutex);                                          \
         MPIU_ERR_CHKANDJUMP1(rval, mpi_errno, MPI_ERR_OTHER, "**pthread_lock",             \
                              "**pthread_lock %s", strerror(rval));                         \
-    } while (0);
+    } while (0); }
 
 
-#define MPIDI_SHM_MUTEX_UNLOCK(win)                                                        \
+#define MPIDI_SHM_MUTEX_UNLOCK(win) {                                                      \
     int mpi_errno=0;                                                                       \
     do {                                                                                   \
         pthread_mutex_t *shm_mutex = (pthread_mutex_t *) &win->mpid.shm->ctrl->mutex_lock; \
         int rval = pthread_mutex_unlock(shm_mutex);                                        \
         MPIU_ERR_CHKANDJUMP1(rval, mpi_errno, MPI_ERR_OTHER, "**pthread_unlock",           \
                              "**pthread_unlock %s", strerror(rval));                       \
-    } while (0);    
+    } while (0); }
 
 
 #define MPIDI_SHM_MUTEX_INIT(win)                                                          \
@@ -78,14 +78,14 @@ pami_rmw_t   zero_rmw_parms;
                              "**pthread_mutex %s", strerror(rval));                        \
     } while (0);
 
-#define MPIDI_SHM_MUTEX_DESTROY(win)                                                        \
+#define MPIDI_SHM_MUTEX_DESTROY(win) {                                                      \
     int mpi_errno=0;                                                                        \
     do {                                                                                    \
         pthread_mutex_t *shm_mutex = (pthread_mutex_t *) &(win)->mpid.shm->ctrl->mutex_lock;\
         int rval = pthread_mutex_destroy(shm_mutex);                                        \
         MPIU_ERR_CHKANDJUMP1(rval, mpi_errno, MPI_ERR_OTHER, "**pthread_mutex",             \
                              "**pthread_mutex %s", strerror(rval));                         \
-    } while (0);
+    } while (0); }
 
 #define MPIDI_ACQUIRE_SHARED_LOCK(win) {                                                    \
          MPIDI_SHM_MUTEX_LOCK(win);                                                         \

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

Summary of changes:
 .../pamid/src/onesided/mpid_win_allocate_shared.c  |   35 ++++++++++---
 src/mpid/pamid/src/onesided/mpid_win_create.c      |   52 ++++++++++---------
 src/mpid/pamid/src/onesided/mpid_win_fence.c       |   14 ++---
 src/mpid/pamid/src/onesided/mpid_win_put.c         |    8 ++-
 .../pamid/src/onesided/mpid_win_shared_query.c     |    4 +-
 src/mpid/pamid/src/onesided/mpidi_onesided.h       |   12 ++--
 6 files changed, 73 insertions(+), 52 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list