[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b4-139-g7e35691

Service Account noreply at mpich.org
Tue Aug 18 12:14:31 CDT 2015


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  7e35691bcbf560acb7cc3f1e466775d7751f260d (commit)
       via  67987097fbad7aad134b2e16ca8598a77b8de2e8 (commit)
       via  db387dd642fc0b647398005c7d9bca663ac0a4dc (commit)
       via  f0f15579f8eaa92ebbcf2d78fe1d7986026f4d7c (commit)
      from  487ec8e3d2bed615f979f39db81832e83ec682c0 (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/7e35691bcbf560acb7cc3f1e466775d7751f260d

commit 7e35691bcbf560acb7cc3f1e466775d7751f260d
Author: Pavan Balaji <balaji at anl.gov>
Date:   Mon Aug 17 18:14:54 2015 -0500

    Bug-fix: Handle icc failures on Darwin with thread local storage.
    
    The intel compiler seems to break on Darwin when the thread local
    storage is specified with the extern keyword.  With older intel
    compilers, which used to break more easily for tls specifiers, we
    added a configure check to disable tls in such cases.  The newer
    compilers seem to work fine with no extern is provided, but break when
    extern is provided for shared library builds.  This patch improves the
    configure check to try both with and without extern.
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/confdb/ax_tls.m4 b/confdb/ax_tls.m4
index 2704438..4447a36 100644
--- a/confdb/ax_tls.m4
+++ b/confdb/ax_tls.m4
@@ -58,8 +58,24 @@ AC_DEFUN([AX_TLS], [
              # link line.
              AC_LINK_IFELSE(
                  [AC_LANG_PROGRAM([$ax_tls_keyword int bar = 5;],[++bar;])],
-                 [ac_cv_tls=$ax_tls_keyword ; break],
+                 [ac_cv_tls=$ax_tls_keyword],
                  [ac_cv_tls=none])
+
+	     # MPICH modification: Also test with the extern keyword.
+	     # The intel compiler on Darwin (at least as of 15.0.1)
+	     # seems to break with the above error when the extern
+	     # keyword is specified in shared library builds.
+	     PAC_PUSH_FLAG([LIBS])
+	     PAC_APPEND_FLAG([-shared],[LIBS])
+	     if test "$ac_cv_tls" != "none" ; then
+                AC_LINK_IFELSE(
+			[AC_LANG_PROGRAM([extern $ax_tls_keyword int bar;],[++bar;])],
+                        [ac_cv_tls=$ax_tls_keyword],
+                        [ac_cv_tls=none])
+	     fi
+	     PAC_POP_FLAG([LIBS])
+
+	     if test "$ac_cv_tls" != "none" ; then break ; fi
           esac
     done
 ])

http://git.mpich.org/mpich.git/commitdiff/67987097fbad7aad134b2e16ca8598a77b8de2e8

commit 67987097fbad7aad134b2e16ca8598a77b8de2e8
Author: Pavan Balaji <balaji at anl.gov>
Date:   Mon Aug 17 12:35:47 2015 -0500

    Use MPIU_Thread_ptr instead of MPIU_Thread.
    
    In other cases, MPIU_Thread is used as the direct structure.  To not
    confuse the reader, use a different variable name, MPIU_Thread_ptr,
    when we are referring to the pointer and not the structure directly.
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/src/util/thread/mpiu_thread_priv.h b/src/util/thread/mpiu_thread_priv.h
index e10f3d2..f6fa3ff 100644
--- a/src/util/thread/mpiu_thread_priv.h
+++ b/src/util/thread/mpiu_thread_priv.h
@@ -57,41 +57,41 @@ extern MPICH_PerThread_t MPIU_ThreadSingle;
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int init_err_;                                              \
-            MPIU_Thread = (MPICH_PerThread_t *) MPIU_Calloc(1, sizeof(MPICH_PerThread_t)); \
-            MPIU_Assert(MPIU_Thread);                                   \
-            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage, (void *)MPIU_Thread, &init_err_); \
+            MPIU_Thread_ptr = (MPICH_PerThread_t *) MPIU_Calloc(1, sizeof(MPICH_PerThread_t)); \
+            MPIU_Assert(MPIU_Thread_ptr);                               \
+            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage, (void *)MPIU_Thread_ptr, &init_err_); \
             MPIU_Assert(init_err_ == 0);                                \
         }                                                               \
     } while (0)
 
 #define MPIU_THREADPRIV_GET                                             \
     do {                                                                \
-        if (!MPIU_Thread) {                                             \
+        if (!MPIU_Thread_ptr) {                                         \
             if (MPIR_ThreadInfo.isThreaded) {                           \
                 int get_err_;                                           \
-                MPIU_Thread_tls_get(&MPIR_ThreadInfo.thread_storage, (void **) &MPIU_Thread, &get_err_); \
+                MPIU_Thread_tls_get(&MPIR_ThreadInfo.thread_storage, (void **) &MPIU_Thread_ptr, &get_err_); \
                 MPIU_Assert(get_err_ == 0);                             \
-                if (!MPIU_Thread) {                                     \
-                    MPIU_THREADPRIV_INIT; /* subtle, sets MPIU_Thread */ \
+                if (!MPIU_Thread_ptr) {                                 \
+                    MPIU_THREADPRIV_INIT; /* subtle, sets MPIU_Thread_ptr */ \
                 }                                                       \
             }                                                           \
             else {                                                      \
-                MPIU_Thread = &MPIU_ThreadSingle;                       \
+                MPIU_Thread_ptr = &MPIU_ThreadSingle;                   \
             }                                                           \
-            MPIU_Assert(MPIU_Thread);                                   \
+            MPIU_Assert(MPIU_Thread_ptr);                               \
         }                                                               \
     } while (0)
 
 /* common definitions when using MPIU_Thread-based TLS */
-#define MPIU_THREADPRIV_DECL MPICH_PerThread_t *MPIU_Thread=NULL
-#define MPIU_THREADPRIV_FIELD(a_) (MPIU_Thread->a_)
+#define MPIU_THREADPRIV_DECL MPICH_PerThread_t *MPIU_Thread_ptr = NULL
+#define MPIU_THREADPRIV_FIELD(a_) (MPIU_Thread_ptr->a_)
 #define MPIU_THREADPRIV_FINALIZE                                        \
     do {                                                                \
         MPIU_THREADPRIV_DECL;                                           \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int tpf_err_; /* unique name to not conflict with vars in called macros */ \
             MPIU_THREADPRIV_GET;                                        \
-            MPIU_Free(MPIU_Thread);                                     \
+            MPIU_Free(MPIU_Thread_ptr);                                 \
             MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage,NULL, &tpf_err_); \
             MPIU_Assert(tpf_err_ == 0);                                 \
             MPIU_Thread_tls_destroy(&MPIR_ThreadInfo.thread_storage,&tpf_err_); \

http://git.mpich.org/mpich.git/commitdiff/db387dd642fc0b647398005c7d9bca663ac0a4dc

commit db387dd642fc0b647398005c7d9bca663ac0a4dc
Author: Pavan Balaji <balaji at anl.gov>
Date:   Mon Aug 17 12:35:16 2015 -0500

    Added missing inclusion of mpimem.h, which is needed for MPIU_Calloc.
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index 32ee3b2..0c9d3f1 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -18,6 +18,12 @@
 #include "mpiu_strerror.h"
 #include "mpiu_timer.h"
 
+/* FIXME: we should not be including an MPIR-level header here.  But
+ * the code is currently a rat-hole where the MPIU and MPIR functions
+ * are all mixed up.  Till that's resolved, adding mpimem.h here as a
+ * workaround for using MPIU_Calloc functionality. */
+#include "mpimem.h"
+
 /* _INVALID exists to avoid accidental macro evaluations to 0 */
 #define MPIU_THREAD_PACKAGE_INVALID 0
 #define MPIU_THREAD_PACKAGE_NONE    1

http://git.mpich.org/mpich.git/commitdiff/f0f15579f8eaa92ebbcf2d78fe1d7986026f4d7c

commit f0f15579f8eaa92ebbcf2d78fe1d7986026f4d7c
Author: Pavan Balaji <balaji at anl.gov>
Date:   Mon Aug 17 13:42:49 2015 -0500

    Bug-fix: PGI compiler failure.
    
    There were several errors in the current code:
    
    1. We were defining prototypes for the thread private functions, but
       were using them as macros.
    
    2. We were missing an error parameter at the end of the macro.
    
    3. There were extra unused prototypes.
    
    4. The cleanup function was defined as static, which was causing the
       global definition to be ignored.
    
    5. Different macros should use different error variable names to avoid
       warnings related to the inner macro shadowing the variable in the
       outer macro.
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/src/mpid/common/thread/mpid_thread_fallback.h b/src/mpid/common/thread/mpid_thread_fallback.h
index 62fe172..09af49f 100644
--- a/src/mpid/common/thread/mpid_thread_fallback.h
+++ b/src/mpid/common/thread/mpid_thread_fallback.h
@@ -63,7 +63,6 @@ typedef MPIU_Thread_cond_t  MPID_Thread_cond_t;
 typedef MPIU_Thread_id_t    MPID_Thread_id_t;
 typedef MPIU_Thread_tls_t   MPID_Thread_tls_t;
 typedef MPIU_Thread_func_t  MPID_Thread_func_t;
-typedef MPIU_Thread_tls_exit_func_t MPID_Thread_tls_exit_func_t;
 
 /*M MPIU_THREAD_CS_ENTER - Enter a named critical section
 
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index e005619..32ee3b2 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -68,17 +68,6 @@ void MPIU_Thread_cond_broadcast(MPIU_Thread_cond_t * cond, int *err);
 void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int *err);
 
 
-/*
- * Thread Local Storage
- */
-typedef void (*MPIU_Thread_tls_exit_func_t) (void *value);
-
-void MPIU_Thread_tls_create(MPIU_Thread_tls_exit_func_t exit_func, MPIU_Thread_tls_t * tls,
-                            int *err);
-void MPIU_Thread_tls_destroy(MPIU_Thread_tls_t * tls, int *err);
-void MPIU_Thread_tls_set(MPIU_Thread_tls_t * tls, void *value, int *err);
-void MPIU_Thread_tls_get(MPIU_Thread_tls_t * tls, void **value, int *err);
-
 /* Error values */
 #define MPIU_THREAD_SUCCESS 0
 /* FIXME: Define other error codes.  For now, any non-zero value is an error. */
diff --git a/src/util/thread/mpiu_thread_priv.h b/src/util/thread/mpiu_thread_priv.h
index 609e8cb..e10f3d2 100644
--- a/src/util/thread/mpiu_thread_priv.h
+++ b/src/util/thread/mpiu_thread_priv.h
@@ -26,7 +26,7 @@
 #if !defined(MPIU_TLS_SPECIFIER)
 /* We need to provide a function that will cleanup the storage attached
  * to the key.  */
-static void MPIUI_Cleanup_tls(void *a);
+void MPIUI_Cleanup_tls(void *a);
 
 /* In the case where the thread level is set in MPI_Init_thread, we
    need a blended version of the non-threaded and the thread-multiple
@@ -47,18 +47,20 @@ extern MPICH_PerThread_t MPIU_ThreadSingle;
 #define MPIU_THREADPRIV_INITKEY                                         \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
-            int err_;                                                   \
-            MPIU_Thread_tls_create(MPIUI_Cleanup_tls,&MPIR_ThreadInfo.thread_storage,&err_); \
-            MPIU_Assert(err_ == 0);                                     \
+            int initkey_err_;                                           \
+            MPIU_Thread_tls_create(MPIUI_Cleanup_tls,&MPIR_ThreadInfo.thread_storage,&initkey_err_); \
+            MPIU_Assert(initkey_err_ == 0);                             \
         }                                                               \
     } while (0)
 
 #define MPIU_THREADPRIV_INIT                                            \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
+            int init_err_;                                              \
             MPIU_Thread = (MPICH_PerThread_t *) MPIU_Calloc(1, sizeof(MPICH_PerThread_t)); \
             MPIU_Assert(MPIU_Thread);                                   \
-            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage, (void *)MPIU_Thread); \
+            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage, (void *)MPIU_Thread, &init_err_); \
+            MPIU_Assert(init_err_ == 0);                                \
         }                                                               \
     } while (0)
 
@@ -66,7 +68,9 @@ extern MPICH_PerThread_t MPIU_ThreadSingle;
     do {                                                                \
         if (!MPIU_Thread) {                                             \
             if (MPIR_ThreadInfo.isThreaded) {                           \
-                MPIU_Thread_tls_get(&MPIR_ThreadInfo.thread_storage, &MPIU_Thread); \
+                int get_err_;                                           \
+                MPIU_Thread_tls_get(&MPIR_ThreadInfo.thread_storage, (void **) &MPIU_Thread, &get_err_); \
+                MPIU_Assert(get_err_ == 0);                             \
                 if (!MPIU_Thread) {                                     \
                     MPIU_THREADPRIV_INIT; /* subtle, sets MPIU_Thread */ \
                 }                                                       \
@@ -88,7 +92,8 @@ extern MPICH_PerThread_t MPIU_ThreadSingle;
             int tpf_err_; /* unique name to not conflict with vars in called macros */ \
             MPIU_THREADPRIV_GET;                                        \
             MPIU_Free(MPIU_Thread);                                     \
-            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage,NULL);  \
+            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage,NULL, &tpf_err_); \
+            MPIU_Assert(tpf_err_ == 0);                                 \
             MPIU_Thread_tls_destroy(&MPIR_ThreadInfo.thread_storage,&tpf_err_); \
             MPIU_Assert(tpf_err_ == 0);                                 \
         }                                                               \
diff --git a/src/util/thread/mpiu_thread_solaris_funcs.h b/src/util/thread/mpiu_thread_solaris_funcs.h
index d3cdff4..34c0735 100644
--- a/src/util/thread/mpiu_thread_solaris_funcs.h
+++ b/src/util/thread/mpiu_thread_solaris_funcs.h
@@ -155,9 +155,6 @@
 /*
  * Thread Local Storage
  */
-typedef void (*MPIU_Thread_tls_exit_func_t) (void *value);
-
-
 #define MPIU_Thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_)	\
     do {                                                                \
         if ((err_ptr_) == NULL) {                                       \

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

Summary of changes:
 confdb/ax_tls.m4                              |   18 +++++++++++-
 src/mpid/common/thread/mpid_thread_fallback.h |    1 -
 src/util/thread/mpiu_thread.h                 |   17 ++++-------
 src/util/thread/mpiu_thread_priv.h            |   39 ++++++++++++++-----------
 src/util/thread/mpiu_thread_solaris_funcs.h   |    3 --
 5 files changed, 45 insertions(+), 33 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list