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

Service Account noreply at mpich.org
Wed Sep 23 16:48:35 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  1def98d77ed0c9cf977695d7461a87cd1983bbb7 (commit)
       via  85ea4e067e1f8f3bab197f46431b024ad826e81e (commit)
      from  b78f14c8e3b732817f5772dc88f6a5d1fe56498c (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/1def98d77ed0c9cf977695d7461a87cd1983bbb7

commit 1def98d77ed0c9cf977695d7461a87cd1983bbb7
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Sep 23 11:14:51 2015 -0500

    Move memalloc mutex to an all-granularity mutex.
    
    MPID_THREAD_CS_ENTER/EXIT routines are recursive for the global thread
    level.  In this case, they use the thread-local storage to figure out
    the locking depth.  For compilers that do not have native TLS support,
    we emulate it by allocating our own TLS using MPIU_Calloc.
    MPIU_Calloc uses MPID_THREAD_CS_ENTER/EXIT in debug mode to make its
    allocations thread-safe.  This is a recursive chain.
    
    To fix this issue, we make memory allocation routines special in that
    they get their own mutex, which is enabled in both global and
    per-object modes.
    
    Signed-off-by: Sangmin Seo <sseo at anl.gov>

diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 16bd63d..ab1f771 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -172,6 +172,8 @@ static int thread_cs_init( void )
 /* There is a single, global lock, held for the duration of an MPI call */
     MPID_Thread_mutex_create(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
     MPIU_Assert(err == 0);
+    MPID_Thread_mutex_create(&MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX, &err);
+    MPIU_Assert(err == 0);
 
 #elif MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
     /* MPICH_THREAD_GRANULARITY_PER_OBJECT: Multiple locks */
@@ -187,7 +189,7 @@ static int thread_cs_init( void )
     MPIU_Assert(err == 0);
     MPID_Thread_mutex_create(&MPIR_THREAD_POBJ_PMI_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_THREAD_POBJ_MEMALLOC_MUTEX, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX, &err);
     MPIU_Assert(err == 0);
 
 #elif MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_LOCK_FREE
diff --git a/src/util/mem/trmem.c b/src/util/mem/trmem.c
index 14ec057..73549ad 100644
--- a/src/util/mem/trmem.c
+++ b/src/util/mem/trmem.c
@@ -17,95 +17,95 @@ void MPIU_trinit(int rank)
 
 void MPIU_trdump(FILE *fp, int minid)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     MPL_trdump(fp, minid);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
 }
 
 void *MPIU_trmalloc(size_t a, int lineno, const char fname[])
 {
     void *retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     retval = MPL_trmalloc(a, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     return retval;
 }
 
 void MPIU_trfree(void *a_ptr, int line, const char fname[])
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     MPL_trfree(a_ptr, line, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
 }
 
 int MPIU_trvalid(const char str[])
 {
     int retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     retval = MPL_trvalid(str);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     return retval;
 }
 
 void MPIU_trspace(size_t *space, size_t *fr)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     MPL_trspace(space, fr);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
 }
 
 void MPIU_trid(int id)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     MPL_trid(id);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
 }
 
 void MPIU_trlevel(int level)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     MPL_trlevel(level);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
 }
 
 void MPIU_trDebugLevel(int level)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     MPL_trDebugLevel(level);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
 }
 
 void *MPIU_trcalloc(size_t nelem, size_t elsize, int lineno, const char fname[])
 {
     void *retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     retval = MPL_trcalloc(nelem, elsize, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     return retval;
 }
 
 void *MPIU_trrealloc(void *p, size_t size, int lineno, const char fname[])
 {
     void *retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     retval = MPL_trrealloc(p, size, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     return retval;
 }
 
 void *MPIU_trstrdup(const char *str, int lineno, const char fname[])
 {
     void *retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     retval = MPL_trstrdup(str, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     return retval;
 }
 
 void MPIU_TrSetMaxMem(size_t size)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     MPL_TrSetMaxMem(size);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
 }
 
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index 33e5b93..e837d34 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -77,6 +77,7 @@ typedef struct {
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL || \
     MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
     MPIU_Thread_mutex_t global_mutex;
+    MPIU_Thread_mutex_t memalloc_mutex; /* for MPIU_{Malloc,Free,Calloc} */
 #endif
 
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
@@ -85,7 +86,6 @@ typedef struct {
     MPIU_Thread_mutex_t completion_mutex;
     MPIU_Thread_mutex_t ctx_mutex;
     MPIU_Thread_mutex_t pmi_mutex;
-    MPIU_Thread_mutex_t memalloc_mutex; /* for MPIU_{Malloc,Free,Calloc} */
 #endif
 } MPIR_Thread_info_t;
 extern MPIR_Thread_info_t MPIR_ThreadInfo;
@@ -96,7 +96,7 @@ extern MPIR_Thread_info_t MPIR_ThreadInfo;
 #define MPIR_THREAD_POBJ_COMPLETION_MUTEX     MPIR_ThreadInfo.completion_mutex
 #define MPIR_THREAD_POBJ_CTX_MUTEX            MPIR_ThreadInfo.ctx_mutex
 #define MPIR_THREAD_POBJ_PMI_MUTEX            MPIR_ThreadInfo.pmi_mutex
-#define MPIR_THREAD_POBJ_MEMALLOC_MUTEX       MPIR_ThreadInfo.memalloc_mutex
+#define MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX    MPIR_ThreadInfo.memalloc_mutex
 #define MPIR_THREAD_POBJ_COMM_MUTEX(_comm_ptr) _comm_ptr->mutex
 #define MPIR_THREAD_POBJ_WIN_MUTEX(_win_ptr)   _win_ptr->mutex
 
diff --git a/src/util/thread/mpiu_thread_global.h b/src/util/thread/mpiu_thread_global.h
index 959b34e..b4f2d23 100644
--- a/src/util/thread/mpiu_thread_global.h
+++ b/src/util/thread/mpiu_thread_global.h
@@ -7,11 +7,16 @@
 #if !defined(MPIU_THREAD_GLOBAL_H_INCLUDED)
 #define MPIU_THREAD_GLOBAL_H_INCLUDED
 
-/* GLOBAL locks are all real ops */
+/* GLOBAL locks are all real recursive ops */
 #define MPIUI_THREAD_CS_ENTER_GLOBAL(mutex) MPIUI_THREAD_CS_ENTER_RECURSIVE("GLOBAL", mutex)
 #define MPIUI_THREAD_CS_EXIT_GLOBAL(mutex) MPIUI_THREAD_CS_EXIT_RECURSIVE("GLOBAL", mutex)
 #define MPIUI_THREAD_CS_YIELD_GLOBAL(mutex) MPIUI_THREAD_CS_YIELD_RECURSIVE("GLOBAL", mutex)
 
+/* ALLGRAN locks are all real nonrecursive ops */
+#define MPIUI_THREAD_CS_ENTER_ALLGRAN(mutex) MPIUI_THREAD_CS_ENTER_NONRECURSIVE("ALLGRAN", mutex)
+#define MPIUI_THREAD_CS_EXIT_ALLGRAN(mutex) MPIUI_THREAD_CS_EXIT_NONRECURSIVE("ALLGRAN", mutex)
+#define MPIUI_THREAD_CS_YIELD_ALLGRAN(mutex) MPIUI_THREAD_CS_YIELD_NONRECURSIVE("ALLGRAN", mutex)
+
 /* POBJ locks are all NO-OPs */
 #define MPIUI_THREAD_CS_ENTER_POBJ(mutex)
 #define MPIUI_THREAD_CS_EXIT_POBJ(mutex)
diff --git a/src/util/thread/mpiu_thread_pobj.h b/src/util/thread/mpiu_thread_pobj.h
index 2713e4c..3e58ff0 100644
--- a/src/util/thread/mpiu_thread_pobj.h
+++ b/src/util/thread/mpiu_thread_pobj.h
@@ -74,11 +74,16 @@
  * the order should be to acquire MPIDCOMM first, then MSGQUEUE.  Release in
  * reverse order. */
 
-/* POBJ locks are all real ops */
+/* POBJ locks are all real recursive ops */
 #define MPIUI_THREAD_CS_ENTER_POBJ(mutex) MPIUI_THREAD_CS_ENTER_NONRECURSIVE("POBJ", mutex)
 #define MPIUI_THREAD_CS_EXIT_POBJ(mutex) MPIUI_THREAD_CS_EXIT_NONRECURSIVE("POBJ", mutex)
 #define MPIUI_THREAD_CS_YIELD_POBJ(mutex) MPIUI_THREAD_CS_YIELD_NONRECURSIVE("POBJ", mutex)
 
+/* ALLGRAN locks are all real nonrecursive ops */
+#define MPIUI_THREAD_CS_ENTER_ALLGRAN(mutex) MPIUI_THREAD_CS_ENTER_NONRECURSIVE("ALLGRAN", mutex)
+#define MPIUI_THREAD_CS_EXIT_ALLGRAN(mutex) MPIUI_THREAD_CS_EXIT_NONRECURSIVE("ALLGRAN", mutex)
+#define MPIUI_THREAD_CS_YIELD_ALLGRAN(mutex) MPIUI_THREAD_CS_YIELD_NONRECURSIVE("ALLGRAN", mutex)
+
 /* GLOBAL locks are all NO-OPs */
 #define MPIUI_THREAD_CS_ENTER_GLOBAL(mutex)
 #define MPIUI_THREAD_CS_EXIT_GLOBAL(mutex)

http://git.mpich.org/mpich.git/commitdiff/85ea4e067e1f8f3bab197f46431b024ad826e81e

commit 85ea4e067e1f8f3bab197f46431b024ad826e81e
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Sep 23 11:10:46 2015 -0500

    Rename POBJ mutexes to better namespace them.
    
    Signed-off-by: Sangmin Seo <sseo at anl.gov>

diff --git a/src/mpi/comm/contextid.c b/src/mpi/comm/contextid.c
index 704d834..1914d8f 100644
--- a/src/mpi/comm/contextid.c
+++ b/src/mpi/comm/contextid.c
@@ -349,7 +349,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
     while (*context_id == 0) {
         /* We lock only around access to the mask (except in the global locking
          * case).  If another thread is using the mask, we take a mask of zero. */
-        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_CTX_MUTEX);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
 
         if (initialize_context_mask) {
             context_id_init();
@@ -418,7 +418,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
                 MPIU_DBG_MSG(COMM, VERBOSE, "Copied local_mask");
             }
         }
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_CTX_MUTEX);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
 
         /* Note: MPIR_MAX_CONTEXT_MASK elements of local_mask are used by the
          * context ID allocation algorithm.  The additional element is ignored
@@ -451,7 +451,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
 
         /* MT FIXME 2/3 cases don't seem to need the CONTEXTID CS, check and
          * narrow this region */
-        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_CTX_MUTEX);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
         if (ignore_id) {
             /* we don't care what the value was, but make sure that everyone
              * who did care agreed on a value */
@@ -476,7 +476,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
                  * When we do a collective operation, we anyway yield
                  * for other others */
                 MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
-                MPID_THREAD_CS_YIELD(POBJ, MPIR_THREAD_CTX_MUTEX);
+                MPID_THREAD_CS_YIELD(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
             }
         }
         else if (own_mask) {
@@ -505,7 +505,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
                  * When we do a collective operation, we anyway yield
                  * for other others */
                 MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
-                MPID_THREAD_CS_YIELD(POBJ, MPIR_THREAD_CTX_MUTEX);
+                MPID_THREAD_CS_YIELD(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
             }
         }
         else {
@@ -514,9 +514,9 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
              * do a collective operation, we anyway yield for other
              * others */
             MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
-            MPID_THREAD_CS_YIELD(POBJ, MPIR_THREAD_CTX_MUTEX);
+            MPID_THREAD_CS_YIELD(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
         }
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_CTX_MUTEX);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
 
         /* Test for context ID exhaustion: All threads that will participate in
          * the new communicator owned the mask and could not allocate a context
@@ -530,13 +530,13 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
             int minfree;
 
             if (own_mask) {
-                MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_CTX_MUTEX);
+                MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
                 mask_in_use = 0;
                 if (lowest_context_id == comm_ptr->context_id && lowest_tag == tag) {
                     lowest_context_id = MPIR_MAXID;
                     lowest_tag = -1;
                 }
-                MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_CTX_MUTEX);
+                MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
             }
 
             context_mask_stats(&nfree, &ntotal);
@@ -1211,12 +1211,12 @@ void MPIR_Free_contextid(MPIU_Context_id_t context_id)
     }
     /* --END ERROR HANDLING-- */
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_CTX_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
     /* MT: Note that this update must be done atomically in the multithreaedd
      * case.  In the "one, single lock" implementation, that lock is indeed
      * held when this operation is called. */
     context_mask[idx] |= (0x1 << bitpos);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_CTX_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
 
     MPIU_DBG_MSG_FMT(COMM, VERBOSE,
                      (MPIU_DBG_FDEST,
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 0e1e45a..16bd63d 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -177,17 +177,17 @@ static int thread_cs_init( void )
     /* MPICH_THREAD_GRANULARITY_PER_OBJECT: Multiple locks */
     MPID_Thread_mutex_create(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_THREAD_HANDLE_MUTEX, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_POBJ_HANDLE_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_THREAD_MSGQ_MUTEX, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_POBJ_MSGQ_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_THREAD_COMPLETION_MUTEX, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_POBJ_COMPLETION_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_THREAD_CTX_MUTEX, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_POBJ_CTX_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_THREAD_PMI_MUTEX, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_POBJ_PMI_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_THREAD_MEMALLOC_MUTEX, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_POBJ_MEMALLOC_MUTEX, &err);
     MPIU_Assert(err == 0);
 
 #elif MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_LOCK_FREE
@@ -228,15 +228,15 @@ int MPIR_Thread_CS_Finalize( void )
      * one for each logical class (e.g., each type of object) */
     MPID_Thread_mutex_destroy(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_destroy(&MPIR_THREAD_HANDLE_MUTEX, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_POBJ_HANDLE_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_destroy(&MPIR_THREAD_MSGQ_MUTEX, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_POBJ_MSGQ_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_destroy(&MPIR_THREAD_COMPLETION_MUTEX, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_POBJ_COMPLETION_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_destroy(&MPIR_THREAD_CTX_MUTEX, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_POBJ_CTX_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_destroy(&MPIR_THREAD_PMI_MUTEX, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_POBJ_PMI_MUTEX, &err);
     MPIU_Assert(err == 0);
 
 
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
index 4ee8677..2c896e7 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
@@ -236,9 +236,9 @@ static int _mxm_handle_rreq(MPID_Request * req)
     MPID_nem_mxm_req_area *req_area = NULL;
     void *tmp_buf = NULL;
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     found = MPIDI_CH3U_Recvq_DP(req);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     /* an MPI_ANY_SOURCE request may have been previously removed from the
      * CH3 queue by an FDP (find and dequeue posted) operation */
     if (req->dev.match.parts.rank != MPI_ANY_SOURCE) {
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
index 424c61e..ac077cf 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
@@ -193,7 +193,7 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
 
     MPIDI_FUNC_ENTER(MPID_STATE_PKT_RTS_HANDLER);
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
     MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST, "received LMT RTS pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d, data_sz=" MPIDI_MSG_SZ_FMT,
                                         rts_pkt->sender_req_id, rts_pkt->match.parts.rank, rts_pkt->match.parts.tag, rts_pkt->match.parts.context_id,
@@ -289,7 +289,7 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
     
     MPIU_CHKPMEM_COMMIT();
  fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_PKT_RTS_HANDLER);
     return mpi_errno;
  fn_fail:
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index dbea0be..51d1420 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -260,7 +260,7 @@ extern MPIDI_Process_t MPIDI_Process;
         if (!MPID_THREADPRIV_FIELD(request_handles)) {                 \
             MPID_Request *prev, *cur;                                  \
             /* batch allocate a linked list of requests */             \
-            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_HANDLE_MUTEX);                        \
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_HANDLE_MUTEX);                        \
             prev = MPIU_Handle_obj_alloc_unsafe(&MPID_Request_mem);    \
             prev->next = NULL;                                         \
             assert(prev);                                              \
@@ -270,7 +270,7 @@ extern MPIDI_Process_t MPIDI_Process;
                 cur->next = prev;                                      \
                 prev = cur;                                            \
             }                                                          \
-            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_HANDLE_MUTEX);                         \
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_HANDLE_MUTEX);                         \
             MPID_THREADPRIV_FIELD(request_handles) = cur;              \
             MPID_THREADPRIV_FIELD(request_handle_count) += MPID_REQUEST_TLS_MAX;    \
         }                                                              \
@@ -1225,12 +1225,12 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
 #ifndef MPIDI_CH3I_INCR_PROGRESS_COMPLETION_COUNT
 #define MPIDI_CH3I_INCR_PROGRESS_COMPLETION_COUNT                                \
     do {                                                                         \
-        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_COMPLETION_MUTEX);                                       \
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_COMPLETION_MUTEX);                                       \
         ++MPIDI_CH3I_progress_completion_count;                                  \
         MPIU_DBG_MSG_D(CH3_PROGRESS,VERBOSE,                                     \
                      "just incremented MPIDI_CH3I_progress_completion_count=%d", \
                      MPIDI_CH3I_progress_completion_count);                      \
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_COMPLETION_MUTEX);                                        \
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_COMPLETION_MUTEX);                                        \
     } while (0)
 #endif
 
