[mpich2-commits] r5493 - in mpich2/trunk: . src/include src/mpi/comm

goodell at mcs.anl.gov goodell at mcs.anl.gov
Tue Oct 20 15:35:18 CDT 2009


Author: goodell
Date: 2009-10-20 15:35:18 -0500 (Tue, 20 Oct 2009)
New Revision: 5493

Modified:
   mpich2/trunk/configure.in
   mpich2/trunk/src/include/mpiimplthread.h
   mpich2/trunk/src/mpi/comm/commutil.c
Log:
Delete the BRIEF_GLOBAL thread granularity level.

It provides little to no performance gains over GLOBAL while requiring
plenty of additional testing and maintenance.  Deleting it should
simplify working with the fine-grained threading code and reduce the
overall maintenance burden.

No reviewer.

Modified: mpich2/trunk/configure.in
===================================================================
--- mpich2/trunk/configure.in	2009-10-20 20:35:15 UTC (rev 5492)
+++ mpich2/trunk/configure.in	2009-10-20 20:35:18 UTC (rev 5493)
@@ -456,8 +456,7 @@
 [--enable-thread-cs=type - Choose the method used for critical
                           sections and other atomic updates when
                           multiple threads are present.  Values may
-                          be global (default), brief-global,
-                          per-object, lock-free]
+                          be global (default), per-object, lock-free]
  , , enable_thread_cs=global)
 
 AC_ARG_ENABLE(refcount,
@@ -466,9 +465,8 @@
                          objects.  Values may be lock, lock-free,
                          none.  The default depends on the thread-cs
                          choice; for global it is none (because none
-                         is required), for brief-global and per-object
-                         it is lock, and for lock-free it is
-                         lock-free]
+                         is required), for per-object it is lock, and for
+                         lock-free it is lock-free]
     ,,enable_refcount=default)
 
 AC_ARG_ENABLE(mutex-timing, [--enable-mutex-timing - calculate the time spent waiting on mutexes.],
@@ -1137,8 +1135,7 @@
     if test "$enable_refcount" = "default" ; then enable_refcount=none ; fi
     ;;
     brief-global|brief_global)
-    thread_granularity=MPIU_THREAD_GRANULARITY_BRIEF_GLOBAL
-    if test "$enable_refcount" = "default" ; then enable_refcount=lock ; fi
+    AC_MSG_ERROR([--enable-thread-cs=brief-global is no longer supported, please select a different granularity])
     ;;
     per-object|per_object)
     thread_granularity=MPIU_THREAD_GRANULARITY_PER_OBJECT

Modified: mpich2/trunk/src/include/mpiimplthread.h
===================================================================
--- mpich2/trunk/src/include/mpiimplthread.h	2009-10-20 20:35:15 UTC (rev 5492)
+++ mpich2/trunk/src/include/mpiimplthread.h	2009-10-20 20:35:18 UTC (rev 5493)
@@ -25,6 +25,12 @@
 #include "mpid_thread.h"
 #endif
 
+#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_INVALID
+#  error Invalid thread granularity option specified (possibly none)
+#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_BRIEF_GLOBAL
+#  error The BRIEF_GLOBAL thread granularity option is no longer supported
+#endif
+
 /*
  * Define possible thread implementations that could be selected at 
  * configure time.  
@@ -59,7 +65,6 @@
 
     /* Define the mutex values used for each kind of implementation */
 #if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL || \
-    MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_BRIEF_GLOBAL || \
     MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
     /* The global mutex goes here when we eliminate USE_THREAD_IMPL */
     /* We need the handle mutex to avoid problems with lock nesting */
@@ -68,8 +73,7 @@
 #error MPIU_THREAD_GRANULARITY_LOCK_FREE not implemented yet
 #endif
 
-#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_BRIEF_GLOBAL || \
-    MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
+#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
     MPID_Thread_tls_t nest_storage;   /* Id for perthread data */
 #endif
 
@@ -376,8 +380,7 @@
 #define MPIU_THREAD_CHECKDEPTH(_name,_value)
 #define MPIU_THREAD_UPDATEDEPTH(_name,_value)				
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_BRIEF_GLOBAL || \
-      MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
+#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
 /* This structure is used to keep track of where the last change was made
    to the thread cs depth */
 #ifdef MPID_THREAD_DEBUG
@@ -513,49 +516,9 @@
 #define MPIU_THREAD_CS_EXIT_MPIDCOMM(_context)
 #define MPIU_THREAD_CS_ENTER_INITFLAG(_context)
 #define MPIU_THREAD_CS_EXIT_INITFLAG(_context)
