[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1b1-37-ge6fde07

mysql vizuser noreply at mpich.org
Wed Sep 18 10:31:05 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  e6fde073449897f124965c87c3c73d1a35dda8c5 (commit)
      from  46dba93ff00afede3c624e462eb3e7ac8e10dcce (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/e6fde073449897f124965c87c3c73d1a35dda8c5

commit e6fde073449897f124965c87c3c73d1a35dda8c5
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Wed Sep 18 09:31:04 2013 -0500

    Test for PTHREAD_PROCESS_SHARED attribute
    
    FreeBSD does not support this attribute. Including this runtime
    test ensures nemesis will not override the allocate_shm function
    pointer unless it is supported. Fixes #1926
    
    Signed-off-by: Pavan Balaji <balaji at mcs.anl.gov>

diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c b/src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c
index 9d9c5ab..89ef6f9 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c
@@ -28,11 +28,23 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
 int MPIDI_CH3_Win_fns_init(MPIDI_CH3U_Win_fns_t *win_fns)
 {
     int mpi_errno = MPI_SUCCESS;
+    int mutex_err;
+    pthread_mutexattr_t attr;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_WIN_FNS_INIT);
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3_WIN_FNS_INIT);
 
-    win_fns->allocate_shm = MPIDI_CH3I_Win_allocate_shm;
+    /* Test for PTHREAD_PROCESS_SHARED support.  Some platforms do not support
+     * this capability even though it is a part of the pthreads core API (e.g.,
+     * FreeBSD does not support this as of version 9.1) */
+    pthread_mutexattr_init(&attr);
+    mutex_err = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
+    pthread_mutexattr_destroy(&attr);
+
+    /* Only allocate shared memory windows if we can use
+     * pthread_mutexattr_setpshared correctly. */
+    if (!mutex_err)
+        win_fns->allocate_shm = MPIDI_CH3I_Win_allocate_shm;
 
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3_WIN_FNS_INIT);
 

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

Summary of changes:
 src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list