diff --git a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
index 7caf3a2..78c864d 100644
--- a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
+++ b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
@@ -173,7 +173,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
                 */
             }
             /* XXX DJG don't need this, PMI API is thread-safe? */
-            /*MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_PMI_MUTEX);*/
+            /*MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);*/
             /* release the global CS for spawn PMI calls */
             MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
             pmi_errno = PMI2_Job_Spawn(count, (const char **)commands,
@@ -185,7 +185,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
                                        /*jobId, jobIdSize,*/ /* XXX DJG job stuff? */
                                        pmi_errcodes);
             MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
-            /*MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_PMI_MUTEX);*/
+            /*MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);*/
             MPIU_Free(argcs);
             if (pmi_errno != PMI2_SUCCESS) {
                 MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER,
@@ -225,7 +225,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
         preput_keyval_vector.val = port_name;
 
 
-        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_PMI_MUTEX);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);
         pmi_errno = PMI_Spawn_multiple(count, (const char **)
                                        commands, 
                                        (const char ***) argvs,
@@ -234,7 +234,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
                                        info_keyval_vectors, 1, 
                                        &preput_keyval_vector,
                                        pmi_errcodes);
-	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_PMI_MUTEX);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);
         if (pmi_errno != PMI_SUCCESS) {
 	    MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER,
 		 "**pmi_spawn_multiple", "**pmi_spawn_multiple %d", pmi_errno);