-#define MPIU_THREAD_CS_ENTER_PMI(_context) 
-#define MPIU_THREAD_CS_EXIT_PMI(_context) 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_BRIEF_GLOBAL
-/* There is a single, global lock, held only when needed */
-#define MPIU_THREAD_CS_ENTER_ALLFUNC(_context)
-#define MPIU_THREAD_CS_EXIT_ALLFUNC(_context)
-/* We use the handle mutex to avoid conflicts with the global mutex - 
-   this is a temporary setting until the brief-global option is fully
-   implemented */
-#define MPIU_THREAD_CS_ENTER_HANDLE(_context) \
-   MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_ENTER_LOCKNAME(handle_mutex) MPIU_THREAD_CHECK_END
-#define MPIU_THREAD_CS_EXIT_HANDLE(_context) \
-   MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_EXIT_LOCKNAME(handle_mutex) MPIU_THREAD_CHECK_END
-   /* The request handles may be allocated, and many other handles might
-      be deallocated, within the communication routines.  To avoid 
-      problems with lock nesting, for this particular case, we use a
-      separate lock (similar to the per-object lock) */
-#define MPIU_THREAD_CS_ENTER_HANDLEALLOC(_context) \
-   MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_ENTER_LOCKNAME(handle_mutex) MPIU_THREAD_CHECK_END
-#define MPIU_THREAD_CS_EXIT_HANDLEALLOC(_context) \
-   MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_EXIT_LOCKNAME(handle_mutex) MPIU_THREAD_CHECK_END
+#define MPIU_THREAD_CS_ENTER_PMI(_context)
+#define MPIU_THREAD_CS_EXIT_PMI(_context)
 
-#define MPIU_THREAD_CS_ENTER_MPIDCOMM(_context) \
-   MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_ENTER_LOCKNAME(global_mutex) MPIU_THREAD_CHECK_END
-#define MPIU_THREAD_CS_EXIT_MPIDCOMM(_context) \
-    MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_EXIT_LOCKNAME(global_mutex) MPIU_THREAD_CHECK_END
-
-#define MPIU_THREAD_CS_ENTER_MSGQUEUE(_context) \
-   MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_ENTER_LOCKNAME(global_mutex) MPIU_THREAD_CHECK_END
-#define MPIU_THREAD_CS_EXIT_MSGQUEUE(_context) \
-   MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_EXIT_LOCKNAME(global_mutex) MPIU_THREAD_CHECK_END
-#define MPIU_THREAD_CS_ENTER_INITFLAG(_context) \
-   MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_ENTER_LOCKNAME(global_mutex) MPIU_THREAD_CHECK_END
-#define MPIU_THREAD_CS_EXIT_INITFLAG(_context) \
-   MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_EXIT_LOCKNAME(global_mutex) MPIU_THREAD_CHECK_END
-   /* PMI for spawn needs to be single-threaded - this allows us to add 
-      PMI calls where no other mutex may be active.  This is a temporary
-      fix for brief-global only */
-#define MPIU_THREAD_CS_ENTER_PMI(_context) \
-   MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_ENTER_LOCKNAME(global_mutex) MPIU_THREAD_CHECK_END
-#define MPIU_THREAD_CS_EXIT_PMI(_context) \
-   MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_EXIT_LOCKNAME(global_mutex) MPIU_THREAD_CHECK_END
-
 #elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
 /* There are multiple locks, one for each (major) object */
 
@@ -641,9 +604,6 @@
 #if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL
 /* There is a single, global lock, held for the duration of an MPI call */
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_BRIEF_GLOBAL
-/* There is a single, global lock, held only when needed */
-
 #elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
 /* There are multiple locks, one for each logical class (e.g., each type of 
    object) */

Modified: mpich2/trunk/src/mpi/comm/commutil.c
===================================================================
--- mpich2/trunk/src/mpi/comm/commutil.c	2009-10-20 20:35:15 UTC (rev 5492)
+++ mpich2/trunk/src/mpi/comm/commutil.c	2009-10-20 20:35:18 UTC (rev 5493)
@@ -32,9 +32,8 @@
 		MPID_Thread_yield();\
 		MPID_Thread_mutex_lock(&MPIR_ThreadInfo.global_mutex);
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_BRIEF_GLOBAL || \
-      MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
-/* There is a single, global lock, held only when needed */
+#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
+/* There are multiple locks, one for each (major) object */
 #define MPIU_THREAD_CS_ENTER_CONTEXTID(_context) \
    MPIU_THREAD_CHECK_BEGIN MPIU_THREAD_CS_ENTER_LOCKNAME(global_mutex) MPIU_THREAD_CHECK_END
 #define MPIU_THREAD_CS_EXIT_CONTEXTID(_context) \



More information about the mpich2-commits mailing list