@@ -339,16 +339,16 @@ int MPIDI_CH3_GetParentPort(char ** parent_port)
 #ifdef USE_PMI2_API
         {
             int vallen = 0;
-            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_PMI_MUTEX);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);
             pmi_errno = PMI2_KVS_Get(kvsname, PMI2_ID_NULL, PARENT_PORT_KVSKEY, val, sizeof(val), &vallen);
-            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_PMI_MUTEX);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);
             if (pmi_errno)
                 MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**pmi_kvsget", "**pmi_kvsget %s", PARENT_PORT_KVSKEY);
         }
 #else
-	MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_PMI_MUTEX);
+	MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);
 	pmi_errno = PMI_KVS_Get( kvsname, PARENT_PORT_KVSKEY, val, sizeof(val));
-	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_PMI_MUTEX);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);
 	if (pmi_errno) {
             mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, FCNAME, __LINE__, MPI_ERR_OTHER, "**pmi_kvsget", "**pmi_kvsget %d", pmi_errno);
             goto fn_exit;
diff --git a/src/mpid/ch3/src/ch3u_eager.c b/src/mpid/ch3/src/ch3u_eager.c
index 9cf33a2..1a81c5a 100644
--- a/src/mpid/ch3/src/ch3u_eager.c
+++ b/src/mpid/ch3/src/ch3u_eager.c
@@ -296,7 +296,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     int found;
     int mpi_errno = MPI_SUCCESS;
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
     /* printf( "Receiving short eager!\n" ); fflush(stdout); */
     MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
@@ -508,7 +508,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* MT note: it may be possible to narrow this CS after careful
      * consideration.  Note though that the (!found) case must be wholly
      * protected by this CS. */
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     return mpi_errno;
 }
 
@@ -615,7 +615,7 @@ int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPIDI_msg_sz_t data_len;
     int mpi_errno = MPI_SUCCESS;
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
     MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 	"received eager send pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d",
@@ -685,7 +685,7 @@ int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     }
 
  fn_fail:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     return mpi_errno;
 }
 
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index b081a3e..4518cb4 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -683,7 +683,7 @@ int MPIDI_CH3U_Recvq_DP(MPID_Request * rreq)
     prev_rreq = NULL;
 
     /* MT FIXME is this right? or should the caller do this? */
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     MPIR_T_PVAR_TIMER_START(RECVQ, time_failed_matching_postedq);
     cur_rreq = recvq_posted_head;
     while (cur_rreq != NULL) {
@@ -713,7 +713,7 @@ int MPIDI_CH3U_Recvq_DP(MPID_Request * rreq)
     if (!found)
         MPIR_T_PVAR_TIMER_END(RECVQ, time_failed_matching_postedq);
 
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3U_RECVQ_DP);
     return found;
@@ -1132,7 +1132,7 @@ int MPIDI_CH3U_Complete_posted_with_error(MPIDI_VC_t *vc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDU_COMPLETE_POSTED_WITH_ERROR);
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
     MPIR_ERR_SETSIMPLE(error, MPIX_ERR_PROC_FAILED, "**proc_failed");
 
@@ -1150,7 +1150,7 @@ int MPIDI_CH3U_Complete_posted_with_error(MPIDI_VC_t *vc)
     }
     
  fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_COMPLETE_POSTED_WITH_ERROR);
     return mpi_errno;
diff --git a/src/mpid/ch3/src/ch3u_rndv.c b/src/mpid/ch3/src/ch3u_rndv.c
index bdff365..f6bb567 100644
--- a/src/mpid/ch3/src/ch3u_rndv.c
+++ b/src/mpid/ch3/src/ch3u_rndv.c
@@ -124,7 +124,7 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 		    rts_pkt->match.parts.rank,rts_pkt->data_sz,
 		    "ReceivedRndv");
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     rreq = MPIDI_CH3U_Recvq_FDP_or_AEU(&rts_pkt->match, &found);
     MPIR_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
 
@@ -138,7 +138,7 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     
     set_request_info(rreq, rts_pkt, MPIDI_REQUEST_RNDV_MSG);
 
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
     
diff --git a/src/mpid/ch3/src/mpid_cancel_send.c b/src/mpid/ch3/src/mpid_cancel_send.c
index 5caff05..5f4b683 100644
--- a/src/mpid/ch3/src/mpid_cancel_send.c
+++ b/src/mpid/ch3/src/mpid_cancel_send.c
@@ -56,9 +56,9 @@ int MPID_Cancel_send(MPID_Request * sreq)
 	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
 		     "attempting to cancel message sent to self");
 	
-	MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+	MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 	rreq = MPIDI_CH3U_Recvq_FDU(sreq->handle, &sreq->dev.match);
-	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 	if (rreq)
 	{
 	    MPIU_Assert(rreq->partner_request == sreq);
diff --git a/src/mpid/ch3/src/mpid_comm_revoke.c b/src/mpid/ch3/src/mpid_comm_revoke.c
index d4f75d5..09d836f 100644
--- a/src/mpid/ch3/src/mpid_comm_revoke.c
+++ b/src/mpid/ch3/src/mpid_comm_revoke.c
@@ -84,9 +84,9 @@ int MPID_Comm_revoke(MPID_Comm *comm_ptr, int is_remote)
          * aren't any unexpected messages hanging around. */
 
         /* Clean up the receive and unexpected queues */
-        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
         MPIDI_CH3U_Clean_recvq(comm_ptr);
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     } else if (is_remote)  { /* If this is local, we've already revoked and don't need to do it again. */
         /* Decrement the revoke counter */
         comm_ptr->dev.waiting_for_revoke--;
diff --git a/src/mpid/ch3/src/mpid_improbe.c b/src/mpid/ch3/src/mpid_improbe.c
index f9a615a..4dbb6b7 100644
--- a/src/mpid/ch3/src/mpid_improbe.c
+++ b/src/mpid/ch3/src/mpid_improbe.c
@@ -42,9 +42,9 @@ int MPID_Improbe(int source, int tag, MPID_Comm *comm, int context_offset,
                If still not found, call progress, and check again. */
 
             /* check shm*/
-            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
             *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
             if (!*flag) {
                 /* not found, check network */
                 mpi_errno = MPIDI_Anysource_improbe_fn(tag, comm, context_offset, flag, message, status);
@@ -54,9 +54,9 @@ int MPID_Improbe(int source, int tag, MPID_Comm *comm, int context_offset,
                     mpi_errno = MPIDI_CH3_Progress_poke();
                     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     /* check shm again */
-                    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+                    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
                     *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-                    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+                    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
                     if (!*flag) {
                         /* check network again */
                         mpi_errno = MPIDI_Anysource_improbe_fn(tag, comm, context_offset, flag, message, status);
@@ -80,9 +80,9 @@ int MPID_Improbe(int source, int tag, MPID_Comm *comm, int context_offset,
     }
 #endif
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
     if (!*flag) {
         /* Always try to advance progress before returning failure
@@ -93,9 +93,9 @@ int MPID_Improbe(int source, int tag, MPID_Comm *comm, int context_offset,
            had changed */
         mpi_errno = MPID_Progress_poke();
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
-        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
         *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     }
 
     if (*flag && *message) {
diff --git a/src/mpid/ch3/src/mpid_iprobe.c b/src/mpid/ch3/src/mpid_iprobe.c
index 713bf86..e30a1b2 100644
--- a/src/mpid/ch3/src/mpid_iprobe.c
+++ b/src/mpid/ch3/src/mpid_iprobe.c
@@ -46,9 +46,9 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
                If still not found, call progress, and check again. */
 
             /* check shm*/
-            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
             found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
             if (!found) {
                 /* not found, check network */
                 mpi_errno = MPIDI_Anysource_iprobe_fn(tag, comm, context_offset, &found, status);
@@ -58,9 +58,9 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
                     mpi_errno = MPIDI_CH3_Progress_poke();
                     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     /* check shm again */
-                    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+                    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
                     found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-                    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+                    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
                     if (!found) {
                         /* check network again */
                         mpi_errno = MPIDI_Anysource_iprobe_fn(tag, comm, context_offset, &found, status);
@@ -90,9 +90,9 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
        a request.  Note that in some cases it will be possible to 
        atomically query the unexpected receive list (which is what the
        probe routines are for). */
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     found = MPIDI_CH3U_Recvq_FU( source, tag, context, status );
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     if (!found) {
 	/* Always try to advance progress before returning failure
 	   from the iprobe test.  */
@@ -101,9 +101,9 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
 	   a second test of the receive queue if we knew that nothing
 	   had changed */
 	mpi_errno = MPID_Progress_poke();
-	MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+	MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 	found = MPIDI_CH3U_Recvq_FU( source, tag, context, status );
-	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     }
 	
     *flag = found;
diff --git a/src/mpid/ch3/src/mpid_irecv.c b/src/mpid/ch3/src/mpid_irecv.c
index 8f19987..47528f5 100644
--- a/src/mpid/ch3/src/mpid_irecv.c
+++ b/src/mpid/ch3/src/mpid_irecv.c
@@ -39,13 +39,13 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
         MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     rreq = MPIDI_CH3U_Recvq_FDU_or_AEP(rank, tag, 
 				       comm->recvcontext_id + context_offset,
                                        comm, buf, count, datatype, &found);
     if (rreq == NULL)
     {
-	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomemreq");
     }
 
@@ -58,7 +58,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 
 	/* Release the message queue - we've removed this request from 
 	   the queue already */
-	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
 	if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_EAGER_MSG)
 	{
@@ -160,7 +160,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 	/* We must wait until here to exit the msgqueue critical section
 	   on this request (we needed to set the recv_pending_count
 	   and the datatype pointer) */
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     }
 
   fn_exit:
diff --git a/src/mpid/ch3/src/mpid_mprobe.c b/src/mpid/ch3/src/mpid_mprobe.c
index 4e00173..6e50eaf 100644
--- a/src/mpid/ch3/src/mpid_mprobe.c
+++ b/src/mpid/ch3/src/mpid_mprobe.c
@@ -40,9 +40,9 @@ int MPID_Mprobe(int source, int tag, MPID_Comm *comm, int context_offset,
                queue and improbing the netmod, then do a progress
                test to make some progress. */
             do {
-                MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+                MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
                 *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm,&found);
-                MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+                MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
                 if (found) goto fn_exit;
 
                 mpi_errno = MPIDI_Anysource_improbe_fn(tag, comm, context_offset, &found, message, status);
@@ -93,9 +93,9 @@ int MPID_Mprobe(int source, int tag, MPID_Comm *comm, int context_offset,
     MPIDI_CH3_Progress_start(&progress_state);
     do
     {
-        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
         *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, &found);
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
         if (found)
             break;
 
diff --git a/src/mpid/ch3/src/mpid_probe.c b/src/mpid/ch3/src/mpid_probe.c
index 9d8a043..2c37309 100644
--- a/src/mpid/ch3/src/mpid_probe.c
+++ b/src/mpid/ch3/src/mpid_probe.c
@@ -42,9 +42,9 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
             do {
                 int found;
                 
-                MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+                MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
                 found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-                MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+                MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
                 if (found) goto fn_exit;
 
                 mpi_errno = MPIDI_Anysource_iprobe_fn(tag, comm, context_offset, &found, status);
@@ -86,9 +86,9 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
     {
         int found;
 
-        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
         found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
         if (found) break;
 
 	mpi_errno = MPIDI_CH3_Progress_wait(&progress_state);
diff --git a/src/mpid/ch3/src/mpid_recv.c b/src/mpid/ch3/src/mpid_recv.c
index 22199ce..d226784 100644
--- a/src/mpid/ch3/src/mpid_recv.c
+++ b/src/mpid/ch3/src/mpid_recv.c
@@ -46,12 +46,12 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
         MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     rreq = MPIDI_CH3U_Recvq_FDU_or_AEP(rank, tag, 
 				       comm->recvcontext_id + context_offset,
                                        comm, buf, count, datatype, &found);
     if (rreq == NULL) {
-	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomemreq");
     }
 
@@ -64,7 +64,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 
 	/* Release the message queue - we've removed this request from 
 	   the queue already */
-	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 	if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_EAGER_MSG)
 	{
 	    int recv_pending;
@@ -180,7 +180,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 	/* We must wait until here to exit the msgqueue critical section
 	   on this request (we needed to set the recv_pending_count
 	   and the datatype pointer) */
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
     }
 
   fn_exit:
diff --git a/src/mpid/ch3/src/mpidi_isend_self.c b/src/mpid/ch3/src/mpidi_isend_self.c
index 1141629..72c9f89 100644
--- a/src/mpid/ch3/src/mpidi_isend_self.c
+++ b/src/mpid/ch3/src/mpidi_isend_self.c
@@ -39,7 +39,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
     match.parts.tag = tag;
     match.parts.context_id = comm->context_id + context_offset;
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
     rreq = MPIDI_CH3U_Recvq_FDP_or_AEU(&match, &found);
     /* --BEGIN ERROR HANDLING-- */
@@ -85,7 +85,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
 	MPIDI_msg_sz_t data_sz;
 	
         /* we found a posted req, which we now own, so we can release the CS */
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
 	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
 		     "found posted receive request; copying data");
@@ -147,7 +147,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
 	MPIDI_Request_set_msg_type(rreq, MPIDI_REQUEST_SELF_MSG);
 
         /* can release now that we've set fields in the unexpected request */
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
         /* kick the progress engine in case another thread that is performing a
            blocking recv or probe is waiting in the progress engine */
diff --git a/src/mpid/ch3/src/mpidi_pg.c b/src/mpid/ch3/src/mpidi_pg.c
index b568242..72dbd98 100644
--- a/src/mpid/ch3/src/mpidi_pg.c
+++ b/src/mpid/ch3/src/mpidi_pg.c
@@ -706,13 +706,13 @@ static int getConnInfoKVS( int rank, char *buf, int bufsize, MPIDI_PG_t *pg )
 	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
     }
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_PMI_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);
     pmi_errno = PMI_KVS_Get(pg->connData, key, buf, bufsize );
     if (pmi_errno) {
 	MPIDI_PG_CheckForSingleton();
 	pmi_errno = PMI_KVS_Get(pg->connData, key, buf, bufsize );
     }
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_PMI_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);
     if (pmi_errno) {
 	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**pmi_kvs_get");
     }
diff --git a/src/util/mem/handlemem.c b/src/util/mem/handlemem.c
index c2c7ccf..1eea3c2 100644
--- a/src/util/mem/handlemem.c
+++ b/src/util/mem/handlemem.c
@@ -322,7 +322,7 @@ Input Parameters:
   MPI_Requests) and should not call any other routines in the common
   case.
 
-  Threading: The 'MPID_THREAD_CS_ENTER/EXIT(POBJ, MPIR_THREAD_HANDLE_MUTEX)' enables both 
+  Threading: The 'MPID_THREAD_CS_ENTER/EXIT(POBJ, MPIR_THREAD_POBJ_HANDLE_MUTEX)' enables both 
   finer-grain
   locking with a single global mutex and with a mutex specific for handles.
 
@@ -334,9 +334,9 @@ Input Parameters:
 void *MPIU_Handle_obj_alloc(MPIU_Object_alloc_t *objmem)
 {
     void *ret;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_HANDLE_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_HANDLE_MUTEX);
     ret = MPIU_Handle_obj_alloc_unsafe(objmem);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_HANDLE_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_HANDLE_MUTEX);
     return ret;
 }
 
@@ -459,7 +459,7 @@ void MPIU_Handle_obj_free( MPIU_Object_alloc_t *objmem, void *object )
 {
     MPIU_Handle_common *obj = (MPIU_Handle_common *)object;
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_HANDLE_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_HANDLE_MUTEX);
 
     MPIU_DBG_MSG_FMT(HANDLE,TYPICAL,(MPIU_DBG_FDEST,
                                      "Freeing object ptr %p (0x%08x kind=%s) refcount=%d",
@@ -502,7 +502,7 @@ void MPIU_Handle_obj_free( MPIU_Object_alloc_t *objmem, void *object )
 
     obj->next	        = objmem->avail;
     objmem->avail	= obj;
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_HANDLE_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_HANDLE_MUTEX);
 }
 
 /* 
diff --git a/src/util/mem/trmem.c b/src/util/mem/trmem.c
index 2b8769c..14ec057 100644
--- a/src/util/mem/trmem.c
+++ b/src/util/mem/trmem.c
@@ -17,95 +17,95 @@ void MPIU_trinit(int rank)
 
 void MPIU_trdump(FILE *fp, int minid)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     MPL_trdump(fp, minid);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
 }
 
 void *MPIU_trmalloc(size_t a, int lineno, const char fname[])
 {
     void *retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     retval = MPL_trmalloc(a, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     return retval;
 }
 
 void MPIU_trfree(void *a_ptr, int line, const char fname[])
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     MPL_trfree(a_ptr, line, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
 }
 
 int MPIU_trvalid(const char str[])
 {
     int retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     retval = MPL_trvalid(str);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     return retval;
 }
 
 void MPIU_trspace(size_t *space, size_t *fr)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     MPL_trspace(space, fr);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
 }
 
 void MPIU_trid(int id)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     MPL_trid(id);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
 }
 
 void MPIU_trlevel(int level)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     MPL_trlevel(level);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
 }
 
 void MPIU_trDebugLevel(int level)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     MPL_trDebugLevel(level);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
 }
 
 void *MPIU_trcalloc(size_t nelem, size_t elsize, int lineno, const char fname[])
 {
     void *retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     retval = MPL_trcalloc(nelem, elsize, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     return retval;
 }
 
 void *MPIU_trrealloc(void *p, size_t size, int lineno, const char fname[])
 {
     void *retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     retval = MPL_trrealloc(p, size, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     return retval;
 }
 
 void *MPIU_trstrdup(const char *str, int lineno, const char fname[])
 {
     void *retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     retval = MPL_trstrdup(str, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     return retval;
 }
 
 void MPIU_TrSetMaxMem(size_t size)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
     MPL_TrSetMaxMem(size);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MEMALLOC_MUTEX);
 }
 
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index 296fb83..33e5b93 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -91,12 +91,12 @@ typedef struct {
 extern MPIR_Thread_info_t MPIR_ThreadInfo;
 
 #define MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX      MPIR_ThreadInfo.global_mutex
-#define MPIR_THREAD_HANDLE_MUTEX      MPIR_ThreadInfo.handle_mutex
-#define MPIR_THREAD_MSGQ_MUTEX        MPIR_ThreadInfo.msgq_mutex
-#define MPIR_THREAD_COMPLETION_MUTEX  MPIR_ThreadInfo.completion_mutex
-#define MPIR_THREAD_CTX_MUTEX         MPIR_ThreadInfo.ctx_mutex
-#define MPIR_THREAD_PMI_MUTEX         MPIR_ThreadInfo.pmi_mutex
-#define MPIR_THREAD_MEMALLOC_MUTEX    MPIR_ThreadInfo.memalloc_mutex
+#define MPIR_THREAD_POBJ_HANDLE_MUTEX         MPIR_ThreadInfo.handle_mutex
+#define MPIR_THREAD_POBJ_MSGQ_MUTEX           MPIR_ThreadInfo.msgq_mutex
+#define MPIR_THREAD_POBJ_COMPLETION_MUTEX     MPIR_ThreadInfo.completion_mutex
+#define MPIR_THREAD_POBJ_CTX_MUTEX            MPIR_ThreadInfo.ctx_mutex
+#define MPIR_THREAD_POBJ_PMI_MUTEX            MPIR_ThreadInfo.pmi_mutex
+#define MPIR_THREAD_POBJ_MEMALLOC_MUTEX       MPIR_ThreadInfo.memalloc_mutex
 #define MPIR_THREAD_POBJ_COMM_MUTEX(_comm_ptr) _comm_ptr->mutex
 #define MPIR_THREAD_POBJ_WIN_MUTEX(_win_ptr)   _win_ptr->mutex
 

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

Summary of changes:
 src/mpi/comm/contextid.c                           |   22 +++++-----
 src/mpi/init/initthread.c                          |   24 +++++-----
 .../ch3/channels/nemesis/netmod/mxm/mxm_poll.c     |    4 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c   |    4 +-
 src/mpid/ch3/include/mpidimpl.h                    |    8 ++--
 src/mpid/ch3/src/ch3u_comm_spawn_multiple.c        |   16 +++---
 src/mpid/ch3/src/ch3u_eager.c                      |    8 ++--
 src/mpid/ch3/src/ch3u_recvq.c                      |    8 ++--
 src/mpid/ch3/src/ch3u_rndv.c                       |    4 +-
 src/mpid/ch3/src/mpid_cancel_send.c                |    4 +-
 src/mpid/ch3/src/mpid_comm_revoke.c                |    4 +-
 src/mpid/ch3/src/mpid_improbe.c                    |   16 +++---
 src/mpid/ch3/src/mpid_iprobe.c                     |   16 +++---
 src/mpid/ch3/src/mpid_irecv.c                      |    8 ++--
 src/mpid/ch3/src/mpid_mprobe.c                     |    8 ++--
 src/mpid/ch3/src/mpid_probe.c                      |    8 ++--
 src/mpid/ch3/src/mpid_recv.c                       |    8 ++--
 src/mpid/ch3/src/mpidi_isend_self.c                |    6 +-
 src/mpid/ch3/src/mpidi_pg.c                        |    4 +-
 src/util/mem/handlemem.c                           |   10 ++--
 src/util/mem/trmem.c                               |   48 ++++++++++----------
 src/util/thread/mpiu_thread.h                      |   14 +++---
 src/util/thread/mpiu_thread_global.h               |    7 +++-
 src/util/thread/mpiu_thread_pobj.h                 |    7 +++-
 24 files changed, 139 insertions(+), 127 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list