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

Service Account noreply at mpich.org
Sat Aug 15 14:57:52 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  6504ef78086bb5ab1433b66dc527fc921cbbfc6a (commit)
       via  964b32d0180840e868cc10b28180c78a3e10d87f (commit)
       via  94c2de448a2e9a598787d41cd948335eb756778a (commit)
       via  8c1db8c508ae2cba9ab4ef53ce5018a2e61b8266 (commit)
       via  45bfb114d45fb5dbeeeaa80e4d975ff0b8a267a3 (commit)
       via  8c3a1def822759e116df9a614d64b8012d3794a9 (commit)
       via  c7ff730a5252a06f524ae1a72914b9967a27906c (commit)
       via  5f2cb148b330cfe2e46e22af8549c92e68e68de2 (commit)
       via  4a706ae7ad15a14f6a759d5df207f5e00d4138f3 (commit)
       via  05a87d2a5f7043ca879da13d3ac4876218e01c38 (commit)
       via  395038058b875d202f765f19fada7a0f61662ee7 (commit)
       via  da5d528c230eb2f1ef8897e4070a9fd47f68d849 (commit)
      from  f3984d8e88e84aedbdb776620833c2068b6bfe15 (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/6504ef78086bb5ab1433b66dc527fc921cbbfc6a

commit 6504ef78086bb5ab1433b66dc527fc921cbbfc6a
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Aug 14 22:52:17 2015 -0500

    Use macros instead of direct mutex names to make the code cleaner.
    
    No reviewer.

diff --git a/src/binding/fortran/use_mpi/create_f90_complex.c b/src/binding/fortran/use_mpi/create_f90_complex.c
index b65e7cb..67981cd 100644
--- a/src/binding/fortran/use_mpi/create_f90_complex.c
+++ b/src/binding/fortran/use_mpi/create_f90_complex.c
@@ -80,7 +80,7 @@ int MPI_Type_create_f90_complex( int precision, int range, MPI_Datatype *newtype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_F90_COMPLEX);
 
     /* ... body of routine ...  */
@@ -126,7 +126,7 @@ int MPI_Type_create_f90_complex( int precision, int range, MPI_Datatype *newtype
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_F90_COMPLEX);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/binding/fortran/use_mpi/create_f90_int.c b/src/binding/fortran/use_mpi/create_f90_int.c
index f2a8ad9..4bff608 100644
--- a/src/binding/fortran/use_mpi/create_f90_int.c
+++ b/src/binding/fortran/use_mpi/create_f90_int.c
@@ -74,7 +74,7 @@ int MPI_Type_create_f90_integer( int range, MPI_Datatype *newtype )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_F90_INTEGER);
 
     /* ... body of routine ...  */
@@ -109,7 +109,7 @@ int MPI_Type_create_f90_integer( int range, MPI_Datatype *newtype )
     /* ... end of body of routine ... */
  fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_F90_INTEGER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
  fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/binding/fortran/use_mpi/create_f90_real.c b/src/binding/fortran/use_mpi/create_f90_real.c
index 5e3a68f..11b5ebd 100644
--- a/src/binding/fortran/use_mpi/create_f90_real.c
+++ b/src/binding/fortran/use_mpi/create_f90_real.c
@@ -79,7 +79,7 @@ int MPI_Type_create_f90_real( int precision, int range, MPI_Datatype *newtype )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_F90_REAL);
 
     /* ... body of routine ...  */
@@ -123,7 +123,7 @@ int MPI_Type_create_f90_real( int precision, int range, MPI_Datatype *newtype )
     /* ... end of body of routine ... */
 
  fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_F90_REAL);
     return mpi_errno;
  fn_fail:
diff --git a/src/glue/romio/glue_romio.c b/src/glue/romio/glue_romio.c
index 0c8c5f6..87a3125 100644
--- a/src/glue/romio/glue_romio.c
+++ b/src/glue/romio/glue_romio.c
@@ -41,12 +41,12 @@ int MPIR_Ext_assert_fail(const char *cond, const char *file_name, int line_num)
  * threading strategies. */
 void MPIR_Ext_cs_enter_global(void)
 {
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 }
 
 void MPIR_Ext_cs_exit_global(void)
 {
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 }
 
 /* This routine is for a thread to yield control when the thread is waiting for
@@ -55,7 +55,7 @@ void MPIR_Ext_cs_exit_global(void)
 void MPIR_Ext_cs_yield_global_if_progress_blocked(void)
 {
     /* TODO: check whether the progress engine is blocked */
-    MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 }
 
 /* will consider MPI_DATATYPE_NULL to be an error */
diff --git a/src/mpi/attr/attr_delete.c b/src/mpi/attr/attr_delete.c
index fa93ba3..42bd6ea 100644
--- a/src/mpi/attr/attr_delete.c
+++ b/src/mpi/attr/attr_delete.c
@@ -62,7 +62,7 @@ int MPI_Attr_delete(MPI_Comm comm, int keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ATTR_DELETE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -105,7 +105,7 @@ int MPI_Attr_delete(MPI_Comm comm, int keyval)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ATTR_DELETE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/attr_get.c b/src/mpi/attr/attr_get.c
index a318284..e75baa8 100644
--- a/src/mpi/attr/attr_get.c
+++ b/src/mpi/attr/attr_get.c
@@ -80,7 +80,7 @@ int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ATTR_GET);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -130,7 +130,7 @@ int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ATTR_GET);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/attr_put.c b/src/mpi/attr/attr_put.c
index adb491b..83b084b 100644
--- a/src/mpi/attr/attr_put.c
+++ b/src/mpi/attr/attr_put.c
@@ -79,7 +79,7 @@ int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ATTR_PUT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -121,7 +121,7 @@ int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ATTR_PUT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/attrutil.c b/src/mpi/attr/attrutil.c
index 656915d..ca6b166 100644
--- a/src/mpi/attr/attrutil.c
+++ b/src/mpi/attr/attrutil.c
@@ -327,9 +327,9 @@ MPIR_Attr_copy_c_proxy(
     /* user functions might call other MPI functions, so we need to
      * release the lock here. This is safe to do as GLOBAL is not at
      * all recursive in our implementation. */
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     ret = user_function(handle, keyval, extra_state, attrib_val, attrib_copy, flag);
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return ret;
 }
@@ -357,9 +357,9 @@ MPIR_Attr_delete_c_proxy(
     /* user functions might call other MPI functions, so we need to
      * release the lock here. This is safe to do as GLOBAL is not at
      * all recursive in our implementation. */
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     ret = user_function(handle, keyval, attrib_val, extra_state);
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return ret;
 }
diff --git a/src/mpi/attr/comm_create_keyval.c b/src/mpi/attr/comm_create_keyval.c
index 379d572..72a2762 100644
--- a/src/mpi/attr/comm_create_keyval.c
+++ b/src/mpi/attr/comm_create_keyval.c
@@ -130,7 +130,7 @@ int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_CREATE_KEYVAL);
 
     /* Validate parameters and objects (post conversion) */
@@ -153,7 +153,7 @@ int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_CREATE_KEYVAL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/comm_delete_attr.c b/src/mpi/attr/comm_delete_attr.c
index 4a2a2f3..27232e9 100644
--- a/src/mpi/attr/comm_delete_attr.c
+++ b/src/mpi/attr/comm_delete_attr.c
@@ -114,7 +114,7 @@ int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_DELETE_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -159,7 +159,7 @@ int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_DELETE_ATTR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/comm_free_keyval.c b/src/mpi/attr/comm_free_keyval.c
index 69e5973..1701603 100644
--- a/src/mpi/attr/comm_free_keyval.c
+++ b/src/mpi/attr/comm_free_keyval.c
@@ -78,7 +78,7 @@ int MPI_Comm_free_keyval(int *comm_keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_FREE_KEYVAL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -122,7 +122,7 @@ int MPI_Comm_free_keyval(int *comm_keyval)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_FREE_KEYVAL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/attr/comm_get_attr.c b/src/mpi/attr/comm_get_attr.c
index a3f22a2..2ea495d 100644
--- a/src/mpi/attr/comm_get_attr.c
+++ b/src/mpi/attr/comm_get_attr.c
@@ -300,9 +300,9 @@ int MPIR_CommGetAttr_fort(MPI_Comm comm, int comm_keyval, void *attribute_val,
 {
     int mpi_errno;
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     mpi_errno = MPIR_CommGetAttr(comm, comm_keyval, attribute_val, flag, outAttrType);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return mpi_errno;
 }
@@ -355,7 +355,7 @@ int MPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_GET_ATTR);
 
     /* Instead, ask for a desired type. */
@@ -366,7 +366,7 @@ int MPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_GET_ATTR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/comm_set_attr.c b/src/mpi/attr/comm_set_attr.c
index 558a883..0a46a08 100644
--- a/src/mpi/attr/comm_set_attr.c
+++ b/src/mpi/attr/comm_set_attr.c
@@ -115,7 +115,7 @@ int MPIR_CommSetAttr( MPI_Comm comm, int comm_keyval, void *attribute_val,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_COMM_SET_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -161,7 +161,7 @@ int MPIR_CommSetAttr( MPI_Comm comm, int comm_keyval, void *attribute_val,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_COMM_SET_ATTR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
@@ -222,7 +222,7 @@ int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val)
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_COMM_SET_ATTR);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SET_ATTR);
 
      /* Validate parameters, especially handles needing to be converted */
@@ -267,7 +267,7 @@ int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val)
 
  fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SET_ATTR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/keyval_create.c b/src/mpi/attr/keyval_create.c
index 8014942..bb99160 100644
--- a/src/mpi/attr/keyval_create.c
+++ b/src/mpi/attr/keyval_create.c
@@ -76,7 +76,7 @@ int MPI_Keyval_create(MPI_Copy_function *copy_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_KEYVAL_CREATE);
 
     /* Validate parameters and objects (post conversion) */
@@ -99,7 +99,7 @@ int MPI_Keyval_create(MPI_Copy_function *copy_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_KEYVAL_CREATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/keyval_free.c b/src/mpi/attr/keyval_free.c
index 560627c..af36597 100644
--- a/src/mpi/attr/keyval_free.c
+++ b/src/mpi/attr/keyval_free.c
@@ -63,7 +63,7 @@ int MPI_Keyval_free(int *keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_KEYVAL_FREE);
 #   ifdef HAVE_ERROR_CHECKING
     {
@@ -101,7 +101,7 @@ int MPI_Keyval_free(int *keyval)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_KEYVAL_FREE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/type_create_keyval.c b/src/mpi/attr/type_create_keyval.c
index 76df18b..b680e77 100644
--- a/src/mpi/attr/type_create_keyval.c
+++ b/src/mpi/attr/type_create_keyval.c
@@ -81,7 +81,7 @@ int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_KEYVAL);
     
     /* Validate parameters and objects (post conversion) */
@@ -128,7 +128,7 @@ int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_KEYVAL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/type_delete_attr.c b/src/mpi/attr/type_delete_attr.c
index 639a586..cfd26b6 100644
--- a/src/mpi/attr/type_delete_attr.c
+++ b/src/mpi/attr/type_delete_attr.c
@@ -61,7 +61,7 @@ int MPI_Type_delete_attr(MPI_Datatype datatype, int type_keyval)
     
     /* The thread lock prevents a valid attr delete on the same datatype
        but in a different thread from causing problems */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_DELETE_ATTR);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -145,7 +145,7 @@ int MPI_Type_delete_attr(MPI_Datatype datatype, int type_keyval)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_DELETE_ATTR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/type_free_keyval.c b/src/mpi/attr/type_free_keyval.c
index e29ae1b..a7b070a 100644
--- a/src/mpi/attr/type_free_keyval.c
+++ b/src/mpi/attr/type_free_keyval.c
@@ -58,7 +58,7 @@ int MPI_Type_free_keyval(int *type_keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_FREE_KEYVAL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -106,7 +106,7 @@ int MPI_Type_free_keyval(int *type_keyval)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_FREE_KEYVAL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/attr/type_get_attr.c b/src/mpi/attr/type_get_attr.c
index e3958ab..851226e 100644
--- a/src/mpi/attr/type_get_attr.c
+++ b/src/mpi/attr/type_get_attr.c
@@ -42,7 +42,7 @@ int MPIR_TypeGetAttr( MPI_Datatype datatype, int type_keyval, void *attribute_va
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_TYPE_GET_ATTR);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -130,7 +130,7 @@ int MPIR_TypeGetAttr( MPI_Datatype datatype, int type_keyval, void *attribute_va
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_TYPE_GET_ATTR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/attr/type_set_attr.c b/src/mpi/attr/type_set_attr.c
index dfd118f..1027311 100644
--- a/src/mpi/attr/type_set_attr.c
+++ b/src/mpi/attr/type_set_attr.c
@@ -42,7 +42,7 @@ int MPIR_TypeSetAttr(MPI_Datatype datatype, int type_keyval, void *attribute_val
     
     /* The thread lock prevents a valid attr delete on the same datatype
        but in a different thread from causing problems */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_TYPE_SET_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -141,7 +141,7 @@ int MPIR_TypeSetAttr(MPI_Datatype datatype, int type_keyval, void *attribute_val
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_TYPE_SET_ATTR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/win_create_keyval.c b/src/mpi/attr/win_create_keyval.c
index a533189..02f4868 100644
--- a/src/mpi/attr/win_create_keyval.c
+++ b/src/mpi/attr/win_create_keyval.c
@@ -81,7 +81,7 @@ int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_CREATE_KEYVAL);
 
     /* Validate parameters and objects (post conversion) */
@@ -124,7 +124,7 @@ int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_CREATE_KEYVAL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/win_delete_attr.c b/src/mpi/attr/win_delete_attr.c
index 710da70..b035f94 100644
--- a/src/mpi/attr/win_delete_attr.c
+++ b/src/mpi/attr/win_delete_attr.c
@@ -62,7 +62,7 @@ int MPI_Win_delete_attr(MPI_Win win, int win_keyval)
     
     /* The thread lock prevents a valid attr delete on the same window
        but in a different thread from causing problems */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_DELETE_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -144,7 +144,7 @@ int MPI_Win_delete_attr(MPI_Win win, int win_keyval)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_DELETE_ATTR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/win_free_keyval.c b/src/mpi/attr/win_free_keyval.c
index 4d76a1a..573cf7d 100644
--- a/src/mpi/attr/win_free_keyval.c
+++ b/src/mpi/attr/win_free_keyval.c
@@ -59,7 +59,7 @@ int MPI_Win_free_keyval(int *win_keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_FREE_KEYVAL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -107,7 +107,7 @@ int MPI_Win_free_keyval(int *win_keyval)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_FREE_KEYVAL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/attr/win_get_attr.c b/src/mpi/attr/win_get_attr.c
index ea88525..d40ee7f 100644
--- a/src/mpi/attr/win_get_attr.c
+++ b/src/mpi/attr/win_get_attr.c
@@ -38,7 +38,7 @@ int MPIR_WinGetAttr( MPI_Win win, int win_keyval, void *attribute_val,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_WIN_GET_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -198,7 +198,7 @@ int MPIR_WinGetAttr( MPI_Win win, int win_keyval, void *attribute_val,
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_WIN_GET_ATTR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/attr/win_set_attr.c b/src/mpi/attr/win_set_attr.c
index 2d66409..f36c9c1 100644
--- a/src/mpi/attr/win_set_attr.c
+++ b/src/mpi/attr/win_set_attr.c
@@ -42,7 +42,7 @@ int MPIR_WinSetAttr( MPI_Win win, int win_keyval, void *attribute_val,
     
     /* The thread lock prevents a valid attr delete on the same window
        but in a different thread from causing problems */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_WIN_SET_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -147,7 +147,7 @@ int MPIR_WinSetAttr( MPI_Win win, int win_keyval, void *attribute_val,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_WIN_SET_ATTR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex); 
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX); 
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/allgather.c b/src/mpi/coll/allgather.c
index a61a089..9d138fc 100644
--- a/src/mpi/coll/allgather.c
+++ b/src/mpi/coll/allgather.c
@@ -907,7 +907,7 @@ int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLGATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -989,7 +989,7 @@ int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLGATHER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/allgatherv.c b/src/mpi/coll/allgatherv.c
index bc976b8..0bbf12d 100644
--- a/src/mpi/coll/allgatherv.c
+++ b/src/mpi/coll/allgatherv.c
@@ -1018,7 +1018,7 @@ int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLGATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1111,7 +1111,7 @@ int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLGATHERV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/allreduce.c b/src/mpi/coll/allreduce.c
index c6cdf94..e6b11bf 100644
--- a/src/mpi/coll/allreduce.c
+++ b/src/mpi/coll/allreduce.c
@@ -821,7 +821,7 @@ int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLREDUCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -896,7 +896,7 @@ int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLREDUCE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/alltoall.c b/src/mpi/coll/alltoall.c
index ea52a6d..4cda343 100644
--- a/src/mpi/coll/alltoall.c
+++ b/src/mpi/coll/alltoall.c
@@ -650,7 +650,7 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLTOALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -726,7 +726,7 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLTOALL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/alltoallv.c b/src/mpi/coll/alltoallv.c
index 8f5945c..23b6a57 100644
--- a/src/mpi/coll/alltoallv.c
+++ b/src/mpi/coll/alltoallv.c
@@ -441,7 +441,7 @@ int MPI_Alltoallv(const void *sendbuf, const int *sendcounts,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLTOALLV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -533,7 +533,7 @@ int MPI_Alltoallv(const void *sendbuf, const int *sendcounts,
 
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLTOALLV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/alltoallw.c b/src/mpi/coll/alltoallw.c
index 0335f85..89e426e 100644
--- a/src/mpi/coll/alltoallw.c
+++ b/src/mpi/coll/alltoallw.c
@@ -436,7 +436,7 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLTOALLW);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -539,7 +539,7 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[],
 
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLTOALLW);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/barrier.c b/src/mpi/coll/barrier.c
index a76d881..2a0bbce 100644
--- a/src/mpi/coll/barrier.c
+++ b/src/mpi/coll/barrier.c
@@ -375,7 +375,7 @@ int MPI_Barrier( MPI_Comm comm )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_BARRIER);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -414,7 +414,7 @@ int MPI_Barrier( MPI_Comm comm )
 
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_BARRIER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/bcast.c b/src/mpi/coll/bcast.c
index 1bbbcb4..da6bb05 100644
--- a/src/mpi/coll/bcast.c
+++ b/src/mpi/coll/bcast.c
@@ -1530,7 +1530,7 @@ int MPI_Bcast( void *buffer, int count, MPI_Datatype datatype, int root,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_BCAST);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1589,7 +1589,7 @@ int MPI_Bcast( void *buffer, int count, MPI_Datatype datatype, int root,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_BCAST);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/exscan.c b/src/mpi/coll/exscan.c
index cf9ad79..f387b21 100644
--- a/src/mpi/coll/exscan.c
+++ b/src/mpi/coll/exscan.c
@@ -310,7 +310,7 @@ int MPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_EXSCAN);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -389,7 +389,7 @@ int MPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
     
   fn_exit:    
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_EXSCAN);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/gather.c b/src/mpi/coll/gather.c
index 47f7315..5d87714 100644
--- a/src/mpi/coll/gather.c
+++ b/src/mpi/coll/gather.c
@@ -779,7 +779,7 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_GATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -893,7 +893,7 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_GATHER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/gatherv.c b/src/mpi/coll/gatherv.c
index 51c3756..a2da9a1 100644
--- a/src/mpi/coll/gatherv.c
+++ b/src/mpi/coll/gatherv.c
@@ -292,7 +292,7 @@ int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_GATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -424,7 +424,7 @@ int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_GATHERV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/iallgather.c b/src/mpi/coll/iallgather.c
index 58da4a8..7a4257c 100644
--- a/src/mpi/coll/iallgather.c
+++ b/src/mpi/coll/iallgather.c
@@ -667,7 +667,7 @@ int MPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLGATHER);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLGATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -739,7 +739,7 @@ int MPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLGATHER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iallgatherv.c b/src/mpi/coll/iallgatherv.c
index 2ba36c6..896dba4 100644
--- a/src/mpi/coll/iallgatherv.c
+++ b/src/mpi/coll/iallgatherv.c
@@ -771,7 +771,7 @@ int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, v
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLGATHERV);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLGATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -851,7 +851,7 @@ int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, v
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLGATHERV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iallreduce.c b/src/mpi/coll/iallreduce.c
index d4c4d01..b91f148 100644
--- a/src/mpi/coll/iallreduce.c
+++ b/src/mpi/coll/iallreduce.c
@@ -723,7 +723,7 @@ int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLREDUCE);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLREDUCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -796,7 +796,7 @@ int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count,
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLREDUCE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ialltoall.c b/src/mpi/coll/ialltoall.c
index d319cde..0cbfa11 100644
--- a/src/mpi/coll/ialltoall.c
+++ b/src/mpi/coll/ialltoall.c
@@ -596,7 +596,7 @@ int MPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLTOALL);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLTOALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -670,7 +670,7 @@ int MPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLTOALL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ialltoallv.c b/src/mpi/coll/ialltoallv.c
index a811cda..3a26f0f 100644
--- a/src/mpi/coll/ialltoallv.c
+++ b/src/mpi/coll/ialltoallv.c
@@ -329,7 +329,7 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLTOALLV);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLTOALLV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -405,7 +405,7 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLTOALLV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ialltoallw.c b/src/mpi/coll/ialltoallw.c
index b42992a..398a440 100644
--- a/src/mpi/coll/ialltoallw.c
+++ b/src/mpi/coll/ialltoallw.c
@@ -334,7 +334,7 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLTOALLW);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLTOALLW);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -393,7 +393,7 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLTOALLW);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ibarrier.c b/src/mpi/coll/ibarrier.c
index 2176658..9319416 100644
--- a/src/mpi/coll/ibarrier.c
+++ b/src/mpi/coll/ibarrier.c
@@ -250,7 +250,7 @@ int MPI_Ibarrier(MPI_Comm comm, MPI_Request *request)
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IBARRIER);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IBARRIER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -292,7 +292,7 @@ int MPI_Ibarrier(MPI_Comm comm, MPI_Request *request)
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IBARRIER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ibcast.c b/src/mpi/coll/ibcast.c
index ae985d3..529aa1b 100644
--- a/src/mpi/coll/ibcast.c
+++ b/src/mpi/coll/ibcast.c
@@ -932,7 +932,7 @@ int MPI_Ibcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Com
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IBCAST);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IBCAST);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -986,7 +986,7 @@ int MPI_Ibcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Com
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IBCAST);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iexscan.c b/src/mpi/coll/iexscan.c
index aca8fed..4d489c0 100644
--- a/src/mpi/coll/iexscan.c
+++ b/src/mpi/coll/iexscan.c
@@ -261,7 +261,7 @@ int MPI_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IEXSCAN);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IEXSCAN);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -327,7 +327,7 @@ int MPI_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IEXSCAN);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/igather.c b/src/mpi/coll/igather.c
index 9907801..eb8c63f 100644
--- a/src/mpi/coll/igather.c
+++ b/src/mpi/coll/igather.c
@@ -593,7 +593,7 @@ int MPI_Igather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IGATHER);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IGATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -715,7 +715,7 @@ int MPI_Igather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IGATHER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/igatherv.c b/src/mpi/coll/igatherv.c
index b636e25..fa4f367 100644
--- a/src/mpi/coll/igatherv.c
+++ b/src/mpi/coll/igatherv.c
@@ -193,7 +193,7 @@ int MPI_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IGATHERV);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IGATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -325,7 +325,7 @@ int MPI_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IGATHERV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ired_scat.c b/src/mpi/coll/ired_scat.c
index 916d325..70617e5 100644
--- a/src/mpi/coll/ired_scat.c
+++ b/src/mpi/coll/ired_scat.c
@@ -1089,7 +1089,7 @@ int MPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IREDUCE_SCATTER);
     i = 0;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IREDUCE_SCATTER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1159,7 +1159,7 @@ int MPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IREDUCE_SCATTER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ired_scat_block.c b/src/mpi/coll/ired_scat_block.c
index 8df4092..067d397 100644
--- a/src/mpi/coll/ired_scat_block.c
+++ b/src/mpi/coll/ired_scat_block.c
@@ -992,7 +992,7 @@ int MPI_Ireduce_scatter_block(const void *sendbuf, void *recvbuf,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IREDUCE_SCATTER_BLOCK);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IREDUCE_SCATTER_BLOCK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1057,7 +1057,7 @@ int MPI_Ireduce_scatter_block(const void *sendbuf, void *recvbuf,
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IREDUCE_SCATTER_BLOCK);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ireduce.c b/src/mpi/coll/ireduce.c
index 0c529b7..e208727 100644
--- a/src/mpi/coll/ireduce.c
+++ b/src/mpi/coll/ireduce.c
@@ -840,7 +840,7 @@ int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IREDUCE);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IREDUCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -922,7 +922,7 @@ int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IREDUCE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iscan.c b/src/mpi/coll/iscan.c
index 2374918..4acd698 100644
--- a/src/mpi/coll/iscan.c
+++ b/src/mpi/coll/iscan.c
@@ -395,7 +395,7 @@ int MPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_ISCAN);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ISCAN);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -464,7 +464,7 @@ int MPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ISCAN);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iscatter.c b/src/mpi/coll/iscatter.c
index ef23f87..d118e62 100644
--- a/src/mpi/coll/iscatter.c
+++ b/src/mpi/coll/iscatter.c
@@ -627,7 +627,7 @@ int MPI_Iscatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_ISCATTER);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ISCATTER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -737,7 +737,7 @@ int MPI_Iscatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ISCATTER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iscatterv.c b/src/mpi/coll/iscatterv.c
index a46ead2..aa3c3b8 100644
--- a/src/mpi/coll/iscatterv.c
+++ b/src/mpi/coll/iscatterv.c
@@ -199,7 +199,7 @@ int MPI_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs[
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_ISCATTERV);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ISCATTERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -339,7 +339,7 @@ int MPI_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs[
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ISCATTERV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/op_commutative.c b/src/mpi/coll/op_commutative.c
index 6367619..f6542de 100644
--- a/src/mpi/coll/op_commutative.c
+++ b/src/mpi/coll/op_commutative.c
@@ -60,7 +60,7 @@ int MPI_Op_commutative(MPI_Op op, int *commute)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_OP_COMMUTATIVE);
 
     MPID_Op_get_ptr( op, op_ptr );
@@ -92,7 +92,7 @@ int MPI_Op_commutative(MPI_Op op, int *commute)
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_OP_COMMUTATIVE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/coll/op_create.c b/src/mpi/coll/op_create.c
index cfb88e1..adcbaee 100644
--- a/src/mpi/coll/op_create.c
+++ b/src/mpi/coll/op_create.c
@@ -108,7 +108,7 @@ int MPI_Op_create(MPI_User_function *user_fn, int commute, MPI_Op *op)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_OP_CREATE);
 
     /* ... body of routine ...  */
@@ -134,7 +134,7 @@ int MPI_Op_create(MPI_User_function *user_fn, int commute, MPI_Op *op)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_OP_CREATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/coll/op_free.c b/src/mpi/coll/op_free.c
index 9a28f5e..9dff0e8 100644
--- a/src/mpi/coll/op_free.c
+++ b/src/mpi/coll/op_free.c
@@ -64,7 +64,7 @@ int MPI_Op_free(MPI_Op *op)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_OP_FREE);
     
     MPID_Op_get_ptr( *op, op_ptr );
@@ -100,7 +100,7 @@ int MPI_Op_free(MPI_Op *op)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_OP_FREE);
-        MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 	return mpi_errno;
 	
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/coll/red_scat.c b/src/mpi/coll/red_scat.c
index 7d494fb..9406325 100644
--- a/src/mpi/coll/red_scat.c
+++ b/src/mpi/coll/red_scat.c
@@ -1125,7 +1125,7 @@ int MPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_REDUCE_SCATTER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1206,7 +1206,7 @@ int MPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_REDUCE_SCATTER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/red_scat_block.c b/src/mpi/coll/red_scat_block.c
index 486a392..f342e98 100644
--- a/src/mpi/coll/red_scat_block.c
+++ b/src/mpi/coll/red_scat_block.c
@@ -1097,7 +1097,7 @@ int MPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_REDUCE_SCATTER_BLOCK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1172,7 +1172,7 @@ int MPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_REDUCE_SCATTER_BLOCK);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/reduce.c b/src/mpi/coll/reduce.c
index 7817e00..f68e317 100644
--- a/src/mpi/coll/reduce.c
+++ b/src/mpi/coll/reduce.c
@@ -1132,7 +1132,7 @@ int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_REDUCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1247,7 +1247,7 @@ int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_REDUCE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/reduce_local.c b/src/mpi/coll/reduce_local.c
index df008ce..f232dd7 100644
--- a/src/mpi/coll/reduce_local.c
+++ b/src/mpi/coll/reduce_local.c
@@ -151,7 +151,7 @@ int MPI_Reduce_local(const void *inbuf, void *inoutbuf, int count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_REDUCE_LOCAL);
 
     /* Validate parameters */
@@ -190,7 +190,7 @@ int MPI_Reduce_local(const void *inbuf, void *inoutbuf, int count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_REDUCE_LOCAL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/scan.c b/src/mpi/coll/scan.c
index ee8ba5f..2e50c75 100644
--- a/src/mpi/coll/scan.c
+++ b/src/mpi/coll/scan.c
@@ -494,7 +494,7 @@ int MPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_SCAN);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -566,7 +566,7 @@ int MPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_SCAN);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/scatter.c b/src/mpi/coll/scatter.c
index 4a852b4..992dfa2 100644
--- a/src/mpi/coll/scatter.c
+++ b/src/mpi/coll/scatter.c
@@ -678,7 +678,7 @@ int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_SCATTER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -793,7 +793,7 @@ int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_SCATTER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/scatterv.c b/src/mpi/coll/scatterv.c
index 3be0977..4adc33c 100644
--- a/src/mpi/coll/scatterv.c
+++ b/src/mpi/coll/scatterv.c
@@ -239,7 +239,7 @@ int MPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_SCATTERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -375,7 +375,7 @@ int MPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_SCATTERV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_agree.c b/src/mpi/comm/comm_agree.c
index e3faf53..61eeeb8 100644
--- a/src/mpi/comm/comm_agree.c
+++ b/src/mpi/comm/comm_agree.c
@@ -136,7 +136,7 @@ int MPIX_Comm_agree(MPI_Comm comm, int *flag)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_AGREE);
 
     /* Validate parameters, and convert MPI object handles to object pointers */
@@ -172,7 +172,7 @@ int MPIX_Comm_agree(MPI_Comm comm, int *flag)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_AGREE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_compare.c b/src/mpi/comm/comm_compare.c
index 2990d31..11bf2fb 100644
--- a/src/mpi/comm/comm_compare.c
+++ b/src/mpi/comm/comm_compare.c
@@ -77,7 +77,7 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_COMPARE);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -180,7 +180,7 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_COMPARE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/comm/comm_create.c b/src/mpi/comm/comm_create.c
index 92f0c3e..a5c31ac 100644
--- a/src/mpi/comm/comm_create.c
+++ b/src/mpi/comm/comm_create.c
@@ -491,7 +491,7 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_CREATE);
 
     /* Validate parameters, and convert MPI object handles to object pointers */
@@ -553,7 +553,7 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_CREATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_create_group.c b/src/mpi/comm/comm_create_group.c
index 262b435..a2923ff 100644
--- a/src/mpi/comm/comm_create_group.c
+++ b/src/mpi/comm/comm_create_group.c
@@ -158,7 +158,7 @@ int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm * ne
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_CREATE_GROUP);
 
     /* Validate parameters, and convert MPI object handles to object pointers */
@@ -216,7 +216,7 @@ int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm * ne
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_CREATE_GROUP);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_dup.c b/src/mpi/comm/comm_dup.c
index 34dd170..3d5285f 100644
--- a/src/mpi/comm/comm_dup.c
+++ b/src/mpi/comm/comm_dup.c
@@ -124,7 +124,7 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_DUP);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -166,7 +166,7 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_DUP);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/comm/comm_dup_with_info.c b/src/mpi/comm/comm_dup_with_info.c
index 5e20710..acd1ac1 100644
--- a/src/mpi/comm/comm_dup_with_info.c
+++ b/src/mpi/comm/comm_dup_with_info.c
@@ -94,7 +94,7 @@ int MPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_DUP_WITH_INFO);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -137,7 +137,7 @@ int MPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_DUP_WITH_INFO);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_failure_ack.c b/src/mpi/comm/comm_failure_ack.c
index 8ec8718..3f03313 100644
--- a/src/mpi/comm/comm_failure_ack.c
+++ b/src/mpi/comm/comm_failure_ack.c
@@ -58,7 +58,7 @@ int MPIX_Comm_failure_ack( MPI_Comm comm )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_FAILURE_ACK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -98,7 +98,7 @@ int MPIX_Comm_failure_ack( MPI_Comm comm )
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_FAILURE_ACK);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/comm/comm_failure_get_acked.c b/src/mpi/comm/comm_failure_get_acked.c
index 82df0ca..74a6bb8 100644
--- a/src/mpi/comm/comm_failure_get_acked.c
+++ b/src/mpi/comm/comm_failure_get_acked.c
@@ -62,7 +62,7 @@ int MPIX_Comm_failure_get_acked( MPI_Comm comm, MPI_Group *failedgrp )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_FAILURE_GET_ACKED);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -102,7 +102,7 @@ int MPIX_Comm_failure_get_acked( MPI_Comm comm, MPI_Group *failedgrp )
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_FAILURE_GET_ACKED);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/comm/comm_free.c b/src/mpi/comm/comm_free.c
index 9f1ab29..3c2f8bb 100644
--- a/src/mpi/comm/comm_free.c
+++ b/src/mpi/comm/comm_free.c
@@ -82,7 +82,7 @@ int MPI_Comm_free(MPI_Comm *comm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_FREE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -132,7 +132,7 @@ int MPI_Comm_free(MPI_Comm *comm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_FREE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_get_info.c b/src/mpi/comm/comm_get_info.c
index c463606..4408112 100644
--- a/src/mpi/comm/comm_get_info.c
+++ b/src/mpi/comm/comm_get_info.c
@@ -84,7 +84,7 @@ int MPI_Comm_get_info(MPI_Comm comm, MPI_Info * info_used)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_GET_INFO);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -126,7 +126,7 @@ int MPI_Comm_get_info(MPI_Comm comm, MPI_Info * info_used)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_GET_INFO);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_group.c b/src/mpi/comm/comm_group.c
index 34bd903..16b0748 100644
--- a/src/mpi/comm/comm_group.c
+++ b/src/mpi/comm/comm_group.c
@@ -115,7 +115,7 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_GROUP);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -156,7 +156,7 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_GROUP);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_idup.c b/src/mpi/comm/comm_idup.c
index 6014962..c59893c 100644
--- a/src/mpi/comm/comm_idup.c
+++ b/src/mpi/comm/comm_idup.c
@@ -100,7 +100,7 @@ int MPI_Comm_idup(MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request)
     MPID_Request *dreq = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_COMM_IDUP);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_IDUP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -150,7 +150,7 @@ int MPI_Comm_idup(MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request)
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_IDUP);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/comm/comm_rank.c b/src/mpi/comm/comm_rank.c
index aaf0e83..9960e87 100644
--- a/src/mpi/comm/comm_rank.c
+++ b/src/mpi/comm/comm_rank.c
@@ -57,7 +57,7 @@ int MPI_Comm_rank( MPI_Comm comm, int *rank )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_RANK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -99,7 +99,7 @@ int MPI_Comm_rank( MPI_Comm comm, int *rank )
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_RANK);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/comm/comm_remote_group.c b/src/mpi/comm/comm_remote_group.c
index 3ff3a99..a655662 100644
--- a/src/mpi/comm/comm_remote_group.c
+++ b/src/mpi/comm/comm_remote_group.c
@@ -105,7 +105,7 @@ int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_REMOTE_GROUP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -152,7 +152,7 @@ int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_REMOTE_GROUP);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_revoke.c b/src/mpi/comm/comm_revoke.c
index 0a2e629..d29414d 100644
--- a/src/mpi/comm/comm_revoke.c
+++ b/src/mpi/comm/comm_revoke.c
@@ -58,7 +58,7 @@ int MPIX_Comm_revoke(MPI_Comm comm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_REVOKE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -97,7 +97,7 @@ int MPIX_Comm_revoke(MPI_Comm comm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_REVOKE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
   fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/comm/comm_set_info.c b/src/mpi/comm/comm_set_info.c
index ff5c506..fed8349 100644
--- a/src/mpi/comm/comm_set_info.c
+++ b/src/mpi/comm/comm_set_info.c
@@ -104,7 +104,7 @@ int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SET_INFO);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -143,7 +143,7 @@ int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SET_INFO);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_shrink.c b/src/mpi/comm/comm_shrink.c
index dbbe3e4..21f11aa 100644
--- a/src/mpi/comm/comm_shrink.c
+++ b/src/mpi/comm/comm_shrink.c
@@ -140,7 +140,7 @@ int MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_SHRINK);
 
     /* Validate parameters, and convert MPI object handles to object pointers */
@@ -180,7 +180,7 @@ int MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_SHRINK);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_split.c b/src/mpi/comm/comm_split.c
index c606eeb..20f8294 100644
--- a/src/mpi/comm/comm_split.c
+++ b/src/mpi/comm/comm_split.c
@@ -441,7 +441,7 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SPLIT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -486,7 +486,7 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SPLIT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/comm/comm_split_type.c b/src/mpi/comm/comm_split_type.c
index f358792..3d6f2a5 100644
--- a/src/mpi/comm/comm_split_type.c
+++ b/src/mpi/comm/comm_split_type.c
@@ -102,7 +102,7 @@ int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SPLIT_TYPE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -150,7 +150,7 @@ int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SPLIT_TYPE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/contextid.c b/src/mpi/comm/contextid.c
index a60e184..87d10fd 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_ThreadInfo.ctx_mutex);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_CTX_MUTEX);
 
         if (initialize_context_mask) {
             context_id_init();
@@ -424,7 +424,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_ThreadInfo.ctx_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_CTX_MUTEX);
 
         /* Note: MPIR_MAX_CONTEXT_MASK elements of local_mask are used by the
          * context ID allocation algorithm.  The additional element is ignored
@@ -457,7 +457,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_ThreadInfo.ctx_mutex);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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 */
@@ -481,8 +481,8 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
                 /* FIXME: Do we need to do an GLOBAL yield here?
                  * When we do a collective operation, we anyway yield
                  * for other others */
-                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
-                MPID_THREAD_CS_YIELD(POBJ, MPIR_ThreadInfo.ctx_mutex);
+                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
+                MPID_THREAD_CS_YIELD(POBJ, MPIR_THREAD_CTX_MUTEX);
             }
         }
         else if (own_mask) {
@@ -511,8 +511,8 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
                 /* FIXME: Do we need to do an GLOBAL yield here?
                  * When we do a collective operation, we anyway yield
                  * for other others */
-                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
-                MPID_THREAD_CS_YIELD(POBJ, MPIR_ThreadInfo.ctx_mutex);
+                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
+                MPID_THREAD_CS_YIELD(POBJ, MPIR_THREAD_CTX_MUTEX);
             }
         }
         else {
@@ -520,10 +520,10 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
             /* FIXME: Do we need to do an GLOBAL yield here?  When we
              * do a collective operation, we anyway yield for other
              * others */
-            MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
-            MPID_THREAD_CS_YIELD(POBJ, MPIR_ThreadInfo.ctx_mutex);
+            MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
+            MPID_THREAD_CS_YIELD(POBJ, MPIR_THREAD_CTX_MUTEX);
         }
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.ctx_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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
@@ -537,13 +537,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_ThreadInfo.ctx_mutex);
+                MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.ctx_mutex);
+                MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_CTX_MUTEX);
             }
 
             context_mask_stats(&nfree, &ntotal);
@@ -1159,12 +1159,12 @@ void MPIR_Free_contextid(MPIU_Context_id_t context_id)
     }
     /* --END ERROR HANDLING-- */
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.ctx_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.ctx_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_CTX_MUTEX);
 
     MPIU_DBG_MSG_FMT(COMM, VERBOSE,
                      (MPIU_DBG_FDEST,
diff --git a/src/mpi/comm/intercomm_create.c b/src/mpi/comm/intercomm_create.c
index f5103fa..362d421 100644
--- a/src/mpi/comm/intercomm_create.c
+++ b/src/mpi/comm/intercomm_create.c
@@ -427,7 +427,7 @@ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INTERCOMM_CREATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -525,7 +525,7 @@ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader,
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INTERCOMM_CREATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/comm/intercomm_merge.c b/src/mpi/comm/intercomm_merge.c
index 13aaca9..55efe38 100644
--- a/src/mpi/comm/intercomm_merge.c
+++ b/src/mpi/comm/intercomm_merge.c
@@ -260,7 +260,7 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);  
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);  
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INTERCOMM_MERGE);
 
     MPIU_THREADPRIV_GET;
@@ -343,7 +343,7 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INTERCOMM_MERGE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/get_elements_x.c b/src/mpi/datatype/get_elements_x.c
index 5ec9a8a..c779da6 100644
--- a/src/mpi/datatype/get_elements_x.c
+++ b/src/mpi/datatype/get_elements_x.c
@@ -386,7 +386,7 @@ int MPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Coun
     int mpi_errno = MPI_SUCCESS;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_GET_ELEMENTS_X);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GET_ELEMENTS_X);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -433,7 +433,7 @@ int MPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Coun
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GET_ELEMENTS_X);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/datatype/register_datarep.c b/src/mpi/datatype/register_datarep.c
index 43b321a..c5124a1 100644
--- a/src/mpi/datatype/register_datarep.c
+++ b/src/mpi/datatype/register_datarep.c
@@ -60,7 +60,7 @@ int MPI_Register_datarep(char *datarep,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_REGISTER_DATAREP);
     
     /* Validate parameters and objects (post conversion) */
@@ -85,7 +85,7 @@ int MPI_Register_datarep(char *datarep,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_REGISTER_DATAREP);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/status_set_elements_x.c b/src/mpi/datatype/status_set_elements_x.c
index 4e7c78f..dc81bdd 100644
--- a/src/mpi/datatype/status_set_elements_x.c
+++ b/src/mpi/datatype/status_set_elements_x.c
@@ -78,7 +78,7 @@ int MPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Cou
     int mpi_errno = MPI_SUCCESS;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_STATUS_SET_ELEMENTS_X);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_STATUS_SET_ELEMENTS_X);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -125,7 +125,7 @@ int MPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Cou
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_STATUS_SET_ELEMENTS_X);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/datatype/type_commit.c b/src/mpi/datatype/type_commit.c
index 895d669..10b4c5a 100644
--- a/src/mpi/datatype/type_commit.c
+++ b/src/mpi/datatype/type_commit.c
@@ -78,7 +78,7 @@ int MPI_Type_commit(MPI_Datatype *datatype)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_COMMIT);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -120,7 +120,7 @@ int MPI_Type_commit(MPI_Datatype *datatype)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_COMMIT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_contiguous.c b/src/mpi/datatype/type_contiguous.c
index aa974f9..81fc72b 100644
--- a/src/mpi/datatype/type_contiguous.c
+++ b/src/mpi/datatype/type_contiguous.c
@@ -146,7 +146,7 @@ int MPI_Type_contiguous(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CONTIGUOUS);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -177,7 +177,7 @@ int MPI_Type_contiguous(int count,
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CONTIGUOUS);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_darray.c b/src/mpi/datatype/type_create_darray.c
index 005b6ec..87b1ef4 100644
--- a/src/mpi/datatype/type_create_darray.c
+++ b/src/mpi/datatype/type_create_darray.c
@@ -392,7 +392,7 @@ int MPI_Type_create_darray(int size,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_DARRAY);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -745,7 +745,7 @@ int MPI_Type_create_darray(int size,
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_DARRAY);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_hindexed.c b/src/mpi/datatype/type_create_hindexed.c
index 7a79f7f..c0c9ed1 100644
--- a/src/mpi/datatype/type_create_hindexed.c
+++ b/src/mpi/datatype/type_create_hindexed.c
@@ -71,7 +71,7 @@ int MPI_Type_create_hindexed(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_HINDEXED);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -139,7 +139,7 @@ int MPI_Type_create_hindexed(int count,
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_HINDEXED);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_hindexed_block.c b/src/mpi/datatype/type_create_hindexed_block.c
index 15bf367..ad4ac1e 100644
--- a/src/mpi/datatype/type_create_hindexed_block.c
+++ b/src/mpi/datatype/type_create_hindexed_block.c
@@ -106,7 +106,7 @@ int MPI_Type_create_hindexed_block(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_HINDEXED_BLOCK);
 
     /* Validate parameters and objects */
@@ -147,7 +147,7 @@ int MPI_Type_create_hindexed_block(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_HINDEXED_BLOCK);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_hvector.c b/src/mpi/datatype/type_create_hvector.c
index 830e9e7..21f33e2 100644
--- a/src/mpi/datatype/type_create_hvector.c
+++ b/src/mpi/datatype/type_create_hvector.c
@@ -68,7 +68,7 @@ int MPI_Type_create_hvector(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_HVECTOR);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -121,7 +121,7 @@ int MPI_Type_create_hvector(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_HVECTOR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_indexed_block.c b/src/mpi/datatype/type_create_indexed_block.c
index 97a8d66..6946344 100644
--- a/src/mpi/datatype/type_create_indexed_block.c
+++ b/src/mpi/datatype/type_create_indexed_block.c
@@ -140,7 +140,7 @@ int MPI_Type_create_indexed_block(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_INDEXED_BLOCK);
     
     /* Validate parameters and objects */
@@ -180,7 +180,7 @@ int MPI_Type_create_indexed_block(int count,
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_INDEXED_BLOCK);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_resized.c b/src/mpi/datatype/type_create_resized.c
index 7567dde..e4786f5 100644
--- a/src/mpi/datatype/type_create_resized.c
+++ b/src/mpi/datatype/type_create_resized.c
@@ -65,7 +65,7 @@ int MPI_Type_create_resized(MPI_Datatype oldtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_RESIZED);
 
     /* Get handles to MPI objects. */
@@ -115,7 +115,7 @@ int MPI_Type_create_resized(MPI_Datatype oldtype,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_RESIZED);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_struct.c b/src/mpi/datatype/type_create_struct.c
index 2a979d5..acbcd11 100644
--- a/src/mpi/datatype/type_create_struct.c
+++ b/src/mpi/datatype/type_create_struct.c
@@ -119,7 +119,7 @@ int MPI_Type_create_struct(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_STRUCT);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -162,7 +162,7 @@ int MPI_Type_create_struct(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_STRUCT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_subarray.c b/src/mpi/datatype/type_create_subarray.c
index bcdba9c..c8648e8 100644
--- a/src/mpi/datatype/type_create_subarray.c
+++ b/src/mpi/datatype/type_create_subarray.c
@@ -88,7 +88,7 @@ int MPI_Type_create_subarray(int ndims,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_SUBARRAY);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -333,7 +333,7 @@ int MPI_Type_create_subarray(int ndims,
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_SUBARRAY);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_dup.c b/src/mpi/datatype/type_dup.c
index 3965991..5b53f7b 100644
--- a/src/mpi/datatype/type_dup.c
+++ b/src/mpi/datatype/type_dup.c
@@ -58,7 +58,7 @@ int MPI_Type_dup(MPI_Datatype oldtype, MPI_Datatype *newtype)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_DUP);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -134,7 +134,7 @@ int MPI_Type_dup(MPI_Datatype oldtype, MPI_Datatype *newtype)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_DUP);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_free.c b/src/mpi/datatype/type_free.c
index a6ae104..0f6e086 100644
--- a/src/mpi/datatype/type_free.c
+++ b/src/mpi/datatype/type_free.c
@@ -77,7 +77,7 @@ int MPI_Type_free(MPI_Datatype *datatype)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_FREE);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -146,7 +146,7 @@ int MPI_Type_free(MPI_Datatype *datatype)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_FREE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/datatype/type_get_contents.c b/src/mpi/datatype/type_get_contents.c
index 1222be3..bc4a2c7 100644
--- a/src/mpi/datatype/type_get_contents.c
+++ b/src/mpi/datatype/type_get_contents.c
@@ -67,7 +67,7 @@ int MPI_Type_get_contents(MPI_Datatype datatype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_GET_CONTENTS);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -142,7 +142,7 @@ int MPI_Type_get_contents(MPI_Datatype datatype,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_GET_CONTENTS);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_get_extent_x.c b/src/mpi/datatype/type_get_extent_x.c
index c98fdf7..62381b3 100644
--- a/src/mpi/datatype/type_get_extent_x.c
+++ b/src/mpi/datatype/type_get_extent_x.c
@@ -73,7 +73,7 @@ int MPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *exten
     int mpi_errno = MPI_SUCCESS;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_GET_EXTENT_X);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_GET_EXTENT_X);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *exten
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_GET_EXTENT_X);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/datatype/type_get_name.c b/src/mpi/datatype/type_get_name.c
index 1296916..123329c 100644
--- a/src/mpi/datatype/type_get_name.c
+++ b/src/mpi/datatype/type_get_name.c
@@ -146,7 +146,7 @@ int MPIR_Datatype_init_names(void)
     MPID_Datatype *datatype_ptr = NULL;
     static volatile int needsInit = 1;
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     if (needsInit) {
 	/* Make sure that the basics have datatype structures allocated
 	 * and filled in for them.  They are just integers prior to this
@@ -204,7 +204,7 @@ int MPIR_Datatype_init_names(void)
 
 fn_fail:
     /* empty statement */ ;
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 }
 #endif
diff --git a/src/mpi/datatype/type_get_true_extent_x.c b/src/mpi/datatype/type_get_true_extent_x.c
index 8ccfdf9..6f4453d 100644
--- a/src/mpi/datatype/type_get_true_extent_x.c
+++ b/src/mpi/datatype/type_get_true_extent_x.c
@@ -73,7 +73,7 @@ int MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Co
     int mpi_errno = MPI_SUCCESS;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_GET_TRUE_EXTENT_X);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_GET_TRUE_EXTENT_X);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Co
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_GET_TRUE_EXTENT_X);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/datatype/type_hindexed.c b/src/mpi/datatype/type_hindexed.c
index 35dbd73..1486504 100644
--- a/src/mpi/datatype/type_hindexed.c
+++ b/src/mpi/datatype/type_hindexed.c
@@ -96,7 +96,7 @@ int MPI_Type_hindexed(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_HINDEXED);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -165,7 +165,7 @@ int MPI_Type_hindexed(int count,
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_HINDEXED);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_hvector.c b/src/mpi/datatype/type_hvector.c
index d303264..50a5ed5 100644
--- a/src/mpi/datatype/type_hvector.c
+++ b/src/mpi/datatype/type_hvector.c
@@ -104,7 +104,7 @@ int MPI_Type_hvector(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_HVECTOR);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -138,7 +138,7 @@ int MPI_Type_hvector(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_HVECTOR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_indexed.c b/src/mpi/datatype/type_indexed.c
index 199d6f5..0cbd90e 100644
--- a/src/mpi/datatype/type_indexed.c
+++ b/src/mpi/datatype/type_indexed.c
@@ -145,7 +145,7 @@ int MPI_Type_indexed(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_INDEXED);
 
     /* Validate parameters and objects (post conversion) */
@@ -187,7 +187,7 @@ int MPI_Type_indexed(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_INDEXED);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_match_size.c b/src/mpi/datatype/type_match_size.c
index ca2e377..bc5f71d 100644
--- a/src/mpi/datatype/type_match_size.c
+++ b/src/mpi/datatype/type_match_size.c
@@ -89,7 +89,7 @@ int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *datatype)
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
     /* FIXME: This routine does not require the global critical section */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_MATCH_SIZE);
 
     MPIU_THREADPRIV_GET;
@@ -187,7 +187,7 @@ int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *datatype)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_MATCH_SIZE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_size_x.c b/src/mpi/datatype/type_size_x.c
index 759fe8d..626b44f 100644
--- a/src/mpi/datatype/type_size_x.c
+++ b/src/mpi/datatype/type_size_x.c
@@ -69,7 +69,7 @@ int MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size)
     int mpi_errno = MPI_SUCCESS;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_SIZE_X);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_SIZE_X);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -115,7 +115,7 @@ int MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size)
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_SIZE_X);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/datatype/type_struct.c b/src/mpi/datatype/type_struct.c
index 6a3abcf..c1d8e4f 100644
--- a/src/mpi/datatype/type_struct.c
+++ b/src/mpi/datatype/type_struct.c
@@ -159,7 +159,7 @@ int MPI_Type_struct(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_STRUCT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -202,7 +202,7 @@ int MPI_Type_struct(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_STRUCT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_vector.c b/src/mpi/datatype/type_vector.c
index 13a57b2..4beb5ae 100644
--- a/src/mpi/datatype/type_vector.c
+++ b/src/mpi/datatype/type_vector.c
@@ -107,7 +107,7 @@ int MPI_Type_vector(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_VECTOR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -140,7 +140,7 @@ int MPI_Type_vector(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_VECTOR);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/add_error_class.c b/src/mpi/errhan/add_error_class.c
index c35a7bb..b4382c2 100644
--- a/src/mpi/errhan/add_error_class.c
+++ b/src/mpi/errhan/add_error_class.c
@@ -54,7 +54,7 @@ int MPI_Add_error_class(int *errorclass)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ADD_ERROR_CLASS);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -84,7 +84,7 @@ int MPI_Add_error_class(int *errorclass)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ADD_ERROR_CLASS);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/add_error_code.c b/src/mpi/errhan/add_error_code.c
index 3fc704d..08f114e 100644
--- a/src/mpi/errhan/add_error_code.c
+++ b/src/mpi/errhan/add_error_code.c
@@ -57,7 +57,7 @@ int MPI_Add_error_code(int errorclass, int *errorcode)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ADD_ERROR_CODE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -83,7 +83,7 @@ int MPI_Add_error_code(int errorclass, int *errorcode)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ADD_ERROR_CODE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/add_error_string.c b/src/mpi/errhan/add_error_string.c
index 8c79a9e..d814bad 100644
--- a/src/mpi/errhan/add_error_string.c
+++ b/src/mpi/errhan/add_error_string.c
@@ -66,7 +66,7 @@ int MPI_Add_error_string(int errorcode, const char *string)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ADD_ERROR_STRING);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -89,7 +89,7 @@ int MPI_Add_error_string(int errorcode, const char *string)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ADD_ERROR_STRING);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/comm_create_errhandler.c b/src/mpi/errhan/comm_create_errhandler.c
index d9031c9..e736a55 100644
--- a/src/mpi/errhan/comm_create_errhandler.c
+++ b/src/mpi/errhan/comm_create_errhandler.c
@@ -89,7 +89,7 @@ int MPI_Comm_create_errhandler(MPI_Comm_errhandler_function *comm_errhandler_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_CREATE_ERRHANDLER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -113,7 +113,7 @@ int MPI_Comm_create_errhandler(MPI_Comm_errhandler_function *comm_errhandler_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_CREATE_ERRHANDLER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/comm_get_errhandler.c b/src/mpi/errhan/comm_get_errhandler.c
index c39d3ff..6cdad86 100644
--- a/src/mpi/errhan/comm_get_errhandler.c
+++ b/src/mpi/errhan/comm_get_errhandler.c
@@ -74,7 +74,7 @@ int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_GET_ERRHANDLER);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -119,7 +119,7 @@ int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_GET_ERRHANDLER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/errhan/comm_set_errhandler.c b/src/mpi/errhan/comm_set_errhandler.c
index 524a345..e2f74f2 100644
--- a/src/mpi/errhan/comm_set_errhandler.c
+++ b/src/mpi/errhan/comm_set_errhandler.c
@@ -86,7 +86,7 @@ int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SET_ERRHANDLER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -131,7 +131,7 @@ int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SET_ERRHANDLER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/errhan/errhandler_create.c b/src/mpi/errhan/errhandler_create.c
index fdbb4bb..ce055a7 100644
--- a/src/mpi/errhan/errhandler_create.c
+++ b/src/mpi/errhan/errhandler_create.c
@@ -69,7 +69,7 @@ int MPI_Errhandler_create(MPI_Handler_function *function,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ERRHANDLER_CREATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -92,7 +92,7 @@ int MPI_Errhandler_create(MPI_Handler_function *function,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ERRHANDLER_CREATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/errhandler_free.c b/src/mpi/errhan/errhandler_free.c
index 6ce0e26..ec3c6b3 100644
--- a/src/mpi/errhan/errhandler_free.c
+++ b/src/mpi/errhan/errhandler_free.c
@@ -57,7 +57,7 @@ int MPI_Errhandler_free(MPI_Errhandler *errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ERRHANDLER_FREE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -101,7 +101,7 @@ int MPI_Errhandler_free(MPI_Errhandler *errhandler)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ERRHANDLER_FREE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/errhan/errhandler_get.c b/src/mpi/errhan/errhandler_get.c
index b1ce71d..7e9f586 100644
--- a/src/mpi/errhan/errhandler_get.c
+++ b/src/mpi/errhan/errhandler_get.c
@@ -70,7 +70,7 @@ int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ERRHANDLER_GET);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -115,7 +115,7 @@ int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
   fn_exit:
 #   endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ERRHANDLER_GET);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 #   ifdef HAVE_ERROR_CHECKING
diff --git a/src/mpi/errhan/errhandler_set.c b/src/mpi/errhan/errhandler_set.c
index 5f19a23..797afb5 100644
--- a/src/mpi/errhan/errhandler_set.c
+++ b/src/mpi/errhan/errhandler_set.c
@@ -61,7 +61,7 @@ int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ERRHANDLER_SET);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -108,7 +108,7 @@ int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
   fn_exit:
 #   endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ERRHANDLER_SET);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 #   ifdef HAVE_ERROR_CHECKING
diff --git a/src/mpi/errhan/file_create_errhandler.c b/src/mpi/errhan/file_create_errhandler.c
index 251a815..31dd6c1 100644
--- a/src/mpi/errhan/file_create_errhandler.c
+++ b/src/mpi/errhan/file_create_errhandler.c
@@ -57,7 +57,7 @@ int MPI_File_create_errhandler(MPI_File_errhandler_function *file_errhandler_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_FILE_CREATE_ERRHANDLER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -86,7 +86,7 @@ int MPI_File_create_errhandler(MPI_File_errhandler_function *file_errhandler_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_FILE_CREATE_ERRHANDLER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/file_get_errhandler.c b/src/mpi/errhan/file_get_errhandler.c
index 7816541..b13f97d 100644
--- a/src/mpi/errhan/file_get_errhandler.c
+++ b/src/mpi/errhan/file_get_errhandler.c
@@ -64,7 +64,7 @@ int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_FILE_GET_ERRHANDLER);
 
 #ifdef MPI_MODE_RDONLY
@@ -107,7 +107,7 @@ int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_FILE_GET_ERRHANDLER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/errhan/win_create_errhandler.c b/src/mpi/errhan/win_create_errhandler.c
index 733e5d9..d4a1d91 100644
--- a/src/mpi/errhan/win_create_errhandler.c
+++ b/src/mpi/errhan/win_create_errhandler.c
@@ -59,7 +59,7 @@ int MPI_Win_create_errhandler(MPI_Win_errhandler_function *win_errhandler_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_CREATE_ERRHANDLER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -89,7 +89,7 @@ int MPI_Win_create_errhandler(MPI_Win_errhandler_function *win_errhandler_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_CREATE_ERRHANDLER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/win_get_errhandler.c b/src/mpi/errhan/win_get_errhandler.c
index 73d9aa5..6fd4887 100644
--- a/src/mpi/errhan/win_get_errhandler.c
+++ b/src/mpi/errhan/win_get_errhandler.c
@@ -59,7 +59,7 @@ int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_GET_ERRHANDLER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -112,7 +112,7 @@ int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_GET_ERRHANDLER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/group/group_compare.c b/src/mpi/group/group_compare.c
index bf7c1e4..ae7b733 100644
--- a/src/mpi/group/group_compare.c
+++ b/src/mpi/group/group_compare.c
@@ -119,7 +119,7 @@ int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
     /* The routines that setup the group data structures must be executed
        within a mutex.  As most of the group routines are not performance
        critical, we simple run these routines within the SINGLE_CS */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_COMPARE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -163,7 +163,7 @@ int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_COMPARE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/group/group_difference.c b/src/mpi/group/group_difference.c
index 4ead944..4c18fd0 100644
--- a/src/mpi/group/group_difference.c
+++ b/src/mpi/group/group_difference.c
@@ -146,7 +146,7 @@ int MPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_DIFFERENCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -191,7 +191,7 @@ int MPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_DIFFERENCE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_excl.c b/src/mpi/group/group_excl.c
index 8fffc31..701f45a 100644
--- a/src/mpi/group/group_excl.c
+++ b/src/mpi/group/group_excl.c
@@ -123,7 +123,7 @@ int MPI_Group_excl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_EXCL);
     /* Validate parameters, especially handles needing to be converted */
 #   ifdef HAVE_ERROR_CHECKING
@@ -172,7 +172,7 @@ int MPI_Group_excl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_EXCL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_free.c b/src/mpi/group/group_free.c
index c80dc36..2084bfd 100644
--- a/src/mpi/group/group_free.c
+++ b/src/mpi/group/group_free.c
@@ -78,7 +78,7 @@ int MPI_Group_free(MPI_Group *group)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_FREE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -128,7 +128,7 @@ int MPI_Group_free(MPI_Group *group)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_FREE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_incl.c b/src/mpi/group/group_incl.c
index 5a3f321..9e85e75 100644
--- a/src/mpi/group/group_incl.c
+++ b/src/mpi/group/group_incl.c
@@ -109,7 +109,7 @@ int MPI_Group_incl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_INCL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -161,7 +161,7 @@ int MPI_Group_incl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_INCL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_intersection.c b/src/mpi/group/group_intersection.c
index 1ff108a..a6a3d81 100644
--- a/src/mpi/group/group_intersection.c
+++ b/src/mpi/group/group_intersection.c
@@ -146,7 +146,7 @@ int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgro
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_INTERSECTION);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -191,7 +191,7 @@ int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgro
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_INTERSECTION);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_range_excl.c b/src/mpi/group/group_range_excl.c
index b050e7c..3ca5d23 100644
--- a/src/mpi/group/group_range_excl.c
+++ b/src/mpi/group/group_range_excl.c
@@ -159,7 +159,7 @@ int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_RANGE_EXCL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -208,7 +208,7 @@ int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_RANGE_EXCL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_range_incl.c b/src/mpi/group/group_range_incl.c
index 1b78dc1..d458739 100644
--- a/src/mpi/group/group_range_incl.c
+++ b/src/mpi/group/group_range_incl.c
@@ -138,7 +138,7 @@ int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_RANGE_INCL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -184,7 +184,7 @@ int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_RANGE_INCL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_translate_ranks.c b/src/mpi/group/group_translate_ranks.c
index 573ef28..07693d8 100644
--- a/src/mpi/group/group_translate_ranks.c
+++ b/src/mpi/group/group_translate_ranks.c
@@ -150,7 +150,7 @@ int MPI_Group_translate_ranks(MPI_Group group1, int n, const int ranks1[],
     /* The routines that setup the group data structures must be executed
        within a mutex.  As most of the group routines are not performance
        critical, we simple run these routines within the SINGLE_CS */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_TRANSLATE_RANKS);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -210,7 +210,7 @@ int MPI_Group_translate_ranks(MPI_Group group1, int n, const int ranks1[],
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_TRANSLATE_RANKS);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/group/group_union.c b/src/mpi/group/group_union.c
index a091413..65fd375 100644
--- a/src/mpi/group/group_union.c
+++ b/src/mpi/group/group_union.c
@@ -179,7 +179,7 @@ int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex); 
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX); 
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_UNION);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -224,7 +224,7 @@ int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_UNION);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/info/info_create.c b/src/mpi/info/info_create.c
index 33f1f65..7e14ee6 100644
--- a/src/mpi/info/info_create.c
+++ b/src/mpi/info/info_create.c
@@ -52,7 +52,7 @@ int MPI_Info_create( MPI_Info *info )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_CREATE);
 
     /* Validate parameters and objects (post conversion) */
@@ -80,7 +80,7 @@ int MPI_Info_create( MPI_Info *info )
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_CREATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/info/info_delete.c b/src/mpi/info/info_delete.c
index 84c088b..1ab1c17 100644
--- a/src/mpi/info/info_delete.c
+++ b/src/mpi/info/info_delete.c
@@ -52,7 +52,7 @@ int MPI_Info_delete( MPI_Info info, const char *key )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_DELETE);
     
 
@@ -115,7 +115,7 @@ int MPI_Info_delete( MPI_Info info, const char *key )
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_DELETE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/info/info_dup.c b/src/mpi/info/info_dup.c
index d31299b..165f0b2 100644
--- a/src/mpi/info/info_dup.c
+++ b/src/mpi/info/info_dup.c
@@ -99,7 +99,7 @@ int MPI_Info_dup( MPI_Info info, MPI_Info *newinfo )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_DUP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -140,7 +140,7 @@ int MPI_Info_dup( MPI_Info info, MPI_Info *newinfo )
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_DUP);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/info/info_free.c b/src/mpi/info/info_free.c
index 0840005..ed684a3 100644
--- a/src/mpi/info/info_free.c
+++ b/src/mpi/info/info_free.c
@@ -55,7 +55,7 @@ int MPI_Info_free( MPI_Info *info )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_FREE);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -96,7 +96,7 @@ int MPI_Info_free( MPI_Info *info )
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_FREE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/info/info_get.c b/src/mpi/info/info_get.c
index 4508b79..8046715 100644
--- a/src/mpi/info/info_get.c
+++ b/src/mpi/info/info_get.c
@@ -99,7 +99,7 @@ int MPI_Info_get(MPI_Info info, const char *key, int valuelen, char *value,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_GET);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -152,7 +152,7 @@ int MPI_Info_get(MPI_Info info, const char *key, int valuelen, char *value,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_GET);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/info/info_getn.c b/src/mpi/info/info_getn.c
index 2725b60..9251264 100644
--- a/src/mpi/info/info_getn.c
+++ b/src/mpi/info/info_getn.c
@@ -77,7 +77,7 @@ int MPI_Info_get_nkeys( MPI_Info info, int *nkeys )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_GET_NKEYS);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -119,7 +119,7 @@ int MPI_Info_get_nkeys( MPI_Info info, int *nkeys )
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_GET_NKEYS);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/info/info_getnth.c b/src/mpi/info/info_getnth.c
index bb1b69d..4a2bd3d 100644
--- a/src/mpi/info/info_getnth.c
+++ b/src/mpi/info/info_getnth.c
@@ -88,7 +88,7 @@ int MPI_Info_get_nthkey( MPI_Info info, int n, char *key )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_GET_NTHKEY);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -127,7 +127,7 @@ int MPI_Info_get_nthkey( MPI_Info info, int n, char *key )
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_GET_NTHKEY);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/info/info_getvallen.c b/src/mpi/info/info_getvallen.c
index 09bc93f..696b411 100644
--- a/src/mpi/info/info_getvallen.c
+++ b/src/mpi/info/info_getvallen.c
@@ -83,7 +83,7 @@ int MPI_Info_get_valuelen( MPI_Info info, const char *key, int *valuelen, int *f
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_GET_VALUELEN);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -136,7 +136,7 @@ int MPI_Info_get_valuelen( MPI_Info info, const char *key, int *valuelen, int *f
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_GET_VALUELEN);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/info/info_set.c b/src/mpi/info/info_set.c
index 8550d3b..f3260cd 100644
--- a/src/mpi/info/info_set.c
+++ b/src/mpi/info/info_set.c
@@ -58,7 +58,7 @@ int MPI_Info_set( MPI_Info info, const char *key, const char *value )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex); 
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX); 
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_SET);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -106,7 +106,7 @@ int MPI_Info_set( MPI_Info info, const char *key, const char *value )
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_SET);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/init/abort.c b/src/mpi/init/abort.c
index fda7232..acf5b59 100644
--- a/src/mpi/init/abort.c
+++ b/src/mpi/init/abort.c
@@ -86,7 +86,7 @@ int MPI_Abort(MPI_Comm comm, int errorcode)
        since that could result in the Abort hanging if another routine is
        hung holding the critical section.  Also note the "not thread-safe"
        comment in the description of MPI_Abort above. */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ABORT);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -144,7 +144,7 @@ int MPI_Abort(MPI_Comm comm, int errorcode)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ABORT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/init/async.c b/src/mpi/init/async.c
index ba64278..0294c6b 100644
--- a/src/mpi/init/async.c
+++ b/src/mpi/init/async.c
@@ -35,7 +35,7 @@ static void progress_fn(void * data)
     /* Explicitly add CS_ENTER/EXIT since this thread is created from
      * within an internal function and will call NMPI functions
      * directly. */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     /* FIXME: We assume that waiting on some request forces progress
      * on all requests. With fine-grained threads, will this still
@@ -65,7 +65,7 @@ static void progress_fn(void * data)
     MPIU_Thread_cond_signal(&progress_cond, &mpi_errno);
     MPIU_Assert(!mpi_errno);
 
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return;
 }
@@ -135,7 +135,7 @@ int MPIR_Finalize_async_thread(void)
     MPIU_Assert(!mpi_errno);
 
     /* XXX DJG why is this unlock/lock necessary?  Should we just YIELD here or later?  */
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     MPIU_Thread_mutex_lock(&progress_mutex, &mpi_errno);
     MPIU_Assert(!mpi_errno);
@@ -151,7 +151,7 @@ int MPIR_Finalize_async_thread(void)
     mpi_errno = MPIR_Comm_free_impl(progress_comm_ptr);
     MPIU_Assert(!mpi_errno);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     MPIU_Thread_cond_destroy(&progress_cond, &mpi_errno);
     MPIU_Assert(!mpi_errno);
diff --git a/src/mpi/init/finalize.c b/src/mpi/init/finalize.c
index c617a7a..534090e 100644
--- a/src/mpi/init/finalize.c
+++ b/src/mpi/init/finalize.c
@@ -151,7 +151,7 @@ int MPI_Finalize( void )
 
     /* Note: Only one thread may ever call MPI_Finalize (MPI_Finalize may
        be called at most once in any program) */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FINALIZE_FUNC_ENTER(MPID_STATE_MPI_FINALIZE);
     
     /* ... body of routine ... */
@@ -257,7 +257,7 @@ int MPI_Finalize( void )
     /* If memory debugging is enabled, check the memory here, after all
        finalize callbacks */
 
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     OPA_store_int(&MPIR_Process.mpich_state, MPICH_POST_FINALIZED);
 
 #if defined(MPICH_IS_THREADED)
@@ -319,7 +319,7 @@ int MPI_Finalize( void )
 #   endif
     mpi_errno = MPIR_Err_return_comm( 0, FCNAME, mpi_errno );
     if (OPA_load_int(&MPIR_Process.mpich_state) < MPICH_POST_FINALIZED) {
-        MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     }
     goto fn_exit;
     /* --END ERROR HANDLING-- */
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index daf9903..bc8eb3e 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -171,7 +171,7 @@ static int thread_cs_init( void )
     MPIU_Assert(MPICH_MAX_LOCKS >= MPIU_NEST_NUM_MUTEXES);
 
     /* we create this at all granularities right now */
-    MPID_Thread_mutex_create(&MPIR_ThreadInfo.memalloc_mutex, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_MEMALLOC_MUTEX, &err);
     MPIU_Assert(err == 0);
 
     /* must come after memalloc_mutex creation */
@@ -180,24 +180,24 @@ static int thread_cs_init( void )
 
 #if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL
 /* There is a single, global lock, held for the duration of an MPI call */
-    MPID_Thread_mutex_create(&MPIR_ThreadInfo.global_mutex, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_GLOBAL_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_ThreadInfo.handle_mutex, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_HANDLE_MUTEX, &err);
     MPIU_Assert(err == 0);
 
 #elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT
     /* MPIR_THREAD_GRANULARITY_PER_OBJECT: Multiple locks */
-    MPID_Thread_mutex_create(&MPIR_ThreadInfo.global_mutex, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_GLOBAL_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_ThreadInfo.handle_mutex, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_HANDLE_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_ThreadInfo.msgq_mutex, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_MSGQ_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_ThreadInfo.completion_mutex, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_COMPLETION_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_ThreadInfo.ctx_mutex, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_CTX_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_ThreadInfo.pmi_mutex, &err);
+    MPID_Thread_mutex_create(&MPIR_THREAD_PMI_MUTEX, &err);
     MPIU_Assert(err == 0);
 
 #elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_LOCK_FREE
@@ -226,25 +226,25 @@ int MPIR_Thread_CS_Finalize( void )
     MPIU_DBG_MSG(THREAD,TYPICAL,"Freeing global mutex and private storage");
 #if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL
 /* There is a single, global lock, held for the duration of an MPI call */
-    MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.global_mutex, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_GLOBAL_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.handle_mutex, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_HANDLE_MUTEX, &err);
     MPIU_Assert(err == 0);
 
 #elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT
     /* MPIR_THREAD_GRANULARITY_PER_OBJECT: There are multiple locks,
      * one for each logical class (e.g., each type of object) */
-    MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.global_mutex, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_GLOBAL_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.handle_mutex, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_HANDLE_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.msgq_mutex, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_MSGQ_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.completion_mutex, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_COMPLETION_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.ctx_mutex, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_CTX_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.pmi_mutex, &err);
+    MPID_Thread_mutex_destroy(&MPIR_THREAD_PMI_MUTEX, &err);
     MPIU_Assert(err == 0);
 
 
@@ -462,7 +462,7 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
 
     /* We can't acquire any critical sections until this point.  Any
      * earlier the basic data structures haven't been initialized */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     exit_init_cs_on_failure = 1;
 
     /* create MPI_INFO_NULL object */
@@ -541,7 +541,7 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
 	mpi_errno = MPID_InitCompleted();
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     /* Make fields of MPIR_Process global visible and set mpich_state
        atomically so that MPI_Initialized() etc. are thread safe */
     OPA_write_barrier();
@@ -554,7 +554,7 @@ fn_fail:
     OPA_store_int(&MPIR_Process.mpich_state, MPICH_PRE_INIT);
 
     if (exit_init_cs_on_failure) {
-        MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     }
 #if defined(MPICH_IS_THREADED)
     MPIR_Thread_CS_Finalize();
@@ -683,7 +683,7 @@ int MPI_Init_thread( int *argc, char ***argv, int required, int *provided )
     mpi_errno = MPIR_Err_return_comm( 0, FCNAME, mpi_errno );
     MPID_MPI_INIT_FUNC_EXIT(MPID_STATE_MPI_INIT_THREAD);
 
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return mpi_errno;
     /* --END ERROR HANDLING-- */
diff --git a/src/mpi/pt2pt/bsend.c b/src/mpi/pt2pt/bsend.c
index 9c260ba..e2a61f1 100644
--- a/src/mpi/pt2pt/bsend.c
+++ b/src/mpi/pt2pt/bsend.c
@@ -97,7 +97,7 @@ int MPI_Bsend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_BSEND);
     
     /* Validate handle parameters needing to be converted */
@@ -173,7 +173,7 @@ int MPI_Bsend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_BSEND);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 	
   fn_fail:
diff --git a/src/mpi/pt2pt/bsend_init.c b/src/mpi/pt2pt/bsend_init.c
index 6f7887d..4ba10f9 100644
--- a/src/mpi/pt2pt/bsend_init.c
+++ b/src/mpi/pt2pt/bsend_init.c
@@ -70,7 +70,7 @@ int MPI_Bsend_init(const void *buf, int count, MPI_Datatype datatype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_BSEND_INIT);
     
     /* Validate handle parameters needing to be converted */
@@ -131,7 +131,7 @@ int MPI_Bsend_init(const void *buf, int count, MPI_Datatype datatype,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_BSEND_INIT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/bufattach.c b/src/mpi/pt2pt/bufattach.c
index bbb09dd..17b58b2 100644
--- a/src/mpi/pt2pt/bufattach.c
+++ b/src/mpi/pt2pt/bufattach.c
@@ -82,7 +82,7 @@ int MPI_Buffer_attach(void *buffer, int size)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_BUFFER_ATTACH);
     
 #   ifdef HAVE_ERROR_CHECKING
@@ -104,7 +104,7 @@ int MPI_Buffer_attach(void *buffer, int size)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_BUFFER_ATTACH);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/buffree.c b/src/mpi/pt2pt/buffree.c
index fa190f9..db90f89 100644
--- a/src/mpi/pt2pt/buffree.c
+++ b/src/mpi/pt2pt/buffree.c
@@ -99,7 +99,7 @@ int MPI_Buffer_detach(void *buffer_addr, int *size)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_BUFFER_DETACH);
     
 #   ifdef HAVE_ERROR_CHECKING
@@ -121,7 +121,7 @@ int MPI_Buffer_detach(void *buffer_addr, int *size)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_BUFFER_DETACH);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/cancel.c b/src/mpi/pt2pt/cancel.c
index 8085639..13a50d9 100644
--- a/src/mpi/pt2pt/cancel.c
+++ b/src/mpi/pt2pt/cancel.c
@@ -164,7 +164,7 @@ int MPI_Cancel(MPI_Request *request)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_CANCEL);
     
     /* Convert MPI object handles to object pointers */
@@ -192,7 +192,7 @@ int MPI_Cancel(MPI_Request *request)
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_CANCEL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/greq_complete.c b/src/mpi/pt2pt/greq_complete.c
index 5bb5dfc..1f296a7 100644
--- a/src/mpi/pt2pt/greq_complete.c
+++ b/src/mpi/pt2pt/greq_complete.c
@@ -72,7 +72,7 @@ int MPI_Grequest_complete( MPI_Request request )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GREQUEST_COMPLETE);
     
     /* Validate handle parameters needing to be converted */
@@ -115,7 +115,7 @@ int MPI_Grequest_complete( MPI_Request request )
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GREQUEST_COMPLETE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/pt2pt/greq_start.c b/src/mpi/pt2pt/greq_start.c
index c8d1ecd..52e28a9 100644
--- a/src/mpi/pt2pt/greq_start.c
+++ b/src/mpi/pt2pt/greq_start.c
@@ -184,7 +184,7 @@ int MPI_Grequest_start( MPI_Grequest_query_function *query_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GREQUEST_START);
 
     /* Validate parameters if error checking is enabled */
@@ -209,7 +209,7 @@ int MPI_Grequest_start( MPI_Grequest_query_function *query_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GREQUEST_START);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/ibsend.c b/src/mpi/pt2pt/ibsend.c
index 0ee0788..52e624b 100644
--- a/src/mpi/pt2pt/ibsend.c
+++ b/src/mpi/pt2pt/ibsend.c
@@ -169,7 +169,7 @@ int MPI_Ibsend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_IBSEND);
 
     /* Validate handle parameters needing to be converted */
@@ -232,7 +232,7 @@ int MPI_Ibsend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_IBSEND);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/improbe.c b/src/mpi/pt2pt/improbe.c
index e9eb080..808db85 100644
--- a/src/mpi/pt2pt/improbe.c
+++ b/src/mpi/pt2pt/improbe.c
@@ -59,7 +59,7 @@ int MPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *mess
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IMPROBE);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IMPROBE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -113,7 +113,7 @@ int MPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *mess
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IMPROBE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/pt2pt/imrecv.c b/src/mpi/pt2pt/imrecv.c
index 60553ed..6cff657 100644
--- a/src/mpi/pt2pt/imrecv.c
+++ b/src/mpi/pt2pt/imrecv.c
@@ -60,7 +60,7 @@ int MPI_Imrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message
     MPID_Request *msgp = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IMRECV);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IMRECV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -121,7 +121,7 @@ int MPI_Imrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IMRECV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/pt2pt/iprobe.c b/src/mpi/pt2pt/iprobe.c
index 1784b53..74cda6e 100644
--- a/src/mpi/pt2pt/iprobe.c
+++ b/src/mpi/pt2pt/iprobe.c
@@ -64,7 +64,7 @@ int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_IPROBE);
     
     /* Validate handle parameters needing to be converted */
@@ -111,7 +111,7 @@ int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_IPROBE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/irecv.c b/src/mpi/pt2pt/irecv.c
index 55959ac..ec599e2 100644
--- a/src/mpi/pt2pt/irecv.c
+++ b/src/mpi/pt2pt/irecv.c
@@ -69,7 +69,7 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_BACK(MPID_STATE_MPI_IRECV);
 
     /* Validate handle parameters needing to be converted */
@@ -142,7 +142,7 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT_BACK(MPID_STATE_MPI_IRECV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/irsend.c b/src/mpi/pt2pt/irsend.c
index b8b81cd..a98c3e9 100644
--- a/src/mpi/pt2pt/irsend.c
+++ b/src/mpi/pt2pt/irsend.c
@@ -70,7 +70,7 @@ int MPI_Irsend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_IRSEND);
 
     /* Validate handle parameters needing to be converted */
@@ -139,7 +139,7 @@ int MPI_Irsend(const void *buf, int count, MPI_Datatype datatype, int dest, int
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_IRSEND);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/isend.c b/src/mpi/pt2pt/isend.c
index 33d0c6c..aec119b 100644
--- a/src/mpi/pt2pt/isend.c
+++ b/src/mpi/pt2pt/isend.c
@@ -68,7 +68,7 @@ int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_ISEND);
 
     /* Validate handle parameters needing to be converted */
@@ -138,7 +138,7 @@ int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_ISEND);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/issend.c b/src/mpi/pt2pt/issend.c
index ac8d603..b2e4265 100644
--- a/src/mpi/pt2pt/issend.c
+++ b/src/mpi/pt2pt/issend.c
@@ -69,7 +69,7 @@ int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_ISSEND);
 
     /* Validate handle parameters needing to be converted */
@@ -138,7 +138,7 @@ int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_ISSEND);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/mprobe.c b/src/mpi/pt2pt/mprobe.c
index e4dde5e..f51f564 100644
--- a/src/mpi/pt2pt/mprobe.c
+++ b/src/mpi/pt2pt/mprobe.c
@@ -57,7 +57,7 @@ int MPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Sta
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_MPROBE);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_MPROBE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -107,7 +107,7 @@ int MPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Sta
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_MPROBE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/pt2pt/mrecv.c b/src/mpi/pt2pt/mrecv.c
index 1953cbe..3463cd7 100644
--- a/src/mpi/pt2pt/mrecv.c
+++ b/src/mpi/pt2pt/mrecv.c
@@ -59,7 +59,7 @@ int MPI_Mrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message,
     MPID_Request *msgp = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_MRECV);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_MRECV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -117,7 +117,7 @@ int MPI_Mrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message,
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_MRECV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/pt2pt/probe.c b/src/mpi/pt2pt/probe.c
index 2c18ab1..adc7ea3 100644
--- a/src/mpi/pt2pt/probe.c
+++ b/src/mpi/pt2pt/probe.c
@@ -60,7 +60,7 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_PROBE);
     
     /* Validate handle parameters needing to be converted */
@@ -104,7 +104,7 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
 
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_PROBE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/recv.c b/src/mpi/pt2pt/recv.c
index 8f8df21..f4a6352 100644
--- a/src/mpi/pt2pt/recv.c
+++ b/src/mpi/pt2pt/recv.c
@@ -75,7 +75,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_BACK(MPID_STATE_MPI_RECV);
     
     /* Validate handle parameters needing to be converted */
@@ -189,7 +189,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT_BACK(MPID_STATE_MPI_RECV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/recv_init.c b/src/mpi/pt2pt/recv_init.c
index bb1d561..4d2c5f5 100644
--- a/src/mpi/pt2pt/recv_init.c
+++ b/src/mpi/pt2pt/recv_init.c
@@ -71,7 +71,7 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_RECV_INIT);
 
     /* Validate handle parameters needing to be converted */
@@ -136,7 +136,7 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_RECV_INIT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/request_free.c b/src/mpi/pt2pt/request_free.c
index d85fd06..43f8b17 100644
--- a/src/mpi/pt2pt/request_free.c
+++ b/src/mpi/pt2pt/request_free.c
@@ -72,7 +72,7 @@ int MPI_Request_free(MPI_Request *request)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_REQUEST_FREE);
     
     /* Validate handle parameters needing to be converted */
@@ -174,7 +174,7 @@ int MPI_Request_free(MPI_Request *request)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_REQUEST_FREE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/request_get_status.c b/src/mpi/pt2pt/request_get_status.c
index 07269e8..522b953 100644
--- a/src/mpi/pt2pt/request_get_status.c
+++ b/src/mpi/pt2pt/request_get_status.c
@@ -62,7 +62,7 @@ int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_REQUEST_GET_STATUS);
 
     /* Check the arguments */
@@ -246,7 +246,7 @@ int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_REQUEST_GET_STATUS);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/rsend.c b/src/mpi/pt2pt/rsend.c
index 12f4736..f8959db 100644
--- a/src/mpi/pt2pt/rsend.c
+++ b/src/mpi/pt2pt/rsend.c
@@ -66,7 +66,7 @@ int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_RSEND);
     
     /* Validate handle parameters needing to be converted */
@@ -158,7 +158,7 @@ int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_RSEND);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/rsend_init.c b/src/mpi/pt2pt/rsend_init.c
index 8e5e851..dfc2383 100644
--- a/src/mpi/pt2pt/rsend_init.c
+++ b/src/mpi/pt2pt/rsend_init.c
@@ -71,7 +71,7 @@ int MPI_Rsend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_RSEND_INIT);
     
     /* Validate handle parameters needing to be converted */
@@ -136,7 +136,7 @@ int MPI_Rsend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_RSEND_INIT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/send.c b/src/mpi/pt2pt/send.c
index 7098471..862d49d 100644
--- a/src/mpi/pt2pt/send.c
+++ b/src/mpi/pt2pt/send.c
@@ -71,7 +71,7 @@ int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int ta
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_SEND);
     
     /* Validate handle parameters needing to be converted */
@@ -163,7 +163,7 @@ int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int ta
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_SEND);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/send_init.c b/src/mpi/pt2pt/send_init.c
index 49eaa5a..8aceca5 100644
--- a/src/mpi/pt2pt/send_init.c
+++ b/src/mpi/pt2pt/send_init.c
@@ -71,7 +71,7 @@ int MPI_Send_init(const void *buf, int count, MPI_Datatype datatype, int dest,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_SEND_INIT);
     
     /* Validate handle parameters needing to be converted */
@@ -137,7 +137,7 @@ int MPI_Send_init(const void *buf, int count, MPI_Datatype datatype, int dest,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_SEND_INIT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/sendrecv.c b/src/mpi/pt2pt/sendrecv.c
index 652320a..51abfe4 100644
--- a/src/mpi/pt2pt/sendrecv.c
+++ b/src/mpi/pt2pt/sendrecv.c
@@ -82,7 +82,7 @@ int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_BOTH(MPID_STATE_MPI_SENDRECV);
     
     /* Validate handle parameters needing to be converted */
@@ -226,7 +226,7 @@ int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT_BOTH(MPID_STATE_MPI_SENDRECV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/sendrecv_rep.c b/src/mpi/pt2pt/sendrecv_rep.c
index 972ab47..bcb945d 100644
--- a/src/mpi/pt2pt/sendrecv_rep.c
+++ b/src/mpi/pt2pt/sendrecv_rep.c
@@ -81,7 +81,7 @@ int MPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
     
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_BOTH(MPID_STATE_MPI_SENDRECV_REPLACE);
 
     /* Convert handles to MPI objects. */
@@ -220,7 +220,7 @@ int MPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_PT2PT_FUNC_EXIT_BOTH(MPID_STATE_MPI_SENDRECV_REPLACE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/ssend.c b/src/mpi/pt2pt/ssend.c
index c17a02b..ac25461 100644
--- a/src/mpi/pt2pt/ssend.c
+++ b/src/mpi/pt2pt/ssend.c
@@ -65,7 +65,7 @@ int MPI_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_SSEND);
     
     /* Validate handle parameters needing to be converted */
@@ -141,7 +141,7 @@ int MPI_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_SSEND);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/ssend_init.c b/src/mpi/pt2pt/ssend_init.c
index 10d86be..9ebf263 100644
--- a/src/mpi/pt2pt/ssend_init.c
+++ b/src/mpi/pt2pt/ssend_init.c
@@ -68,7 +68,7 @@ int MPI_Ssend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_SSEND_INIT);
     
     /* Validate handle parameters needing to be converted */
@@ -133,7 +133,7 @@ int MPI_Ssend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_SSEND_INIT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/start.c b/src/mpi/pt2pt/start.c
index 8efdb3d..5f517cf 100644
--- a/src/mpi/pt2pt/start.c
+++ b/src/mpi/pt2pt/start.c
@@ -54,7 +54,7 @@ int MPI_Start(MPI_Request *request)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_START);
 
     /* Validate handle parameters needing to be converted */
@@ -95,7 +95,7 @@ int MPI_Start(MPI_Request *request)
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_START);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/startall.c b/src/mpi/pt2pt/startall.c
index b1de944..5c18507 100644
--- a/src/mpi/pt2pt/startall.c
+++ b/src/mpi/pt2pt/startall.c
@@ -70,7 +70,7 @@ int MPI_Startall(int count, MPI_Request array_of_requests[])
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_STARTALL);
 
     /* Validate handle parameters needing to be converted */
@@ -132,7 +132,7 @@ int MPI_Startall(int count, MPI_Request array_of_requests[])
     }
 
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_STARTALL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/test.c b/src/mpi/pt2pt/test.c
index 18cf606..94ef842 100644
--- a/src/mpi/pt2pt/test.c
+++ b/src/mpi/pt2pt/test.c
@@ -117,7 +117,7 @@ int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_TEST);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -163,7 +163,7 @@ int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status)
     
   fn_exit:
 	MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_TEST);
-	MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+	MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 	return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/testall.c b/src/mpi/pt2pt/testall.c
index 99699d2..a32dc99 100644
--- a/src/mpi/pt2pt/testall.c
+++ b/src/mpi/pt2pt/testall.c
@@ -238,7 +238,7 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_TESTALL);
 
     /* Check the arguments */
@@ -273,7 +273,7 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
   fn_exit:
     
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_TESTALL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/testany.c b/src/mpi/pt2pt/testany.c
index 17e51a7..4096014 100644
--- a/src/mpi/pt2pt/testany.c
+++ b/src/mpi/pt2pt/testany.c
@@ -80,7 +80,7 @@ int MPI_Testany(int count, MPI_Request array_of_requests[], int *indx,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_TESTANY);
 
     /* Check the arguments */
@@ -221,7 +221,7 @@ int MPI_Testany(int count, MPI_Request array_of_requests[], int *indx,
     }
 
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_TESTANY);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/testsome.c b/src/mpi/pt2pt/testsome.c
index 95ceadf..16a17ea 100644
--- a/src/mpi/pt2pt/testsome.c
+++ b/src/mpi/pt2pt/testsome.c
@@ -84,7 +84,7 @@ int MPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_TESTSOME);
 
     /* Check the arguments */
@@ -244,7 +244,7 @@ int MPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount,
     }
 
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_TESTSOME);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/wait.c b/src/mpi/pt2pt/wait.c
index 64f7520..c068e22 100644
--- a/src/mpi/pt2pt/wait.c
+++ b/src/mpi/pt2pt/wait.c
@@ -142,7 +142,7 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_WAIT);
 
     /* Check the arguments */
@@ -193,7 +193,7 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status)
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_WAIT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 	
   fn_fail:
diff --git a/src/mpi/pt2pt/waitall.c b/src/mpi/pt2pt/waitall.c
index a89dd6e..a331b48 100644
--- a/src/mpi/pt2pt/waitall.c
+++ b/src/mpi/pt2pt/waitall.c
@@ -347,7 +347,7 @@ int MPI_Waitall(int count, MPI_Request array_of_requests[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_WAITALL);
 
     /* Check the arguments */
@@ -382,7 +382,7 @@ int MPI_Waitall(int count, MPI_Request array_of_requests[],
     
  fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_WAITALL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
  fn_fail:
diff --git a/src/mpi/pt2pt/waitany.c b/src/mpi/pt2pt/waitany.c
index 16d1259..75f97ec 100644
--- a/src/mpi/pt2pt/waitany.c
+++ b/src/mpi/pt2pt/waitany.c
@@ -84,7 +84,7 @@ int MPI_Waitany(int count, MPI_Request array_of_requests[], int *indx,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_WAITANY);
 
     /* Check the arguments */
@@ -226,7 +226,7 @@ int MPI_Waitany(int count, MPI_Request array_of_requests[], int *indx,
     }
 
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_WAITANY);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_progress_end_fail:
diff --git a/src/mpi/pt2pt/waitsome.c b/src/mpi/pt2pt/waitsome.c
index c80d1eb..359c8aa 100644
--- a/src/mpi/pt2pt/waitsome.c
+++ b/src/mpi/pt2pt/waitsome.c
@@ -103,7 +103,7 @@ int MPI_Waitsome(int incount, MPI_Request array_of_requests[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_WAITSOME);
 
     /* Check the arguments */
@@ -297,7 +297,7 @@ int MPI_Waitsome(int incount, MPI_Request array_of_requests[],
     }
 
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_WAITSOME);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/accumulate.c b/src/mpi/rma/accumulate.c
index d711f4a..1bb10df 100644
--- a/src/mpi/rma/accumulate.c
+++ b/src/mpi/rma/accumulate.c
@@ -77,7 +77,7 @@ int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_ACCUMULATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -155,7 +155,7 @@ int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_ACCUMULATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/alloc_mem.c b/src/mpi/rma/alloc_mem.c
index d6179ec..c8fc338 100644
--- a/src/mpi/rma/alloc_mem.c
+++ b/src/mpi/rma/alloc_mem.c
@@ -70,7 +70,7 @@ int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ALLOC_MEM);
     
 #   ifdef HAVE_ERROR_CHECKING
@@ -106,7 +106,7 @@ int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ALLOC_MEM);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/compare_and_swap.c b/src/mpi/rma/compare_and_swap.c
index f694811..ddc947e 100644
--- a/src/mpi/rma/compare_and_swap.c
+++ b/src/mpi/rma/compare_and_swap.c
@@ -83,7 +83,7 @@ int MPI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_COMPARE_AND_SWAP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -143,7 +143,7 @@ int MPI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_COMPARE_AND_SWAP);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/fetch_and_op.c b/src/mpi/rma/fetch_and_op.c
index f128f76..8138142 100644
--- a/src/mpi/rma/fetch_and_op.c
+++ b/src/mpi/rma/fetch_and_op.c
@@ -88,7 +88,7 @@ int MPI_Fetch_and_op(const void *origin_addr, void *result_addr,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_FETCH_AND_OP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -159,7 +159,7 @@ int MPI_Fetch_and_op(const void *origin_addr, void *result_addr,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_FETCH_AND_OP);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/free_mem.c b/src/mpi/rma/free_mem.c
index cde79bb..b701adc 100644
--- a/src/mpi/rma/free_mem.c
+++ b/src/mpi/rma/free_mem.c
@@ -52,7 +52,7 @@ int MPI_Free_mem(void *base)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_FREE_MEM);
 
     /* ... body of routine ...  */
@@ -66,7 +66,7 @@ int MPI_Free_mem(void *base)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_FREE_MEM);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/get.c b/src/mpi/rma/get.c
index c5e5f5c..1ba8e8e 100644
--- a/src/mpi/rma/get.c
+++ b/src/mpi/rma/get.c
@@ -72,7 +72,7 @@ int MPI_Get(void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_GET);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -148,7 +148,7 @@ int MPI_Get(void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_GET);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/get_accumulate.c b/src/mpi/rma/get_accumulate.c
index b541bfe..fd788b2 100644
--- a/src/mpi/rma/get_accumulate.c
+++ b/src/mpi/rma/get_accumulate.c
@@ -108,7 +108,7 @@ int MPI_Get_accumulate(const void *origin_addr, int origin_count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_GET_ACCUMULATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -209,7 +209,7 @@ int MPI_Get_accumulate(const void *origin_addr, int origin_count,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_GET_ACCUMULATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/put.c b/src/mpi/rma/put.c
index 7f58379..b2c593a 100644
--- a/src/mpi/rma/put.c
+++ b/src/mpi/rma/put.c
@@ -72,7 +72,7 @@ int MPI_Put(const void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_PUT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -148,7 +148,7 @@ int MPI_Put(const void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_PUT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/raccumulate.c b/src/mpi/rma/raccumulate.c
index d8fd28d..4118978 100644
--- a/src/mpi/rma/raccumulate.c
+++ b/src/mpi/rma/raccumulate.c
@@ -91,7 +91,7 @@ int MPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_RACCUMULATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -172,7 +172,7 @@ int MPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_RACCUMULATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/rget.c b/src/mpi/rma/rget.c
index cf5470e..2c1efcd 100644
--- a/src/mpi/rma/rget.c
+++ b/src/mpi/rma/rget.c
@@ -86,7 +86,7 @@ int MPI_Rget(void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_RGET);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -165,7 +165,7 @@ int MPI_Rget(void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_RGET);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/rget_accumulate.c b/src/mpi/rma/rget_accumulate.c
index 514556b..6fe8ad3 100644
--- a/src/mpi/rma/rget_accumulate.c
+++ b/src/mpi/rma/rget_accumulate.c
@@ -101,7 +101,7 @@ int MPI_Rget_accumulate(const void *origin_addr, int origin_count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_RGET_ACCUMULATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -201,7 +201,7 @@ int MPI_Rget_accumulate(const void *origin_addr, int origin_count,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_RGET_ACCUMULATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/rput.c b/src/mpi/rma/rput.c
index 166812a..664e19d 100644
--- a/src/mpi/rma/rput.c
+++ b/src/mpi/rma/rput.c
@@ -88,7 +88,7 @@ int MPI_Rput(const void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_RPUT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -167,7 +167,7 @@ int MPI_Rput(const void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_RPUT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_allocate.c b/src/mpi/rma/win_allocate.c
index 2cc2914..1a0e277 100644
--- a/src/mpi/rma/win_allocate.c
+++ b/src/mpi/rma/win_allocate.c
@@ -80,7 +80,7 @@ int MPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_ALLOCATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -153,7 +153,7 @@ int MPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_ALLOCATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_allocate_shared.c b/src/mpi/rma/win_allocate_shared.c
index edc18fd..0623e68 100644
--- a/src/mpi/rma/win_allocate_shared.c
+++ b/src/mpi/rma/win_allocate_shared.c
@@ -90,7 +90,7 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Com
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_ALLOCATE_SHARED);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -151,7 +151,7 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Com
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_ALLOCATE_SHARED);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_attach.c b/src/mpi/rma/win_attach.c
index 2e545a2..a4fa201 100644
--- a/src/mpi/rma/win_attach.c
+++ b/src/mpi/rma/win_attach.c
@@ -69,7 +69,7 @@ int MPI_Win_attach(MPI_Win win, void *base, MPI_Aint size)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_ATTACH);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -127,7 +127,7 @@ int MPI_Win_attach(MPI_Win win, void *base, MPI_Aint size)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_ATTACH);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_complete.c b/src/mpi/rma/win_complete.c
index 9dd42d2..c625366 100644
--- a/src/mpi/rma/win_complete.c
+++ b/src/mpi/rma/win_complete.c
@@ -54,7 +54,7 @@ int MPI_Win_complete(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_COMPLETE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -94,7 +94,7 @@ int MPI_Win_complete(MPI_Win win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_COMPLETE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_create.c b/src/mpi/rma/win_create.c
index 9b3d921..a4a8ebd 100644
--- a/src/mpi/rma/win_create.c
+++ b/src/mpi/rma/win_create.c
@@ -108,7 +108,7 @@ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_CREATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -181,7 +181,7 @@ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_CREATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_create_dynamic.c b/src/mpi/rma/win_create_dynamic.c
index a88ab4a..84e13b3 100644
--- a/src/mpi/rma/win_create_dynamic.c
+++ b/src/mpi/rma/win_create_dynamic.c
@@ -96,7 +96,7 @@ int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_CREATE_DYNAMIC);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -145,7 +145,7 @@ int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_CREATE_DYNAMIC);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_detach.c b/src/mpi/rma/win_detach.c
index fc87847..098bd2d 100644
--- a/src/mpi/rma/win_detach.c
+++ b/src/mpi/rma/win_detach.c
@@ -68,7 +68,7 @@ int MPI_Win_detach(MPI_Win win, const void *base)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_DETACH);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -109,7 +109,7 @@ int MPI_Win_detach(MPI_Win win, const void *base)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_DETACH);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_fence.c b/src/mpi/rma/win_fence.c
index c238012..c5f32cf 100644
--- a/src/mpi/rma/win_fence.c
+++ b/src/mpi/rma/win_fence.c
@@ -72,7 +72,7 @@ int MPI_Win_fence(int assert, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_FENCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -115,7 +115,7 @@ int MPI_Win_fence(int assert, MPI_Win win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_FENCE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_flush.c b/src/mpi/rma/win_flush.c
index cdcf825..cafac61 100644
--- a/src/mpi/rma/win_flush.c
+++ b/src/mpi/rma/win_flush.c
@@ -63,7 +63,7 @@ int MPI_Win_flush(int rank, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_FLUSH);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -110,7 +110,7 @@ int MPI_Win_flush(int rank, MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_FLUSH);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_flush_all.c b/src/mpi/rma/win_flush_all.c
index 5403a47..1733422 100644
--- a/src/mpi/rma/win_flush_all.c
+++ b/src/mpi/rma/win_flush_all.c
@@ -62,7 +62,7 @@ int MPI_Win_flush_all(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_FLUSH_ALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -104,7 +104,7 @@ int MPI_Win_flush_all(MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_FLUSH_ALL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_flush_local.c b/src/mpi/rma/win_flush_local.c
index f04dc70..224705b 100644
--- a/src/mpi/rma/win_flush_local.c
+++ b/src/mpi/rma/win_flush_local.c
@@ -65,7 +65,7 @@ int MPI_Win_flush_local(int rank, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_FLUSH_LOCAL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -112,7 +112,7 @@ int MPI_Win_flush_local(int rank, MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_FLUSH_LOCAL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_flush_local_all.c b/src/mpi/rma/win_flush_local_all.c
index 133558e..7306480 100644
--- a/src/mpi/rma/win_flush_local_all.c
+++ b/src/mpi/rma/win_flush_local_all.c
@@ -61,7 +61,7 @@ int MPI_Win_flush_local_all(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_FLUSH_LOCAL_ALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -102,7 +102,7 @@ int MPI_Win_flush_local_all(MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_FLUSH_LOCAL_ALL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_free.c b/src/mpi/rma/win_free.c
index 3630cf3..1df3951 100644
--- a/src/mpi/rma/win_free.c
+++ b/src/mpi/rma/win_free.c
@@ -57,7 +57,7 @@ int MPI_Win_free(MPI_Win *win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_FREE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -124,7 +124,7 @@ int MPI_Win_free(MPI_Win *win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_FREE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_get_group.c b/src/mpi/rma/win_get_group.c
index 83d8e46..fea73f7 100644
--- a/src/mpi/rma/win_get_group.c
+++ b/src/mpi/rma/win_get_group.c
@@ -66,7 +66,7 @@ int MPI_Win_get_group(MPI_Win win, MPI_Group *group)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_GET_GROUP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -110,7 +110,7 @@ int MPI_Win_get_group(MPI_Win win, MPI_Group *group)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_GET_GROUP);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_get_info.c b/src/mpi/rma/win_get_info.c
index d5a5ffa..90ef494 100644
--- a/src/mpi/rma/win_get_info.c
+++ b/src/mpi/rma/win_get_info.c
@@ -76,7 +76,7 @@ int MPI_Win_get_info(MPI_Win win, MPI_Info *info_used)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_GET_INFO);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Win_get_info(MPI_Win win, MPI_Info *info_used)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_GET_INFO);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_lock.c b/src/mpi/rma/win_lock.c
index bbea9ac..e094c59 100644
--- a/src/mpi/rma/win_lock.c
+++ b/src/mpi/rma/win_lock.c
@@ -82,7 +82,7 @@ int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_LOCK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -143,7 +143,7 @@ int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_LOCK);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_lock_all.c b/src/mpi/rma/win_lock_all.c
index 471018e..1fa806e 100644
--- a/src/mpi/rma/win_lock_all.c
+++ b/src/mpi/rma/win_lock_all.c
@@ -86,7 +86,7 @@ int MPI_Win_lock_all(int assert, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_LOCK_ALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -137,7 +137,7 @@ int MPI_Win_lock_all(int assert, MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_LOCK_ALL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_post.c b/src/mpi/rma/win_post.c
index 4d0d176..d63bb5d 100644
--- a/src/mpi/rma/win_post.c
+++ b/src/mpi/rma/win_post.c
@@ -71,7 +71,7 @@ int MPI_Win_post(MPI_Group group, int assert, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_POST);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Win_post(MPI_Group group, int assert, MPI_Win win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_POST);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_set_info.c b/src/mpi/rma/win_set_info.c
index eedc5e4..095da0c 100644
--- a/src/mpi/rma/win_set_info.c
+++ b/src/mpi/rma/win_set_info.c
@@ -73,7 +73,7 @@ int MPI_Win_set_info(MPI_Win win, MPI_Info info)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_SET_INFO);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -117,7 +117,7 @@ int MPI_Win_set_info(MPI_Win win, MPI_Info info)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_SET_INFO);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_shared_query.c b/src/mpi/rma/win_shared_query.c
index 03ecfb5..0361502 100644
--- a/src/mpi/rma/win_shared_query.c
+++ b/src/mpi/rma/win_shared_query.c
@@ -80,7 +80,7 @@ int MPI_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size, int *disp_unit,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_SHARED_QUERY);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -129,7 +129,7 @@ int MPI_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size, int *disp_unit,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_SHARED_QUERY);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_start.c b/src/mpi/rma/win_start.c
index 84ff952..3617b6a 100644
--- a/src/mpi/rma/win_start.c
+++ b/src/mpi/rma/win_start.c
@@ -72,7 +72,7 @@ int MPI_Win_start(MPI_Group group, int assert, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_START);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -119,7 +119,7 @@ int MPI_Win_start(MPI_Group group, int assert, MPI_Win win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_START);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_sync.c b/src/mpi/rma/win_sync.c
index 6762dc1..a84b567 100644
--- a/src/mpi/rma/win_sync.c
+++ b/src/mpi/rma/win_sync.c
@@ -64,7 +64,7 @@ int MPI_Win_sync(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_SYNC);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -104,7 +104,7 @@ int MPI_Win_sync(MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_SYNC);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_test.c b/src/mpi/rma/win_test.c
index 4f9c256..17139c6 100644
--- a/src/mpi/rma/win_test.c
+++ b/src/mpi/rma/win_test.c
@@ -63,7 +63,7 @@ int MPI_Win_test(MPI_Win win, int *flag)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_TEST);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -105,7 +105,7 @@ int MPI_Win_test(MPI_Win win, int *flag)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_TEST);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_unlock.c b/src/mpi/rma/win_unlock.c
index fba5778..6a7ee8a 100644
--- a/src/mpi/rma/win_unlock.c
+++ b/src/mpi/rma/win_unlock.c
@@ -58,7 +58,7 @@ int MPI_Win_unlock(int rank, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_UNLOCK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -105,7 +105,7 @@ int MPI_Win_unlock(int rank, MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_UNLOCK);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_unlock_all.c b/src/mpi/rma/win_unlock_all.c
index c396f87..5fc6c3b 100644
--- a/src/mpi/rma/win_unlock_all.c
+++ b/src/mpi/rma/win_unlock_all.c
@@ -65,7 +65,7 @@ int MPI_Win_unlock_all(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_UNLOCK_ALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -107,7 +107,7 @@ int MPI_Win_unlock_all(MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_UNLOCK_ALL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_wait.c b/src/mpi/rma/win_wait.c
index 8d49f5f..c2ba1b2 100644
--- a/src/mpi/rma/win_wait.c
+++ b/src/mpi/rma/win_wait.c
@@ -54,7 +54,7 @@ int MPI_Win_wait(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_WAIT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -95,7 +95,7 @@ int MPI_Win_wait(MPI_Win win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_WAIT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/romio/mpi-io/close.c b/src/mpi/romio/mpi-io/close.c
index ddc2a99..797c851 100644
--- a/src/mpi/romio/mpi-io/close.c
+++ b/src/mpi/romio/mpi-io/close.c
@@ -44,7 +44,7 @@ int MPI_File_close(MPI_File *fh)
     HPMP_IO_WSTART(fl_xmpi, BLKMPIFILECLOSE, TRDTBLOCK, *adio_fh);
 #endif /* MPI_hpux */
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(*fh);
 
@@ -90,7 +90,7 @@ int MPI_File_close(MPI_File *fh)
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/romio/mpi-io/delete.c b/src/mpi/romio/mpi-io/delete.c
index 414d270..19a2335 100644
--- a/src/mpi/romio/mpi-io/delete.c
+++ b/src/mpi/romio/mpi-io/delete.c
@@ -48,7 +48,7 @@ int MPI_File_delete(ROMIO_CONST char *filename, MPI_Info info)
 
     MPIU_UNREFERENCED_ARG(info);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     MPIR_MPIOInit(&error_code);
     if (error_code != MPI_SUCCESS) goto fn_exit;
@@ -90,6 +90,6 @@ int MPI_File_delete(ROMIO_CONST char *filename, MPI_Info info)
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/fsync.c b/src/mpi/romio/mpi-io/fsync.c
index 021d01a..6bca025 100644
--- a/src/mpi/romio/mpi-io/fsync.c
+++ b/src/mpi/romio/mpi-io/fsync.c
@@ -45,7 +45,7 @@ int MPI_File_sync(MPI_File fh)
     HPMP_IO_START(fl_xmpi, BLKMPIFILESYNC, TRDTBLOCK, adio_fh,
 		  MPI_DATATYPE_NULL, -1);
 #endif /* MPI_hpux */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
     /* --BEGIN ERROR HANDLING-- */
@@ -71,6 +71,6 @@ int MPI_File_sync(MPI_File fh)
 #endif /* MPI_hpux */
  
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/get_errh.c b/src/mpi/romio/mpi-io/get_errh.c
index 304ac68..67d65d2 100644
--- a/src/mpi/romio/mpi-io/get_errh.c
+++ b/src/mpi/romio/mpi-io/get_errh.c
@@ -44,7 +44,7 @@ int MPI_File_get_errhandler(MPI_File mpi_fh, MPI_Errhandler *errhandler)
     static char myname[] = "MPI_FILE_GET_ERRHANDLER";
     MPIU_THREADPRIV_DECL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     if (mpi_fh == MPI_FILE_NULL) {
 	*errhandler = ADIOI_DFLT_ERR_HANDLER;
@@ -66,6 +66,6 @@ int MPI_File_get_errhandler(MPI_File mpi_fh, MPI_Errhandler *errhandler)
     }
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/mpi-io/get_group.c b/src/mpi/romio/mpi-io/get_group.c
index cf8ade0..da6c910 100644
--- a/src/mpi/romio/mpi-io/get_group.c
+++ b/src/mpi/romio/mpi-io/get_group.c
@@ -43,7 +43,7 @@ int MPI_File_get_group(MPI_File fh, MPI_Group *group)
     ADIO_File adio_fh;
     static char myname[] = "MPI_FILE_GET_GROUP";
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -59,6 +59,6 @@ int MPI_File_get_group(MPI_File fh, MPI_Group *group)
     error_code = MPI_Comm_group(adio_fh->comm, group);
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/get_info.c b/src/mpi/romio/mpi-io/get_info.c
index 65b737f..6962793 100644
--- a/src/mpi/romio/mpi-io/get_info.c
+++ b/src/mpi/romio/mpi-io/get_info.c
@@ -42,7 +42,7 @@ int MPI_File_get_info(MPI_File fh, MPI_Info *info_used)
     ADIO_File adio_fh;
     static char myname[] = "MPI_FILE_GET_INFO";
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -57,6 +57,6 @@ int MPI_File_get_info(MPI_File fh, MPI_Info *info_used)
     /* --END ERROR HANDLING-- */
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return  error_code;
 }
diff --git a/src/mpi/romio/mpi-io/get_view.c b/src/mpi/romio/mpi-io/get_view.c
index 5d8672d..1c7f9b1 100644
--- a/src/mpi/romio/mpi-io/get_view.c
+++ b/src/mpi/romio/mpi-io/get_view.c
@@ -52,7 +52,7 @@ int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype,
     int i, j, k, combiner;
     MPI_Datatype copy_etype, copy_filetype;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -96,7 +96,7 @@ int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype,
     }
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/mpi-io/ioreq_c2f.c b/src/mpi/romio/mpi-io/ioreq_c2f.c
index 6791b94..64b615d 100644
--- a/src/mpi/romio/mpi-io/ioreq_c2f.c
+++ b/src/mpi/romio/mpi-io/ioreq_c2f.c
@@ -56,7 +56,7 @@ MPI_Fint MPIO_Request_c2f(MPIO_Request request)
 	    return (MPI_Fint) 0;
     }
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     if (!ADIOI_Reqtable) {
 	ADIOI_Reqtable_max = 1024;
 	ADIOI_Reqtable = (MPIO_Request *)
@@ -75,7 +75,7 @@ MPI_Fint MPIO_Request_c2f(MPIO_Request request)
     ADIOI_Reqtable_ptr++;
     ADIOI_Reqtable[ADIOI_Reqtable_ptr] = request;
 
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return (MPI_Fint) ADIOI_Reqtable_ptr;
 #endif
 }
diff --git a/src/mpi/romio/mpi-io/ioreq_f2c.c b/src/mpi/romio/mpi-io/ioreq_f2c.c
index a264cda..69bed05 100644
--- a/src/mpi/romio/mpi-io/ioreq_f2c.c
+++ b/src/mpi/romio/mpi-io/ioreq_f2c.c
@@ -49,7 +49,7 @@ MPIO_Request MPIO_Request_f2c(MPI_Fint request)
     return (MPIO_Request) request;
 #else
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     
     if (!request) {
 	return MPIO_REQUEST_NULL;
@@ -65,7 +65,7 @@ MPIO_Request MPIO_Request_f2c(MPI_Fint request)
     /* --END ERROR HANDLING-- */
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return ADIOI_Reqtable[request];
 #endif
 }
diff --git a/src/mpi/romio/mpi-io/iotest.c b/src/mpi/romio/mpi-io/iotest.c
index d85fb94..2aa7302 100644
--- a/src/mpi/romio/mpi-io/iotest.c
+++ b/src/mpi/romio/mpi-io/iotest.c
@@ -56,7 +56,7 @@ int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status)
     }
 #endif /* MPI_hpux */
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     if (*request == MPIO_REQUEST_NULL) {
 	    error_code = MPI_SUCCESS;
@@ -89,7 +89,7 @@ int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status)
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 }
 #endif
diff --git a/src/mpi/romio/mpi-io/iotestall.c b/src/mpi/romio/mpi-io/iotestall.c
index 5572061..2583294 100644
--- a/src/mpi/romio/mpi-io/iotestall.c
+++ b/src/mpi/romio/mpi-io/iotestall.c
@@ -34,7 +34,7 @@ int MPIO_Testall(int count, MPIO_Request requests[], int *flag,
     int done, i, err; 
     MPIU_THREADPRIV_DECL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     if (count == 1)  {
 	    err = MPIO_Test( requests, flag, statuses );
 	    goto fn_exit;
@@ -71,7 +71,7 @@ int MPIO_Testall(int count, MPIO_Request requests[], int *flag,
 
     err = MPI_SUCCESS;
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return err;
 }
 
diff --git a/src/mpi/romio/mpi-io/iotestany.c b/src/mpi/romio/mpi-io/iotestany.c
index e7d12df..dfa4581 100644
--- a/src/mpi/romio/mpi-io/iotestany.c
+++ b/src/mpi/romio/mpi-io/iotestany.c
@@ -34,7 +34,7 @@ int MPIO_Testany(int count, MPIO_Request requests[], int *index,
     int i, err; 
     MPIU_THREADPRIV_DECL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     if (count == 1) {
 	err = MPIO_Test( requests, flag, status );
@@ -76,6 +76,6 @@ int MPIO_Testany(int count, MPIO_Request requests[], int *index,
 
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return err;
 }
diff --git a/src/mpi/romio/mpi-io/iotestsome.c b/src/mpi/romio/mpi-io/iotestsome.c
index c9395a9..5526d6b 100644
--- a/src/mpi/romio/mpi-io/iotestsome.c
+++ b/src/mpi/romio/mpi-io/iotestsome.c
@@ -35,7 +35,7 @@ int MPIO_Testsome(int count, MPIO_Request requests[], int *outcount,
     int flag;
     MPIU_THREADPRIV_DECL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     if (count == 1) {
 	err = MPIO_Test( requests, &flag, statuses );
@@ -81,6 +81,6 @@ int MPIO_Testsome(int count, MPIO_Request requests[], int *outcount,
 
 fn_exit:
 
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return err;
 }
diff --git a/src/mpi/romio/mpi-io/iowait.c b/src/mpi/romio/mpi-io/iowait.c
index 0b8220d..28392ee 100644
--- a/src/mpi/romio/mpi-io/iowait.c
+++ b/src/mpi/romio/mpi-io/iowait.c
@@ -56,7 +56,7 @@ int MPIO_Wait(MPIO_Request *request, MPI_Status *status)
     }
 #endif /* MPI_hpux */
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     if (*request == MPIO_REQUEST_NULL) {
 	    error_code = MPI_SUCCESS;
@@ -90,7 +90,7 @@ int MPIO_Wait(MPIO_Request *request, MPI_Status *status)
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 }
 #endif
diff --git a/src/mpi/romio/mpi-io/iowaitall.c b/src/mpi/romio/mpi-io/iowaitall.c
index b03208b..a45700f 100644
--- a/src/mpi/romio/mpi-io/iowaitall.c
+++ b/src/mpi/romio/mpi-io/iowaitall.c
@@ -33,7 +33,7 @@ int MPIO_Waitall( int count, MPIO_Request requests[], MPI_Status statuses[] )
     int notdone, i, flag, err; 
     MPIU_THREADPRIV_DECL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     if (count == 1)  {
 	    err = MPIO_Wait(requests, statuses);
@@ -68,7 +68,7 @@ int MPIO_Waitall( int count, MPIO_Request requests[], MPI_Status statuses[] )
     err = MPI_SUCCESS;
 fn_exit:
 
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return err;
 }
 
diff --git a/src/mpi/romio/mpi-io/iowaitany.c b/src/mpi/romio/mpi-io/iowaitany.c
index 84fa2b6..853ff6f 100644
--- a/src/mpi/romio/mpi-io/iowaitany.c
+++ b/src/mpi/romio/mpi-io/iowaitany.c
@@ -34,7 +34,7 @@ int MPIO_Waitany(int count, MPIO_Request requests[], int *index,
     int i, flag, err; 
     MPIU_THREADPRIV_DECL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     if (count == 1) {
 	err = MPIO_Wait( requests, status );
@@ -78,7 +78,7 @@ int MPIO_Waitany(int count, MPIO_Request requests[], int *index,
     } while (flag == 0);
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return err;
 }
diff --git a/src/mpi/romio/mpi-io/iowaitsome.c b/src/mpi/romio/mpi-io/iowaitsome.c
index 7145fb9..c1dc4b3 100644
--- a/src/mpi/romio/mpi-io/iowaitsome.c
+++ b/src/mpi/romio/mpi-io/iowaitsome.c
@@ -34,7 +34,7 @@ int MPIO_Waitsome(int count, MPIO_Request requests[], int *outcount,
     int i, flag, err; 
     MPIU_THREADPRIV_DECL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     if (count == 1) {
 	err = MPIO_Wait( requests, statuses );
@@ -76,6 +76,6 @@ int MPIO_Waitsome(int count, MPIO_Request requests[], int *outcount,
     } while (*outcount == 0);
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return err;
 }
diff --git a/src/mpi/romio/mpi-io/iread.c b/src/mpi/romio/mpi-io/iread.c
index 4779dd1..8225ccf 100644
--- a/src/mpi/romio/mpi-io/iread.c
+++ b/src/mpi/romio/mpi-io/iread.c
@@ -83,7 +83,7 @@ int MPIOI_File_iread(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *bu
     ADIO_Offset off, bufsize;
     MPI_Offset nbytes=0;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -154,7 +154,7 @@ int MPIOI_File_iread(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *bu
 			   offset, request, &error_code); 
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/iread_all.c b/src/mpi/romio/mpi-io/iread_all.c
index 5cd8b60..6679f19 100644
--- a/src/mpi/romio/mpi-io/iread_all.c
+++ b/src/mpi/romio/mpi-io/iread_all.c
@@ -89,7 +89,7 @@ int MPIOI_File_iread_all(MPI_File fh,
     ADIO_File adio_fh;
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -142,7 +142,7 @@ int MPIOI_File_iread_all(MPI_File fh,
     }
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/iread_sh.c b/src/mpi/romio/mpi-io/iread_sh.c
index 7e76fb3..040e10b 100644
--- a/src/mpi/romio/mpi-io/iread_sh.c
+++ b/src/mpi/romio/mpi-io/iread_sh.c
@@ -55,7 +55,7 @@ int MPI_File_iread_shared(MPI_File fh, void *buf, int count,
     ADIO_Offset off, shared_fp;
     MPI_Offset nbytes=0;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -134,7 +134,7 @@ int MPI_File_iread_shared(MPI_File fh, void *buf, int count,
     /* --END ERROR HANDLING-- */
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 }
 #endif
diff --git a/src/mpi/romio/mpi-io/iwrite.c b/src/mpi/romio/mpi-io/iwrite.c
index 5d8eb84..ffa5713 100644
--- a/src/mpi/romio/mpi-io/iwrite.c
+++ b/src/mpi/romio/mpi-io/iwrite.c
@@ -90,7 +90,7 @@ int MPIOI_File_iwrite(MPI_File fh,
     ADIO_File adio_fh;
     MPI_Offset nbytes=0;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     adio_fh = MPIO_File_resolve(fh);
 
     /* --BEGIN ERROR HANDLING-- */
@@ -162,7 +162,7 @@ int MPIOI_File_iwrite(MPI_File fh,
 			   offset, request, &error_code);
     }
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 }
 #endif
diff --git a/src/mpi/romio/mpi-io/iwrite_all.c b/src/mpi/romio/mpi-io/iwrite_all.c
index 3c36867..bc7dda5 100644
--- a/src/mpi/romio/mpi-io/iwrite_all.c
+++ b/src/mpi/romio/mpi-io/iwrite_all.c
@@ -84,7 +84,7 @@ int MPIOI_File_iwrite_all(MPI_File fh,
     void *e32buf=NULL;
     const void *xbuf=NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -131,7 +131,7 @@ int MPIOI_File_iwrite_all(MPI_File fh,
 
 fn_exit:
     if (e32buf != NULL) ADIOI_Free(e32buf);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/iwrite_sh.c b/src/mpi/romio/mpi-io/iwrite_sh.c
index eff87c8..9c9cc8b 100644
--- a/src/mpi/romio/mpi-io/iwrite_sh.c
+++ b/src/mpi/romio/mpi-io/iwrite_sh.c
@@ -55,7 +55,7 @@ int MPI_File_iwrite_shared(MPI_File fh, ROMIO_CONST void *buf, int count,
     ADIO_Offset off, shared_fp;
     static char myname[] = "MPI_FILE_IWRITE_SHARED";
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -114,7 +114,7 @@ int MPI_File_iwrite_shared(MPI_File fh, ROMIO_CONST void *buf, int count,
 			   shared_fp, request, &error_code); 
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/open.c b/src/mpi/romio/mpi-io/open.c
index 45b7fd9..940cd3d 100644
--- a/src/mpi/romio/mpi-io/open.c
+++ b/src/mpi/romio/mpi-io/open.c
@@ -59,7 +59,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode,
     HPMP_IO_OPEN_START(fl_xmpi, comm);
 #endif /* MPI_hpux */
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     /* --BEGIN ERROR HANDLING-- */
     MPIO_CHECK_COMM(comm, myname, error_code);
@@ -198,7 +198,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode,
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/romio/mpi-io/prealloc.c b/src/mpi/romio/mpi-io/prealloc.c
index 8784049..a8e3acc 100644
--- a/src/mpi/romio/mpi-io/prealloc.c
+++ b/src/mpi/romio/mpi-io/prealloc.c
@@ -48,7 +48,7 @@ int MPI_File_preallocate(MPI_File fh, MPI_Offset size)
 		  adio_fh, MPI_DATATYPE_NULL, -1);
 #endif /* MPI_hpux */
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -99,7 +99,7 @@ int MPI_File_preallocate(MPI_File fh, MPI_Offset size)
 
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     /* TODO: bcast result? */
     if (!mynod) return error_code;
diff --git a/src/mpi/romio/mpi-io/read.c b/src/mpi/romio/mpi-io/read.c
index adbdf97..08828c3 100644
--- a/src/mpi/romio/mpi-io/read.c
+++ b/src/mpi/romio/mpi-io/read.c
@@ -79,7 +79,7 @@ int MPIOI_File_read(MPI_File fh,
     ADIO_Offset off, bufsize;
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -180,7 +180,7 @@ int MPIOI_File_read(MPI_File fh,
     }
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_all.c b/src/mpi/romio/mpi-io/read_all.c
index babd719..2579047 100644
--- a/src/mpi/romio/mpi-io/read_all.c
+++ b/src/mpi/romio/mpi-io/read_all.c
@@ -80,7 +80,7 @@ int MPIOI_File_read_all(MPI_File fh,
     ADIO_File adio_fh;
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -135,7 +135,7 @@ int MPIOI_File_read_all(MPI_File fh,
     }
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_allb.c b/src/mpi/romio/mpi-io/read_allb.c
index 80c79a4..59e206a 100644
--- a/src/mpi/romio/mpi-io/read_allb.c
+++ b/src/mpi/romio/mpi-io/read_allb.c
@@ -67,7 +67,7 @@ int MPIOI_File_read_all_begin(MPI_File fh,
     ADIO_File adio_fh;
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -132,7 +132,7 @@ int MPIOI_File_read_all_begin(MPI_File fh,
     }
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_alle.c b/src/mpi/romio/mpi-io/read_alle.c
index 7cb5ef0..a77b54c 100644
--- a/src/mpi/romio/mpi-io/read_alle.c
+++ b/src/mpi/romio/mpi-io/read_alle.c
@@ -60,7 +60,7 @@ int MPIOI_File_read_all_end(MPI_File fh,
 
     MPIU_UNREFERENCED_ARG(buf);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -83,7 +83,7 @@ int MPIOI_File_read_all_end(MPI_File fh,
     adio_fh->split_coll_count = 0;
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_ord.c b/src/mpi/romio/mpi-io/read_ord.c
index dd6aede..6badd0a 100644
--- a/src/mpi/romio/mpi-io/read_ord.c
+++ b/src/mpi/romio/mpi-io/read_ord.c
@@ -53,7 +53,7 @@ int MPI_File_read_ordered(MPI_File fh, void *buf, int count,
     ADIO_Offset shared_fp=0;
     ADIO_File adio_fh;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -104,7 +104,7 @@ int MPI_File_read_ordered(MPI_File fh, void *buf, int count,
     /* --END ERROR HANDLING-- */
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     /* FIXME: Check for error code from ReadStridedColl? */
     return error_code;
diff --git a/src/mpi/romio/mpi-io/read_ordb.c b/src/mpi/romio/mpi-io/read_ordb.c
index 488d038..1f1c9d0 100644
--- a/src/mpi/romio/mpi-io/read_ordb.c
+++ b/src/mpi/romio/mpi-io/read_ordb.c
@@ -50,7 +50,7 @@ int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count,
     static char myname[] = "MPI_FILE_READ_ORDERED_BEGIN";
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -131,7 +131,7 @@ int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count,
     }
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_orde.c b/src/mpi/romio/mpi-io/read_orde.c
index 5220cdc..7c22247 100644
--- a/src/mpi/romio/mpi-io/read_orde.c
+++ b/src/mpi/romio/mpi-io/read_orde.c
@@ -45,7 +45,7 @@ int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status)
 
     MPIU_UNREFERENCED_ARG(buf);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -69,7 +69,7 @@ int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status)
     adio_fh->split_coll_count = 0;
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_sh.c b/src/mpi/romio/mpi-io/read_sh.c
index 4040739..e3a3e5b 100644
--- a/src/mpi/romio/mpi-io/read_sh.c
+++ b/src/mpi/romio/mpi-io/read_sh.c
@@ -52,7 +52,7 @@ int MPI_File_read_shared(MPI_File fh, void *buf, int count,
     ADIO_File adio_fh;
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -149,7 +149,7 @@ int MPI_File_read_shared(MPI_File fh, void *buf, int count,
 	ADIOI_Free(e32_buf);
     }
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/register_datarep.c b/src/mpi/romio/mpi-io/register_datarep.c
index 3029f5d..2c20102 100644
--- a/src/mpi/romio/mpi-io/register_datarep.c
+++ b/src/mpi/romio/mpi-io/register_datarep.c
@@ -62,7 +62,7 @@ int MPI_Register_datarep(ROMIO_CONST char *datarep,
     ADIOI_Datarep *adio_datarep;
     static char myname[] = "MPI_REGISTER_DATAREP";
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     /* --BEGIN ERROR HANDLING-- */
     /* check datarep name (use strlen instead of strnlen because
@@ -139,7 +139,7 @@ int MPI_Register_datarep(ROMIO_CONST char *datarep,
     error_code = MPI_SUCCESS;
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/seek.c b/src/mpi/romio/mpi-io/seek.c
index 0b1b057..be4f746 100644
--- a/src/mpi/romio/mpi-io/seek.c
+++ b/src/mpi/romio/mpi-io/seek.c
@@ -49,7 +49,7 @@ int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence)
     HPMP_IO_START(fl_xmpi, BLKMPIFILESEEK, TRDTBLOCK, adio_fh, MPI_DATATYPE_NULL, -1);
 #endif /* MPI_hpux */
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -134,6 +134,6 @@ int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence)
     error_code = MPI_SUCCESS;
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/seek_sh.c b/src/mpi/romio/mpi-io/seek_sh.c
index ea49fad..141bcf2 100644
--- a/src/mpi/romio/mpi-io/seek_sh.c
+++ b/src/mpi/romio/mpi-io/seek_sh.c
@@ -41,7 +41,7 @@ int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence)
     MPI_Offset curr_offset, eof_offset, tmp_offset;
     ADIO_File adio_fh;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -178,7 +178,7 @@ int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence)
     error_code = MPI_SUCCESS;
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/set_atom.c b/src/mpi/romio/mpi-io/set_atom.c
index 0e60ba7..d338eb5 100644
--- a/src/mpi/romio/mpi-io/set_atom.c
+++ b/src/mpi/romio/mpi-io/set_atom.c
@@ -41,7 +41,7 @@ int MPI_File_set_atomicity(MPI_File fh, int flag)
     ADIO_Fcntl_t *fcntl_struct;
     ADIO_File adio_fh;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -86,6 +86,6 @@ int MPI_File_set_atomicity(MPI_File fh, int flag)
     ADIOI_Free(fcntl_struct);
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/set_errh.c b/src/mpi/romio/mpi-io/set_errh.c
index 07641ed..eec14da 100644
--- a/src/mpi/romio/mpi-io/set_errh.c
+++ b/src/mpi/romio/mpi-io/set_errh.c
@@ -42,7 +42,7 @@ int MPI_File_set_errhandler(MPI_File mpi_fh, MPI_Errhandler errhandler)
     ADIO_File fh;
     MPIU_THREADPRIV_DECL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     if (mpi_fh == MPI_FILE_NULL) {
 	ADIOI_DFLT_ERR_HANDLER = errhandler;
@@ -71,6 +71,6 @@ int MPI_File_set_errhandler(MPI_File mpi_fh, MPI_Errhandler errhandler)
     }
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/set_info.c b/src/mpi/romio/mpi-io/set_info.c
index c05b0f5..64e5227 100644
--- a/src/mpi/romio/mpi-io/set_info.c
+++ b/src/mpi/romio/mpi-io/set_info.c
@@ -40,7 +40,7 @@ int MPI_File_set_info(MPI_File fh, MPI_Info info)
     static char myname[] = "MPI_FILE_SET_INFO";
     ADIO_File adio_fh;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -58,7 +58,7 @@ fn_exit:
 	error_code = MPIO_Err_return_file(adio_fh, error_code);
     /* --END ERROR HANDLING-- */
 
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 fn_fail:
diff --git a/src/mpi/romio/mpi-io/set_size.c b/src/mpi/romio/mpi-io/set_size.c
index 9e3094f..b1f4af3 100644
--- a/src/mpi/romio/mpi-io/set_size.c
+++ b/src/mpi/romio/mpi-io/set_size.c
@@ -48,7 +48,7 @@ int MPI_File_set_size(MPI_File fh, MPI_Offset size)
 		  MPI_DATATYPE_NULL, -1);
 #endif /* MPI_hpux */
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -99,7 +99,7 @@ int MPI_File_set_size(MPI_File fh, MPI_Offset size)
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/set_view.c b/src/mpi/romio/mpi-io/set_view.c
index 5470178..325ec56 100644
--- a/src/mpi/romio/mpi-io/set_view.c
+++ b/src/mpi/romio/mpi-io/set_view.c
@@ -48,7 +48,7 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
     ADIO_Offset shared_fp, byte_off;
     ADIO_File adio_fh;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -193,7 +193,7 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
 	adio_fh->is_external32 = 1;
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 fn_fail:
diff --git a/src/mpi/romio/mpi-io/write.c b/src/mpi/romio/mpi-io/write.c
index b6b92a5..51541bf 100644
--- a/src/mpi/romio/mpi-io/write.c
+++ b/src/mpi/romio/mpi-io/write.c
@@ -80,7 +80,7 @@ int MPIOI_File_write(MPI_File fh,
     void *e32buf=NULL;
     const void *xbuf=NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -179,7 +179,7 @@ int MPIOI_File_write(MPI_File fh,
 
 fn_exit:
     if (e32buf!= NULL) ADIOI_Free(e32buf);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/write_all.c b/src/mpi/romio/mpi-io/write_all.c
index 1957271..eea9ae8 100644
--- a/src/mpi/romio/mpi-io/write_all.c
+++ b/src/mpi/romio/mpi-io/write_all.c
@@ -81,7 +81,7 @@ int MPIOI_File_write_all(MPI_File fh,
     void *e32buf=NULL;
     const void *xbuf=NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -127,7 +127,7 @@ int MPIOI_File_write_all(MPI_File fh,
 
 fn_exit:
     if (e32buf != NULL) ADIOI_Free(e32buf);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/write_allb.c b/src/mpi/romio/mpi-io/write_allb.c
index 7abe14d..6f66772 100644
--- a/src/mpi/romio/mpi-io/write_allb.c
+++ b/src/mpi/romio/mpi-io/write_allb.c
@@ -67,7 +67,7 @@ int MPIOI_File_write_all_begin(MPI_File fh,
     void *e32buf=NULL;
     const void *xbuf=NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -125,7 +125,7 @@ int MPIOI_File_write_all_begin(MPI_File fh,
 
 fn_exit:
     if ( e32buf != NULL) ADIOI_Free(e32buf);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/write_alle.c b/src/mpi/romio/mpi-io/write_alle.c
index 6fd684a..79488cc 100644
--- a/src/mpi/romio/mpi-io/write_alle.c
+++ b/src/mpi/romio/mpi-io/write_alle.c
@@ -59,7 +59,7 @@ int MPIOI_File_write_all_end(MPI_File fh,
 
     MPIU_UNREFERENCED_ARG(buf);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -88,7 +88,7 @@ int MPIOI_File_write_all_end(MPI_File fh,
     error_code = MPI_SUCCESS;
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/write_ord.c b/src/mpi/romio/mpi-io/write_ord.c
index 94aec40..d8aa198 100644
--- a/src/mpi/romio/mpi-io/write_ord.c
+++ b/src/mpi/romio/mpi-io/write_ord.c
@@ -56,7 +56,7 @@ int MPI_File_write_ordered(MPI_File fh, ROMIO_CONST void *buf, int count,
     void *e32buf=NULL;
     const void *xbuf;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -120,7 +120,7 @@ int MPI_File_write_ordered(MPI_File fh, ROMIO_CONST void *buf, int count,
 
 fn_exit:
     if (e32buf != NULL) ADIOI_Free(e32buf);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     /* FIXME: Check for error code from WriteStridedColl? */
     return error_code;
diff --git a/src/mpi/romio/mpi-io/write_ordb.c b/src/mpi/romio/mpi-io/write_ordb.c
index 5584640..b741c49 100644
--- a/src/mpi/romio/mpi-io/write_ordb.c
+++ b/src/mpi/romio/mpi-io/write_ordb.c
@@ -52,7 +52,7 @@ int MPI_File_write_ordered_begin(MPI_File fh, ROMIO_CONST void *buf, int count,
     void *e32buf = NULL;
     const void *xbuf=NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -125,7 +125,7 @@ int MPI_File_write_ordered_begin(MPI_File fh, ROMIO_CONST void *buf, int count,
     /* --END ERROR HANDLING-- */
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     /* FIXME: Check for error code from WriteStridedColl? */
     return error_code;
diff --git a/src/mpi/romio/mpi-io/write_orde.c b/src/mpi/romio/mpi-io/write_orde.c
index 8500b9a..de28a08 100644
--- a/src/mpi/romio/mpi-io/write_orde.c
+++ b/src/mpi/romio/mpi-io/write_orde.c
@@ -45,7 +45,7 @@ int MPI_File_write_ordered_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *s
 
     MPIU_UNREFERENCED_ARG(buf);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -70,6 +70,6 @@ int MPI_File_write_ordered_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *s
 
 
 fn_exit:
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/mpi-io/write_sh.c b/src/mpi/romio/mpi-io/write_sh.c
index b21d1f4..3e9cc6b 100644
--- a/src/mpi/romio/mpi-io/write_sh.c
+++ b/src/mpi/romio/mpi-io/write_sh.c
@@ -54,7 +54,7 @@ int MPI_File_write_shared(MPI_File fh, ROMIO_CONST void *buf, int count,
     void *e32buf = NULL;
     const void *xbuf = NULL;
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -144,6 +144,6 @@ int MPI_File_write_shared(MPI_File fh, ROMIO_CONST void *buf, int count,
 
 fn_exit:
     if (e32buf != NULL) ADIOI_Free(e32buf);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return error_code;
 }
diff --git a/src/mpi/spawn/close_port.c b/src/mpi/spawn/close_port.c
index 95a8d5c..8c3b2f1 100644
--- a/src/mpi/spawn/close_port.c
+++ b/src/mpi/spawn/close_port.c
@@ -57,7 +57,7 @@ int MPI_Close_port(const char *port_name)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_CLOSE_PORT);
 
     /* ... body of routine ...  */
@@ -69,7 +69,7 @@ int MPI_Close_port(const char *port_name)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_CLOSE_PORT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_accept.c b/src/mpi/spawn/comm_accept.c
index 389874c..4fc7bdc 100644
--- a/src/mpi/spawn/comm_accept.c
+++ b/src/mpi/spawn/comm_accept.c
@@ -75,7 +75,7 @@ int MPI_Comm_accept(const char *port_name, MPI_Info info, int root, MPI_Comm com
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_ACCEPT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Comm_accept(const char *port_name, MPI_Info info, int root, MPI_Comm com
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_ACCEPT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_connect.c b/src/mpi/spawn/comm_connect.c
index 2cd0e21..88bdfd6 100644
--- a/src/mpi/spawn/comm_connect.c
+++ b/src/mpi/spawn/comm_connect.c
@@ -74,7 +74,7 @@ int MPI_Comm_connect(const char *port_name, MPI_Info info, int root, MPI_Comm co
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_CONNECT);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Comm_connect(const char *port_name, MPI_Info info, int root, MPI_Comm co
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_CONNECT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_disconnect.c b/src/mpi/spawn/comm_disconnect.c
index 08c30b4..2957345 100644
--- a/src/mpi/spawn/comm_disconnect.c
+++ b/src/mpi/spawn/comm_disconnect.c
@@ -59,7 +59,7 @@ int MPI_Comm_disconnect(MPI_Comm * comm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_DISCONNECT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -132,7 +132,7 @@ int MPI_Comm_disconnect(MPI_Comm * comm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_DISCONNECT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_join.c b/src/mpi/spawn/comm_join.c
index 7793117..334a6c8 100644
--- a/src/mpi/spawn/comm_join.c
+++ b/src/mpi/spawn/comm_join.c
@@ -144,7 +144,7 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_JOIN);
 
     /* ... body of routine ...  */
@@ -186,7 +186,7 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_JOIN);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_spawn.c b/src/mpi/spawn/comm_spawn.c
index c596d7c..77e4386 100644
--- a/src/mpi/spawn/comm_spawn.c
+++ b/src/mpi/spawn/comm_spawn.c
@@ -72,7 +72,7 @@ int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info inf
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SPAWN);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -133,7 +133,7 @@ int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info inf
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SPAWN);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_spawn_multiple.c b/src/mpi/spawn/comm_spawn_multiple.c
index 3d65fe3..b45fa87 100644
--- a/src/mpi/spawn/comm_spawn_multiple.c
+++ b/src/mpi/spawn/comm_spawn_multiple.c
@@ -78,7 +78,7 @@ int MPI_Comm_spawn_multiple(int count, char *array_of_commands[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SPAWN_MULTIPLE);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -151,7 +151,7 @@ int MPI_Comm_spawn_multiple(int count, char *array_of_commands[],
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SPAWN_MULTIPLE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/open_port.c b/src/mpi/spawn/open_port.c
index 3c3fcb5..b64c1ed 100644
--- a/src/mpi/spawn/open_port.c
+++ b/src/mpi/spawn/open_port.c
@@ -73,7 +73,7 @@ int MPI_Open_port(MPI_Info info, char *port_name)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_OPEN_PORT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -112,7 +112,7 @@ int MPI_Open_port(MPI_Info info, char *port_name)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_OPEN_PORT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/publish_name.c b/src/mpi/spawn/publish_name.c
index ad8f753..de66c00 100644
--- a/src/mpi/spawn/publish_name.c
+++ b/src/mpi/spawn/publish_name.c
@@ -62,7 +62,7 @@ int MPI_Publish_name(const char *service_name, MPI_Info info, const char *port_n
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_PUBLISH_NAME);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -122,7 +122,7 @@ int MPI_Publish_name(const char *service_name, MPI_Info info, const char *port_n
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_PUBLISH_NAME);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/spawn/unpublish_name.c b/src/mpi/spawn/unpublish_name.c
index 54bbe59..47bd5a2 100644
--- a/src/mpi/spawn/unpublish_name.c
+++ b/src/mpi/spawn/unpublish_name.c
@@ -59,7 +59,7 @@ int MPI_Unpublish_name(const char *service_name, MPI_Info info, const char *port
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);  
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);  
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_UNPUBLISH_NAME);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -122,7 +122,7 @@ int MPI_Unpublish_name(const char *service_name, MPI_Info info, const char *port
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_UNPUBLISH_NAME);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/topo/cart_create.c b/src/mpi/topo/cart_create.c
index ef1e73f..564d09b 100644
--- a/src/mpi/topo/cart_create.c
+++ b/src/mpi/topo/cart_create.c
@@ -245,7 +245,7 @@ int MPI_Cart_create(MPI_Comm comm_old, int ndims, const int dims[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_CART_CREATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -307,7 +307,7 @@ int MPI_Cart_create(MPI_Comm comm_old, int ndims, const int dims[],
 
  fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_CART_CREATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
  fn_fail:
diff --git a/src/mpi/topo/cart_sub.c b/src/mpi/topo/cart_sub.c
index e163633..84398f0 100644
--- a/src/mpi/topo/cart_sub.c
+++ b/src/mpi/topo/cart_sub.c
@@ -68,7 +68,7 @@ int MPI_Cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_CART_SUB);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -199,7 +199,7 @@ int MPI_Cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_CART_SUB);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/topo/dist_gr_create.c b/src/mpi/topo/dist_gr_create.c
index 170c587..c27f70e 100644
--- a/src/mpi/topo/dist_gr_create.c
+++ b/src/mpi/topo/dist_gr_create.c
@@ -99,7 +99,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_DIST_GRAPH_CREATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -408,7 +408,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
     MPIU_CHKLMEM_FREEALL();
 
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_DIST_GRAPH_CREATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/topo/dist_gr_create_adj.c b/src/mpi/topo/dist_gr_create_adj.c
index a6df38b..e90fc08 100644
--- a/src/mpi/topo/dist_gr_create_adj.c
+++ b/src/mpi/topo/dist_gr_create_adj.c
@@ -84,7 +84,7 @@ int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_DIST_GRAPH_CREATE_ADJACENT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -182,7 +182,7 @@ int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old,
     /* ... end of body of routine ... */
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_DIST_GRAPH_CREATE_ADJACENT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/topo/dist_gr_neighb.c b/src/mpi/topo/dist_gr_neighb.c
index 8d1d261..4246bcc 100644
--- a/src/mpi/topo/dist_gr_neighb.c
+++ b/src/mpi/topo/dist_gr_neighb.c
@@ -97,7 +97,7 @@ int MPI_Dist_graph_neighbors(MPI_Comm comm,
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
     /* FIXME: Why does this routine need a CS */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_DIST_GRAPH_NEIGHBORS);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -144,7 +144,7 @@ int MPI_Dist_graph_neighbors(MPI_Comm comm,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_DIST_GRAPH_NEIGHBORS);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/topo/dist_gr_neighb_count.c b/src/mpi/topo/dist_gr_neighb_count.c
index 94087ea..caddf10 100644
--- a/src/mpi/topo/dist_gr_neighb_count.c
+++ b/src/mpi/topo/dist_gr_neighb_count.c
@@ -82,7 +82,7 @@ int MPI_Dist_graph_neighbors_count(MPI_Comm comm, int *indegree, int *outdegree,
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
     /* FIXME: Why does this routine require a CS? */
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_DIST_GRAPH_NEIGHBORS_COUNT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -124,7 +124,7 @@ int MPI_Dist_graph_neighbors_count(MPI_Comm comm, int *indegree, int *outdegree,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_DIST_GRAPH_NEIGHBORS_COUNT);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/topo/graphcreate.c b/src/mpi/topo/graphcreate.c
index b97f31d..0da6e25 100644
--- a/src/mpi/topo/graphcreate.c
+++ b/src/mpi/topo/graphcreate.c
@@ -177,7 +177,7 @@ int MPI_Graph_create(MPI_Comm comm_old, int nnodes, const int indx[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GRAPH_CREATE);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -310,7 +310,7 @@ int MPI_Graph_create(MPI_Comm comm_old, int nnodes, const int indx[],
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GRAPH_CREATE);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/topo/inhb_allgather.c b/src/mpi/topo/inhb_allgather.c
index bfe9254..24da679 100644
--- a/src/mpi/topo/inhb_allgather.c
+++ b/src/mpi/topo/inhb_allgather.c
@@ -146,7 +146,7 @@ int MPI_Ineighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sen
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_INEIGHBOR_ALLGATHER);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INEIGHBOR_ALLGATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -208,7 +208,7 @@ int MPI_Ineighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sen
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INEIGHBOR_ALLGATHER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/inhb_allgatherv.c b/src/mpi/topo/inhb_allgatherv.c
index bcad5a7..85f6be3 100644
--- a/src/mpi/topo/inhb_allgatherv.c
+++ b/src/mpi/topo/inhb_allgatherv.c
@@ -151,7 +151,7 @@ int MPI_Ineighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype se
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_INEIGHBOR_ALLGATHERV);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INEIGHBOR_ALLGATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -214,7 +214,7 @@ int MPI_Ineighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype se
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INEIGHBOR_ALLGATHERV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/inhb_alltoall.c b/src/mpi/topo/inhb_alltoall.c
index d1fbb46..a0eb573 100644
--- a/src/mpi/topo/inhb_alltoall.c
+++ b/src/mpi/topo/inhb_alltoall.c
@@ -152,7 +152,7 @@ int MPI_Ineighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype send
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_INEIGHBOR_ALLTOALL);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INEIGHBOR_ALLTOALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -214,7 +214,7 @@ int MPI_Ineighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype send
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INEIGHBOR_ALLTOALL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/inhb_alltoallv.c b/src/mpi/topo/inhb_alltoallv.c
index 6b7bb75..70ce0e7 100644
--- a/src/mpi/topo/inhb_alltoallv.c
+++ b/src/mpi/topo/inhb_alltoallv.c
@@ -157,7 +157,7 @@ int MPI_Ineighbor_alltoallv(const void *sendbuf, const int sendcounts[], const i
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_INEIGHBOR_ALLTOALLV);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INEIGHBOR_ALLTOALLV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -218,7 +218,7 @@ int MPI_Ineighbor_alltoallv(const void *sendbuf, const int sendcounts[], const i
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INEIGHBOR_ALLTOALLV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/inhb_alltoallw.c b/src/mpi/topo/inhb_alltoallw.c
index 0644f48..a489c93 100644
--- a/src/mpi/topo/inhb_alltoallw.c
+++ b/src/mpi/topo/inhb_alltoallw.c
@@ -148,7 +148,7 @@ int MPI_Ineighbor_alltoallw(const void *sendbuf, const int sendcounts[], const M
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_INEIGHBOR_ALLTOALLW);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INEIGHBOR_ALLTOALLW);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -191,7 +191,7 @@ int MPI_Ineighbor_alltoallw(const void *sendbuf, const int sendcounts[], const M
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INEIGHBOR_ALLTOALLW);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/nhb_allgather.c b/src/mpi/topo/nhb_allgather.c
index 3ef42ea..e0837ca 100644
--- a/src/mpi/topo/nhb_allgather.c
+++ b/src/mpi/topo/nhb_allgather.c
@@ -106,7 +106,7 @@ int MPI_Neighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype send
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_NEIGHBOR_ALLGATHER);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_NEIGHBOR_ALLGATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -163,7 +163,7 @@ int MPI_Neighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype send
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_NEIGHBOR_ALLGATHER);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/nhb_allgatherv.c b/src/mpi/topo/nhb_allgatherv.c
index 97b621d..6320c74 100644
--- a/src/mpi/topo/nhb_allgatherv.c
+++ b/src/mpi/topo/nhb_allgatherv.c
@@ -107,7 +107,7 @@ int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sen
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_NEIGHBOR_ALLGATHERV);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_NEIGHBOR_ALLGATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -164,7 +164,7 @@ int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sen
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_NEIGHBOR_ALLGATHERV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/nhb_alltoall.c b/src/mpi/topo/nhb_alltoall.c
index c6629d8..1dff5c7 100644
--- a/src/mpi/topo/nhb_alltoall.c
+++ b/src/mpi/topo/nhb_alltoall.c
@@ -110,7 +110,7 @@ int MPI_Neighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendt
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_NEIGHBOR_ALLTOALL);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_NEIGHBOR_ALLTOALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -167,7 +167,7 @@ int MPI_Neighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendt
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_NEIGHBOR_ALLTOALL);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/nhb_alltoallv.c b/src/mpi/topo/nhb_alltoallv.c
index 1233985..99e8c80 100644
--- a/src/mpi/topo/nhb_alltoallv.c
+++ b/src/mpi/topo/nhb_alltoallv.c
@@ -105,7 +105,7 @@ int MPI_Neighbor_alltoallv(const void *sendbuf, const int sendcounts[], const in
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_NEIGHBOR_ALLTOALLV);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_NEIGHBOR_ALLTOALLV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -162,7 +162,7 @@ int MPI_Neighbor_alltoallv(const void *sendbuf, const int sendcounts[], const in
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_NEIGHBOR_ALLTOALLV);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/nhb_alltoallw.c b/src/mpi/topo/nhb_alltoallw.c
index f67d187..686c26c 100644
--- a/src/mpi/topo/nhb_alltoallw.c
+++ b/src/mpi/topo/nhb_alltoallw.c
@@ -105,7 +105,7 @@ int MPI_Neighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MP
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_NEIGHBOR_ALLTOALLW);
 
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_NEIGHBOR_ALLTOALLW);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -147,7 +147,7 @@ int MPI_Neighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MP
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_NEIGHBOR_ALLTOALLW);
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     return mpi_errno;
 
 fn_fail:
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 c03be70..4ee8677 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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
     found = MPIDI_CH3U_Recvq_DP(req);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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/ch3_isend.c b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
index e1d1b40..862efa7 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
@@ -46,7 +46,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
     hdr_sz = sizeof(MPIDI_CH3_Pkt_t);
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)hdr);
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     in_cs = TRUE;
 
     if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
@@ -88,7 +88,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
 
  fn_exit:
     if (in_cs) {
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     }
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_ISEND);
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
index 35ade04..e89dcc7 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
@@ -63,7 +63,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
     iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)iov[0].MPL_IOV_BUF);
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     in_cs = TRUE;
 
     if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
@@ -185,7 +185,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
 
  fn_exit:
     if (in_cs) {
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     }
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_ISENDV);
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
index 406e170..3ff067f 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
@@ -49,7 +49,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
     hdr_sz = sizeof(MPIDI_CH3_Pkt_t);
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)hdr);
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     in_cs = 1;
 
     if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
@@ -75,7 +75,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
 
  fn_exit:
     if (in_cs) {
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     }
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_ISTARTMSG);
     return mpi_errno;
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
index 12b9469..d4792f0 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
@@ -71,7 +71,7 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
     iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)iov[0].MPL_IOV_BUF);
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     in_cs = TRUE;
 
     if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
@@ -184,7 +184,7 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
 
  fn_exit:
     if (in_cs) {
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     }
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_ISTARTMSGV);
     return mpi_errno;
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
index 9b1e6c7..b2e5d21 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
@@ -304,7 +304,7 @@ int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
         if (progress_hooks[i].func_ptr == NULL) {
@@ -323,7 +323,7 @@ int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
     (*id) = i;
 
   fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
     return mpi_errno;
 
@@ -341,7 +341,7 @@ int MPIDI_CH3I_Progress_deregister_hook(int id)
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS && progress_hooks[id].func_ptr != NULL);
 
@@ -349,7 +349,7 @@ int MPIDI_CH3I_Progress_deregister_hook(int id)
     progress_hooks[id].active = FALSE;
 
   fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
     return mpi_errno;
 
@@ -368,7 +368,7 @@ int MPIDI_CH3I_Progress_activate_hook(int id)
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS &&
                 progress_hooks[id].active == FALSE && progress_hooks[id].func_ptr != NULL);
@@ -378,7 +378,7 @@ int MPIDI_CH3I_Progress_activate_hook(int id)
     MPIU_Assert(total_progress_hook_cnt <= MAX_PROGRESS_HOOKS);
 
   fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
     return mpi_errno;
 
@@ -397,7 +397,7 @@ int MPIDI_CH3I_Progress_deactivate_hook(int id)
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS &&
                 progress_hooks[id].active == TRUE && progress_hooks[id].func_ptr != NULL);
@@ -407,7 +407,7 @@ int MPIDI_CH3I_Progress_deactivate_hook(int id)
     MPIU_Assert(total_progress_hook_cnt >= 0);
 
   fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
     return mpi_errno;
 
@@ -430,7 +430,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS);
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     /* sanity: if this doesn't hold, we can't track our local view of completion safely */
     if (is_blocking) {
@@ -632,7 +632,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
         {
             if (is_blocking) {
                 MPIDI_CH3I_progress_blocked = TRUE;
-                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
+                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
                 /* MPIDCOMM yield is needed because at least the send
                  * functions acquire MPIDCOMM to put things into the send
                  * queues.  Failure to yield could result in a deadlock.
@@ -643,7 +643,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
                  * sections besides the MPIDCOMM CS at this point.
                  * Violating this will probably lead to lock-ordering
                  * deadlocks. */
-                MPID_THREAD_CS_YIELD(POBJ, MPIR_ThreadInfo.global_mutex);
+                MPID_THREAD_CS_YIELD(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
                 MPIDI_CH3I_progress_blocked = FALSE;
                 MPIDI_CH3I_progress_wakeup_signalled = FALSE;
             }
@@ -668,7 +668,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
 #endif
 
  fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS);
     return mpi_errno;
  fn_fail:
@@ -691,7 +691,7 @@ static int MPIDI_CH3I_Progress_delay(unsigned int completion_count)
     /* FIXME should be appropriately abstracted somehow */
 #   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
     {
-        MPID_Thread_cond_wait(&MPIDI_CH3I_progress_completion_cond, &MPIR_ThreadInfo.global_mutex/*MPIDCOMM*/, &err);
+        MPID_Thread_cond_wait(&MPIDI_CH3I_progress_completion_cond, &MPIR_THREAD_GLOBAL_MUTEX/*MPIDCOMM*/, &err);
     }
 #   endif
 
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c b/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
index e5b35d7..53014b0 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
@@ -29,7 +29,7 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
 
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)header);
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     if (!MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq)) /* MT */
     {
@@ -96,7 +96,7 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
     }
 
  fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SENDNONCONTIG);
     return mpi_errno;
  fn_fail:
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
index 2a00df4..19bb8da 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
@@ -478,7 +478,7 @@ MPID_nem_vc_init (MPIDI_VC_t *vc)
     /* MT we acquire the LMT CS here, b/c there is at least a theoretical race
      * on some fields, such as lmt_copy_buf.  In practice it's not an issue, but
      * this will keep DRD happy. */
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     /* override rendezvous functions */
     vc->rndvSend_fn = MPID_nem_lmt_RndvSend;
@@ -599,7 +599,7 @@ MPID_nem_vc_init (MPIDI_VC_t *vc)
 
     }
 
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     /* FIXME: ch3 assumes there is a field called sendq_head in the ch
        portion of the vc.  This is unused in nemesis and should be set
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 ce6da0c..6fd751e 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
@@ -122,13 +122,13 @@ int MPID_nem_lmt_RndvSend(MPID_Request **sreq_p, const void * buf, MPI_Aint coun
     MPIDI_Request_set_seqnum(sreq, seqnum);
     sreq->ch.vc = vc;
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     mpi_errno = vc->ch.lmt_initiate_lmt(vc, &upkt.p, sreq);
     if (MPIR_CVAR_ENABLE_FT) {
         if (MPI_SUCCESS == mpi_errno)
             MPID_nem_lmt_rtsq_enqueue(&vc->ch.lmt_rts_queue, sreq);
     }
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
@@ -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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_PKT_RTS_HANDLER);
     return mpi_errno;
  fn_fail:
@@ -321,12 +321,12 @@ static int pkt_CTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
 
     MPID_Request_get_ptr(cts_pkt->sender_req_id, sreq);
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     if (MPIR_CVAR_ENABLE_FT) {
         /* Remove the request from the VC RTS queue. */
         MPID_nem_lmt_rtsq_search_remove(&vc->ch.lmt_rts_queue, cts_pkt->sender_req_id, &rts_sreq);
     }
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     sreq->ch.lmt_req_id = cts_pkt->receiver_req_id;
     sreq->ch.lmt_data_sz = cts_pkt->data_sz;
@@ -348,9 +348,9 @@ static int pkt_CTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
             /* if whole cookie has been received, start the send */
             sreq->ch.lmt_tmp_cookie.MPL_IOV_BUF = data_buf;
             sreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = cts_pkt->cookie_len;
-            MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
             mpi_errno = vc->ch.lmt_start_send(vc, sreq, sreq->ch.lmt_tmp_cookie);
-            MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
             if (mpi_errno) MPIR_ERR_POP (mpi_errno);
             sreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = 0;
             *buflen = sizeof(MPIDI_CH3_Pkt_t) + cts_pkt->cookie_len;
@@ -378,9 +378,9 @@ static int pkt_CTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
     else
     {
         MPL_IOV cookie = {0,0};
-        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
         mpi_errno = vc->ch.lmt_start_send(vc, sreq, cookie);
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
         if (mpi_errno) MPIR_ERR_POP (mpi_errno);
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
         *rreqp = NULL;
@@ -411,7 +411,7 @@ static int pkt_DONE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
     MPID_Request_get_ptr(done_pkt->req_id, req);
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     switch (MPIDI_Request_get_type(req))
     {
@@ -434,7 +434,7 @@ static int pkt_DONE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
     *rreqp = NULL;
 
  fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_PKT_DONE_HANDLER);
     return mpi_errno;
  fn_fail:
@@ -480,9 +480,9 @@ static int pkt_COOKIE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz
 
             cookie.MPL_IOV_BUF = data_buf;
             cookie.MPL_IOV_LEN = cookie_pkt->cookie_len;
-            MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
             mpi_errno = vc->ch.lmt_handle_cookie(vc, req, cookie);
-            MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
             if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             *rreqp = NULL;
@@ -510,9 +510,9 @@ static int pkt_COOKIE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz
     {
         MPL_IOV cookie = {0,0};
 
-        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
         mpi_errno = vc->ch.lmt_handle_cookie(vc, req, cookie);
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
         *rreqp = NULL;
@@ -556,9 +556,9 @@ static int do_cts(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 
     s_cookie = rreq->ch.lmt_tmp_cookie;
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     mpi_errno = vc->ch.lmt_start_recv(vc, rreq, s_cookie);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* free cookie buffer allocated in RTS handler */
@@ -592,9 +592,9 @@ static int do_send(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 
     r_cookie = sreq->ch.lmt_tmp_cookie;
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     mpi_errno = vc->ch.lmt_start_send(vc, sreq, r_cookie);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* free cookie buffer allocated in CTS handler */
@@ -625,9 +625,9 @@ static int do_cookie(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 
     cookie = req->ch.lmt_tmp_cookie;
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     mpi_errno = vc->ch.lmt_handle_cookie(vc, req, cookie);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
     /* free cookie buffer allocated in COOKIE handler */
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c
index 0c799ef..57fe247 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c
@@ -825,13 +825,13 @@ int MPID_nem_lmt_shm_vc_terminated(MPIDI_VC_t *vc)
 
     /* If there is anything in the RTS queue, it needs to be cleared out. */
     if (MPIR_CVAR_ENABLE_FT) {
-        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
         while (!MPID_nem_lmt_rtsq_empty(vc_ch->lmt_rts_queue)) {
             MPID_nem_lmt_rtsq_dequeue(&vc_ch->lmt_rts_queue, &req);
             req->status.MPI_ERROR = req_errno;
             MPID_Request_complete(req);
         }
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     }
 
     /* We empty the vc queue, but don't remove the vc from the global
diff --git a/src/mpid/ch3/channels/sock/include/mpidi_ch3_post.h b/src/mpid/ch3/channels/sock/include/mpidi_ch3_post.h
index 952023e..2d45e94 100644
--- a/src/mpid/ch3/channels/sock/include/mpidi_ch3_post.h
+++ b/src/mpid/ch3/channels/sock/include/mpidi_ch3_post.h
@@ -23,10 +23,10 @@
  */
 #define MPIDI_CH3_Progress_start(progress_state_)			\
 {									\
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);\
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);\
     (progress_state_)->ch.completion_count = MPIDI_CH3I_progress_completion_count;\
 }
-#define MPIDI_CH3_Progress_end(progress_state_) MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex)
+#define MPIDI_CH3_Progress_end(progress_state_) MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX)
 #define MPIDI_CH3_Progress_poke() (MPIDI_CH3_Progress_test())
 
 int MPIDI_CH3I_Progress(int blocking, MPID_Progress_state *state);
diff --git a/src/mpid/ch3/channels/sock/src/ch3_progress.c b/src/mpid/ch3/channels/sock/src/ch3_progress.c
index 0baaf32..e6b4f2f 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_progress.c
@@ -755,7 +755,7 @@ static int MPIDI_CH3I_Progress_delay(unsigned int completion_count)
 	while (completion_count == MPIDI_CH3I_progress_completion_count)
 	{
 	    MPID_Thread_cond_wait(&MPIDI_CH3I_progress_completion_cond, 
-				  &MPIR_ThreadInfo.global_mutex, &err);
+				  &MPIR_THREAD_GLOBAL_MUTEX, &err);
 	}
     }
 #   endif
@@ -989,7 +989,7 @@ int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
         if (progress_hooks[i].func_ptr == NULL) {
@@ -1008,7 +1008,7 @@ int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
     (*id) = i;
 
   fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
     return mpi_errno;
 
@@ -1026,7 +1026,7 @@ int MPIDI_CH3I_Progress_deregister_hook(int id)
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS && progress_hooks[id].func_ptr != NULL);
 
@@ -1034,7 +1034,7 @@ int MPIDI_CH3I_Progress_deregister_hook(int id)
     progress_hooks[id].active = FALSE;
 
   fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
     return mpi_errno;
 
@@ -1052,7 +1052,7 @@ int MPIDI_CH3I_Progress_activate_hook(int id)
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS &&
                 progress_hooks[id].active == FALSE && progress_hooks[id].func_ptr != NULL);
@@ -1062,7 +1062,7 @@ int MPIDI_CH3I_Progress_activate_hook(int id)
     MPIU_Assert(total_progress_hook_cnt <= MAX_PROGRESS_HOOKS);
 
   fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
     return mpi_errno;
 
@@ -1081,7 +1081,7 @@ int MPIDI_CH3I_Progress_deactivate_hook(int id)
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS &&
                 progress_hooks[id].active == TRUE && progress_hooks[id].func_ptr != NULL);
@@ -1091,7 +1091,7 @@ int MPIDI_CH3I_Progress_deactivate_hook(int id)
     MPIU_Assert(total_progress_hook_cnt >= 0);
 
   fn_exit:
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
     return mpi_errno;
 
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index 55631dc..cb8aa79 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 (!MPIU_THREADPRIV_FIELD(request_handles)) {                 \
             MPID_Request *prev, *cur;                                  \
             /* batch allocate a linked list of requests */             \
-            MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.handle_mutex);                        \
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.handle_mutex);                         \
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_HANDLE_MUTEX);                         \
             MPIU_THREADPRIV_FIELD(request_handles) = cur;              \
             MPIU_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_ThreadInfo.completion_mutex);                                       \
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.completion_mutex);                                        \
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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 c56ec4c..915b964 100644
--- a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
+++ b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
@@ -173,9 +173,9 @@ 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_ThreadInfo.pmi_mutex);*/
+            /*MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_PMI_MUTEX);*/
             /* release the global CS for spawn PMI calls */
-            MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+            MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
             pmi_errno = PMI2_Job_Spawn(count, (const char **)commands,
                                        argcs, (const char ***)argvs,
                                        maxprocs,
@@ -184,8 +184,8 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
                                        NULL, 0,
                                        /*jobId, jobIdSize,*/ /* XXX DJG job stuff? */
                                        pmi_errcodes);
-            MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
-            /*MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.pmi_mutex);*/
+            MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
+            /*MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.pmi_mutex);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.pmi_mutex);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.pmi_mutex);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_PMI_MUTEX);
             pmi_errno = PMI2_KVS_Get(kvsname, PMI2_ID_NULL, PARENT_PORT_KVSKEY, val, sizeof(val), &vallen);
-            MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.pmi_mutex);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.pmi_mutex);
+	MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_PMI_MUTEX);
 	pmi_errno = PMI_KVS_Get( kvsname, PARENT_PORT_KVSKEY, val, sizeof(val));
-	MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.pmi_mutex);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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 63073a2..9cf33a2 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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
     return mpi_errno;
 }
 
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index 4d98758..b081a3e 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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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 829dc3b..bdff365 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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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 7510dfe..5caff05 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_ThreadInfo.msgq_mutex);
+	MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
 	rreq = MPIDI_CH3U_Recvq_FDU(sreq->handle, &sreq->dev.match);
-	MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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 de1f613..d4f75d5 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_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
         MPIDI_CH3U_Clean_recvq(comm_ptr);
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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 9cdb8dc..f9a615a 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_ThreadInfo.msgq_mutex);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
             *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-            MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+                    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
                     *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-                    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+                    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
     *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
         *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
     }
 
     if (*flag && *message) {
diff --git a/src/mpid/ch3/src/mpid_iprobe.c b/src/mpid/ch3/src/mpid_iprobe.c
index 176db5c..713bf86 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_ThreadInfo.msgq_mutex);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
             found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-            MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+                    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
                     found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-                    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+                    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
     found = MPIDI_CH3U_Recvq_FU( source, tag, context, status );
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+	MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
 	found = MPIDI_CH3U_Recvq_FU( source, tag, context, status );
-	MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
     }
 	
     *flag = found;
diff --git a/src/mpid/ch3/src/mpid_irecv.c b/src/mpid/ch3/src/mpid_irecv.c
index fdf766d..8f19987 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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
     }
 
   fn_exit:
diff --git a/src/mpid/ch3/src/mpid_mprobe.c b/src/mpid/ch3/src/mpid_mprobe.c
index 2d7ac25..3ef7a20 100644
--- a/src/mpid/ch3/src/mpid_mprobe.c
+++ b/src/mpid/ch3/src/mpid_mprobe.c
@@ -40,16 +40,16 @@ 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_ThreadInfo.msgq_mutex);
+                MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
                 *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm,&found);
-                MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+                MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
                 if (found) goto fn_exit;
 
                 mpi_errno = MPIDI_Anysource_improbe_fn(tag, comm, context_offset, &found, message, status);
                 if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 if (found) goto fn_exit;
 
-                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
+                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
                 /* FIXME could this be replaced with a progress_wait? */
                 mpi_errno = MPIDI_CH3_Progress_test();
@@ -69,7 +69,7 @@ int MPID_Mprobe(int source, int tag, MPID_Comm *comm, int context_offset,
                     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     if (found) goto fn_exit;
 
-                    MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
+                    MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 
                     /* FIXME could this be replaced with a progress_wait? */
                     mpi_errno = MPIDI_CH3_Progress_test();
@@ -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_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
         *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, &found);
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
         if (found)
             break;
 
diff --git a/src/mpid/ch3/src/mpid_probe.c b/src/mpid/ch3/src/mpid_probe.c
index 853e4da..b21c1e7 100644
--- a/src/mpid/ch3/src/mpid_probe.c
+++ b/src/mpid/ch3/src/mpid_probe.c
@@ -42,16 +42,16 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
             do {
                 int found;
                 
-                MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
+                MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
                 found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-                MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+                MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
                 if (found) goto fn_exit;
 
                 mpi_errno = MPIDI_Anysource_iprobe_fn(tag, comm, context_offset, &found, status);
                 if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 if (found) goto fn_exit;
 
-                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
+                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
                 
                 mpi_errno = MPIDI_CH3_Progress_test();
                 if (mpi_errno) MPIR_ERR_POP(mpi_errno);
@@ -71,7 +71,7 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
                     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     if (found) goto fn_exit;
                     
-                    MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
+                    MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
                     
                     mpi_errno = MPIDI_CH3_Progress_test();
                     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
@@ -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_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MSGQ_MUTEX);
         found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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 97b3db1..22199ce 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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MSGQ_MUTEX);
     }
 
   fn_exit:
diff --git a/src/mpid/ch3/src/mpid_rma.c b/src/mpid/ch3/src/mpid_rma.c
index 65842c5..9242f61 100644
--- a/src/mpid/ch3/src/mpid_rma.c
+++ b/src/mpid/ch3/src/mpid_rma.c
@@ -257,7 +257,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
 
     MPIDI_FUNC_ENTER(MPID_STATE_WIN_INIT);
 
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
     if (initRMAoptions) {
 
         MPIDI_CH3_RMA_Init_sync_pvars();
@@ -265,7 +265,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
 
         initRMAoptions = 0;
     }
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
 
     *win_ptr = (MPID_Win *) MPIU_Handle_obj_alloc(&MPID_Win_mem);
     MPIR_ERR_CHKANDJUMP1(!(*win_ptr), mpi_errno, MPI_ERR_OTHER, "**nomem",
diff --git a/src/mpid/ch3/src/mpidi_isend_self.c b/src/mpid/ch3/src/mpidi_isend_self.c
index 847abfe..1141629 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_ThreadInfo.msgq_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.msgq_mutex);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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 3e769f7..b568242 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_ThreadInfo.pmi_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.pmi_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_PMI_MUTEX);
     if (pmi_errno) {
 	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**pmi_kvs_get");
     }
diff --git a/src/mpid/common/sock/iocp/sock.c b/src/mpid/common/sock/iocp/sock.c
index a9be96f..c232b1d 100644
--- a/src/mpid/common/sock/iocp/sock.c
+++ b/src/mpid/common/sock/iocp/sock.c
@@ -1786,7 +1786,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	    /* Release the lock so that other threads may make progress while this thread waits for something to do */
 	    MPIU_DBG_MSG(THREAD,TYPICAL,"Exit global critical section");
 	    MPIU_THREAD_CHECK_BEGIN;
-	    MPID_Thread_mutex_unlock(&MPIR_ThreadInfo.global_mutex, &err);
+	    MPID_Thread_mutex_unlock(&MPIR_THREAD_GLOBAL_MUTEX, &err);
 	    MPIU_THREAD_CHECK_END;
 	}
 #       else
@@ -1811,7 +1811,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
 		MPIU_DBG_MSG(THREAD,TYPICAL,"Enter global critical section");
 		MPIU_THREAD_CHECK_BEGIN;
-		MPID_Thread_mutex_lock(&MPIR_ThreadInfo.global_mutex, &err);
+		MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_MUTEX, &err);
 		MPIU_THREAD_CHECK_END;
 	    }
 #           else
@@ -2404,7 +2404,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
 		MPIU_DBG_MSG(THREAD,TYPICAL,"Enter global critical section");
 		MPIU_THREAD_CHECK_BEGIN;
-		MPID_Thread_mutex_lock(&MPIR_ThreadInfo.global_mutex, &err);
+		MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_MUTEX, &err);
 		MPIU_THREAD_CHECK_END;
 	    }
 #           else
diff --git a/src/mpid/common/sock/poll/sock_wait.i b/src/mpid/common/sock/poll/sock_wait.i
index 6913cbe..adccb3b 100644
--- a/src/mpid/common/sock/poll/sock_wait.i
+++ b/src/mpid/common/sock/poll/sock_wait.i
@@ -156,9 +156,9 @@ int MPIDU_Sock_wait(struct MPIDU_Sock_set * sock_set, int millisecond_timeout,
 		       progress while this thread waits for something to 
 		       do */
 		    MPIU_DBG_MSG(THREAD,TYPICAL,"Exit global critical section (sock_wait)");
-		    /* 		    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
-				    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex); */
-		    MPID_Thread_mutex_unlock(&MPIR_ThreadInfo.global_mutex, &err);
+		    /* 		    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_MUTEX);
+				    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX); */
+		    MPID_Thread_mutex_unlock(&MPIR_THREAD_GLOBAL_MUTEX, &err);
 			    
 		    MPIDI_FUNC_ENTER(MPID_STATE_POLL);
 		    n_fds = poll(sock_set->pollfds_active, 
@@ -168,9 +168,9 @@ int MPIDU_Sock_wait(struct MPIDU_Sock_set * sock_set, int millisecond_timeout,
 		    /* Reaquire the lock before processing any of the 
 		       information returned from poll */
 		    MPIU_DBG_MSG(THREAD,TYPICAL,"Enter global critical section (sock_wait)");
-		    /* 		    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
-				    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex); */
-		    MPID_Thread_mutex_lock(&MPIR_ThreadInfo.global_mutex, &err);
+		    /* 		    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
+				    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_MUTEX); */
+		    MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_MUTEX, &err);
 
 		    /*
 		     * Update pollfds array if changes were posted while we 
diff --git a/src/nameserv/pmi/pmi_nameserv.c b/src/nameserv/pmi/pmi_nameserv.c
index 274bb67..b9ef744 100644
--- a/src/nameserv/pmi/pmi_nameserv.c
+++ b/src/nameserv/pmi/pmi_nameserv.c
@@ -51,9 +51,9 @@ int MPID_NS_Publish( MPID_NS_Handle handle, const MPID_Info *info_ptr,
 
 #ifdef USE_PMI2_API
     /* release the global CS for PMI calls */
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     rc = PMI2_Nameserv_publish(service_name, info_ptr, port);
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 #else
     rc = PMI_Publish_name( service_name, port );
 #endif
@@ -78,9 +78,9 @@ int MPID_NS_Lookup( MPID_NS_Handle handle, const MPID_Info *info_ptr,
 
 #ifdef USE_PMI2_API
     /* release the global CS for PMI calls */
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     rc = PMI2_Nameserv_lookup(service_name, info_ptr, port, MPI_MAX_PORT_NAME);
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 #else
     rc = PMI_Lookup_name( service_name, port );
 #endif
@@ -105,9 +105,9 @@ int MPID_NS_Unpublish( MPID_NS_Handle handle, const MPID_Info *info_ptr,
 
 #ifdef USE_PMI2_API
     /* release the global CS for PMI calls */
-    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
     rc = PMI2_Nameserv_unpublish(service_name, info_ptr);
-    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
 #else
     rc = PMI_Unpublish_name( service_name );
 #endif
diff --git a/src/pmi/pmi2/poe/poe2pmi.c b/src/pmi/pmi2/poe/poe2pmi.c
index 2e1adf0..6dd2bb0 100644
--- a/src/pmi/pmi2/poe/poe2pmi.c
+++ b/src/pmi/pmi2/poe/poe2pmi.c
@@ -298,7 +298,7 @@ int _mpi_world_exiting_handler(int world_id)
 /*  struct worldExitReq *req = (struct worldExitReq *)cookie; */
   MPID_Comm *comm = MPIR_Process.comm_world;
 
-  MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+  MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
   ref_count = MPIDI_get_refcnt_of_world(world_id);
   TRACE_ERR("_mpi_world_exiting_handler: invoked for world %d exiting ref_count=%d my comm_word_size=%d\n", world_id, ref_count, world_size);
   if(ref_count == 0) {
@@ -322,7 +322,7 @@ int _mpi_world_exiting_handler(int world_id)
 
   TRACE_ERR("_mpi_world_exiting_handler: Out of _mpi_reduce_for_dyntask for exiting world %d reduce_state=%d\n",world_id, reduce_state);
 
-  MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
+  MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_MUTEX);
   if(comm->rank == 0) {
     MPL_snprintf(world_id_str, sizeof(world_id_str), "%d", world_id);
     PMI2_Abort(0, world_id_str);
diff --git a/src/util/mem/handlemem.c b/src/util/mem/handlemem.c
index 68f5794..c2c7ccf 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_ThreadInfo.handle_mutex)' enables both 
+  Threading: The 'MPID_THREAD_CS_ENTER/EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.handle_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_HANDLE_MUTEX);
     ret = MPIU_Handle_obj_alloc_unsafe(objmem);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.handle_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.handle_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_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_ThreadInfo.handle_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_HANDLE_MUTEX);
 }
 
 /* 
diff --git a/src/util/mem/trmem.c b/src/util/mem/trmem.c
index bd491f8..2b8769c 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_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     MPL_trdump(fp, minid);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
 }
 
 void *MPIU_trmalloc(size_t a, int lineno, const char fname[])
 {
     void *retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     retval = MPL_trmalloc(a, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     return retval;
 }
 
 void MPIU_trfree(void *a_ptr, int line, const char fname[])
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     MPL_trfree(a_ptr, line, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
 }
 
 int MPIU_trvalid(const char str[])
 {
     int retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     retval = MPL_trvalid(str);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     return retval;
 }
 
 void MPIU_trspace(size_t *space, size_t *fr)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     MPL_trspace(space, fr);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
 }
 
 void MPIU_trid(int id)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     MPL_trid(id);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
 }
 
 void MPIU_trlevel(int level)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     MPL_trlevel(level);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
 }
 
 void MPIU_trDebugLevel(int level)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     MPL_trDebugLevel(level);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
 }
 
 void *MPIU_trcalloc(size_t nelem, size_t elsize, int lineno, const char fname[])
 {
     void *retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     retval = MPL_trcalloc(nelem, elsize, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_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_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     retval = MPL_trrealloc(p, size, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     return retval;
 }
 
 void *MPIU_trstrdup(const char *str, int lineno, const char fname[])
 {
     void *retval;
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     retval = MPL_trstrdup(str, lineno, fname);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     return retval;
 }
 
 void MPIU_TrSetMaxMem(size_t size)
 {
-    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
     MPL_TrSetMaxMem(size);
-    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_MEMALLOC_MUTEX);
 }
 
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index 4a7641f..e005619 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -149,6 +149,14 @@ typedef struct MPICH_ThreadInfo_t {
 } MPICH_ThreadInfo_t;
 extern MPICH_ThreadInfo_t MPIR_ThreadInfo;
 
+#define MPIR_THREAD_GLOBAL_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
+
 /* ------------------------------------------------------------------------- */
 /* thread-local storage macros */
 /* moved here from mpiimpl.h because they logically belong here */

http://git.mpich.org/mpich.git/commitdiff/964b32d0180840e868cc10b28180c78a3e10d87f

commit 964b32d0180840e868cc10b28180c78a3e10d87f
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Aug 14 17:31:29 2015 -0500

    Remove unused CH3-specific CS functionality.
    
    No reviewer.

diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index 10a14b8..55631dc 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -1875,32 +1875,6 @@ int MPIDI_CH3_ReqHandler_FOPSendComplete( MPIDI_VC_t *, MPID_Request *,
 /* RMA operation request handler */
 int MPIDI_CH3_Req_handler_rma_op_complete(MPID_Request *);
 
-/* Thread Support */
-#ifdef MPICH_IS_THREADED
-#if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL
-/* There is a single, global lock, held for the duration of an MPI call */
-#define MPIU_THREAD_CS_ENTER_LMT(_context)
-#define MPIU_THREAD_CS_EXIT_LMT(_context)
-
-#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT
-
-/* MT FIXME making LMT into MPIDCOMM for now because of overwhelming deadlock
- * issues */
-#define MPIU_THREAD_CS_ENTER_LMT(context_) MPID_THREAD_CS_ENTER_MPIDCOMM(context_)
-#define MPIU_THREAD_CS_EXIT_LMT(context_)  MPID_THREAD_CS_EXIT_MPIDCOMM(context_)
-
-#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_SINGLE
-/* No thread support, make all operations a no-op */
-/* FIXME incomplete? or already handled by the upper level? */
-/* FIXME does it make sense to have (MPICH_IS_THREADED && _GRANULARITY==_SINGLE) ? */
-
-#else
-#error Unrecognized thread granularity
-#endif
-#else
-
-#endif /* MPICH_IS_THREADED */
-
 #define MPIDI_CH3_GET_EAGER_THRESHOLD(eager_threshold_p, comm, vc)  \
     do {                                                            \
         if ((comm)->dev.eager_max_msg_sz != -1)                     \

http://git.mpich.org/mpich.git/commitdiff/94c2de448a2e9a598787d41cd948335eb756778a

commit 94c2de448a2e9a598787d41cd948335eb756778a
Author: Halim Amer <aamer at anl.gov>
Date:   Fri Aug 14 15:18:41 2015 -0500

    Refactor USE_xx to MPIU_xx in mpiu_timer*
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/configure.ac b/configure.ac
index f5953f0..a175928 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5019,7 +5019,7 @@ esac
 # Convert timer type to upper case
 timer_type=`echo $timer_type | \
     tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-MPICH_TIMER_KIND=USE_$timer_type
+MPICH_TIMER_KIND=MPIU_$timer_type
 AC_SUBST(MPICH_TIMER_KIND)
 # ----------------------------------------------------------------------------
 # End of code for timer support (except for ac_ OUTPUT)
diff --git a/src/util/timers/mpiu_timer.c b/src/util/timers/mpiu_timer.c
index bebd005..ff4c5fb 100644
--- a/src/util/timers/mpiu_timer.c
+++ b/src/util/timers/mpiu_timer.c
@@ -38,7 +38,7 @@ static void init_wtick(void)
     }
 }
 
-#if MPICH_TIMER_KIND == USE_GETHRTIME
+#if MPICH_TIMER_KIND == MPIU_GETHRTIME
 /*
  * MPIU_Time_t is hrtime_t, which under Solaris is defined as a 64bit
  * longlong_t .  However, the Solaris header files will define
@@ -86,7 +86,7 @@ int MPIU_Wtime_init(void)
     return 0;
 }
 
-#elif MPICH_TIMER_KIND == USE_CLOCK_GETTIME
+#elif MPICH_TIMER_KIND == MPIU_CLOCK_GETTIME
 void MPIU_Wtime(MPIU_Time_t * timeval)
 {
     /* POSIX timer (14.2.1, page 311) */
@@ -140,7 +140,7 @@ int MPIU_Wtime_init(void)
 }
 
 
-#elif MPICH_TIMER_KIND == USE_GETTIMEOFDAY
+#elif MPICH_TIMER_KIND == MPIU_GETTIMEOFDAY
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
@@ -188,7 +188,7 @@ int MPIU_Wtime_init(void)
 }
 
 
-#elif MPICH_TIMER_KIND == USE_LINUX86_CYCLE
+#elif MPICH_TIMER_KIND == MPIU_LINUX86_CYCLE
 #include <sys/time.h>
 double MPIU_Seconds_per_tick = 0.0;
 double MPIU_Wtick(void)
@@ -240,7 +240,7 @@ double MPIU_Wtick(void)
 }
 
 
-#elif MPICH_TIMER_KIND == USE_GCC_IA64_CYCLE
+#elif MPICH_TIMER_KIND == MPIU_GCC_IA64_CYCLE
 #include <sys/time.h>
 double MPIU_Seconds_per_tick = 0.0;
 double MPIU_Wtick(void)
@@ -286,12 +286,12 @@ void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
     *t3 += (*t2 - *t1);
 }
 
-#elif MPICH_TIMER_KIND == USE_LINUXALPHA_CYCLE
+#elif MPICH_TIMER_KIND == MPIU_LINUXALPHA_CYCLE
 /* FIXME: This should have been fixed in the configure, rather than as a
    make-time error message */
 #error "LinuxAlpha cycle counter not supported"
 
-#elif (MPICH_TIMER_KIND == USE_WIN86_CYCLE) || (MPICH_TIMER_KIND == USE_WIN64_CYCLE)
+#elif (MPICH_TIMER_KIND == MPIU_WIN86_CYCLE) || (MPICH_TIMER_KIND == MPIU_WIN64_CYCLE)
 double MPIU_Seconds_per_tick = 0.0;
 double MPIU_Wtick(void)
 {
@@ -337,7 +337,7 @@ int MPIU_Wtime_init(void)
      */
     return 0;
 }
-#elif MPICH_TIMER_KIND == USE_QUERYPERFORMANCECOUNTER
+#elif MPICH_TIMER_KIND == MPIU_QUERYPERFORMANCECOUNTER
 double MPIU_Seconds_per_tick = 0.0;     /* High performance counter frequency */
 int MPIU_Wtime_init(void)
 {
@@ -370,7 +370,7 @@ void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
 }
 
 
-#elif MPICH_TIMER_KIND == USE_MACH_ABSOLUTE_TIME
+#elif MPICH_TIMER_KIND == MPIU_MACH_ABSOLUTE_TIME
 static double MPIR_Wtime_mult;
 
 int MPIU_Wtime_init(void)
diff --git a/src/util/timers/mpiu_timer.h.in b/src/util/timers/mpiu_timer.h.in
index ae6d1b4..713543b 100644
--- a/src/util/timers/mpiu_timer.h.in
+++ b/src/util/timers/mpiu_timer.h.in
@@ -19,41 +19,41 @@
  * is needed only to build the function versions of the timers.
  */
 /* Include the appropriate files */
-#define USE_GETHRTIME               1
-#define USE_CLOCK_GETTIME           2
-#define USE_GETTIMEOFDAY            3
-#define USE_LINUX86_CYCLE           4
-#define USE_LINUXALPHA_CYCLE        5
-#define USE_QUERYPERFORMANCECOUNTER 6
-#define USE_WIN86_CYCLE             7
-#define USE_GCC_IA64_CYCLE          8
-/* The value "USE_DEVICE" means that the ADI device provides the timer */
-#define USE_DEVICE                  9
-#define USE_WIN64_CYCLE             10
-#define USE_MACH_ABSOLUTE_TIME      11
+#define MPIU_GETHRTIME               1
+#define MPIU_CLOCK_GETTIME           2
+#define MPIU_GETTIMEOFDAY            3
+#define MPIU_LINUX86_CYCLE           4
+#define MPIU_LINUXALPHA_CYCLE        5
+#define MPIU_QUERYPERFORMANCECOUNTER 6
+#define MPIU_WIN86_CYCLE             7
+#define MPIU_GCC_IA64_CYCLE          8
+/* The value "MPIU_DEVICE" means that the ADI device provides the timer */
+#define MPIU_DEVICE                  9
+#define MPIU_WIN64_CYCLE             10
+#define MPIU_MACH_ABSOLUTE_TIME      11
 #define MPICH_TIMER_KIND @MPICH_TIMER_KIND@
 
-#if MPICH_TIMER_KIND == USE_GETHRTIME
+#if MPICH_TIMER_KIND == MPIU_GETHRTIME
 #include <sys/time.h>
-#elif MPICH_TIMER_KIND == USE_CLOCK_GETTIME
+#elif MPICH_TIMER_KIND == MPIU_CLOCK_GETTIME
 #include <time.h>
 #ifdef NEEDS_SYS_TIME_H
 /* Some OS'es mistakenly require sys/time.h to get the definition of
    CLOCK_REALTIME (POSIX requires the definition to be in time.h) */
 #include <sys/time.h>
 #endif
-#elif MPICH_TIMER_KIND == USE_GETTIMEOFDAY
+#elif MPICH_TIMER_KIND == MPIU_GETTIMEOFDAY
 #include <sys/types.h>
 #include <sys/time.h>
-#elif MPICH_TIMER_KIND == USE_LINUX86_CYCLE
-#elif MPICH_TIMER_KIND == USE_GCC_IA64_CYCLE
-#elif MPICH_TIMER_KIND == USE_LINUXALPHA_CYCLE
-#elif MPICH_TIMER_KIND == USE_QUERYPERFORMANCECOUNTER
+#elif MPICH_TIMER_KIND == MPIU_LINUX86_CYCLE
+#elif MPICH_TIMER_KIND == MPIU_GCC_IA64_CYCLE
+#elif MPICH_TIMER_KIND == MPIU_LINUXALPHA_CYCLE
+#elif MPICH_TIMER_KIND == MPIU_QUERYPERFORMANCECOUNTER
 #include <winsock2.h>
 #include <windows.h>
-#elif MPICH_TIMER_KIND == USE_MACH_ABSOLUTE_TIME
+#elif MPICH_TIMER_KIND == MPIU_MACH_ABSOLUTE_TIME
 #include <mach/mach_time.h>
-#elif MPICH_TIMER_KIND == USE_WIN86_CYCLE
+#elif MPICH_TIMER_KIND == MPIU_WIN86_CYCLE
 #include <winsock2.h>
 #include <windows.h>
 #endif
@@ -227,16 +227,16 @@ int MPIU_Wtime_init(void);
 /* The timer kind is set using AC_SUBST in the MPICH configure */
 #define MPICH_TIMER_KIND @MPICH_TIMER_KIND@
 
-#if MPICH_TIMER_KIND == USE_GETHRTIME
+#if MPICH_TIMER_KIND == MPIU_GETHRTIME
 #define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
-#elif MPICH_TIMER_KIND == USE_CLOCK_GETTIME
+#elif MPICH_TIMER_KIND == MPIU_CLOCK_GETTIME
 #define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
-#elif MPICH_TIMER_KIND == USE_GETTIMEOFDAY
+#elif MPICH_TIMER_KIND == MPIU_GETTIMEOFDAY
 #define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
-#elif MPICH_TIMER_KIND == USE_LINUX86_CYCLE
+#elif MPICH_TIMER_KIND == MPIU_LINUX86_CYCLE
 /* The rdtsc instruction is not a "serializing" instruction, so the
    processor is free to reorder it.  In order to get more accurate
    timing numbers with rdtsc, we need to put a serializing
@@ -268,7 +268,7 @@ int MPIU_Wtime_init(void);
 extern double MPIU_Seconds_per_tick;
 #define MPIUM_Wtime_todouble(t, d) *d = (double)*t * MPIU_Seconds_per_tick
 
-#elif MPICH_TIMER_KIND == USE_GCC_IA64_CYCLE
+#elif MPICH_TIMER_KIND == MPIU_GCC_IA64_CYCLE
 #ifdef __INTEL_COMPILER
 #include "ia64regs.h"
 #define MPIU_Wtime(var_ptr) { MPIU_Time_t t_val;\
@@ -280,16 +280,16 @@ extern double MPIU_Seconds_per_tick;
 extern double MPIU_Seconds_per_tick;
 #define MPIUM_Wtime_todouble(t, d) *d = (double)*t * MPIU_Seconds_per_tick
 
-#elif MPICH_TIMER_KIND == USE_LINUXALPHA_CYCLE
+#elif MPICH_TIMER_KIND == MPIU_LINUXALPHA_CYCLE
 #define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
-#elif MPICH_TIMER_KIND == USE_QUERYPERFORMANCECOUNTER
+#elif MPICH_TIMER_KIND == MPIU_QUERYPERFORMANCECOUNTER
 #define MPIU_Wtime(var) QueryPerformanceCounter(var)
 extern double MPIU_Seconds_per_tick;
 #define MPIUM_Wtime_todouble( t, d ) \
   *d = (double)t->QuadPart * MPIU_Seconds_per_tick /* convert to seconds */
 
-#elif MPICH_TIMER_KIND == USE_WIN86_CYCLE
+#elif MPICH_TIMER_KIND == MPIU_WIN86_CYCLE
 #define MPIU_Wtime(var_ptr) \
 { \
     register int *f1 = (int*)var_ptr; \
@@ -303,7 +303,7 @@ extern double MPIU_Seconds_per_tick;
 #define MPIUM_Wtime_todouble(t, d) *d = (double)(__int64)*t * MPIU_Seconds_per_tick
 #define MPIUM_Wtime_diff(t1,t2,diff) *diff = (double)((__int64)( *t2 - *t1 )) * MPIU_Seconds_per_tick
 
-#elif MPICH_TIMER_KIND == USE_MACH_ABSOLUTE_TIME
+#elif MPICH_TIMER_KIND == MPIU_MACH_ABSOLUTE_TIME
 #define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
 #endif

http://git.mpich.org/mpich.git/commitdiff/8c1db8c508ae2cba9ab4ef53ce5018a2e61b8266

commit 8c1db8c508ae2cba9ab4ef53ce5018a2e61b8266
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Aug 14 16:47:18 2015 -0500

    Remove useless redefinitions of MPIU_Wtime_init.
    
    We both define the function MPIU_Wtime_init and macro it to 0, which
    is weird.  This patch removes the macro.
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/src/util/timers/mpiu_timer.h.in b/src/util/timers/mpiu_timer.h.in
index a0ad428..ae6d1b4 100644
--- a/src/util/timers/mpiu_timer.h.in
+++ b/src/util/timers/mpiu_timer.h.in
@@ -228,7 +228,6 @@ int MPIU_Wtime_init(void);
 #define MPICH_TIMER_KIND @MPICH_TIMER_KIND@
 
 #if MPICH_TIMER_KIND == USE_GETHRTIME
-#define MPIU_Wtime_init() 0
 #define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
 #elif MPICH_TIMER_KIND == USE_CLOCK_GETTIME
@@ -282,7 +281,6 @@ extern double MPIU_Seconds_per_tick;
 #define MPIUM_Wtime_todouble(t, d) *d = (double)*t * MPIU_Seconds_per_tick
 
 #elif MPICH_TIMER_KIND == USE_LINUXALPHA_CYCLE
-#define MPIU_Wtime_init() 0
 #define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
 #elif MPICH_TIMER_KIND == USE_QUERYPERFORMANCECOUNTER

http://git.mpich.org/mpich.git/commitdiff/45bfb114d45fb5dbeeeaa80e4d975ff0b8a267a3

commit 45bfb114d45fb5dbeeeaa80e4d975ff0b8a267a3
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Aug 14 16:03:54 2015 -0500

    White space cleanup.
    
    No reviewer.

diff --git a/src/util/thread/mpiu_thread.c b/src/util/thread/mpiu_thread.c
index 8626ab4..c132d49 100644
--- a/src/util/thread/mpiu_thread.c
+++ b/src/util/thread/mpiu_thread.c
@@ -15,7 +15,7 @@ MPICH_PerThread_t MPIU_Thread = { 0 };
 
 MPIU_TLS_SPECIFIER MPICH_PerThread_t MPIU_Thread = { 0 };
 
-#else  /* defined(MPICH_IS_THREADED) && !defined(MPIU_TLS_SPECIFIER) */
+#else /* defined(MPICH_IS_THREADED) && !defined(MPIU_TLS_SPECIFIER) */
 
 /* If we may be single threaded, we need a preallocated version to use
  * if we are single threaded case */
@@ -24,10 +24,10 @@ MPICH_PerThread_t MPIU_ThreadSingle = { 0 };
 /* This routine is called when a thread exits; it is passed the value
  * associated with the key.  In our case, this is simply storage
  * allocated with MPIU_Calloc */
-void MPIUI_Cleanup_tls( void *a )
+void MPIUI_Cleanup_tls(void *a)
 {
     if (a)
-	MPIU_Free( a );
+        MPIU_Free(a);
 }
 
 #endif
diff --git a/src/util/thread/mpiu_thread_multiple.h b/src/util/thread/mpiu_thread_multiple.h
index 26cb19c..20ec810 100644
--- a/src/util/thread/mpiu_thread_multiple.h
+++ b/src/util/thread/mpiu_thread_multiple.h
@@ -39,25 +39,25 @@
 #define MPIU_THREAD_CS_ENTER_LOCKNAME(name_,mutex_)                     \
     do {                                                                \
         MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to ENTER lockname=%s", #name_); \
-        MPIU_Thread_CS_enter_lockname_impl_(#name_, &mutex_); \
+        MPIU_Thread_CS_enter_lockname_impl_(#name_, &mutex_);           \
     } while (0)
 
 #define MPIU_THREAD_CS_EXIT_LOCKNAME(name_,mutex_)                      \
     do {                                                                \
         MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to EXIT lockname=%s", #name_); \
-        MPIU_Thread_CS_exit_lockname_impl_(#name_, &mutex_); \
+        MPIU_Thread_CS_exit_lockname_impl_(#name_, &mutex_);            \
     } while (0)
 
 #define MPIU_THREAD_CS_YIELD_LOCKNAME(name_,mutex_)                     \
     do {                                                                \
         MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to YIELD lockname=%s", #name_); \
-        MPIU_Thread_CS_yield_lockname_impl_(#name_, &mutex_); \
+        MPIU_Thread_CS_yield_lockname_impl_(#name_, &mutex_);           \
     } while (0)
 
 
 enum MPIU_Nest_mutexes {
     MPIU_NEST_GLOBAL = 0,
-    MPIU_NEST_POBJ,   /* Nesting does not really make sense for POBJ */
+    MPIU_NEST_POBJ,     /* Nesting does not really make sense for POBJ */
     MPIU_NEST_NUM_MUTEXES
 };
 
diff --git a/src/util/thread/mpiu_thread_pobj.h b/src/util/thread/mpiu_thread_pobj.h
index fb9e187..40b287c 100644
--- a/src/util/thread/mpiu_thread_pobj.h
+++ b/src/util/thread/mpiu_thread_pobj.h
@@ -149,23 +149,23 @@ static MPL_DBG_INLINE_KEYWORD int MPIU_cc_is_complete(MPIU_cc_t * cc_ptr)
 }
 
 /* incomplete_==TRUE iff the cc > 0 after the decr */
-#define MPIU_cc_decr(cc_ptr_, incomplete_)                                  \
-    do {                                                                    \
-        OPA_write_barrier();                                                \
-        MPL_VG_ANNOTATE_HAPPENS_BEFORE(cc_ptr_);                            \
-        *(incomplete_) = !OPA_decr_and_test_int(cc_ptr_);                   \
-        /* TODO check if this HA is actually necessary */                   \
-        if (!*(incomplete_)) {                                              \
-            MPL_VG_ANNOTATE_HAPPENS_AFTER(cc_ptr_);                         \
-        }                                                                   \
+#define MPIU_cc_decr(cc_ptr_, incomplete_)                      \
+    do {                                                        \
+        OPA_write_barrier();                                    \
+        MPL_VG_ANNOTATE_HAPPENS_BEFORE(cc_ptr_);                \
+        *(incomplete_) = !OPA_decr_and_test_int(cc_ptr_);       \
+        /* TODO check if this HA is actually necessary */       \
+        if (!*(incomplete_)) {                                  \
+            MPL_VG_ANNOTATE_HAPPENS_AFTER(cc_ptr_);             \
+        }                                                       \
     } while (0)
 
 /* MT FIXME does this need a HB/HA annotation?  This macro is only used for
  * cancel_send right now. */
 /* was_incomplete_==TRUE iff the cc==0 before the decr */
-#define MPIU_cc_incr(cc_ptr_, was_incomplete_)                              \
-    do {                                                                    \
-        *(was_incomplete_) = OPA_fetch_and_incr_int(cc_ptr_);               \
+#define MPIU_cc_incr(cc_ptr_, was_incomplete_)                  \
+    do {                                                        \
+        *(was_incomplete_) = OPA_fetch_and_incr_int(cc_ptr_);   \
     } while (0)
 
 #define MPIU_cc_get(cc_) OPA_load_int(&(cc_))
@@ -184,18 +184,18 @@ static MPL_DBG_INLINE_KEYWORD int MPIU_cc_is_complete(MPIU_cc_t * cc_ptr)
 /* Ideally _GLOBAL would use this too, but we don't want to count on OPA
  * availability in _GLOBAL mode.  Instead the GLOBAL critical section should be
  * used. */
-#define MPIU_OBJ_PUBLISH_HANDLE(hnd_lval_, handle_)                                 \
-    do {                                                                            \
+#define MPIU_OBJ_PUBLISH_HANDLE(hnd_lval_, handle_)                     \
+    do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             /* wmb ensures all read-only object field values are seen before the */ \
-            /* handle value is seen at the application level */                     \
-            OPA_write_barrier();                                                    \
-            /* volatile ensures lval is not speculatively read or written */        \
-            *(volatile int *)&(hnd_lval_) = (handle_);                              \
-        }                                                                           \
-        else {                                                                      \
-            (hnd_lval_) = (handle_);                                                \
-        }                                                                           \
+            /* handle value is seen at the application level */         \
+            OPA_write_barrier();                                        \
+            /* volatile ensures lval is not speculatively read or written */ \
+            *(volatile int *)&(hnd_lval_) = (handle_);                  \
+        }                                                               \
+        else {                                                          \
+            (hnd_lval_) = (handle_);                                    \
+        }                                                               \
     } while (0)
 
 #endif /* !defined(MPIU_THREAD_POBJ_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_posix_funcs.h b/src/util/thread/mpiu_thread_posix_funcs.h
index 1ffde48..b82e7d3 100644
--- a/src/util/thread/mpiu_thread_posix_funcs.h
+++ b/src/util/thread/mpiu_thread_posix_funcs.h
@@ -11,13 +11,13 @@
 #ifndef MPIU_THREAD_POSIX_FUNCS_H_INCLUDED
 #define MPIU_THREAD_POSIX_FUNCS_H_INCLUDED
 
-#include "mpiu_process_wrappers.h" /* for MPIU_PW_Sched_yield */
+#include "mpiu_process_wrappers.h"      /* for MPIU_PW_Sched_yield */
 
-/* 
-   One of PTHREAD_MUTEX_RECURSIVE_NP and PTHREAD_MUTEX_RECURSIVE seem to be 
-   present in different versions.  For example, Mac OS X 10.4 had 
+/*
+   One of PTHREAD_MUTEX_RECURSIVE_NP and PTHREAD_MUTEX_RECURSIVE seem to be
+   present in different versions.  For example, Mac OS X 10.4 had
    PTHREAD_MUTEX_RECURSIVE_NP but Mac OS X 10.5 does not; instead it has
-   PTHREAD_MUTEX_RECURSIVE 
+   PTHREAD_MUTEX_RECURSIVE
 */
 #if defined(HAVE_PTHREAD_MUTEX_RECURSIVE_NP)
 #define PTHREAD_MUTEX_RECURSIVE_VALUE PTHREAD_MUTEX_RECURSIVE_NP
@@ -28,25 +28,25 @@
 #endif /* pthread mutex recursive value */
 
 #if defined(NEEDS_PTHREAD_MUTEXATTR_SETTYPE_DECL)
-int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind);
+int pthread_mutexattr_settype(pthread_mutexattr_t * attr, int kind);
 #endif /* NEEDS_PTHREAD_MUTEXATTR_SETTYPE_DECL */
 
 /* MPIU_Thread_create() defined in mpiu_thread.c */
 
 #define MPIU_Thread_exit()			\
-do {                                               \
-    pthread_exit(NULL);				\
-} while (0)
+    do {                                        \
+        pthread_exit(NULL);                     \
+    } while (0)
 
 #define MPIU_Thread_self(id_)			\
-do {                                               \
-    *(id_) = pthread_self();			\
-} while (0)
+    do {                                        \
+        *(id_) = pthread_self();                \
+    } while (0)
 
-#define MPIU_Thread_same(id1_, id2_, same_)			\
-do {                                                               \
-    *(same_) = pthread_equal(*(id1_), *(id2_)) ? TRUE : FALSE;	\
-} while (0)
+#define MPIU_Thread_same(id1_, id2_, same_)                             \
+    do {                                                                \
+        *(same_) = pthread_equal(*(id1_), *(id2_)) ? TRUE : FALSE;	\
+    } while (0)
 
 #define MPIU_Thread_yield(mutex_ptr_)                                   \
     do {                                                                \
@@ -73,211 +73,229 @@ do {                                                               \
 
 /* FIXME: using constant initializer if available */
 #if !defined(MPICH_DEBUG_MUTEX) || !defined(PTHREAD_MUTEX_ERRORCHECK_VALUE)
-#define MPIU_Thread_mutex_create(mutex_ptr_, err_ptr_)                   \
-do {                                                                       \
-    int err__;                                                          \
+
+#define MPIU_Thread_mutex_create(mutex_ptr_, err_ptr_)                  \
+    do {                                                                \
+        int err__;                                                      \
                                                                         \
-    OPA_store_int(&(mutex_ptr_)->num_queued_threads,0);                  \
-    err__ = pthread_mutex_init(&(mutex_ptr_)->mutex, NULL);             \
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */              \
-    *(int *)(err_ptr_) = err__;                                         \
-    MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_));    \
-} while (0)
-#else /* MPICH_DEBUG_MUTEX */
-#define MPIU_Thread_mutex_create(mutex_ptr_, err_ptr_)                   \
-do {                                                                       \
-    int err__;                                                          \
-    OPA_store_int(&(mutex_ptr_)->num_queued_threads,0);                  \
-    pthread_mutexattr_t attr__;                                         \
+        OPA_store_int(&(mutex_ptr_)->num_queued_threads,0);             \
+        err__ = pthread_mutex_init(&(mutex_ptr_)->mutex, NULL);         \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+        MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
+    } while (0)
+
+#else /* defined(MPICH_DEBUG_MUTEX) && defined(PTHREAD_MUTEX_ERRORCHECK_VALUE) */
+
+#define MPIU_Thread_mutex_create(mutex_ptr_, err_ptr_)                  \
+    do {                                                                \
+        int err__;                                                      \
+        OPA_store_int(&(mutex_ptr_)->num_queued_threads,0);             \
+        pthread_mutexattr_t attr__;                                     \
                                                                         \
-    /* FIXME this used to be PTHREAD_MUTEX_ERRORCHECK_NP, but we had to change
-       it for the thread granularity work when we needed recursive mutexes.  We
-       should go through this code and see if there's any good way to implement
-       error checked versions with the recursive mutexes. */ \
-    pthread_mutexattr_init(&attr__);                                    \
-    pthread_mutexattr_settype(&attr__, PTHREAD_MUTEX_ERRORCHECK_VALUE); \
-    err__ = pthread_mutex_init(&(mutex_ptr_)->mutex, &attr__);          \
-    if (err__)                                                          \
-        MPL_internal_sys_error_printf("pthread_mutex_init", err__,     \
-                                       "    %s:%d\n", __FILE__, __LINE__);\
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */                  \
-    *(int *)(err_ptr_) = err__;                                             \
-    MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_));    \
-} while (0)
-#endif
-
-#define MPIU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)		\
-do {                                                               \
-    int err__;							\
-								\
-    MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to destroy MPIU_Thread_mutex %p", (mutex_ptr_));    \
-    err__ = pthread_mutex_destroy(&(mutex_ptr_)->mutex);                \
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
-    *(int *)(err_ptr_) = err__;                                 \
-} while (0)
-
-#ifndef MPICH_DEBUG_MUTEX
-#define MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_)             \
-do {                                                               \
-    int err__;                                                  \
-    MPIU_DBG_MSG_P(THREAD,VERBOSE,"enter MPIU_Thread_mutex_lock %p", (mutex_ptr_));      \
-    OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                  \
-    err__ = pthread_mutex_lock(&(mutex_ptr_)->mutex);                   \
-    OPA_decr_int(&(mutex_ptr_)->num_queued_threads);                 \
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */      \
-    *(int *)(err_ptr_) = err__;                                 \
-    MPIU_DBG_MSG_P(THREAD,VERBOSE,"exit MPIU_Thread_mutex_lock %p", (mutex_ptr_));      \
-} while (0)
+        /* FIXME this used to be PTHREAD_MUTEX_ERRORCHECK_NP, but we    \
+         * had to change it for the thread granularity work when we     \
+         * needed recursive mutexes.  We should go through this code    \
+         * and see if there's any good way to implement error checked   \
+         * versions with the recursive mutexes. */                      \
+        pthread_mutexattr_init(&attr__);                                \
+        pthread_mutexattr_settype(&attr__, PTHREAD_MUTEX_ERRORCHECK_VALUE); \
+        err__ = pthread_mutex_init(&(mutex_ptr_)->mutex, &attr__);      \
+        if (err__)                                                      \
+            MPL_internal_sys_error_printf("pthread_mutex_init", err__,  \
+                                          "    %s:%d\n", __FILE__, __LINE__); \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+        MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
+    } while (0)
+
+#endif /* defined(MPICH_DEBUG_MUTEX) && defined(PTHREAD_MUTEX_ERRORCHECK_VALUE) */
+
+#define MPIU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)                 \
+    do {                                                                \
+        int err__;							\
+                                                                        \
+        MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to destroy MPIU_Thread_mutex %p", (mutex_ptr_)); \
+        err__ = pthread_mutex_destroy(&(mutex_ptr_)->mutex);            \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+    } while (0)
+
+
+#if !defined(MPICH_DEBUG_MUTEX)
+
+#define MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_)                    \
+    do {                                                                \
+        int err__;                                                      \
+        MPIU_DBG_MSG_P(THREAD,VERBOSE,"enter MPIU_Thread_mutex_lock %p", (mutex_ptr_)); \
+        OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                \
+        err__ = pthread_mutex_lock(&(mutex_ptr_)->mutex);               \
+        OPA_decr_int(&(mutex_ptr_)->num_queued_threads);                \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+        MPIU_DBG_MSG_P(THREAD,VERBOSE,"exit MPIU_Thread_mutex_lock %p", (mutex_ptr_)); \
+    } while (0)
+
 #else /* MPICH_DEBUG_MUTEX */
-#define MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_)             \
-do {                                                               \
-    int err__;                                                  \
-    MPIU_DBG_MSG_P(THREAD,VERBOSE,"enter MPIU_Thread_mutex_lock %p", (mutex_ptr_));      \
-    OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                  \
-    err__ = pthread_mutex_lock(&(mutex_ptr_)->mutex);                   \
-    OPA_decr_int(&(mutex_ptr_)->num_queued_threads);                 \
-    if (err__)                                                  \
-    {                                                           \
-        MPIU_DBG_MSG_S(THREAD,TERSE,"  mutex lock error: %s", MPIU_Strerror(err__));       \
-        MPL_internal_sys_error_printf("pthread_mutex_lock", err__,\
-                                       "    %s:%d\n", __FILE__, __LINE__);\
-    }                                                          \
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */     \
-    *(int *)(err_ptr_) = err__;                                \
-    MPIU_DBG_MSG_P(THREAD,VERBOSE,"exit MPIU_Thread_mutex_lock %p", (mutex_ptr_));      \
-} while (0)
-#endif
-
-#ifndef MPICH_DEBUG_MUTEX
-#define MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_)           \
-do {                                                               \
-    int err__;                                                  \
-                                                                \
-    MPIU_DBG_MSG_P(THREAD,TYPICAL,"MPIU_Thread_mutex_unlock %p", (mutex_ptr_));    \
-    err__ = pthread_mutex_unlock(&(mutex_ptr_)->mutex);                 \
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */      \
-    *(int *)(err_ptr_) = err__;                                 \
-} while (0)
+
+#define MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_)                    \
+    do {                                                                \
+        int err__;                                                      \
+        MPIU_DBG_MSG_P(THREAD,VERBOSE,"enter MPIU_Thread_mutex_lock %p", (mutex_ptr_)); \
+        OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                \
+        err__ = pthread_mutex_lock(&(mutex_ptr_)->mutex);               \
+        OPA_decr_int(&(mutex_ptr_)->num_queued_threads);                \
+        if (err__) {                                                    \
+            MPIU_DBG_MSG_S(THREAD,TERSE,"  mutex lock error: %s", MPIU_Strerror(err__)); \
+            MPL_internal_sys_error_printf("pthread_mutex_lock", err__,  \
+                                          "    %s:%d\n", __FILE__, __LINE__); \
+        }                                                               \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+        MPIU_DBG_MSG_P(THREAD,VERBOSE,"exit MPIU_Thread_mutex_lock %p", (mutex_ptr_)); \
+    } while (0)
+
+#endif /* MPICH_DEBUG_MUTEX */
+
+
+#if !defined(MPICH_DEBUG_MUTEX)
+
+#define MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_)                  \
+    do {                                                                \
+        int err__;                                                      \
+                                                                        \
+        MPIU_DBG_MSG_P(THREAD,TYPICAL,"MPIU_Thread_mutex_unlock %p", (mutex_ptr_)); \
+        err__ = pthread_mutex_unlock(&(mutex_ptr_)->mutex);             \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+    } while (0)
+
 #else /* MPICH_DEBUG_MUTEX */
-#define MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_)           \
-do {                                                               \
-    int err__;                                                  \
-                                                                \
-    MPIU_DBG_MSG_P(THREAD,VERBOSE,"MPIU_Thread_mutex_unlock %p", (mutex_ptr_));    \
-    err__ = pthread_mutex_unlock(&(mutex_ptr_)->mutex);                 \
-    if (err__)                                                  \
-    {                                                           \
-        MPIU_DBG_MSG_S(THREAD,TERSE,"  mutex unlock error: %s", MPIU_Strerror(err__));     \
-        MPL_internal_sys_error_printf("pthread_mutex_unlock", err__,         \
-                                       "    %s:%d\n", __FILE__, __LINE__);    \
-    }                                                           \
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */      \
-    *(int *)(err_ptr_) = err__;                                 \
-} while (0)
-#endif
-
-#ifndef MPICH_DEBUG_MUTEX
-#define MPIU_Thread_mutex_trylock(mutex_ptr_, flag_ptr_, err_ptr_)    \
-do {                                                                    \
-    int err__;                                                       \
-                                                                     \
-    err__ = pthread_mutex_trylock(&(mutex_ptr_)->mutex);             \
-    *(flag_ptr_) = (err__ == 0) ? TRUE : FALSE;                      \
-    MPIU_DBG_MSG_FMT(THREAD,VERBOSE,(MPIU_DBG_FDEST, "MPIU_Thread_mutex_trylock mutex=%p result=%s", (mutex_ptr_), (*(flag_ptr_) ? "success" : "failure")));    \
-    *(int *)(err_ptr_) = (err__ == EBUSY) ? MPIU_THREAD_SUCCESS : err__; \
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */              \
-} while (0)
+
+#define MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_)                  \
+    do {                                                                \
+        int err__;                                                      \
+                                                                        \
+        MPIU_DBG_MSG_P(THREAD,VERBOSE,"MPIU_Thread_mutex_unlock %p", (mutex_ptr_)); \
+        err__ = pthread_mutex_unlock(&(mutex_ptr_)->mutex);             \
+        if (err__) {                                                    \
+            MPIU_DBG_MSG_S(THREAD,TERSE,"  mutex unlock error: %s", MPIU_Strerror(err__)); \
+            MPL_internal_sys_error_printf("pthread_mutex_unlock", err__, \
+                                          "    %s:%d\n", __FILE__, __LINE__); \
+        }                                                               \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+    } while (0)
+
+#endif  /* MPICH_DEBUG_MUTEX */
+
+
+#if !defined(MPICH_DEBUG_MUTEX)
+
+#define MPIU_Thread_mutex_trylock(mutex_ptr_, flag_ptr_, err_ptr_)      \
+    do {                                                                \
+        int err__;                                                      \
+                                                                        \
+        err__ = pthread_mutex_trylock(&(mutex_ptr_)->mutex);            \
+        *(flag_ptr_) = (err__ == 0) ? TRUE : FALSE;                     \
+        MPIU_DBG_MSG_FMT(THREAD,VERBOSE,(MPIU_DBG_FDEST, "MPIU_Thread_mutex_trylock mutex=%p result=%s", (mutex_ptr_), (*(flag_ptr_) ? "success" : "failure"))); \
+        *(int *)(err_ptr_) = (err__ == EBUSY) ? MPIU_THREAD_SUCCESS : err__; \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+    } while (0)
+
 #else /* MPICH_DEBUG_MUTEX */
-#define MPIU_Thread_mutex_trylock(mutex_ptr_, flag_ptr_, err_ptr_)    \
-do {                                                                    \
-    int err__;                                                       \
-                                                                     \
-    err__ = pthread_mutex_trylock(&(mutex_ptr_)->mutex);             \
-    if (err__ && err__ != EBUSY)                                     \
-    {                                                                \
-        MPIU_DBG_MSG_S(THREAD,TERSE,"  mutex trylock error: %s", MPIU_Strerror(err__));    \
-        MPL_internal_sys_error_printf("pthread_mutex_trylock", err__,\
-                                       "    %s:%d\n", __FILE__, __LINE__);\
-    }                                                                \
-    *(flag_ptr_) = (err__ == 0) ? TRUE : FALSE;                      \
-    MPIU_DBG_MSG_FMT(THREAD,VERBOSE,(MPIU_DBG_FDEST, "MPIU_Thread_mutex_trylock mutex=%p result=%s", (mutex_ptr_), (*(flag_ptr_) ? "success" : "failure")));    \
-    *(int *)(err_ptr_) = (err__ == EBUSY) ? MPIU_THREAD_SUCCESS : err__; \
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */              \
-} while (0)
-#endif
+
+#define MPIU_Thread_mutex_trylock(mutex_ptr_, flag_ptr_, err_ptr_)      \
+    do {                                                                \
+        int err__;                                                      \
+                                                                        \
+        err__ = pthread_mutex_trylock(&(mutex_ptr_)->mutex);            \
+        if (err__ && err__ != EBUSY)                                    \
+        {                                                               \
+            MPIU_DBG_MSG_S(THREAD,TERSE,"  mutex trylock error: %s", MPIU_Strerror(err__)); \
+            MPL_internal_sys_error_printf("pthread_mutex_trylock", err__, \
+                                          "    %s:%d\n", __FILE__, __LINE__); \
+        }                                                               \
+        *(flag_ptr_) = (err__ == 0) ? TRUE : FALSE;                     \
+        MPIU_DBG_MSG_FMT(THREAD,VERBOSE,(MPIU_DBG_FDEST, "MPIU_Thread_mutex_trylock mutex=%p result=%s", (mutex_ptr_), (*(flag_ptr_) ? "success" : "failure"))); \
+        *(int *)(err_ptr_) = (err__ == EBUSY) ? MPIU_THREAD_SUCCESS : err__; \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+    } while (0)
+
+#endif /* MPICH_DEBUG_MUTEX */
+
 
 /*
  * Condition Variables
  */
 
 #define MPIU_Thread_cond_create(cond_ptr_, err_ptr_)                    \
-  do {                                                                  \
-      int err__;							\
+    do {                                                                \
+        int err__;							\
                                                                         \
-      err__ = pthread_cond_init((cond_ptr_), NULL);                     \
-      MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_cond %p", (cond_ptr_)); \
-      /* FIXME: convert error to an MPIU_THREAD_ERR value */            \
-      *(int *)(err_ptr_) = err__;                                       \
-  } while (0)
+        err__ = pthread_cond_init((cond_ptr_), NULL);                   \
+        MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_cond %p", (cond_ptr_)); \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+    } while (0)
 
 #define MPIU_Thread_cond_destroy(cond_ptr_, err_ptr_)                   \
-  do {                                                                  \
-      int err__;							\
+    do {                                                                \
+        int err__;							\
                                                                         \
-      MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to destroy MPIU_Thread_cond %p", (cond_ptr_)); \
-      err__ = pthread_cond_destroy(cond_ptr_);                          \
-      /* FIXME: convert error to an MPIU_THREAD_ERR value */            \
-      *(int *)(err_ptr_) = err__;                                       \
-  } while (0)
+        MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to destroy MPIU_Thread_cond %p", (cond_ptr_)); \
+        err__ = pthread_cond_destroy(cond_ptr_);                        \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+    } while (0)
 
 #define MPIU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_)		\
-do {                                                                       \
-    int err__;								\
+    do {                                                                \
+        int err__;                                                      \
     									\
-    /* The latest pthread specification says that cond_wait routines    \
-       aren't allowed to return EINTR,	                                \
-       but some of the older implementations still do. */		\
-    MPIU_DBG_MSG_FMT(THREAD,TYPICAL,(MPIU_DBG_FDEST,"Enter cond_wait on cond=%p mutex=%p",(cond_ptr_),(mutex_ptr_))) \
-    do									\
-    {									\
-        OPA_incr_int(&(mutex_ptr_)->num_queued_threads);              \
-	err__ = pthread_cond_wait((cond_ptr_), &(mutex_ptr_)->mutex);   \
-        OPA_decr_int(&(mutex_ptr_)->num_queued_threads);             \
-    }									\
-    while (err__ == EINTR);						\
+        /* The latest pthread specification says that cond_wait         \
+         * routines aren't allowed to return EINTR, but some of the     \
+         * older implementations still do. */                           \
+        MPIU_DBG_MSG_FMT(THREAD,TYPICAL,(MPIU_DBG_FDEST,"Enter cond_wait on cond=%p mutex=%p",(cond_ptr_),(mutex_ptr_))) \
+            do {                                                        \
+                OPA_incr_int(&(mutex_ptr_)->num_queued_threads);        \
+                err__ = pthread_cond_wait((cond_ptr_), &(mutex_ptr_)->mutex); \
+                OPA_decr_int(&(mutex_ptr_)->num_queued_threads);        \
+            }                                                           \
+            while (err__ == EINTR);                                     \
 									\
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */		\
-    *(int *)(err_ptr_) = err__;                                         \
-    MPIU_Assert_fmt_msg(err__ == 0,                   \
-                        ("cond_wait failed, err=%d (%s)",err__,strerror(err__))); \
-    MPIU_DBG_MSG_FMT(THREAD,TYPICAL,(MPIU_DBG_FDEST,"Exit cond_wait on cond=%p mutex=%p",(cond_ptr_),(mutex_ptr_))) \
-} while (0)
-
-#define MPIU_Thread_cond_broadcast(cond_ptr_, err_ptr_)		\
-do {                                                               \
-    int err__;							\
-    								\
-    MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to cond_broadcast on MPIU_Thread_cond %p", (cond_ptr_));    \
-    err__ = pthread_cond_broadcast(cond_ptr_);			\
-								\
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
-    *(int *)(err_ptr_) = err__;                                 \
-    MPIU_Assert_fmt_msg(err__ == 0,                     \
-                        ("cond_broadcast failed, err__=%d (%s)",err__,strerror(err__))); \
-} while (0)
-
-#define MPIU_Thread_cond_signal(cond_ptr_, err_ptr_)		\
-do {                                                               \
-    int err__;							\
-								\
-    MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to cond_signal on MPIU_Thread_cond %p", (cond_ptr_));    \
-    err__ = pthread_cond_signal(cond_ptr_);			\
-								\
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
-    *(int *)(err_ptr_) = err__;                                 \
-    MPIU_Assert_fmt_msg(err__ == 0,                                     \
-                        ("cond_signal failed, err__=%d (%s)",err__,strerror(err__))); \
-} while (0)
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */		\
+        *(int *)(err_ptr_) = err__;                                     \
+        MPIU_Assert_fmt_msg(err__ == 0,                                 \
+                            ("cond_wait failed, err=%d (%s)",err__,strerror(err__))); \
+        MPIU_DBG_MSG_FMT(THREAD,TYPICAL,(MPIU_DBG_FDEST,"Exit cond_wait on cond=%p mutex=%p",(cond_ptr_),(mutex_ptr_))); \
+    } while (0)
+
+#define MPIU_Thread_cond_broadcast(cond_ptr_, err_ptr_)                 \
+    do {                                                                \
+        int err__;							\
+                                                                        \
+        MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to cond_broadcast on MPIU_Thread_cond %p", (cond_ptr_)); \
+        err__ = pthread_cond_broadcast(cond_ptr_);			\
+                                                                        \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+        MPIU_Assert_fmt_msg(err__ == 0,                                 \
+                            ("cond_broadcast failed, err__=%d (%s)",err__,strerror(err__))); \
+    } while (0)
+
+#define MPIU_Thread_cond_signal(cond_ptr_, err_ptr_)                    \
+    do {                                                                \
+        int err__;							\
+                                                                        \
+        MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to cond_signal on MPIU_Thread_cond %p", (cond_ptr_)); \
+        err__ = pthread_cond_signal(cond_ptr_);                         \
+                                                                        \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+        MPIU_Assert_fmt_msg(err__ == 0,                                 \
+                            ("cond_signal failed, err__=%d (%s)",err__,strerror(err__))); \
+    } while (0)
 
 
 /*
@@ -285,43 +303,43 @@ do {                                                               \
  */
 
 #define MPIU_Thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_)	\
-do {                                                                       \
-    int err__;								\
+    do {                                                                \
+        int err__;                                                      \
     									\
-    err__ = pthread_key_create((tls_ptr_), (exit_func_ptr_));		\
+        err__ = pthread_key_create((tls_ptr_), (exit_func_ptr_));       \
 									\
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */		\
-    *(int *)(err_ptr_) = err__;                                         \
-} while (0)
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */		\
+        *(int *)(err_ptr_) = err__;                                     \
+    } while (0)
 
 #define MPIU_Thread_tls_destroy(tls_ptr_, err_ptr_)		\
-do {                                                               \
-    int err__;							\
+    do {                                                        \
+        int err__;                                              \
     								\
-    err__ = pthread_key_delete(*(tls_ptr_));			\
+        err__ = pthread_key_delete(*(tls_ptr_));                \
 								\
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
-    *(int *)(err_ptr_) = err__;                                 \
-} while (0)
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
+        *(int *)(err_ptr_) = err__;                             \
+    } while (0)
 
-#define MPIU_Thread_tls_set(tls_ptr_, value_, err_ptr_)		\
-do {                                                               \
-    int err__;							\
-								\
-    err__ = pthread_setspecific(*(tls_ptr_), (value_));		\
-								\
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
-    *(int *)(err_ptr_) = err__;                             \
-    MPIU_Assert_fmt_msg(err__ == 0,                     \
-                        ("tls_set failed, err__=%d (%s)",err__,strerror(err__))); \
-} while (0)
+#define MPIU_Thread_tls_set(tls_ptr_, value_, err_ptr_)                 \
+    do {                                                                \
+        int err__;							\
+                                                                        \
+        err__ = pthread_setspecific(*(tls_ptr_), (value_));		\
+                                                                        \
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */          \
+        *(int *)(err_ptr_) = err__;                                     \
+        MPIU_Assert_fmt_msg(err__ == 0,                                 \
+                            ("tls_set failed, err__=%d (%s)",err__,strerror(err__))); \
+    } while (0)
 
 #define MPIU_Thread_tls_get(tls_ptr_, value_ptr_, err_ptr_)	\
-do {                                                               \
-    *(value_ptr_) = pthread_getspecific(*(tls_ptr_));		\
+    do {                                                        \
+        *(value_ptr_) = pthread_getspecific(*(tls_ptr_));       \
 								\
-    /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
-    *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;                   \
-} while (0)
+        /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
+        *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;               \
+    } while (0)
 
 #endif /* MPIU_THREAD_POSIX_FUNCS_H_INCLUDED */
diff --git a/src/util/thread/mpiu_thread_posix_types.h b/src/util/thread/mpiu_thread_posix_types.h
index 4c793a1..024e590 100644
--- a/src/util/thread/mpiu_thread_posix_types.h
+++ b/src/util/thread/mpiu_thread_posix_types.h
@@ -15,9 +15,9 @@ typedef struct {
     pthread_mutex_t mutex;
     OPA_int_t num_queued_threads;
 } MPIU_Thread_mutex_t;
-typedef pthread_cond_t  MPIU_Thread_cond_t;
-typedef pthread_t       MPIU_Thread_id_t;
-typedef pthread_key_t   MPIU_Thread_tls_t;
+typedef pthread_cond_t MPIU_Thread_cond_t;
+typedef pthread_t MPIU_Thread_id_t;
+typedef pthread_key_t MPIU_Thread_tls_t;
 
 #define MPIU_THREAD_TLS_T_NULL 0
 
diff --git a/src/util/thread/mpiu_thread_priv.h b/src/util/thread/mpiu_thread_priv.h
index 25afaef..609e8cb 100644
--- a/src/util/thread/mpiu_thread_priv.h
+++ b/src/util/thread/mpiu_thread_priv.h
@@ -105,7 +105,7 @@ extern MPIU_TLS_SPECIFIER MPICH_PerThread_t MPIU_Thread;
 #define MPIU_THREADPRIV_DECL
 #define MPIU_THREADPRIV_GET
 #define MPIU_THREADPRIV_FIELD(a_) (MPIU_Thread.a_)
-#define MPIU_THREADPRIV_FINALIZE do{}while(0)
+#define MPIU_THREADPRIV_FINALIZE do {} while (0)
 
 #endif /* defined(MPIU_TLS_SPECIFIER) */
 
diff --git a/src/util/thread/mpiu_thread_solaris_funcs.h b/src/util/thread/mpiu_thread_solaris_funcs.h
index dba7b76..d3cdff4 100644
--- a/src/util/thread/mpiu_thread_solaris_funcs.h
+++ b/src/util/thread/mpiu_thread_solaris_funcs.h
@@ -14,27 +14,27 @@
 /* MPIU_Thread_create() defined in mpiu_thread.c */
 
 #define MPIU_Thread_exit()			\
-do {                                               \
-    thr_exit(NULL);				\
-} while (0)
+    do {                                        \
+        thr_exit(NULL);				\
+    } while (0)
 
 #define MPIU_Thread_self(id_ptr_)		\
-do {                                               \
-    *(id_ptr_) = thr_self();			\
-} while (0)
+    do {                                        \
+        *(id_ptr_) = thr_self();                \
+    } while (0)
 
-#define MPIU_Thread_same(id1_ptr_, id2_ptr_, same_ptr_)	\
-do {                                                       \
-    *(same_ptr_) = (*(id1_ptr_) == *(id2_ptr_)) ? TRUE : FALSE;		\
-} while (0)
+#define MPIU_Thread_same(id1_ptr_, id2_ptr_, same_ptr_)                 \
+    do {                                                                \
+        *(same_ptr_) = (*(id1_ptr_) == *(id2_ptr_)) ? TRUE : FALSE;     \
+    } while (0)
 
-#define MPIU_Thread_yield(mutex_ptr_)              \
-do {                                               \
-    int err;                                            \
-    MPIU_Thread_mutex_unlock(mutex_ptr_, &err);         \
-    thr_yield();                                   \
-    MPIU_Thread_mutex_lock(mutex_ptr_, &err);      \
-} while (0)
+#define MPIU_Thread_yield(mutex_ptr_)                   \
+    do {                                                \
+        int err;                                        \
+        MPIU_Thread_mutex_unlock(mutex_ptr_, &err);     \
+        thr_yield();                                    \
+        MPIU_Thread_mutex_lock(mutex_ptr_, &err);       \
+    } while (0)
 
 
 /*
@@ -42,65 +42,57 @@ do {                                               \
  */
 
 #define MPIU_Thread_mutex_create(mutex_ptr_, err_ptr_)	\
-do {                                                       \
-    *(mutex_ptr_) = DEFAULTMUTEX;			\
-    if ((err_ptr_) == NULL)				\
-    { 							\
-	*(err_ptr_) = MPIU_THREAD_SUCCESS;		\
-    }							\
-} while (0)
-
-#define MPIU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)		\
-do {                                                               \
-    if ((err_ptr_) == NULL)					\
-    { 								\
-	mutex_destroy(mutex_ptr_);				\
-    }								\
-    else							\
-    {								\
-	*(err_ptr_) = mutex_destroy(mutex_ptr_);		\
-	/* FIXME: convert error to an MPIU_THREAD_ERR value */	\
-    }								\
-} while (0)
-
-#define MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_)		\
-do {                                                               \
-    if ((err_ptr_) == NULL)					\
-    { 								\
-	mutex_lock(mutex_ptr_);					\
-    }								\
-    else							\
-    {								\
-	*(err_ptr_) = mutex_lock(mutex_ptr_);			\
-	/* FIXME: convert error to an MPIU_THREAD_ERR value */	\
-    }								\
-} while (0)
-
-#define MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_)		\
-do {                                                               \
-    if ((err_ptr_) == NULL)					\
-    { 								\
-	mutex_unlock(mutex_ptr_);				\
-    }								\
-    else							\
-    {								\
-	*(err_ptr_) = mutex_unlock(mutex_ptr_);			\
-	/* FIXME: convert error to an MPIU_THREAD_ERR value */	\
-    }								\
-} while (0)
+    do {                                                \
+        *(mutex_ptr_) = DEFAULTMUTEX;			\
+        if ((err_ptr_) == NULL) {                       \
+            *(err_ptr_) = MPIU_THREAD_SUCCESS;		\
+        }                                               \
+    } while (0)
+
+#define MPIU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)                 \
+    do {                                                                \
+        if ((err_ptr_) == NULL) {                                       \
+            mutex_destroy(mutex_ptr_);                                  \
+        }								\
+        else {                                                          \
+            *(err_ptr_) = mutex_destroy(mutex_ptr_);                    \
+            /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
+        }								\
+    } while (0)
+
+#define MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_)                    \
+    do {                                                                \
+        if ((err_ptr_) == NULL) {                                       \
+            mutex_lock(mutex_ptr_);					\
+        }								\
+        else {                                                          \
+            *(err_ptr_) = mutex_lock(mutex_ptr_);			\
+            /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
+        }								\
+    } while (0)
+
+#define MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_)                  \
+    do {                                                                \
+        if ((err_ptr_) == NULL) {                                       \
+            mutex_unlock(mutex_ptr_);                                   \
+        }								\
+        else {                                                          \
+            *(err_ptr_) = mutex_unlock(mutex_ptr_);			\
+            /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
+        }								\
+    } while (0)
 
 #define MPIU_Thread_mutex_trylock(mutex_ptr_, flag_ptr_, err_ptr_)	\
-do {                                                                       \
-    int err__;								\
+    do {                                                                \
+        int err__;                                                      \
     									\
-    err__ = mutex_trylock(mutex_ptr_);					\
-    *(flag_ptr_) = (err__ == 0) ? TRUE : FALSE;				\
-    if ((err_ptr_) != NULL)						\
-    {									\
-	*(err_ptr_) = (err__ == EBUSY) : MPIU_THREAD_SUCCESS ? err__;	\
-	/* FIXME: convert error to an MPIU_THREAD_ERR value */		\
-    }									\
-} while (0)
+        err__ = mutex_trylock(mutex_ptr_);                              \
+        *(flag_ptr_) = (err__ == 0) ? TRUE : FALSE;                     \
+        if ((err_ptr_) != NULL) {                                       \
+            *(err_ptr_) = (err__ == EBUSY) : MPIU_THREAD_SUCCESS ? err__; \
+            /* FIXME: convert error to an MPIU_THREAD_ERR value */      \
+        }                                                               \
+    } while (0)
 
 
 /*
@@ -108,123 +100,109 @@ do {                                                                       \
  */
 
 #define MPIU_Thread_cond_create(cond_ptr_, err_ptr_)	\
-do {                                                       \
-    *(cond_ptr_) = DEFAULTCV;				\
-    if ((err_ptr_) == NULL)				\
-    { 							\
-	*(err_ptr_) = MPIU_THREAD_SUCCESS;		\
-    }							\
-} while (0)
-
-#define MPIU_Thread_cond_destroy(cond_ptr_, err_ptr_)		\
-do {                                                               \
-    if ((err_ptr_) == NULL)					\
-    { 								\
-	cond_destroy(cond_ptr_);				\
-    }								\
-    else							\
-    {								\
-	*(err_ptr_) = cond_destroy(cond_ptr_);			\
-	/* FIXME: convert error to a MPIU_THREAD_ERR value */	\
-    }								\
-} while (0)
-
-#define MPIU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_)	\
-do {                                                               \
-    if ((err_ptr_) == NULL)					\
-    { 								\
-	cond_wait((cond_ptr_), (mutex_ptr_));			\
-    }								\
-    else							\
-    {								\
-	*(err_ptr_) = cond_wait((cond_ptr_), (mutex_ptr_));	\
-	/* FIXME: convert error to a MPIU_THREAD_ERR value */	\
-    }								\
-} while (0)
-
-#define MPIU_Thread_cond_broadcast(cond_ptr_, err_ptr_)		\
-do {                                                               \
-    if ((err_ptr_) == NULL)					\
-    { 								\
-	cond_broadcast(cond_ptr_);				\
-    }								\
-    else							\
-    {								\
-	*(err_ptr_) = cond_broadcast(cond_ptr_);		\
-	/* FIXME: convert error to a MPIU_THREAD_ERR value */	\
-    }								\
-} while (0)
-
-#define MPIU_Thread_cond_signal(cond_ptr_, err_ptr_)		\
-do {                                                               \
-    if ((err_ptr_) == NULL)					\
-    { 								\
-	cond_signal(cond_ptr_);					\
-    }								\
-    else							\
-    {								\
-	*(err_ptr_) = cond_signal(cond_ptr_);			\
-	/* FIXME: convert error to a MPIU_THREAD_ERR value */	\
-    }								\
-} while (0)
+    do {                                                \
+        *(cond_ptr_) = DEFAULTCV;                       \
+        if ((err_ptr_) == NULL) {                       \
+            *(err_ptr_) = MPIU_THREAD_SUCCESS;		\
+        }                                               \
+    } while (0)
+
+#define MPIU_Thread_cond_destroy(cond_ptr_, err_ptr_)                   \
+    do {                                                                \
+        if ((err_ptr_) == NULL) {                                       \
+            cond_destroy(cond_ptr_);                                    \
+        }								\
+        else {                                                          \
+            *(err_ptr_) = cond_destroy(cond_ptr_);			\
+            /* FIXME: convert error to a MPIU_THREAD_ERR value */	\
+        }								\
+    } while (0)
+
+#define MPIU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_)          \
+    do {                                                                \
+        if ((err_ptr_) == NULL) {                                       \
+            cond_wait((cond_ptr_), (mutex_ptr_));			\
+        }								\
+        else {                                                          \
+            *(err_ptr_) = cond_wait((cond_ptr_), (mutex_ptr_));         \
+            /* FIXME: convert error to a MPIU_THREAD_ERR value */	\
+        }								\
+    } while (0)
+
+#define MPIU_Thread_cond_broadcast(cond_ptr_, err_ptr_)                 \
+    do {                                                                \
+        if ((err_ptr_) == NULL) {                                       \
+            cond_broadcast(cond_ptr_);                                  \
+        }								\
+        else {                                                          \
+            *(err_ptr_) = cond_broadcast(cond_ptr_);                    \
+            /* FIXME: convert error to a MPIU_THREAD_ERR value */	\
+        }								\
+    } while (0)
+
+#define MPIU_Thread_cond_signal(cond_ptr_, err_ptr_)                    \
+    do {                                                                \
+        if ((err_ptr_) == NULL) {                                       \
+            cond_signal(cond_ptr_);					\
+        }								\
+        else {                                                          \
+            *(err_ptr_) = cond_signal(cond_ptr_);			\
+            /* FIXME: convert error to a MPIU_THREAD_ERR value */	\
+        }								\
+    } while (0)
 
 
 /*
  * Thread Local Storage
  */
-typedef void (*MPIU_Thread_tls_exit_func_t)(void * value);
+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)						\
-    {									\
-	thr_keycreate((tls_ptr), (exit_func_ptr));			\
-    }									\
-    else								\
-    {									\
-	*(err_ptr_) = thr_keycreate((tls_ptr), (exit_func_ptr));	\
-	/* FIXME: convert error to a MPIU_THREAD_ERR value */		\
-    }									\
-} while (0)
-
-#define MPIU_Thread_tls_destroy(tls_ptr_, err_ptr_)										  \
-do {                                                                                                                                 \
-    /*																  \
-     * FIXME: Solaris threads does not have a key destroy.  We need to create equivalent functionality to prevent a callback from \
-     * occuring when a thread exits after the TLS is destroyed.  This is the only way to prevent subsystems that have shutdown	  \
-     * from continuing to receive callbacks.											  \
-     */																  \
-    if ((err_ptr_) != NULL)													  \
-    {																  \
-	*(err_ptr) = MPIU_THREAD_SUCCESS;											  \
-    }																  \
-} while (0)
-
-#define MPIU_Thread_tls_set(tls_ptr, value_)			\
-do {                                                               \
-    if ((err_ptr_) == NULL)					\
-    {								\
-	thr_setspecific(*(tls_ptr), (value_));			\
-    }								\
-    else							\
-    {								\
-	*(err_ptr_) = thr_setspecific(*(tls_ptr), (value_));	\
-	/* FIXME: convert error to a MPIU_THREAD_ERR value */	\
-    }								\
-} while (0)
-
-#define MPIU_Thread_tls_get(tls_ptr, value_ptr_)				\
-do {                                                                       \
-    if ((err_ptr_) == NULL)						\
-    {									\
-	thr_setspecific(*(tls_ptr), (value_ptr_));			\
-    }									\
-    else								\
-    {									\
-	*(err_ptr_) = thr_setspecific(*(tls_ptr), (value_ptr_));	\
-	/* FIXME: convert error to a MPIU_THREAD_ERR value */		\
-    }									\
-} while (0)
+    do {                                                                \
+        if ((err_ptr_) == NULL) {                                       \
+            thr_keycreate((tls_ptr), (exit_func_ptr));			\
+        }                                                               \
+        else {								\
+            *(err_ptr_) = thr_keycreate((tls_ptr), (exit_func_ptr));	\
+            /* FIXME: convert error to a MPIU_THREAD_ERR value */       \
+        }                                                               \
+    } while (0)
+
+#define MPIU_Thread_tls_destroy(tls_ptr_, err_ptr_)                     \
+    do {                                                                \
+        /*                                                              \
+         * FIXME: Solaris threads does not have a key destroy.  We      \
+         * need to create equivalent functionality to prevent a         \
+         * callback from occuring when a thread exits after the TLS is  \
+         * destroyed.  This is the only way to prevent subsystems that  \
+         * have shutdown from continuing to receive callbacks.          \
+         */                                                             \
+        if ((err_ptr_) != NULL) {                                       \
+            *(err_ptr) = MPIU_THREAD_SUCCESS;                           \
+        }                                                               \
+    } while (0)
+
+#define MPIU_Thread_tls_set(tls_ptr, value_)                            \
+    do {                                                                \
+        if ((err_ptr_) == NULL) {                                       \
+            thr_setspecific(*(tls_ptr), (value_));			\
+        }								\
+        else {                                                          \
+            *(err_ptr_) = thr_setspecific(*(tls_ptr), (value_));	\
+            /* FIXME: convert error to a MPIU_THREAD_ERR value */	\
+        }								\
+    } while (0)
+
+#define MPIU_Thread_tls_get(tls_ptr, value_ptr_)                        \
+    do {                                                                \
+        if ((err_ptr_) == NULL) {                                       \
+            thr_setspecific(*(tls_ptr), (value_ptr_));			\
+        }                                                               \
+        else {								\
+            *(err_ptr_) = thr_setspecific(*(tls_ptr), (value_ptr_));	\
+            /* FIXME: convert error to a MPIU_THREAD_ERR value */       \
+        }                                                               \
+    } while (0)
 
 #endif /* MPIU_THREAD_SOLARIS_FUNCS_H_INCLUDED */
diff --git a/src/util/thread/mpiu_thread_win_funcs.h b/src/util/thread/mpiu_thread_win_funcs.h
index ff6cd9f..0280b2c 100644
--- a/src/util/thread/mpiu_thread_win_funcs.h
+++ b/src/util/thread/mpiu_thread_win_funcs.h
@@ -7,74 +7,63 @@
 
 #ifndef MPIU_THREAD_WIN_FUNCS_H_INCLUDED
 #define MPIU_THREAD_WIN_FUNCS_H_INCLUDED
+
 /*
  * Thread Local Storage
  */
 
 #define MPIU_Thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_)	\
-do{									\
-    *(tls_ptr_) = TlsAlloc();		                                \
-    if ((err_ptr_) != NULL)                                             \
-    {                                                                   \
-        if (*(tls_ptr_) == TLS_OUT_OF_INDEXES)				\
-        {								\
-	    *(int *)(err_ptr_) = GetLastError();			\
-        }								\
-        else                                                            \
-        {                                                               \
-            *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;                \
+    do {                                                                \
+        *(tls_ptr_) = TlsAlloc();                                       \
+        if ((err_ptr_) != NULL) {                                       \
+            if (*(tls_ptr_) == TLS_OUT_OF_INDEXES) {                    \
+                *(int *)(err_ptr_) = GetLastError();			\
+            }								\
+            else {                                                      \
+                *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;               \
+            }                                                           \
         }                                                               \
-    }                                                                   \
-}while(0)
+    } while (0)
 
 #define MPIU_Thread_tls_destroy(tls_ptr_, err_ptr_)		\
-do{								\
-    BOOL result__;                                              \
-    result__ = TlsFree(*(tls_ptr_));                            \
-    if ((err_ptr_) != NULL)                                     \
-    {                                                           \
-        if (result__)                                           \
-        {                                                       \
-            *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;        \
+    do {                                                        \
+        BOOL result__;                                          \
+        result__ = TlsFree(*(tls_ptr_));                        \
+        if ((err_ptr_) != NULL) {                               \
+            if (result__) {                                     \
+                *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;       \
+            }                                                   \
+            else {                                              \
+                *(int *)(err_ptr_) = GetLastError();		\
+            }							\
         }                                                       \
-        else                                                    \
-        {							\
-	    *(int *)(err_ptr_) = GetLastError();		\
-        }							\
-    }                                                           \
-}while(0)
+    } while (0)
 
 #define MPIU_Thread_tls_set(tls_ptr_, value_, err_ptr_)		\
-do{								\
-    BOOL result__;                                              \
-    result__ = TlsSetValue(*(tls_ptr_), (value_));		\
-    if ((err_ptr_) != NULL)                                     \
-    {                                                           \
-        if (result__)                                           \
-        {                                                       \
-            *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;        \
+    do {                                                        \
+        BOOL result__;                                          \
+        result__ = TlsSetValue(*(tls_ptr_), (value_));		\
+        if ((err_ptr_) != NULL) {                               \
+            if (result__) {                                     \
+                *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;       \
+            }                                                   \
+            else {                                              \
+                *(int *)(err_ptr_) = GetLastError();		\
+            }							\
         }                                                       \
-        else                                                    \
-        {							\
-	    *(int *)(err_ptr_) = GetLastError();		\
-        }							\
-    }                                                           \
-}while(0)
+    } while (0)
 
-#define MPIU_Thread_tls_get(tls_ptr_, value_ptr_, err_ptr_)	\
-do{								\
-    *((void **)value_ptr_) = TlsGetValue(*(tls_ptr_));		        \
-    if ((err_ptr_) != NULL)                                     \
-    {                                                           \
-        if (*(value_ptr_) == 0 && GetLastError() != NO_ERROR)	\
-        {							\
-	    *(int *)(err_ptr_) = GetLastError();		\
-        }							\
-        else                                                    \
-        {                                                       \
-            *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;        \
-        }                                                       \
-    }                                                           \
-}while(0)
+#define MPIU_Thread_tls_get(tls_ptr_, value_ptr_, err_ptr_)             \
+    do {								\
+        *((void **)value_ptr_) = TlsGetValue(*(tls_ptr_));              \
+        if ((err_ptr_) != NULL) {                                       \
+            if (*(value_ptr_) == 0 && GetLastError() != NO_ERROR) {     \
+                *(int *)(err_ptr_) = GetLastError();                    \
+            }                                                           \
+            else {                                                      \
+                *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;               \
+            }                                                           \
+        }                                                               \
+    } while (0)
 
 #endif /* MPIU_THREAD_WIN_FUNCS_H_INCLUDED */
diff --git a/src/util/thread/mpiu_thread_win_types.h b/src/util/thread/mpiu_thread_win_types.h
index c5cde26..a2d3286 100644
--- a/src/util/thread/mpiu_thread_win_types.h
+++ b/src/util/thread/mpiu_thread_win_types.h
@@ -5,10 +5,10 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-/* For "historical" reasons windows.h includes winsock.h 
+/* For "historical" reasons windows.h includes winsock.h
  * internally and WIN32_MEAN_AND_LEAN is to be defined
- * if we plan to include winsock2.h later on -- in the 
- * include hierarchy -- to prevent type redefinition 
+ * if we plan to include winsock2.h later on -- in the
+ * include hierarchy -- to prevent type redefinition
  * errors...
  */
 #ifndef MPIU_THREAD_WIN_TYPES_H_INCLUDED
@@ -22,13 +22,11 @@ typedef HANDLE MPIU_Thread_mutex_t;
 typedef HANDLE MPIU_Thread_id_t;
 typedef DWORD MPIU_Thread_tls_t;
 
-typedef struct MPIU_Thread_cond_fifo_t
-{
+typedef struct MPIU_Thread_cond_fifo_t {
     HANDLE event;
     struct MPIU_Thread_cond_fifo_t *next;
 } MPIU_Thread_cond_fifo_t;
-typedef struct MPIU_Thread_cond_t
-{
+typedef struct MPIU_Thread_cond_t {
     MPIU_Thread_tls_t tls;
     MPIU_Thread_mutex_t fifo_mutex;
     MPIU_Thread_cond_fifo_t *fifo_head, *fifo_tail;

http://git.mpich.org/mpich.git/commitdiff/8c3a1def822759e116df9a614d64b8012d3794a9

commit 8c3a1def822759e116df9a614d64b8012d3794a9
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Aug 14 14:35:22 2015 -0500

    Added search/replace script to the maint directory.
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/maint/mpich-replace.sh b/maint/mpich-replace.sh
new file mode 100755
index 0000000..2d56707
--- /dev/null
+++ b/maint/mpich-replace.sh
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+grep -r $1 * | cut -f1 -d':' | uniq | xargs sed -i "s/$1/$2/g"

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

commit c7ff730a5252a06f524ae1a72914b9967a27906c
Author: Halim Amer <aamer at anl.gov>
Date:   Fri Aug 14 11:12:16 2015 -0500

    Refactor some MPI_ macros into MPIU_
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/src/binding/fortran/mpif_h/buildiface b/src/binding/fortran/mpif_h/buildiface
index 9f5d95f..f6571fb 100755
--- a/src/binding/fortran/mpif_h/buildiface
+++ b/src/binding/fortran/mpif_h/buildiface
@@ -4416,7 +4416,7 @@ MPIR_Comm_copy_attr_f77_proxy(
     MPI_Fint ierr = 0;
     MPI_Fint fhandle = (MPI_Fint)comm;
     MPI_Fint fkeyval = (MPI_Fint)keyval;
-    MPI_Fint fvalue = (MPI_Fint) MPI_VOID_PTR_CAST_TO_MPI_AINT (value);
+    MPI_Fint fvalue = (MPI_Fint) MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
     MPI_Fint* fextra  = (MPI_Fint*)extra_state;
     MPI_Fint fnew = 0;
     MPI_Fint fflag = 0;
@@ -4424,7 +4424,7 @@ MPIR_Comm_copy_attr_f77_proxy(
     ((F77_CopyFunction*)user_function)( &fhandle, &fkeyval, fextra, &fvalue, &fnew, &fflag, &ierr );
 
     *flag = MPIR_FROM_FLOG(fflag);
-    *new_value = MPI_AINT_CAST_TO_VOID_PTR ((MPI_Aint) fnew);
+    *new_value = MPIU_AINT_CAST_TO_VOID_PTR ((MPI_Aint) fnew);
     return (int)ierr;
 }
 
@@ -4447,7 +4447,7 @@ MPIR_Comm_delete_attr_f77_proxy(
     MPI_Fint ierr = 0;
     MPI_Fint fhandle = (MPI_Fint)comm;
     MPI_Fint fkeyval = (MPI_Fint)keyval;
-    MPI_Fint fvalue = (MPI_Fint) MPI_VOID_PTR_CAST_TO_MPI_AINT (value);
+    MPI_Fint fvalue = (MPI_Fint) MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
     MPI_Fint* fextra  = (MPI_Fint*)extra_state;
 
     ((F77_DeleteFunction*)user_function)( &fhandle, &fkeyval, &fvalue, fextra, &ierr );
@@ -5429,7 +5429,7 @@ MPIR_Type_copy_attr_f90_proxy(
     MPI_Fint ierr = 0;
     MPI_Fint fhandle = (MPI_Fint)datatype;
     MPI_Fint fkeyval = (MPI_Fint)keyval;
-    MPI_Aint fvalue = MPI_VOID_PTR_CAST_TO_MPI_AINT (value);
+    MPI_Aint fvalue = MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
     MPI_Aint* fextra  = (MPI_Aint*)extra_state;
     MPI_Aint fnew = 0;
     MPI_Fint fflag = 0;
@@ -5437,7 +5437,7 @@ MPIR_Type_copy_attr_f90_proxy(
     ((F90_CopyFunction*)user_function)( &fhandle, &fkeyval, fextra, &fvalue, &fnew, &fflag, &ierr );
 
     *flag = MPIR_FROM_FLOG(fflag);
-    *new_value = MPI_AINT_CAST_TO_VOID_PTR (fnew);
+    *new_value = MPIU_AINT_CAST_TO_VOID_PTR (fnew);
     return (int)ierr;
 }
 
@@ -5460,7 +5460,7 @@ MPIR_Type_delete_attr_f90_proxy(
     MPI_Fint ierr = 0;
     MPI_Fint fhandle = (MPI_Fint)datatype;
     MPI_Fint fkeyval = (MPI_Fint)keyval;
-    MPI_Aint fvalue = MPI_VOID_PTR_CAST_TO_MPI_AINT (value);
+    MPI_Aint fvalue = MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
     MPI_Aint* fextra  = (MPI_Aint*)extra_state;
 
     ((F90_DeleteFunction*)user_function)( &fhandle, &fkeyval, &fvalue, fextra, &ierr );
@@ -5493,7 +5493,7 @@ MPIR_Comm_copy_attr_f90_proxy(
     MPI_Fint ierr = 0;
     MPI_Fint fhandle = (MPI_Fint)comm;
     MPI_Fint fkeyval = (MPI_Fint)keyval;
-    MPI_Aint fvalue = MPI_VOID_PTR_CAST_TO_MPI_AINT (value);
+    MPI_Aint fvalue = MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
     MPI_Aint* fextra  = (MPI_Aint*)extra_state;
     MPI_Aint fnew = 0;
     MPI_Fint fflag = 0;
@@ -5501,7 +5501,7 @@ MPIR_Comm_copy_attr_f90_proxy(
     ((F90_CopyFunction*)user_function)( &fhandle, &fkeyval, fextra, &fvalue, &fnew, &fflag, &ierr );
 
     *flag = MPIR_FROM_FLOG(fflag);
-    *new_value = MPI_AINT_CAST_TO_VOID_PTR (fnew);
+    *new_value = MPIU_AINT_CAST_TO_VOID_PTR (fnew);
     return (int)ierr;
 }
 
@@ -5524,7 +5524,7 @@ MPIR_Comm_delete_attr_f90_proxy(
     MPI_Fint ierr = 0;
     MPI_Fint fhandle = (MPI_Fint)comm;
     MPI_Fint fkeyval = (MPI_Fint)keyval;
-    MPI_Aint fvalue = MPI_VOID_PTR_CAST_TO_MPI_AINT (value);
+    MPI_Aint fvalue = MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
     MPI_Aint* fextra  = (MPI_Aint*)extra_state;
 
     ((F90_DeleteFunction*)user_function)( &fhandle, &fkeyval, &fvalue, fextra, &ierr );
@@ -5557,7 +5557,7 @@ MPIR_Win_copy_attr_f90_proxy(
     MPI_Fint ierr = 0;
     MPI_Fint fhandle = (MPI_Fint)win;
     MPI_Fint fkeyval = (MPI_Fint)keyval;
-    MPI_Aint fvalue = MPI_VOID_PTR_CAST_TO_MPI_AINT (value);
+    MPI_Aint fvalue = MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
     MPI_Aint* fextra  = (MPI_Aint*)extra_state;
     MPI_Aint fnew = 0;
     MPI_Fint fflag = 0;
@@ -5565,7 +5565,7 @@ MPIR_Win_copy_attr_f90_proxy(
     ((F90_CopyFunction*)user_function)( &fhandle, &fkeyval, fextra, &fvalue, &fnew, &fflag, &ierr );
 
     *flag = MPIR_FROM_FLOG(fflag);
-    *new_value = MPI_AINT_CAST_TO_VOID_PTR (fnew);
+    *new_value = MPIU_AINT_CAST_TO_VOID_PTR (fnew);
     return (int)ierr;
 }
 
@@ -5588,7 +5588,7 @@ MPIR_Win_delete_attr_f90_proxy(
     MPI_Fint ierr = 0;
     MPI_Fint fhandle = (MPI_Fint)win;
     MPI_Fint fkeyval = (MPI_Fint)keyval;
-    MPI_Aint fvalue = MPI_VOID_PTR_CAST_TO_MPI_AINT (value);
+    MPI_Aint fvalue = MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
     MPI_Aint* fextra  = (MPI_Aint*)extra_state;
 
     ((F90_DeleteFunction*)user_function)( &fhandle, &fkeyval, &fvalue, fextra, &ierr );
diff --git a/src/mpi/attr/win_get_attr.c b/src/mpi/attr/win_get_attr.c
index d306f7b..ea88525 100644
--- a/src/mpi/attr/win_get_attr.c
+++ b/src/mpi/attr/win_get_attr.c
@@ -127,7 +127,7 @@ int MPIR_WinGetAttr( MPI_Win win, int win_keyval, void *attribute_val,
 	case MPIR_ATTR_C_TO_FORTRAN(MPI_WIN_BASE):
 	    /* The Fortran routine that matches this routine should
 	       provide an address-sized integer, not an MPI_Fint */
-	    *attr_int = MPI_VOID_PTR_CAST_TO_MPI_AINT(win_ptr->base);
+	    *attr_int = MPIU_VOID_PTR_CAST_TO_MPI_AINT(win_ptr->base);
 	    break;
         case MPIR_ATTR_C_TO_FORTRAN(MPI_WIN_SIZE):
 	    /* We do not need to copy because we return the value,
diff --git a/src/mpi/coll/allgather.c b/src/mpi/coll/allgather.c
index bcd1c69..a61a089 100644
--- a/src/mpi/coll/allgather.c
+++ b/src/mpi/coll/allgather.c
@@ -147,7 +147,7 @@ int MPIR_Allgather_intra (
     MPID_Datatype_get_size_macro( recvtype, type_size );
 
     /* This is the largest offset we add to recvbuf */
-    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
 				     (comm_size * recvcount * recvtype_extent));
 
     /* check if multiple threads are calling this collective function */
diff --git a/src/mpi/coll/alltoall.c b/src/mpi/coll/alltoall.c
index 657acf5..ea52a6d 100644
--- a/src/mpi/coll/alltoall.c
+++ b/src/mpi/coll/alltoall.c
@@ -501,9 +501,9 @@ int MPIR_Alltoall_inter(
 
     /* Do the pairwise exchanges */
     max_size = MPIR_MAX(local_size, remote_size);
-    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
 				     max_size*recvcount*recvtype_extent);
-    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
 				     max_size*sendcount*sendtype_extent);
     for (i=0; i<max_size; i++) {
         src = (rank - i + max_size) % max_size;
diff --git a/src/mpi/coll/alltoallv.c b/src/mpi/coll/alltoallv.c
index 4fec383..8f5945c 100644
--- a/src/mpi/coll/alltoallv.c
+++ b/src/mpi/coll/alltoallv.c
@@ -152,7 +152,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
                 if (recvcounts[dst]) {
                     MPID_Datatype_get_size_macro(recvtype, type_size);
                     if (type_size) {
-                        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+                        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                                          rdispls[dst]*recv_extent);
                         mpi_errno = MPIC_Irecv((char *)recvbuf+rdispls[dst]*recv_extent,
                                                   recvcounts[dst], recvtype, dst,
@@ -174,7 +174,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
                 if (sendcounts[dst]) {
                     MPID_Datatype_get_size_macro(sendtype, type_size);
                     if (type_size) {
-                        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+                        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
                                                          sdispls[dst]*send_extent);
                         mpi_errno = MPIC_Isend((char *)sendbuf+sdispls[dst]*send_extent,
                                                   sendcounts[dst], sendtype, dst,
@@ -282,7 +282,7 @@ int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *
             recvcount = 0;
         }
         else {
-            MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+            MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
 					     rdispls[src]*recv_extent);
             recvaddr = (char *)recvbuf + rdispls[src]*recv_extent;
             recvcount = recvcounts[src];
@@ -293,7 +293,7 @@ int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *
             sendcount = 0;
         }
         else {
-            MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+            MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
 					     sdispls[dst]*send_extent);
             sendaddr = (char *)sendbuf + sdispls[dst]*send_extent;
             sendcount = sendcounts[dst];
diff --git a/src/mpi/coll/gather.c b/src/mpi/coll/gather.c
index 3c6a82b..47f7315 100644
--- a/src/mpi/coll/gather.c
+++ b/src/mpi/coll/gather.c
@@ -135,7 +135,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     if (rank == root) 
     {
         MPID_Datatype_get_extent_macro(recvtype, extent);
-        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf+
+        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf+
 					 (extent*recvcount*comm_size));
     }
 
@@ -327,7 +327,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 		}
 		else {
 		    blocks[0] = sendcount;
-		    struct_displs[0] = MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf;
+		    struct_displs[0] = MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf;
 		    types[0] = sendtype;
 		    /* check for overflow.  work around int limits if needed*/
 		    if (curr_cnt - nbytes != (int)(curr_cnt - nbytes)) {
@@ -338,7 +338,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 			    MPIU_Assign_trunc(blocks[1],  curr_cnt - nbytes, int);
 			    types[1] = MPI_BYTE;
 		    }
-		    struct_displs[1] = MPI_VOID_PTR_CAST_TO_MPI_AINT tmp_buf;
+		    struct_displs[1] = MPIU_VOID_PTR_CAST_TO_MPI_AINT tmp_buf;
 		    mpi_errno = MPIR_Type_create_struct_impl(2, blocks, struct_displs, types, &tmp_type);
                     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     
@@ -623,7 +623,7 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
         if (root == MPI_ROOT)
 	{
             MPID_Datatype_get_extent_macro(recvtype, extent);
-            MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+            MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
 					     (recvcount*remote_size*extent));
 
             for (i=0; i<remote_size; i++)
diff --git a/src/mpi/coll/gatherv.c b/src/mpi/coll/gatherv.c
index eef5dd1..51c3756 100644
--- a/src/mpi/coll/gatherv.c
+++ b/src/mpi/coll/gatherv.c
@@ -110,7 +110,7 @@ int MPIR_Gatherv (
 
         MPID_Datatype_get_extent_macro(recvtype, extent);
 	/* each node can make sure it is not going to overflow aint */
-        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
 					 displs[rank] * extent);
 
         MPIU_CHKLMEM_MALLOC(reqarray, MPID_Request **, comm_size * sizeof(MPID_Request *), mpi_errno, "reqarray");
diff --git a/src/mpi/coll/iallgather.c b/src/mpi/coll/iallgather.c
index 13f719c..58da4a8 100644
--- a/src/mpi/coll/iallgather.c
+++ b/src/mpi/coll/iallgather.c
@@ -79,7 +79,7 @@ int MPIR_Iallgather_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype sen
     MPID_Datatype_get_extent_macro( recvtype, recvtype_extent );
 
     /* This is the largest offset we add to recvbuf */
-    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                      (comm_size * recvcount * recvtype_extent));
 
     /*  copy local data into recvbuf */
@@ -250,7 +250,7 @@ int MPIR_Iallgather_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendt
     MPIR_Type_get_true_extent_impl(recvtype, &recvtype_true_lb, &recvtype_true_extent);
 
     /* This is the largest offset we add to recvbuf */
-    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                      (comm_size * recvcount * recvtype_extent));
 
     /* allocate a temporary buffer of the same size as recvbuf. */
@@ -355,7 +355,7 @@ int MPIR_Iallgather_ring(const void *sendbuf, int sendcount, MPI_Datatype sendty
     MPID_Datatype_get_extent_macro(recvtype, recvtype_extent);
 
     /* This is the largest offset we add to recvbuf */
-    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                      (comm_size * recvcount * recvtype_extent));
 
     /* First, load the "local" version in the recvbuf. */
diff --git a/src/mpi/coll/ialltoall.c b/src/mpi/coll/ialltoall.c
index 8bdd163..d319cde 100644
--- a/src/mpi/coll/ialltoall.c
+++ b/src/mpi/coll/ialltoall.c
@@ -480,9 +480,9 @@ int MPIR_Ialltoall_inter(const void *sendbuf, int sendcount, MPI_Datatype sendty
 
     /* Do the pairwise exchanges */
     max_size = MPIR_MAX(local_size, remote_size);
-    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                      max_size*recvcount*recvtype_extent);
-    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
                                      max_size*sendcount*sendtype_extent);
     for (i = 0; i < max_size; i++) {
         src = (rank - i + max_size) % max_size;
diff --git a/src/mpi/coll/ialltoallv.c b/src/mpi/coll/ialltoallv.c
index 97a2661..a811cda 100644
--- a/src/mpi/coll/ialltoallv.c
+++ b/src/mpi/coll/ialltoallv.c
@@ -126,7 +126,7 @@ int MPIR_Ialltoallv_intra(const void *sendbuf, const int sendcounts[], const int
             for (i=0; i < ss; i++) {
                 dst = (rank+i+ii) % comm_size;
                 if (recvcounts[dst] && recvtype_size) {
-                    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+                    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                                      rdispls[dst]*recv_extent);
                     mpi_errno = MPID_Sched_recv((char *)recvbuf+rdispls[dst]*recv_extent,
                                                 recvcounts[dst], recvtype, dst, comm_ptr, s);
@@ -137,7 +137,7 @@ int MPIR_Ialltoallv_intra(const void *sendbuf, const int sendcounts[], const int
             for (i=0; i < ss; i++) {
                 dst = (rank-i-ii+comm_size) % comm_size;
                 if (sendcounts[dst] && sendtype_size) {
-                    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+                    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
                                                      sdispls[dst]*send_extent);
                     mpi_errno = MPID_Sched_send((char *)sendbuf+sdispls[dst]*send_extent,
                                                 sendcounts[dst], sendtype, dst, comm_ptr, s);
@@ -205,7 +205,7 @@ int MPIR_Ialltoallv_inter(const void *sendbuf, const int sendcounts[], const int
             recvcount = 0;
         }
         else {
-            MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+            MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                              rdispls[src]*recv_extent);
             recvaddr = (char *)recvbuf + rdispls[src]*recv_extent;
             recvcount = recvcounts[src];
@@ -216,7 +216,7 @@ int MPIR_Ialltoallv_inter(const void *sendbuf, const int sendcounts[], const int
             sendcount = 0;
         }
         else {
-            MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+            MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
                                              sdispls[dst]*send_extent);
             sendaddr = (char *)sendbuf + sdispls[dst]*send_extent;
             sendcount = sendcounts[dst];
diff --git a/src/mpi/coll/igather.c b/src/mpi/coll/igather.c
index 44a9af3..9907801 100644
--- a/src/mpi/coll/igather.c
+++ b/src/mpi/coll/igather.c
@@ -91,7 +91,7 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
     if (rank == root)
     {
         MPID_Datatype_get_extent_macro(recvtype, extent);
-        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf+
+        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf+
                                          (extent*recvcount*comm_size));
     }
 
@@ -241,10 +241,10 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
                 }
                 else {
                     blocks[0] = sendcount;
-                    struct_displs[0] = MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf;
+                    struct_displs[0] = MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf;
                     types[0] = sendtype;
                     blocks[1] = curr_cnt - nbytes;
-                    struct_displs[1] = MPI_VOID_PTR_CAST_TO_MPI_AINT tmp_buf;
+                    struct_displs[1] = MPIU_VOID_PTR_CAST_TO_MPI_AINT tmp_buf;
                     types[1] = MPI_BYTE;
 
                     mpi_errno = MPIR_Type_create_struct_impl(2, blocks, struct_displs, types, &tmp_type);
@@ -485,7 +485,7 @@ int MPIR_Igather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
         /* long message. use linear algorithm. */
         if (root == MPI_ROOT) {
             MPID_Datatype_get_extent_macro(recvtype, extent);
-            MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+            MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                              (recvcount*remote_size*extent));
 
             for (i=0; i<remote_size; i++) {
diff --git a/src/mpi/coll/igatherv.c b/src/mpi/coll/igatherv.c
index faf3579..b636e25 100644
--- a/src/mpi/coll/igatherv.c
+++ b/src/mpi/coll/igatherv.c
@@ -56,7 +56,7 @@ int MPIR_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, voi
 
         MPID_Datatype_get_extent_macro(recvtype, extent);
         /* each node can make sure it is not going to overflow aint */
-        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf + displs[rank] * extent);
+        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf + displs[rank] * extent);
 
         for (i = 0; i < comm_size; i++) {
             if (recvcounts[i]) {
diff --git a/src/mpi/coll/iscatter.c b/src/mpi/coll/iscatter.c
index 0bbc35f..ef23f87 100644
--- a/src/mpi/coll/iscatter.c
+++ b/src/mpi/coll/iscatter.c
@@ -131,7 +131,7 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
                in the event of recvbuf=MPI_IN_PLACE on the root,
                recvcount and recvtype are not valid */
             MPID_Datatype_get_size_macro(sendtype, sendtype_size);
-            MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+            MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
                                              extent*sendcount*comm_size);
 
             ss->nbytes = sendtype_size * sendcount;
@@ -486,7 +486,7 @@ int MPIR_Iscatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
 
                 MPID_Datatype_get_extent_macro(recvtype, extent);
                 MPIU_Ensure_Aint_fits_in_pointer(extent*recvcount*local_size);
-                MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+                MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
                                                  sendcount*remote_size*extent);
 
                 MPIR_SCHED_CHKPMEM_MALLOC(tmp_buf, void *, recvcount*local_size*(MPIR_MAX(extent,true_extent)),
diff --git a/src/mpi/coll/iscatterv.c b/src/mpi/coll/iscatterv.c
index 9d2c420..a46ead2 100644
--- a/src/mpi/coll/iscatterv.c
+++ b/src/mpi/coll/iscatterv.c
@@ -77,7 +77,7 @@ int MPIR_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs
          * a minimal sanity check. Maybe add a global var since we do
          * loop over sendcount[] in MPI_Scatterv before calling
          * this? */
-        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf + extent);
+        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf + extent);
 
         for (i = 0; i < comm_size; i++) {
             if (sendcounts[i]) {
diff --git a/src/mpi/coll/scatter.c b/src/mpi/coll/scatter.c
index 6edf0de..4a852b4 100644
--- a/src/mpi/coll/scatter.c
+++ b/src/mpi/coll/scatter.c
@@ -118,7 +118,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                in the event of recvbuf=MPI_IN_PLACE on the root,
                recvcount and recvtype are not valid */
             MPID_Datatype_get_size_macro(sendtype, sendtype_size);
-            MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+            MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
 					     extent*sendcount*comm_size);
 
             nbytes = sendtype_size * sendcount;
@@ -485,7 +485,7 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
 
                 MPID_Datatype_get_extent_macro(recvtype, extent);
 		MPIU_Ensure_Aint_fits_in_pointer(extent*recvcount*local_size);
-		MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+		MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
 						 sendcount*remote_size*extent);
 
                 MPIU_CHKLMEM_MALLOC(tmp_buf, void *, recvcount*local_size*(MPIR_MAX(extent,true_extent)), mpi_errno, "tmp_buf");
diff --git a/src/mpi/coll/scatterv.c b/src/mpi/coll/scatterv.c
index 9370b7d..3be0977 100644
--- a/src/mpi/coll/scatterv.c
+++ b/src/mpi/coll/scatterv.c
@@ -85,7 +85,7 @@ int MPIR_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
          * a minimal sanity check. Maybe add a global var since we do
          * loop over sendcount[] in MPI_Scatterv before calling
          * this? */
-        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf + extent);
+        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf + extent);
 
         MPIU_CHKLMEM_MALLOC(reqarray, MPID_Request **, comm_size * sizeof(MPID_Request *), mpi_errno, "reqarray");
         MPIU_CHKLMEM_MALLOC(starray, MPI_Status *, comm_size * sizeof(MPI_Status), mpi_errno, "starray");
diff --git a/src/mpi/datatype/address.c b/src/mpi/datatype/address.c
index 866aef2..4557846 100644
--- a/src/mpi/datatype/address.c
+++ b/src/mpi/datatype/address.c
@@ -89,7 +89,7 @@ int MPI_Address(const void *location, MPI_Aint *address)
        standard, I can't tell if this is a compiler bug or a language bug.
     */
 #ifdef CHAR_PTR_IS_ADDRESS
-    *address = MPI_VOID_PTR_CAST_TO_MPI_AINT ((char *) location);
+    *address = MPIU_VOID_PTR_CAST_TO_MPI_AINT ((char *) location);
 #else
     /* Note that this is the "portable" way to generate an address.
        The difference of two pointers is the number of elements
@@ -98,7 +98,7 @@ int MPI_Address(const void *location, MPI_Aint *address)
        of bytes from 0 to location */
     /* To cover the case where a pointer is 32 bits and MPI_Aint is 64 bits,
        add cast to unsigned so the high order address bit is not sign-extended. */
-    *address = MPI_VOID_PTR_CAST_TO_MPI_AINT ((char *) location - (char *) MPI_BOTTOM);
+    *address = MPIU_VOID_PTR_CAST_TO_MPI_AINT ((char *) location - (char *) MPI_BOTTOM);
 #endif
     /* The same code is used in MPI_Get_address */
 
diff --git a/src/mpi/datatype/get_address.c b/src/mpi/datatype/get_address.c
index a53980c..2f291bf 100644
--- a/src/mpi/datatype/get_address.c
+++ b/src/mpi/datatype/get_address.c
@@ -99,14 +99,14 @@ int MPI_Get_address(const void *location, MPI_Aint *address)
        standard, I can't tell if this is a compiler bug or a language bug.
     */
 #ifdef CHAR_PTR_IS_ADDRESS
-    *address = MPI_VOID_PTR_CAST_TO_MPI_AINT ((char *) location);
+    *address = MPIU_VOID_PTR_CAST_TO_MPI_AINT ((char *) location);
 #else
     /* Note that this is the "portable" way to generate an address.
        The difference of two pointers is the number of elements
        between them, so this gives the number of chars between location
        and ptr.  As long as sizeof(char) represents one byte,
        of bytes from 0 to location */
-    *address = MPI_VOID_PTR_CAST_TO_MPI_AINT ((char *) location - (char *) MPI_BOTTOM);
+    *address = MPIU_VOID_PTR_CAST_TO_MPI_AINT ((char *) location - (char *) MPI_BOTTOM);
 #endif
     /* The same code is used in MPI_Address */
 
diff --git a/src/mpi/datatype/pack.c b/src/mpi/datatype/pack.c
index 760554b..3232ee0 100644
--- a/src/mpi/datatype/pack.c
+++ b/src/mpi/datatype/pack.c
@@ -85,7 +85,7 @@ int MPIR_Pack_impl(const void *inbuf,
     last  = SEGMENT_IGNORE_LAST;
 
     /* Ensure that pointer increment fits in a pointer */
-    MPIU_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT outbuf) +
+    MPIU_Ensure_Aint_fits_in_pointer((MPIU_VOID_PTR_CAST_TO_MPI_AINT outbuf) +
 				     (MPI_Aint) *position);
 
     MPID_Segment_pack(segp,
diff --git a/src/mpi/datatype/pack_external.c b/src/mpi/datatype/pack_external.c
index 081ac81..2972fa3 100644
--- a/src/mpi/datatype/pack_external.c
+++ b/src/mpi/datatype/pack_external.c
@@ -137,7 +137,7 @@ int MPI_Pack_external(const char datarep[],
     last  = SEGMENT_IGNORE_LAST;
 
     /* Ensure that pointer increment fits in a pointer */
-    MPIU_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT outbuf) + *position);
+    MPIU_Ensure_Aint_fits_in_pointer((MPIU_VOID_PTR_CAST_TO_MPI_AINT outbuf) + *position);
 
     MPID_Segment_pack_external32(segp,
 				 first,
diff --git a/src/mpi/datatype/unpack.c b/src/mpi/datatype/unpack.c
index 52057a0..a4e56fd 100644
--- a/src/mpi/datatype/unpack.c
+++ b/src/mpi/datatype/unpack.c
@@ -76,7 +76,7 @@ int MPIR_Unpack_impl(const void *inbuf, MPI_Aint insize, MPI_Aint *position,
     last  = SEGMENT_IGNORE_LAST;
 
     /* Ensure that pointer increment fits in a pointer */
-    MPIU_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT inbuf) +
+    MPIU_Ensure_Aint_fits_in_pointer((MPIU_VOID_PTR_CAST_TO_MPI_AINT inbuf) +
 				     (MPI_Aint) *position);
 
     MPID_Segment_unpack(segp,
diff --git a/src/mpi/datatype/unpack_external.c b/src/mpi/datatype/unpack_external.c
index 2f4db11..d9e6d95 100644
--- a/src/mpi/datatype/unpack_external.c
+++ b/src/mpi/datatype/unpack_external.c
@@ -122,7 +122,7 @@ int MPI_Unpack_external(const char datarep[],
     last  = SEGMENT_IGNORE_LAST;
 
     /* Ensure that pointer increment fits in a pointer */
-    MPIU_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT inbuf) + *position);
+    MPIU_Ensure_Aint_fits_in_pointer((MPIU_VOID_PTR_CAST_TO_MPI_AINT inbuf) + *position);
 
     MPID_Segment_unpack_external32(segp,
 				   first,
diff --git a/src/mpi/romio/adio/include/adioi.h b/src/mpi/romio/adio/include/adioi.h
index c813090..4e8e35f 100644
--- a/src/mpi/romio/adio/include/adioi.h
+++ b/src/mpi/romio/adio/include/adioi.h
@@ -1015,7 +1015,7 @@ int  ADIOI_MPE_iwrite_b;
       to (possible) 4 byte ptr cast)                              */
 /* Should work even on 64bit or old 32bit configs                 */
   /* Use MPIU_Ensure_Aint_fits_in_pointer from mpiutil.h and 
-         MPI_AINT_CAST_TO_VOID_PTR from configure (mpi.h) */
+         MPIU_AINT_CAST_TO_VOID_PTR from configure (mpi.h) */
   #include "glue_romio.h"
 
   #define ADIOI_AINT_CAST_TO_VOID_PTR (void*)(MPIU_Pint)
diff --git a/src/mpi/topo/inhb_allgather.c b/src/mpi/topo/inhb_allgather.c
index fe512dc..bfe9254 100644
--- a/src/mpi/topo/inhb_allgather.c
+++ b/src/mpi/topo/inhb_allgather.c
@@ -46,7 +46,7 @@ int MPIR_Ineighbor_allgather_default(const void *sendbuf, int sendcount, MPI_Dat
     MPID_Datatype_get_extent_macro(recvtype, recvtype_extent);
 
     /* This is the largest offset we add to recvbuf */
-    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                      (comm_ptr->local_size * recvcount * recvtype_extent));
 
     mpi_errno = MPIR_Topo_canon_nhb_count(comm_ptr, &indegree, &outdegree, &weighted);
diff --git a/src/mpi/topo/inhb_allgatherv.c b/src/mpi/topo/inhb_allgatherv.c
index 70ba414..bcad5a7 100644
--- a/src/mpi/topo/inhb_allgatherv.c
+++ b/src/mpi/topo/inhb_allgatherv.c
@@ -49,7 +49,7 @@ int MPIR_Ineighbor_allgatherv_default(const void *sendbuf, int sendcount, MPI_Da
     MPID_Datatype_get_extent_macro(recvtype, recvtype_extent);
 
     for (i = 0; i < comm_size; ++i) {
-        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                          (displs[i] * recvtype_extent));
     }
 
diff --git a/src/mpi/topo/inhb_alltoall.c b/src/mpi/topo/inhb_alltoall.c
index 8f0bc52..d1fbb46 100644
--- a/src/mpi/topo/inhb_alltoall.c
+++ b/src/mpi/topo/inhb_alltoall.c
@@ -47,10 +47,10 @@ int MPIR_Ineighbor_alltoall_default(const void *sendbuf, int sendcount, MPI_Data
     MPID_Datatype_get_extent_macro(recvtype, recvtype_extent);
 
     /* This is the largest offset we add to sendbuf */
-    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
                                      (comm_ptr->local_size * sendcount * sendtype_extent));
     /* This is the largest offset we add to recvbuf */
-    MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+    MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                      (comm_ptr->local_size * recvcount * recvtype_extent));
 
     mpi_errno = MPIR_Topo_canon_nhb_count(comm_ptr, &indegree, &outdegree, &weighted);
diff --git a/src/mpi/topo/inhb_alltoallv.c b/src/mpi/topo/inhb_alltoallv.c
index af999f1..6b7bb75 100644
--- a/src/mpi/topo/inhb_alltoallv.c
+++ b/src/mpi/topo/inhb_alltoallv.c
@@ -51,9 +51,9 @@ int MPIR_Ineighbor_alltoallv_default(const void *sendbuf, const int sendcounts[]
     MPID_Datatype_get_extent_macro(recvtype, recvtype_extent);
 
     for (i = 0; i < comm_size; ++i) {
-        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
+        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf +
                                          (sdispls[i] * sendtype_extent));
-        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
                                          (rdispls[i] * recvtype_extent));
     }
 
diff --git a/src/mpi/topo/inhb_alltoallw.c b/src/mpi/topo/inhb_alltoallw.c
index b492a7c..0644f48 100644
--- a/src/mpi/topo/inhb_alltoallw.c
+++ b/src/mpi/topo/inhb_alltoallw.c
@@ -53,7 +53,7 @@ int MPIR_Ineighbor_alltoallw_default(const void *sendbuf, const int sendcounts[]
 
     for (k = 0; k < outdegree; ++k) {
         char *sb;
-        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf + sdispls[k]);
+        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT sendbuf + sdispls[k]);
 
         sb = ((char *)sendbuf) + sdispls[k];
         mpi_errno = MPID_Sched_send(sb, sendcounts[k], sendtypes[k], dsts[k], comm_ptr, s);
@@ -62,7 +62,7 @@ int MPIR_Ineighbor_alltoallw_default(const void *sendbuf, const int sendcounts[]
 
     for (l = 0; l < indegree; ++l) {
         char *rb;
-        MPIU_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf + rdispls[l]);
+        MPIU_Ensure_Aint_fits_in_pointer(MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf + rdispls[l]);
 
         rb = ((char *)recvbuf) + rdispls[l];
         mpi_errno = MPID_Sched_recv(rb, recvcounts[l], recvtypes[l], srcs[l], comm_ptr, s);
diff --git a/src/mpid/ch3/src/mpid_aint.c b/src/mpid/ch3/src/mpid_aint.c
index b3bc8f1..e5f6af7 100644
--- a/src/mpid/ch3/src/mpid_aint.c
+++ b/src/mpid/ch3/src/mpid_aint.c
@@ -27,7 +27,7 @@ MPI_Aint MPID_Aint_add(MPI_Aint base, MPI_Aint disp)
     MPIDI_STATE_DECL(MPID_STATE_MPID_AINT_ADD);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_AINT_ADD);
 
-    result =  MPI_VOID_PTR_CAST_TO_MPI_AINT ((char*)MPI_AINT_CAST_TO_VOID_PTR(base) + disp);
+    result =  MPIU_VOID_PTR_CAST_TO_MPI_AINT ((char*)MPIU_AINT_CAST_TO_VOID_PTR(base) + disp);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_AINT_ADD);
     return result;
@@ -54,7 +54,7 @@ MPI_Aint MPID_Aint_diff(MPI_Aint addr1, MPI_Aint addr2)
     MPIDI_STATE_DECL(MPID_STATE_MPID_AINT_DIFF);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_AINT_DIFF);
 
-    result =  MPI_PTR_DISP_CAST_TO_MPI_AINT ((char*)MPI_AINT_CAST_TO_VOID_PTR(addr1) - (char*)MPI_AINT_CAST_TO_VOID_PTR(addr2));
+    result =  MPIU_PTR_DISP_CAST_TO_MPI_AINT ((char*)MPIU_AINT_CAST_TO_VOID_PTR(addr1) - (char*)MPIU_AINT_CAST_TO_VOID_PTR(addr2));
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_AINT_DIFF);
     return result;
diff --git a/src/mpid/common/datatype/mpid_dataloop.h b/src/mpid/common/datatype/mpid_dataloop.h
index 9cdd623..7ff7c94 100644
--- a/src/mpid/common/datatype/mpid_dataloop.h
+++ b/src/mpid/common/datatype/mpid_dataloop.h
@@ -90,9 +90,9 @@
 #define DLOOP_Memcpy MPIU_Memcpy
 
 /* casting macros */
-#define DLOOP_OFFSET_CAST_TO_VOID_PTR MPI_AINT_CAST_TO_VOID_PTR
-#define DLOOP_VOID_PTR_CAST_TO_OFFSET MPI_VOID_PTR_CAST_TO_MPI_AINT
-#define DLOOP_PTR_DISP_CAST_TO_OFFSET MPI_PTR_DISP_CAST_TO_MPI_AINT
+#define DLOOP_OFFSET_CAST_TO_VOID_PTR MPIU_AINT_CAST_TO_VOID_PTR
+#define DLOOP_VOID_PTR_CAST_TO_OFFSET MPIU_VOID_PTR_CAST_TO_MPI_AINT
+#define DLOOP_PTR_DISP_CAST_TO_OFFSET MPIU_PTR_DISP_CAST_TO_MPI_AINT
 
 /* printing macros */
 #define DLOOP_OFFSET_FMT_DEC_SPEC MPI_AINT_FMT_DEC_SPEC
diff --git a/src/mpid/common/datatype/mpid_segment.c b/src/mpid/common/datatype/mpid_segment.c
index ef36cd9..027f47d 100644
--- a/src/mpid/common/datatype/mpid_segment.c
+++ b/src/mpid/common/datatype/mpid_segment.c
@@ -248,7 +248,7 @@ static int MPID_Segment_contig_pack_to_iov(DLOOP_Offset *blocks_p,
 	    paramp->u.pack_vector.vectorp[last_idx].DLOOP_VECTOR_LEN;
     }
 
-    MPIU_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (bufp)) + rel_off);
+    MPIU_Ensure_Aint_fits_in_pointer((MPIU_VOID_PTR_CAST_TO_MPI_AINT (bufp)) + rel_off);
     if ((last_idx == paramp->u.pack_vector.length-1) &&
 	(last_end != ((char *) bufp + rel_off)))
     {
@@ -348,7 +348,7 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
 		paramp->u.pack_vector.vectorp[last_idx].DLOOP_VECTOR_LEN;
 	}
 
-	MPIU_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (bufp)) + rel_off);
+	MPIU_Ensure_Aint_fits_in_pointer((MPIU_VOID_PTR_CAST_TO_MPI_AINT (bufp)) + rel_off);
 	if ((last_idx == paramp->u.pack_vector.length-1) &&
 	    (last_end != ((char *) bufp + rel_off)))
 	{
@@ -422,13 +422,13 @@ static int MPID_Segment_contig_flatten(DLOOP_Offset *blocks_p,
 #ifdef MPID_SP_VERBOSE
     MPIU_dbg_printf("\t[contig flatten: idx = %d, loc = (" MPI_AINT_FMT_HEX_SPEC " + " MPI_AINT_FMT_HEX_SPEC ") = " MPI_AINT_FMT_HEX_SPEC ", size = " MPI_AINT_FMT_DEC_SPEC "]\n",
 		    idx,
-		    MPI_VOID_PTR_CAST_TO_MPI_AINT bufp,
+		    MPIU_VOID_PTR_CAST_TO_MPI_AINT bufp,
 		    (MPI_Aint) rel_off,
-		    MPI_VOID_PTR_CAST_TO_MPI_AINT bufp + rel_off,
+		    MPIU_VOID_PTR_CAST_TO_MPI_AINT bufp + rel_off,
 		    (MPI_Aint) size);
 #endif
 
-    if (idx > 0 && ((DLOOP_Offset) MPI_VOID_PTR_CAST_TO_MPI_AINT bufp + rel_off) ==
+    if (idx > 0 && ((DLOOP_Offset) MPIU_VOID_PTR_CAST_TO_MPI_AINT bufp + rel_off) ==
 	((paramp->u.flatten.offp[idx - 1]) +
 	 (DLOOP_Offset) paramp->u.flatten.sizep[idx - 1]))
     {
@@ -436,7 +436,7 @@ static int MPID_Segment_contig_flatten(DLOOP_Offset *blocks_p,
 	paramp->u.flatten.sizep[idx - 1] += size;
     }
     else {
-	paramp->u.flatten.offp[idx] =  ((int64_t) MPI_VOID_PTR_CAST_TO_MPI_AINT bufp) + (int64_t) rel_off;
+	paramp->u.flatten.offp[idx] =  ((int64_t) MPIU_VOID_PTR_CAST_TO_MPI_AINT bufp) + (int64_t) rel_off;
 	paramp->u.flatten.sizep[idx] = size;
 
 	paramp->u.flatten.index++;
@@ -499,7 +499,7 @@ static int MPID_Segment_vector_flatten(DLOOP_Offset *blocks_p,
 	    blocks_left = 0;
 	}
 
-	if (idx > 0 && ((DLOOP_Offset) MPI_VOID_PTR_CAST_TO_MPI_AINT bufp + rel_off) ==
+	if (idx > 0 && ((DLOOP_Offset) MPIU_VOID_PTR_CAST_TO_MPI_AINT bufp + rel_off) ==
 	    ((paramp->u.flatten.offp[idx - 1]) + (DLOOP_Offset) paramp->u.flatten.sizep[idx - 1]))
 	{
 	    /* add this size to the last region rather than using up another one */
@@ -507,7 +507,7 @@ static int MPID_Segment_vector_flatten(DLOOP_Offset *blocks_p,
 	}
 	else if (idx < paramp->u.flatten.length) {
 	    /* take up another region */
-	    paramp->u.flatten.offp[idx]  = (DLOOP_Offset) MPI_VOID_PTR_CAST_TO_MPI_AINT bufp + rel_off;
+	    paramp->u.flatten.offp[idx]  = (DLOOP_Offset) MPIU_VOID_PTR_CAST_TO_MPI_AINT bufp + rel_off;
 	    paramp->u.flatten.sizep[idx] = size;
 	    paramp->u.flatten.index++;
 	}
diff --git a/src/mpid/common/datatype/mpid_type_create_pairtype.c b/src/mpid/common/datatype/mpid_type_create_pairtype.c
index 2db382c..3c6fad8 100644
--- a/src/mpid/common/datatype/mpid_type_create_pairtype.c
+++ b/src/mpid/common/datatype/mpid_type_create_pairtype.c
@@ -20,7 +20,7 @@
 	type_size_   = sizeof(foo.a) + sizeof(foo.b);			\
 	type_extent_ = (MPI_Aint) sizeof(foo);				\
 	el_size_ = (sizeof(foo.a) == sizeof(foo.b)) ? (int) sizeof(foo.a) : -1; \
-	true_ub_ = (MPI_VOID_PTR_CAST_TO_MPI_AINT ((char *) &foo.b -     \
+	true_ub_ = (MPIU_VOID_PTR_CAST_TO_MPI_AINT ((char *) &foo.b -     \
                                                   (char *) &foo.a)) +   \
                   (MPI_Aint) sizeof(foo.b);                             \
 	alignsize_ = MPIR_MAX(MPID_Datatype_get_basic_size(mt1_),	\
diff --git a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
index 14104a2..8ef7b66 100644
--- a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
+++ b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
@@ -174,7 +174,7 @@ int MPIDO_Allgather_bcast(const void *sendbuf,
   np = comm_ptr ->local_size;
   MPID_Datatype_get_extent_macro(recvtype, extent);
 
-  MPIU_Ensure_Aint_fits_in_pointer ((MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
+  MPIU_Ensure_Aint_fits_in_pointer ((MPIU_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
 				     np * recvcount * extent));
   if (sendbuf != MPI_IN_PLACE)
   {
diff --git a/src/mpid/pamid/src/mpid_aint.c b/src/mpid/pamid/src/mpid_aint.c
index e331f57..39c50b9 100644
--- a/src/mpid/pamid/src/mpid_aint.c
+++ b/src/mpid/pamid/src/mpid_aint.c
@@ -27,7 +27,7 @@ MPI_Aint MPID_Aint_add(MPI_Aint base, MPI_Aint disp)
     MPIDI_STATE_DECL(MPID_STATE_MPID_AINT_ADD);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_AINT_ADD);
 
-    result =  MPI_VOID_PTR_CAST_TO_MPI_AINT ((char*)MPI_AINT_CAST_TO_VOID_PTR(base) + disp);
+    result =  MPIU_VOID_PTR_CAST_TO_MPI_AINT ((char*)MPIU_AINT_CAST_TO_VOID_PTR(base) + disp);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_AINT_ADD);
     return result;
@@ -54,7 +54,7 @@ MPI_Aint MPID_Aint_diff(MPI_Aint addr1, MPI_Aint addr2)
     MPIDI_STATE_DECL(MPID_STATE_MPID_AINT_DIFF);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_AINT_DIFF);
 
-    result =  MPI_PTR_DISP_CAST_TO_MPI_AINT ((char*)MPI_AINT_CAST_TO_VOID_PTR(addr1) - (char*)MPI_AINT_CAST_TO_VOID_PTR(addr2));
+    result =  MPIU_PTR_DISP_CAST_TO_MPI_AINT ((char*)MPIU_AINT_CAST_TO_VOID_PTR(addr1) - (char*)MPIU_AINT_CAST_TO_VOID_PTR(addr2));
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_AINT_DIFF);
     return result;
diff --git a/src/util/pointer/mpiu_pointer.h b/src/util/pointer/mpiu_pointer.h
index df42b0b..e19d22b 100644
--- a/src/util/pointer/mpiu_pointer.h
+++ b/src/util/pointer/mpiu_pointer.h
@@ -53,7 +53,7 @@
  * \param[in]  aint  Variable of type MPI_Aint
  */
 #define MPIU_Ensure_Aint_fits_in_pointer(aint) \
-  MPIU_Assert((aint) == (MPI_Aint)(MPIU_Upint) MPI_AINT_CAST_TO_VOID_PTR(aint));
+  MPIU_Assert((aint) == (MPI_Aint)(MPIU_Upint) MPIU_AINT_CAST_TO_VOID_PTR(aint));
 
 
 #endif /* !defined(MPIU_POINTER_H_INCLUDED) */
diff --git a/src/util/type/mpiu_type_defs.h b/src/util/type/mpiu_type_defs.h
index 6126855..5c3bc01 100644
--- a/src/util/type/mpiu_type_defs.h
+++ b/src/util/type/mpiu_type_defs.h
@@ -86,9 +86,9 @@ typedef MPIU_SIZE_T MPIU_Size_t;
 
 /* Adding the 32-bit compute/64-bit I/O related type-casts in here as
  * they are not a part of the MPI standard yet. */
-#define MPI_AINT_CAST_TO_VOID_PTR (void *)(MPIU_Pint)
-#define MPI_VOID_PTR_CAST_TO_MPI_AINT (MPI_Aint)(MPIU_Upint)
-#define MPI_PTR_DISP_CAST_TO_MPI_AINT (MPI_Aint)(MPIU_Pint)
+#define MPIU_AINT_CAST_TO_VOID_PTR (void *)(MPIU_Pint)
+#define MPIU_VOID_PTR_CAST_TO_MPI_AINT (MPI_Aint)(MPIU_Upint)
+#define MPIU_PTR_DISP_CAST_TO_MPI_AINT (MPI_Aint)(MPIU_Pint)
 
 #define MPIU_CONTEXT_ID_T_DATATYPE MPI_UINT16_T
 typedef uint16_t MPIU_Context_id_t;

http://git.mpich.org/mpich.git/commitdiff/5f2cb148b330cfe2e46e22af8549c92e68e68de2

commit 5f2cb148b330cfe2e46e22af8549c92e68e68de2
Author: Charles J Archer <charles.j.archer at intel.com>
Date:   Fri Aug 14 09:01:57 2015 -0700

    MPIR_ERR_POP routines, remove if branch on error checking
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/src/include/mpierrs.h b/src/include/mpierrs.h
index 5c22f15..795e36d 100644
--- a/src/include/mpierrs.h
+++ b/src/include/mpierrs.h
@@ -625,6 +625,7 @@ cvars:
  *
  */
 /* --BEGIN ERROR MACROS-- */
+#ifdef HAVE_ERROR_CHECKING
 #define MPIR_ERR_POP(err_) \
     MPIR_ERR_SETANDSTMT(err_,MPI_ERR_OTHER,goto fn_fail,"**fail")
 #define MPIR_ERR_POP_LABEL(err_, label_) \
@@ -633,6 +634,12 @@ cvars:
     MPIR_ERR_SETFATALANDSTMT(err_,MPI_ERR_OTHER,goto fn_fail,"**fail")
 #define MPIR_ERR_POPFATAL_LABEL(err_, label_)                           \
     MPIR_ERR_SETFATALANDSTMT(err_,MPI_ERR_OTHER,goto label_,"**fail")
+#else
+#define MPIR_ERR_POP(err_) goto fn_fail
+#define MPIR_ERR_POP_LABEL(err_, label_) goto label_
+#define MPIR_ERR_POPFATAL(err_) goto fn_fail
+#define MPIR_ERR_POPFATAL_LABEL(err_, label_) goto label_
+#endif
 
 /* If you add any macros to this list, make sure that you update
  maint/extracterrmsgs to handle the additional macros (see the hash 

http://git.mpich.org/mpich.git/commitdiff/4a706ae7ad15a14f6a759d5df207f5e00d4138f3

commit 4a706ae7ad15a14f6a759d5df207f5e00d4138f3
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Aug 14 11:18:12 2015 -0500

    Cleanup timer functionality.
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/src/util/timers/mpiu_timer.c b/src/util/timers/mpiu_timer.c
index c0d72b7..bebd005 100644
--- a/src/util/timers/mpiu_timer.c
+++ b/src/util/timers/mpiu_timer.c
@@ -6,6 +6,38 @@
 
 #include "mpiu_timer.h"
 
+/*
+ * For timers that do not have defined resolutions, compute the resolution
+ * by sampling the clock itself.
+ *
+ */
+static double tickval = -1.0;
+
+static void init_wtick(void) ATTRIBUTE((unused));
+static void init_wtick(void)
+{
+    double timediff;
+    MPIU_Time_t t1, t2;
+    int cnt;
+    int icnt;
+
+    tickval = 1.0e6;
+    for (icnt = 0; icnt < 10; icnt++) {
+        cnt = 1000;
+        MPIU_Wtime(&t1);
+        do {
+            MPIU_Wtime(&t2);
+            MPIU_Wtime_diff(&t1, &t2, &timediff);
+            if (timediff > 0)
+                break;
+        }
+        while (cnt--);
+        if (cnt && timediff > 0.0 && timediff < tickval) {
+            MPIU_Wtime_diff(&t1, &t2, &tickval);
+        }
+    }
+}
+
 #if MPICH_TIMER_KIND == USE_GETHRTIME
 /*
  * MPIU_Time_t is hrtime_t, which under Solaris is defined as a 64bit
@@ -47,10 +79,10 @@ double MPIU_Wtick(void)
      * is untested */
     return 1.0e-9;
 }
-void MPIU_Init_wtick();
+
 int MPIU_Wtime_init(void)
 {
-    MPIU_Init_wtick();
+    init_wtick();
     return 0;
 }
 
@@ -86,9 +118,6 @@ void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
     }
 }
 
-/* FIXME: We need to cleanup the use of the MPIU_Generic_wtick prototype */
-double MPIU_Generic_wtick(void);
-
 double MPIU_Wtick(void)
 {
     struct timespec res;
@@ -100,19 +129,16 @@ double MPIU_Wtick(void)
         return res.tv_sec + 1.0e-9 * res.tv_nsec;
 
     /* Sigh.  If not implemented (POSIX allows that),
-     * then we need to use the generic tick routine */
-    return MPIU_Generic_wtick();
+     * then we need to return the generic tick value */
+    return tickval;
 }
-void MPIU_Init_wtick();
+
 int MPIU_Wtime_init(void)
 {
-    MPIU_Init_wtick();
+    init_wtick();
     return 0;
 }
 
-#define MPICH_NEEDS_GENERIC_WTICK
-/* Rename the function so that we can access it */
-#define MPIU_Wtick MPIU_Generic_wtick
 
 #elif MPICH_TIMER_KIND == USE_GETTIMEOFDAY
 #ifdef HAVE_SYS_TIME_H
@@ -151,7 +177,15 @@ void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
     }
 }
 
-#define MPICH_NEEDS_GENERIC_WTICK
+double MPIU_Wtick(void)
+{
+    return tickval;
+}
+
+int MPIU_Wtime_init(void)
+{
+    return 0;
+}
 
 
 #elif MPICH_TIMER_KIND == USE_LINUX86_CYCLE
@@ -200,6 +234,10 @@ void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
     *t3 += (*t2 - *t1);
 }
 
+double MPIU_Wtick(void)
+{
+    return tickval;
+}
 
 
 #elif MPICH_TIMER_KIND == USE_GCC_IA64_CYCLE
@@ -334,13 +372,13 @@ void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
 
 #elif MPICH_TIMER_KIND == USE_MACH_ABSOLUTE_TIME
 static double MPIR_Wtime_mult;
-void MPIU_Init_wtick();
+
 int MPIU_Wtime_init(void)
 {
     mach_timebase_info_data_t info;
     mach_timebase_info(&info);
     MPIR_Wtime_mult = 1.0e-9 * ((double) info.numer / (double) info.denom);
-    MPIU_Init_wtick();
+    init_wtick();
     return 0;
 }
 
@@ -364,59 +402,9 @@ void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
     *t3 += *t2 - *t1;
 }
 
-/* FIXME: We need to cleanup the use of the MPIU_Generic_wtick prototype */
-double MPIU_Generic_wtick(void);
-
-double MPIU_Wtick(void)
-{
-    return MPIU_Generic_wtick();
-}
-
-#define MPICH_NEEDS_GENERIC_WTICK
-/* Rename the function so that we can access it */
-#define MPIU_Wtick MPIU_Generic_wtick
-
-
-#endif
-
-#ifdef MPICH_NEEDS_GENERIC_WTICK
-/*
- * For timers that do not have defined resolutions, compute the resolution
- * by sampling the clock itself.
- *
- */
-static double tickval = -1.0;
-
-void MPIU_Init_wtick(void)
-{
-    double timediff;
-    MPIU_Time_t t1, t2;
-    int cnt;
-    int icnt;
-
-    tickval = 1.0e6;
-    for (icnt = 0; icnt < 10; icnt++) {
-        cnt = 1000;
-        MPIU_Wtime(&t1);
-        do {
-            MPIU_Wtime(&t2);
-            MPIU_Wtime_diff(&t1, &t2, &timediff);
-            if (timediff > 0)
-                break;
-        }
-        while (cnt--);
-        if (cnt && timediff > 0.0 && timediff < tickval) {
-            MPIU_Wtime_diff(&t1, &t2, &tickval);
-        }
-    }
-}
-
-#undef FUNCNAME
-#define FUNCNAME MPIU_Wtick
-#undef FCNAME
-#define FCNAME MPL_QUOTE(FUNCNAME)
 double MPIU_Wtick(void)
 {
     return tickval;
 }
+
 #endif
diff --git a/src/util/timers/mpiu_timer.h.in b/src/util/timers/mpiu_timer.h.in
index d101880..a0ad428 100644
--- a/src/util/timers/mpiu_timer.h.in
+++ b/src/util/timers/mpiu_timer.h.in
@@ -8,6 +8,8 @@
 
 #include "mpichconf.h"
 #include <stdlib.h>
+#include "mpl.h"
+
 /*
  * This include file provide the definitions that are necessary to use the
  * timer calls, including the definition of the time stamp type and

http://git.mpich.org/mpich.git/commitdiff/05a87d2a5f7043ca879da13d3ac4876218e01c38

commit 05a87d2a5f7043ca879da13d3ac4876218e01c38
Author: Charles J Archer <charles.j.archer at intel.com>
Date:   Fri Aug 7 12:18:06 2015 -0700

    Second round of code refactoring
    
    Includes MPID->MPIU and MPIU->MPIR cleanup in appropriate places.
    Removes unused macros.  Moves thread functionality to src/util.
    
    Also, remove lock mode for ref counting.  We should never use locks
    for ref counting.  We either use straight load/store or incr/decr
    (when the lock is already held) or do OPA atomics if there is no lock
    held.  If OPA does not have native atomics for a platform, it will
    internally do the lock/unlock based atomic emulation anyway.
    
    Cleanup the per-object threading to pass actual mutexes.
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/.gitignore b/.gitignore
index 5c25ece..bb70b76 100644
--- a/.gitignore
+++ b/.gitignore
@@ -473,7 +473,6 @@ Makefile.am-stamp
 # /src/include/
 /src/include/mpi.h
 /src/include/mpif.h
-/src/include/mpichtimer.h
 #/src/include/mpe_thread.h
 /src/include/mpimod.pcl
 /src/include/mpid_datatype.h
@@ -530,9 +529,6 @@ Makefile.am-stamp
 
 # /src/mpi/spawn/
 
-# /src/mpi/timer/
-/src/mpi/timer/mpichtimer.h
-
 # /src/mpid/ch3/channels/nemesis/nemesis/src/
 /src/mpid/ch3/channels/nemesis/src/mpid_nem_net_array.c
 
@@ -578,6 +574,9 @@ Makefile.am-stamp
 /src/util/logging/rlog/irlog2rlog
 /src/util/logging/rlog/trace_impl.h
 
+# /src/util/timers
+/src/util/timers/mpiu_timer.h
+
 # /test/
 /test/runtests
 
diff --git a/configure.ac b/configure.ac
index 6959e1a..f5953f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -513,11 +513,11 @@ AC_ARG_ENABLE(refcount,
 	AC_HELP_STRING([--enable-refcount=type],
 			[Choose the method for ensuring atomic updates
                          to the reference counts for MPI objects.
-                         Values may be lock, lock-free, none.  The
+                         Values may be lock-free or none.  The
                          default depends on the thread-cs choice; for
                          global it is none (because none is required),
-                         for per-object it is lock, and for lock-free
-                         it is lock-free]),,enable_refcount=default)
+                         for per-object and lock-free, lock-free]),,
+                         enable_refcount=default)
 
 AC_ARG_ENABLE(mutex-timing,
 	AC_HELP_STRING([--enable-mutex-timing], [calculate the time spent waiting on mutexes]),
@@ -1349,6 +1349,10 @@ fi
 export MPICH_THREAD_LEVEL
 AC_DEFINE_UNQUOTED(MPICH_THREAD_LEVEL,$MPICH_THREAD_LEVEL,[Level of thread support selected at compile time])
 
+if test "$MPICH_THREAD_LEVEL" = "MPI_THREAD_MULTIPLE" ; then
+   AC_DEFINE([MPICH_IS_THREADED],[1],[MPICH is configured to require thread safety])
+fi
+
 # If not in MPI_THREAD_SINGLE, we need -D_REENTRANT to get thread-safe "errno".
 # Most POSIX systems provide this by default when using -lpthread, but we only use it in MPI_THREAD_MULTIPLE.
 # Some systems (Solaris) still require an explicit define in any case.
@@ -1357,23 +1361,20 @@ if test "$MPICH_THREAD_LEVEL" != "MPI_THREAD_SINGLE"; then
 fi
 
 # Check for value thread_cs choice; set the refcount default if necessary
-thread_granularity=MPIU_THREAD_GRANULARITY_SINGLE
+thread_granularity=MPIR_THREAD_GRANULARITY_SINGLE
 thread_refcount=MPIU_REFCOUNT_NONE
 if test "$enable_threads" = "multiple" ; then
     case $enable_thread_cs in 
     global)
-    thread_granularity=MPIU_THREAD_GRANULARITY_GLOBAL
+    thread_granularity=MPIR_THREAD_GRANULARITY_GLOBAL
     if test "$enable_refcount" = "default" ; then enable_refcount=none ; fi
     ;;
-    brief-global|brief_global)
-    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
-    if test "$enable_refcount" = "default" ; then enable_refcount=lock ; fi
+    thread_granularity=MPIR_THREAD_GRANULARITY_PER_OBJECT
+    if test "$enable_refcount" = "default" ; then enable_refcount=lock-free ; fi
     ;;
     lock-free|lock_free|lockfree)
-    thread_granularity=MPIU_THREAD_GRANULARITY_LOCK_FREE
+    thread_granularity=MPIR_THREAD_GRANULARITY_LOCK_FREE
     if test "$enable_refcount" = "default" ; then enable_refcount=lock-free ; fi
     if test "$enable_predefined_refcount" = "default" ; then enable_predefined_refcount=no ; fi
     AC_MSG_ERROR([--enable-thread-cs=lock-free is not supported yet, please select a different granularity])
@@ -1384,9 +1385,6 @@ if test "$enable_threads" = "multiple" ; then
     esac
 
     case $enable_refcount in
-    lock)
-    thread_refcount=MPIU_REFCOUNT_LOCK
-    ;;
     lock-free|lock_free|lockfree)
     thread_refcount=MPIU_REFCOUNT_LOCKFREE
     ;;
@@ -1398,7 +1396,7 @@ if test "$enable_threads" = "multiple" ; then
     ;;
     esac
 fi
-AC_DEFINE_UNQUOTED([MPIU_THREAD_GRANULARITY],$thread_granularity,[Method used to implement atomic updates and access])
+AC_DEFINE_UNQUOTED([MPICH_THREAD_GRANULARITY],$thread_granularity,[Method used to implement atomic updates and access])
 
 if test "$enable_predefined_refcount" = "no" ; then
     AC_DEFINE([MPIU_THREAD_SUPPRESS_PREDEFINED_REFCOUNTS],[1],[define to disable reference counting predefined objects like MPI_COMM_WORLD])
@@ -1512,9 +1510,6 @@ if test -n "$perform_memtracing" ; then
         AC_DEFINE(MPICH_DEBUG_MEMARENA,1,[Define if each function exit should confirm memory arena correctness])
     fi
 fi
-if test -n "$perform_mutexnesting" ; then 
-    AC_DEFINE(MPICH_DEBUG_MUTEXNESTING,1,[Define to check nesting in mutexes])
-fi
 USE_DBG_LOGGING=0
 if test -n "$perform_dbglog" ; then
    if test "$with_logging" != "none" ; then
@@ -2356,6 +2351,18 @@ fi
 export modincdir
 AC_SUBST(modincdir)
 
+AC_LANG_PUSH([C])
+AC_MSG_CHECKING([whether TRUE has been defined])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[return TRUE;])],
+                  [has_true_upper_case=yes],
+	          [has_true_upper_case=no])
+AC_MSG_RESULT($has_true_upper_case)
+if test "$has_true_upper_case" = "no" ; then
+   AC_DEFINE(TRUE,1,[Define TRUE])
+   AC_DEFINE(FALSE,0,[Define FALSE])
+fi
+AC_LANG_POP([C])
+
 # ----------------------------------------------------------------------------
 # We previously allowed "default" as a valid value for $enable_cxx.  Now we
 # assume its available by default and error out if it doesn't work (just like
@@ -4699,7 +4706,7 @@ fi
 # Support for timers.  The following code processes the 
 #  --enable-timer-type=name argument and selects the timer based on 
 # both that field and what configure is able to determine is available.
-# The file src/include/mpichtimer.h is also created.
+# The file src/include/mpiu_timer.h is also created.
 # Note that at least the handling of the "device" option must come *after* 
 # the setup_device script is loaded so that the device can set the appropriate
 # fields.  For now, we've split this so that there is an update to the timer
@@ -4708,8 +4715,8 @@ fi
 # FIXME DJG setup_device has been eliminated in favor of subconfigure.m4 files
 # ----------------------------------------------------------------------------
 # Default type for timer stamp.
-MPID_TIMER_TYPE=long
-AC_SUBST(MPID_TIMER_TYPE)
+MPICH_TIMER_TYPE=long
+AC_SUBST(MPICH_TIMER_TYPE)
 
 # If the device specified a timer type, use that by default.  Else,
 # try to detect a type that works on this system.
@@ -4796,7 +4803,7 @@ fi
 case "$timer_type" in
 
     gethrtime)
-    MPID_TIMER_TYPE=hrtime_t
+    MPICH_TIMER_TYPE=hrtime_t
     AC_CHECK_FUNC(gethrtime,,[
          AC_MSG_ERROR([Requested timer gethrtime is not available])
 ])
@@ -4806,7 +4813,7 @@ case "$timer_type" in
     missing_function=no
     AC_SEARCH_LIBS([clock_gettime],[rt],,AC_MSG_ERROR([clock_gettime is not available]))
     AC_SEARCH_LIBS([clock_getres],[rt],,AC_MSG_ERROR([clock_getres is not available]))
-    MPID_TIMER_TYPE="struct timespec"
+    MPICH_TIMER_TYPE="struct timespec"
     # AIX does not always define struct timespec (!)
     # Make sure that we can use struct timespec
     AC_CACHE_CHECK([whether struct timespec is defined in time.h],
@@ -4862,7 +4869,7 @@ pac_cv_posix_clock_realtime=no)
     ;;
 
     gettimeofday)
-    MPID_TIMER_TYPE="struct timeval"
+    MPICH_TIMER_TYPE="struct timeval"
     # We may have already tested for gettimeofday.  If we got a "yes",
     # we're good to go
     if test "$ac_cv_func_gettimeofday" != "yes" ; then
@@ -4966,7 +4973,7 @@ dnl platform.
     if test "$cpu_gcc_x86_cycle" = "no" ; then
         AC_MSG_ERROR([Linux86 cycle counter is not available on this system and or with the $CC compiler])
     fi
-    MPID_TIMER_TYPE="long long"
+    MPICH_TIMER_TYPE="long long"
     ;;
 
     gcc_ia64_cycle)
@@ -4984,7 +4991,7 @@ pac_cv_ia64_cycle,[
     if test "$pac_cv_gcc_ia64_cycle" != "yes" ; then
         AC_MSG_ERROR([IPF cycle counter is not available on this system and or with the $CC compiler])
      fi
-     MPID_TIMER_TYPE="long"
+     MPICH_TIMER_TYPE="long"
      ;;
 
     linuxalpha_cycle)
@@ -4994,14 +5001,14 @@ pac_cv_ia64_cycle,[
     mach_absolute_time)
     AC_CHECK_FUNC(mach_absolute_time,,[AC_MSG_ERROR([mach_absolute_time is not available])])
     AC_CHECK_FUNC(mach_timebase_info,,[AC_MSG_ERROR([mach_timebase_info is not available])])
-    MPID_TIMER_TYPE="uint64_t"
+    MPICH_TIMER_TYPE="uint64_t"
     ;;
 
     device)
     # The device selected should export the datatype for the timer
     # in MPID_DEVICE_TIMER_TYPE if something other than long is needed
     if test -n "$MPID_DEVICE_TIMER_TYPE" ; then
-       MPID_TIMER_TYPE=$MPID_DEVICE_TIMER_TYPE
+       MPICH_TIMER_TYPE=$MPID_DEVICE_TIMER_TYPE
     fi
     ;;
 
@@ -5202,7 +5209,7 @@ if test "$timer_type" = "DEVICE" ; then
     # The device selected should export the datatype for the timer
     # in MPID_DEVICE_TIMER_TYPE if something other than long is needed
     if test -n "$MPID_DEVICE_TIMER_TYPE" ; then 
-       MPID_TIMER_TYPE=$MPID_DEVICE_TIMER_TYPE
+       MPICH_TIMER_TYPE=$MPID_DEVICE_TIMER_TYPE
     fi
 fi
 
@@ -6198,7 +6205,6 @@ AC_OUTPUT(Makefile \
           src/include/mpichinfo.h \
 	  mpich-doxygen \
           src/include/glue_romio.h \
-          src/include/mpichtimer.h \
           src/binding/cxx/mpicxx.h \
 	  src/binding/fortran/mpif_h/mpif.h \
 	  src/binding/fortran/mpif_h/setbotf.f \
@@ -6221,6 +6227,7 @@ AC_OUTPUT(Makefile \
 	  src/env/mpifort.bash \
           src/env/parkill \
 	  src/util/dbg/getfuncstack \
+	  src/util/timers/mpiu_timer.h \
           src/include/mpi.h \
           doc/design/Makefile \
           doc/installguide/Makefile \
diff --git a/maint/Makefile.mk b/maint/Makefile.mk
index caf4fe1..83a9572 100644
--- a/maint/Makefile.mk
+++ b/maint/Makefile.mk
@@ -48,7 +48,6 @@ dist_noinst_DATA +=                        \
     maint/mpi1.lst                         \
     maint/setup.jpg                        \
     maint/structalign.c                    \
-    maint/template.c                       \
     maint/version.m4
 
 ### TODO FIXME what do we do about these?
diff --git a/maint/extractcvars.in b/maint/extractcvars.in
index bb2eca3..b21b688 100755
--- a/maint/extractcvars.in
+++ b/maint/extractcvars.in
@@ -226,7 +226,7 @@ print OUTPUT_C <<EOT;
 #undef FUNCNAME
 #define FUNCNAME ${fn_ns}_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int ${fn_ns}_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -328,19 +328,19 @@ EOT
         if ($p->{type} eq 'range') {
 print OUTPUT_C <<EOT;
     rc = MPL_env2${env_fn}("$env_name", &($var_name.low), &($var_name.high));
-    MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","$env_name");
+    MPIR_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","$env_name");
 EOT
         }
         elsif ($p->{type} eq 'string') {
 print OUTPUT_C <<EOT;
     rc = MPL_env2${env_fn}("$env_name", &tmp_str);
-    MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","$env_name");
+    MPIR_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","$env_name");
 EOT
         }
         else {
 print OUTPUT_C <<EOT;
     rc = MPL_env2${env_fn}("$env_name", &($var_name));
-    MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","$env_name");
+    MPIR_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","$env_name");
 EOT
         }
     }
diff --git a/maint/extracterrmsgs b/maint/extracterrmsgs
index 5fe997e..b22954b 100755
--- a/maint/extracterrmsgs
+++ b/maint/extracterrmsgs
@@ -623,10 +623,10 @@ sub ProcessFile
 	# Match the known routines and macros.
 	# Then check that the arguments match if there is a 
 	# specific string (number of args matches the number present)
-        # MPIU_ERR_CHK(FATAL)?ANDJUMP[1-4]?(cond,code,class,gmsg[,smsg,args])
-        # MPIU_ERR_SET(FATAL)?ANDJUMP[1-4]?(code,class,gmsg[,smsg,args])
-	# MPIU_ERR_CHK(FATAL)?ANDSTMT[1-4]?(cond,code,class,stmt,gmsg[,smsg,args])
-	# MPIU_ERR_SET(FATAL)?ANDSTMT[1-4]?(code,class,stmt,gmsg[,smsg,args])
+        # MPIR_ERR_CHK(FATAL)?ANDJUMP[1-4]?(cond,code,class,gmsg[,smsg,args])
+        # MPIR_ERR_SET(FATAL)?ANDJUMP[1-4]?(code,class,gmsg[,smsg,args])
+	# MPIR_ERR_CHK(FATAL)?ANDSTMT[1-4]?(cond,code,class,stmt,gmsg[,smsg,args])
+	# MPIR_ERR_SET(FATAL)?ANDSTMT[1-4]?(code,class,stmt,gmsg[,smsg,args])
 	# Value is a tuple of:
 	#  the count of args where the generic msg begins (starting from 0)
 	#  location of __LINE__ (-1 for none)
@@ -635,54 +635,54 @@ sub ProcessFile
 	#  location of the error class
 	%KnownErrRoutines = ( 'MPIR_Err_create_code'      => '5:3:1:1:4', 
 			      'MPIO_Err_create_code'      => '5:3:1:0:-1', 
-			      'MPIU_ERR_SET'              => '2:-1:0:1:1',
-			      'MPIU_ERR_SETSIMPLE'        => '2:-1:0:1:1',
-			      'MPIU_ERR_SET1'             => '2:-1:1:1:1',
-			      'MPIU_ERR_SET2'             => '2:-1:2:1:1',
-			      'MPIU_ERR_SETANDSTMT'       => '3:-1:0:1:1',
-			      'MPIU_ERR_SETANDSTMT1'      => '3:-1:1:1:1', 
-			      'MPIU_ERR_SETANDSTMT2'      => '3:-1:1:1:1', 
-			      'MPIU_ERR_SETANDSTMT3'      => '3:-1:1:1:1', 
-			      'MPIU_ERR_SETANDSTMT4'      => '3:-1:1:1:1', 
-			      'MPIU_ERR_SETANDJUMP'       => '2:-1:0:1:1',
-			      'MPIU_ERR_SETANDJUMP1'      => '2:-1:1:1:1', 
-			      'MPIU_ERR_SETANDJUMP2'      => '2:-1:1:1:1', 
-			      'MPIU_ERR_SETANDJUMP3'      => '2:-1:1:1:1', 
-			      'MPIU_ERR_SETANDJUMP4'      => '2:-1:1:1:1', 
-			      'MPIU_ERR_CHKANDSTMT'       => '4:-1:0:1:2', 
-			      'MPIU_ERR_CHKANDSTMT1'      => '4:-1:1:1:2', 
-			      'MPIU_ERR_CHKANDSTMT2'      => '4:-1:1:1:2', 
-			      'MPIU_ERR_CHKANDSTMT3'      => '4:-1:1:1:2', 
-			      'MPIU_ERR_CHKANDSTMT4'      => '4:-1:1:1:2', 
-			      'MPIU_ERR_CHKANDJUMP'       => '3:-1:0:1:2',
-			      'MPIU_ERR_CHKANDJUMP1'      => '3:-1:1:1:2',
-			      'MPIU_ERR_CHKANDJUMP2'      => '3:-1:1:1:2',
-			      'MPIU_ERR_CHKANDJUMP3'      => '3:-1:1:1:2',
-			      'MPIU_ERR_CHKANDJUMP4'      => '3:-1:1:1:2',
-			      'MPIU_ERR_SETFATAL'         => '2:-1:0:1:1',
-			      'MPIU_ERR_SETFATALSIMPLE'   => '2:-1:0:1:1',
-			      'MPIU_ERR_SETFATAL1'        => '2:-1:1:1:1',
-			      'MPIU_ERR_SETFATAL2'        => '2:-1:2:1:1',
-			      'MPIU_ERR_SETFATALANDSTMT'  => '3:-1:0:1:1',
-			      'MPIU_ERR_SETFATALANDSTMT1' => '3:-1:1:1:1', 
-			      'MPIU_ERR_SETFATALANDSTMT2' => '3:-1:1:1:1', 
-			      'MPIU_ERR_SETFATALANDSTMT3' => '3:-1:1:1:1', 
-			      'MPIU_ERR_SETFATALANDSTMT4' => '3:-1:1:1:1', 
-			      'MPIU_ERR_SETFATALANDJUMP'  => '2:-1:0:1:1',
-			      'MPIU_ERR_SETFATALANDJUMP1' => '2:-1:1:1:1', 
-			      'MPIU_ERR_SETFATALANDJUMP2' => '2:-1:1:1:1', 
-			      'MPIU_ERR_SETFATALANDJUMP3' => '2:-1:1:1:1', 
-			      'MPIU_ERR_SETFATALANDJUMP4' => '2:-1:1:1:1', 
-			      'MPIU_ERR_CHKFATALANDSTMT'  => '4:-1:0:1:2', 
-			      'MPIU_ERR_CHKFATALANDSTMT1' => '4:-1:1:1:2', 
-			      'MPIU_ERR_CHKFATALANDSTMT2' => '4:-1:1:1:2', 
-			      'MPIU_ERR_CHKFATALANDSTMT3' => '4:-1:1:1:2', 
-			      'MPIU_ERR_CHKFATALANDSTMT4' => '4:-1:1:1:2', 
-			      'MPIU_ERR_CHKFATALANDJUMP'  => '3:-1:0:1:2',
-			      'MPIU_ERR_CHKFATALANDJUMP1' => '3:-1:1:1:2',
-			      'MPIU_ERR_CHKFATALANDJUMP2' => '3:-1:1:1:2',
-			      'MPIU_ERR_CHKFATALANDJUMP3' => '3:-1:1:1:2',
-			      'MPIU_ERR_CHKFATALANDJUMP4' => '3:-1:1:1:2',
+			      'MPIR_ERR_SET'              => '2:-1:0:1:1',
+			      'MPIR_ERR_SETSIMPLE'        => '2:-1:0:1:1',
+			      'MPIR_ERR_SET1'             => '2:-1:1:1:1',
+			      'MPIR_ERR_SET2'             => '2:-1:2:1:1',
+			      'MPIR_ERR_SETANDSTMT'       => '3:-1:0:1:1',
+			      'MPIR_ERR_SETANDSTMT1'      => '3:-1:1:1:1', 
+			      'MPIR_ERR_SETANDSTMT2'      => '3:-1:1:1:1', 
+			      'MPIR_ERR_SETANDSTMT3'      => '3:-1:1:1:1', 
+			      'MPIR_ERR_SETANDSTMT4'      => '3:-1:1:1:1', 
+			      'MPIR_ERR_SETANDJUMP'       => '2:-1:0:1:1',
+			      'MPIR_ERR_SETANDJUMP1'      => '2:-1:1:1:1', 
+			      'MPIR_ERR_SETANDJUMP2'      => '2:-1:1:1:1', 
+			      'MPIR_ERR_SETANDJUMP3'      => '2:-1:1:1:1', 
+			      'MPIR_ERR_SETANDJUMP4'      => '2:-1:1:1:1', 
+			      'MPIR_ERR_CHKANDSTMT'       => '4:-1:0:1:2', 
+			      'MPIR_ERR_CHKANDSTMT1'      => '4:-1:1:1:2', 
+			      'MPIR_ERR_CHKANDSTMT2'      => '4:-1:1:1:2', 
+			      'MPIR_ERR_CHKANDSTMT3'      => '4:-1:1:1:2', 
+			      'MPIR_ERR_CHKANDSTMT4'      => '4:-1:1:1:2', 
+			      'MPIR_ERR_CHKANDJUMP'       => '3:-1:0:1:2',
+			      'MPIR_ERR_CHKANDJUMP1'      => '3:-1:1:1:2',
+			      'MPIR_ERR_CHKANDJUMP2'      => '3:-1:1:1:2',
+			      'MPIR_ERR_CHKANDJUMP3'      => '3:-1:1:1:2',
+			      'MPIR_ERR_CHKANDJUMP4'      => '3:-1:1:1:2',
+			      'MPIR_ERR_SETFATAL'         => '2:-1:0:1:1',
+			      'MPIR_ERR_SETFATALSIMPLE'   => '2:-1:0:1:1',
+			      'MPIR_ERR_SETFATAL1'        => '2:-1:1:1:1',
+			      'MPIR_ERR_SETFATAL2'        => '2:-1:2:1:1',
+			      'MPIR_ERR_SETFATALANDSTMT'  => '3:-1:0:1:1',
+			      'MPIR_ERR_SETFATALANDSTMT1' => '3:-1:1:1:1', 
+			      'MPIR_ERR_SETFATALANDSTMT2' => '3:-1:1:1:1', 
+			      'MPIR_ERR_SETFATALANDSTMT3' => '3:-1:1:1:1', 
+			      'MPIR_ERR_SETFATALANDSTMT4' => '3:-1:1:1:1', 
+			      'MPIR_ERR_SETFATALANDJUMP'  => '2:-1:0:1:1',
+			      'MPIR_ERR_SETFATALANDJUMP1' => '2:-1:1:1:1', 
+			      'MPIR_ERR_SETFATALANDJUMP2' => '2:-1:1:1:1', 
+			      'MPIR_ERR_SETFATALANDJUMP3' => '2:-1:1:1:1', 
+			      'MPIR_ERR_SETFATALANDJUMP4' => '2:-1:1:1:1', 
+			      'MPIR_ERR_CHKFATALANDSTMT'  => '4:-1:0:1:2', 
+			      'MPIR_ERR_CHKFATALANDSTMT1' => '4:-1:1:1:2', 
+			      'MPIR_ERR_CHKFATALANDSTMT2' => '4:-1:1:1:2', 
+			      'MPIR_ERR_CHKFATALANDSTMT3' => '4:-1:1:1:2', 
+			      'MPIR_ERR_CHKFATALANDSTMT4' => '4:-1:1:1:2', 
+			      'MPIR_ERR_CHKFATALANDJUMP'  => '3:-1:0:1:2',
+			      'MPIR_ERR_CHKFATALANDJUMP1' => '3:-1:1:1:2',
+			      'MPIR_ERR_CHKFATALANDJUMP2' => '3:-1:1:1:2',
+			      'MPIR_ERR_CHKFATALANDJUMP3' => '3:-1:1:1:2',
+			      'MPIR_ERR_CHKFATALANDJUMP4' => '3:-1:1:1:2',
 			      'MPIR_ERRTEST_VALID_HANDLE' => '4:-1:0:1:3',
 			      );
 	while (/(MPI[OUR]_E[A-Za-z0-9_]+)\s*(\(.*)$/) {
diff --git a/maint/getcoverage.in b/maint/getcoverage.in
index 904fcd3..9eb7239 100644
--- a/maint/getcoverage.in
+++ b/maint/getcoverage.in
@@ -288,13 +288,13 @@ L:  while (<FD>) {
 	}
 
 	# If requested, skip obvious error checking lines
-	# The errflag set should really be an MPIU_ERR macro; the
+	# The errflag set should really be an MPIR_ERR macro; the
 	# test is designed to accept only lines that set that flag
 	# and nothing else.
 	if ($skipErrExits && 
 	    (/FUNC_EXIT.*STATE/ || /MPIR_Err_return_/ || 
-	     /MPIU_ERR_SET/ || /MPIU_ERR_POP/ || /goto\s+fn_fail/ ||
-	     /MPIU_ERR_ADD/ || /\*errflag\s*=\s*[^;]*;\s*$/ || 
+	     /MPIR_ERR_SET/ || /MPIR_ERR_POP/ || /goto\s+fn_fail/ ||
+	     /MPIR_ERR_ADD/ || /\*errflag\s*=\s*[^;]*;\s*$/ || 
 	     /fn_fail:/ || /MPIR_Err_create_code/)) {
 	    next;
 	}
@@ -408,8 +408,8 @@ L2: while (<FD>) {
 	# The format of the line also changed
 	if ($skipErrExits && 
 	    (/FUNC_EXIT.*STATE/ || /MPIR_Err_return_/ || 
-	     /MPIU_ERR_SET/ || /MPIU_ERR_POP/ || /goto\s+fn_fail/ ||
-	     /MPIU_ERR_ADD/ || /\*errflag\s*=\s*[^;]*;\s*$/ || 
+	     /MPIR_ERR_SET/ || /MPIR_ERR_POP/ || /goto\s+fn_fail/ ||
+	     /MPIR_ERR_ADD/ || /\*errflag\s*=\s*[^;]*;\s*$/ || 
             /fn_fail:/ || /MPIR_Err_create_code/)) {
 	    # If requested, skip obvious error checking lines
 	    $newstate = "skip";
diff --git a/maint/template.c b/maint/template.c
deleted file mode 100644
index 945aaf1..0000000
--- a/maint/template.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include "mpiimpl.h"
-
-/* -- Begin Profiling Symbol Block for routine MPI_Foo */
-#if defined(HAVE_PRAGMA_WEAK)
-#pragma weak MPI_Foo = PMPI_Foo
-#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
-#pragma _HP_SECONDARY_DEF PMPI_Foo  MPI_Foo
-#elif defined(HAVE_PRAGMA_CRI_DUP)
-#pragma _CRI duplicate MPI_Foo as PMPI_Foo
-#endif
-/* -- End Profiling Symbol Block */
-
-/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
-   the MPI routines.  You can use USE_WEAK_SYMBOLS to see if MPICH is
-   using weak symbols to implement the MPI routines. */
-#ifndef MPICH_MPI_FROM_PMPI
-/* The PMPI routine is built using a CPP macro to rename the MPI routine
-   implemented below.  The MPI name must be undefined first to prevent any
-   conflicts with previous renamings. */
-#undef MPI_Foo
-#define MPI_Foo PMPI_Foo
-
-/* Any internal routines can go here.  Make them static if possible.  If they
-   are used by both the MPI and PMPI versions, use PMPI_LOCAL instead of 
-   static; this macro expands into "static" if weak symbols are supported and
-   into nothing otherwise. */
-int MPIR_Foo_util( int a, MPID_Comm *comm )
-{
-...
-}
-#endif
-
-#undef FUNCNAME
-#define FUNCNAME MPI_Foo
-
-/*@
-   MPI_Foo - short description
-
-   Input Arguments:
-+  first - 
-.  middle - 
--  last - 
-
-   Output Arguments:
-
-   Notes:
-
-.N Fortran
-
-.N Errors
-.N MPI_SUCCESS
-.N ... others
-@*/
-int MPI_Foo( MPI_Comm comm, MPI_Datatype dataype, int a ) 
-{
-    static const char FCNAME[] = "MPI_Foo";
-    int mpi_errno = MPI_SUCCESS;
-    MPID_Comm *comm_ptr = NULL;
-    MPID_MPI_STATE_DECL(MPID_STATE_MPI_FOO);
-
-    MPIR_ERRTEST_INITIALIZED_ORDIE();
-    
-    MPIU_THREAD_CS_ENTER(ALLFUNC);
-    MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_FOO);
-
-    /* Validate handle parameters needing to be converted */
-#   ifdef HAVE_ERROR_CHECKING
-    {
-        MPID_BEGIN_ERROR_CHECKS;
-        {
-	    MPIR_ERRTEST_COMM(comm, mpi_errno);
-            if (mpi_errno) goto fn_fail;
-	}
-        MPID_END_ERROR_CHECKS;
-    }
-#   endif /* HAVE_ERROR_CHECKING */
-    
-    /* Convert handles to MPI objects. */
-    MPID_Comm_get_ptr( comm, comm_ptr );
-    
-#   ifdef HAVE_ERROR_CHECKING
-    {
-        MPID_BEGIN_ERROR_CHECKS;
-        {
-            MPID_Datatype *datatype_ptr = NULL;
-
-            /* Validate comm_ptr */
-            MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
-	    /* If comm_ptr is not valid, it will be reset to null */
-            if (mpi_errno) goto fn_fail;
-
-            if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN)
-	    {
-                MPID_Datatype_get_ptr(datatype, datatype_ptr);
-                MPID_Datatype_valid_ptr( datatype_ptr, mpi_errno );
-                if (mpi_errno != MPI_SUCCESS) goto fn_fail;
-            }
-        }
-        MPID_END_ERROR_CHECKS;
-    }
-#   endif /* HAVE_ERROR_CHECKING */
-
-    /* ... body of routine ...  */
-    
-    /* ... end of body of routine ... */
-
-  fn_exit:
-    MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_FOO);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
-    return mpi_errno;
-
-  fn_fail:
-    /* --BEGIN ERROR HANDLING-- */
-#   ifdef HAVE_ERROR_CHECKING
-    {
-	mpi_errno = MPIR_Err_create_code(
-	    mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, 
-	    MPI_ERR_OTHER, "**mpi_foo",
-	    "**mpi_foo %C %D %d", comm, datatype, a);
-    }
-#   endif
-    mpi_errno = MPIR_Err_return_comm( comm_ptr, FCNAME, mpi_errno );
-    goto fn_exit;
-    /* --END ERROR HANDLING-- */
-}
diff --git a/src/binding/fortran/mpif_h/buildiface b/src/binding/fortran/mpif_h/buildiface
index d644d58..9f5d95f 100755
--- a/src/binding/fortran/mpif_h/buildiface
+++ b/src/binding/fortran/mpif_h/buildiface
@@ -4283,17 +4283,14 @@ sub build_specials {
     &set_weak_decl( "MPI_Wtime", "void", "double" );
     &set_weak_decl( "PMPI_Wtime", "void", "double" );
     &print_header( "mpi_", "MPI_Wtime", "wtime", "" );
-    # mpichtimer.h is needed for the timer definitions
+    # mpiu_timer.h is needed for the timer definitions
     print $OUTFD "#include \"mpichconf.h\"\n";
-    print $OUTFD "#include \"mpichtimer.h\"\n";
+    print $OUTFD "#include \"mpiu_timer.h\"\n";
     &print_routine_type_decl( $OUTFD, $out_prefix, "wtime" );
     print $OUTFD "( void ) ";
     #&print_attr;
     print $OUTFD "{\n";
-    print $OUTFD "    double d; MPID_Time_t t;\n
-    MPID_Wtime( &t );
-    MPID_Wtime_todouble( &t, &d );
-    return d;\n";
+    print $OUTFD "return MPI_Wtime();\n";
     print $OUTFD "}\n";
     close ($OUTFD);
     &ReplaceIfDifferent( $filename, $filename . ".new" );
@@ -4315,16 +4312,14 @@ sub build_specials {
     &set_weak_decl( "MPI_Wtick", "void", "double" );
     &set_weak_decl( "PMPI_Wtick", "void", "double" );
     &print_header( "mpi_", "MPI_Wtick", "wtick", "" );
-    # mpichtimer.h is needed for the timer definitions
+    # mpiu_timer.h is needed for the timer definitions
     print $OUTFD "#include \"mpichconf.h\"\n";
-    print $OUTFD "#include \"mpichtimer.h\"\n";
+    print $OUTFD "#include \"mpiu_timer.h\"\n";
     &print_routine_type_decl( $OUTFD, $out_prefix, "wtick" );
     print $OUTFD "( void ) ";
     #&print_attr;
     print $OUTFD "{\n";
-    print $OUTFD "    double d; 
-    d = MPID_Wtick( );
-    return d;\n";
+    print $OUTFD "return MPI_Wtick();\n";
     print $OUTFD "}\n";
     close ($OUTFD);
     &ReplaceIfDifferent( $filename, $filename . ".new" );
diff --git a/src/binding/fortran/use_mpi/create_f90_complex.c b/src/binding/fortran/use_mpi/create_f90_complex.c
index c002da4..b65e7cb 100644
--- a/src/binding/fortran/use_mpi/create_f90_complex.c
+++ b/src/binding/fortran/use_mpi/create_f90_complex.c
@@ -80,7 +80,7 @@ int MPI_Type_create_f90_complex( int precision, int range, MPI_Datatype *newtype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_F90_COMPLEX);
 
     /* ... body of routine ...  */
@@ -95,7 +95,7 @@ int MPI_Type_create_f90_complex( int precision, int range, MPI_Datatype *newtype
 					    f90_real_model[i].digits, 
 					    f90_real_model[i].exponent, 
 					    &f90_real_model[i].dtype );
-	    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+	    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	}
     }
 
@@ -120,13 +120,13 @@ int MPI_Type_create_f90_complex( int precision, int range, MPI_Datatype *newtype
 	mpi_errno = MPIR_Create_unnamed_predefined( basetype, 
 		    MPI_COMBINER_F90_COMPLEX, range, precision, newtype );
 	}
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_F90_COMPLEX);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/binding/fortran/use_mpi/create_f90_int.c b/src/binding/fortran/use_mpi/create_f90_int.c
index 4dd7c8c..f2a8ad9 100644
--- a/src/binding/fortran/use_mpi/create_f90_int.c
+++ b/src/binding/fortran/use_mpi/create_f90_int.c
@@ -74,7 +74,7 @@ int MPI_Type_create_f90_integer( int range, MPI_Datatype *newtype )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_F90_INTEGER);
 
     /* ... body of routine ...  */
@@ -109,7 +109,7 @@ int MPI_Type_create_f90_integer( int range, MPI_Datatype *newtype )
     /* ... end of body of routine ... */
  fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_F90_INTEGER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
  fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/binding/fortran/use_mpi/create_f90_real.c b/src/binding/fortran/use_mpi/create_f90_real.c
index a21e810..5e3a68f 100644
--- a/src/binding/fortran/use_mpi/create_f90_real.c
+++ b/src/binding/fortran/use_mpi/create_f90_real.c
@@ -79,7 +79,7 @@ int MPI_Type_create_f90_real( int precision, int range, MPI_Datatype *newtype )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_F90_REAL);
 
     /* ... body of routine ...  */
@@ -94,7 +94,7 @@ int MPI_Type_create_f90_real( int precision, int range, MPI_Datatype *newtype )
 					    f90_real_model[i].digits, 
 					    f90_real_model[i].exponent, 
 					    &f90_real_model[i].dtype );
-	    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+	    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	}
     }
 
@@ -119,11 +119,11 @@ int MPI_Type_create_f90_real( int precision, int range, MPI_Datatype *newtype )
 	mpi_errno = MPIR_Create_unnamed_predefined( basetype, 
 			    MPI_COMBINER_F90_REAL, range, precision, newtype );
     }
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     /* ... end of body of routine ... */
 
  fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_F90_REAL);
     return mpi_errno;
  fn_fail:
diff --git a/src/binding/fortran/use_mpi/create_f90_util.c b/src/binding/fortran/use_mpi/create_f90_util.c
index 956a118..0749891 100644
--- a/src/binding/fortran/use_mpi/create_f90_util.c
+++ b/src/binding/fortran/use_mpi/create_f90_util.c
@@ -36,7 +36,7 @@ static int MPIR_FreeF90Datatypes( void *d )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Create_unnamed_predefined
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Create_unnamed_predefined( MPI_Datatype old, int combiner, 
 				    int r, int p, 
 				    MPI_Datatype *new_ptr )
@@ -76,7 +76,7 @@ int MPIR_Create_unnamed_predefined( MPI_Datatype old, int combiner,
 
     /* Create a contiguous type from one instance of the named type */
     mpi_errno = MPID_Type_contiguous( 1, old, &type->d );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Initialize the contents data */
     {
@@ -102,7 +102,7 @@ int MPIR_Create_unnamed_predefined( MPI_Datatype old, int combiner,
 	mpi_errno = MPID_Datatype_set_contents(new_dtp, combiner,
 					       nvals, 0, 0, vals,
 					       NULL, NULL );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* FIXME should we be setting type->is_permanent=TRUE here too?  If so,
          * will the cleanup code handle it correctly and not freak out? */
@@ -123,7 +123,7 @@ int MPIR_Create_unnamed_predefined( MPI_Datatype old, int combiner,
         /* the MPI Standard requires that these types are pre-committed
          * (MPI-2.2, sec 16.2.5, pg 492) */
         mpi_errno = MPID_Type_commit(&type->d);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     *new_ptr       = type->d;
diff --git a/src/binding/fortran/use_mpi_f08/wrappers_c/comm_spawn_multiple_c.c b/src/binding/fortran/use_mpi_f08/wrappers_c/comm_spawn_multiple_c.c
index 5e07e57..b7ab98c 100644
--- a/src/binding/fortran/use_mpi_f08/wrappers_c/comm_spawn_multiple_c.c
+++ b/src/binding/fortran/use_mpi_f08/wrappers_c/comm_spawn_multiple_c.c
@@ -4,7 +4,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_spawn_multiple_c
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_spawn_multiple_c(int count, char* array_of_commands_f,
              char* array_of_argv_f, const int* array_of_maxprocs,
              const MPI_Info* array_of_info, int root, MPI_Comm comm,
@@ -49,12 +49,12 @@ int MPIR_Comm_spawn_multiple_c(int count, char* array_of_commands_f,
         array_of_argv_c = MPI_ARGVS_NULL;
     } else {
         array_of_argv_c = (char***) MPIU_Malloc(sizeof(char**)*count);
-        if (!array_of_argv_c) MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
+        if (!array_of_argv_c) MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
 
         /* Allocate a temp buf to put args of a command */
         len = 256; /* length of buf. Initialized with an arbitrary value */
         buf = (char*)MPIU_Malloc(sizeof(char)*len);
-        if (!buf) MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
+        if (!buf) MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
 
         for (i = 0; i < count; i++) {
             /* Extract args of command i, and put them in buf */
@@ -67,7 +67,7 @@ int MPIR_Comm_spawn_multiple_c(int count, char* array_of_commands_f,
                     newbuf = (char*)MPIU_Realloc(buf, len);
                     if (!newbuf) {
                         MPIU_Free(buf);
-                        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
+                        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
                     }
                     buf = newbuf;
                 }
diff --git a/src/binding/fortran/use_mpi_f08/wrappers_c/utils.c b/src/binding/fortran/use_mpi_f08/wrappers_c/utils.c
index 3e1e629..4d0e112 100644
--- a/src/binding/fortran/use_mpi_f08/wrappers_c/utils.c
+++ b/src/binding/fortran/use_mpi_f08/wrappers_c/utils.c
@@ -24,7 +24,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_Fortran_array_of_string_f2c
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 extern int MPIR_Fortran_array_of_string_f2c(const char* strs_f, char*** strs_c, int str_len, int know_size, int size)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -53,7 +53,7 @@ extern int MPIR_Fortran_array_of_string_f2c(const char* strs_f, char*** strs_c,
     /* Allocate memory for pointers to strings and the strings themself */
     buf = (char*) MPIU_Malloc(sizeof(char*) * num_strs + sizeof(char) * (num_chars + num_strs)); /* Add \0 for each string */
     if (buf == NULL) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
     }
 
     *strs_c = (char**)buf;
diff --git a/src/glue/romio/glue_romio.c b/src/glue/romio/glue_romio.c
index 9b64992..0c8c5f6 100644
--- a/src/glue/romio/glue_romio.c
+++ b/src/glue/romio/glue_romio.c
@@ -35,50 +35,50 @@ int MPIR_Ext_assert_fail(const char *cond, const char *file_name, int line_num)
     return MPIR_Assert_fail(cond, file_name, line_num);
 }
 
-/* These two routines export the ALLFUNC CS_ENTER/EXIT macros as functions so
+/* These two routines export the GLOBAL CS_ENTER/EXIT macros as functions so
  * that ROMIO can use them.  These routines only support the GLOBAL granularity
  * of MPICH threading; other accommodations must be made for finer-grained
  * threading strategies. */
-void MPIR_Ext_cs_enter_allfunc(void)
+void MPIR_Ext_cs_enter_global(void)
 {
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 }
 
-void MPIR_Ext_cs_exit_allfunc(void)
+void MPIR_Ext_cs_exit_global(void)
 {
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 }
 
 /* This routine is for a thread to yield control when the thread is waiting for
  * the completion of communication inside a ROMIO routine but the progress
  * engine is blocked by another thread. */
-void MPIR_Ext_cs_yield_allfunc_if_progress_blocked(void)
+void MPIR_Ext_cs_yield_global_if_progress_blocked(void)
 {
     /* TODO: check whether the progress engine is blocked */
-    MPIU_THREAD_CS_YIELD(ALLFUNC,);
+    MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
 }
 
 /* will consider MPI_DATATYPE_NULL to be an error */
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ext_datatype_iscommitted
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ext_datatype_iscommitted(MPI_Datatype datatype)
 {
     int mpi_errno = MPI_SUCCESS;
 
     MPIR_ERRTEST_DATATYPE(datatype, "datatype", mpi_errno);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN) {
         MPID_Datatype *datatype_ptr = NULL;
         MPID_Datatype_get_ptr(datatype, datatype_ptr);
 
         MPID_Datatype_valid_ptr(datatype_ptr, mpi_errno);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         MPID_Datatype_committed_ptr(datatype_ptr, mpi_errno);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_fail:
diff --git a/src/include/Makefile.mk b/src/include/Makefile.mk
index 23a11ab..4c2eb76 100644
--- a/src/include/Makefile.mk
+++ b/src/include/Makefile.mk
@@ -14,8 +14,7 @@ nodist_include_HEADERS += src/include/mpi.h
 nodist_noinst_HEADERS +=     \
     src/include/glue_romio.h \
     src/include/mpichinfo.h \
-    src/include/mpichconf.h  \
-    src/include/mpichtimer.h
+    src/include/mpichconf.h
 
 ## listed here in BUILT_SOURCES to ensure that if glue_romio.h is out of date
 ## that it will be rebuilt before make recurses into src/mpi/romio and runs
@@ -39,8 +38,6 @@ noinst_HEADERS +=                   \
     src/include/mpifunc.h           \
     src/include/mpihandlemem.h      \
     src/include/mpiimpl.h           \
-    src/include/mpiimplthread.h     \
-    src/include/mpiimplthreadpost.h \
     src/include/mpimem.h            \
     src/include/mpir_nbc.h          \
     src/include/mpir_type_defs.h    \
diff --git a/src/include/glue_romio.h.in b/src/include/glue_romio.h.in
index 5f61016..d4d859d 100644
--- a/src/include/glue_romio.h.in
+++ b/src/include/glue_romio.h.in
@@ -51,9 +51,9 @@ extern int MPIR_Ext_dbg_romio_verbose_enabled;
  * glue code that cannot be initialized statically */
 int MPIR_Ext_init(void);
 
-void MPIR_Ext_cs_enter_allfunc(void);
-void MPIR_Ext_cs_exit_allfunc(void);
-void MPIR_Ext_cs_yield_allfunc_if_progress_blocked(void);
+void MPIR_Ext_cs_enter_global(void);
+void MPIR_Ext_cs_exit_global(void);
+void MPIR_Ext_cs_yield_global_if_progress_blocked(void);
 
 /* to facilitate error checking */
 int MPIR_Ext_datatype_iscommitted(MPI_Datatype datatype);
diff --git a/src/include/mpichconfconst.h b/src/include/mpichconfconst.h
index 8f4e2da..946a8de 100644
--- a/src/include/mpichconfconst.h
+++ b/src/include/mpichconfconst.h
@@ -26,16 +26,15 @@
 /* Define the four ways that we achieve proper thread-safe updates of
  * shared structures and services
  *
- * A configure choice will set MPIU_THREAD_GRANULARITY to one of these values */
+ * A configure choice will set MPICH_THREAD_GRANULARITY to one of these values */
 
 /* _INVALID exists to avoid accidental macro evaluations to 0 */
-#define MPIU_THREAD_GRANULARITY_INVALID 0
-#define MPIU_THREAD_GRANULARITY_GLOBAL 1
-#define MPIU_THREAD_GRANULARITY_BRIEF_GLOBAL 2
-#define MPIU_THREAD_GRANULARITY_PER_OBJECT 3
-#define MPIU_THREAD_GRANULARITY_LOCK_FREE 4
+#define MPIR_THREAD_GRANULARITY_INVALID 0
+#define MPIR_THREAD_GRANULARITY_GLOBAL 1
+#define MPIR_THREAD_GRANULARITY_PER_OBJECT 2
+#define MPIR_THREAD_GRANULARITY_LOCK_FREE 3
 /* _SINGLE is the "null" granularity, where all processes are single-threaded */
-#define MPIU_THREAD_GRANULARITY_SINGLE 5
+#define MPIR_THREAD_GRANULARITY_SINGLE 4
 
 /* controls the allocation mechanism for MPID_Request handles, which can greatly
  * affect concurrency on the critical path */
@@ -46,7 +45,6 @@
 #define MPIU_REFCOUNT_INVALID 0
 /* _NONE means no concurrency control, such as when using MPI_THREAD_SINGLE */
 #define MPIU_REFCOUNT_NONE 1
-#define MPIU_REFCOUNT_LOCK 2
-#define MPIU_REFCOUNT_LOCKFREE 3
+#define MPIU_REFCOUNT_LOCKFREE 2
 
 #endif /* MPICHCONFCONST_H_INCLUDED */
diff --git a/src/include/mpierrs.h b/src/include/mpierrs.h
index cf7ed3c..5c22f15 100644
--- a/src/include/mpierrs.h
+++ b/src/include/mpierrs.h
@@ -265,7 +265,7 @@ cvars:
 #define MPIR_ERRTEST_WIN_FLAVOR(win_, flavor_, err_)                    \
     do {                                                                \
         if ((win_)->create_flavor != (flavor_)) {                       \
-            MPIU_ERR_SETANDSTMT1((err_), MPI_ERR_RMA_FLAVOR,            \
+            MPIR_ERR_SETANDSTMT1((err_), MPI_ERR_RMA_FLAVOR,            \
                                 goto fn_fail, "**winflavor",            \
                                  "**winflavor %s", #flavor_);           \
         }                                                               \
@@ -295,7 +295,7 @@ cvars:
 #define MPIR_ERRTEST_NAMED_BUF_INPLACE(buf, bufname, count, err)       \
     do {                                                               \
         if (count > 0 && buf == MPI_IN_PLACE) {                        \
-            MPIU_ERR_SETANDJUMP1(err, MPI_ERR_BUFFER, "**buf_inplace", \
+            MPIR_ERR_SETANDJUMP1(err, MPI_ERR_BUFFER, "**buf_inplace", \
                                  "**buf_inplace %s", bufname);         \
         }                                                              \
     } while (0)
@@ -346,7 +346,7 @@ cvars:
 #define MPIR_ERRTEST_VALID_HANDLE(handle_,kind_,err_,errclass_,gmsg_) { \
         if (HANDLE_GET_MPI_KIND(handle_) != kind_ ||                    \
             HANDLE_GET_KIND(handle_) == HANDLE_KIND_INVALID) {          \
-            MPIU_ERR_SETANDSTMT(err_,errclass_,goto fn_fail,gmsg_);     \
+            MPIR_ERR_SETANDSTMT(err_,errclass_,goto fn_fail,gmsg_);     \
         }                                                               \
     }
 /* --END ERROR MACROS-- */
@@ -354,10 +354,10 @@ cvars:
 #define MPIR_ERRTEST_OP(op,err)                                                 \
     do {                                                                        \
         if (op == MPI_OP_NULL) {                                                \
-            MPIU_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnull");        \
+            MPIR_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnull");        \
         }                                                                       \
         else if (op == MPI_NO_OP || op == MPI_REPLACE) {                        \
-            MPIU_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnotallowed");  \
+            MPIR_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnotallowed");  \
         }                                                                       \
         else {                                                                  \
             MPIR_ERRTEST_VALID_HANDLE(op,MPID_OP,err,MPI_ERR_OP,"**op");        \
@@ -367,35 +367,35 @@ cvars:
 #define MPIR_ERRTEST_OP_ACC(op,err)                                             \
     do {                                                                        \
         if (op == MPI_OP_NULL) {                                                \
-            MPIU_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnull");        \
+            MPIR_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnull");        \
         }                                                                       \
         else if (op == MPI_NO_OP) {                                             \
-            MPIU_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnotallowed");  \
+            MPIR_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnotallowed");  \
         }                                                                       \
         else {                                                                  \
             MPIR_ERRTEST_VALID_HANDLE(op,MPID_OP,err,MPI_ERR_OP,"**op");        \
         }                                                                       \
         if (HANDLE_GET_KIND(op) != HANDLE_KIND_BUILTIN) {                       \
-            MPIU_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnotpredefined"); \
+            MPIR_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnotpredefined"); \
         }                                                                       \
     } while (0)
 
 #define MPIR_ERRTEST_OP_GACC(op,err)                                            \
     do {                                                                        \
         if (op == MPI_OP_NULL) {                                                \
-            MPIU_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnull");        \
+            MPIR_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnull");        \
         }                                                                       \
         else {                                                                  \
             MPIR_ERRTEST_VALID_HANDLE(op,MPID_OP,err,MPI_ERR_OP,"**op");        \
         }                                                                       \
         if (HANDLE_GET_KIND(op) != HANDLE_KIND_BUILTIN) {                       \
-            MPIU_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnotpredefined"); \
+            MPIR_ERR_SETANDSTMT(err,MPI_ERR_OP,goto fn_fail,"**opnotpredefined"); \
         }                                                                       \
     } while (0)
 
 #define MPIR_ERRTEST_GROUP(group,err)                                   \
     if (group == MPI_GROUP_NULL) {                                      \
-        MPIU_ERR_SETANDSTMT(err,MPI_ERR_GROUP,goto fn_fail,"**groupnull"); \
+        MPIR_ERR_SETANDSTMT(err,MPI_ERR_GROUP,goto fn_fail,"**groupnull"); \
     }                                                                   \
     else {                                                              \
         MPIR_ERRTEST_VALID_HANDLE(group,MPID_GROUP,err,MPI_ERR_GROUP,"**group"); \
@@ -405,7 +405,7 @@ cvars:
     {									\
         if ((comm_) == MPI_COMM_NULL)					\
         {                                                               \
-            MPIU_ERR_SETANDSTMT((err_), MPI_ERR_COMM,goto fn_fail,"**commnull"); \
+            MPIR_ERR_SETANDSTMT((err_), MPI_ERR_COMM,goto fn_fail,"**commnull"); \
         }                                                               \
         else								\
         {                                                               \
@@ -417,7 +417,7 @@ cvars:
     {									\
         if ((win_) == MPI_WIN_NULL)                                     \
         {                                                               \
-            MPIU_ERR_SETANDSTMT((err_), MPI_ERR_WIN,goto fn_fail, "**winnull"); \
+            MPIR_ERR_SETANDSTMT((err_), MPI_ERR_WIN,goto fn_fail, "**winnull"); \
         }                                                               \
         else								\
         {                                                               \
@@ -429,7 +429,7 @@ cvars:
     {									\
         if ((request_) == MPI_REQUEST_NULL)                             \
         {                                                               \
-            MPIU_ERR_SETANDSTMT((err_), MPI_ERR_REQUEST,goto fn_fail, "**requestnull"); \
+            MPIR_ERR_SETANDSTMT((err_), MPI_ERR_REQUEST,goto fn_fail, "**requestnull"); \
         }                                                               \
         else								\
         {                                                               \
@@ -451,12 +451,12 @@ cvars:
         if ((request_) != MPI_REQUEST_NULL)                             \
         {                                                               \
             if (HANDLE_GET_MPI_KIND(request_) != MPID_REQUEST) {        \
-                MPIU_ERR_SETANDSTMT2(err_,MPI_ERR_REQUEST,goto fn_fail, \
+                MPIR_ERR_SETANDSTMT2(err_,MPI_ERR_REQUEST,goto fn_fail, \
                                      "**request_invalid_kind","**request_invalid_kind %d %d", \
                                      i_, HANDLE_GET_MPI_KIND(request_)); \
             }                                                           \
             else if (HANDLE_GET_KIND(request_) == HANDLE_KIND_INVALID) { \
-                MPIU_ERR_SETANDSTMT1(err_,MPI_ERR_REQUEST,goto fn_fail, \
+                MPIR_ERR_SETANDSTMT1(err_,MPI_ERR_REQUEST,goto fn_fail, \
                                      "**request","**request %d", i_ );  \
             }                                                           \
         }                                                               \
@@ -464,7 +464,7 @@ cvars:
 
 #define MPIR_ERRTEST_ERRHANDLER(errhandler_,err_)			\
     if (errhandler_ == MPI_ERRHANDLER_NULL) {				\
-        MPIU_ERR_SETANDSTMT(err_,MPI_ERR_ARG,goto fn_fail,"**errhandlernull"); \
+        MPIR_ERR_SETANDSTMT(err_,MPI_ERR_ARG,goto fn_fail,"**errhandlernull"); \
     }									\
     else {								\
         MPIR_ERRTEST_VALID_HANDLE(errhandler_,MPID_ERRHANDLER,		\
@@ -475,7 +475,7 @@ cvars:
     {									\
         if ((info_) == MPI_INFO_NULL)					\
         {                                                               \
-            MPIU_ERR_SETANDSTMT(err_, MPI_ERR_ARG,goto fn_fail, "**infonull"); \
+            MPIR_ERR_SETANDSTMT(err_, MPI_ERR_ARG,goto fn_fail, "**infonull"); \
         }                                                               \
         else								\
         {                                                               \
@@ -495,15 +495,15 @@ cvars:
     {									\
         if ((keyval_) == MPI_KEYVAL_INVALID)				\
         {                                                               \
-            MPIU_ERR_SETANDSTMT(err_, MPI_ERR_KEYVAL,goto fn_fail, "**keyvalinvalid"); \
+            MPIR_ERR_SETANDSTMT(err_, MPI_ERR_KEYVAL,goto fn_fail, "**keyvalinvalid"); \
         }                                                               \
         else if (HANDLE_GET_MPI_KIND(keyval_) != MPID_KEYVAL)		\
         {                                                               \
-            MPIU_ERR_SETANDSTMT(err_, MPI_ERR_KEYVAL,goto fn_fail, "**keyval"); \
+            MPIR_ERR_SETANDSTMT(err_, MPI_ERR_KEYVAL,goto fn_fail, "**keyval"); \
         }                                                               \
         else if ((((keyval_) & 0x03c00000) >> 22) != (object_))		\
         {                                                               \
-            MPIU_ERR_SETANDSTMT1(err_, MPI_ERR_KEYVAL,goto fn_fail, "**keyvalobj", \
+            MPIR_ERR_SETANDSTMT1(err_, MPI_ERR_KEYVAL,goto fn_fail, "**keyvalobj", \
                                  "**keyvalobj %s", (objectdesc_));      \
         }                                                               \
     }
@@ -513,7 +513,7 @@ cvars:
         if (HANDLE_GET_MPI_KIND(keyval_) == MPID_KEYVAL &&              \
             HANDLE_GET_KIND(keyval_) == HANDLE_KIND_BUILTIN)		\
         {                                                               \
-            MPIU_ERR_SETANDSTMT(err_, MPI_ERR_KEYVAL,goto fn_fail, "**permattr"); \
+            MPIR_ERR_SETANDSTMT(err_, MPI_ERR_KEYVAL,goto fn_fail, "**permattr"); \
         }                                                               \
     }
 
@@ -521,7 +521,7 @@ cvars:
 #define MPIR_ERRTEST_MPIT_INITIALIZED(err_) \
     do { \
         if (!MPIR_T_is_initialized()) { \
-            MPIU_ERR_SETANDSTMT(err_, MPI_T_ERR_NOT_INITIALIZED, goto fn_fail, "**mpitinit"); \
+            MPIR_ERR_SETANDSTMT(err_, MPI_T_ERR_NOT_INITIALIZED, goto fn_fail, "**mpitinit"); \
         } \
     } while (0)
 #else
@@ -532,7 +532,7 @@ cvars:
     do {   \
         if ((index_) < 0 || (index_) >= utarray_len(cat_table)) \
         {  \
-            MPIU_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_INDEX, goto fn_fail, "**catindex");  \
+            MPIR_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_INDEX, goto fn_fail, "**catindex");  \
         }  \
     } while (0)
 
@@ -540,11 +540,11 @@ cvars:
     do {   \
         if ((handle_) == MPI_T_ENUM_NULL)  \
         {  \
-            MPIU_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_HANDLE, goto fn_fail, "**enumhandlenull");  \
+            MPIR_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_HANDLE, goto fn_fail, "**enumhandlenull");  \
         }  \
         else if ((handle_)->kind != MPIR_T_ENUM_HANDLE) \
         {  \
-            MPIU_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_HANDLE, goto fn_fail, "**enumhandle"); \
+            MPIR_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_HANDLE, goto fn_fail, "**enumhandle"); \
         }  \
     } while (0)
 
@@ -552,7 +552,7 @@ cvars:
     do {   \
         if ((index_) < 0 || (index_) >= utarray_len((enum_)->items)) \
         {  \
-            MPIU_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_ITEM, goto fn_fail, "**itemindex");  \
+            MPIR_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_ITEM, goto fn_fail, "**itemindex");  \
         }  \
     } while (0)
 
@@ -560,7 +560,7 @@ cvars:
     do {   \
         if ((index_) < 0 || (index_) >= utarray_len(cvar_table)) \
         {  \
-            MPIU_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_INDEX, goto fn_fail, "**cvarindex");  \
+            MPIR_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_INDEX, goto fn_fail, "**cvarindex");  \
         }  \
     } while (0)
 
@@ -568,11 +568,11 @@ cvars:
     do {   \
         if ((handle_) == MPI_T_CVAR_HANDLE_NULL)  \
         {  \
-            MPIU_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_HANDLE, goto fn_fail, "**cvarhandlenull");  \
+            MPIR_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_HANDLE, goto fn_fail, "**cvarhandlenull");  \
         }  \
         else if ((handle_)->kind != MPIR_T_CVAR_HANDLE) \
         {  \
-            MPIU_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_HANDLE, goto fn_fail, "**cvarhandle"); \
+            MPIR_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_HANDLE, goto fn_fail, "**cvarhandle"); \
         }  \
     } while (0)
 
@@ -580,7 +580,7 @@ cvars:
     do {   \
         if ((index_) < 0 || (index_) >= utarray_len(pvar_table)) \
         {  \
-            MPIU_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_INDEX, goto fn_fail, "**pvarindex");  \
+            MPIR_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_INDEX, goto fn_fail, "**pvarindex");  \
         }  \
     } while (0)
 
@@ -588,11 +588,11 @@ cvars:
     do {   \
         if (handle_ == MPI_T_PVAR_HANDLE_NULL) \
         {  \
-            MPIU_ERR_SETANDSTMT(err_,MPI_T_ERR_INVALID_HANDLE, goto fn_fail,"**pvarhandlenull"); \
+            MPIR_ERR_SETANDSTMT(err_,MPI_T_ERR_INVALID_HANDLE, goto fn_fail,"**pvarhandlenull"); \
         }  \
         else if ((handle_)->kind != MPIR_T_PVAR_HANDLE)  \
         {  \
-            MPIU_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_HANDLE, goto fn_fail, "**pvarhandle");  \
+            MPIR_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_HANDLE, goto fn_fail, "**pvarhandle");  \
         }  \
     } while (0)
 
@@ -600,19 +600,19 @@ cvars:
     do {    \
         if ((session_) == MPI_T_PVAR_SESSION_NULL)  \
         {   \
-            MPIU_ERR_SETANDSTMT(err_,MPI_T_ERR_INVALID_SESSION, goto fn_fail,"**pvarsessionnull");  \
+            MPIR_ERR_SETANDSTMT(err_,MPI_T_ERR_INVALID_SESSION, goto fn_fail,"**pvarsessionnull");  \
         }   \
         else if ((session_)->kind != MPIR_T_PVAR_SESSION) \
         {   \
-            MPIU_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_SESSION, goto fn_fail, "**pvarsession");  \
+            MPIR_ERR_SETANDSTMT(err_, MPI_T_ERR_INVALID_SESSION, goto fn_fail, "**pvarsession");  \
         }   \
     } while (0)
 
 /* some simple memcpy aliasing checks */
-#define MPIU_ERR_CHKMEMCPYANDSTMT(err_,stmt_,src_,dst_,len_) \
-    MPIU_ERR_CHKANDSTMT3(MPIU_MEM_RANGES_OVERLAP((dst_),(len_),(src_),(len_)),err_,MPI_ERR_INTERN,stmt_,"**memcpyalias","**memcpyalias %p %p %L",(src_),(dst_),(long long)(len_))
-#define MPIU_ERR_CHKMEMCPYANDJUMP(err_,src_,dst_,len_) \
-    MPIU_ERR_CHKMEMCPYANDSTMT((err_),goto fn_fail,(src_),(dst_),(len_))
+#define MPIR_ERR_CHKMEMCPYANDSTMT(err_,stmt_,src_,dst_,len_) \
+    MPIR_ERR_CHKANDSTMT3(MPIU_MEM_RANGES_OVERLAP((dst_),(len_),(src_),(len_)),err_,MPI_ERR_INTERN,stmt_,"**memcpyalias","**memcpyalias %p %p %L",(src_),(dst_),(long long)(len_))
+#define MPIR_ERR_CHKMEMCPYANDJUMP(err_,src_,dst_,len_) \
+    MPIR_ERR_CHKMEMCPYANDSTMT((err_),goto fn_fail,(src_),(dst_),(len_))
 
 /* Special MPI error "class/code" for out of memory */
 /* FIXME: not yet done */
@@ -625,14 +625,14 @@ cvars:
  *
  */
 /* --BEGIN ERROR MACROS-- */
-#define MPIU_ERR_POP(err_) \
-    MPIU_ERR_SETANDSTMT(err_,MPI_ERR_OTHER,goto fn_fail,"**fail")
-#define MPIU_ERR_POP_LABEL(err_, label_) \
-    MPIU_ERR_SETANDSTMT(err_,MPI_ERR_OTHER,goto label_,"**fail")
-#define MPIU_ERR_POPFATAL(err_) \
-    MPIU_ERR_SETFATALANDSTMT(err_,MPI_ERR_OTHER,goto fn_fail,"**fail")
-#define MPIU_ERR_POPFATAL_LABEL(err_, label_)                           \
-    MPIU_ERR_SETFATALANDSTMT(err_,MPI_ERR_OTHER,goto label_,"**fail")
+#define MPIR_ERR_POP(err_) \
+    MPIR_ERR_SETANDSTMT(err_,MPI_ERR_OTHER,goto fn_fail,"**fail")
+#define MPIR_ERR_POP_LABEL(err_, label_) \
+    MPIR_ERR_SETANDSTMT(err_,MPI_ERR_OTHER,goto label_,"**fail")
+#define MPIR_ERR_POPFATAL(err_) \
+    MPIR_ERR_SETFATALANDSTMT(err_,MPI_ERR_OTHER,goto fn_fail,"**fail")
+#define MPIR_ERR_POPFATAL_LABEL(err_, label_)                           \
+    MPIR_ERR_SETFATALANDSTMT(err_,MPI_ERR_OTHER,goto label_,"**fail")
 
 /* If you add any macros to this list, make sure that you update
  maint/extracterrmsgs to handle the additional macros (see the hash 
@@ -643,184 +643,184 @@ cvars:
  first argument to MPIR_Err_create_code .
 */
 #ifdef HAVE_ERROR_CHECKING
-#define MPIU_ERR_SETSIMPLE(err_,class_,msg_)	\
+#define MPIR_ERR_SETSIMPLE(err_,class_,msg_)	\
     err_ = MPIR_Err_create_code( MPI_SUCCESS,MPIR_ERR_RECOVERABLE,FCNAME,\
            __LINE__, class_, msg_, 0 )
-#define MPIU_ERR_SET(err_,class_,msg_) \
+#define MPIR_ERR_SET(err_,class_,msg_) \
     err_ = MPIR_Err_create_code( err_,MPIR_ERR_RECOVERABLE,FCNAME,\
            __LINE__, class_, msg_, 0 )
-#define MPIU_ERR_SET1(err_,class_,gmsg_,smsg_,arg1_) \
+#define MPIR_ERR_SET1(err_,class_,gmsg_,smsg_,arg1_) \
     err_ = MPIR_Err_create_code( err_,MPIR_ERR_RECOVERABLE,FCNAME,\
            __LINE__, class_, gmsg_, smsg_, arg1_ )
-#define MPIU_ERR_SET2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
+#define MPIR_ERR_SET2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
     err_ = MPIR_Err_create_code( err_,MPIR_ERR_RECOVERABLE,FCNAME,\
            __LINE__, class_, gmsg_, smsg_, arg1_, arg2_ )
-#define MPIU_ERR_SETANDSTMT(err_,class_,stmt_,msg_) \
+#define MPIR_ERR_SETANDSTMT(err_,class_,stmt_,msg_) \
     do {err_ = MPIR_Err_create_code( err_,MPIR_ERR_RECOVERABLE,FCNAME,\
            __LINE__, class_, msg_, 0 ); stmt_ ;} while (0)
-#define MPIU_ERR_SETANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_) \
+#define MPIR_ERR_SETANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_) \
     do {err_ = MPIR_Err_create_code( err_,MPIR_ERR_RECOVERABLE,FCNAME,\
            __LINE__, class_, gmsg_, smsg_, arg1_ ); stmt_ ;} while (0)
-#define MPIU_ERR_SETANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
+#define MPIR_ERR_SETANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
     do {err_ = MPIR_Err_create_code( err_,MPIR_ERR_RECOVERABLE,FCNAME,\
            __LINE__, class_, gmsg_, smsg_, arg1_, arg2_ ); stmt_ ;} while (0)
-#define MPIU_ERR_SETANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_, arg3_) \
+#define MPIR_ERR_SETANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_, arg3_) \
     do {err_ = MPIR_Err_create_code( err_,MPIR_ERR_RECOVERABLE,FCNAME,\
            __LINE__, class_, gmsg_, smsg_, arg1_, arg2_, arg3_ ); stmt_ ;} while (0)
-#define MPIU_ERR_SETANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_, arg3_, arg4_) \
+#define MPIR_ERR_SETANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_, arg3_, arg4_) \
     do {err_ = MPIR_Err_create_code( err_,MPIR_ERR_RECOVERABLE,FCNAME,\
 	    __LINE__, class_, gmsg_, smsg_, arg1_, arg2_, arg3_, arg4_ ); stmt_ ;} while (0)
 
-#define MPIU_ERR_SETFATALSIMPLE(err_,class_,msg_) \
+#define MPIR_ERR_SETFATALSIMPLE(err_,class_,msg_) \
     err_ = MPIR_Err_create_code( MPI_SUCCESS,MPIR_ERR_FATAL,FCNAME,     \
            __LINE__, class_, msg_, 0 )
-#define MPIU_ERR_SETFATAL(err_,class_,msg_) \
+#define MPIR_ERR_SETFATAL(err_,class_,msg_) \
     err_ = MPIR_Err_create_code( err_,MPIR_ERR_FATAL,FCNAME,\
            __LINE__, class_, msg_, 0 )
-#define MPIU_ERR_SETFATAL1(err_,class_,gmsg_,smsg_,arg1_) \
+#define MPIR_ERR_SETFATAL1(err_,class_,gmsg_,smsg_,arg1_) \
     err_ = MPIR_Err_create_code( err_,MPIR_ERR_FATAL,FCNAME,\
            __LINE__, class_, gmsg_, smsg_, arg1_ )
-#define MPIU_ERR_SETFATAL2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
+#define MPIR_ERR_SETFATAL2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
     err_ = MPIR_Err_create_code( err_,MPIR_ERR_FATAL,FCNAME,\
            __LINE__, class_, gmsg_, smsg_, arg1_, arg2_ )
-#define MPIU_ERR_SETFATALANDSTMT(err_,class_,stmt_,msg_) \
+#define MPIR_ERR_SETFATALANDSTMT(err_,class_,stmt_,msg_) \
     do {err_ = MPIR_Err_create_code( err_,MPIR_ERR_FATAL,FCNAME,\
            __LINE__, class_, msg_, 0 ); stmt_ ;} while (0)
-#define MPIU_ERR_SETFATALANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_) \
+#define MPIR_ERR_SETFATALANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_) \
     do {err_ = MPIR_Err_create_code( err_,MPIR_ERR_FATAL,FCNAME,\
            __LINE__, class_, gmsg_, smsg_, arg1_ ); stmt_ ;} while (0)
-#define MPIU_ERR_SETFATALANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
+#define MPIR_ERR_SETFATALANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
     do {err_ = MPIR_Err_create_code( err_,MPIR_ERR_FATAL,FCNAME,\
            __LINE__, class_, gmsg_, smsg_, arg1_, arg2_ ); stmt_ ;} while (0)
-#define MPIU_ERR_SETFATALANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_, arg3_) \
+#define MPIR_ERR_SETFATALANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_, arg3_) \
     do {err_ = MPIR_Err_create_code( err_,MPIR_ERR_FATAL,FCNAME,\
            __LINE__, class_, gmsg_, smsg_, arg1_, arg2_, arg3_ ); stmt_ ;} while (0)
-#define MPIU_ERR_SETFATALANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_, arg3_, arg4_) \
+#define MPIR_ERR_SETFATALANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_, arg3_, arg4_) \
     do {err_ = MPIR_Err_create_code( err_,MPIR_ERR_FATAL,FCNAME,\
 	    __LINE__, class_, gmsg_, smsg_, arg1_, arg2_, arg3_, arg4_ ); stmt_ ;} while (0)
-#define MPIU_ERR_ADD(err_, newerr_) \
+#define MPIR_ERR_ADD(err_, newerr_) \
     do {(err_) = MPIR_Err_combine_codes((err_), (newerr_));} while (0)
 #else
 /* Simply set the class, being careful not to override a previously
    set class. */
-#define MPIU_ERR_SETSIMPLE(err_,class_,msg_)	\
+#define MPIR_ERR_SETSIMPLE(err_,class_,msg_)	\
     do {err_ = class_;} while (0)
-#define MPIU_ERR_SET(err_,class_,msg_) \
+#define MPIR_ERR_SET(err_,class_,msg_) \
     do {if (!err_){err_=class_;}} while (0)
-#define MPIU_ERR_SET1(err_,class_,gmsg_,smsg_,arg1_) \
-      MPIU_ERR_SET(err_,class_,msg_)
-#define MPIU_ERR_SET2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
-      MPIU_ERR_SET(err_,class_,msg_)
-#define MPIU_ERR_SETANDSTMT(err_,class_,stmt_,msg_) \
+#define MPIR_ERR_SET1(err_,class_,gmsg_,smsg_,arg1_) \
+      MPIR_ERR_SET(err_,class_,msg_)
+#define MPIR_ERR_SET2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
+      MPIR_ERR_SET(err_,class_,msg_)
+#define MPIR_ERR_SETANDSTMT(err_,class_,stmt_,msg_) \
     do {if (!err_){err_=class_;} stmt_;} while (0)
-#define MPIU_ERR_SETANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_) \
-     MPIU_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
-#define MPIU_ERR_SETANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
-     MPIU_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
-#define MPIU_ERR_SETANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
-     MPIU_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
-#define MPIU_ERR_SETANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
-     MPIU_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
-
-#define MPIU_ERR_SETFATALSIMPLE(err_,class_,msg_)	\
+#define MPIR_ERR_SETANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_) \
+     MPIR_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
+#define MPIR_ERR_SETANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
+     MPIR_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
+#define MPIR_ERR_SETANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
+     MPIR_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
+#define MPIR_ERR_SETANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
+     MPIR_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
+
+#define MPIR_ERR_SETFATALSIMPLE(err_,class_,msg_)	\
     do {err_ = class_;} while (0)
-#define MPIU_ERR_SETFATAL(err_,class_,msg_) \
+#define MPIR_ERR_SETFATAL(err_,class_,msg_) \
     do {if (!err_){err_=class_;}} while (0)
-#define MPIU_ERR_SETFATAL1(err_,class_,gmsg_,smsg_,arg1_) \
-      MPIU_ERR_SET(err_,class_,msg_)
-#define MPIU_ERR_SETFATAL2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
-      MPIU_ERR_SET(err_,class_,msg_)
-#define MPIU_ERR_SETFATALANDSTMT(err_,class_,stmt_,msg_) \
-     MPIU_ERR_SETANDSTMT(err_,class_,stmt_,msg_)
-#define MPIU_ERR_SETFATALANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_) \
-     MPIU_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
-#define MPIU_ERR_SETFATALANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
-     MPIU_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
-#define MPIU_ERR_SETFATALANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
-     MPIU_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
-#define MPIU_ERR_SETFATALANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
-     MPIU_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
+#define MPIR_ERR_SETFATAL1(err_,class_,gmsg_,smsg_,arg1_) \
+      MPIR_ERR_SET(err_,class_,msg_)
+#define MPIR_ERR_SETFATAL2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
+      MPIR_ERR_SET(err_,class_,msg_)
+#define MPIR_ERR_SETFATALANDSTMT(err_,class_,stmt_,msg_) \
+     MPIR_ERR_SETANDSTMT(err_,class_,stmt_,msg_)
+#define MPIR_ERR_SETFATALANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_) \
+     MPIR_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
+#define MPIR_ERR_SETFATALANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
+     MPIR_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
+#define MPIR_ERR_SETFATALANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
+     MPIR_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
+#define MPIR_ERR_SETFATALANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
+     MPIR_ERR_SETANDSTMT(err_,class_,stmt_,gmsg_)
     /* No-op - use original error class; discard newerr_ unless err is 
        MPI_SUCCESS*/
-#define MPIU_ERR_ADD(err_, newerr_) \
+#define MPIR_ERR_ADD(err_, newerr_) \
     do {if (!err_) err_ = newerr_;} while (0)
 #endif
 
 /* The following definitions are the same independent of the choice of 
    HAVE_ERROR_CHECKING */
-#define MPIU_ERR_SETANDJUMP(err_,class_,msg_) \
-     MPIU_ERR_SETANDSTMT(err_,class_,goto fn_fail,msg_)
-#define MPIU_ERR_SETFATALANDJUMP(err_,class_,msg_) \
-     MPIU_ERR_SETFATALANDSTMT(err_,class_,goto fn_fail,msg_)
-#define MPIU_ERR_CHKANDSTMT(cond_,err_,class_,stmt_,msg_) \
-    do {if (cond_) { MPIU_ERR_SETANDSTMT(err_,class_,stmt_,msg_); }} while (0)
-#define MPIU_ERR_CHKFATALANDSTMT(cond_,err_,class_,stmt_,msg_) \
-    do {if (cond_) { MPIU_ERR_SETFATALANDSTMT(err_,class_,stmt_,msg_); }} while (0)
-#define MPIU_ERR_CHKANDJUMP(cond_,err_,class_,msg_) \
-     MPIU_ERR_CHKANDSTMT(cond_,err_,class_,goto fn_fail,msg_)
-#define MPIU_ERR_CHKFATALANDJUMP(cond_,err_,class_,msg_) \
-     MPIU_ERR_CHKFATALANDSTMT(cond_,err_,class_,goto fn_fail,msg_)
-
-#define MPIU_ERR_SETANDJUMP1(err_,class_,gmsg_,smsg_,arg1_) \
-     MPIU_ERR_SETANDSTMT1(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_)
-#define MPIU_ERR_SETFATALANDJUMP1(err_,class_,gmsg_,smsg_,arg1_) \
-     MPIU_ERR_SETFATALANDSTMT1(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_)
-#define MPIU_ERR_CHKANDSTMT1(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_) \
-    do {if (cond_) { MPIU_ERR_SETANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_); }} while (0)
-#define MPIU_ERR_CHKFATALANDSTMT1(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_) \
-    do {if (cond_) { MPIU_ERR_SETFATALANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_); }} while (0)
-#define MPIU_ERR_CHKANDJUMP1(cond_,err_,class_,gmsg_,smsg_,arg1_) \
-     MPIU_ERR_CHKANDSTMT1(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_)
-#define MPIU_ERR_CHKFATALANDJUMP1(cond_,err_,class_,gmsg_,smsg_,arg1_) \
-     MPIU_ERR_CHKFATALANDSTMT1(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_)
-
-#define MPIU_ERR_SETANDJUMP2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
-     MPIU_ERR_SETANDSTMT2(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_)
-#define MPIU_ERR_SETFATALANDJUMP2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
-     MPIU_ERR_SETFATALANDSTMT2(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_)
-#define MPIU_ERR_CHKANDSTMT2(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
-    do {if (cond_) { MPIU_ERR_SETANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_); }} while (0)
-#define MPIU_ERR_CHKFATALANDSTMT2(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
-    do {if (cond_) { MPIU_ERR_SETFATALANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_); }} while (0)
-#define MPIU_ERR_CHKANDJUMP2(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_) \
-     MPIU_ERR_CHKANDSTMT2(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_)
-#define MPIU_ERR_CHKFATALANDJUMP2(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_) \
-     MPIU_ERR_CHKFATALANDSTMT2(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_)
-
-#define MPIU_ERR_SETANDJUMP3(err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
-     MPIU_ERR_SETANDSTMT3(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_)
-#define MPIU_ERR_SETFATALANDJUMP3(err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
-     MPIU_ERR_SETFATALANDSTMT3(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_)
-#define MPIU_ERR_CHKANDSTMT3(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
-    do {if (cond_) { MPIU_ERR_SETANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_); }} while (0)
-#define MPIU_ERR_CHKFATALANDSTMT3(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
-    do {if (cond_) { MPIU_ERR_SETFATALANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_); }} while (0)
-#define MPIU_ERR_CHKANDJUMP3(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
-     MPIU_ERR_CHKANDSTMT3(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_)
-#define MPIU_ERR_CHKFATALANDJUMP3(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
-     MPIU_ERR_CHKFATALANDSTMT3(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_)
-
-#define MPIU_ERR_SETANDJUMP4(err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
-     MPIU_ERR_SETANDSTMT4(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_)
-#define MPIU_ERR_SETFATALANDJUMP4(err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
-     MPIU_ERR_SETFATALANDSTMT4(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_)
-#define MPIU_ERR_CHKANDSTMT4(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_, arg4_) \
-    do {if (cond_) { MPIU_ERR_SETANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_); }} while (0)
-#define MPIU_ERR_CHKFATALANDSTMT4(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_, arg4_) \
-    do {if (cond_) { MPIU_ERR_SETFATALANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_); }} while (0)
-#define MPIU_ERR_CHKANDJUMP4(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
-     MPIU_ERR_CHKANDSTMT4(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_)
-#define MPIU_ERR_CHKFATALANDJUMP4(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
-     MPIU_ERR_CHKFATALANDSTMT4(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_)
-
-#define MPIU_ERR_INTERNAL(err_, msg_)   \
-    MPIU_ERR_SETFATAL1(err_, MPI_ERR_INTERN, "**intern", "**intern %s", msg_)
-#define MPIU_ERR_INTERNALANDSTMT(err_, msg_, stmt_) \
-    MPIU_ERR_SETANDSTMT1(err_, MPI_ERR_INTERN, stmt_, "**intern", "**intern %s", msg_)
-#define MPIU_ERR_INTERNALANDJUMP(err_, msg_) \
-    MPIU_ERR_INTERNALANDSTMT(err_, msg_, goto fn_fail)
-#define MPIU_ERR_CHKINTERNAL(cond_, err_, msg_) \
-    do {if (cond_) MPIU_ERR_INTERNALANDJUMP(err_, msg_);} while(0)
+#define MPIR_ERR_SETANDJUMP(err_,class_,msg_) \
+     MPIR_ERR_SETANDSTMT(err_,class_,goto fn_fail,msg_)
+#define MPIR_ERR_SETFATALANDJUMP(err_,class_,msg_) \
+     MPIR_ERR_SETFATALANDSTMT(err_,class_,goto fn_fail,msg_)
+#define MPIR_ERR_CHKANDSTMT(cond_,err_,class_,stmt_,msg_) \
+    do {if (cond_) { MPIR_ERR_SETANDSTMT(err_,class_,stmt_,msg_); }} while (0)
+#define MPIR_ERR_CHKFATALANDSTMT(cond_,err_,class_,stmt_,msg_) \
+    do {if (cond_) { MPIR_ERR_SETFATALANDSTMT(err_,class_,stmt_,msg_); }} while (0)
+#define MPIR_ERR_CHKANDJUMP(cond_,err_,class_,msg_) \
+     MPIR_ERR_CHKANDSTMT(cond_,err_,class_,goto fn_fail,msg_)
+#define MPIR_ERR_CHKFATALANDJUMP(cond_,err_,class_,msg_) \
+     MPIR_ERR_CHKFATALANDSTMT(cond_,err_,class_,goto fn_fail,msg_)
+
+#define MPIR_ERR_SETANDJUMP1(err_,class_,gmsg_,smsg_,arg1_) \
+     MPIR_ERR_SETANDSTMT1(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_)
+#define MPIR_ERR_SETFATALANDJUMP1(err_,class_,gmsg_,smsg_,arg1_) \
+     MPIR_ERR_SETFATALANDSTMT1(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_)
+#define MPIR_ERR_CHKANDSTMT1(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_) \
+    do {if (cond_) { MPIR_ERR_SETANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_); }} while (0)
+#define MPIR_ERR_CHKFATALANDSTMT1(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_) \
+    do {if (cond_) { MPIR_ERR_SETFATALANDSTMT1(err_,class_,stmt_,gmsg_,smsg_,arg1_); }} while (0)
+#define MPIR_ERR_CHKANDJUMP1(cond_,err_,class_,gmsg_,smsg_,arg1_) \
+     MPIR_ERR_CHKANDSTMT1(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_)
+#define MPIR_ERR_CHKFATALANDJUMP1(cond_,err_,class_,gmsg_,smsg_,arg1_) \
+     MPIR_ERR_CHKFATALANDSTMT1(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_)
+
+#define MPIR_ERR_SETANDJUMP2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
+     MPIR_ERR_SETANDSTMT2(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_)
+#define MPIR_ERR_SETFATALANDJUMP2(err_,class_,gmsg_,smsg_,arg1_,arg2_) \
+     MPIR_ERR_SETFATALANDSTMT2(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_)
+#define MPIR_ERR_CHKANDSTMT2(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
+    do {if (cond_) { MPIR_ERR_SETANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_); }} while (0)
+#define MPIR_ERR_CHKFATALANDSTMT2(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_) \
+    do {if (cond_) { MPIR_ERR_SETFATALANDSTMT2(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_); }} while (0)
+#define MPIR_ERR_CHKANDJUMP2(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_) \
+     MPIR_ERR_CHKANDSTMT2(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_)
+#define MPIR_ERR_CHKFATALANDJUMP2(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_) \
+     MPIR_ERR_CHKFATALANDSTMT2(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_)
+
+#define MPIR_ERR_SETANDJUMP3(err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
+     MPIR_ERR_SETANDSTMT3(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_)
+#define MPIR_ERR_SETFATALANDJUMP3(err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
+     MPIR_ERR_SETFATALANDSTMT3(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_)
+#define MPIR_ERR_CHKANDSTMT3(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
+    do {if (cond_) { MPIR_ERR_SETANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_); }} while (0)
+#define MPIR_ERR_CHKFATALANDSTMT3(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
+    do {if (cond_) { MPIR_ERR_SETFATALANDSTMT3(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_); }} while (0)
+#define MPIR_ERR_CHKANDJUMP3(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
+     MPIR_ERR_CHKANDSTMT3(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_)
+#define MPIR_ERR_CHKFATALANDJUMP3(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_) \
+     MPIR_ERR_CHKFATALANDSTMT3(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_)
+
+#define MPIR_ERR_SETANDJUMP4(err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
+     MPIR_ERR_SETANDSTMT4(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_)
+#define MPIR_ERR_SETFATALANDJUMP4(err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
+     MPIR_ERR_SETFATALANDSTMT4(err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_)
+#define MPIR_ERR_CHKANDSTMT4(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_, arg4_) \
+    do {if (cond_) { MPIR_ERR_SETANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_); }} while (0)
+#define MPIR_ERR_CHKFATALANDSTMT4(cond_,err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_, arg4_) \
+    do {if (cond_) { MPIR_ERR_SETFATALANDSTMT4(err_,class_,stmt_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_); }} while (0)
+#define MPIR_ERR_CHKANDJUMP4(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
+     MPIR_ERR_CHKANDSTMT4(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_)
+#define MPIR_ERR_CHKFATALANDJUMP4(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
+     MPIR_ERR_CHKFATALANDSTMT4(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_)
+
+#define MPIR_ERR_INTERNAL(err_, msg_)   \
+    MPIR_ERR_SETFATAL1(err_, MPI_ERR_INTERN, "**intern", "**intern %s", msg_)
+#define MPIR_ERR_INTERNALANDSTMT(err_, msg_, stmt_) \
+    MPIR_ERR_SETANDSTMT1(err_, MPI_ERR_INTERN, stmt_, "**intern", "**intern %s", msg_)
+#define MPIR_ERR_INTERNALANDJUMP(err_, msg_) \
+    MPIR_ERR_INTERNALANDSTMT(err_, msg_, goto fn_fail)
+#define MPIR_ERR_CHKINTERNAL(cond_, err_, msg_) \
+    do {if (cond_) MPIR_ERR_INTERNALANDJUMP(err_, msg_);} while(0)
 
 /* --END ERROR MACROS-- */
 
diff --git a/src/include/mpihandlemem.h b/src/include/mpihandlemem.h
index 1847031..e099cb8 100644
--- a/src/include/mpihandlemem.h
+++ b/src/include/mpihandlemem.h
@@ -244,40 +244,6 @@ typedef int MPIU_Handle_ref_count;
         MPIU_HANDLE_CHECK_REFCOUNT(objptr_,"decr");       \
     } while (0)
 
-#elif MPIU_THREAD_REFCOUNT == MPIU_REFCOUNT_LOCK
-
-typedef volatile int MPIU_Handle_ref_count;
-#define MPIU_HANDLE_REF_COUNT_INITIALIZER(val_) (val_)
-
-#define MPIU_Object_set_ref(objptr_,val)                 \
-    do {                                                 \
-        MPIU_THREAD_CS_ENTER(HANDLE,objptr_);            \
-        (objptr_)->ref_count = val;                      \
-        MPIU_HANDLE_LOG_REFCOUNT_CHANGE(objptr_, "set"); \
-        MPIU_THREAD_CS_EXIT(HANDLE,objptr_);             \
-    } while (0)
-
-/* must be used with care, since there is no synchronization for this read */
-#define MPIU_Object_get_ref(objptr_) \
-    ((objptr_)->ref_count)
-
-#define MPIU_Object_add_ref_always(objptr_)               \
-    do {                                                  \
-        MPIU_THREAD_CS_ENTER(HANDLE,objptr_);             \
-        (objptr_)->ref_count++;                           \
-        MPIU_HANDLE_LOG_REFCOUNT_CHANGE(objptr_, "incr"); \
-        MPIU_HANDLE_CHECK_REFCOUNT(objptr_,"incr");       \
-        MPIU_THREAD_CS_EXIT(HANDLE,objptr_);              \
-    } while (0)
-#define MPIU_Object_release_ref_always(objptr_,inuse_ptr) \
-    do {                                                  \
-        MPIU_THREAD_CS_ENTER(HANDLE,objptr_);             \
-        *(inuse_ptr) = --((objptr_)->ref_count);          \
-        MPIU_HANDLE_LOG_REFCOUNT_CHANGE(objptr_, "decr"); \
-        MPIU_HANDLE_CHECK_REFCOUNT(objptr_,"decr");       \
-        MPIU_THREAD_CS_EXIT(HANDLE,objptr_);              \
-    } while (0)
-
 #elif MPIU_THREAD_REFCOUNT == MPIU_REFCOUNT_LOCKFREE
 
 #include "opa_primitives.h"
@@ -384,7 +350,6 @@ typedef OPA_int_t MPIU_Handle_ref_count;
  * NOTE: This macro *must* be invoked as the very first element of the structure! */
 #define MPIU_OBJECT_HEADER             \
     int handle;                        \
-    MPIU_THREAD_OBJECT_HOOK/*no-semi*/ \
     MPIU_Handle_ref_count ref_count/*semicolon intentionally omitted*/
 
 /* ALL objects have the handle as the first value. */
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 6a3fa60..8423eeb 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -136,8 +136,6 @@ int usleep(useconds_t usec);
     } while (0)
 #endif
 
-#include "mpiimplthread.h"
-
 /* ------------------------------------------------------------------------- */
 /* mpidebug.h */
 /* ------------------------------------------------------------------------- */
@@ -450,10 +448,10 @@ int MPIU_Handle_free( void *((*)[]), int );
 #define MPID_Comm_valid_ptr(ptr,err,ignore_rev) {     \
      MPID_Valid_ptr_class(Comm,ptr,MPI_ERR_COMM,err); \
      if ((ptr) && MPIU_Object_get_ref(ptr) <= 0) {    \
-         MPIU_ERR_SET(err,MPI_ERR_COMM,"**comm");     \
+         MPIR_ERR_SET(err,MPI_ERR_COMM,"**comm");     \
          ptr = 0;                                     \
      } else if ((ptr) && (ptr)->revoked && !(ignore_rev)) {        \
-         MPIU_ERR_SET(err,MPIX_ERR_REVOKED,"**comm"); \
+         MPIR_ERR_SET(err,MPIX_ERR_REVOKED,"**comm"); \
      }                                                \
 }
 #define MPID_Group_valid_ptr(ptr,err) MPID_Valid_ptr_class(Group,ptr,MPI_ERR_GROUP,err)
@@ -1284,7 +1282,7 @@ int MPIR_Comm_delete_internal(MPID_Comm * comm_ptr);
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_release
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIR_Comm_release(MPID_Comm * comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1462,7 +1460,6 @@ struct MPID_Grequest_fns {
                                                        the generalize req */
 };
 
-/* see mpiimplthread.h for the def of MPID_cc_t and related functions/macros */
 #define MPID_Request_is_complete(req_) (MPID_cc_is_complete((req_)->cc_ptr))
 
 /*S
@@ -3719,8 +3716,6 @@ int MPID_Comm_get_lpid(MPID_Comm *comm_ptr, int idx, int * lpid_ptr, MPIU_BOOL i
  * collectives */
 #include "mpir_nbc.h"
 
-#include "mpiimplthreadpost.h"
-
 /* Include definitions from the device which require items defined by this 
    file (mpiimpl.h). */
 #include "mpidpost.h"
@@ -4397,7 +4392,7 @@ int MPIR_Comm_set_attr_impl(MPID_Comm *comm_ptr, int comm_keyval, void *attribut
 #undef FUNCNAME
 #define FUNCNAME MPIR_process_status
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void MPIR_Process_status(MPI_Status *status, MPIR_Errflag_t *errflag)
 {
     if (MPI_PROC_NULL != status->MPI_SOURCE &&
diff --git a/src/include/mpiimplthread.h b/src/include/mpiimplthread.h
deleted file mode 100644
index 4e5a0d7..0000000
--- a/src/include/mpiimplthread.h
+++ /dev/null
@@ -1,1044 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#if !defined(MPIIMPLTHREAD_H_INCLUDED)
-#define MPIIMPLTHREAD_H_INCLUDED
-
-#ifndef HAVE_MPICHCONF
-#error 'This file requires mpichconf.h'
-#endif
-
-#if !defined(MPID_THREAD_DEBUG) && defined(MPICH_DEBUG_MUTEXNESTING)
-#define MPID_THREAD_DEBUG 1
-#endif
-
-/* Make the CPP definition that will be used to control whether threaded
-   code is supported.  Test ONLY on whether MPICH_IS_THREADED is defined.
-
-   Rather than embed a conditional test in the MPICH code, we define a
-   single value on which we can test
- */
-#if !defined(MPICH_THREAD_LEVEL) || !defined(MPI_THREAD_MULTIPLE)
-#error Internal error in macro definitions in include/mpiimplthread.h
-#endif
-#if (MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE)
-#define MPICH_IS_THREADED 1
-#endif
-
-/* mpid_thread.h is needed at serialized and above because we might need to
- * store some thread-local data */
-#if (MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED)
-#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
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_LOCK_FREE
-#  error MPIU_THREAD_GRANULARITY_LOCK_FREE not implemented yet
-#endif
-
-
-/* I don't have a better place for this at the moment, so it lives here for now. */
-enum MPIU_Thread_cs_name {
-    MPIU_THREAD_CS_NAME_ALLFUNC = 0,
-    MPIU_THREAD_CS_NAME_INIT,
-    MPIU_THREAD_CS_NAME_HANDLE,
-    MPIU_THREAD_CS_NAME_HANDLEALLOC,
-    MPIU_THREAD_CS_NAME_MPIDCOMM,
-    MPIU_THREAD_CS_NAME_COMPLETION,
-    MPIU_THREAD_CS_NAME_PMI,
-    MPIU_THREAD_CS_NAME_CONTEXTID,
-    MPIU_THREAD_CS_NAME_MPI_OBJ,
-    MPIU_THREAD_CS_NAME_MSGQUEUE,
-    /* FIXME device-specific, should this live here? */
-    /*
-    MPIU_THREAD_CS_NAME_CH3COMM,
-     */
-    MPIU_THREAD_CS_NUM_NAMES
-};
-
-typedef struct MPICH_ThreadInfo_t {
-    int               thread_provided;  /* Provided level of thread support */
-    /* This is a special case for is_thread_main, which must be
-       implemented even if MPICH itself is single threaded.  */
-#if (MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED)
-#  if !defined(MPIU_TLS_SPECIFIER)
-    MPID_Thread_tls_t thread_storage;   /* Id for perthread data */
-#  endif /* !TLS */
-    MPID_Thread_id_t  master_thread;    /* Thread that started MPI */
-#endif
-
-#if defined MPICH_IS_THREADED
-    int isThreaded;                      /* Set to true if user requested
-					    THREAD_MULTIPLE */
-#endif /* MPICH_IS_THREADED */
-
-    /* Define the mutex values used for each kind of implementation */
-#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL || \
-    MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
-    MPID_Thread_mutex_t global_mutex;
-    /* We need the handle mutex to avoid problems with lock nesting */
-    MPID_Thread_mutex_t handle_mutex;
-#endif
-
-#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
-    MPID_Thread_mutex_t msgq_mutex;
-    MPID_Thread_mutex_t completion_mutex;
-    MPID_Thread_mutex_t ctx_mutex;
-    MPID_Thread_mutex_t pmi_mutex;
-#endif
-
-#if (MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED)
-    MPID_Thread_mutex_t memalloc_mutex; /* for MPIU_{Malloc,Free,Calloc} */
-    MPID_Thread_id_t cs_holder[MPIU_THREAD_CS_NUM_NAMES];
-#endif
-} MPICH_ThreadInfo_t;
-extern MPICH_ThreadInfo_t MPIR_ThreadInfo;
-
-#ifndef MPICH_IS_THREADED
-
-#define MPIU_THREAD_CHECK_BEGIN
-#define MPIU_THREAD_CHECK_END
-#define MPIU_ISTHREADED (0)
-
-#else /* defined(MPICH_IS_THREADED) */
-
-#define MPIU_THREAD_CHECK_BEGIN if (MPIR_ThreadInfo.isThreaded) {
-#define MPIU_THREAD_CHECK_END   }
-/* This macro used to take an argument of one or more statements that
- * would be wrapped in a conditional.  However it was not used anywhere
- * in part because it looked unnatural.  This version takes no arguments
- * and evaluates to a boolean expression that is true if MPICH is
- * threaded (including any runtime check if needed) and false otherwise.
- * MPIU_THREAD_CHECK_{BEGIN,END} should probably still be used if you
- * don't have any other conditions that you need to check in order to
- * completely eliminate unnecessary if's. */
-#define MPIU_ISTHREADED (MPIR_ThreadInfo.isThreaded)
-
-#endif /* MPICH_IS_THREADED */
-
-/* ------------------------------------------------------------------------- */
-/* thread-local storage macros */
-/* moved here from mpiimpl.h because they logically belong here */
-
-/* Time stamps */
-/* Get the timer definitions.  The source file for this include is
-   src/mpi/timer/mpichtimer.h.in */
-#include "mpichtimer.h"
-
-typedef struct MPID_Stateinfo_t {
-    MPID_Time_t stamp;
-    int count;
-} MPID_Stateinfo_t;
-#define MPICH_MAX_STATES 512
-
-/* arbitrary, just needed to avoid cleaning up heap allocated memory at thread
- * destruction time */
-#define MPIU_STRERROR_BUF_SIZE (1024)
-
-/* FIXME should really be MPIU_Nest_NUM_MUTEXES, but it's defined later */
-#define MPICH_MAX_LOCKS (6)
-
-/* This structure contains all thread-local variables and will be zeroed at
- * allocation time.
- *
- * Note that any pointers to dynamically allocated memory stored in this
- * structure must be externally cleaned up.
- * */
-typedef struct MPICH_PerThread_t {
-    int              op_errno;     /* For errors in predefined MPI_Ops */
-
-    /* error string storage for MPIU_Strerror */
-    char strerrbuf[MPIU_STRERROR_BUF_SIZE];
-
-#if (MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED)
-    int lock_depth[MPICH_MAX_LOCKS];
-#endif
-    /* FIXME: Is this used anywhere? */
-#ifdef HAVE_TIMING
-    MPID_Stateinfo_t timestamps[MPICH_MAX_STATES];  /* per thread state info */
-#endif
-#if defined(MPID_DEV_PERTHREAD_DECL)
-    MPID_DEV_PERTHREAD_DECL
-#endif
-} MPICH_PerThread_t;
-
-#if !defined(MPICH_IS_THREADED)
-/* If single threaded, make this point at a pre-allocated segment.
-   This structure is allocated in src/mpi/init/initthread.c */
-extern MPICH_PerThread_t MPIR_Thread;
-
-/* The following three macros define a way to portably access thread-private
-   storage in MPICH, and avoid extra overhead when MPICH is single
-   threaded
-   INITKEY - Create the key.  Must happen *before* the other threads
-             are created
-   INIT    - Create the thread-private storage.  Must happen once per thread
-   DECL    - Declare local variables
-   GET     - Access the thread-private storage
-   FIELD   - Access the thread-private field (by name)
-   FINALIZE - to be invoked when all threads no longer need access to the thread
-              local storage, such as at MPI_Finalize time
-
-   The "DECL" is the extern so that there is always a statement for
-   the declaration.
-*/
-#define MPIU_THREADPRIV_INITKEY
-#define MPIU_THREADPRIV_INIT
-/* Empty declarations are not allowed in C, so we just define a dummy
- * variable and tell the compiler it is unused. */
-#define MPIU_THREADPRIV_DECL int MPIU_THREADPRIV_LOCAL_DUMMY_VAR ATTRIBUTE((unused))
-#define MPIU_THREADPRIV_GET
-#define MPIU_THREADPRIV_FIELD(a_) (MPIR_Thread.a_)
-
-#else /* defined(MPICH_IS_THREADED) */
-
-/* We need to provide a function that will cleanup the storage attached
-   to the key.  */
-void MPIR_CleanupThreadStorage(void *a);
-
-#if !defined(MPIU_TLS_SPECIFIER)
-/* 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
-   definitions.
-
-   The approach is to have TWO MPICH_PerThread_t pointers.  One is local
-   (The MPIU_THREADPRIV_DECL is used in the routines local definitions),
-   as in the threaded version of these macros.  This is set by using a routine
-   to get thread-private storage.  The second is a preallocated, extern
-   MPICH_PerThread_t struct, as in the single threaded case.  Based on
-   MPIR_Process.isThreaded, one or the other is used.
-
- */
-/* For the single threaded case, we use a preallocated structure
-   This structure is allocated in src/mpi/init/initthread.c */
-extern MPICH_PerThread_t MPIR_ThreadSingle;
-
-#define MPIU_THREADPRIV_INITKEY                                         \
-    do {                                                                \
-        if (MPIU_ISTHREADED) {                                          \
-            int err_;                                                   \
-            MPID_Thread_tls_create(MPIR_CleanupThreadStorage,&MPIR_ThreadInfo.thread_storage,&err_); \
-            MPIU_Assert(err_ == 0);                                     \
-        }                                                               \
-    } while (0)
-#define MPIU_THREADPRIV_INIT                                                                            \
-    do {                                                                                                \
-        if (MPIU_ISTHREADED) {                                                                          \
-            MPIR_Thread = (MPICH_PerThread_t *) MPIU_Calloc(1, sizeof(MPICH_PerThread_t));              \
-            MPIU_Assert(MPIR_Thread);                                                                   \
-            MPID_Thread_tls_set(&MPIR_ThreadInfo.thread_storage, (void *)MPIR_Thread);                  \
-        }                                                                                               \
-    } while (0)
-/* MPIU_THREADPRIV_INIT must *always* be called before MPIU_THREADPRIV_GET */
-#define MPIU_THREADPRIV_GET                                                         \
-    do {                                                                            \
-        if (!MPIR_Thread) {                                                         \
-            if (MPIU_ISTHREADED) {                                                  \
-                MPID_Thread_tls_get(&MPIR_ThreadInfo.thread_storage, &MPIR_Thread); \
-                if (!MPIR_Thread) {                                                 \
-                    MPIU_THREADPRIV_INIT; /* subtle, sets MPIR_Thread */            \
-                }                                                                   \
-            }                                                                       \
-            else {                                                                  \
-                MPIR_Thread = &MPIR_ThreadSingle;                                   \
-            }                                                                       \
-            MPIU_Assert(MPIR_Thread);                                               \
-        }                                                                           \
-    } while (0)
-
-/* common definitions when using MPID_Thread-based TLS */
-#define MPIU_THREADPRIV_DECL MPICH_PerThread_t *MPIR_Thread=NULL
-#define MPIU_THREADPRIV_FIELD(a_) (MPIR_Thread->a_)
-#define MPIU_THREADPRIV_FINALIZE                                                        \
-    do {                                                                                \
-        MPIU_THREADPRIV_DECL;                                                           \
-        if (MPIU_ISTHREADED) {                                                          \
-            int tpf_err_; /* unique name to not conflict with vars in called macros */  \
-            MPIU_THREADPRIV_GET;                                                        \
-            MPIU_Free(MPIR_Thread);                                                     \
-            MPID_Thread_tls_set(&MPIR_ThreadInfo.thread_storage,NULL);                  \
-            MPID_Thread_tls_destroy(&MPIR_ThreadInfo.thread_storage,&tpf_err_);         \
-            MPIU_Assert(tpf_err_ == 0);                                                 \
-        }                                                                               \
-    } while (0)
-
-#else /* defined(MPIU_TLS_SPECIFIER) */
-
-/* We have proper thread-local storage (TLS) support from the compiler, which
- * should yield the best performance and simplest code, so we'll use that. */
-extern MPIU_TLS_SPECIFIER MPICH_PerThread_t MPIR_Thread;
-
-#define MPIU_THREADPRIV_INITKEY
-#define MPIU_THREADPRIV_INIT
-/* Empty declarations are not allowed in C, so we just define a dummy
- * variable and tell the compiler it is unused. */
-#define MPIU_THREADPRIV_DECL int MPIU_THREADPRIV_LOCAL_DUMMY_VAR ATTRIBUTE((unused))
-#define MPIU_THREADPRIV_GET
-#define MPIU_THREADPRIV_FIELD(a_) (MPIR_Thread.a_)
-#define MPIU_THREADPRIV_FINALIZE do{}while(0)
-
-#endif /* defined(MPIU_TLS_SPECIFIER) */
-#endif /* defined(MPICH_IS_THREADED) */
-
-/* ------------------------------------------------------------------------- */
-/*
- * New definitions for controling the granularity of thread atomicity
- *
- * If MPICH supports threads and the device doesn't wish to override our
- * definitions, we supply default definitions.
- *
- * If the device does choose to override our definitions, it needs to do the
- * following at a minimum:
- * 1) #define MPID_DEVICE_DEFINES_THREAD_CS in mpidpre.h
- * 2) provide #defines for MPIU_THREAD_CS_{INIT,FINALIZE}
- * 3) provide #defines for MPIU_THREAD_CS_{ENTER,EXIT,YIELD}(name_,context_)
- * 4) provide #defines for MPIU_THREADSAFE_INIT_{DECL,STMT,BLOCK_BEGIN,BLOCK_END,CLEAR}
- */
-#if defined(MPICH_IS_THREADED) && !defined(MPID_DEVICE_DEFINES_THREAD_CS)
-
-/* MPIU_THREAD_CS_INIT will be invoked early in the top level
- * MPI_Init/MPI_Init_thread process.  It is responsible for performing any
- * initialization for the MPIU_THREAD_CS_ macros, as well as invoking
- * MPIU_THREADPRIV_INITKEY and MPIU_THREADPRIV_INIT.
- *
- * MPIR_ThreadInfo.isThreaded will be set prior to this macros invocation, based
- * on the "provided" value to MPI_Init_thread
- */
-#define MPIU_THREAD_CS_INIT     MPIR_Thread_CS_Init()     /* in src/mpi/init/initthread.c */
-#define MPIU_THREAD_CS_FINALIZE MPIR_Thread_CS_Finalize() /* in src/mpi/init/initthread.c */
-
-/* some important critical section names:
- *   ALLFUNC - entered/exited at beginning/end of (nearly) every MPI_ function
- *   INIT - entered before MPID_Init and exited near the end of MPI_Init(_thread)
- * See the analysis of the MPI routines for thread usage properties.  Those
- * routines considered "Access Only" do not require ALLFUNC.  That analysis
- * was very general; in MPICH, some routines may have internal shared
- * state that isn't required by the MPI specification.  Perhaps the
- * best example of this is the MPI_ERROR_STRING routine, where the 
- * instance-specific error messages make use of shared state, and hence
- * must be accessed in a thread-safe fashion (e.g., require an ALLFUNC
- * critical section).  With such routines removed, the set of routines
- * that (probably) do not require ALLFUNC include:
- *
- * MPI_CART_COORDS, MPI_CART_GET, MPI_CART_MAP, MPI_CART_RANK, MPI_CART_SHIFT, 
- * MPI_CART_SUB, MPI_CARTDIM_GET, MPI_COMM_GET_NAME, 
- * MPI_COMM_RANK, MPI_COMM_REMOTE_SIZE, 
- * MPI_COMM_SET_NAME, MPI_COMM_SIZE, MPI_COMM_TEST_INTER, MPI_ERROR_CLASS,
- * MPI_FILE_GET_AMODE, MPI_FILE_GET_ATOMICITY, MPI_FILE_GET_BYTE_OFFSET, 
- * MPI_FILE_GET_POSITION, MPI_FILE_GET_POSITION_SHARED, MPI_FILE_GET_SIZE
- * MPI_FILE_GET_TYPE_EXTENT, MPI_FILE_SET_SIZE, 
- * MPI_FINALIZED, MPI_GET_COUNT, MPI_GET_ELEMENTS, MPI_GRAPH_GET, 
- * MPI_GRAPH_MAP, MPI_GRAPH_NEIGHBORS, MPI_GRAPH_NEIGHBORS_COUNT, 
- * MPI_GRAPHDIMS_GET, MPI_GROUP_COMPARE, MPI_GROUP_RANK, 
- * MPI_GROUP_SIZE, MPI_GROUP_TRANSLATE_RANKS, MPI_INITIALIZED, 
- * MPI_PACK, MPI_PACK_EXTERNAL, MPI_PACK_SIZE, MPI_TEST_CANCELLED, 
- * MPI_TOPO_TEST, MPI_TYPE_EXTENT, MPI_TYPE_GET_ENVELOPE, 
- * MPI_TYPE_GET_EXTENT, MPI_TYPE_GET_NAME, MPI_TYPE_GET_TRUE_EXTENT, 
- * MPI_TYPE_LB, MPI_TYPE_SET_NAME, MPI_TYPE_SIZE, MPI_TYPE_UB, MPI_UNPACK, 
- * MPI_UNPACK_EXTERNAL, MPI_WIN_GET_NAME, MPI_WIN_SET_NAME
- *
- * Some of the routines that could be read-only, but internally may
- * require access or updates to shared data include
- * MPI_COMM_COMPARE (creation of group sets)
- * MPI_COMM_SET_ERRHANDLER (reference count on errhandler)
- * MPI_COMM_CALL_ERRHANDLER (actually ok, but risk high, usage low)
- * MPI_FILE_CALL_ERRHANDLER (ditto)
- * MPI_WIN_CALL_ERRHANDLER (ditto)
- * MPI_ERROR_STRING (access to instance-specific string, which could
- *                   be overwritten by another thread)
- * MPI_FILE_SET_VIEW (setting view a big deal)
- * MPI_TYPE_COMMIT (could update description of type internally,
- *                  including creating a new representation.  Should
- *                  be ok, but, like call_errhandler, low usage)
- * 
- * Note that other issues may force a routine to include the ALLFUNC
- * critical section, such as debugging information that requires shared
- * state.  Such situations should be avoided where possible.
- */
-
-/*M MPIU_THREAD_CS_ENTER - Enter a named critical section
-
-  Input Parameters:
-+ _name - name of the critical section
-- _context - A context (typically an object) of the critical section
-
-M*/
-#define MPIU_THREAD_CS_ENTER(_name,_context) MPIU_THREAD_CS_ENTER_##_name(_context)
-
-/*M MPIU_THREAD_CS_EXIT - Exit a named critical section
-
-  Input Parameters:
-+ _name - cname of the critical section
-- _context - A context (typically an object) of the critical section
-
-M*/
-#define MPIU_THREAD_CS_EXIT(_name,_context) MPIU_THREAD_CS_EXIT_##_name(_context)
-
-/*M MPIU_THREAD_CS_YIELD - Temporarily release a critical section and yield
-    to other threads
-
-  Input Parameters:
-+ _name - cname of the critical section
-- _context - A context (typically an object) of the critical section
-
-  M*/
-#define MPIU_THREAD_CS_YIELD(_name,_context) MPIU_THREAD_CS_YIELD_##_name(_context)
-
-/*M MPIU_THREAD_CS_TRY - Trylock version of ENTER to a named critical section
-
-  Input Parameters:
-+ _name - name of the critical section
-- _context - A context (typically an object) of the critical section
-
-M*/
-#define MPIU_THREAD_CS_TRY(_name,_locked,_context) MPIU_THREAD_CS_TRY_##_name(_context,_locked)
-
-
-/*M
-  ... move the threadsafe init block
-
-  These use a private critical section called INITFLAG
-  M*/
-
-/* FIXME this is a broken version of the Double-Checked Locking Pattern (DCLP).
- * In practice it may work OK, but it certainly isn't guaranteed depending on
- * what the processor, compiler, and pthread implementation choose to do.
- *
- * These might be fixable in practice via OPA memory barriers. */
-#define MPIU_THREADSAFE_INIT_DECL(_var) static volatile int _var=1
-#define MPIU_THREADSAFE_INIT_STMT(_var,_stmt)   \
-    do {                                        \
-        if (_var) {                             \
-            MPIU_THREAD_CS_ENTER(INITFLAG,);    \
-            _stmt;                              \
-            _var=0;                             \
-            MPIU_THREAD_CS_EXIT(INITFLAG,);     \
-        }                                       \
-    while (0)
-#define MPIU_THREADSAFE_INIT_BLOCK_BEGIN(_var)  \
-    MPIU_THREAD_CS_ENTER(INITFLAG,);            \
-    if (_var) {
-#define MPIU_THREADSAFE_INIT_CLEAR(_var) _var=0
-#define MPIU_THREADSAFE_INIT_BLOCK_END(_var)    \
-    }                                           \
-    MPIU_THREAD_CS_EXIT(INITFLAG,)
-
-#elif !defined(MPID_DEVICE_DEFINES_THREAD_CS) /* && !defined(MPICH_IS_THREADED) */
-
-/* These provide a uniform way to perform a first-use initialization
-   in a thread-safe way.  See the web page or mpidtime.c for the generic
-   wtick */
-#define MPIU_THREADSAFE_INIT_DECL(_var) static int _var=1
-#define MPIU_THREADSAFE_INIT_STMT(_var,_stmt) \
-    do {                                      \
-        if (_var) {                           \
-            _stmt;                            \
-            _var = 0;                         \
-        }                                     \
-    } while (0)
-#define MPIU_THREADSAFE_INIT_BLOCK_BEGIN(_var)
-#define MPIU_THREADSAFE_INIT_CLEAR(_var) _var=0
-#define MPIU_THREADSAFE_INIT_BLOCK_END(_var)
-
-#endif
-
-/* Helper definitions for the default macro definitions */
-#if defined(MPICH_IS_THREADED) && !defined(MPID_DEVICE_DEFINES_THREAD_CS)
-#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL
-
-#define MPIU_THREAD_CHECKDEPTH(kind_, lockname_, value_)
-#define MPIU_THREAD_UPDATEDEPTH(kind_, lockname_, value_)
-
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
-
-/* this nesting is different than the MPIR_Nest_* macros, this is critical
- * section nesting, the other is MPI/NMPI nesting */
-
-/* This structure is used to keep track of where the last change was made
-   to the thread cs depth */
-/* temporarily disabled until we figure out if these should be restored (they
- * are currently broken) */
-#if 0 && MPID_THREAD_DEBUG
-
-#define MPIU_THREAD_CHECKDEPTH(kind_, lockname_, value_)                                   \
-    do {                                                                                   \
-        MPIU_ThreadDebug_t *nest_ptr_ = NULL;                                              \
-        MPIU_THREADPRIV_GET;                                                               \
-        nest_ptr_ = MPIU_THREADPRIV_FIELD(nest_debug);                                     \
-        if (nest_ptr_[kind_].count != value_) {                                            \
-            fprintf(stderr, "%s:%d %s = %d, required %d; previously set in %s:%d(%s)\n",   \
-                    __FILE__, __LINE__,  lockname_,                                        \
-                    nest_ptr_[kind_].count, value_,                                        \
-                    nest_ptr_[kind_].file,                                                 \
-                    nest_ptr_[kind_].line,                                                 \
-                    nest_ptr_[kind_].fname );                                              \
-            fflush(stderr);                                                                \
-        }                                                                                  \
-    } while (0)
-#define MPIU_THREAD_UPDATEDEPTH(kind_, lockname_, value_)                                  \
-    do {                                                                                   \
-        MPIU_ThreadDebug_t *nest_ptr_ = NULL;                                              \
-        MPIU_THREADPRIV_GET;                                                               \
-        nest_ptr_ = MPIU_THREADPRIV_FIELD(nest_debug);                                     \
-        if (nest_ptr_[kind_].count + (value_) < 0) {                                       \
-            fprintf(stderr, "%s:%d %s = %d (<0); previously set in %s:%d(%s)\n",           \
-                    __FILE__, __LINE__,  lockname_,                                        \
-                    nest_ptr_[kind_].count,                                                \
-                    nest_ptr_[kind_].file,                                                 \
-                    nest_ptr_[kind_].line,                                                 \
-                    nest_ptr_[kind_].fname );                                              \
-            fflush(stderr);                                                                \
-        }                                                                                  \
-        nest_ptr_[kind_].count += value_;                                                  \
-        nest_ptr_[kind_].line = __LINE__;                                                  \
-        MPIU_Strncpy( nest_ptr_[kind_].file, __FILE__, MPIU_THREAD_LOC_LEN );              \
-        MPIU_Strncpy( nest_ptr_[kind_].fname, FCNAME, MPIU_THREAD_FNAME_LEN );             \
-    } while (0)
-#else
-#define MPIU_THREAD_CHECKDEPTH(kind_, lockname_, value_)
-#define MPIU_THREAD_UPDATEDEPTH(kind_, lockname_, value_)
-#endif /* MPID_THREAD_DEBUG */
-#endif /* test on THREAD_GRANULARITY */
-
-#define MPIU_THREAD_CS_ENTER_LOCKNAME_RECURSIVE(name_)                                          \
-    do {                                                                                        \
-        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to recursively ENTER lockname=%s", #name_);   \
-        MPIU_Thread_CS_enter_lockname_recursive_impl_(MPIU_Nest_##name_, #name_, &MPIR_ThreadInfo.name_); \
-    } while (0)
-#define MPIU_THREAD_CS_EXIT_LOCKNAME_RECURSIVE(name_)                                           \
-    do {                                                                                        \
-        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to recursively EXIT lockname=%s", #name_);    \
-        MPIU_Thread_CS_exit_lockname_recursive_impl_(MPIU_Nest_##name_, #name_, &MPIR_ThreadInfo.name_);  \
-    } while (0)
-#define MPIU_THREAD_CS_YIELD_LOCKNAME_RECURSIVE(name_)                                          \
-    do {                                                                                        \
-        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to recursively YIELD lockname=%s", #name_);   \
-        MPIU_Thread_CS_yield_lockname_recursive_impl_(MPIU_Nest_##name_, #name_, &MPIR_ThreadInfo.name_); \
-    } while (0)
-#define MPIU_THREAD_CS_TRY_LOCKNAME_RECURSIVE(name_,locked_)                                   \
-    do {                                                                                      \
-        MPIU_Thread_CS_try_lockname_recursive_impl_(MPIU_Nest_##name_, #name_, &MPIR_ThreadInfo.name_, locked_); \
-    } while (0)
-
-
-#define MPIU_THREAD_CS_ENTER_LOCKNAME(name_)                                                   \
-    do {                                                                                       \
-        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to ENTER lockname=%s", #name_);              \
-        MPIU_Thread_CS_enter_lockname_impl_(MPIU_Nest_##name_, #name_, &MPIR_ThreadInfo.name_); \
-    } while (0)
-#define MPIU_THREAD_CS_EXIT_LOCKNAME(name_)                                                    \
-    do {                                                                                       \
-        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to EXIT lockname=%s", #name_);               \
-        MPIU_Thread_CS_exit_lockname_impl_(MPIU_Nest_##name_, #name_, &MPIR_ThreadInfo.name_);  \
-    } while (0)
-#define MPIU_THREAD_CS_YIELD_LOCKNAME(name_)                                                   \
-    do {                                                                                       \
-        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to YIELD lockname=%s", #name_);              \
-        MPIU_Thread_CS_yield_lockname_impl_(MPIU_Nest_##name_, #name_, &MPIR_ThreadInfo.name_); \
-    } while (0)
-
-enum MPIU_Nest_mutexes {
-    MPIU_Nest_global_mutex = 0,
-    MPIU_Nest_handle_mutex,
-    MPIU_Nest_msgq_mutex,
-    MPIU_Nest_completion_mutex,
-    MPIU_Nest_ctx_mutex,
-    MPIU_Nest_pmi_mutex,
-    MPIU_Nest_NUM_MUTEXES
-};
-
-/* Some locks (such as the memory allocation locks) are needed to
- * bootstrap the lock checking code.  These macros provide a similar
- * interface to the MPIU_THREAD_CS_{ENTER,EXIT}_LOCKNAME macros but
- * without the bootstrapping issue. */
-#define MPIU_THREAD_CS_ENTER_LOCKNAME_NOCHECK(_name)                  \
-    do {                                                              \
-        MPIU_DBG_MSG(THREAD,TYPICAL,"Enter critical section "#_name " (checking disabled)"); \
-        MPID_Thread_mutex_lock(&MPIR_ThreadInfo._name);               \
-    } while (0)
-#define MPIU_THREAD_CS_EXIT_LOCKNAME_NOCHECK(_name)                  \
-    do {                                                             \
-        MPIU_DBG_MSG(THREAD,TYPICAL,"Exit critical section "#_name " (checking disabled)"); \
-        MPID_Thread_mutex_unlock(&MPIR_ThreadInfo._name);            \
-    } while (0)
-
-#if defined(USE_MEMORY_TRACING)
-    /* These are defined for all levels of thread granularity due to the
-     * bootstrapping issue mentioned above */
-#   define MPIU_THREAD_CS_ENTER_MEMALLOC(_context)                  \
-        do {                                                        \
-            MPIU_THREAD_CHECK_BEGIN                                 \
-            MPIU_THREAD_CS_ENTER_LOCKNAME_NOCHECK(memalloc_mutex);  \
-            MPIU_THREAD_CHECK_END                                   \
-        } while(0)
-#   define MPIU_THREAD_CS_EXIT_MEMALLOC(_context)                   \
-        do {                                                        \
-            MPIU_THREAD_CHECK_BEGIN                                 \
-            MPIU_THREAD_CS_EXIT_LOCKNAME_NOCHECK(memalloc_mutex);   \
-            MPIU_THREAD_CHECK_END                                   \
-        } while(0)
-#else
-    /* we don't need these macros when using the system malloc */
-#   define MPIU_THREAD_CS_ENTER_MEMALLOC(_context) do {} while (0)
-#   define MPIU_THREAD_CS_EXIT_MEMALLOC(_context) do {} while (0)
-#endif
-
-/* helper macros to insert thread checks around LOCKNAME actions */
-#define MPIU_THREAD_CS_ENTER_LOCKNAME_CHECKED(name_)    \
-    MPIU_THREAD_CHECK_BEGIN                             \
-    MPIU_THREAD_CS_ENTER_LOCKNAME(name_);               \
-    MPIU_THREAD_CHECK_END
-#define MPIU_THREAD_CS_EXIT_LOCKNAME_CHECKED(name_)     \
-    MPIU_THREAD_CHECK_BEGIN                             \
-    MPIU_THREAD_CS_EXIT_LOCKNAME(name_);                \
-    MPIU_THREAD_CHECK_END
-#define MPIU_THREAD_CS_YIELD_LOCKNAME_CHECKED(name_)    \
-    MPIU_THREAD_CHECK_BEGIN                             \
-    MPIU_THREAD_CS_YIELD_LOCKNAME(name_);               \
-    MPIU_THREAD_CHECK_END
-
-
-/* Definitions of the thread support for various levels of thread granularity */
-#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL
-/* There is a single, global lock, held for the duration of an MPI call */
-/* FIXME this shouldn't need to be recursive, but using a recursive mutex here
- * greatly simplifies thread safety in ROMIO right now.  In the long term we
- * should make ROMIO internally thread safe and then this can go back to being a
- * non-recursive mutex. [goodell@ 2010-10-15] */
-#define MPIU_THREAD_CS_ENTER_ALLFUNC(_context)                 \
-    do {                                                       \
-        MPIU_THREAD_CHECK_BEGIN                                \
-        MPIU_THREAD_CS_ENTER_LOCKNAME_RECURSIVE(global_mutex); \
-        MPIU_THREAD_CHECK_END                                  \
-    } while (0)
-#define MPIU_THREAD_CS_EXIT_ALLFUNC(_context)                 \
-    do {                                                      \
-        MPIU_THREAD_CHECK_BEGIN                               \
-        MPIU_THREAD_CS_EXIT_LOCKNAME_RECURSIVE(global_mutex); \
-        MPIU_THREAD_CHECK_END                                 \
-    } while (0)
-#define MPIU_THREAD_CS_YIELD_ALLFUNC(_context)                 \
-    do {                                                       \
-        MPIU_THREAD_CHECK_BEGIN                                \
-        MPIU_THREAD_CS_YIELD_LOCKNAME_RECURSIVE(global_mutex); \
-        MPIU_THREAD_CHECK_END                                  \
-    } while (0)
-#define MPIU_THREAD_CS_TRY_ALLFUNC(_context,_locked)           \
-    do {                                                       \
-        MPIU_THREAD_CHECK_BEGIN                                \
-        MPIU_THREAD_CS_TRY_LOCKNAME_RECURSIVE(global_mutex,_locked);   \
-        MPIU_THREAD_CHECK_END                                  \
-    } while (0)
-
-/* not _CHECKED, invoked before MPIU_ISTHREADED will work */
-#define MPIU_THREAD_CS_ENTER_INIT(_context)    MPIU_THREAD_CS_ENTER_LOCKNAME_RECURSIVE(global_mutex)
-#define MPIU_THREAD_CS_EXIT_INIT(_context)     MPIU_THREAD_CS_EXIT_LOCKNAME_RECURSIVE(global_mutex)
-
-#define MPIU_THREAD_CS_ENTER_HANDLE(_context)
-#define MPIU_THREAD_CS_EXIT_HANDLE(_context)
-#define MPIU_THREAD_CS_ENTER_HANDLEALLOC(_context)
-#define MPIU_THREAD_CS_EXIT_HANDLEALLOC(_context)
-#define MPIU_THREAD_CS_ENTER_MSGQUEUE(_context)
-#define MPIU_THREAD_CS_EXIT_MSGQUEUE(_context)
-
-#define MPIU_THREAD_CS_ENTER_MPIDCOMM(_context)
-#define MPIU_THREAD_CS_EXIT_MPIDCOMM(_context)
-#define MPIU_THREAD_CS_YIELD_MPIDCOMM(_context)
-
-#define MPIU_THREAD_CS_ENTER_COMPLETION(_context)
-#define MPIU_THREAD_CS_EXIT_COMPLETION(_context)
-#define MPIU_THREAD_CS_YIELD_COMPLETION(_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)
-
-#define MPIU_THREAD_CS_ENTER_CONTEXTID(_context)
-#define MPIU_THREAD_CS_EXIT_CONTEXTID(_context)
-/* XXX DJG at the global level should CONTEXTID yield even though it
- * doesn't do anything at ENTER/EXIT? */
-#define MPIU_THREAD_CS_YIELD_CONTEXTID(_context)               \
-    do {                                                       \
-        MPIU_THREAD_CHECK_BEGIN                                \
-        MPIU_THREAD_CS_YIELD_LOCKNAME_RECURSIVE(global_mutex); \
-        MPIU_THREAD_CHECK_END                                  \
-    } while (0)
-
-#define MPIU_THREAD_CS_ENTER_MPI_OBJ(context_) do {} while(0)
-#define MPIU_THREAD_CS_EXIT_MPI_OBJ(context_)  do {} while(0)
-
-
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
-/* There are multiple locks, one for each (major) object */
-
-#define MPIU_THREAD_CS_ENTER_ALLFUNC(_context)
-#define MPIU_THREAD_CS_EXIT_ALLFUNC(_context)
-#define MPIU_THREAD_CS_YIELD_ALLFUNC(_context)
-
-#define MPIU_THREAD_CS_ENTER_INIT(_context)
-#define MPIU_THREAD_CS_EXIT_INIT(_context)
-
-#define MPIU_THREAD_CS_ENTER_HANDLE(_context) MPIU_THREAD_CS_ENTER_LOCKNAME_CHECKED(handle_mutex)
-#define MPIU_THREAD_CS_EXIT_HANDLE(_context)  MPIU_THREAD_CS_EXIT_LOCKNAME_CHECKED(handle_mutex)
-
-#define MPIU_THREAD_CS_ENTER_HANDLEALLOC(_context) MPIU_THREAD_CS_ENTER_LOCKNAME_CHECKED(handle_mutex)
-#define MPIU_THREAD_CS_EXIT_HANDLEALLOC(_context)  MPIU_THREAD_CS_EXIT_LOCKNAME_CHECKED(handle_mutex)
-
-/* MPIDCOMM protects the progress engine and related code */
-#define MPIU_THREAD_CS_ENTER_MPIDCOMM(_context)                \
-    MPIU_THREAD_CHECK_BEGIN                                    \
-    do {                                                       \
-        MPIU_THREAD_CS_ENTER_LOCKNAME_RECURSIVE(global_mutex); \
-    } while (0);                                               \
-    MPIU_THREAD_CHECK_END
-#define MPIU_THREAD_CS_EXIT_MPIDCOMM(_context)                \
-    MPIU_THREAD_CHECK_BEGIN                                   \
-    do {                                                      \
-        MPIU_THREAD_CS_EXIT_LOCKNAME_RECURSIVE(global_mutex); \
-    } while (0);                                              \
-    MPIU_THREAD_CHECK_END
-#define MPIU_THREAD_CS_YIELD_MPIDCOMM(_context)                \
-    MPIU_THREAD_CHECK_BEGIN                                    \
-    do {                                                       \
-        MPIU_THREAD_CS_YIELD_LOCKNAME_RECURSIVE(global_mutex); \
-    } while (0);                                               \
-    MPIU_THREAD_CHECK_END
-
-#define MPIU_THREAD_CS_ENTER_COMPLETION(_context) MPIU_THREAD_CS_ENTER_LOCKNAME_CHECKED(completion_mutex)
-#define MPIU_THREAD_CS_EXIT_COMPLETION(_context)  MPIU_THREAD_CS_EXIT_LOCKNAME_CHECKED(completion_mutex)
-
-
-/* MT FIXME the following description is almost right, but it needs minor
- * updates and revision to account for the COMPLETION CS and other issues in the
- * request */
-/* The fine-grained locking discipline for requests is unfortunately complicated:
- *
- * (1) Raw allocation and deallocation of requests is protected internally by
- * the HANDLEALLOC critical section.  This is currently the same as the HANDLE
- * CS, not sure why we have both...
- *
- * (2) Once allocated, a directly allocated request is intially held exclusively
- * by a single thread.  Direct allocation is common for send requests, but recv
- * requests are usually created differently.
- *
- * (3) Most receive requests are created as the result of a call to FDP_or_AEU
- * or FDU_or_AEP.  Calls to these functions (along with the other receive queue
- * functions) must be inside a MSGQUEUE CS.  This CS protects the queue data
- * structures as well as any fields inside the requests while they are in the
- * queue.  For example, assume a call to FDU_or_AEP, as in MPID_Recv.  If the
- * FDU case hits, the MSGQUEUE CS may be released immediately after the call.
- * If the AEP case hits, however, the MSGQUEUE CS must remain held until any
- * request field manipulation (such as dev.recv_pending_count) is complete.
- *
- * (4) In both the send and receive request cases, there is usually a particular
- * thread in some upper-level code (e.g. MPI_Send) with interest in the
- * completion of the request.  This may or may not be a thread that is also
- * making progress on this request (often not).  The upper level code must not
- * attempt to access any request fields (such as the status) until completion is
- * signalled by the lower layer.
- *
- * (5) Once removed from the receive queue, the request is once again
- * exclusively owned by the dequeuing thread.  From here, the dequeuing thread
- * may do whatever it wants with the request without holding any CS, until it
- * signals the request's completion.  Signalling completion indicates that the
- * thread in the upper layer polling on it may access the rest of the fields in
- * the request.  This completion signalling is lock-free and must be implemented
- * carefully to work correctly in the face of optimizing compilers and CPUs.
- * The upper-level thread now wholly owns the request until it is deallocated.
- *
- * (6) In ch3:nemesis at least, multithreaded access to send requests is managed
- * by the MPIDCOMM (progress engine) CS.  The completion signalling pattern
- * applies here (think MPI_Isend/MPI_Wait).
- *
- * (7) Request cancellation is tricky-ish.  For send cancellation, it is
- * possible that the completion counter is actually *incremented* because a
- * pkt is sent to the recipient asking for remote cancellation.  By asking for
- * cancellation (of any kind of req), the upper layer gives up its exclusive
- * access to the request and must wait for the completion counter to drop to 0
- * before exclusively accessing the request fields.
- *
- * The completion counter is a reference count, much like the object liveness
- * reference count.  However it differs from a normal refcount because of
- * guarantees in the MPI Standard.  Applications must not attempt to complete
- * (wait/test/free) a given request concurrently in two separate threads.  So
- * checking for cc==0 is safe because only one thread is ever allowed to make
- * that check.
- *
- * A non-zero completion count must always be accompanied by a normal reference
- * that is logically held by the progress engine.  Similarly, once the
- * completion counter drops to zero, the progress engine is expected to release
- * its reference.
- */
-/* lock ordering: if MPIDCOMM+MSGQUEUE must be aquired at the same time, then
- * the order should be to acquire MPIDCOMM first, then MSGQUEUE.  Release in
- * reverse order. */
-#define MPIU_THREAD_CS_ENTER_MSGQUEUE(context_)           \
-    do {                                                  \
-        MPIU_THREAD_CS_ENTER_LOCKNAME_CHECKED(msgq_mutex) \
-        MPIU_THREAD_CS_ASSERT_ENTER_HELPER(MSGQUEUE);     \
-    } while (0)
-#define MPIU_THREAD_CS_EXIT_MSGQUEUE(context_)            \
-    do {                                                  \
-        MPIU_THREAD_CS_ASSERT_EXIT_HELPER(MSGQUEUE);      \
-        MPIU_THREAD_CS_EXIT_LOCKNAME_CHECKED(msgq_mutex)  \
-    } while (0)
-
-/* change to 1 to enable some iffy CS assert_held logic */
-#if 0
-#define MPIU_THREAD_CS_ASSERT_HELD(name_)                                                      \
-    do {                                                                                       \
-        int same = FALSE;                                                                      \
-        MPID_Thread_id_t me;                                                                   \
-        if (MPIU_ISTHREADED) {                                                                 \
-            MPID_Thread_self(&me);                                                                 \
-            MPID_Thread_same(&me, &MPIR_ThreadInfo.cs_holder[MPIU_THREAD_CS_NAME_##name_], &same); \
-            MPIU_Assert_fmt_msg(same, ("me=%#08x holder=%#08x",                                              \
-                                       ((unsigned)(size_t)me),                                                       \
-                                       ((unsigned)(size_t)MPIR_ThreadInfo.cs_holder[MPIU_THREAD_CS_NAME_##name_]))); \
-        }                                                                                      \
-    } while (0)
-
-/* MT FIXME buggy, these defs don't work with recursive mutexes as implemented */
-#define MPIU_THREAD_CS_ASSERT_ENTER_HELPER(name_)                                                        \
-    do {                                                                                                 \
-        MPID_Thread_self(&MPIR_ThreadInfo.cs_holder[MPIU_THREAD_CS_NAME_##name_]);                       \
-    } while (0)
-#define MPIU_THREAD_CS_ASSERT_EXIT_HELPER(name_)                                                         \
-    do {                                                                                                 \
-        /* FIXME hack, assumes all 0-bytes won't be a valid thread ID */                                 \
-        memset(&MPIR_ThreadInfo.cs_holder[MPIU_THREAD_CS_NAME_##name_], 0x00, sizeof(MPID_Thread_id_t)); \
-    } while (0)
-#endif
-
-/* MT FIXME should this CS share the global_mutex?  If yes, how do
- * we avoid accidental deadlock? */
-#define MPIU_THREAD_CS_ENTER_INITFLAG(_context) MPIU_THREAD_CS_ENTER_LOCKNAME_CHECKED(global_mutex)
-#define MPIU_THREAD_CS_EXIT_INITFLAG(_context)  MPIU_THREAD_CS_EXIT_LOCKNAME_CHECKED(global_mutex)
-
-#define MPIU_THREAD_CS_ENTER_PMI(_context) MPIU_THREAD_CS_ENTER_LOCKNAME_CHECKED(pmi_mutex)
-#define MPIU_THREAD_CS_EXIT_PMI(_context)  MPIU_THREAD_CS_EXIT_LOCKNAME_CHECKED(pmi_mutex)
-
-#define MPIU_THREAD_CS_ENTER_CONTEXTID(_context) MPIU_THREAD_CS_ENTER_LOCKNAME_CHECKED(ctx_mutex)
-#define MPIU_THREAD_CS_EXIT_CONTEXTID(_context)  MPIU_THREAD_CS_EXIT_LOCKNAME_CHECKED(ctx_mutex)
-#define MPIU_THREAD_CS_YIELD_CONTEXTID(_context) MPIU_THREAD_CS_YIELD_LOCKNAME_CHECKED(ctx_mutex)
-
-/* must include semicolon */
-#define MPIU_THREAD_OBJECT_HOOK MPID_Thread_mutex_t pobj_mutex;
-
-#define MPIU_THREAD_CS_ENTER_MPI_OBJ(context_)                      \
-    do {                                                            \
-        if (MPIU_ISTHREADED)                                        \
-            MPID_Thread_mutex_lock(&context_->pobj_mutex);          \
-    } while (0)
-#define MPIU_THREAD_CS_EXIT_MPI_OBJ(context_)                       \
-    do {                                                            \
-        if (MPIU_ISTHREADED)                                        \
-            MPID_Thread_mutex_unlock(&context_->pobj_mutex);        \
-    } while (0)
-
-/* initialize any per-object mutex in an MPI handle allocated object.  Mainly
- * provided to reduce the amount of #ifdef/#endif code outside of this file. */
-#define MPIU_THREAD_MPI_OBJ_INIT(objptr_)                        \
-    do {                                                         \
-        int err_ = 0;                                            \
-        MPID_Thread_mutex_create(&(objptr_)->pobj_mutex, &err_); \
-        MPIU_Assert(!err_);                                      \
-    } while (0)
-
-#define MPIU_THREAD_MPI_OBJ_FINALIZE(objptr_)                    \
-    do {                                                         \
-        int err;                                                 \
-        MPID_Thread_mutex_destroy(&(objptr_)->pobj_mutex, &err); \
-        MPIU_Assert(!err);                                       \
-    } while (0)                                                  \
-
-
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_LOCK_FREE
-/* Updates to shared data and access to shared services is handled without
-   locks where ever possible. */
-#error lock-free not yet implemented
-
-#else
-#error Unrecognized thread granularity
-#endif
-
-#elif !defined(MPID_DEVICE_DEFINES_THREAD_CS) /* && !defined(MPICH_IS_THREADED) */
-#define MPIU_THREAD_CS_INIT
-#define MPIU_THREAD_CS_FINALIZE
-#define MPIU_THREAD_CS_ENTER(_name,_context) do{/*nothing*/}while(0)
-#define MPIU_THREAD_CS_EXIT(_name,_context)  do{/*nothing*/}while(0)
-#define MPIU_THREAD_CS_YIELD(_name,_context) do{/*nothing*/}while(0)
-#endif /* MPICH_IS_THREADED */
-
-/* catch-all */
-#ifndef MPIU_THREAD_OBJECT_HOOK
-#  define MPIU_THREAD_OBJECT_HOOK /**/
-#  define MPIU_THREAD_OBJECT_HOOK_INIT /**/
-#endif
-
-#ifndef MPIU_THREAD_CS_ASSERT_HELD
-#define MPIU_THREAD_CS_ASSERT_HELD(name_) do{/*nothing*/}while(0)
-#define MPIU_THREAD_CS_ASSERT_ENTER_HELPER(name_)
-#define MPIU_THREAD_CS_ASSERT_EXIT_HELPER(name_)
-#endif
-
-
-/* define a type for the completion counter */
-#if defined(MPICH_IS_THREADED)
-# if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL
-
-/* memory barriers aren't needed in this impl, because all access to completion
- * counters is done while holding the ALLFUNC critical section */
-typedef volatile int MPID_cc_t;
-#  define MPID_cc_set(cc_ptr_, val_) (*(cc_ptr_)) = (val_)
-#  define MPID_cc_is_complete(cc_ptr_) (0 == *(cc_ptr_))
-#define MPID_cc_decr(cc_ptr_, incomplete_)     \
-do {                                           \
-    *(incomplete_) = --(*(cc_ptr_));           \
-} while (0)
-#define MPID_cc_incr(cc_ptr_, was_incomplete_) \
-do {                                           \
-    *(was_incomplete_) = (*(cc_ptr_))++;       \
-} while (0)
-#define MPID_cc_get(cc_) (cc_)
-
-# elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
-
-#include "opa_primitives.h"
-
-typedef OPA_int_t MPID_cc_t;
-
-/* implies no barrier, since this routine should only be used for request
- * initialization */
-static inline void MPID_cc_set(MPID_cc_t *cc_ptr, int val)
-{
-    if (val == 0) {
-        /* values other than 0 do not enforce any ordering, and therefore do not
-         * start a HB arc */
-        /* MT FIXME using cc_set in this way is sloppy.  Sometimes the caller
-         * really does know that the cc value may cleared, but more likely this
-         * is just a hack to avoid the work of figuring out what the cc value
-         * currently is and decrementing it instead. */
-        /* barrier ensures that any state written before indicating completion is
-         * seen by the thread polling on the cc.  If OPA adds store-release
-         * semantics, we can convert to that instead. */
-        OPA_write_barrier();
-        MPL_VG_ANNOTATE_HAPPENS_BEFORE(cc_ptr);
-    }
-#if defined(MPL_VG_AVAILABLE)
-    /* MT subtle: store_int is actually safe to use, but Helgrind/DRD/TSan all
-     * view the store/load pair as a race.  Using an atomic operation for the
-     * store side makes all three happy.  DRD & TSan also support
-     * ANNOTATE_BENIGN_RACE, but Helgrind does not. */
-    OPA_swap_int(cc_ptr, val);
-#else
-    OPA_store_int(cc_ptr, val);
-#endif
-}
-
-ATTRIBUTE((unused))
-static MPL_DBG_INLINE_KEYWORD int MPID_cc_is_complete(MPID_cc_t *cc_ptr)
-{
-    int complete;
-    complete = (0 == OPA_load_int(cc_ptr));
-    if (complete) {
-        MPL_VG_ANNOTATE_HAPPENS_AFTER(cc_ptr);
-        OPA_read_barrier();
-    }
-    return complete;
-}
-
-/* incomplete_==TRUE iff the cc > 0 after the decr */
-#define MPID_cc_decr(cc_ptr_, incomplete_)                                  \
-    do {                                                                    \
-        OPA_write_barrier();                                                \
-        MPL_VG_ANNOTATE_HAPPENS_BEFORE(cc_ptr_);                            \
-        *(incomplete_) = !OPA_decr_and_test_int(cc_ptr_);                   \
-        /* TODO check if this HA is actually necessary */                   \
-        if (!*(incomplete_)) {                                              \
-            MPL_VG_ANNOTATE_HAPPENS_AFTER(cc_ptr_);                         \
-        }                                                                   \
-    } while (0)
-
-/* MT FIXME does this need a HB/HA annotation?  This macro is only used for
- * cancel_send right now. */
-/* was_incomplete_==TRUE iff the cc==0 before the decr */
-#define MPID_cc_incr(cc_ptr_, was_incomplete_)                              \
-    do {                                                                    \
-        *(was_incomplete_) = OPA_fetch_and_incr_int(cc_ptr_);               \
-    } while (0)
-
-#define MPID_cc_get(cc_) OPA_load_int(&(cc_))
-
-# else
-#  error "unexpected thread granularity"
-# endif /* granularity */
-#else /* !defined(MPICH_IS_THREADED) */
-
-typedef int MPID_cc_t;
-# define MPID_cc_set(cc_ptr_, val_) (*(cc_ptr_)) = (val_)
-# define MPID_cc_is_complete(cc_ptr_) (0 == *(cc_ptr_))
-#define MPID_cc_decr(cc_ptr_, incomplete_)     \
-do {                                           \
-    *(incomplete_) = --(*(cc_ptr_));           \
-} while (0)
-#define MPID_cc_incr(cc_ptr_, was_incomplete_) \
-do {                                           \
-    *(was_incomplete_) = (*(cc_ptr_))++;       \
-} while (0)
-#define MPID_cc_get(cc_) (cc_)
-
-#endif /* defined(MPICH_IS_THREADED) */
-
-
-/* "publishes" the obj with handle value (handle_) via the handle pointer
- * (hnd_lval_).  That is, it is a version of the following statement that fixes
- * memory consistency issues:
- *     (hnd_lval_) = (handle_);
- *
- * assumes that the following is always true: typeof(*hnd_lval_ptr_)==int
- */
-/* This could potentially be generalized beyond MPI-handle objects, but we
- * should only take that step after seeing good evidence of its use.  A general
- * macro (that is portable to non-gcc compilers) will need type information to
- * make the appropriate volatile cast. */
-/* Ideally _GLOBAL would use this too, but we don't want to count on OPA
- * availability in _GLOBAL mode.  Instead the ALLFUNC critical section should be
- * used. */
-#if defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
-#define MPIU_OBJ_PUBLISH_HANDLE(hnd_lval_, handle_)                                 \
-    do {                                                                            \
-        if (MPIU_ISTHREADED) {                                                      \
-            /* wmb ensures all read-only object field values are seen before the */ \
-            /* handle value is seen at the application level */                     \
-            OPA_write_barrier();                                                    \
-            /* volatile ensures lval is not speculatively read or written */        \
-            *(volatile int *)&(hnd_lval_) = (handle_);                              \
-        }                                                                           \
-        else {                                                                      \
-            (hnd_lval_) = (handle_);                                                \
-        }                                                                           \
-    } while (0)
-#else
-#define MPIU_OBJ_PUBLISH_HANDLE(hnd_lval_, handle_)  \
-    do {                                             \
-        (hnd_lval_) = (handle_);                     \
-    } while (0)
-#endif
-
-#ifndef MPIU_THREAD_MPI_OBJ_INIT
-#define MPIU_THREAD_MPI_OBJ_INIT(objptr_) do {} while (0)
-#endif
-#ifndef MPIU_THREAD_MPI_OBJ_FINALIZE
-#define MPIU_THREAD_MPI_OBJ_FINALIZE(objptr_) do {} while (0)
-#endif
-
-#endif /* !defined(MPIIMPLTHREAD_H_INCLUDED) */
-
diff --git a/src/include/mpiimplthreadpost.h b/src/include/mpiimplthreadpost.h
deleted file mode 100644
index afdfa7f..0000000
--- a/src/include/mpiimplthreadpost.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2010 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-/* this file contains definitions and declarations that would otherwise live in
- * mpiimplthread.h but must come later in the mpiimpl.h include process because
- * of the "big ball of wax" situation in our headers */
-
-#ifndef MPIIMPLTHREADPOST_H_INCLUDED
-#define MPIIMPLTHREADPOST_H_INCLUDED
-
-#if defined(MPICH_IS_THREADED) && !defined(MPID_DEVICE_DEFINES_THREAD_CS)
-/* All the funcs below require MPID Thread defns - that are available only
- * when thread level >= serialized
- */
-#undef FUNCNAME
-#define FUNCNAME MPIU_Thread_CS_enter_lockname_impl_
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-/* these are inline functions instead of macros to avoid some of the
- * MPIU_THREADPRIV_DECL scoping issues */
-MPL_DBG_ATTRIBUTE_NOINLINE
-ATTRIBUTE((unused))
-static MPL_DBG_INLINE_KEYWORD void
-MPIU_Thread_CS_enter_lockname_impl_(enum MPIU_Nest_mutexes kind,
-                                    const char *lockname,
-                                    MPID_Thread_mutex_t *mutex)
-{
-    MPIU_THREADPRIV_DECL;
-    MPIU_THREADPRIV_GET;
-    MPIU_THREAD_CHECKDEPTH(kind, lockname, 0);
-    MPIU_DBG_MSG_S(THREAD,TYPICAL,"locking %s", lockname);
-    MPID_Thread_mutex_lock(mutex);
-    MPIU_THREAD_UPDATEDEPTH(kind, lockname, 1);
-}
-
-#undef FUNCNAME
-#define FUNCNAME MPIU_Thread_CS_exit_lockname_impl_
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-MPL_DBG_ATTRIBUTE_NOINLINE
-ATTRIBUTE((unused))
-static MPL_DBG_INLINE_KEYWORD void
-MPIU_Thread_CS_exit_lockname_impl_(enum MPIU_Nest_mutexes kind,
-                                   const char *lockname,
-                                   MPID_Thread_mutex_t *mutex)
-{
-    MPIU_THREADPRIV_DECL;
-    MPIU_THREADPRIV_GET;
-    MPIU_THREAD_CHECKDEPTH(kind, lockname, 1);
-    MPIU_DBG_MSG_S(THREAD,TYPICAL,"unlocking %s", lockname);
-    MPID_Thread_mutex_unlock(mutex);
-    MPIU_THREAD_UPDATEDEPTH(kind, lockname, -1);
-}
-
-#undef FUNCNAME
-#define FUNCNAME MPIU_Thread_CS_yield_lockname_impl_
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-MPL_DBG_ATTRIBUTE_NOINLINE
-ATTRIBUTE((unused))
-static MPL_DBG_INLINE_KEYWORD void
-MPIU_Thread_CS_yield_lockname_impl_(enum MPIU_Nest_mutexes kind,
-                                    const char *lockname,
-                                    MPID_Thread_mutex_t *mutex)
-{
-    MPIU_THREADPRIV_DECL;
-    MPIU_THREADPRIV_GET;
-    MPIU_THREAD_CHECKDEPTH(kind, lockname, 1);
-    MPID_Thread_yield(mutex);
-}
-
-/* ------------------------------------------------------------------- */
-/* recursive versions, these are for the few locks where it is difficult or
- * impossible to eliminate recursive locking usage */
-
-#undef FUNCNAME
-#define FUNCNAME MPIU_Thread_CS_enter_lockname_recursive_impl_
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-/* these are inline functions instead of macros to avoid some of the
- * MPIU_THREADPRIV_DECL scoping issues */
-MPL_DBG_ATTRIBUTE_NOINLINE
-ATTRIBUTE((unused))
-static MPL_DBG_INLINE_KEYWORD void
-MPIU_Thread_CS_enter_lockname_recursive_impl_(enum MPIU_Nest_mutexes kind,
-                                              const char *lockname,
-                                              MPID_Thread_mutex_t *mutex)
-{
-    int depth;
-    MPIU_THREADPRIV_DECL;
-    MPIU_THREADPRIV_GET;
-    depth = MPIU_THREADPRIV_FIELD(lock_depth)[kind];
-    MPIU_DBG_MSG_D(THREAD,TYPICAL,"recursive enter, depth=%d", depth);
-
-    MPIU_Assert(depth >= 0 && depth < 10); /* probably a mismatch if we hit this */
-
-    if (depth == 0) {
-        MPIU_DBG_MSG_S(THREAD,TYPICAL,"locking %s", lockname);
-        MPID_Thread_mutex_lock(mutex);
-    }
-    MPIU_THREADPRIV_FIELD(lock_depth)[kind] += 1;
-}
-
-#undef FUNCNAME
-#define FUNCNAME MPIU_Thread_CS_try_lockname_recursive_impl_
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-/* these are inline functions instead of macros to avoid some of the
- * MPIU_THREADPRIV_DECL scoping issues */
-MPL_DBG_ATTRIBUTE_NOINLINE
-ATTRIBUTE((unused))
-static MPL_DBG_INLINE_KEYWORD void
-MPIU_Thread_CS_try_lockname_recursive_impl_(enum MPIU_Nest_mutexes kind,
-                                            const char *lockname,
-                                            MPID_Thread_mutex_t *mutex,
-                                            int *locked)
-{
-    int depth,local_try;
-    MPIU_THREADPRIV_DECL;
-    MPIU_THREADPRIV_GET;
-    depth = MPIU_THREADPRIV_FIELD(lock_depth)[kind];
-    MPIU_DBG_MSG_D(THREAD,TYPICAL,"recursive enter, depth=%d", depth);
-
-    MPIU_Assert(depth >= 0 && depth < 10); /* probably a mismatch if we hit this */
-
-    *locked = FALSE;
-
-    if (depth == 0) {
-        MPIU_DBG_MSG_S(THREAD,TYPICAL,"locking %s", lockname);
-        MPID_Thread_mutex_trylock(mutex,&local_try);
-        if (local_try == TRUE) {
-           MPIU_THREADPRIV_FIELD(lock_depth)[kind] += 1;
-           *locked = local_try;
-        }
-    } else {
-        MPIU_THREADPRIV_FIELD(lock_depth)[kind] += 1;
-        *locked = 1;
-   }
-}
-
-#undef FUNCNAME
-#define FUNCNAME MPIU_Thread_CS_exit_lockname_recursive_impl_
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-MPL_DBG_ATTRIBUTE_NOINLINE
-ATTRIBUTE((unused))
-static MPL_DBG_INLINE_KEYWORD void
-MPIU_Thread_CS_exit_lockname_recursive_impl_(enum MPIU_Nest_mutexes kind,
-                                             const char *lockname,
-                                             MPID_Thread_mutex_t *mutex)
-{
-    int depth;
-    MPIU_THREADPRIV_DECL;
-    MPIU_THREADPRIV_GET;
-    depth = MPIU_THREADPRIV_FIELD(lock_depth)[kind];
-    MPIU_DBG_MSG_D(THREAD,TYPICAL,"recursive exit, depth=%d", depth);
-
-    MPIU_Assert(depth > 0 && depth < 10); /* probably a mismatch if we hit this */
-
-    if (depth == 1) {
-        MPIU_DBG_MSG_S(THREAD,TYPICAL,"unlocking %s", lockname);
-        MPID_Thread_mutex_unlock(mutex);
-    }
-    MPIU_THREADPRIV_FIELD(lock_depth)[kind] -= 1;
-}
-
-#undef FUNCNAME
-#define FUNCNAME MPIU_Thread_CS_yield_lockname_recursive_impl_
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-MPL_DBG_ATTRIBUTE_NOINLINE
-ATTRIBUTE((unused))
-static MPL_DBG_INLINE_KEYWORD void
-MPIU_Thread_CS_yield_lockname_recursive_impl_(enum MPIU_Nest_mutexes kind,
-                                              const char *lockname,
-                                              MPID_Thread_mutex_t *mutex)
-{
-    int depth ATTRIBUTE((unused));
-    MPIU_THREADPRIV_DECL;
-    MPIU_THREADPRIV_GET;
-    depth = MPIU_THREADPRIV_FIELD(lock_depth)[kind];
-    MPIU_DBG_MSG_D(THREAD,TYPICAL,"recursive yield, depth=%d", depth);
-
-    MPIU_Assert(depth > 0 && depth < 10); /* we must hold the mutex */
-    /* no need to update depth, this is a thread-local value */
-
-    MPID_Thread_yield(mutex);
-}
-
-/* undef for safety, this is a commonly-included header */
-#undef FUNCNAME
-#undef FCNAME
-
-#endif /*  (MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED) */
-
-#endif /* defined(MPIIMPLTHREADPOST_H_INCLUDED) */
-
diff --git a/src/include/mpimem.h b/src/include/mpimem.h
index 1694bbc..cc4d1e0 100644
--- a/src/include/mpimem.h
+++ b/src/include/mpimem.h
@@ -88,11 +88,6 @@ char *MPIU_Strdup( const char * );
 #define MPIU_STR_FAIL      -1
 #define MPIU_STR_NOMEM      1
 
-/* FIXME: TRUE/FALSE definitions should either not be used or be
-   used consistently.  These also do not belong in the mpimem header file. */
-#define MPIU_TRUE  1
-#define MPIU_FALSE 0
-
 /* FIXME: Global types like this need to be discussed and agreed to */
 typedef int MPIU_BOOL;
 
@@ -420,7 +415,7 @@ if (pointer_) { \
     void *realloc_tmp_ = MPIU_Realloc((ptr_), (size_)); \
     if ((size_) && !realloc_tmp_) { \
         MPIU_Free(ptr_); \
-        MPIU_ERR_SETANDJUMP2(rc_,MPI_ERR_OTHER,"**nomem2","**nomem2 %d %s",(size_),MPIU_QUOTE(ptr_)); \
+        MPIR_ERR_SETANDJUMP2(rc_,MPI_ERR_OTHER,"**nomem2","**nomem2 %d %s",(size_),MPL_QUOTE(ptr_)); \
     } \
     (ptr_) = realloc_tmp_; \
 } while (0)
@@ -428,7 +423,7 @@ if (pointer_) { \
 #define MPIU_REALLOC_ORJUMP(ptr_,size_,rc_) do { \
     void *realloc_tmp_ = MPIU_Realloc((ptr_), (size_)); \
     if (size_) \
-        MPIU_ERR_CHKANDJUMP2(!realloc_tmp_,rc_,MPI_ERR_OTHER,"**nomem2","**nomem2 %d %s",(size_),MPIU_QUOTE(ptr_)); \
+        MPIR_ERR_CHKANDJUMP2(!realloc_tmp_,rc_,MPI_ERR_OTHER,"**nomem2","**nomem2 %d %s",(size_),MPL_QUOTE(ptr_)); \
     (ptr_) = realloc_tmp_; \
 } while (0)
 
@@ -455,13 +450,6 @@ void MPIU_Basename(char *path, char **basename);
       ((char *)(b_) >= (char *)(a_) && ((char *)(b_) < ((char *)(a_) + (a_len_)))) )
 #if (!defined(NDEBUG) && defined(HAVE_ERROR_CHECKING))
 
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
 /* May be used to perform sanity and range checking on memcpy and mempcy-like
    function calls.  This macro will bail out much like an MPIU_Assert if any of
    the checks fail. */
diff --git a/src/include/mpir_nbc.h b/src/include/mpir_nbc.h
index d9c3224..0e615e9 100644
--- a/src/include/mpir_nbc.h
+++ b/src/include/mpir_nbc.h
@@ -77,12 +77,12 @@ int MPID_Sched_copy(const void *inbuf,  int incount,  MPI_Datatype intype,
 int MPID_Sched_barrier(MPID_Sched_t s);
 
 /* A convenience macro for the extremely common case that "mpi_errno" is the
- * variable used for tracking error state and MPIU_ERR_POP is needed.  This
+ * variable used for tracking error state and MPIR_ERR_POP is needed.  This
  * declutters the NBC code substantially. */
 #define MPID_SCHED_BARRIER(sched_)              \
     do {                                        \
         mpi_errno = MPID_Sched_barrier(sched_); \
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno); \
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno); \
     } while (0)
 
 /* Defers evaluating (*count) until the entry actually begins to execute.  This
@@ -151,7 +151,7 @@ int MPIR_Sched_cb_free_buf(MPID_Comm *comm, int tag, void *state);
             mpi_errno = MPID_Sched_cb(&MPIR_Sched_cb_free_buf,                                 \
                                       (mpir_sched_chkpmem_stk_[--mpir_sched_chkpmem_stk_sp_]), \
                                       (sched_));                                               \
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);                                            \
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);                                            \
         }                                                                                      \
     } while (0)
 
diff --git a/src/include/mpishared.h b/src/include/mpishared.h
index 16cf8ed..4231d53 100644
--- a/src/include/mpishared.h
+++ b/src/include/mpishared.h
@@ -54,9 +54,6 @@
 #define MPI_THREAD_MULTIPLE 3
 #endif
 
-/* For thread support */
-#include "mpiimplthread.h"
-
 /* Error reporting routines */
 #include "mpierror.h"
 #include "mpierrs.h"
@@ -135,6 +132,4 @@
 #define MPIU_UNREFERENCED_ARG(a)
 #endif
 
-#include "mpiimplthreadpost.h"
-
 #endif
diff --git a/src/include/mpitimpl.h b/src/include/mpitimpl.h
index 75b72fb..48bf02b 100644
--- a/src/include/mpitimpl.h
+++ b/src/include/mpitimpl.h
@@ -11,9 +11,9 @@
 #define MPITIMPL_H_INCLUDED
 
 #include "mpi.h"
+#include "mpiutil.h"
 #include "mpiu_utarray.h"
 #include "mpiu_uthash.h"
-#include "mpiimplthread.h" /* For MPICH_IS_THREADED */
 
 #ifdef HAVE_ERROR_CHECKING
 typedef enum {
@@ -1411,15 +1411,17 @@ extern MPIU_Thread_mutex_t mpi_t_mutex;
 
 #define MPIR_T_THREAD_CS_ENTER() \
     do { \
-        MPIR_T_THREAD_CHECK_BEGIN \
-        MPID_Thread_mutex_lock(&mpi_t_mutex); \
+        int err;                              \
+        MPIR_T_THREAD_CHECK_BEGIN             \
+            MPID_Thread_mutex_lock(&mpi_t_mutex,&err);  \
         MPIR_T_THREAD_CHECK_END \
     } while (0)
 
 #define MPIR_T_THREAD_CS_EXIT() \
     do { \
+        int err;                  \
         MPIR_T_THREAD_CHECK_BEGIN \
-        MPID_Thread_mutex_unlock(&mpi_t_mutex); \
+            MPID_Thread_mutex_unlock(&mpi_t_mutex,&err);  \
         MPIR_T_THREAD_CHECK_END \
     } while (0)
 #else /* !MPICH_IS_THREADED */
diff --git a/src/include/mpiutil.h b/src/include/mpiutil.h
index 96768de..18937de 100644
--- a/src/include/mpiutil.h
+++ b/src/include/mpiutil.h
@@ -10,350 +10,8 @@
 #include "mpiu_thread.h"
 #include "mpiu_type_defs.h"
 #include "mpidbg.h"
-
-/*
-=== BEGIN_MPI_T_CVAR_INFO_BLOCK ===
-
-cvars:
-    - name        : MPIR_CVAR_POLLS_BEFORE_YIELD
-      category    : NEMESIS
-      type        : int
-      default     : 1000
-      class       : none
-      verbosity   : MPI_T_VERBOSITY_USER_BASIC
-      scope       : MPI_T_SCOPE_ALL_EQ
-      description : >-
-        When MPICH is in a busy waiting loop, it will periodically
-        call a function to yield the processor.  This cvar sets
-        the number of loops before the yield function is called.  A
-        value of 0 disables yielding.
-
-=== END_MPI_T_CVAR_INFO_BLOCK ===
-*/
-
-/* -------------------------------------------------------------------------- */
-/* detect compiler characteristics from predefined preprocesor tokens */
-
-/* modern versions of clang support lots of C11 features */
-#if defined(__has_extension)
-#  if __has_extension(c_generic_selections)
-#    define HAVE_C11__GENERIC 1
-#  endif
-#  if __has_extension(c_static_assert)
-#    define HAVE_C11__STATIC_ASSERT 1
-#  endif
-#endif
-
-/* GCC 4.6 added support for _Static_assert:
- * http://gcc.gnu.org/gcc-4.6/changes.html */
-#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined __cplusplus
-#  define HAVE_C11__STATIC_ASSERT 1
-#endif
-
-/* -------------------------------------------------------------------------- */
-
-/*
- * MPIU_Busy_wait()
- *
- * Call this in every busy wait loop to periodically yield the processor.  The
- * MPIR_CVAR_POLLS_BEFORE_YIELD parameter can be used to adjust the number of
- * times MPIU_Busy_wait is called before the yield function is called.
- */
-#ifdef USE_NOTHING_FOR_YIELD
-/* optimize if we're not yielding the processor */
-#define MPIU_Busy_wait() do {} while (0)
-#else
-/* MT: Updating the static int poll_count variable isn't thread safe and will
-   need to be changed for fine-grained multithreading.  A possible alternative
-   is to make it a global thread-local variable. */
-#define MPIU_Busy_wait() do {                                   \
-        if (MPIR_CVAR_POLLS_BEFORE_YIELD) {                    \
-            static int poll_count_ = 0;                         \
-            if (poll_count_ >= MPIR_CVAR_POLLS_BEFORE_YIELD) { \
-                poll_count_ = 0;                                \
-                MPIU_PW_Sched_yield();                          \
-            } else {                                            \
-                ++poll_count_;                                  \
-            }                                                   \
-        }                                                       \
-    } while (0)
-#endif
-
-/* prototypes for assertion implementation helpers */
-int MPIR_Assert_fail(const char *cond, const char *file_name, int line_num);
-int MPIR_Assert_fail_fmt(const char *cond, const char *file_name, int line_num, const char *fmt, ...);
-
-/*
- * MPIU_Assert()
- *
- * Similar to assert() except that it performs an MPID_Abort() when the 
- * assertion fails.  Also, for Windows, it doesn't popup a
- * mesage box on a remote machine.
- *
- * MPIU_AssertDecl may be used to include declarations only needed
- * when MPIU_Assert is non-null (e.g., when assertions are enabled)
- */
-#if (!defined(NDEBUG) && defined(HAVE_ERROR_CHECKING))
-#   define MPIU_AssertDecl(a_) a_
-#   define MPIU_AssertDeclValue(_a,_b) _a = _b
-#   define MPIU_Assert(a_)                             \
-    do {                                               \
-        if (unlikely(!(a_))) {                         \
-            MPIR_Assert_fail(#a_, __FILE__, __LINE__); \
-        }                                              \
-    } while (0)
-#else
-#   define MPIU_Assert(a_)
-/* Empty decls not allowed in C */
-#   define MPIU_AssertDecl(a_) a_ 
-#   define MPIU_AssertDeclValue(_a,_b) _a ATTRIBUTE((unused)) = _b
-#endif
-
-/*
- * MPIU_Assertp()
- *
- * Similar to MPIU_Assert() except that these assertions persist regardless of 
- * NDEBUG or HAVE_ERROR_CHECKING.  MPIU_Assertp() may
- * be used for error checking in prototype code, although it should be 
- * converted real error checking and reporting once the
- * prototype becomes part of the official and supported code base.
- */
-#define MPIU_Assertp(a_)                                             \
-    do {                                                             \
-        if (unlikely(!(a_))) {                                       \
-            MPIR_Assert_fail(#a_, __FILE__, __LINE__);               \
-        }                                                            \
-    } while (0)
-
-/* Define the MPIU_Assert_fmt_msg macro.  This macro takes two arguments.  The
- * first is the condition to assert.  The second is a parenthesized list of
- * arguments suitable for passing directly to printf that will yield a relevant
- * error message.  The macro will first evaluate the condition.  If it evaluates
- * to false the macro will take four steps:
- *
- * 1) It will emit an "Assertion failed..." message in the valgrind output with
- *    a backtrace, if valgrind client requests are available and the process is
- *    running under valgrind.  It will also evaluate and print the supplied
- *    message.
- * 2) It will emit an "Assertion failed..." message via MPL_internal_error_printf.
- *    The supplied error message will also be evaluated and printed.
- * 3) It will similarly emit the assertion failure and caller supplied messages
- *    to the debug log, if enabled, via MPIU_DBG_MSG_FMT.
- * 4) It will invoke MPID_Abort, just like the other MPIU_Assert* macros.
- *
- * If the compiler doesn't support (...)/__VA_ARGS__ in macros then the user
- * message will not be evaluated or printed.  If NDEBUG is defined or
- * HAVE_ERROR_CHECKING is undefined, this macro will expand to nothing, just
- * like MPIU_Assert.
- *
- * Example usage:
- *
- * MPIU_Assert_fmg_msg(foo > bar,("foo is larger than bar: foo=%d bar=%d",foo,bar));
- */
-#if (!defined(NDEBUG) && defined(HAVE_ERROR_CHECKING))
-#  if defined(HAVE_MACRO_VA_ARGS)
-
-/* newlines are added internally by the impl function, callers do not need to include them */
-#    define MPIU_Assert_fmt_msg(cond_,fmt_arg_parens_)                         \
-    do {                                                                       \
-        if (unlikely(!(cond_))) {                                              \
-            MPIR_Assert_fail_fmt(#cond_, __FILE__, __LINE__,                   \
-                                 MPIU_Assert_fmt_msg_expand_ fmt_arg_parens_); \
-        }                                                                      \
-    } while (0)
-/* helper to just expand the parens arg inline */
-#    define MPIU_Assert_fmt_msg_expand_(...) __VA_ARGS__
-
-#  else /* defined(HAVE_MACRO_VA_ARGS) */
-
-#    define MPIU_Assert_fmt_msg(cond_,fmt_arg_parens_)                                                   \
-    do {                                                                                                 \
-        if (unlikely(!(cond_))) {                                                                        \
-            MPIR_Assert_fail_fmt(#cond_, __FILE__, __LINE__,                                             \
-                                 "%s", "macro __VA_ARGS__ not supported, unable to print user message"); \
-        }                                                                                                \
-    } while (0)
-
-#  endif
-#else /* !defined(NDEBUG) && defined(HAVE_ERROR_CHECKING) */
-#    define MPIU_Assert_fmt_msg(cond_,fmt_arg_parens_)
-#endif
-
-
-/* evaluates to TRUE if ((a_)*(b_)>(max_)), only detects overflow for positive
- * a_ and _b. */
-#define MPIU_Prod_overflows_max(a_, b_, max_) \
-    ( (a_) > 0 && (b_) > 0 && ((a_) > ((max_) / (b_))) )
-
-/* asserts that ((a_)*(b_)<=(max_)) holds in a way that is robust against
- * undefined integer overflow behavior and is suitable for both signed and
- * unsigned math (only suitable for positive values of (a_) and (b_)) */
-#define MPIU_Assert_prod_pos_overflow_safe(a_, b_, max_)                               \
-    MPIU_Assert_fmt_msg(!MPIU_Prod_overflows_max((a_),(b_),(max_)),                    \
-                        ("overflow detected: (%llx * %llx) > %s", (a_), (b_), #max_)); \
-
-
-/* Helper macros that give us a crude version of C++'s
- * "std::numeric_limits<TYPE>" functionality.  These rely on either C11
- * "_Generic" functionality or some unfortunately complicated GCC builtins. */
-#if defined(HAVE_C11__GENERIC)
-#define expr_inttype_max(expr_)              \
-    _Generic(expr_,                          \
-             signed char:        SCHAR_MAX,  \
-             signed short:       SHRT_MAX,   \
-             signed int:         INT_MAX,    \
-             signed long:        LONG_MAX,   \
-             signed long long:   LLONG_MAX,  \
-             unsigned char:      UCHAR_MAX,  \
-             unsigned short:     USHRT_MAX,  \
-             unsigned int:       UINT_MAX,   \
-             unsigned long:      ULONG_MAX,  \
-             unsigned long long: ULLONG_MAX,\
-             /* _Generic cares about cv-qualifiers */ \
-             volatile signed int:   INT_MAX,          \
-             volatile unsigned int: UINT_MAX)
-#define expr_inttype_min(expr_)             \
-    _Generic(expr_,                         \
-             signed char:        SCHAR_MIN, \
-             signed short:       SHRT_MIN,  \
-             signed int:         INT_MIN,   \
-             signed long:        LONG_MIN,  \
-             signed long long:   LLONG_MIN, \
-             unsigned char:      0,         \
-             unsigned short:     0,         \
-             unsigned int:       0,         \
-             unsigned long:      0,         \
-             unsigned long long: 0,         \
-             /* _Generic cares about cv-qualifiers */ \
-             volatile signed int:   INT_MIN,          \
-             volatile unsigned int: 0)
-#endif
-
-/* Assigns (src_) to (dst_), checking that (src_) fits in (dst_) without
- * truncation.
- *
- * When fiddling with this macro, please keep C's overly complicated integer
- * promotion/truncation/conversion rules in mind.  A discussion of these issues
- * can be found in Chapter 5 of "Secure Coding in C and C++" by Robert Seacord.
- */
-#define MPIU_Assign_trunc(dst_,src_,dst_type_)                                         \
-    do {                                                                               \
-        /* will catch some of the cases if the expr_inttype macros aren't available */ \
-        MPIU_Assert((src_) == (dst_type_)(src_));                                      \
-        dst_ = (dst_type_)(src_);                                                      \
-    } while (0)
-
-/*
- * Ensure an MPI_Aint value fits into a signed int.
- * Useful for detecting overflow when MPI_Aint is larger than an int.
- *
- * \param[in]  aint  Variable of type MPI_Aint
- */
-#define MPIU_Ensure_Aint_fits_in_int(aint) \
-  MPIU_Assert((aint) == (MPI_Aint)(int)(aint));
-
-/*
- * Ensure an MPI_Aint value fits into an unsigned int.
- * Useful for detecting overflow when MPI_Aint is larger than an 
- * unsigned int.
- *
- * \param[in]  aint  Variable of type MPI_Aint
- */
-#define MPIU_Ensure_Aint_fits_in_uint(aint) \
-  MPIU_Assert((aint) == (MPI_Aint)(unsigned int)(aint));
-
-/*
- * Ensure an MPI_Aint value fits into a pointer.
- * Useful for detecting overflow when MPI_Aint is larger than a pointer.
- *
- * \param[in]  aint  Variable of type MPI_Aint
- */
-#define MPIU_Ensure_Aint_fits_in_pointer(aint) \
-  MPIU_Assert((aint) == (MPI_Aint)(MPIU_Upint) MPI_AINT_CAST_TO_VOID_PTR(aint));
-
-/* -------------------------------------------------------------------------- */
-/* static assertions
- *
- * C11 adds static assertions.  They can be faked in pre-C11 compilers through
- * various tricks as long as you are willing to accept some ugly error messages
- * when the assert trips.  See
- * http://www.pixelbeat.org/programming/gcc/static_assert.html
- * for some implementation options.
- *
- * For now, we just use some simple preprocessor tests to use real static
- * assertions when the compiler supports them (modern clang and gcc do).
- * Eventually add configure logic to detect this.
- */
-/* the case we usually want to hit */
-#ifdef HAVE_C11__STATIC_ASSERT
-#  define MPIU_Static_assert(cond_,msg_) _Static_assert(cond_,msg_)
-#endif
-/* fallthrough to a run-time assertion */
-#ifndef MPIU_Static_assert
-#  define MPIU_Static_assert(cond_,msg_) MPIU_Assert_fmt_msg((cond_), ("%s", (msg_)))
-#endif
-
-/* -------------------------------------------------------------------------- */
-/* static type checking macros */
-
-/* implement using C11's "_Generic" functionality (optimal case) */
-#ifdef HAVE_C11__GENERIC
-#  define MPIU_Assert_has_type(expr_,type_) \
-    MPIU_Static_assert(_Generic((expr_), type_: 1, default: 0), \
-                       "expression '" #expr_ "' does not have type '" #type_ "'")
-#endif
-/* fallthrough to do nothing */
-#ifndef MPIU_Assert_has_type
-#  define MPIU_Assert_has_type(expr_,type_) do {} while (0)
-#endif
-
-/* -------------------------------------------------------------------------- */
-/*
- * Basic utility macros
- */
-#define MPIU_QUOTE(A) MPIU_QUOTE2(A)
-#define MPIU_QUOTE2(A) #A
-
-/* This macro is used to silence warnings from the Mac OS X linker when
- * an object file "has no symbols".  The unused attribute prevents a
- * warning about the unused dummy variable while the used attribute
- * prevents the compiler from discarding the symbol altogether.  This
- * macro should be used at the top of any file that might not define any
- * other variables or functions (perhaps due to conditional compilation
- * via the preprocessor).  A semicolon is expected after each invocation
- * of this macro. */
-#define MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING \
-    static int MPIU_UNIQUE_SYMBOL_NAME(dummy) ATTRIBUTE((unused,used)) = 0
-
-/* we jump through a couple of extra macro hoops to append the line
- * number to the variable name in order to reduce the chance of a name
- * collision with headers that might be included in the translation
- * unit */
-#define MPIU_UNIQUE_SYMBOL_NAME(prefix_) MPIU_UNIQUE_IMPL1_(prefix_##_unique_L,__LINE__)
-#define MPIU_UNIQUE_IMPL1_(prefix_,line_) MPIU_UNIQUE_IMPL2_(prefix_,line_)
-#define MPIU_UNIQUE_IMPL2_(prefix_,line_) MPIU_UNIQUE_IMPL3_(prefix_,line_)
-#define MPIU_UNIQUE_IMPL3_(prefix_,line_) prefix_##line_
-
-/* These likely/unlikely macros provide static branch prediction hints to the
- * compiler, if such hints are available.  Simply wrap the relevant expression in
- * the macro, like this:
- *
- * if (unlikely(ptr == NULL)) {
- *     // ... some unlikely code path ...
- * }
- *
- * They should be used sparingly, especially in upper-level code.  It's easy to
- * incorrectly estimate branching likelihood, while the compiler can often do a
- * decent job if left to its own devices.
- *
- * These macros are not namespaced because the namespacing is cumbersome.
- */
-#ifdef HAVE_BUILTIN_EXPECT
-#  define unlikely(x_) __builtin_expect(!!(x_),0)
-#  define likely(x_)   __builtin_expect(!!(x_),1)
-#else
-#  define unlikely(x_) (x_)
-#  define likely(x_)   (x_)
-#endif
+#include "mpiassert.h"
+#include "mpiu_timer.h"
+#include "mpiu_pointer.h"
 
 #endif /* !defined(MPIUTIL_H_INCLUDED) */
diff --git a/src/include/rlog.h b/src/include/rlog.h
index b46523c..4908e63 100644
--- a/src/include/rlog.h
+++ b/src/include/rlog.h
@@ -17,12 +17,6 @@ extern "C" {
 #ifndef RLOG_BOOL
 #define RLOG_BOOL int
 #endif
-#ifndef RLOG_TRUE
-#define RLOG_TRUE 1
-#endif
-#ifndef RLOG_FALSE
-#define RLOG_FALSE 0
-#endif
 
 #define RLOG_BUFFSIZE           (8*1024*1024)
 #define RLOG_MAX_RECORD_SIZE     1024
diff --git a/src/include/rlog_macros.h b/src/include/rlog_macros.h
index 597a6bc..ccb8b11 100644
--- a/src/include/rlog_macros.h
+++ b/src/include/rlog_macros.h
@@ -8,7 +8,7 @@
 #define RLOG_MACROS_H_INCLUDED
 
 #include "rlog.h"
-#include "mpichtimer.h"
+#include "mpiu_timer.h"
 
 #ifndef MPIDM_Wtime_todouble
 #error Failed to select a defintion for MPIDM_Wtime_todouble
diff --git a/src/mpi/attr/attr_delete.c b/src/mpi/attr/attr_delete.c
index 1e624f9..fa93ba3 100644
--- a/src/mpi/attr/attr_delete.c
+++ b/src/mpi/attr/attr_delete.c
@@ -62,7 +62,7 @@ int MPI_Attr_delete(MPI_Comm comm, int keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ATTR_DELETE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -105,7 +105,7 @@ int MPI_Attr_delete(MPI_Comm comm, int keyval)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ATTR_DELETE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/attr_get.c b/src/mpi/attr/attr_get.c
index 1851e52..a318284 100644
--- a/src/mpi/attr/attr_get.c
+++ b/src/mpi/attr/attr_get.c
@@ -80,7 +80,7 @@ int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ATTR_GET);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -95,7 +95,7 @@ int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag)
 	       should have been used.  We can test for this specific
 	       case.  Note that this code assumes sizeof(MPIU_Pint) is 
 	       a power of 2. */
-            MPIU_ERR_CHKANDJUMP((MPIU_Pint)attribute_val & (sizeof(MPIU_Pint)-1),
+            MPIR_ERR_CHKANDJUMP((MPIU_Pint)attribute_val & (sizeof(MPIU_Pint)-1),
                                 mpi_errno,MPI_ERR_ARG,"**attrnotptr");
 #           endif
         }
@@ -130,7 +130,7 @@ int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ATTR_GET);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/attr_put.c b/src/mpi/attr/attr_put.c
index 89987fd..adb491b 100644
--- a/src/mpi/attr/attr_put.c
+++ b/src/mpi/attr/attr_put.c
@@ -79,7 +79,7 @@ int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ATTR_PUT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -121,7 +121,7 @@ int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ATTR_PUT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/attrutil.c b/src/mpi/attr/attrutil.c
index 4658657..656915d 100644
--- a/src/mpi/attr/attrutil.c
+++ b/src/mpi/attr/attrutil.c
@@ -63,7 +63,7 @@ void MPID_Attr_free(MPID_Attribute *attr_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Call_attr_delete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*
   This function deletes a single attribute.
   It is called by both the function to delete a list and attribute set/put 
@@ -133,7 +133,7 @@ int MPIR_Call_attr_delete( int handle, MPID_Attribute *attr_p )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Call_attr_copy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Call_attr_copy( int handle, MPID_Attribute *attr_p, void** value_copy, int* flag)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -173,7 +173,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Attr_dup_list
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* Routine to duplicate an attribute list */
 int MPIR_Attr_dup_list( int handle, MPID_Attribute *old_attrs, 
 			MPID_Attribute **new_attr )
@@ -239,7 +239,7 @@ int MPIR_Attr_dup_list( int handle, MPID_Attribute *old_attrs,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Attr_delete_list
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* Routine to delete an attribute list */
 int MPIR_Attr_delete_list( int handle, MPID_Attribute **attr )
 {
@@ -256,7 +256,7 @@ int MPIR_Attr_delete_list( int handle, MPID_Attribute **attr )
 	/* Check the sentinals first */
 	/* --BEGIN ERROR HANDLING-- */
 	if (p->pre_sentinal != 0 || p->post_sentinal != 0) {
-	    MPIU_ERR_SET(mpi_errno,MPI_ERR_OTHER,"**attrsentinal");
+	    MPIR_ERR_SET(mpi_errno,MPI_ERR_OTHER,"**attrsentinal");
 	    /* We could keep trying to free the attributes, but for now
 	       we'll just bag it */
 	    return mpi_errno;
@@ -325,11 +325,11 @@ MPIR_Attr_copy_c_proxy(
     }
 
     /* user functions might call other MPI functions, so we need to
-     * release the lock here. This is safe to do as ALLFUNC is not at
+     * release the lock here. This is safe to do as GLOBAL is not at
      * all recursive in our implementation. */
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     ret = user_function(handle, keyval, extra_state, attrib_val, attrib_copy, flag);
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return ret;
 }
@@ -355,11 +355,11 @@ MPIR_Attr_delete_c_proxy(
         attrib_val = attrib;
 
     /* user functions might call other MPI functions, so we need to
-     * release the lock here. This is safe to do as ALLFUNC is not at
+     * release the lock here. This is safe to do as GLOBAL is not at
      * all recursive in our implementation. */
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     ret = user_function(handle, keyval, attrib_val, extra_state);
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return ret;
 }
diff --git a/src/mpi/attr/comm_create_keyval.c b/src/mpi/attr/comm_create_keyval.c
index e2f5f28..379d572 100644
--- a/src/mpi/attr/comm_create_keyval.c
+++ b/src/mpi/attr/comm_create_keyval.c
@@ -40,7 +40,7 @@ int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_create_keyval_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_create_keyval_impl(MPI_Comm_copy_attr_function *comm_copy_attr_fn,
                                  MPI_Comm_delete_attr_function *comm_delete_attr_fn,
                                  int *comm_keyval, void *extra_state)
@@ -49,7 +49,7 @@ int MPIR_Comm_create_keyval_impl(MPI_Comm_copy_attr_function *comm_copy_attr_fn,
     MPID_Keyval *keyval_ptr;
         
     keyval_ptr = (MPID_Keyval *)MPIU_Handle_obj_alloc( &MPID_Keyval_mem );
-    MPIU_ERR_CHKANDJUMP(!keyval_ptr, mpi_errno, MPI_ERR_OTHER,"**nomem");
+    MPIR_ERR_CHKANDJUMP(!keyval_ptr, mpi_errno, MPI_ERR_OTHER,"**nomem");
 
     /* Initialize the attribute dup function */
     if (!MPIR_Process.attr_dup) {
@@ -84,7 +84,7 @@ int MPIR_Comm_create_keyval_impl(MPI_Comm_copy_attr_function *comm_copy_attr_fn,
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_create_keyval
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Comm_create_keyval - Create a new attribute key 
 
@@ -130,7 +130,7 @@ int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_CREATE_KEYVAL);
 
     /* Validate parameters and objects (post conversion) */
@@ -153,7 +153,7 @@ int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_CREATE_KEYVAL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/comm_delete_attr.c b/src/mpi/attr/comm_delete_attr.c
index c184d43..4a2a2f3 100644
--- a/src/mpi/attr/comm_delete_attr.c
+++ b/src/mpi/attr/comm_delete_attr.c
@@ -29,7 +29,7 @@ int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval) __attribute__((weak,ali
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_delete_attr_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_delete_attr_impl(MPID_Comm *comm_ptr, MPID_Keyval *keyval_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -85,7 +85,7 @@ int MPIR_Comm_delete_attr_impl(MPID_Comm *comm_ptr, MPID_Keyval *keyval_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_delete_attr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Comm_delete_attr - Deletes an attribute value associated with a key on 
    a  communicator
@@ -114,7 +114,7 @@ int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_DELETE_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -159,7 +159,7 @@ int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_DELETE_ATTR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/comm_free_keyval.c b/src/mpi/attr/comm_free_keyval.c
index 6536f76..69e5973 100644
--- a/src/mpi/attr/comm_free_keyval.c
+++ b/src/mpi/attr/comm_free_keyval.c
@@ -29,7 +29,7 @@ int MPI_Comm_free_keyval(int *comm_keyval) __attribute__((weak,alias("PMPI_Comm_
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_free_keyval_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Comm_free_keyval_impl(int keyval)
 {
     int in_use;
@@ -52,7 +52,7 @@ void MPIR_Comm_free_keyval_impl(int keyval)
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_free_keyval
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Comm_free_keyval - Frees an attribute key for communicators
 
@@ -78,7 +78,7 @@ int MPI_Comm_free_keyval(int *comm_keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_FREE_KEYVAL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -122,7 +122,7 @@ int MPI_Comm_free_keyval(int *comm_keyval)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_FREE_KEYVAL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/attr/comm_get_attr.c b/src/mpi/attr/comm_get_attr.c
index 5ddeb01..a3f22a2 100644
--- a/src/mpi/attr/comm_get_attr.c
+++ b/src/mpi/attr/comm_get_attr.c
@@ -64,7 +64,7 @@ int MPIR_CommGetAttr( MPI_Comm comm, int comm_keyval, void *attribute_val,
 	       case.  Note that this code assumes sizeof(MPIU_Pint) is 
 	       a power of 2. */
 	    if ((MPIU_Pint)attribute_val & (sizeof(MPIU_Pint)-1)) {
-		MPIU_ERR_SETANDSTMT(mpi_errno,MPI_ERR_ARG,goto fn_fail,"**attrnotptr");
+		MPIR_ERR_SETANDSTMT(mpi_errno,MPI_ERR_ARG,goto fn_fail,"**attrnotptr");
 	    }
 #           endif
         }
@@ -300,9 +300,9 @@ int MPIR_CommGetAttr_fort(MPI_Comm comm, int comm_keyval, void *attribute_val,
 {
     int mpi_errno;
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     mpi_errno = MPIR_CommGetAttr(comm, comm_keyval, attribute_val, flag, outAttrType);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return mpi_errno;
 }
@@ -313,7 +313,7 @@ int MPIR_CommGetAttr_fort(MPI_Comm comm, int comm_keyval, void *attribute_val,
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_get_attr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /* FIXME: Attributes must be visable from all languages */
 /*@
@@ -355,7 +355,7 @@ int MPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_GET_ATTR);
 
     /* Instead, ask for a desired type. */
@@ -366,7 +366,7 @@ int MPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_GET_ATTR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/comm_set_attr.c b/src/mpi/attr/comm_set_attr.c
index 8da5935..558a883 100644
--- a/src/mpi/attr/comm_set_attr.c
+++ b/src/mpi/attr/comm_set_attr.c
@@ -29,7 +29,7 @@ int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val) __att
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_set_attr_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_set_attr_impl(MPID_Comm *comm_ptr, int comm_keyval, void *attribute_val, 
                             MPIR_AttrType attrType)
 {
@@ -37,7 +37,7 @@ int MPIR_Comm_set_attr_impl(MPID_Comm *comm_ptr, int comm_keyval, void *attribut
     MPID_Keyval *keyval_ptr = NULL;
     MPID_Attribute *p;
 
-    MPIU_ERR_CHKANDJUMP(comm_keyval == MPI_KEYVAL_INVALID, mpi_errno, MPI_ERR_KEYVAL, "**keyvalinvalid");
+    MPIR_ERR_CHKANDJUMP(comm_keyval == MPI_KEYVAL_INVALID, mpi_errno, MPI_ERR_KEYVAL, "**keyvalinvalid");
 
     /* CHANGE FOR MPI 2.2:  Look for attribute.  They are ordered by when they
        were added, with the most recent first. This uses 
@@ -75,7 +75,7 @@ int MPIR_Comm_set_attr_impl(MPID_Comm *comm_ptr, int comm_keyval, void *attribut
     /* CHANGE FOR MPI 2.2: If not found, add at the beginning */
     if (!p) {
 	MPID_Attribute *new_p = MPID_Attr_alloc();
-	MPIU_ERR_CHKANDJUMP(!new_p,mpi_errno,MPI_ERR_OTHER,"**nomem");
+	MPIR_ERR_CHKANDJUMP(!new_p,mpi_errno,MPI_ERR_OTHER,"**nomem");
 	/* Did not find in list.  Add at end */
 	new_p->keyval	     = keyval_ptr;
 	new_p->attrType      = attrType;
@@ -105,7 +105,7 @@ int MPIR_Comm_set_attr_impl(MPID_Comm *comm_ptr, int comm_keyval, void *attribut
 #undef FUNCNAME
 #define FUNCNAME MPIR_CommSetAttr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_CommSetAttr( MPI_Comm comm, int comm_keyval, void *attribute_val, 
 		      MPIR_AttrType attrType )
 {
@@ -115,7 +115,7 @@ int MPIR_CommSetAttr( MPI_Comm comm, int comm_keyval, void *attribute_val,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_COMM_SET_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -161,7 +161,7 @@ int MPIR_CommSetAttr( MPI_Comm comm, int comm_keyval, void *attribute_val,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_COMM_SET_ATTR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
@@ -182,7 +182,7 @@ int MPIR_CommSetAttr( MPI_Comm comm, int comm_keyval, void *attribute_val,
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_set_attr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Comm_set_attr - Stores attribute value associated with a key
 
@@ -222,7 +222,7 @@ int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val)
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_COMM_SET_ATTR);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SET_ATTR);
 
      /* Validate parameters, especially handles needing to be converted */
@@ -267,7 +267,7 @@ int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val)
 
  fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SET_ATTR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/keyval_create.c b/src/mpi/attr/keyval_create.c
index 27a194d..8014942 100644
--- a/src/mpi/attr/keyval_create.c
+++ b/src/mpi/attr/keyval_create.c
@@ -76,7 +76,7 @@ int MPI_Keyval_create(MPI_Copy_function *copy_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_KEYVAL_CREATE);
 
     /* Validate parameters and objects (post conversion) */
@@ -99,7 +99,7 @@ int MPI_Keyval_create(MPI_Copy_function *copy_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_KEYVAL_CREATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/keyval_free.c b/src/mpi/attr/keyval_free.c
index e107af8..560627c 100644
--- a/src/mpi/attr/keyval_free.c
+++ b/src/mpi/attr/keyval_free.c
@@ -63,7 +63,7 @@ int MPI_Keyval_free(int *keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_KEYVAL_FREE);
 #   ifdef HAVE_ERROR_CHECKING
     {
@@ -101,7 +101,7 @@ int MPI_Keyval_free(int *keyval)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_KEYVAL_FREE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/type_create_keyval.c b/src/mpi/attr/type_create_keyval.c
index 1084696..76df18b 100644
--- a/src/mpi/attr/type_create_keyval.c
+++ b/src/mpi/attr/type_create_keyval.c
@@ -81,7 +81,7 @@ int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_KEYVAL);
     
     /* Validate parameters and objects (post conversion) */
@@ -98,7 +98,7 @@ int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn,
     /* ... body of routine ...  */
     
     keyval_ptr = (MPID_Keyval *)MPIU_Handle_obj_alloc( &MPID_Keyval_mem );
-    MPIU_ERR_CHKANDJUMP(!keyval_ptr,mpi_errno,MPI_ERR_OTHER,"**nomem");
+    MPIR_ERR_CHKANDJUMP(!keyval_ptr,mpi_errno,MPI_ERR_OTHER,"**nomem");
 
     /* Initialize the attribute dup function */
     if (!MPIR_Process.attr_dup) {
@@ -128,7 +128,7 @@ int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_KEYVAL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/type_delete_attr.c b/src/mpi/attr/type_delete_attr.c
index 0f77e00..639a586 100644
--- a/src/mpi/attr/type_delete_attr.c
+++ b/src/mpi/attr/type_delete_attr.c
@@ -61,7 +61,7 @@ int MPI_Type_delete_attr(MPI_Datatype datatype, int type_keyval)
     
     /* The thread lock prevents a valid attr delete on the same datatype
        but in a different thread from causing problems */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_DELETE_ATTR);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -145,7 +145,7 @@ int MPI_Type_delete_attr(MPI_Datatype datatype, int type_keyval)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_DELETE_ATTR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/type_free_keyval.c b/src/mpi/attr/type_free_keyval.c
index c52dc3b..e29ae1b 100644
--- a/src/mpi/attr/type_free_keyval.c
+++ b/src/mpi/attr/type_free_keyval.c
@@ -58,7 +58,7 @@ int MPI_Type_free_keyval(int *type_keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_FREE_KEYVAL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -106,7 +106,7 @@ int MPI_Type_free_keyval(int *type_keyval)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_FREE_KEYVAL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/attr/type_get_attr.c b/src/mpi/attr/type_get_attr.c
index ac62d75..e3958ab 100644
--- a/src/mpi/attr/type_get_attr.c
+++ b/src/mpi/attr/type_get_attr.c
@@ -42,7 +42,7 @@ int MPIR_TypeGetAttr( MPI_Datatype datatype, int type_keyval, void *attribute_va
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_TYPE_GET_ATTR);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -59,7 +59,7 @@ int MPIR_TypeGetAttr( MPI_Datatype datatype, int type_keyval, void *attribute_va
 	       case.  Note that this code assumes sizeof(MPIU_Pint) is 
 	       a power of 2. */
 	    if ((MPIU_Pint)attribute_val & (sizeof(MPIU_Pint)-1)) {
-		MPIU_ERR_SETANDSTMT(mpi_errno,MPI_ERR_ARG,goto fn_fail,"**attrnotptr");
+		MPIR_ERR_SETANDSTMT(mpi_errno,MPI_ERR_ARG,goto fn_fail,"**attrnotptr");
 	    }
 #           endif
         }
@@ -130,7 +130,7 @@ int MPIR_TypeGetAttr( MPI_Datatype datatype, int type_keyval, void *attribute_va
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_TYPE_GET_ATTR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
@@ -153,7 +153,7 @@ int MPIR_TypeGetAttr( MPI_Datatype datatype, int type_keyval, void *attribute_va
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_get_attr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
    MPI_Type_get_attr - Retrieves attribute value by key
diff --git a/src/mpi/attr/type_set_attr.c b/src/mpi/attr/type_set_attr.c
index 1239d5a..dfd118f 100644
--- a/src/mpi/attr/type_set_attr.c
+++ b/src/mpi/attr/type_set_attr.c
@@ -42,7 +42,7 @@ int MPIR_TypeSetAttr(MPI_Datatype datatype, int type_keyval, void *attribute_val
     
     /* The thread lock prevents a valid attr delete on the same datatype
        but in a different thread from causing problems */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_TYPE_SET_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -101,7 +101,7 @@ int MPIR_TypeSetAttr(MPI_Datatype datatype, int type_keyval, void *attribute_val
 	}
 	else if (p->keyval->handle > keyval_ptr->handle) {
 	    MPID_Attribute *new_p = MPID_Attr_alloc();
-	    MPIU_ERR_CHKANDJUMP1(!new_p,mpi_errno,MPI_ERR_OTHER,
+	    MPIR_ERR_CHKANDJUMP1(!new_p,mpi_errno,MPI_ERR_OTHER,
 				 "**nomem","**nomem %s", "MPID_Attribute" );
 	    new_p->keyval	 = keyval_ptr;
 	    new_p->attrType      = attrType;
@@ -119,7 +119,7 @@ int MPIR_TypeSetAttr(MPI_Datatype datatype, int type_keyval, void *attribute_val
     if (!p)
     {
 	MPID_Attribute *new_p = MPID_Attr_alloc();
-	MPIU_ERR_CHKANDJUMP1(!new_p,mpi_errno,MPI_ERR_OTHER,
+	MPIR_ERR_CHKANDJUMP1(!new_p,mpi_errno,MPI_ERR_OTHER,
 			     "**nomem","**nomem %s", "MPID_Attribute" );
 	/* Did not find in list.  Add at end */
 	new_p->keyval	     = keyval_ptr;
@@ -141,7 +141,7 @@ int MPIR_TypeSetAttr(MPI_Datatype datatype, int type_keyval, void *attribute_val
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_TYPE_SET_ATTR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/win_create_keyval.c b/src/mpi/attr/win_create_keyval.c
index b632701..a533189 100644
--- a/src/mpi/attr/win_create_keyval.c
+++ b/src/mpi/attr/win_create_keyval.c
@@ -81,7 +81,7 @@ int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_CREATE_KEYVAL);
 
     /* Validate parameters and objects (post conversion) */
@@ -98,7 +98,7 @@ int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn,
     /* ... body of routine ...  */
     
     keyval_ptr = (MPID_Keyval *)MPIU_Handle_obj_alloc( &MPID_Keyval_mem );
-    MPIU_ERR_CHKANDJUMP1(!keyval_ptr,mpi_errno,MPI_ERR_OTHER,"**nomem",
+    MPIR_ERR_CHKANDJUMP1(!keyval_ptr,mpi_errno,MPI_ERR_OTHER,"**nomem",
 			 "**nomem %s", "MPID_Keyval" );
     /* Initialize the attribute dup function */
     if (!MPIR_Process.attr_dup) {
@@ -124,7 +124,7 @@ int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_CREATE_KEYVAL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/win_delete_attr.c b/src/mpi/attr/win_delete_attr.c
index 199aa3f..710da70 100644
--- a/src/mpi/attr/win_delete_attr.c
+++ b/src/mpi/attr/win_delete_attr.c
@@ -62,7 +62,7 @@ int MPI_Win_delete_attr(MPI_Win win, int win_keyval)
     
     /* The thread lock prevents a valid attr delete on the same window
        but in a different thread from causing problems */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_DELETE_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -144,7 +144,7 @@ int MPI_Win_delete_attr(MPI_Win win, int win_keyval)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_DELETE_ATTR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/attr/win_free_keyval.c b/src/mpi/attr/win_free_keyval.c
index 5c58caa..4d76a1a 100644
--- a/src/mpi/attr/win_free_keyval.c
+++ b/src/mpi/attr/win_free_keyval.c
@@ -59,7 +59,7 @@ int MPI_Win_free_keyval(int *win_keyval)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_FREE_KEYVAL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -107,7 +107,7 @@ int MPI_Win_free_keyval(int *win_keyval)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_FREE_KEYVAL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/attr/win_get_attr.c b/src/mpi/attr/win_get_attr.c
index c6cc3a2..d306f7b 100644
--- a/src/mpi/attr/win_get_attr.c
+++ b/src/mpi/attr/win_get_attr.c
@@ -28,7 +28,7 @@ int MPI_Win_get_attr(MPI_Win win, int win_keyval, void *attribute_val, int *flag
 #undef FUNCNAME
 #define FUNCNAME MPIR_WinGetAttr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_WinGetAttr( MPI_Win win, int win_keyval, void *attribute_val, 
 		     int *flag, MPIR_AttrType outAttrType )
 {
@@ -38,7 +38,7 @@ int MPIR_WinGetAttr( MPI_Win win, int win_keyval, void *attribute_val,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_WIN_GET_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -55,7 +55,7 @@ int MPIR_WinGetAttr( MPI_Win win, int win_keyval, void *attribute_val,
 	       case.  Note that this code assumes sizeof(MPIU_Pint) is
 	       a power of 2. */
 	    if ((MPIU_Pint)attribute_val & (sizeof(MPIU_Pint)-1)) {
-		MPIU_ERR_SETANDSTMT(mpi_errno,MPI_ERR_ARG,goto fn_fail,"**attrnotptr");
+		MPIR_ERR_SETANDSTMT(mpi_errno,MPI_ERR_ARG,goto fn_fail,"**attrnotptr");
 	    }
 #           endif
         }
@@ -198,7 +198,7 @@ int MPIR_WinGetAttr( MPI_Win win, int win_keyval, void *attribute_val,
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_WIN_GET_ATTR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
@@ -221,7 +221,7 @@ int MPIR_WinGetAttr( MPI_Win win, int win_keyval, void *attribute_val,
 #undef FUNCNAME
 #define FUNCNAME MPI_Win_get_attr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Win_get_attr - Get attribute cached on an MPI window object
 
diff --git a/src/mpi/attr/win_set_attr.c b/src/mpi/attr/win_set_attr.c
index 6135db4..2d66409 100644
--- a/src/mpi/attr/win_set_attr.c
+++ b/src/mpi/attr/win_set_attr.c
@@ -42,7 +42,7 @@ int MPIR_WinSetAttr( MPI_Win win, int win_keyval, void *attribute_val,
     
     /* The thread lock prevents a valid attr delete on the same window
        but in a different thread from causing problems */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_WIN_SET_ATTR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -107,7 +107,7 @@ int MPIR_WinSetAttr( MPI_Win win, int win_keyval, void *attribute_val,
 	}
 	else if (p->keyval->handle > keyval_ptr->handle) {
 	    MPID_Attribute *new_p = MPID_Attr_alloc();
-	    MPIU_ERR_CHKANDJUMP1(!new_p,mpi_errno,MPI_ERR_OTHER,
+	    MPIR_ERR_CHKANDJUMP1(!new_p,mpi_errno,MPI_ERR_OTHER,
 				 "**nomem", "**nomem %s", "MPID_Attribute" );
 	    new_p->keyval	 = keyval_ptr;
 	    new_p->attrType      = attrType;
@@ -125,7 +125,7 @@ int MPIR_WinSetAttr( MPI_Win win, int win_keyval, void *attribute_val,
     if (!p)
     {
 	MPID_Attribute *new_p = MPID_Attr_alloc();
-	MPIU_ERR_CHKANDJUMP1(!new_p,mpi_errno,MPI_ERR_OTHER,
+	MPIR_ERR_CHKANDJUMP1(!new_p,mpi_errno,MPI_ERR_OTHER,
 			     "**nomem", "**nomem %s", "MPID_Attribute" );
 	/* Did not find in list.  Add at end */
 	new_p->attrType      = attrType;
@@ -147,7 +147,7 @@ int MPIR_WinSetAttr( MPI_Win win, int win_keyval, void *attribute_val,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_WIN_SET_ATTR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,); 
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex); 
     return mpi_errno;
 
   fn_fail:
@@ -168,7 +168,7 @@ int MPIR_WinSetAttr( MPI_Win win, int win_keyval, void *attribute_val,
 #undef FUNCNAME
 #define FUNCNAME MPI_Win_set_attr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
    MPI_Win_set_attr - Stores attribute value associated with a key
diff --git a/src/mpi/coll/allgather.c b/src/mpi/coll/allgather.c
index 877ccfa..bcd1c69 100644
--- a/src/mpi/coll/allgather.c
+++ b/src/mpi/coll/allgather.c
@@ -108,7 +108,7 @@ int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, voi
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allgather_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allgather_intra ( 
     const void *sendbuf,
     int sendcount,
@@ -174,7 +174,7 @@ int MPIR_Allgather_intra (
                                              rank*recvcount*recvtype_extent), 
                                             recvcount, recvtype);
 		if (mpi_errno) { 
-		    MPIU_ERR_POP(mpi_errno);
+		    MPIR_ERR_POP(mpi_errno);
 		}
             }
             
@@ -211,8 +211,8 @@ int MPIR_Allgather_intra (
 		    if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         last_recv_cnt = 0;
 		    } else
                         MPIR_Get_count_impl(&status, recvtype, &last_recv_cnt);
@@ -276,8 +276,8 @@ int MPIR_Allgather_intra (
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                             }
                         }
                         /* recv only if this proc. doesn't have data and sender
@@ -295,8 +295,8 @@ int MPIR_Allgather_intra (
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                                 last_recv_cnt = 0;
                             } else
                                 MPIR_Get_count_impl(&status, recvtype, &last_recv_cnt);
@@ -338,13 +338,13 @@ int MPIR_Allgather_intra (
             if (sendbuf != MPI_IN_PLACE) {
                 mpi_errno = MPIR_Pack_impl(sendbuf, sendcount, sendtype, tmp_buf, tmp_buf_size,
                                            &position);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             else {
                 /* if in_place specified, local data is found in recvbuf */
                 mpi_errno = MPIR_Pack_impl(((char *)recvbuf + recvtype_extent*rank), recvcount,
                                            recvtype, tmp_buf, tmp_buf_size, &position);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             
             curr_cnt = nbytes;
@@ -379,8 +379,8 @@ int MPIR_Allgather_intra (
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         last_recv_cnt = 0;
                     } else
                         MPIR_Get_count_impl(&status, MPI_BYTE, &last_recv_cnt);
@@ -434,8 +434,8 @@ int MPIR_Allgather_intra (
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                             }
                             /* last_recv_cnt was set in the previous
                                receive. that's the amount of data to be
@@ -456,8 +456,8 @@ int MPIR_Allgather_intra (
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                                 last_recv_cnt = 0;
                             } else
                                 MPIR_Get_count_impl(&status, MPI_BYTE, &last_recv_cnt);
@@ -474,7 +474,7 @@ int MPIR_Allgather_intra (
             position = 0;
             mpi_errno = MPIR_Unpack_impl(tmp_buf, tmp_buf_size, &position, recvbuf,
                                          recvcount*comm_size, recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 #endif /* MPID_HAS_HETERO */
     }
@@ -501,7 +501,7 @@ int MPIR_Allgather_intra (
             mpi_errno = MPIR_Localcopy (sendbuf, sendcount, sendtype,
                                         tmp_buf, recvcount, recvtype);
 	    if (mpi_errno) { 
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
         }
         else {
@@ -510,7 +510,7 @@ int MPIR_Allgather_intra (
                                         recvcount, recvtype, tmp_buf, 
                                         recvcount, recvtype);
 	    if (mpi_errno) { 
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
         }
         
@@ -531,8 +531,8 @@ int MPIR_Allgather_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             curr_cnt *= 2;
             pof2 *= 2;
@@ -554,8 +554,8 @@ int MPIR_Allgather_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
 
@@ -566,7 +566,7 @@ int MPIR_Allgather_intra (
                   recvtype, (char *) recvbuf + rank*recvcount*recvtype_extent, 
                                        (comm_size-rank)*recvcount, recvtype);
 	if (mpi_errno) { 
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
 
         if (rank) {
@@ -575,7 +575,7 @@ int MPIR_Allgather_intra (
                                        rank*recvcount, recvtype, recvbuf,
                                        rank*recvcount, recvtype);
 	    if (mpi_errno) { 
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
         }
     }
@@ -590,7 +590,7 @@ int MPIR_Allgather_intra (
                                         rank*recvcount*recvtype_extent),  
                                        recvcount, recvtype);
 	    if (mpi_errno) { 
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
         }
         
@@ -616,8 +616,8 @@ int MPIR_Allgather_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             j	    = jnext;
             jnext = (comm_size + jnext - 1) % comm_size;
@@ -631,7 +631,7 @@ int MPIR_Allgather_intra (
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
 
     return mpi_errno;
 
@@ -643,7 +643,7 @@ int MPIR_Allgather_intra (
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allgather_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /* not declared static because a machine-specific function may call this one 
    in some cases */
@@ -701,8 +701,8 @@ int MPIR_Allgather_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -717,8 +717,8 @@ int MPIR_Allgather_inter (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
 
@@ -730,8 +730,8 @@ int MPIR_Allgather_inter (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -744,8 +744,8 @@ int MPIR_Allgather_inter (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
 
@@ -757,8 +757,8 @@ int MPIR_Allgather_inter (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -768,7 +768,7 @@ int MPIR_Allgather_inter (
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
 
     return mpi_errno;
 
@@ -784,7 +784,7 @@ int MPIR_Allgather_inter (
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allgather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                    void *recvbuf, int recvcount, MPI_Datatype recvtype,
                    MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -796,13 +796,13 @@ int MPIR_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
         mpi_errno = MPIR_Allgather_intra(sendbuf, sendcount, sendtype,
                                          recvbuf, recvcount, recvtype,
                                          comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         /* intercommunicator */
         mpi_errno = MPIR_Allgather_inter(sendbuf, sendcount, sendtype,
                                          recvbuf, recvcount, recvtype,
                                          comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -818,7 +818,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allgather_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                         void *recvbuf, int recvcount, MPI_Datatype recvtype,
                         MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -831,13 +831,13 @@ int MPIR_Allgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
 	mpi_errno = comm_ptr->coll_fns->Allgather(sendbuf, sendcount, sendtype,
                                                   recvbuf, recvcount, recvtype,
                                                   comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Allgather(sendbuf, sendcount, sendtype,
                                    recvbuf, recvcount, recvtype,
                                    comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -852,7 +852,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Allgather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Allgather - Gathers data from all tasks and distribute the combined
     data to all tasks
@@ -907,7 +907,7 @@ int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLGATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -989,7 +989,7 @@ int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLGATHER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/allgatherv.c b/src/mpi/coll/allgatherv.c
index 3cefcbe..bc976b8 100644
--- a/src/mpi/coll/allgatherv.c
+++ b/src/mpi/coll/allgatherv.c
@@ -88,7 +88,7 @@ int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, vo
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allgatherv_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allgatherv_intra ( 
     const void *sendbuf,
     int sendcount,
@@ -165,7 +165,7 @@ int MPIR_Allgatherv_intra (
                                            ((char *)tmp_buf + position*
                                             recvtype_extent), 
                                            recvcounts[rank], recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    }
             else
 	    {
@@ -176,7 +176,7 @@ int MPIR_Allgatherv_intra (
                                            ((char *)tmp_buf + position*
                                             recvtype_extent), 
                                            recvcounts[rank], recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    }
 
             curr_cnt = recvcounts[rank];
@@ -216,8 +216,8 @@ int MPIR_Allgatherv_intra (
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         last_recv_cnt = 0;
                     } else
                         /* for convenience, recv is posted for a bigger amount
@@ -284,8 +284,8 @@ int MPIR_Allgatherv_intra (
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                             }
                             /* last_recv_cnt was set in the previous
                                receive. that's the amount of data to be
@@ -308,8 +308,8 @@ int MPIR_Allgatherv_intra (
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                                 last_recv_cnt = 0;
                             } else
                                 /* for convenience, recv is posted for a
@@ -337,7 +337,7 @@ int MPIR_Allgatherv_intra (
                                                recvcounts[j], recvtype,
                                                ((char *)recvbuf + displs[j]*recvtype_extent),
                                                recvcounts[j], recvtype);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 position += recvcounts[j];
             }
@@ -358,7 +358,7 @@ int MPIR_Allgatherv_intra (
             position = 0;
             mpi_errno = MPIR_Pack_impl(recvbuf, 1, recvtype, tmp_buf, tmp_buf_size,
                                        &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             nbytes = position;
             
             /* pack local data into right location in tmp_buf */
@@ -369,14 +369,14 @@ int MPIR_Allgatherv_intra (
             if (sendbuf != MPI_IN_PLACE) {
                 mpi_errno = MPIR_Pack_impl(sendbuf, sendcount, sendtype, tmp_buf,
                                            tmp_buf_size, &position);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             else {
                 /* if in_place specified, local data is found in recvbuf */ 
                 mpi_errno = MPIR_Pack_impl(((char *)recvbuf + displs[rank]*recvtype_extent),
                                            recvcounts[rank], recvtype, tmp_buf,
                                            tmp_buf_size, &position);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             
             curr_cnt = recvcounts[rank]*nbytes;
@@ -417,8 +417,8 @@ int MPIR_Allgatherv_intra (
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         last_recv_cnt = 0;
                     } else
                         /* for convenience, recv is posted for a bigger amount
@@ -477,8 +477,8 @@ int MPIR_Allgatherv_intra (
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                             }
                             /* last_recv_cnt was set in the previous
                                receive. that's the amount of data to be
@@ -497,8 +497,8 @@ int MPIR_Allgatherv_intra (
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                                 last_recv_cnt = 0;
                             } else
                                 /* for convenience, recv is posted for a bigger amount
@@ -522,7 +522,7 @@ int MPIR_Allgatherv_intra (
                     mpi_errno = MPIR_Unpack_impl(tmp_buf, tmp_buf_size, &position,
                                                  ((char *)recvbuf + displs[j]*recvtype_extent),
                                                  recvcounts[j], recvtype);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -553,14 +553,14 @@ int MPIR_Allgatherv_intra (
         if (sendbuf != MPI_IN_PLACE) {
             mpi_errno = MPIR_Localcopy (sendbuf, sendcount, sendtype,
                                         tmp_buf, recvcounts[rank], recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             mpi_errno = MPIR_Localcopy(((char *)recvbuf +
                                         displs[rank]*recvtype_extent), 
                                        recvcounts[rank], recvtype,
                                        tmp_buf, recvcounts[rank], recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         
         /* do the first \floor(\lg p) steps */
@@ -579,8 +579,8 @@ int MPIR_Allgatherv_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 recv_cnt = 0;
             } else
                 MPIR_Get_count_impl(&status, recvtype, &recv_cnt);
@@ -609,8 +609,8 @@ int MPIR_Allgatherv_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
 
@@ -624,7 +624,7 @@ int MPIR_Allgatherv_intra (
                                        recvcounts[j], recvtype, 
                                   (char *)recvbuf + displs[j]*recvtype_extent, 
                                        recvcounts[j], recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             send_cnt += recvcounts[j];
         }
 
@@ -633,7 +633,7 @@ int MPIR_Allgatherv_intra (
                                        recvcounts[i], recvtype, 
                                   (char *)recvbuf + displs[i]*recvtype_extent, 
                                        recvcounts[i], recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             send_cnt += recvcounts[i];
         }
     }
@@ -651,7 +651,7 @@ int MPIR_Allgatherv_intra (
             mpi_errno = MPIR_Localcopy(sendbuf, sendcount, sendtype, 
 				       ((char *)recvbuf + displs[rank]*recvtype_extent),
                                        recvcounts[rank], recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         left  = (comm_size + rank - 1) % comm_size;
@@ -697,8 +697,8 @@ int MPIR_Allgatherv_intra (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
 		torecv -= recvnow;
 	    }
@@ -707,8 +707,8 @@ int MPIR_Allgatherv_intra (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
 		tosend -= sendnow;
 	    }
@@ -719,8 +719,8 @@ int MPIR_Allgatherv_intra (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
 		tosend -= sendnow;
 		torecv -= recvnow;
@@ -746,7 +746,7 @@ int MPIR_Allgatherv_intra (
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
 
     return mpi_errno;
  fn_fail:
@@ -759,7 +759,7 @@ int MPIR_Allgatherv_intra (
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allgatherv_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allgatherv_inter ( 
     const void *sendbuf,
     int sendcount,
@@ -798,8 +798,8 @@ int MPIR_Allgatherv_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
         /* gatherv to right group */
         root = 0;
@@ -809,8 +809,8 @@ int MPIR_Allgatherv_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     else {
@@ -822,8 +822,8 @@ int MPIR_Allgatherv_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
         /* gatherv from left group */
         root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
@@ -833,8 +833,8 @@ int MPIR_Allgatherv_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -844,23 +844,23 @@ int MPIR_Allgatherv_inter (
     /* Get the local intracommunicator */
     if (!comm_ptr->local_comm) {
 	mpi_errno = MPIR_Setup_intercomm_localcomm( comm_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     newcomm_ptr = comm_ptr->local_comm;
 
     mpi_errno = MPIR_Type_indexed_impl(remote_size, recvcounts, displs, recvtype, &newtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     mpi_errno = MPIR_Type_commit_impl(&newtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIR_Bcast_intra(recvbuf, 1, newtype, 0, newcomm_ptr, errflag);
     if (mpi_errno) {
         /* for communication errors, just record the error but continue */
         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
     }
 
     MPIR_Type_free_impl(&newtype);
@@ -869,7 +869,7 @@ int MPIR_Allgatherv_inter (
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
     return mpi_errno;
  fn_fail:
@@ -889,7 +889,7 @@ int MPIR_Allgatherv_inter (
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allgatherv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                     void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype,
                     MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -901,13 +901,13 @@ int MPIR_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
         mpi_errno = MPIR_Allgatherv_intra(sendbuf, sendcount, sendtype,
                                           recvbuf, recvcounts, displs, recvtype,
                                           comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         /* intracommunicator */
         mpi_errno = MPIR_Allgatherv_inter(sendbuf, sendcount, sendtype,
                                           recvbuf, recvcounts, displs, recvtype,
                                           comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -925,7 +925,7 @@ int MPIR_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allgatherv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allgatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                          void *recvbuf, const int *recvcounts, const int *displs,
                          MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -936,12 +936,12 @@ int MPIR_Allgatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendty
 	/* --BEGIN USEREXTENSION-- */
 	mpi_errno = comm_ptr->coll_fns->Allgatherv(sendbuf, sendcount, sendtype,
                                                    recvbuf, recvcounts, displs, recvtype, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Allgatherv(sendbuf, sendcount, sendtype,
                                     recvbuf, recvcounts, displs, recvtype, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -958,7 +958,7 @@ int MPIR_Allgatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendty
 #undef FUNCNAME
 #define FUNCNAME MPI_Allgatherv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Allgatherv - Gathers data from all tasks and deliver the combined data
@@ -1018,7 +1018,7 @@ int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLGATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1111,7 +1111,7 @@ int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLGATHERV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/allred_group.c b/src/mpi/coll/allred_group.c
index 18cd2bc..7a6d279 100644
--- a/src/mpi/coll/allred_group.c
+++ b/src/mpi/coll/allred_group.c
@@ -17,14 +17,14 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
     do {                                                                                                      \
         int gr_tmp_ = (gr_);                                                                                  \
         mpi_errno = MPIR_Group_translate_ranks_impl(group_ptr, 1, &(gr_tmp_), comm_ptr->local_group, &(cr_)); \
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);                                                               \
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);                                                               \
         MPIU_Assert((cr_) != MPI_UNDEFINED);                                                                  \
     } while (0)
 
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allreduce_group_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
                                MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
                                MPID_Group *group_ptr, int tag, MPIR_Errflag_t *errflag)
@@ -50,7 +50,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
 
     group_rank = group_ptr->rank;
     group_size = group_ptr->size;
-    MPIU_ERR_CHKANDJUMP(group_rank == MPI_UNDEFINED, mpi_errno, MPI_ERR_OTHER, "**rank");
+    MPIR_ERR_CHKANDJUMP(group_rank == MPI_UNDEFINED, mpi_errno, MPI_ERR_OTHER, "**rank");
 
     is_commutative = MPIR_Op_is_commutative(op);
 
@@ -68,7 +68,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
     if (sendbuf != MPI_IN_PLACE) {
         mpi_errno = MPIR_Localcopy(sendbuf, count, datatype, recvbuf,
                                    count, datatype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPID_Datatype_get_size_macro(datatype, type_size);
@@ -95,8 +95,8 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
 
             /* temporarily set the rank to -1 so that this
@@ -113,15 +113,15 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
 
             /* do the reduction on received data. since the
                ordering is right, it doesn't matter whether
                the operation is commutative or not. */
             mpi_errno = MPIR_Reduce_local_impl(tmp_buf, recvbuf, count, datatype, op);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             /* change the rank */
             newrank = group_rank / 2;
@@ -162,8 +162,8 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 } else {
 
                     /* tmp_buf contains data received in this step.
@@ -172,17 +172,17 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
                     if (is_commutative  || (dst < group_rank)) {
                         /* op is commutative OR the order is already right */
                         mpi_errno = MPIR_Reduce_local_impl(tmp_buf, recvbuf, count, datatype, op);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                     else {
                         /* op is noncommutative and the order is not right */
                         mpi_errno = MPIR_Reduce_local_impl(recvbuf, tmp_buf, count, datatype, op);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                         /* copy result back into recvbuf */
                         mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype,
                                 recvbuf, count, datatype);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
                 mask <<= 1;
@@ -246,8 +246,8 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
 
                 /* tmp_buf contains data received in this step.
@@ -258,7 +258,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
                 mpi_errno = MPIR_Reduce_local_impl(((char *) tmp_buf + disps[recv_idx]*extent),
                                                    ((char *) recvbuf + disps[recv_idx]*extent),
                                                    recv_cnt, datatype, op);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 /* update send_idx for next iteration */
                 send_idx = recv_idx;
@@ -312,8 +312,8 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
 
                 if (newrank > newdst) send_idx = recv_idx;
@@ -343,8 +343,8 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -353,7 +353,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return (mpi_errno);
 
   fn_fail:
@@ -363,18 +363,18 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allreduce_group
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allreduce_group(void *sendbuf, void *recvbuf, int count,
                          MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
                          MPID_Group *group_ptr, int tag, MPIR_Errflag_t *errflag)
 {
     int mpi_errno = MPI_SUCCESS;
 
-    MPIU_ERR_CHKANDJUMP(comm_ptr->comm_kind != MPID_INTRACOMM, mpi_errno, MPI_ERR_OTHER, "**commnotintra");
+    MPIR_ERR_CHKANDJUMP(comm_ptr->comm_kind != MPID_INTRACOMM, mpi_errno, MPI_ERR_OTHER, "**commnotintra");
 
     mpi_errno = MPIR_Allreduce_group_intra(sendbuf, recvbuf, count, datatype,
                                            op, comm_ptr, group_ptr, tag, errflag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     fn_exit:
         return mpi_errno;
diff --git a/src/mpi/coll/allreduce.c b/src/mpi/coll/allreduce.c
index 75dab4b..c6cdf94 100644
--- a/src/mpi/coll/allreduce.c
+++ b/src/mpi/coll/allreduce.c
@@ -147,7 +147,7 @@ MPIR_Op_check_dtype_fn *MPIR_Op_check_dtype_table[] = {
 #undef FUNCNAME
 #define FUNCNAME allreduce_intra_or_coll_fn
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int allreduce_intra_or_coll_fn(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
                                              MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
@@ -156,11 +156,11 @@ static inline int allreduce_intra_or_coll_fn(void *sendbuf, void *recvbuf, int c
     if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Allreduce != NULL) {
 	/* --BEGIN USEREXTENSION-- */
 	mpi_errno = comm_ptr->coll_fns->Allreduce(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Allreduce_intra(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
         
  fn_exit:
@@ -175,7 +175,7 @@ static inline int allreduce_intra_or_coll_fn(void *sendbuf, void *recvbuf, int c
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allreduce_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allreduce_intra ( 
     const void *sendbuf,
     void *recvbuf, 
@@ -227,23 +227,23 @@ int MPIR_Allreduce_intra (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             } else {
                 mpi_errno = MPIR_Reduce_impl(sendbuf, recvbuf, count, datatype, op, 0, comm_ptr->node_comm, errflag);
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             }
         } else {
             /* only one process on the node. copy sendbuf to recvbuf */
             if (sendbuf != MPI_IN_PLACE) {
                 mpi_errno = MPIR_Localcopy(sendbuf, count, datatype, recvbuf, count, datatype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         }
 
@@ -254,8 +254,8 @@ int MPIR_Allreduce_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
 
@@ -265,8 +265,8 @@ int MPIR_Allreduce_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
         goto fn_exit;
@@ -289,16 +289,16 @@ int MPIR_Allreduce_intra (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
 
         mpi_errno = MPIR_Bcast_impl( recvbuf, count, datatype, 0, comm_ptr, errflag );
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     else 
@@ -325,7 +325,7 @@ int MPIR_Allreduce_intra (
         if (sendbuf != MPI_IN_PLACE) {
             mpi_errno = MPIR_Localcopy(sendbuf, count, datatype, recvbuf,
                                        count, datatype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         MPID_Datatype_get_size_macro(datatype, type_size);
@@ -351,8 +351,8 @@ int MPIR_Allreduce_intra (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 
                 /* temporarily set the rank to -1 so that this
@@ -368,15 +368,15 @@ int MPIR_Allreduce_intra (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
 
                 /* do the reduction on received data. since the
                    ordering is right, it doesn't matter whether
                    the operation is commutative or not. */
                 mpi_errno = MPIR_Reduce_local_impl(tmp_buf, recvbuf, count, datatype, op);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 /* change the rank */
                 newrank = rank / 2;
@@ -414,8 +414,8 @@ int MPIR_Allreduce_intra (
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                     
                     /* tmp_buf contains data received in this step.
@@ -424,17 +424,17 @@ int MPIR_Allreduce_intra (
                     if (is_commutative  || (dst < rank)) {
                         /* op is commutative OR the order is already right */
                         mpi_errno = MPIR_Reduce_local_impl(tmp_buf, recvbuf, count, datatype, op);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                     else {
                         /* op is noncommutative and the order is not right */
                         mpi_errno = MPIR_Reduce_local_impl(recvbuf, tmp_buf, count, datatype, op);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                         /* copy result back into recvbuf */
                         mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype,
                                                    recvbuf, count, datatype);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                     mask <<= 1;
                 }
@@ -499,8 +499,8 @@ int MPIR_Allreduce_intra (
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                     
                     /* tmp_buf contains data received in this step.
@@ -511,7 +511,7 @@ int MPIR_Allreduce_intra (
                     mpi_errno = MPIR_Reduce_local_impl(((char *) tmp_buf + disps[recv_idx]*extent),
                                                        ((char *) recvbuf + disps[recv_idx]*extent),
                                                        recv_cnt, datatype, op);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                     /* update send_idx for next iteration */
                     send_idx = recv_idx;
@@ -564,8 +564,8 @@ int MPIR_Allreduce_intra (
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
 
                     if (newrank > newdst) send_idx = recv_idx;
@@ -591,8 +591,8 @@ int MPIR_Allreduce_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -616,7 +616,7 @@ int MPIR_Allreduce_intra (
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allreduce_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allreduce_inter ( 
     const void *sendbuf,
     void *recvbuf, 
@@ -664,8 +664,8 @@ int MPIR_Allreduce_inter (
     if (mpi_errno) {
         /* for communication errors, just record the error but continue */
         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
     }
 
     /* Do a exchange between local and remote rank 0 on this intercommunicator */
@@ -676,8 +676,8 @@ int MPIR_Allreduce_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -687,8 +687,8 @@ int MPIR_Allreduce_inter (
     if (mpi_errno) {
         /* for communication errors, just record the error but continue */
         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
     }
 
   fn_exit:
@@ -697,7 +697,7 @@ int MPIR_Allreduce_inter (
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
 
     return mpi_errno;
 
@@ -712,7 +712,7 @@ int MPIR_Allreduce_inter (
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allreduce
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
                    MPI_Op op, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
@@ -721,12 +721,12 @@ int MPIR_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype d
     if (comm_ptr->comm_kind == MPID_INTRACOMM) {
         /* intracommunicator */
         mpi_errno = MPIR_Allreduce_intra(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* intercommunicator */
         mpi_errno = MPIR_Allreduce_inter(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -743,7 +743,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Allreduce_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Allreduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
                         MPIR_Errflag_t *errflag)
 {
@@ -753,7 +753,7 @@ int MPIR_Allreduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datat
     {
 	/* --BEGIN USEREXTENSION-- */
 	mpi_errno = comm_ptr->coll_fns->Allreduce(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     }
     else
@@ -761,12 +761,12 @@ int MPIR_Allreduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datat
         if (comm_ptr->comm_kind == MPID_INTRACOMM) {
             /* intracommunicator */
             mpi_errno = MPIR_Allreduce_intra(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	}
         else {
             /* intercommunicator */
             mpi_errno = MPIR_Allreduce_inter(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -821,7 +821,7 @@ int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLREDUCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -896,7 +896,7 @@ int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLREDUCE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/alltoall.c b/src/mpi/coll/alltoall.c
index a495944..657acf5 100644
--- a/src/mpi/coll/alltoall.c
+++ b/src/mpi/coll/alltoall.c
@@ -126,7 +126,7 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoall_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoall_intra( 
     const void *sendbuf,
     int sendcount, 
@@ -189,8 +189,8 @@ int MPIR_Alltoall_intra(
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
                 else if (rank == j) {
@@ -203,8 +203,8 @@ int MPIR_Alltoall_intra(
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
             }
@@ -225,12 +225,12 @@ int MPIR_Alltoall_intra(
 			   rank*sendcount*sendtype_extent, 
                            (comm_size - rank)*sendcount, sendtype, recvbuf, 
                            (comm_size - rank)*recvcount, recvtype);
-	if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
         mpi_errno = MPIR_Localcopy(sendbuf, rank*sendcount, sendtype, 
                         (char *) recvbuf + 
 				   (comm_size-rank)*recvcount*recvtype_extent, 
                                    rank*recvcount, recvtype);
-	if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
         /* Input data is now stored in recvbuf with datatype recvtype */
 
         /* Now do Phase 2, the communication phase. It takes
@@ -261,14 +261,14 @@ int MPIR_Alltoall_intra(
 
             mpi_errno = MPIR_Type_create_indexed_block_impl(count, recvcount,
                                                             displs, recvtype, &newtype);
-	    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+	    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             mpi_errno = MPIR_Type_commit_impl(&newtype);
-	    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+	    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             position = 0;
             mpi_errno = MPIR_Pack_impl(recvbuf, 1, newtype, tmp_buf, pack_size, &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             mpi_errno = MPIC_Sendrecv(tmp_buf, position, MPI_PACKED, dst,
                                          MPIR_ALLTOALL_TAG, recvbuf, 1, newtype,
@@ -277,8 +277,8 @@ int MPIR_Alltoall_intra(
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
 
             MPIR_Type_free_impl(&newtype);
@@ -301,11 +301,11 @@ int MPIR_Alltoall_intra(
         mpi_errno = MPIR_Localcopy((char *) recvbuf + (rank+1)*recvcount*recvtype_extent, 
                        (comm_size - rank - 1)*recvcount, recvtype, tmp_buf, 
                        (comm_size - rank - 1)*recvcount, recvtype);
-	if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
         mpi_errno = MPIR_Localcopy(recvbuf, (rank+1)*recvcount, recvtype, 
                        (char *) tmp_buf + (comm_size-rank-1)*recvcount*recvtype_extent, 
                        (rank+1)*recvcount, recvtype);
-	if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 
         /* Blocks are in the reverse order now (comm_size-1 to 0). 
          * Reorder them to (0 to comm_size-1) and store them in recvbuf. */
@@ -315,7 +315,7 @@ int MPIR_Alltoall_intra(
                                        recvcount, recvtype, 
                                        (char *) recvbuf + (comm_size-i-1)*recvcount*recvtype_extent, 
                                        recvcount, recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -352,7 +352,7 @@ int MPIR_Alltoall_intra(
                                           recvcount, recvtype, dst,
                                           MPIR_ALLTOALL_TAG, comm_ptr,
                                           &reqarray[i]);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
 
             for ( i=0; i<ss; i++ ) { 
@@ -362,12 +362,12 @@ int MPIR_Alltoall_intra(
                                           sendcount, sendtype, dst,
                                           MPIR_ALLTOALL_TAG, comm_ptr,
                                           &reqarray[i+ss], errflag);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
   
             /* ... then wait for them to finish: */
             mpi_errno = MPIC_Waitall(2*ss,reqarray,starray, errflag);
-            if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS) MPIR_ERR_POP(mpi_errno);
             
             /* --BEGIN ERROR HANDLING-- */
             if (mpi_errno == MPI_ERR_IN_STATUS) {
@@ -377,8 +377,8 @@ int MPIR_Alltoall_intra(
                         if (mpi_errno) {
                             /* for communication errors, just record the error but continue */
                             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         }
                     }
                 }
@@ -399,7 +399,7 @@ int MPIR_Alltoall_intra(
                                    ((char *)recvbuf +
                                     rank*recvcount*recvtype_extent),
                                    recvcount, recvtype);
-	if (mpi_errno) { MPIU_ERR_POP(mpi_errno ); }
+	if (mpi_errno) { MPIR_ERR_POP(mpi_errno ); }
 
         /* Is comm_size a power-of-two? */
         i = 1;
@@ -432,8 +432,8 @@ int MPIR_Alltoall_intra(
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -445,7 +445,7 @@ int MPIR_Alltoall_intra(
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
 
     return mpi_errno;
  fn_fail:
@@ -460,7 +460,7 @@ int MPIR_Alltoall_intra(
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoall_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoall_inter( 
     const void *sendbuf,
     int sendcount, 
@@ -530,8 +530,8 @@ int MPIR_Alltoall_inter(
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -541,7 +541,7 @@ int MPIR_Alltoall_inter(
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
 
     return mpi_errno;
  fn_fail:
@@ -552,7 +552,7 @@ int MPIR_Alltoall_inter(
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoall
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                   void *recvbuf, int recvcount, MPI_Datatype recvtype,
                   MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -564,13 +564,13 @@ int MPIR_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
         mpi_errno = MPIR_Alltoall_intra(sendbuf, sendcount, sendtype,
                                         recvbuf, recvcount, recvtype,
                                         comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         /* intercommunicator */
         mpi_errno = MPIR_Alltoall_inter(sendbuf, sendcount, sendtype,
                                         recvbuf, recvcount, recvtype,
                                         comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -582,7 +582,7 @@ int MPIR_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoall_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoall_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                        void *recvbuf, int recvcount, MPI_Datatype recvtype,
                        MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -593,13 +593,13 @@ int MPIR_Alltoall_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype
 	mpi_errno = comm_ptr->coll_fns->Alltoall(sendbuf, sendcount, sendtype,
                                                  recvbuf, recvcount, recvtype,
                                                  comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Alltoall(sendbuf, sendcount, sendtype,
                                   recvbuf, recvcount, recvtype,
                                   comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
  fn_exit:
@@ -614,7 +614,7 @@ int MPIR_Alltoall_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype
 #undef FUNCNAME
 #define FUNCNAME MPI_Alltoall
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Alltoall - Sends data from all to all processes
 
@@ -650,7 +650,7 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLTOALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -726,7 +726,7 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLTOALL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/alltoallv.c b/src/mpi/coll/alltoallv.c
index 9c6b8d9..4fec383 100644
--- a/src/mpi/coll/alltoallv.c
+++ b/src/mpi/coll/alltoallv.c
@@ -59,7 +59,7 @@ int MPI_Alltoallv(const void *sendbuf, const int *sendcounts, const int *sdispls
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoallv_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *sdispls,
                          MPI_Datatype sendtype, void *recvbuf, const int *recvcounts,
                          const int *rdispls, MPI_Datatype recvtype, MPID_Comm *comm_ptr,
@@ -110,8 +110,8 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
 
                 }
@@ -125,8 +125,8 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
             }
@@ -161,8 +161,8 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
                         if (mpi_errno) {
                             /* for communication errors, just record the error but continue */
                             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         }
                         req_cnt++;
                     }
@@ -183,8 +183,8 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
                         if (mpi_errno) {
                             /* for communication errors, just record the error but continue */
                             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         }
                         req_cnt++;
                     }
@@ -192,7 +192,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
             }
 
             mpi_errno = MPIC_Waitall(req_cnt, reqarray, starray, errflag);
-            if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS) MPIR_ERR_POP(mpi_errno);
 
             /* --BEGIN ERROR HANDLING-- */
             if (mpi_errno == MPI_ERR_IN_STATUS) {
@@ -202,8 +202,8 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
                         if (mpi_errno) {
                             /* for communication errors, just record the error but continue */
                             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         }
                     }
                 }
@@ -220,7 +220,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
 
     return mpi_errno;
 
@@ -234,7 +234,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoallv_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *sdispls,
                          MPI_Datatype sendtype, void *recvbuf, const int *recvcounts,
                          const int *rdispls, MPI_Datatype recvtype, MPID_Comm *comm_ptr,
@@ -306,8 +306,8 @@ int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -317,7 +317,7 @@ int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
@@ -327,7 +327,7 @@ int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoallv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoallv(const void *sendbuf, const int *sendcounts, const int *sdispls,
                    MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *rdispls,
                    MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -339,13 +339,13 @@ int MPIR_Alltoallv(const void *sendbuf, const int *sendcounts, const int *sdispl
         mpi_errno = MPIR_Alltoallv_intra(sendbuf, sendcounts, sdispls,
                                          sendtype, recvbuf, recvcounts,
                                          rdispls, recvtype, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         /* intercommunicator */
         mpi_errno = MPIR_Alltoallv_inter(sendbuf, sendcounts, sdispls,
                                          sendtype, recvbuf, recvcounts,
                                          rdispls, recvtype, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -357,7 +357,7 @@ int MPIR_Alltoallv(const void *sendbuf, const int *sendcounts, const int *sdispl
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoallv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoallv_impl(const void *sendbuf, const int *sendcounts, const int *sdispls,
                         MPI_Datatype sendtype, void *recvbuf, const int *recvcounts,
                         const int *rdispls, MPI_Datatype recvtype,
@@ -370,13 +370,13 @@ int MPIR_Alltoallv_impl(const void *sendbuf, const int *sendcounts, const int *s
 	mpi_errno = comm_ptr->coll_fns->Alltoallv(sendbuf, sendcounts, sdispls,
                                                  sendtype, recvbuf, recvcounts,
                                                  rdispls, recvtype, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Alltoallv(sendbuf, sendcounts, sdispls,
                                    sendtype, recvbuf, recvcounts,
                                    rdispls, recvtype, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -393,7 +393,7 @@ int MPIR_Alltoallv_impl(const void *sendbuf, const int *sendcounts, const int *s
 #undef FUNCNAME
 #define FUNCNAME MPI_Alltoallv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Alltoallv - Sends data from all to all processes; each process may 
    send a different amount of data and provide displacements for the input
@@ -441,7 +441,7 @@ int MPI_Alltoallv(const void *sendbuf, const int *sendcounts,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLTOALLV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -479,7 +479,7 @@ int MPI_Alltoallv(const void *sendbuf, const int *sendcounts,
                 comm_size = comm_ptr->remote_size;
 
             if (comm_ptr->comm_kind == MPID_INTERCOMM && sendbuf == MPI_IN_PLACE) {
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sendbuf_inplace");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sendbuf_inplace");
             }
 
             for (i=0; i<comm_size; i++) {
@@ -533,7 +533,7 @@ int MPI_Alltoallv(const void *sendbuf, const int *sendcounts,
 
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLTOALLV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/alltoallw.c b/src/mpi/coll/alltoallw.c
index a9f551c..0335f85 100644
--- a/src/mpi/coll/alltoallw.c
+++ b/src/mpi/coll/alltoallw.c
@@ -53,7 +53,7 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoallw_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int sdispls[],
                          const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
                          const int rdispls[], const MPI_Datatype recvtypes[], MPID_Comm *comm_ptr,
@@ -100,8 +100,8 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
                 else if (rank == j) {
@@ -114,8 +114,8 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
             }
@@ -143,7 +143,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
                                                   recvcounts[dst], recvtypes[dst], dst,
                                                   MPIR_ALLTOALLW_TAG, comm_ptr,
                                                   &reqarray[outstanding_requests]);
-                        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                        if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 
                         outstanding_requests++;
                     }
@@ -159,7 +159,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
                                                   sendcounts[dst], sendtypes[dst], dst,
                                                   MPIR_ALLTOALLW_TAG, comm_ptr,
                                                   &reqarray[outstanding_requests], errflag);
-                        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                        if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 
                         outstanding_requests++;
                     }
@@ -167,7 +167,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
             }
 
             mpi_errno = MPIC_Waitall(outstanding_requests, reqarray, starray, errflag);
-            if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS) MPIR_ERR_POP(mpi_errno);
             
             /* --BEGIN ERROR HANDLING-- */
             if (mpi_errno == MPI_ERR_IN_STATUS) {
@@ -177,8 +177,8 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
                         if (mpi_errno) {
                             /* for communication errors, just record the error but continue */
                             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         }
                     }
                 }
@@ -194,7 +194,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
                                    sendcounts[rank], sendtypes[rank],
                                    ((char *)recvbuf+rdispls[rank]), 
                                    recvcounts[rank], recvtypes[rank]);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         /* Do the pairwise exchange. */
         for (i=1; i<comm_size; i++) {
             src = (rank - i + comm_size) % comm_size;
@@ -208,8 +208,8 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
 #endif
@@ -222,7 +222,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
 
   fn_fail:
@@ -234,7 +234,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoallw_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoallw_inter(const void *sendbuf, const int sendcounts[], const int sdispls[],
                          const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
                          const int rdispls[], const MPI_Datatype recvtypes[], MPID_Comm *comm_ptr,
@@ -301,8 +301,8 @@ int MPIR_Alltoallw_inter(const void *sendbuf, const int sendcounts[], const int
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     
@@ -312,7 +312,7 @@ int MPIR_Alltoallw_inter(const void *sendbuf, const int sendcounts[], const int
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
@@ -321,7 +321,7 @@ int MPIR_Alltoallw_inter(const void *sendbuf, const int sendcounts[], const int
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoallw
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[],
                    const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
                    const int rdispls[], const MPI_Datatype recvtypes[],
@@ -334,13 +334,13 @@ int MPIR_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
         mpi_errno = MPIR_Alltoallw_intra(sendbuf, sendcounts, sdispls,
                                          sendtypes, recvbuf, recvcounts,
                                          rdispls, recvtypes, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         /* intercommunicator */
         mpi_errno = MPIR_Alltoallw_inter(sendbuf, sendcounts, sdispls,
                                          sendtypes, recvbuf, recvcounts,
                                          rdispls, recvtypes, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -352,7 +352,7 @@ int MPIR_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
 #undef FUNCNAME
 #define FUNCNAME MPIR_Alltoallw_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Alltoallw_impl(const void *sendbuf, const int sendcounts[], const int sdispls[],
                         const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
                         const int rdispls[], const MPI_Datatype recvtypes[],
@@ -365,13 +365,13 @@ int MPIR_Alltoallw_impl(const void *sendbuf, const int sendcounts[], const int s
 	mpi_errno = comm_ptr->coll_fns->Alltoallw(sendbuf, sendcounts, sdispls,
                                                   sendtypes, recvbuf, recvcounts,
                                                   rdispls, recvtypes, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Alltoallw(sendbuf, sendcounts, sdispls,
                                    sendtypes, recvbuf, recvcounts,
                                    rdispls, recvtypes, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -387,7 +387,7 @@ int MPIR_Alltoallw_impl(const void *sendbuf, const int sendcounts[], const int s
 #undef FUNCNAME
 #define FUNCNAME MPI_Alltoallw
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Alltoallw - Generalized all-to-all communication allowing different
    datatypes, counts, and displacements for each partner
@@ -436,7 +436,7 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_ALLTOALLW);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -468,7 +468,7 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[],
             check_send = (comm_ptr->comm_kind == MPID_INTRACOMM && sendbuf != MPI_IN_PLACE);
 
             if (comm_ptr->comm_kind == MPID_INTERCOMM && sendbuf == MPI_IN_PLACE) {
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sendbuf_inplace");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sendbuf_inplace");
             }
 
             if (comm_ptr->comm_kind == MPID_INTRACOMM) {
@@ -539,7 +539,7 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[],
 
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_ALLTOALLW);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/barrier.c b/src/mpi/coll/barrier.c
index 8d624e1..a76d881 100644
--- a/src/mpi/coll/barrier.c
+++ b/src/mpi/coll/barrier.c
@@ -66,7 +66,7 @@ int MPI_Barrier(MPI_Comm comm) __attribute__((weak,alias("PMPI_Barrier")));
 #undef FUNCNAME
 #define FUNCNAME barrier_smp_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int barrier_smp_intra(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
     int mpi_errno=MPI_SUCCESS;
@@ -82,8 +82,8 @@ static int barrier_smp_intra(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -93,8 +93,8 @@ static int barrier_smp_intra(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -108,8 +108,8 @@ static int barrier_smp_intra(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -117,7 +117,7 @@ static int barrier_smp_intra(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
@@ -127,7 +127,7 @@ static int barrier_smp_intra(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Barrier_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Barrier_intra( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
 {
     int size, rank, src, dst, mask, mpi_errno=MPI_SUCCESS;
@@ -147,8 +147,8 @@ int MPIR_Barrier_intra( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
         goto fn_exit;
     }
@@ -166,8 +166,8 @@ int MPIR_Barrier_intra( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
         mask <<= 1;
     }
@@ -177,7 +177,7 @@ int MPIR_Barrier_intra( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
@@ -188,7 +188,7 @@ int MPIR_Barrier_intra( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Barrier_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Barrier_inter( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
 {
     int rank, mpi_errno = MPI_SUCCESS, root;
@@ -201,7 +201,7 @@ int MPIR_Barrier_inter( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
     /* Get the local intracommunicator */
     if (!comm_ptr->local_comm) {
 	mpi_errno = MPIR_Setup_intercomm_localcomm( comm_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     newcomm_ptr = comm_ptr->local_comm;
@@ -211,8 +211,8 @@ int MPIR_Barrier_inter( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
     if (mpi_errno) {
         /* for communication errors, just record the error but continue */
         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
     }
 
     /* rank 0 on each group does an intercommunicator broadcast to the
@@ -229,8 +229,8 @@ int MPIR_Barrier_inter( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
 
         /* receive bcast from right */
@@ -239,8 +239,8 @@ int MPIR_Barrier_inter( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     else {
@@ -250,8 +250,8 @@ int MPIR_Barrier_inter( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
 
         /* bcast to left */
@@ -260,28 +260,28 @@ int MPIR_Barrier_inter( MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag )
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
  fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
 }
 
-/* MPIR_Barrier performs an barrier using poin        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+/* MPIR_Barrier performs an barrier using poin        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 t-to-point messages.
    This is intended to be used by device-specific implementations of
    barrier.  In all other cases MPIR_Barrier_impl should be used. */
 #undef FUNCNAME
 #define FUNCNAME MPIR_Barrier
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Barrier(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -289,11 +289,11 @@ int MPIR_Barrier(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
     if (comm_ptr->comm_kind == MPID_INTRACOMM) {
         /* intracommunicator */
         mpi_errno = MPIR_Barrier_intra( comm_ptr, errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         /* intercommunicator */
         mpi_errno = MPIR_Barrier_inter( comm_ptr, errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -310,7 +310,7 @@ int MPIR_Barrier(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Barrier_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Barrier_impl(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -318,18 +318,18 @@ int MPIR_Barrier_impl(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
     {
 	/* --BEGIN USEREXTENSION-- */
 	mpi_errno = comm_ptr->coll_fns->Barrier(comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     }
     else
     {
         mpi_errno = MPIR_Barrier(comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
         
  fn_exit:
     if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
@@ -343,7 +343,7 @@ int MPIR_Barrier_impl(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 #undef FUNCNAME
 #define FUNCNAME MPI_Barrier
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 
@@ -375,7 +375,7 @@ int MPI_Barrier( MPI_Comm comm )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_BARRIER);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -414,7 +414,7 @@ int MPI_Barrier( MPI_Comm comm )
 
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_BARRIER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/bcast.c b/src/mpi/coll/bcast.c
index 5ea65e5..1bbbcb4 100644
--- a/src/mpi/coll/bcast.c
+++ b/src/mpi/coll/bcast.c
@@ -120,7 +120,7 @@ int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bcast_binomial
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Bcast_binomial(
     void *buffer, 
     int count, 
@@ -189,7 +189,7 @@ static int MPIR_Bcast_binomial(
         if (rank == root) {
             mpi_errno = MPIR_Pack_impl(buffer, count, datatype, tmp_buf, nbytes,
                                        &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -236,8 +236,8 @@ static int MPIR_Bcast_binomial(
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
 
             /* check that we received as much as we expected */
@@ -245,10 +245,10 @@ static int MPIR_Bcast_binomial(
             /* recvd_size may not be accurate for packed heterogeneous data */
             if (is_homogeneous && recvd_size != nbytes) {
                 if (*errflag == MPIR_ERR_NONE) *errflag = MPIR_ERR_OTHER;
-                MPIU_ERR_SET2(mpi_errno, MPI_ERR_OTHER,
+                MPIR_ERR_SET2(mpi_errno, MPI_ERR_OTHER,
 		      "**collective_size_mismatch",
 		      "**collective_size_mismatch %d %d", recvd_size, nbytes );
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             break;
         }
@@ -282,8 +282,8 @@ static int MPIR_Bcast_binomial(
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
         mask >>= 1;
@@ -296,7 +296,7 @@ static int MPIR_Bcast_binomial(
             position = 0;
             mpi_errno = MPIR_Unpack_impl(tmp_buf, nbytes, &position, buffer,
                                          count, datatype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             
         }
     }
@@ -307,7 +307,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     /* --END ERROR HANDLING-- */
     return mpi_errno;
 fn_fail:
@@ -327,7 +327,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME scatter_for_bcast
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int scatter_for_bcast(
     void *buffer ATTRIBUTE((unused)),
     int count ATTRIBUTE((unused)), 
@@ -392,8 +392,8 @@ static int scatter_for_bcast(
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     curr_size = 0;
                 } else
                     /* query actual size of data received */
@@ -428,8 +428,8 @@ static int scatter_for_bcast(
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
 
                 curr_size -= send_size;
@@ -443,7 +443,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     /* --END ERROR HANDLING-- */
     return mpi_errno;
 fn_fail:
@@ -473,7 +473,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bcast_scatter_doubling_allgather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Bcast_scatter_doubling_allgather(
     void *buffer, 
     int count, 
@@ -552,7 +552,7 @@ static int MPIR_Bcast_scatter_doubling_allgather(
         if (rank == root) {
             mpi_errno = MPIR_Pack_impl(buffer, count, datatype, tmp_buf, nbytes,
                                        &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -564,8 +564,8 @@ static int MPIR_Bcast_scatter_doubling_allgather(
     if (mpi_errno) {
         /* for communication errors, just record the error but continue */
         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
     }
 
     /* curr_size is the amount of data that this process now has stored in
@@ -610,8 +610,8 @@ static int MPIR_Bcast_scatter_doubling_allgather(
 		/* --BEGIN ERROR HANDLING-- */
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 recv_size = 0;
 		/* --END ERROR HANDLING-- */
             } else
@@ -686,8 +686,8 @@ static int MPIR_Bcast_scatter_doubling_allgather(
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
                 /* recv only if this proc. doesn't have data and sender
@@ -708,8 +708,8 @@ static int MPIR_Bcast_scatter_doubling_allgather(
 			/* --BEGIN ERROR HANDLING-- */
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         recv_size = 0;
 			/* --END ERROR HANDLING-- */
                     } else
@@ -732,10 +732,10 @@ static int MPIR_Bcast_scatter_doubling_allgather(
     /* recvd_size may not be accurate for packed heterogeneous data */
     if (is_homogeneous && curr_size != nbytes) {
         if (*errflag == MPIR_ERR_NONE) *errflag = MPIR_ERR_OTHER;
-        MPIU_ERR_SET2(mpi_errno, MPI_ERR_OTHER,
+        MPIR_ERR_SET2(mpi_errno, MPI_ERR_OTHER,
 		      "**collective_size_mismatch",
 		      "**collective_size_mismatch %d %d", curr_size, nbytes );
-        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
     }
 
     if (!is_contig || !is_homogeneous)
@@ -745,7 +745,7 @@ static int MPIR_Bcast_scatter_doubling_allgather(
             position = 0;
             mpi_errno = MPIR_Unpack_impl(tmp_buf, nbytes, &position, buffer,
                                          count, datatype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -755,7 +755,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     /* --END ERROR HANDLING-- */
     return mpi_errno;
 fn_fail:
@@ -781,7 +781,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bcast_scatter_ring_allgather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Bcast_scatter_ring_allgather(
     void *buffer, 
     int count, 
@@ -858,7 +858,7 @@ static int MPIR_Bcast_scatter_ring_allgather(
         if (rank == root) {
             mpi_errno = MPIR_Pack_impl(buffer, count, datatype, tmp_buf, nbytes,
                                        &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -869,8 +869,8 @@ static int MPIR_Bcast_scatter_ring_allgather(
     if (mpi_errno) {
         /* for communication errors, just record the error but continue */
         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
     }
 
     /* long-message allgather or medium-size but non-power-of-two. use ring algorithm. */ 
@@ -908,8 +908,8 @@ static int MPIR_Bcast_scatter_ring_allgather(
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
         MPIR_Get_count_impl(&status, MPI_BYTE, &recvd_size);
         curr_size += recvd_size;
@@ -921,10 +921,10 @@ static int MPIR_Bcast_scatter_ring_allgather(
     /* recvd_size may not be accurate for packed heterogeneous data */
     if (is_homogeneous && curr_size != nbytes) {
         if (*errflag == MPIR_ERR_NONE) *errflag = MPIR_ERR_OTHER;
-        MPIU_ERR_SET2(mpi_errno, MPI_ERR_OTHER,
+        MPIR_ERR_SET2(mpi_errno, MPI_ERR_OTHER,
 		      "**collective_size_mismatch",
 		      "**collective_size_mismatch %d %d", curr_size, nbytes );
-        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
     }
 
     if (!is_contig || !is_homogeneous)
@@ -934,7 +934,7 @@ static int MPIR_Bcast_scatter_ring_allgather(
             position = 0;
             mpi_errno = MPIR_Unpack_impl(tmp_buf, nbytes, &position, buffer,
                                          count, datatype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -944,7 +944,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     /* --END ERROR HANDLING-- */
     return mpi_errno;
 fn_fail:
@@ -955,7 +955,7 @@ fn_fail:
    Invokes the coll_fns->Bcast override for the given communicator if non-null.
    Otherwise it invokes bcast_fn_ with the given args.
    
-   NOTE: calls MPIU_ERR_POP on any failure, so a fn_fail label is needed. */
+   NOTE: calls MPIR_ERR_POP on any failure, so a fn_fail label is needed. */
 #define MPIR_Bcast_fn_or_override(bcast_fn_,mpi_errno_ret_,buffer_,count_,datatype_,root_,comm_ptr_,errflag_) \
     do {                                                                                         \
         int mpi_errno_ = MPI_SUCCESS;                                                            \
@@ -973,8 +973,8 @@ fn_fail:
         if (mpi_errno_) {                                                                        \
             /* for communication errors, just record the error but continue */                   \
             *(errflag_) = MPIR_ERR_GET_CLASS(mpi_errno_);                                        \
-            MPIU_ERR_SET(mpi_errno_, *(errflag_), "**fail");                                     \
-            MPIU_ERR_ADD(mpi_errno_ret_, mpi_errno_);                                            \
+            MPIR_ERR_SET(mpi_errno_, *(errflag_), "**fail");                                     \
+            MPIR_ERR_ADD(mpi_errno_ret_, mpi_errno_);                                            \
         }                                                                                        \
     } while (0)
 
@@ -987,7 +987,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_SMP_Bcast
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_SMP_Bcast(
         void *buffer, 
         int count, 
@@ -1044,8 +1044,8 @@ static int MPIR_SMP_Bcast(
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             }
             else if (0 == comm_ptr->node_comm->rank) {
@@ -1054,19 +1054,19 @@ static int MPIR_SMP_Bcast(
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 /* check that we received as much as we expected */
                 MPIR_Get_count_impl(&status, MPI_BYTE, &recvd_size);
                 /* recvd_size may not be accurate for packed heterogeneous data */
                 if (is_homogeneous && recvd_size != nbytes) {
                     if (*errflag == MPIR_ERR_NONE) *errflag = MPIR_ERR_OTHER;
-                    MPIU_ERR_SET2(mpi_errno, MPI_ERR_OTHER,
+                    MPIR_ERR_SET2(mpi_errno, MPI_ERR_OTHER,
 				  "**collective_size_mismatch",
 				  "**collective_size_mismatch %d %d", 
 				  recvd_size, nbytes );
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             }
             
@@ -1149,8 +1149,8 @@ static int MPIR_SMP_Bcast(
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -1160,7 +1160,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     /* --END ERROR HANDLING-- */
     return mpi_errno;
 fn_fail:
@@ -1213,7 +1213,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bcast_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* not declared static because it is called in intercomm. allgatherv */
 int MPIR_Bcast_intra ( 
         void *buffer, 
@@ -1246,8 +1246,8 @@ int MPIR_Bcast_intra (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
         goto fn_exit;
     }
@@ -1284,8 +1284,8 @@ int MPIR_Bcast_intra (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     else /* (nbytes >= MPIR_CVAR_BCAST_SHORT_MSG_SIZE) && (comm_size >= MPIR_CVAR_BCAST_MIN_PROCS) */
@@ -1296,8 +1296,8 @@ int MPIR_Bcast_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
         else /* (nbytes >= MPIR_CVAR_BCAST_LONG_MSG_SIZE) || !(comm_size_is_pof2) */
@@ -1309,8 +1309,8 @@ int MPIR_Bcast_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -1325,7 +1325,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     /* --END ERROR HANDLING-- */
     return mpi_errno;
 fn_fail:
@@ -1336,7 +1336,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bcast_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /* Not PMPI_LOCAL because it is called in intercomm allgather */
 int MPIR_Bcast_inter ( 
@@ -1374,8 +1374,8 @@ int MPIR_Bcast_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
         MPIDU_ERR_CHECK_MULTIPLE_THREADS_EXIT( comm_ptr );
     }
@@ -1392,8 +1392,8 @@ int MPIR_Bcast_inter (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
         
@@ -1409,8 +1409,8 @@ int MPIR_Bcast_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -1420,7 +1420,7 @@ fn_fail:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
     /* --END ERROR HANDLING-- */
     return mpi_errno;
 }
@@ -1433,7 +1433,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bcast_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Bcast_impl(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1443,13 +1443,13 @@ int MPIR_Bcast_impl(void *buffer, int count, MPI_Datatype datatype, int root, MP
 	/* --BEGIN USEREXTENSION-- */
 	mpi_errno = comm_ptr->coll_fns->Bcast(buffer, count,
                                               datatype, root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     }
     else
     {
         mpi_errno = MPIR_Bcast(buffer, count, datatype, root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 
@@ -1465,7 +1465,7 @@ int MPIR_Bcast_impl(void *buffer, int count, MPI_Datatype datatype, int root, MP
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bcast
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 inline int MPIR_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1473,12 +1473,12 @@ inline int MPIR_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
     if (comm_ptr->comm_kind == MPID_INTRACOMM) {
         /* intracommunicator */
         mpi_errno = MPIR_Bcast_intra( buffer, count, datatype, root, comm_ptr, errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         
     } else {
         /* intercommunicator */
         mpi_errno = MPIR_Bcast_inter( buffer, count, datatype, root, comm_ptr, errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -1493,7 +1493,7 @@ inline int MPIR_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
 #undef FUNCNAME
 #define FUNCNAME MPI_Bcast
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 MPI_Bcast - Broadcasts a message from the process with rank "root" to
@@ -1530,7 +1530,7 @@ int MPI_Bcast( void *buffer, int count, MPI_Datatype datatype, int root,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_BCAST);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1589,7 +1589,7 @@ int MPI_Bcast( void *buffer, int count, MPI_Datatype datatype, int root,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_BCAST);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/exscan.c b/src/mpi/coll/exscan.c
index 6cf6b52..cf9ad79 100644
--- a/src/mpi/coll/exscan.c
+++ b/src/mpi/coll/exscan.c
@@ -83,7 +83,7 @@ int MPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
 #undef FUNCNAME
 #define FUNCNAME MPIR_Exscan
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Exscan ( 
     const void *sendbuf,
     void *recvbuf,
@@ -141,7 +141,7 @@ int MPIR_Exscan (
 
     mpi_errno = MPIR_Localcopy((sendbuf == MPI_IN_PLACE ? (const void *)recvbuf : sendbuf), count, datatype,
                                partial_scan, count, datatype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* check if multiple threads are calling this collective function */
     MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
@@ -160,14 +160,14 @@ int MPIR_Exscan (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
 
             if (rank > dst) {
 		mpi_errno = MPIR_Reduce_local_impl( tmp_buf, partial_scan,
 						    count, datatype, op );
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 /* On rank 0, recvbuf is not defined.  For sendbuf==MPI_IN_PLACE
                    recvbuf must not change (per MPI-2.2).
@@ -180,14 +180,14 @@ int MPIR_Exscan (
                         /* simply copy data recd from rank 0 into recvbuf */
                         mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype,
                                                    recvbuf, count, datatype);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                         flag = 1;
                     }
                     else {
 			mpi_errno = MPIR_Reduce_local_impl( tmp_buf,
 					    recvbuf, count, datatype, op );
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
             }
@@ -195,17 +195,17 @@ int MPIR_Exscan (
                 if (is_commutative) {
 		    mpi_errno = MPIR_Reduce_local_impl( tmp_buf, partial_scan,
 							count, datatype, op );
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		}
                 else {
 		    mpi_errno = MPIR_Reduce_local_impl( partial_scan,
 						tmp_buf, count, datatype, op );
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                     mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype,
                                                partial_scan,
                                                count, datatype);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -223,7 +223,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
     return mpi_errno;
 fn_fail:
     goto fn_exit;
@@ -237,7 +237,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Exscan_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Exscan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -245,11 +245,11 @@ int MPIR_Exscan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
     if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Exscan != NULL) {
 	/* --BEGIN USEREXTENSION-- */
 	mpi_errno = comm_ptr->coll_fns->Exscan(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
 	mpi_errno = MPIR_Exscan(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
         
@@ -265,7 +265,7 @@ int MPIR_Exscan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
 #undef FUNCNAME
 #define FUNCNAME MPI_Exscan
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Exscan - Computes the exclusive scan (partial reductions) of data on a 
@@ -310,7 +310,7 @@ int MPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_EXSCAN);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -389,7 +389,7 @@ int MPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
     
   fn_exit:    
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_EXSCAN);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/gather.c b/src/mpi/coll/gather.c
index 6ee0c3b..3c6a82b 100644
--- a/src/mpi/coll/gather.c
+++ b/src/mpi/coll/gather.c
@@ -84,7 +84,7 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *
 #undef FUNCNAME
 #define FUNCNAME MPIR_Gather_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
                       int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr,
                       MPIR_Errflag_t *errflag)
@@ -184,7 +184,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 	    {
 		mpi_errno = MPIR_Localcopy(sendbuf, sendcount, sendtype,
 					   ((char *) recvbuf + extent*recvcount*rank), recvcount, recvtype);
-		if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+		if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 	    }
         }
 	else if (tmp_buf_size && (nbytes < MPIR_CVAR_GATHER_VSMALL_MSG_SIZE))
@@ -192,7 +192,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
             /* copy from sendbuf into tmp_buf */
             mpi_errno = MPIR_Localcopy(sendbuf, sendcount, sendtype,
                                        tmp_buf, nbytes, MPI_BYTE);
-	    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
         }
 	curr_cnt = nbytes;
         
@@ -227,8 +227,8 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                             }
 			}
 			else if (nbytes < MPIR_CVAR_GATHER_VSMALL_MSG_SIZE) {
@@ -240,8 +240,8 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                             }
 			    copy_offset = rank + mask;
 			    copy_blks = recvblks;
@@ -253,18 +253,18 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 			    displs[1] = 0;
 			    
 			    mpi_errno = MPIR_Type_indexed_impl(2, blocks, displs, recvtype, &tmp_type);
-                            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                             
 			    mpi_errno = MPIR_Type_commit_impl(&tmp_type);
-                            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 			    
 			    mpi_errno = MPIC_Recv(recvbuf, 1, tmp_type, src,
                                                      MPIR_GATHER_TAG, comm_ptr, &status, errflag);
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                             }
 
 			    MPIR_Type_free_impl(&tmp_type);
@@ -291,8 +291,8 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                         if (mpi_errno) {
                             /* for communication errors, just record the error but continue */
                             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         }
 			curr_cnt += (recvblks * nbytes);
                     }
@@ -311,8 +311,8 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
                 else if (nbytes < MPIR_CVAR_GATHER_VSMALL_MSG_SIZE) {
@@ -321,8 +321,8 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
 		}
 		else {
@@ -340,18 +340,18 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 		    }
 		    struct_displs[1] = MPI_VOID_PTR_CAST_TO_MPI_AINT tmp_buf;
 		    mpi_errno = MPIR_Type_create_struct_impl(2, blocks, struct_displs, types, &tmp_type);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     
 		    mpi_errno = MPIR_Type_commit_impl(&tmp_type);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 		    mpi_errno = MPIC_Send(MPI_BOTTOM, 1, tmp_type, dst,
                                              MPIR_GATHER_TAG, comm_ptr, errflag);
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
 		    MPIR_Type_free_impl(&tmp_type);
 		    if (types[1] != MPI_BYTE)
@@ -370,12 +370,12 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                                        nbytes * (comm_size - copy_offset), MPI_BYTE,  
                                        ((char *) recvbuf + extent * recvcount * copy_offset),
                                        recvcount * (comm_size - copy_offset), recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    mpi_errno = MPIR_Localcopy((char *) tmp_buf + nbytes * (comm_size - copy_offset),
                                        nbytes * (copy_blks - comm_size + copy_offset), MPI_BYTE,  
                                        recvbuf,
                                        recvcount * (copy_blks - comm_size + copy_offset), recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
     }
@@ -395,7 +395,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 	{
             mpi_errno = MPIR_Pack_impl(sendbuf, sendcount, sendtype, tmp_buf,
                                        tmp_buf_size, &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             nbytes = position;
         }
         else
@@ -403,7 +403,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
             /* do a dummy pack just to calculate nbytes */
             mpi_errno = MPIR_Pack_impl(recvbuf, 1, recvtype, tmp_buf,
                                        tmp_buf_size, &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             nbytes = position*recvcount;
         }
         
@@ -425,8 +425,8 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         recv_size = 0;
                     } else
                         /* the recv size is larger than what may be sent in
@@ -444,8 +444,8 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 break;
             }
@@ -461,7 +461,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                 mpi_errno = MPIR_Unpack_impl(tmp_buf, tmp_buf_size, &position,
                                              ((char *) recvbuf + extent*recvcount*rank),
                                              recvcount*(comm_size-rank), recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             else
 	    {
@@ -469,12 +469,12 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                 mpi_errno = MPIR_Unpack_impl(tmp_buf, tmp_buf_size, &position,
                                              ((char *) recvbuf + extent*recvcount*(rank+1)),
                                              recvcount*(comm_size-rank-1), recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             if (root != 0) {
                 mpi_errno = MPIR_Unpack_impl(tmp_buf, tmp_buf_size, &position, recvbuf,
                                              recvcount*rank, recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         }
         
@@ -488,7 +488,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
@@ -500,7 +500,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Gather_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
                       int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr,
                       MPIR_Errflag_t *errflag)
@@ -560,8 +560,8 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
         else
@@ -587,7 +587,7 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
             /* all processes in remote group form new intracommunicator */
             if (!comm_ptr->local_comm) {
                 mpi_errno = MPIR_Setup_intercomm_localcomm( comm_ptr );
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
 
             newcomm_ptr = comm_ptr->local_comm;
@@ -599,8 +599,8 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             
             if (rank == 0)
@@ -611,8 +611,8 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             }
         }
@@ -634,8 +634,8 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             }
         }
@@ -646,8 +646,8 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -658,7 +658,7 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
@@ -671,7 +671,7 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Gather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                 void *recvbuf, int recvcount, MPI_Datatype recvtype,
                 int root, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -683,13 +683,13 @@ int MPIR_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
         mpi_errno = MPIR_Gather_intra(sendbuf, sendcount, sendtype,
                                       recvbuf, recvcount, recvtype, root,
                                       comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         /* intercommunicator */
         mpi_errno = MPIR_Gather_inter(sendbuf, sendcount, sendtype,
                                       recvbuf, recvcount, recvtype, root,
                                       comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -705,7 +705,7 @@ int MPIR_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Gather_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Gather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                      void *recvbuf, int recvcount, MPI_Datatype recvtype,
                      int root, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -717,13 +717,13 @@ int MPIR_Gather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 	mpi_errno = comm_ptr->coll_fns->Gather(sendbuf, sendcount,
                                                sendtype, recvbuf, recvcount,
                                                recvtype, root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Gather(sendbuf, sendcount, sendtype,
                                 recvbuf, recvcount, recvtype, root,
                                 comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -738,7 +738,7 @@ int MPIR_Gather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 #undef FUNCNAME
 #define FUNCNAME MPI_Gather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Gather - Gathers together values from a group of processes
@@ -779,7 +779,7 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_GATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -893,7 +893,7 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_GATHER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/gatherv.c b/src/mpi/coll/gatherv.c
index 6efca0a..eef5dd1 100644
--- a/src/mpi/coll/gatherv.c
+++ b/src/mpi/coll/gatherv.c
@@ -72,7 +72,7 @@ int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void
 #undef FUNCNAME
 #define FUNCNAME MPIR_Gatherv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Gatherv ( 
 	const void *sendbuf,
 	int sendcount,
@@ -124,7 +124,7 @@ int MPIR_Gatherv (
                         mpi_errno = MPIR_Localcopy(sendbuf, sendcount, sendtype,
                                                    ((char *)recvbuf+displs[rank]*extent), 
                                                    recvcounts[rank], recvtype);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
                 else {
@@ -132,13 +132,13 @@ int MPIR_Gatherv (
                                               recvcounts[i], recvtype, i,
                                               MPIR_GATHERV_TAG, comm_ptr,
                                               &reqarray[reqs++]);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
         /* ... then wait for *all* of them to finish: */
         mpi_errno = MPIC_Waitall(reqs, reqarray, starray, errflag);
-        if (mpi_errno&& mpi_errno != MPI_ERR_IN_STATUS) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno&& mpi_errno != MPI_ERR_IN_STATUS) MPIR_ERR_POP(mpi_errno);
         
         /* --BEGIN ERROR HANDLING-- */
         if (mpi_errno == MPI_ERR_IN_STATUS) {
@@ -148,8 +148,8 @@ int MPIR_Gatherv (
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
             }
@@ -176,8 +176,8 @@ int MPIR_Gatherv (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             }
             else {
@@ -186,8 +186,8 @@ int MPIR_Gatherv (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             }
         }
@@ -201,7 +201,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
 fn_fail:
     goto fn_exit;
@@ -214,7 +214,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Gatherv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Gatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                       void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype,
                       int root, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -226,13 +226,13 @@ int MPIR_Gatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 	mpi_errno = comm_ptr->coll_fns->Gatherv(sendbuf, sendcount, sendtype,
                                                 recvbuf, recvcounts, displs, recvtype,
                                                 root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Gatherv(sendbuf, sendcount, sendtype,
                                  recvbuf, recvcounts, displs, recvtype,
                                  root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -247,7 +247,7 @@ int MPIR_Gatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 #undef FUNCNAME
 #define FUNCNAME MPI_Gatherv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Gatherv - Gathers into specified locations from all processes in a group
@@ -292,7 +292,7 @@ int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_GATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -424,7 +424,7 @@ int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_GATHERV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index 42808ff..7b7fb83 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -21,7 +21,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIC_Probe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -71,7 +71,7 @@ int MPIR_Localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtyp
 
 #if defined(HAVE_ERROR_CHECKING)
     if (sdata_sz > rdata_sz) {
-        MPIU_ERR_SET2(mpi_errno, MPI_ERR_TRUNCATE, "**truncate", "**truncate %d %d", sdata_sz, rdata_sz);
+        MPIR_ERR_SET2(mpi_errno, MPI_ERR_TRUNCATE, "**truncate", "**truncate %d %d", sdata_sz, rdata_sz);
         copy_sz = rdata_sz;
     }
     else
@@ -94,7 +94,7 @@ int MPIR_Localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtyp
     if (sendtype_iscontig && recvtype_iscontig)
     {
 #if defined(HAVE_ERROR_CHECKING)
-        MPIU_ERR_CHKMEMCPYANDJUMP(mpi_errno,
+        MPIR_ERR_CHKMEMCPYANDJUMP(mpi_errno,
                                   ((char *)recvbuf + recvtype_true_lb),
                                   ((char *)sendbuf + sendtype_true_lb),
                                   copy_sz);
@@ -111,7 +111,7 @@ int MPIR_Localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtyp
 	MPID_Segment_init(recvbuf, recvcount, recvtype, &seg, 0);
 	last = copy_sz;
 	MPID_Segment_unpack(&seg, 0, &last, (char*)sendbuf + sendtype_true_lb);
-        MPIU_ERR_CHKANDJUMP(last != copy_sz, mpi_errno, MPI_ERR_TYPE, "**dtypemismatch");
+        MPIR_ERR_CHKANDJUMP(last != copy_sz, mpi_errno, MPI_ERR_TYPE, "**dtypemismatch");
     }
     else if (recvtype_iscontig)
     {
@@ -121,7 +121,7 @@ int MPIR_Localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtyp
 	MPID_Segment_init(sendbuf, sendcount, sendtype, &seg, 0);
 	last = copy_sz;
 	MPID_Segment_pack(&seg, 0, &last, (char*)recvbuf + recvtype_true_lb);
-        MPIU_ERR_CHKANDJUMP(last != copy_sz, mpi_errno, MPI_ERR_TYPE, "**dtypemismatch");
+        MPIR_ERR_CHKANDJUMP(last != copy_sz, mpi_errno, MPI_ERR_TYPE, "**dtypemismatch");
     }
     else
     {
@@ -173,7 +173,7 @@ int MPIR_Localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtyp
 	    }
 
             /* if the send side finished, but the recv side couldn't unpack it, there's a datatype mismatch */
-            MPIU_ERR_CHKANDJUMP(sfirst == copy_sz, mpi_errno, MPI_ERR_TYPE, "**dtypemismatch");        
+            MPIR_ERR_CHKANDJUMP(sfirst == copy_sz, mpi_errno, MPI_ERR_TYPE, "**dtypemismatch");        
 
             /* if not all data was unpacked, copy it to the front of the buffer for next time */
 	    buf_off = sfirst - rfirst;
@@ -223,7 +223,7 @@ int MPIC_Wait(MPID_Request * request_ptr, MPIR_Errflag_t *errflag)
         while (!MPID_Request_is_complete(request_ptr))
 	{
 	    mpi_errno = MPID_Progress_wait(&progress_state);
-	    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 	}
 	MPID_Progress_end(&progress_state);
     }
@@ -267,7 +267,7 @@ int MPIC_Wait(MPID_Request * request_ptr, MPIR_Errflag_t *errflag)
 #undef FUNCNAME
 #define FUNCNAME MPIC_Send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
                  MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
@@ -280,7 +280,7 @@ int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 
     MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
-    MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
+    MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
 
     switch(*errflag) {
@@ -297,10 +297,10 @@ int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 
     mpi_errno = MPID_Send(buf, count, datatype, dest, tag, comm_ptr,
                           context_id, &request_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     if (request_ptr) {
         mpi_errno = MPIC_Wait(request_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_Request_release(request_ptr);
     }
 
@@ -325,7 +325,7 @@ int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 #undef FUNCNAME
 #define FUNCNAME MPIC_Recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int tag,
                  MPID_Comm *comm_ptr, MPI_Status *status, MPIR_Errflag_t *errflag)
 {
@@ -339,7 +339,7 @@ int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int
 
     MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
-    MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
+    MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
 
     context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
@@ -350,11 +350,11 @@ int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int
 
     mpi_errno = MPID_Recv(buf, count, datatype, source, tag, comm_ptr,
                           context_id, status, &request_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     if (request_ptr) {
         mpi_errno = MPIC_Wait(request_ptr, errflag);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         *status = request_ptr->status;
         mpi_errno = status->MPI_ERROR;
@@ -383,7 +383,7 @@ int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int
 #undef FUNCNAME
 #define FUNCNAME MPIC_Ssend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
                   MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
@@ -396,7 +396,7 @@ int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 
     MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
-    MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
+    MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
             "**countneg", "**countneg %d", count);
 
     context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
@@ -413,10 +413,10 @@ int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 
     mpi_errno = MPID_Ssend(buf, count, datatype, dest, tag, comm_ptr,
                            context_id, &request_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     if (request_ptr) {
         mpi_errno = MPIC_Wait(request_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_Request_release(request_ptr);
     }
 
@@ -441,7 +441,7 @@ int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 #undef FUNCNAME
 #define FUNCNAME MPIC_Sendrecv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
                      int dest, int sendtag, void *recvbuf, MPI_Aint recvcount,
                      MPI_Datatype recvtype, int source, int recvtag,
@@ -457,9 +457,9 @@ int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype
 
     MPIU_DBG_MSG_S(PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
 
-    MPIU_ERR_CHKANDJUMP1((sendcount < 0), mpi_errno, MPI_ERR_COUNT,
+    MPIR_ERR_CHKANDJUMP1((sendcount < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", sendcount);
-    MPIU_ERR_CHKANDJUMP1((recvcount < 0), mpi_errno, MPI_ERR_COUNT,
+    MPIR_ERR_CHKANDJUMP1((recvcount < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", recvcount);
 
     context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
@@ -477,15 +477,15 @@ int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype
 
     mpi_errno = MPID_Irecv(recvbuf, recvcount, recvtype, source, recvtag,
                            comm_ptr, context_id, &recv_req_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Isend(sendbuf, sendcount, sendtype, dest, sendtag,
                            comm_ptr, context_id, &send_req_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIC_Wait(send_req_ptr, errflag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPIC_Wait(recv_req_ptr, errflag);
-    if (mpi_errno) MPIU_ERR_POPFATAL(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POPFATAL(mpi_errno);
 
     *status = recv_req_ptr->status;
 
@@ -519,7 +519,7 @@ int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype
 #undef FUNCNAME
 #define FUNCNAME MPIC_Sendrecv_replace
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
                              int dest, int sendtag,
                              int source, int recvtag,
@@ -544,7 +544,7 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
 
     MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
-    MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
+    MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
 
     if (status == MPI_STATUS_IGNORE) status = &mystatus;
@@ -565,12 +565,12 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
         MPIU_CHKLMEM_MALLOC(tmpbuf, void *, tmpbuf_size, mpi_errno, "temporary send buffer");
 
         mpi_errno = MPIR_Pack_impl(buf, count, datatype, tmpbuf, tmpbuf_size, &tmpbuf_count);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     mpi_errno = MPID_Irecv(buf, count, datatype, source, recvtag,
                            comm_ptr, context_id_offset, &rreq);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Isend(tmpbuf, tmpbuf_count, MPI_PACKED, dest,
                            sendtag, comm_ptr, context_id_offset, &sreq);
@@ -579,14 +579,14 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
         /* FIXME: should we cancel the pending (possibly completed) receive
          * request or wait for it to complete? */
         MPID_Request_release(rreq);
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
         /* --END ERROR HANDLING-- */
     }
 
     mpi_errno = MPIC_Wait(sreq, errflag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPIC_Wait(rreq, errflag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     *status = rreq->status;
 
@@ -617,7 +617,7 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
 #undef FUNCNAME
 #define FUNCNAME MPIC_Isend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
                   MPID_Comm *comm_ptr, MPID_Request **request_ptr, MPIR_Errflag_t *errflag)
 {
@@ -629,7 +629,7 @@ int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
     MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
-    MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
+    MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
 
     switch(*errflag) {
@@ -646,7 +646,7 @@ int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
     mpi_errno = MPID_Isend(buf, count, datatype, dest, tag, comm_ptr,
             context_id, request_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_ISEND);
@@ -658,7 +658,7 @@ int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 #undef FUNCNAME
 #define FUNCNAME MPIC_Issend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIC_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
                   MPID_Comm *comm_ptr, MPID_Request **request_ptr, MPIR_Errflag_t *errflag)
 {
@@ -670,7 +670,7 @@ int MPIC_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
     MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
-    MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
+    MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
 
     switch(*errflag) {
@@ -687,7 +687,7 @@ int MPIC_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
     mpi_errno = MPID_Issend(buf, count, datatype, dest, tag, comm_ptr,
             context_id, request_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_ISSEND);
@@ -699,7 +699,7 @@ int MPIC_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 #undef FUNCNAME
 #define FUNCNAME MPIC_Irecv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
                   int tag, MPID_Comm *comm_ptr, MPID_Request **request_ptr)
 {
@@ -709,7 +709,7 @@ int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_IRECV);
 
-    MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
+    MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
 
     context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
@@ -717,7 +717,7 @@ int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
 
     mpi_errno = MPID_Irecv(buf, count, datatype, source, tag, comm_ptr,
             context_id, request_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_IRECV);
@@ -730,7 +730,7 @@ int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
 #undef FUNCNAME
 #define FUNCNAME MPIC_Waitall
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIC_Waitall(int numreq, MPID_Request *requests[], MPI_Status statuses[], MPIR_Errflag_t *errflag)
 {
     int mpi_errno = MPI_SUCCESS;
diff --git a/src/mpi/coll/iallgather.c b/src/mpi/coll/iallgather.c
index c23d638..13f719c 100644
--- a/src/mpi/coll/iallgather.c
+++ b/src/mpi/coll/iallgather.c
@@ -54,7 +54,7 @@ static int dtp_release_ref(MPID_Comm *comm, int tag, void *state)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgather_rec_dbl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgather_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -87,7 +87,7 @@ int MPIR_Iallgather_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype sen
         mpi_errno = MPID_Sched_copy(sendbuf, sendcount, sendtype,
                                     ((char *)recvbuf + rank*recvcount*recvtype_extent),
                                     recvcount, recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -121,16 +121,16 @@ int MPIR_Iallgather_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype sen
         if (dst < comm_size) {
             mpi_errno = MPID_Sched_send_defer(((char *)recvbuf + send_offset),
                                               &ss->curr_count, recvtype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             /* send-recv, no sched barrier here */
             mpi_errno = MPID_Sched_recv_status(((char *)recvbuf + recv_offset),
                                                ((comm_size-dst_tree_root)*recvcount),
                                                recvtype, dst, comm_ptr, &ss->status, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             mpi_errno = MPID_Sched_cb(&get_count, ss, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
 
@@ -187,7 +187,7 @@ int MPIR_Iallgather_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype sen
                     mpi_errno = MPID_Sched_send_defer(((char *)recvbuf + offset),
                                                       &ss->last_recv_count,
                                                       recvtype, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
                 /* recv only if this proc. doesn't have data and sender
@@ -203,7 +203,7 @@ int MPIR_Iallgather_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype sen
                                                        recvtype, dst, comm_ptr, &ss->status, s);
                     MPID_SCHED_BARRIER(s);
                     mpi_errno = MPID_Sched_cb(&get_count, ss, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
 
@@ -219,7 +219,7 @@ int MPIR_Iallgather_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype sen
 
     if (recv_dtp) {
         mpi_errno = MPID_Sched_cb(dtp_release_ref, recv_dtp, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPIR_SCHED_CHKPMEM_COMMIT(s);
@@ -233,7 +233,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgather_bruck
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgather_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -267,14 +267,14 @@ int MPIR_Iallgather_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendt
     if (sendbuf != MPI_IN_PLACE) {
         mpi_errno = MPID_Sched_copy(sendbuf, sendcount, sendtype,
                                     tmp_buf, recvcount, recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
     else {
         mpi_errno = MPID_Sched_copy(((char *)recvbuf + rank * recvcount * recvtype_extent),
                                     recvcount, recvtype, tmp_buf,
                                     recvcount, recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -287,11 +287,11 @@ int MPIR_Iallgather_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendt
         dst = (rank - pof2 + comm_size) % comm_size;
 
         mpi_errno = MPID_Sched_send(tmp_buf, curr_cnt, recvtype, dst, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         /* logically sendrecv, so no barrier here */
         mpi_errno = MPID_Sched_recv(((char *)tmp_buf + curr_cnt*recvtype_extent),
                                     curr_cnt, recvtype, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
         curr_cnt *= 2;
@@ -306,11 +306,11 @@ int MPIR_Iallgather_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendt
         dst = (rank - pof2 + comm_size) % comm_size;
 
         mpi_errno = MPID_Sched_send(tmp_buf, rem * recvcount, recvtype, dst, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         /* logically sendrecv, so no barrier here */
         mpi_errno = MPID_Sched_recv(((char *)tmp_buf + curr_cnt*recvtype_extent),
                                     (rem * recvcount), recvtype, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -320,14 +320,14 @@ int MPIR_Iallgather_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendt
     mpi_errno = MPID_Sched_copy(tmp_buf, ((comm_size-rank)*recvcount), recvtype,
                                 ((char *) recvbuf + rank*recvcount*recvtype_extent),
                                 ((comm_size-rank)*recvcount), recvtype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(s);
 
     if (rank) {
         mpi_errno = MPID_Sched_copy(((char *) tmp_buf + (comm_size-rank)*recvcount*recvtype_extent),
                                    rank*recvcount, recvtype,
                                    recvbuf, rank*recvcount, recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPIR_SCHED_CHKPMEM_COMMIT(s);
@@ -341,7 +341,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgather_ring
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgather_ring(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -363,7 +363,7 @@ int MPIR_Iallgather_ring(const void *sendbuf, int sendcount, MPI_Datatype sendty
         mpi_errno = MPID_Sched_copy(sendbuf, sendcount, sendtype,
                                     ((char *)recvbuf + rank*recvcount*recvtype_extent),
                                     recvcount, recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -377,11 +377,11 @@ int MPIR_Iallgather_ring(const void *sendbuf, int sendcount, MPI_Datatype sendty
     for (i=1; i<comm_size; i++) {
         mpi_errno = MPID_Sched_send(((char *)recvbuf + j*recvcount*recvtype_extent),
                                      recvcount, recvtype, right, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         /* concurrent, no barrier here */
         mpi_errno = MPID_Sched_recv(((char *)recvbuf + jnext*recvcount*recvtype_extent),
                                      recvcount, recvtype, left, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
         j = jnext;
@@ -442,7 +442,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgather_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -461,19 +461,19 @@ int MPIR_Iallgather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendt
         /* Short or medium size message and power-of-two no. of processes. Use
          * recursive doubling algorithm */
         mpi_errno = MPIR_Iallgather_rec_dbl(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else if (tot_bytes < MPIR_CVAR_ALLGATHER_SHORT_MSG_SIZE) {
         /* Short message and non-power-of-two no. of processes. Use
          * Bruck algorithm (see description above). */
         mpi_errno = MPIR_Iallgather_bruck(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* long message or medium-size message and non-power-of-two no. of
          * processes. use ring algorithm. */
         mpi_errno = MPIR_Iallgather_ring(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -485,7 +485,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgather_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     /* Intercommunicator Allgather.
@@ -529,7 +529,7 @@ int MPIR_Iallgather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendt
         mpi_errno = newcomm_ptr->coll_fns->Igather_sched(sendbuf, sendcount, sendtype,
                                                    tmp_buf, sendcount, sendtype,
                                                    0, newcomm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -542,7 +542,7 @@ int MPIR_Iallgather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendt
             root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
             mpi_errno = comm_ptr->coll_fns->Ibcast_sched(tmp_buf, sendcount*local_size,
                                                    sendtype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         /* no sched barrier, bcasts are logically concurrent */
@@ -552,7 +552,7 @@ int MPIR_Iallgather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendt
             root = 0;
             mpi_errno = comm_ptr->coll_fns->Ibcast_sched(recvbuf, recvcount*remote_size,
                                                    recvtype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         MPID_SCHED_BARRIER(s);
     }
@@ -562,7 +562,7 @@ int MPIR_Iallgather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendt
             root = 0;
             mpi_errno = comm_ptr->coll_fns->Ibcast_sched(recvbuf, recvcount*remote_size,
                                                    recvtype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         /* no sched barrier, bcasts are logically concurrent */
@@ -572,7 +572,7 @@ int MPIR_Iallgather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendt
             root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
             mpi_errno = comm_ptr->coll_fns->Ibcast_sched(tmp_buf, sendcount*local_size,
                                                    sendtype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         MPID_SCHED_BARRIER(s);
     }
@@ -588,7 +588,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgather_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -604,26 +604,26 @@ int MPIR_Iallgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendty
         mpi_errno = comm_ptr->coll_fns->Iallgather_req(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype,comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Iallgather_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Iallgather_sched(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -636,7 +636,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Iallgather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Iallgather - Gathers data from all tasks and distribute the combined data
                  to all tasks in a nonblocking way
@@ -667,7 +667,7 @@ int MPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLGATHER);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLGATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -733,13 +733,13 @@ int MPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Iallgather_impl(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLGATHER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iallgatherv.c b/src/mpi/coll/iallgatherv.c
index 584ee77..2ba36c6 100644
--- a/src/mpi/coll/iallgatherv.c
+++ b/src/mpi/coll/iallgatherv.c
@@ -30,7 +30,7 @@ int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, v
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgatherv_rec_dbl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgatherv_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                              void *recvbuf, const int recvcounts[], const int displs[],
                              MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
@@ -80,7 +80,7 @@ int MPIR_Iallgatherv_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype se
         mpi_errno = MPID_Sched_copy(sendbuf, sendcount, sendtype,
                                    ((char *)tmp_buf + position*recvtype_extent),
                                    recvcounts[rank], recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else
     {
@@ -89,7 +89,7 @@ int MPIR_Iallgatherv_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype se
                                    recvcounts[rank], recvtype,
                                    ((char *)tmp_buf + position*recvtype_extent),
                                    recvcounts[rank], recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     curr_count = recvcounts[rank];
@@ -137,11 +137,11 @@ int MPIR_Iallgatherv_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype se
 
             mpi_errno = MPID_Sched_send(((char *)tmp_buf + send_offset * recvtype_extent),
                                         curr_count, recvtype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             /* sendrecv, no barrier here */
             mpi_errno = MPID_Sched_recv(((char *)tmp_buf + recv_offset * recvtype_extent),
                                         incoming_count, recvtype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             curr_count += incoming_count;
@@ -206,7 +206,7 @@ int MPIR_Iallgatherv_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype se
                        sent now. */
                     mpi_errno = MPID_Sched_send(((char *)tmp_buf + offset),
                                                 incoming_count, recvtype, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
                 /* recv only if this proc. doesn't have data and sender
@@ -229,7 +229,7 @@ int MPIR_Iallgatherv_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype se
                     mpi_errno = MPID_Sched_recv(((char *)tmp_buf + offset * recvtype_extent),
                                                 incoming_count, recvtype,
                                                 dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                     curr_count += incoming_count;
                 }
@@ -256,7 +256,7 @@ int MPIR_Iallgatherv_rec_dbl(const void *sendbuf, int sendcount, MPI_Datatype se
                                        recvcounts[j], recvtype,
                                        ((char *)recvbuf + displs[j]*recvtype_extent),
                                        recvcounts[j], recvtype, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         position += recvcounts[j];
     }
@@ -272,7 +272,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgatherv_bruck
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgatherv_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                            void *recvbuf, const int recvcounts[], const int displs[],
                            MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
@@ -314,14 +314,14 @@ int MPIR_Iallgatherv_bruck(const void *sendbuf, int sendcount, MPI_Datatype send
     if (sendbuf != MPI_IN_PLACE) {
         mpi_errno = MPID_Sched_copy(sendbuf, sendcount, sendtype,
                                     tmp_buf, recvcounts[rank], recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
     else {
         mpi_errno = MPID_Sched_copy(((char *)recvbuf + displs[rank]*recvtype_extent),
                                     recvcounts[rank], recvtype,
                                     tmp_buf, recvcounts[rank], recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -346,11 +346,11 @@ int MPIR_Iallgatherv_bruck(const void *sendbuf, int sendcount, MPI_Datatype send
         }
 
         mpi_errno = MPID_Sched_send(tmp_buf, curr_count, recvtype, dst, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         /* sendrecv, no barrier */
         mpi_errno = MPID_Sched_recv(((char *)tmp_buf + curr_count*recvtype_extent),
                                     incoming_count, recvtype, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
         /* we will send everything we had plus what we just got to next round's dst */
@@ -369,11 +369,11 @@ int MPIR_Iallgatherv_bruck(const void *sendbuf, int sendcount, MPI_Datatype send
             send_cnt += recvcounts[(rank+i)%comm_size];
 
         mpi_errno = MPID_Sched_send(tmp_buf, send_cnt, recvtype, dst, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         /* sendrecv, no barrier */
         mpi_errno = MPID_Sched_recv(((char *)tmp_buf + curr_count*recvtype_extent),
                                      (total_count - curr_count), recvtype, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -387,7 +387,7 @@ int MPIR_Iallgatherv_bruck(const void *sendbuf, int sendcount, MPI_Datatype send
                                     recvcounts[j], recvtype,
                                     ((char *)recvbuf + displs[j]*recvtype_extent),
                                     recvcounts[j], recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         send_cnt += recvcounts[j];
     }
 
@@ -396,7 +396,7 @@ int MPIR_Iallgatherv_bruck(const void *sendbuf, int sendcount, MPI_Datatype send
                                     recvcounts[i], recvtype,
                                     ((char *)recvbuf + displs[i]*recvtype_extent),
                                     recvcounts[i], recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         send_cnt += recvcounts[i];
     }
 
@@ -411,7 +411,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgatherv_ring
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgatherv_ring(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                           void *recvbuf, const int recvcounts[], const int displs[],
                           MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
@@ -444,7 +444,7 @@ int MPIR_Iallgatherv_ring(const void *sendbuf, int sendcount, MPI_Datatype sendt
         mpi_errno = MPID_Sched_copy(sendbuf, sendcount, sendtype,
                                     ((char *)recvbuf + displs[rank]*recvtype_extent),
                                     recvcounts[rank], recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -484,12 +484,12 @@ int MPIR_Iallgatherv_ring(const void *sendbuf, int sendcount, MPI_Datatype sendt
         /* Communicate */
         if (recvnow) { /* If there's no data to send, just do a recv call */
             mpi_errno = MPID_Sched_recv(rbuf, recvnow, recvtype, left, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             torecv -= recvnow;
         }
         if (sendnow) { /* If there's no data to receive, just do a send call */
             mpi_errno = MPID_Sched_send(sbuf, sendnow, recvtype, right, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             tosend -= sendnow;
         }
         MPID_SCHED_BARRIER(s);
@@ -553,7 +553,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgatherv_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgatherv_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                            void *recvbuf, const int recvcounts[], const int displs[],
                            MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
@@ -577,19 +577,19 @@ int MPIR_Iallgatherv_intra(const void *sendbuf, int sendcount, MPI_Datatype send
         /* Short or medium size message and power-of-two no. of processes. Use
          * recursive doubling algorithm */
         mpi_errno = MPIR_Iallgatherv_rec_dbl(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else if (total_count*recvtype_size < MPIR_CVAR_ALLGATHER_SHORT_MSG_SIZE) {
         /* Short message and non-power-of-two no. of processes. Use
          * Bruck algorithm (see description above). */
         mpi_errno = MPIR_Iallgatherv_bruck(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* long message or medium-size message and non-power-of-two
          * no. of processes. Use ring algorithm. */
         mpi_errno = MPIR_Iallgatherv_ring(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -601,7 +601,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgatherv_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgatherv_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                            void *recvbuf, const int recvcounts[], const int displs[],
                            MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
@@ -632,13 +632,13 @@ int MPIR_Iallgatherv_inter(const void *sendbuf, int sendcount, MPI_Datatype send
         mpi_errno = comm_ptr->coll_fns->Igatherv_sched(sendbuf, sendcount, sendtype, recvbuf,
                                                  recvcounts, displs, recvtype, root,
                                                  comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         /* gatherv to right group */
         root = 0;
         mpi_errno = comm_ptr->coll_fns->Igatherv_sched(sendbuf, sendcount, sendtype, recvbuf,
                                                  recvcounts, displs, recvtype, root,
                                                  comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* gatherv to left group  */
@@ -646,13 +646,13 @@ int MPIR_Iallgatherv_inter(const void *sendbuf, int sendcount, MPI_Datatype send
         mpi_errno = comm_ptr->coll_fns->Igatherv_sched(sendbuf, sendcount, sendtype, recvbuf,
                                                  recvcounts, displs, recvtype, root,
                                                  comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         /* gatherv from left group */
         root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
         mpi_errno = comm_ptr->coll_fns->Igatherv_sched(sendbuf, sendcount, sendtype, recvbuf,
                                                  recvcounts, displs, recvtype, root,
                                                  comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPID_SCHED_BARRIER(s);
@@ -663,20 +663,20 @@ int MPIR_Iallgatherv_inter(const void *sendbuf, int sendcount, MPI_Datatype send
     /* Get the local intracommunicator */
     if (!comm_ptr->local_comm) {
         mpi_errno = MPIR_Setup_intercomm_localcomm( comm_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     newcomm_ptr = comm_ptr->local_comm;
     MPIU_Assert(newcomm_ptr->coll_fns && newcomm_ptr->coll_fns->Ibcast_sched);
 
     mpi_errno = MPIR_Type_indexed_impl(remote_size, recvcounts, displs, recvtype, &newtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIR_Type_commit_impl(&newtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = newcomm_ptr->coll_fns->Ibcast_sched(recvbuf, 1, newtype, 0, newcomm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIR_Type_free_impl(&newtype);
 
@@ -689,7 +689,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallgatherv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallgatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                           void *recvbuf, const int recvcounts[], const int displs[],
                           MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPI_Request *request)
@@ -707,26 +707,26 @@ int MPIR_Iallgatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendt
         mpi_errno = comm_ptr->coll_fns->Iallgatherv_req(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Iallgatherv_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Iallgatherv_sched(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -739,7 +739,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Iallgatherv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Iallgatherv - Gathers data from all tasks and deliver the combined data
                   to all tasks in a nonblocking way
@@ -771,7 +771,7 @@ int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, v
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLGATHERV);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLGATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -845,13 +845,13 @@ int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, v
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Iallgatherv_impl(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLGATHERV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iallreduce.c b/src/mpi/coll/iallreduce.c
index 1ba3a98..d4c4d01 100644
--- a/src/mpi/coll/iallreduce.c
+++ b/src/mpi/coll/iallreduce.c
@@ -33,7 +33,7 @@ int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype d
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallreduce_naive
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallreduce_naive(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -43,17 +43,17 @@ int MPIR_Iallreduce_naive(const void *sendbuf, void *recvbuf, int count, MPI_Dat
 
     if ((sendbuf == MPI_IN_PLACE) && (rank != 0)) {
         mpi_errno = MPIR_Ireduce_intra(recvbuf, NULL, count, datatype, op, 0, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         mpi_errno = MPIR_Ireduce_intra(sendbuf, recvbuf, count, datatype, op, 0, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPID_SCHED_BARRIER(s);
 
     mpi_errno = MPIR_Ibcast_intra(recvbuf, count, datatype, 0, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -65,7 +65,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallreduce_redscat_allgather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallreduce_redscat_allgather(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -98,7 +98,7 @@ int MPIR_Iallreduce_redscat_allgather(const void *sendbuf, void *recvbuf, int co
     if (sendbuf != MPI_IN_PLACE) {
         mpi_errno = MPID_Sched_copy(sendbuf, count, datatype,
                                     recvbuf, count, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -118,7 +118,7 @@ int MPIR_Iallreduce_redscat_allgather(const void *sendbuf, void *recvbuf, int co
     if (rank < 2*rem) {
         if (rank % 2 == 0) { /* even */
             mpi_errno = MPID_Sched_send(recvbuf, count, datatype, rank+1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* temporarily set the rank to -1 so that this
@@ -128,14 +128,14 @@ int MPIR_Iallreduce_redscat_allgather(const void *sendbuf, void *recvbuf, int co
         }
         else { /* odd */
             mpi_errno = MPID_Sched_recv(tmp_buf, count, datatype, rank-1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* do the reduction on received data. since the
                ordering is right, it doesn't matter whether
                the operation is commutative or not. */
             mpi_errno = MPID_Sched_reduce(tmp_buf, recvbuf, count, datatype, op, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* change the rank */
@@ -192,11 +192,11 @@ int MPIR_Iallreduce_redscat_allgather(const void *sendbuf, void *recvbuf, int co
             /* Send data from recvbuf. Recv into tmp_buf */
             mpi_errno = MPID_Sched_recv(((char *)tmp_buf + disps[recv_idx]*extent),
                                         recv_cnt, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             /* sendrecv, no barrier here */
             mpi_errno = MPID_Sched_send(((char *)recvbuf + disps[send_idx]*extent),
                                         send_cnt, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* tmp_buf contains data received in this step.
@@ -207,7 +207,7 @@ int MPIR_Iallreduce_redscat_allgather(const void *sendbuf, void *recvbuf, int co
             mpi_errno = MPID_Sched_reduce(((char *)tmp_buf + disps[recv_idx]*extent),
                                           ((char *)recvbuf + disps[recv_idx]*extent),
                                           recv_cnt, datatype, op, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* update send_idx for next iteration */
@@ -251,11 +251,11 @@ int MPIR_Iallreduce_redscat_allgather(const void *sendbuf, void *recvbuf, int co
 
             mpi_errno = MPID_Sched_recv(((char *)recvbuf + disps[recv_idx]*extent),
                                         recv_cnt, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             /* sendrecv, no barrier here */
             mpi_errno = MPID_Sched_send(((char *)recvbuf + disps[send_idx]*extent),
                                         send_cnt, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             if (newrank > newdst) send_idx = recv_idx;
@@ -270,11 +270,11 @@ int MPIR_Iallreduce_redscat_allgather(const void *sendbuf, void *recvbuf, int co
     if (rank < 2*rem) {
         if (rank % 2) { /* odd */
             mpi_errno = MPID_Sched_send(recvbuf, count, datatype, rank-1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else { /* even */
             mpi_errno = MPID_Sched_recv(recvbuf, count, datatype, rank+1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -290,7 +290,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallreduce_rec_dbl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallreduce_rec_dbl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -319,7 +319,7 @@ int MPIR_Iallreduce_rec_dbl(const void *sendbuf, void *recvbuf, int count, MPI_D
     if (sendbuf != MPI_IN_PLACE) {
         mpi_errno = MPID_Sched_copy(sendbuf, count, datatype,
                                     recvbuf, count, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -339,7 +339,7 @@ int MPIR_Iallreduce_rec_dbl(const void *sendbuf, void *recvbuf, int count, MPI_D
     if (rank < 2*rem) {
         if (rank % 2 == 0) { /* even */
             mpi_errno = MPID_Sched_send(recvbuf, count, datatype, rank+1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* temporarily set the rank to -1 so that this
@@ -349,14 +349,14 @@ int MPIR_Iallreduce_rec_dbl(const void *sendbuf, void *recvbuf, int count, MPI_D
         }
         else { /* odd */
             mpi_errno = MPID_Sched_recv(tmp_buf, count, datatype, rank-1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* do the reduction on received data. since the
                ordering is right, it doesn't matter whether
                the operation is commutative or not. */
             mpi_errno = MPID_Sched_reduce(tmp_buf, recvbuf, count, datatype, op, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* change the rank */
@@ -376,11 +376,11 @@ int MPIR_Iallreduce_rec_dbl(const void *sendbuf, void *recvbuf, int count, MPI_D
             /* Send the most current data, which is in recvbuf. Recv
                into tmp_buf */
             mpi_errno = MPID_Sched_recv(tmp_buf, count, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             /* sendrecv, no barrier here */
             mpi_errno = MPID_Sched_send(recvbuf, count, datatype,
                                         dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* tmp_buf contains data received in this step.
@@ -389,19 +389,19 @@ int MPIR_Iallreduce_rec_dbl(const void *sendbuf, void *recvbuf, int count, MPI_D
             if (is_commutative  || (dst < rank)) {
                 /* op is commutative OR the order is already right */
                 mpi_errno = MPID_Sched_reduce(tmp_buf, recvbuf, count, datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
             else {
                 /* op is noncommutative and the order is not right */
                 mpi_errno = MPID_Sched_reduce(recvbuf, tmp_buf, count, datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
 
                 /* copy result back into recvbuf */
                 mpi_errno = MPID_Sched_copy(tmp_buf, count, datatype,
                                             recvbuf, count, datatype, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
             mask <<= 1;
@@ -414,11 +414,11 @@ int MPIR_Iallreduce_rec_dbl(const void *sendbuf, void *recvbuf, int count, MPI_D
     if (rank < 2*rem) {
         if (rank % 2) { /* odd */
             mpi_errno = MPID_Sched_send(recvbuf, count, datatype, rank-1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else { /* even */
             mpi_errno = MPID_Sched_recv(recvbuf, count, datatype, rank+1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -433,7 +433,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallreduce_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallreduce_intra(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -449,7 +449,7 @@ int MPIR_Iallreduce_intra(const void *sendbuf, void *recvbuf, int count, MPI_Dat
 
     if (!is_homogeneous) {
         mpi_errno = MPIR_Iallreduce_naive(sendbuf, recvbuf, count, datatype, op, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
@@ -477,12 +477,12 @@ int MPIR_Iallreduce_intra(const void *sendbuf, void *recvbuf, int count, MPI_Dat
     {
         /* use recursive doubling */
         mpi_errno = MPIR_Iallreduce_rec_dbl(sendbuf, recvbuf, count, datatype, op, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* do a reduce-scatter followed by allgather */
         mpi_errno = MPIR_Iallreduce_redscat_allgather(sendbuf, recvbuf, count, datatype, op, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -494,7 +494,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallreduce_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallreduce_inter(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
 /* Intercommunicator Allreduce.
@@ -519,43 +519,43 @@ int MPIR_Iallreduce_inter(const void *sendbuf, void *recvbuf, int count, MPI_Dat
         /* reduce from right group to rank 0*/
         root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
         mpi_errno = MPIR_Ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* no barrier, these reductions can be concurrent */
 
         /* reduce to rank 0 of right group */
         root = 0;
         mpi_errno = MPIR_Ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* reduce to rank 0 of left group */
         root = 0;
         mpi_errno = MPIR_Ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* no barrier, these reductions can be concurrent */
 
         /* reduce from right group to rank 0 */
         root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
         mpi_errno = MPIR_Ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* don't bcast until the reductions have finished */
     mpi_errno = MPID_Sched_barrier(s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Get the local intracommunicator */
     if (!comm_ptr->local_comm) {
         MPIR_Setup_intercomm_localcomm( comm_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     lcomm_ptr = comm_ptr->local_comm;
 
     MPIU_Assert(lcomm_ptr->coll_fns && lcomm_ptr->coll_fns->Ibcast_sched);
     mpi_errno = lcomm_ptr->coll_fns->Ibcast_sched(recvbuf, count, datatype, 0, lcomm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -567,7 +567,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallreduce_SMP
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallreduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -588,7 +588,7 @@ int MPIR_Iallreduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datat
     if (!is_commutative) {
         /* use flat fallback */
         mpi_errno = MPIR_Iallreduce_intra(sendbuf, recvbuf, count, datatype, op, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
@@ -603,10 +603,10 @@ int MPIR_Iallreduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datat
             /* IN_PLACE and not root of reduce. Data supplied to this
                allreduce is in recvbuf. Pass that as the sendbuf to reduce. */
             mpi_errno = nc->coll_fns->Ireduce_sched(recvbuf, NULL, count, datatype, op, 0, nc, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         } else {
             mpi_errno = nc->coll_fns->Ireduce_sched(sendbuf, recvbuf, count, datatype, op, 0, nc, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         MPID_SCHED_BARRIER(s);
     } else {
@@ -614,7 +614,7 @@ int MPIR_Iallreduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datat
         if (sendbuf != MPI_IN_PLACE) {
             mpi_errno = MPID_Sched_copy(sendbuf, count, datatype,
                                         recvbuf, count, datatype, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         MPID_SCHED_BARRIER(s);
     }
@@ -623,7 +623,7 @@ int MPIR_Iallreduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datat
     if (nrc != NULL) {
         MPIU_Assert(nrc->coll_fns && nrc->coll_fns->Iallreduce_sched);
         mpi_errno = nrc->coll_fns->Iallreduce_sched(MPI_IN_PLACE, recvbuf, count, datatype, op, nrc, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -631,7 +631,7 @@ int MPIR_Iallreduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datat
     if (comm_ptr->node_comm != NULL) {
         MPIU_Assert(nc->coll_fns && nc->coll_fns->Ibcast_sched);
         mpi_errno = nc->coll_fns->Ibcast_sched(recvbuf, count, datatype, 0, nc, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -645,7 +645,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iallreduce_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iallreduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -661,26 +661,26 @@ int MPIR_Iallreduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Data
         mpi_errno = comm_ptr->coll_fns->Iallreduce_req(sendbuf, recvbuf, count, datatype, op, comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Iallreduce_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Iallreduce_sched(sendbuf, recvbuf, count, datatype, op, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -693,7 +693,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Iallreduce
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Iallreduce - Combines values from all processes and distributes the result
                  back to all processes in a nonblocking way
@@ -723,7 +723,7 @@ int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLREDUCE);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLREDUCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -790,13 +790,13 @@ int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count,
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Iallreduce_impl(sendbuf, recvbuf, count, datatype, op, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLREDUCE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ialltoall.c b/src/mpi/coll/ialltoall.c
index 846032e..8bdd163 100644
--- a/src/mpi/coll/ialltoall.c
+++ b/src/mpi/coll/ialltoall.c
@@ -43,7 +43,7 @@ int MPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, voi
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoall_inplace
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoall_inplace(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -84,15 +84,15 @@ int MPIR_Ialltoall_inplace(const void *sendbuf, int sendcount, MPI_Datatype send
                 mpi_errno = MPID_Sched_copy(((char *)recvbuf + peer*recvcount*recvtype_extent),
                                             recvcount, recvtype,
                                             tmp_buf, nbytes, MPI_BYTE, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
 
                 /* now simultaneously send from tmp_buf and recv to recvbuf */
                 mpi_errno = MPID_Sched_send(tmp_buf, nbytes, MPI_BYTE, peer, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 mpi_errno = MPID_Sched_recv(((char *)recvbuf + peer*recvcount*recvtype_extent),
                                             recvcount, recvtype, peer, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
         }
@@ -109,7 +109,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoall_bruck
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoall_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -144,11 +144,11 @@ int MPIR_Ialltoall_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendty
     mpi_errno = MPID_Sched_copy(((char *) sendbuf + rank*sendcount*sendtype_extent),
                                 (comm_size - rank)*sendcount, sendtype,
                                 recvbuf, (comm_size - rank)*recvcount, recvtype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_copy(sendbuf, rank*sendcount, sendtype,
                                 ((char *) recvbuf + (comm_size-rank)*recvcount*recvtype_extent),
                                 rank*recvcount, recvtype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(s);
     /* Input data is now stored in recvbuf with datatype recvtype */
 
@@ -180,22 +180,22 @@ int MPIR_Ialltoall_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendty
 
         mpi_errno = MPIR_Type_create_indexed_block_impl(count, recvcount,
                                                         displs, recvtype, &newtype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Type_commit_impl(&newtype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_Datatype_get_size_macro(newtype, newtype_size);
 
         /* we will usually copy much less than nbytes */
         mpi_errno = MPID_Sched_copy(recvbuf, 1, newtype, tmp_buf, newtype_size, MPI_BYTE, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
         /* now send and recv in parallel */
         mpi_errno = MPID_Sched_send(tmp_buf, newtype_size, MPI_BYTE, dst, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_Sched_recv(recvbuf, 1, newtype, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
         MPIR_Type_free_impl(&newtype);
@@ -218,11 +218,11 @@ int MPIR_Ialltoall_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendty
     mpi_errno = MPID_Sched_copy(((char *) recvbuf + (rank+1)*recvcount*recvtype_extent),
                                 (comm_size - rank - 1)*recvcount, recvtype,
                                 tmp_buf, (comm_size - rank - 1)*recvcount, recvtype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_copy(recvbuf, (rank+1)*recvcount, recvtype,
                                 ((char *) tmp_buf + (comm_size-rank-1)*recvcount*recvtype_extent),
                                 (rank+1)*recvcount, recvtype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(s);
 
     /* Blocks are in the reverse order now (comm_size-1 to 0).
@@ -233,7 +233,7 @@ int MPIR_Ialltoall_bruck(const void *sendbuf, int sendcount, MPI_Datatype sendty
                                     recvcount, recvtype,
                                     ((char *) recvbuf + (comm_size-i-1)*recvcount*recvtype_extent),
                                     recvcount, recvtype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPIR_SCHED_CHKPMEM_COMMIT(s);
@@ -253,7 +253,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoall_perm_sr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoall_perm_sr(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -280,14 +280,14 @@ int MPIR_Ialltoall_perm_sr(const void *sendbuf, int sendcount, MPI_Datatype send
             dst = (rank+i+ii) % comm_size;
             mpi_errno = MPID_Sched_recv(((char *)recvbuf + dst*recvcount*recvtype_extent),
                                         recvcount, recvtype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         for (i = 0; i < ss; i++) {
             dst = (rank-i-ii+comm_size) % comm_size;
             mpi_errno = MPID_Sched_send(((char *)sendbuf + dst*sendcount*sendtype_extent),
                                         sendcount, sendtype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         /* force the (2*ss) sends/recvs above to complete before posting additional ops */
@@ -306,7 +306,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoall_pairwise
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoall_pairwise(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -328,7 +328,7 @@ int MPIR_Ialltoall_pairwise(const void *sendbuf, int sendcount, MPI_Datatype sen
                                 sendcount, sendtype,
                                 ((char *)recvbuf + rank*recvcount*recvtype_extent),
                                 recvcount, recvtype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     is_pof2 = MPIU_is_pof2(comm_size, NULL);
 
@@ -345,10 +345,10 @@ int MPIR_Ialltoall_pairwise(const void *sendbuf, int sendcount, MPI_Datatype sen
 
         mpi_errno = MPID_Sched_send(((char *)sendbuf + dst*sendcount*sendtype_extent),
                                     sendcount, sendtype, dst, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_Sched_recv(((char *)recvbuf + src*recvcount*recvtype_extent),
                                     recvcount, recvtype, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -406,7 +406,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoall_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoall_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -419,27 +419,27 @@ int MPIR_Ialltoall_intra(const void *sendbuf, int sendcount, MPI_Datatype sendty
 
     if (sendbuf == MPI_IN_PLACE) {
         mpi_errno = MPIR_Ialltoall_inplace(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else if ((nbytes <= MPIR_CVAR_ALLTOALL_SHORT_MSG_SIZE) && (comm_size >= 8)) {
         /* use the indexing algorithm by Jehoshua Bruck et al,
          * IEEE TPDS, Nov. 97 */
         mpi_errno = MPIR_Ialltoall_bruck(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else if (nbytes <= MPIR_CVAR_ALLTOALL_MEDIUM_MSG_SIZE) {
         /* Medium-size message. Use isend/irecv with scattered
            destinations. Use Tony Ladd's modification to post only
            a small number of isends/irecvs at a time. */
         mpi_errno = MPIR_Ialltoall_perm_sr(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* Long message. If comm_size is a power-of-two, do a pairwise
            exchange using exclusive-or to create pairs. Else send to
            rank+i, receive from rank-i. */
         mpi_errno = MPIR_Ialltoall_pairwise(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -452,7 +452,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoall_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoall_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
 /* Intercommunicator alltoall. We use a pairwise exchange algorithm
@@ -503,9 +503,9 @@ int MPIR_Ialltoall_inter(const void *sendbuf, int sendcount, MPI_Datatype sendty
         }
 
         mpi_errno = MPID_Sched_send(sendaddr, sendcount, sendtype, dst, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_Sched_recv(recvaddr, recvcount, recvtype, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -518,7 +518,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoall_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoall_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -534,26 +534,26 @@ int MPIR_Ialltoall_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
         mpi_errno = comm_ptr->coll_fns->Ialltoall_req(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Ialltoall_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Ialltoall_sched(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -566,7 +566,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ialltoall
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ialltoall - Sends data from all to all processes in a nonblocking way
 
@@ -596,7 +596,7 @@ int MPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLTOALL);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLTOALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -664,13 +664,13 @@ int MPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ialltoall_impl(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLTOALL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ialltoallv.c b/src/mpi/coll/ialltoallv.c
index e68dfc3..97a2661 100644
--- a/src/mpi/coll/ialltoallv.c
+++ b/src/mpi/coll/ialltoallv.c
@@ -33,7 +33,7 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoallv_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoallv_intra(const void *sendbuf, const int sendcounts[], const int sdispls[],
                           MPI_Datatype sendtype, void *recvbuf, const int recvcounts[],
                           const int rdispls[], MPI_Datatype recvtype, MPID_Comm *comm_ptr,
@@ -93,15 +93,15 @@ int MPIR_Ialltoallv_intra(const void *sendbuf, const int sendcounts[], const int
 
                     mpi_errno = MPID_Sched_send(((char *)recvbuf + rdispls[dst]*recv_extent),
                                                 recvcounts[dst], recvtype, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     mpi_errno = MPID_Sched_recv(tmp_buf, recvcounts[dst], recvtype, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
 
                     mpi_errno = MPID_Sched_copy(tmp_buf, recvcounts[dst], recvtype,
                                                 ((char *)recvbuf + rdispls[dst]*recv_extent),
                                                 recvcounts[dst], recvtype, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
             }
@@ -130,7 +130,7 @@ int MPIR_Ialltoallv_intra(const void *sendbuf, const int sendcounts[], const int
                                                      rdispls[dst]*recv_extent);
                     mpi_errno = MPID_Sched_recv((char *)recvbuf+rdispls[dst]*recv_extent,
                                                 recvcounts[dst], recvtype, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
 
@@ -141,7 +141,7 @@ int MPIR_Ialltoallv_intra(const void *sendbuf, const int sendcounts[], const int
                                                      sdispls[dst]*send_extent);
                     mpi_errno = MPID_Sched_send((char *)sendbuf+sdispls[dst]*send_extent,
                                                 sendcounts[dst], sendtype, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
 
@@ -161,7 +161,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoallv_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoallv_inter(const void *sendbuf, const int sendcounts[], const int sdispls[],
                           MPI_Datatype sendtype, void *recvbuf, const int recvcounts[],
                           const int rdispls[], MPI_Datatype recvtype, MPID_Comm *comm_ptr,
@@ -228,11 +228,11 @@ int MPIR_Ialltoallv_inter(const void *sendbuf, const int sendcounts[], const int
             src = MPI_PROC_NULL;
 
         mpi_errno = MPID_Sched_send(sendaddr, sendcount, sendtype, dst, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_Sched_recv(recvaddr, recvcount, recvtype, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_Sched_barrier(s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -244,7 +244,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoallv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoallv_impl(const void *sendbuf, const int sendcounts[], const int sdispls[],
                          MPI_Datatype sendtype, void *recvbuf, const int recvcounts[],
                          const int rdispls[], MPI_Datatype recvtype, MPID_Comm *comm_ptr,
@@ -263,26 +263,26 @@ int MPIR_Ialltoallv_impl(const void *sendbuf, const int sendcounts[], const int
         mpi_errno = comm_ptr->coll_fns->Ialltoallv_req(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Ialltoallv_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Ialltoallv_sched(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -295,7 +295,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ialltoallv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ialltoallv - Sends data from all to all processes in a nonblocking way;
    each process may send a different amount of data and provide displacements
@@ -329,7 +329,7 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLTOALLV);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLTOALLV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -399,13 +399,13 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ialltoallv_impl(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLTOALLV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ialltoallw.c b/src/mpi/coll/ialltoallw.c
index 9651b19..b42992a 100644
--- a/src/mpi/coll/ialltoallw.c
+++ b/src/mpi/coll/ialltoallw.c
@@ -54,7 +54,7 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoallw_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoallw_intra(const void *sendbuf, const int sendcounts[], const int sdispls[],
                           const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
                           const int rdispls[], const MPI_Datatype recvtypes[],
@@ -114,15 +114,15 @@ int MPIR_Ialltoallw_intra(const void *sendbuf, const int sendcounts[], const int
 
                     mpi_errno = MPID_Sched_send(((char *)recvbuf + rdispls[dst]),
                                                 recvcounts[dst], recvtypes[dst], dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     mpi_errno = MPID_Sched_recv(adj_tmp_buf, recvcounts[dst], recvtypes[dst], dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
 
                     mpi_errno = MPID_Sched_copy(adj_tmp_buf, recvcounts[dst], recvtypes[dst],
                                                 ((char *)recvbuf + rdispls[dst]),
                                                 recvcounts[dst], recvtypes[dst], s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
             }
@@ -145,7 +145,7 @@ int MPIR_Ialltoallw_intra(const void *sendbuf, const int sendcounts[], const int
                         mpi_errno = MPID_Sched_recv((char *)recvbuf+rdispls[dst],
                                                     recvcounts[dst], recvtypes[dst],
                                                     dst, comm_ptr, s);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
             }
@@ -158,7 +158,7 @@ int MPIR_Ialltoallw_intra(const void *sendbuf, const int sendcounts[], const int
                         mpi_errno = MPID_Sched_send((char *)sendbuf+sdispls[dst],
                                                     sendcounts[dst], sendtypes[dst],
                                                     dst, comm_ptr, s);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
             }
@@ -179,7 +179,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoallw_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoallw_inter(const void *sendbuf, const int sendcounts[], const int sdispls[],
                           const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
                           const int rdispls[], const MPI_Datatype recvtypes[],
@@ -233,10 +233,10 @@ int MPIR_Ialltoallw_inter(const void *sendbuf, const int sendcounts[], const int
         }
 
         mpi_errno = MPID_Sched_send(sendaddr, sendcount, sendtype, dst, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         /* sendrecv, no barrier here */
         mpi_errno = MPID_Sched_recv(recvaddr, recvcount, recvtype, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -249,7 +249,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ialltoallw_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ialltoallw_impl(const void *sendbuf, const int sendcounts[], const int sdispls[],
                          const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
                          const int rdispls[], const MPI_Datatype recvtypes[], MPID_Comm *comm_ptr,
@@ -268,26 +268,26 @@ int MPIR_Ialltoallw_impl(const void *sendbuf, const int sendcounts[], const int
         mpi_errno = comm_ptr->coll_fns->Ialltoallw_req(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Ialltoallw_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Ialltoallw_sched(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -300,7 +300,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ialltoallw
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ialltoallw - Nonblocking generalized all-to-all communication allowing
    different datatypes, counts, and displacements for each partner
@@ -334,7 +334,7 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IALLTOALLW);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IALLTOALLW);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -375,7 +375,7 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
             MPIR_ERRTEST_ARGNULL(rdispls,"rdispls", mpi_errno);
             MPIR_ERRTEST_ARGNULL(recvtypes,"recvtypes", mpi_errno);
             if (comm_ptr->comm_kind == MPID_INTERCOMM && sendbuf == MPI_IN_PLACE) {
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sendbuf_inplace");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sendbuf_inplace");
             }
             MPIR_ERRTEST_ARGNULL(request,"request", mpi_errno);
             /* TODO more checks may be appropriate (counts, in_place, etc) */
@@ -387,13 +387,13 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ialltoallw_impl(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IALLTOALLW);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ibarrier.c b/src/mpi/coll/ibarrier.c
index defcb74..2176658 100644
--- a/src/mpi/coll/ibarrier.c
+++ b/src/mpi/coll/ibarrier.c
@@ -52,7 +52,7 @@ int MPI_Ibarrier(MPI_Comm comm, MPI_Request *request) __attribute__((weak,alias(
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibarrier_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ibarrier_intra(MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -72,13 +72,13 @@ int MPIR_Ibarrier_intra(MPID_Comm *comm_ptr, MPID_Sched_t s)
         src = (rank - mask + size) % size;
 
         mpi_errno = MPID_Sched_send(NULL, 0, MPI_BYTE, dst, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPID_Sched_recv(NULL, 0, MPI_BYTE, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPID_Sched_barrier(s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mask <<= 1;
     }
@@ -95,7 +95,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibarrier_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ibarrier_inter(MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -110,14 +110,14 @@ int MPIR_Ibarrier_inter(MPID_Comm *comm_ptr, MPID_Sched_t s)
     /* Get the local intracommunicator */
     if (!comm_ptr->local_comm) {
         mpi_errno = MPIR_Setup_intercomm_localcomm(comm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* do a barrier on the local intracommunicator */
     MPIU_Assert(comm_ptr->local_comm->coll_fns && comm_ptr->local_comm->coll_fns->Ibarrier_sched);
     if(comm_ptr->local_size != 1) {
         mpi_errno = comm_ptr->local_comm->coll_fns->Ibarrier_sched(comm_ptr->local_comm, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
     /* rank 0 on each group does an intercommunicator broadcast to the
@@ -134,27 +134,27 @@ int MPIR_Ibarrier_inter(MPID_Comm *comm_ptr, MPID_Sched_t s)
     if (comm_ptr->is_low_group) {
         root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
         mpi_errno = comm_ptr->coll_fns->Ibcast_sched(buf, 1, MPI_BYTE, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         MPID_SCHED_BARRIER(s);
 
         /* receive bcast from right */
         root = 0;
         mpi_errno = comm_ptr->coll_fns->Ibcast_sched(buf, 1, MPI_BYTE, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* receive bcast from left */
         root = 0;
         mpi_errno = comm_ptr->coll_fns->Ibcast_sched(buf, 1, MPI_BYTE, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         MPID_SCHED_BARRIER(s);
 
         /* bcast to left */
         root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
         mpi_errno = comm_ptr->coll_fns->Ibcast_sched(buf, 1, MPI_BYTE, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPIR_SCHED_CHKPMEM_COMMIT(s);
@@ -168,7 +168,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibarrier_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ibarrier_impl(MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -184,7 +184,7 @@ int MPIR_Ibarrier_impl(MPID_Comm *comm_ptr, MPI_Request *request)
         mpi_errno = comm_ptr->coll_fns->Ibarrier_req(comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
@@ -192,18 +192,18 @@ int MPIR_Ibarrier_impl(MPID_Comm *comm_ptr, MPI_Request *request)
 
     if (comm_ptr->local_size != 1 || comm_ptr->comm_kind == MPID_INTERCOMM) {
         mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_Sched_create(&s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         MPIU_Assert(comm_ptr->coll_fns->Ibarrier_sched != NULL);
         mpi_errno = comm_ptr->coll_fns->Ibarrier_sched(comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
         if (reqp)
             *request = reqp->handle;
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -217,7 +217,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ibarrier
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ibarrier - Notifies the process that it has reached the barrier and returns
                immediately
@@ -250,7 +250,7 @@ int MPI_Ibarrier(MPI_Comm comm, MPI_Request *request)
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IBARRIER);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IBARRIER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -286,13 +286,13 @@ int MPI_Ibarrier(MPI_Comm comm, MPI_Request *request)
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ibarrier_impl(comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IBARRIER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ibcast.c b/src/mpi/coll/ibcast.c
index a35bcd5..ae985d3 100644
--- a/src/mpi/coll/ibcast.c
+++ b/src/mpi/coll/ibcast.c
@@ -37,7 +37,7 @@ int MPI_Ibcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Com
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibcast_binomial
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ibcast_binomial(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -87,7 +87,7 @@ int MPIR_Ibcast_binomial(void *buffer, int count, MPI_Datatype datatype, int roo
         /* TODO: Pipeline the packing and communication */
         if (rank == root) {
             mpi_errno = MPID_Sched_copy(buffer, count, datatype, tmp_buf, nbytes, MPI_PACKED, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
     }
@@ -128,7 +128,7 @@ int MPIR_Ibcast_binomial(void *buffer, int count, MPI_Datatype datatype, int roo
                 mpi_errno = MPID_Sched_recv(tmp_buf, nbytes, MPI_BYTE, src, comm_ptr, s);
             else
                 mpi_errno = MPID_Sched_recv(buffer, count, datatype, src, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             MPID_SCHED_BARRIER(s);
 
@@ -157,7 +157,7 @@ int MPIR_Ibcast_binomial(void *buffer, int count, MPI_Datatype datatype, int roo
                 mpi_errno = MPID_Sched_send(tmp_buf, nbytes, MPI_BYTE, dst, comm_ptr, s);
             else
                 mpi_errno = MPID_Sched_send(buffer, count, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             /* NOTE: This is departure from MPIR_Bcast_binomial.  A true analog
              * would put an MPID_Sched_barrier here after every send. */
@@ -169,7 +169,7 @@ int MPIR_Ibcast_binomial(void *buffer, int count, MPI_Datatype datatype, int roo
         if (rank != root) {
             MPID_SCHED_BARRIER(s);
             mpi_errno = MPID_Sched_copy(tmp_buf, nbytes, MPI_PACKED, buffer, count, datatype, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
     }
@@ -191,7 +191,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iscatter_for_bcast
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iscatter_for_bcast(void *tmp_buf, int root, MPID_Comm *comm_ptr, int nbytes, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -233,7 +233,7 @@ int MPIR_Iscatter_for_bcast(void *tmp_buf, int root, MPID_Comm *comm_ptr, int nb
             if (recv_size > 0) {
                 mpi_errno = MPID_Sched_recv(((char *)tmp_buf + relative_rank*scatter_size),
                                             recv_size, MPI_BYTE, src, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
             break;
@@ -258,7 +258,7 @@ int MPIR_Iscatter_for_bcast(void *tmp_buf, int root, MPID_Comm *comm_ptr, int nb
                     dst -= comm_size;
                 mpi_errno = MPID_Sched_send(((char *)tmp_buf + scatter_size*(relative_rank+mask)),
                                             send_size, MPI_BYTE, dst, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 curr_size -= send_size;
             }
@@ -313,7 +313,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibcast_scatter_rec_dbl_allgather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ibcast_scatter_rec_dbl_allgather(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -368,14 +368,14 @@ int MPIR_Ibcast_scatter_rec_dbl_allgather(void *buffer, int count, MPI_Datatype
         if (rank == root) {
             mpi_errno = MPID_Sched_copy(buffer, count, datatype,
                                         tmp_buf, nbytes, MPI_BYTE, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
     }
 
 
     mpi_errno = MPIR_Iscatter_for_bcast(tmp_buf, root, comm_ptr, nbytes, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* this is the block size used for the scatter operation */
     scatter_size = (nbytes + comm_size - 1) / comm_size; /* ceiling division */
@@ -421,12 +421,12 @@ int MPIR_Ibcast_scatter_rec_dbl_allgather(void *buffer, int count, MPI_Datatype
 
             mpi_errno = MPID_Sched_send(((char *)tmp_buf + send_offset),
                                         curr_size, MPI_BYTE, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             /* sendrecv, no barrier */
             mpi_errno = MPID_Sched_recv(((char *)tmp_buf + recv_offset),
                                         incoming_count,
                                         MPI_BYTE, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             curr_size += incoming_count;
@@ -484,7 +484,7 @@ int MPIR_Ibcast_scatter_rec_dbl_allgather(void *buffer, int count, MPI_Datatype
                        sent now. */
                     mpi_errno = MPID_Sched_send(((char *)tmp_buf + offset),
                                                 incoming_count, MPI_BYTE, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
                 /* recv only if this proc. doesn't have data and sender
@@ -504,7 +504,7 @@ int MPIR_Ibcast_scatter_rec_dbl_allgather(void *buffer, int count, MPI_Datatype
                        whose data we don't have */
                     mpi_errno = MPID_Sched_recv(((char *)tmp_buf + offset),
                                                 incoming_count, MPI_BYTE, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
 
                     curr_size += incoming_count;
@@ -523,7 +523,7 @@ int MPIR_Ibcast_scatter_rec_dbl_allgather(void *buffer, int count, MPI_Datatype
         if (rank != root) {
             mpi_errno = MPID_Sched_copy(tmp_buf, nbytes, MPI_BYTE,
                                         buffer, count, datatype, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -554,7 +554,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibcast_scatter_ring_allgather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ibcast_scatter_ring_allgather(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -603,13 +603,13 @@ int MPIR_Ibcast_scatter_ring_allgather(void *buffer, int count, MPI_Datatype dat
         /* TODO: Pipeline the packing and communication */
         if (rank == root) {
             mpi_errno = MPID_Sched_copy(buffer, count, datatype, tmp_buf, nbytes, MPI_BYTE, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
     }
 
     mpi_errno = MPIR_Iscatter_for_bcast(tmp_buf, root, comm_ptr, nbytes, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* this is the block size used for the scatter operation */
     scatter_size = (nbytes + comm_size - 1) / comm_size; /* ceiling division */
@@ -637,11 +637,11 @@ int MPIR_Ibcast_scatter_ring_allgather(void *buffer, int count, MPI_Datatype dat
 
         mpi_errno = MPID_Sched_send(((char *)tmp_buf + right_disp),
                                     right_count, MPI_BYTE, right, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         /* sendrecv, no barrier here */
         mpi_errno = MPID_Sched_recv(((char *)tmp_buf + left_disp),
                                     left_count, MPI_BYTE, left, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
         j     = jnext;
@@ -650,7 +650,7 @@ int MPIR_Ibcast_scatter_ring_allgather(void *buffer, int count, MPI_Datatype dat
 
     if (!is_contig && rank != root) {
         mpi_errno = MPID_Sched_copy(tmp_buf, nbytes, MPI_BYTE, buffer, count, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPIR_SCHED_CHKPMEM_COMMIT(s);
@@ -668,7 +668,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibcast_SMP
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ibcast_SMP(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -720,7 +720,7 @@ int MPIR_Ibcast_SMP(void *buffer, int count, MPI_Datatype datatype, int root, MP
             mpi_errno = MPID_Sched_recv(buffer, count, datatype, MPIU_Get_intranode_rank(comm_ptr, root),
                                         comm_ptr->node_comm, s);
         }
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -730,7 +730,7 @@ int MPIR_Ibcast_SMP(void *buffer, int count, MPI_Datatype datatype, int root, MP
         mpi_errno = comm_ptr->node_roots_comm->coll_fns->Ibcast_sched(buffer, count, datatype,
                                                                 MPIU_Get_internode_rank(comm_ptr, root),
                                                                 comm_ptr->node_roots_comm, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* don't allow the local ops for the intranode phase to start until this has completed */
         MPID_SCHED_BARRIER(s);
@@ -739,7 +739,7 @@ int MPIR_Ibcast_SMP(void *buffer, int count, MPI_Datatype datatype, int root, MP
     if (comm_ptr->node_comm != NULL)
     {
         mpi_errno = comm_ptr->node_comm->coll_fns->Ibcast_sched(buffer, count, datatype, 0, comm_ptr->node_comm, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -754,7 +754,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibcast_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ibcast_intra(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -779,17 +779,17 @@ int MPIR_Ibcast_intra(void *buffer, int count, MPI_Datatype datatype, int root,
         (comm_size < MPIR_CVAR_BCAST_MIN_PROCS))
     {
         mpi_errno = MPIR_Ibcast_binomial(buffer, count, datatype, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else /* (nbytes >= MPIR_CVAR_BCAST_SHORT_MSG_SIZE) && (comm_size >= MPIR_CVAR_BCAST_MIN_PROCS) */
     {
         if ((nbytes < MPIR_CVAR_BCAST_LONG_MSG_SIZE) && (MPIU_is_pof2(comm_size, NULL))) {
             mpi_errno = MPIR_Ibcast_scatter_rec_dbl_allgather(buffer, count, datatype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             mpi_errno = MPIR_Ibcast_scatter_ring_allgather(buffer, count, datatype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -805,7 +805,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibcast_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -824,27 +824,27 @@ int MPIR_Ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root,
     {
         /* root sends to rank 0 on remote group and returns */
         mpi_errno = MPID_Sched_send(buffer, count, datatype, 0, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else
     {
         /* remote group. rank 0 on remote group receives from root */
         if (comm_ptr->rank == 0) {
             mpi_errno = MPID_Sched_recv(buffer, count, datatype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
 
         if (comm_ptr->local_comm == NULL) {
             mpi_errno = MPIR_Setup_intercomm_localcomm(comm_ptr);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         /* now do the usual broadcast on this intracommunicator
            with rank 0 as root. */
         MPIU_Assert(comm_ptr->local_comm->coll_fns && comm_ptr->local_comm->coll_fns->Ibcast_sched);
         mpi_errno = comm_ptr->local_comm->coll_fns->Ibcast_sched(buffer, count, datatype, root, comm_ptr->local_comm, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -856,7 +856,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibcast_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ibcast_impl(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -872,25 +872,25 @@ int MPIR_Ibcast_impl(void *buffer, int count, MPI_Datatype datatype, int root, M
         mpi_errno = comm_ptr->coll_fns->Ibcast_req(buffer, count, datatype, root, comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns->Ibcast_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Ibcast_sched(buffer, count, datatype, root, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -903,7 +903,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ibcast
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ibcast - Broadcasts a message from the process with rank "root" to
              all other processes of the communicator in a nonblocking way
@@ -932,7 +932,7 @@ int MPI_Ibcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Com
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IBCAST);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IBCAST);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -980,13 +980,13 @@ int MPI_Ibcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Com
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ibcast_impl(buffer, count, datatype, root, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IBCAST);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iexscan.c b/src/mpi/coll/iexscan.c
index d5dbb3f..aca8fed 100644
--- a/src/mpi/coll/iexscan.c
+++ b/src/mpi/coll/iexscan.c
@@ -75,7 +75,7 @@ int MPI_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iexscan
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -108,7 +108,7 @@ int MPIR_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype dat
 
     mpi_errno = MPID_Sched_copy((sendbuf == MPI_IN_PLACE ? (const void *)recvbuf : sendbuf), count, datatype,
                                partial_scan, count, datatype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     flag = 0;
     mask = 0x1;
@@ -117,15 +117,15 @@ int MPIR_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype dat
         if (dst < comm_size) {
             /* Send partial_scan to dst. Recv into tmp_buf */
             mpi_errno = MPID_Sched_send(partial_scan, count, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             /* sendrecv, no barrier here */
             mpi_errno = MPID_Sched_recv(tmp_buf, count, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             if (rank > dst) {
                 mpi_errno = MPID_Sched_reduce(tmp_buf, partial_scan, count, datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
 
                 /* On rank 0, recvbuf is not defined.  For sendbuf==MPI_IN_PLACE
@@ -139,14 +139,14 @@ int MPIR_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype dat
                         /* simply copy data recd from rank 0 into recvbuf */
                         mpi_errno = MPID_Sched_copy(tmp_buf, count, datatype,
                                                     recvbuf, count, datatype, s);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                         MPID_SCHED_BARRIER(s);
 
                         flag = 1;
                     }
                     else {
                         mpi_errno = MPID_Sched_reduce(tmp_buf, recvbuf, count, datatype, op, s);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                         MPID_SCHED_BARRIER(s);
                     }
                 }
@@ -154,17 +154,17 @@ int MPIR_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype dat
             else {
                 if (is_commutative) {
                     mpi_errno = MPID_Sched_reduce(tmp_buf, partial_scan, count, datatype, op, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
                 else {
                     mpi_errno = MPID_Sched_reduce(partial_scan, tmp_buf, count, datatype, op, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
 
                     mpi_errno = MPID_Sched_copy(tmp_buf, count, datatype,
                                                 partial_scan, count, datatype, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
             }
@@ -183,7 +183,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iexscan_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iexscan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -199,26 +199,26 @@ int MPIR_Iexscan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatyp
         mpi_errno = comm_ptr->coll_fns->Iexscan_req(sendbuf, recvbuf, count, datatype, op, comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Iexscan_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Iexscan_sched(sendbuf, recvbuf, count, datatype, op, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -231,7 +231,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Iexscan
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Iexscan - Computes the exclusive scan (partial reductions) of data on a
               collection of processes in a nonblocking way
@@ -261,7 +261,7 @@ int MPI_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IEXSCAN);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IEXSCAN);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -321,13 +321,13 @@ int MPI_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Iexscan_impl(sendbuf, recvbuf, count, datatype, op, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IEXSCAN);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/igather.c b/src/mpi/coll/igather.c
index 0b51f39..44a9af3 100644
--- a/src/mpi/coll/igather.c
+++ b/src/mpi/coll/igather.c
@@ -53,7 +53,7 @@ int MPI_Igather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void
 #undef FUNCNAME
 #define FUNCNAME MPIR_Igather_binomial
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -136,14 +136,14 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
             if (sendbuf != MPI_IN_PLACE) {
                 mpi_errno = MPIR_Localcopy(sendbuf, sendcount, sendtype,
                                            ((char *) recvbuf + extent*recvcount*rank), recvcount, recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         }
         else if (tmp_buf_size && (nbytes < MPIR_CVAR_GATHER_VSMALL_MSG_SIZE)) {
             /* copy from sendbuf into tmp_buf */
             mpi_errno = MPIR_Localcopy(sendbuf, sendcount, sendtype,
                                        tmp_buf, nbytes, MPI_BYTE);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         curr_cnt = nbytes;
 
@@ -168,15 +168,15 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
                              * rank 0. */
                             char *rp = (char *)recvbuf + (((rank + mask) % comm_size)*recvcount*extent);
                             mpi_errno = MPID_Sched_recv(rp, (recvblks * recvcount), recvtype, src, comm_ptr, s);
-                            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                             mpi_errno = MPID_Sched_barrier(s);
-                            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                         }
                         else if (nbytes < MPIR_CVAR_GATHER_VSMALL_MSG_SIZE) {
                             mpi_errno = MPID_Sched_recv(tmp_buf, (recvblks * nbytes), MPI_BYTE, src, comm_ptr, s);
-                            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                             mpi_errno = MPID_Sched_barrier(s);
-                            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                             copy_offset = rank + mask;
                             copy_blks = recvblks;
                         }
@@ -187,14 +187,14 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
                             displs[1] = 0;
 
                             mpi_errno = MPIR_Type_indexed_impl(2, blocks, displs, recvtype, &tmp_type);
-                            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                             mpi_errno = MPIR_Type_commit_impl(&tmp_type);
-                            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                             mpi_errno = MPID_Sched_recv(recvbuf, 1, tmp_type, src, comm_ptr, s);
-                            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                             mpi_errno = MPID_Sched_barrier(s);
-                            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                             /* this "premature" free is safe b/c the sched holds an actual ref to keep it alive */
                             MPIR_Type_free_impl(&tmp_type);
@@ -215,9 +215,9 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
                             offset = (mask - 1) * nbytes;
                         mpi_errno = MPID_Sched_recv(((char *)tmp_buf + offset), (recvblks * nbytes),
                                                     MPI_BYTE, src, comm_ptr, s);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                         mpi_errno = MPID_Sched_barrier(s);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                         curr_cnt += (recvblks * nbytes);
                     }
                 }
@@ -229,15 +229,15 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
                 if (!tmp_buf_size) {
                     /* leaf nodes send directly from sendbuf */
                     mpi_errno = MPID_Sched_send(sendbuf, sendcount, sendtype, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     mpi_errno = MPID_Sched_barrier(s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 else if (nbytes < MPIR_CVAR_GATHER_VSMALL_MSG_SIZE) {
                     mpi_errno = MPID_Sched_send(tmp_buf, curr_cnt, MPI_BYTE, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     mpi_errno = MPID_Sched_barrier(s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 else {
                     blocks[0] = sendcount;
@@ -248,12 +248,12 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
                     types[1] = MPI_BYTE;
 
                     mpi_errno = MPIR_Type_create_struct_impl(2, blocks, struct_displs, types, &tmp_type);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     mpi_errno = MPIR_Type_commit_impl(&tmp_type);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                     mpi_errno = MPID_Sched_send(MPI_BOTTOM, 1, tmp_type, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
 
                     /* this "premature" free is safe b/c the sched holds an actual ref to keep it alive */
@@ -271,12 +271,12 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
             mpi_errno = MPID_Sched_copy(tmp_buf, nbytes * (comm_size - copy_offset), MPI_BYTE,
                                        ((char *)recvbuf + extent * recvcount * copy_offset),
                                        recvcount * (comm_size - copy_offset), recvtype, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             mpi_errno = MPID_Sched_copy((char *)tmp_buf + nbytes * (comm_size - copy_offset),
                                         nbytes * (copy_blks - comm_size + copy_offset), MPI_BYTE,
                                         recvbuf, recvcount * (copy_blks - comm_size + copy_offset),
                                         recvtype, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 #ifdef MPID_HAS_HETERO
@@ -298,14 +298,14 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
         if (sendbuf != MPI_IN_PLACE) {
             mpi_errno = MPIR_Pack_impl(sendbuf, sendcount, sendtype, tmp_buf,
                                        tmp_buf_size, &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             nbytes = position;
         }
         else {
             /* do a dummy pack just to calculate nbytes */
             mpi_errno = MPIR_Pack_impl(recvbuf, 1, recvtype, tmp_buf,
                                        tmp_buf_size, &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             nbytes = position*recvcount;
         }
 
@@ -334,7 +334,7 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
                 dst = (dst + root) % comm_size;
                 mpi_errno = MPIC_Send(tmp_buf, curr_cnt, MPI_BYTE, dst,
                                          MPIR_GATHER_TAG, comm_ptr, errflag);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 break;
             }
             mask <<= 1;
@@ -348,19 +348,19 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
                 mpi_errno = MPIR_Unpack_impl(tmp_buf, tmp_buf_size, &position,
                                              ((char *) recvbuf + extent*recvcount*rank),
                                              recvcount*(comm_size-rank), recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             else {
                 position = nbytes;
                 mpi_errno = MPIR_Unpack_impl(tmp_buf, tmp_buf_size, &position,
                                              ((char *) recvbuf + extent*recvcount*(rank+1)),
                                              recvcount*(comm_size-rank-1), recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             if (root != 0) {
                 mpi_errno = MPIR_Unpack_impl(tmp_buf, tmp_buf_size, &position, recvbuf,
                                              recvcount*rank, recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         }
 
@@ -379,13 +379,13 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Igather_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Igather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
 
     mpi_errno = MPIR_Igather_binomial(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -396,7 +396,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Igather_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Igather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -440,7 +440,7 @@ int MPIR_Igather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
         if (root == MPI_ROOT) {
             /* root receives data from rank 0 on remote group */
             mpi_errno = MPID_Sched_recv(recvbuf, recvcount*remote_size, recvtype, 0, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             /* remote group. Rank 0 allocates temporary buffer, does
@@ -463,7 +463,7 @@ int MPIR_Igather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
             /* all processes in remote group form new intracommunicator */
             if (!comm_ptr->local_comm) {
                 mpi_errno = MPIR_Setup_intercomm_localcomm( comm_ptr );
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
 
             newcomm_ptr = comm_ptr->local_comm;
@@ -473,11 +473,11 @@ int MPIR_Igather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
             mpi_errno = newcomm_ptr->coll_fns->Igather_sched(sendbuf, sendcount, sendtype,
                                                        tmp_buf, sendcount, sendtype, 0,
                                                        newcomm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             if (rank == 0) {
                 mpi_errno = MPID_Sched_send(tmp_buf, sendcount*local_size, sendtype, root, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -491,12 +491,12 @@ int MPIR_Igather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
             for (i=0; i<remote_size; i++) {
                 mpi_errno = MPID_Sched_recv(((char *)recvbuf+recvcount*i*extent),
                                             recvcount, recvtype, i, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         }
         else {
             mpi_errno = MPID_Sched_send(sendbuf, sendcount, sendtype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -511,7 +511,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Igather_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Igather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -529,26 +529,26 @@ int MPIR_Igather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                                                           root, comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Igather_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Igather_sched(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -561,7 +561,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Igather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Igather - Gathers together values from a group of processes in
               a nonblocking way
@@ -593,7 +593,7 @@ int MPI_Igather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IGATHER);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IGATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -709,13 +709,13 @@ int MPI_Igather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Igather_impl(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IGATHER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/igatherv.c b/src/mpi/coll/igatherv.c
index 7f64179..faf3579 100644
--- a/src/mpi/coll/igatherv.c
+++ b/src/mpi/coll/igatherv.c
@@ -32,7 +32,7 @@ int MPI_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void
 #undef FUNCNAME
 #define FUNCNAME MPIR_Igatherv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
                   const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root,
                   MPID_Comm *comm_ptr, MPID_Sched_t s)
@@ -65,13 +65,13 @@ int MPIR_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, voi
                         mpi_errno = MPID_Sched_copy(sendbuf, sendcount, sendtype,
                                                     ((char *)recvbuf+displs[rank]*extent),
                                                     recvcounts[rank], recvtype, s);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
                 else {
                     mpi_errno = MPID_Sched_recv(((char *)recvbuf+displs[i]*extent),
                                                 recvcounts[i], recvtype, i, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -95,7 +95,7 @@ int MPIR_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, voi
                 mpi_errno = MPID_Sched_ssend(sendbuf, sendcount, sendtype, root, comm_ptr, s);
             else
                 mpi_errno = MPID_Sched_send(sendbuf, sendcount, sendtype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -108,7 +108,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Igatherv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Igatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
                        const int recvcounts[], const int displs[], MPI_Datatype recvtype,
                        int root, MPID_Comm *comm_ptr, MPI_Request *request)
@@ -128,26 +128,26 @@ int MPIR_Igatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                                                            root, comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Igatherv_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Igatherv_sched(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -160,7 +160,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Igatherv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Igatherv - Gathers into specified locations from all processes in a group
                in a nonblocking way
@@ -193,7 +193,7 @@ int MPI_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IGATHERV);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IGATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -319,13 +319,13 @@ int MPI_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Igatherv_impl(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IGATHERV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ired_scat.c b/src/mpi/coll/ired_scat.c
index 741e758..916d325 100644
--- a/src/mpi/coll/ired_scat.c
+++ b/src/mpi/coll/ired_scat.c
@@ -34,7 +34,7 @@ int MPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_rec_hlv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_rec_hlv(const void *sendbuf, void *recvbuf, const int recvcounts[],
                                  MPI_Datatype datatype, MPI_Op op,
                                  MPID_Comm *comm_ptr, MPID_Sched_t s)
@@ -91,7 +91,7 @@ int MPIR_Ireduce_scatter_rec_hlv(const void *sendbuf, void *recvbuf, const int r
     else
         mpi_errno = MPID_Sched_copy(recvbuf, total_count, datatype,
                                     tmp_results, total_count, datatype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(s);
 
     pof2 = 1;
@@ -109,7 +109,7 @@ int MPIR_Ireduce_scatter_rec_hlv(const void *sendbuf, void *recvbuf, const int r
     if (rank < 2*rem) {
         if (rank % 2 == 0) { /* even */
             mpi_errno = MPID_Sched_send(tmp_results, total_count, datatype, rank+1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* temporarily set the rank to -1 so that this
@@ -119,14 +119,14 @@ int MPIR_Ireduce_scatter_rec_hlv(const void *sendbuf, void *recvbuf, const int r
         }
         else { /* odd */
             mpi_errno = MPID_Sched_recv(tmp_recvbuf, total_count, datatype, rank-1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* do the reduction on received data. since the
                ordering is right, it doesn't matter whether
                the operation is commutative or not. */
             mpi_errno = MPID_Sched_reduce(tmp_recvbuf, tmp_results, total_count, datatype, op, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* change the rank */
@@ -193,10 +193,10 @@ int MPIR_Ireduce_scatter_rec_hlv(const void *sendbuf, void *recvbuf, const int r
 
                 mpi_errno = MPID_Sched_send(((char *)tmp_results + newdisps[send_idx]*extent),
                                             send_cnt, datatype, send_dst, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 mpi_errno = MPID_Sched_recv(((char *) tmp_recvbuf + newdisps[recv_idx]*extent),
                                             recv_cnt, datatype, recv_dst, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
 
@@ -220,7 +220,7 @@ int MPIR_Ireduce_scatter_rec_hlv(const void *sendbuf, void *recvbuf, const int r
             mpi_errno = MPID_Sched_copy(((char *)tmp_results + disps[rank]*extent),
                                         recvcounts[rank], datatype,
                                         recvbuf, recvcounts[rank], datatype, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
 
@@ -234,14 +234,14 @@ int MPIR_Ireduce_scatter_rec_hlv(const void *sendbuf, void *recvbuf, const int r
             if (recvcounts[rank-1]) {
                 mpi_errno = MPID_Sched_send(((char *)tmp_results + disps[rank-1]*extent),
                                             recvcounts[rank-1], datatype, rank-1, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
         }
         else  {   /* even */
             if (recvcounts[rank]) {
                 mpi_errno = MPID_Sched_recv(recvbuf, recvcounts[rank], datatype, rank+1, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
         }
@@ -261,7 +261,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_rec_pairwise
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_pairwise(const void *sendbuf, void *recvbuf, const int recvcounts[],
                                   MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
                                   MPID_Sched_t s)
@@ -305,7 +305,7 @@ int MPIR_Ireduce_scatter_pairwise(const void *sendbuf, void *recvbuf, const int
         mpi_errno = MPID_Sched_copy(((char *)sendbuf+disps[rank]*extent),
                                     recvcounts[rank], datatype,
                                     recvbuf, recvcounts[rank], datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -323,15 +323,15 @@ int MPIR_Ireduce_scatter_pairwise(const void *sendbuf, void *recvbuf, const int
         if (sendbuf != MPI_IN_PLACE) {
             mpi_errno = MPID_Sched_send(((char *)sendbuf+disps[dst]*extent),
                                         recvcounts[dst], datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             mpi_errno = MPID_Sched_send(((char *)recvbuf+disps[dst]*extent),
                                         recvcounts[dst], datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         mpi_errno = MPID_Sched_recv(tmp_recvbuf, recvcounts[rank], datatype, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
         /* FIXME does this algorithm actually work correctly for noncommutative ops?
@@ -339,12 +339,12 @@ int MPIR_Ireduce_scatter_pairwise(const void *sendbuf, void *recvbuf, const int
         if (is_commutative || (src < rank)) {
             if (sendbuf != MPI_IN_PLACE) {
                 mpi_errno = MPID_Sched_reduce(tmp_recvbuf, recvbuf, recvcounts[rank], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             else {
                 mpi_errno = MPID_Sched_reduce(tmp_recvbuf, ((char *)recvbuf+disps[rank]*extent),
                                               recvcounts[rank], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 /* We can't store the result at the beginning of
                    recvbuf right here because there is useful data there that
                    other process/processes need.  At the end we will copy back
@@ -355,23 +355,23 @@ int MPIR_Ireduce_scatter_pairwise(const void *sendbuf, void *recvbuf, const int
         else {
             if (sendbuf != MPI_IN_PLACE) {
                 mpi_errno = MPID_Sched_reduce(recvbuf, tmp_recvbuf, recvcounts[rank], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
                 /* copy result back into recvbuf */
                 mpi_errno = MPID_Sched_copy(tmp_recvbuf, recvcounts[rank], datatype,
                                             recvbuf, recvcounts[rank], datatype, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             else {
                 mpi_errno = MPID_Sched_reduce(((char *)recvbuf+disps[rank]*extent),
                                               tmp_recvbuf, recvcounts[rank], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
                 /* copy result back into recvbuf */
                 mpi_errno = MPID_Sched_copy(tmp_recvbuf, recvcounts[rank], datatype,
                                             ((char *)recvbuf + disps[rank]*extent),
                                             recvcounts[rank], datatype, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             MPID_SCHED_BARRIER(s);
         }
@@ -383,7 +383,7 @@ int MPIR_Ireduce_scatter_pairwise(const void *sendbuf, void *recvbuf, const int
         mpi_errno = MPID_Sched_copy(((char *)recvbuf + disps[rank]*extent),
                                     recvcounts[rank], datatype,
                                     recvbuf, recvcounts[rank], datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -400,7 +400,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_rec_dbl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_rec_dbl(const void *sendbuf, void *recvbuf, const int recvcounts[],
                                  MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
                                  MPID_Sched_t s)
@@ -462,7 +462,7 @@ int MPIR_Ireduce_scatter_rec_dbl(const void *sendbuf, void *recvbuf, const int r
         mpi_errno = MPID_Sched_copy(recvbuf, total_count, datatype,
                                     tmp_results, total_count, datatype, s);
 
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(s);
 
     mask = 0x1;
@@ -498,10 +498,10 @@ int MPIR_Ireduce_scatter_rec_dbl(const void *sendbuf, void *recvbuf, const int r
             dis[1] += recvcounts[j];
 
         mpi_errno = MPIR_Type_indexed_impl(2, blklens, dis, datatype, &sendtype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Type_commit_impl(&sendtype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* calculate recvtype */
         blklens[0] = blklens[1] = 0;
@@ -516,10 +516,10 @@ int MPIR_Ireduce_scatter_rec_dbl(const void *sendbuf, void *recvbuf, const int r
             dis[1] += recvcounts[j];
 
         mpi_errno = MPIR_Type_indexed_impl(2, blklens, dis, datatype, &recvtype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Type_commit_impl(&recvtype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         received = 0;
         if (dst < comm_size) {
@@ -528,9 +528,9 @@ int MPIR_Ireduce_scatter_rec_dbl(const void *sendbuf, void *recvbuf, const int r
                tmp_results. accumulation is done later below.   */
 
             mpi_errno = MPID_Sched_send(tmp_results, 1, sendtype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             mpi_errno = MPID_Sched_recv(tmp_recvbuf, 1, recvtype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
             received = 1;
         }
@@ -573,7 +573,7 @@ int MPIR_Ireduce_scatter_rec_dbl(const void *sendbuf, void *recvbuf, const int r
                 {
                     /* send the current result */
                     mpi_errno = MPID_Sched_send(tmp_recvbuf, 1, recvtype, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
                 /* recv only if this proc. doesn't have data and sender
@@ -583,7 +583,7 @@ int MPIR_Ireduce_scatter_rec_dbl(const void *sendbuf, void *recvbuf, const int r
                          (rank >= tree_root + nprocs_completed))
                 {
                     mpi_errno = MPID_Sched_recv(tmp_recvbuf, 1, recvtype, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                     received = 1;
                 }
@@ -607,26 +607,26 @@ int MPIR_Ireduce_scatter_rec_dbl(const void *sendbuf, void *recvbuf, const int r
         if (received) {
             if (is_commutative || (dst_tree_root < my_tree_root)) {
                 mpi_errno = MPID_Sched_reduce(tmp_recvbuf, tmp_results, blklens[0], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 mpi_errno = MPID_Sched_reduce(((char *)tmp_recvbuf + dis[1]*extent),
                                               ((char *)tmp_results + dis[1]*extent),
                                               blklens[1], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
             else {
                 mpi_errno = MPID_Sched_reduce(tmp_results, tmp_recvbuf, blklens[0], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 mpi_errno = MPID_Sched_reduce(((char *)tmp_results + dis[1]*extent),
                                               ((char *)tmp_recvbuf + dis[1]*extent),
                                               blklens[1], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
 
                 /* copy result back into tmp_results */
                 mpi_errno = MPID_Sched_copy(tmp_recvbuf, 1, recvtype,
                                             tmp_results, 1, recvtype, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
         }
@@ -642,7 +642,7 @@ int MPIR_Ireduce_scatter_rec_dbl(const void *sendbuf, void *recvbuf, const int r
     mpi_errno = MPID_Sched_copy(((char *)tmp_results+disps[rank]*extent),
                                 recvcounts[rank], datatype,
                                 recvbuf, recvcounts[rank], datatype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(s);
 
     MPIR_SCHED_CHKPMEM_COMMIT(s);
@@ -661,7 +661,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_noncomm
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Ireduce_scatter_noncomm(const void *sendbuf, void *recvbuf,
                                         const int recvcounts[], MPI_Datatype datatype, MPI_Op op,
                                         MPID_Comm *comm_ptr, MPID_Sched_t s)
@@ -715,7 +715,7 @@ static int MPIR_Ireduce_scatter_noncomm(const void *sendbuf, void *recvbuf,
                                     block_size, datatype,
                                     ((char *)tmp_buf0 + (MPIU_Mirror_permutation(i, log2_comm_size) * true_extent * block_size)),
                                     block_size, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
     buf0_was_inout = 1;
@@ -741,10 +741,10 @@ static int MPIR_Ireduce_scatter_noncomm(const void *sendbuf, void *recvbuf,
 
         mpi_errno = MPID_Sched_send((outgoing_data + send_offset*true_extent),
                                     size, datatype, peer, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_Sched_recv((incoming_data + recv_offset*true_extent),
                                     size, datatype, peer, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
         /* always perform the reduction at recv_offset, the data at send_offset
@@ -754,14 +754,14 @@ static int MPIR_Ireduce_scatter_noncomm(const void *sendbuf, void *recvbuf,
             mpi_errno = MPID_Sched_reduce((incoming_data + recv_offset*true_extent),
                                           (outgoing_data + recv_offset*true_extent),
                                           size, datatype, op, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             /* lower ranked value so need to call op(my_data, received_data) */
             mpi_errno = MPID_Sched_reduce((outgoing_data + recv_offset*true_extent),
                                           (incoming_data + recv_offset*true_extent),
                                           size, datatype, op, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             buf0_was_inout = !buf0_was_inout;
         }
         MPID_SCHED_BARRIER(s);
@@ -777,7 +777,7 @@ static int MPIR_Ireduce_scatter_noncomm(const void *sendbuf, void *recvbuf,
     result_ptr = (char *)(buf0_was_inout ? tmp_buf0 : tmp_buf1) + recv_offset * true_extent;
     mpi_errno = MPID_Sched_copy(result_ptr, size, datatype,
                                 recvbuf, size, datatype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIR_SCHED_CHKPMEM_COMMIT(s);
 fn_exit:
     return mpi_errno;
@@ -835,7 +835,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recvcounts[],
                                MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
                                MPID_Sched_t s)
@@ -862,11 +862,11 @@ int MPIR_Ireduce_scatter_intra(const void *sendbuf, void *recvbuf, const int rec
     /* select an appropriate algorithm based on commutivity and message size */
     if (is_commutative && (nbytes < MPIR_CVAR_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE)) {
         mpi_errno = MPIR_Ireduce_scatter_rec_hlv(sendbuf, recvbuf, recvcounts, datatype, op, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else if (is_commutative && (nbytes >= MPIR_CVAR_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE)) {
         mpi_errno = MPIR_Ireduce_scatter_pairwise(sendbuf, recvbuf, recvcounts, datatype, op, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else /* (!is_commutative) */ {
         int is_block_regular = TRUE;
@@ -880,12 +880,12 @@ int MPIR_Ireduce_scatter_intra(const void *sendbuf, void *recvbuf, const int rec
         if (MPIU_is_pof2(comm_size, NULL) && is_block_regular) {
             /* noncommutative, pof2 size, and block regular */
             mpi_errno = MPIR_Ireduce_scatter_noncomm(sendbuf, recvbuf, recvcounts, datatype, op, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             /* noncommutative and (non-pof2 or block irregular), use recursive doubling. */
             mpi_errno = MPIR_Ireduce_scatter_rec_dbl(sendbuf, recvbuf, recvcounts, datatype, op, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -898,7 +898,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_inter(const void *sendbuf, void *recvbuf, const int recvcounts[],
                                MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
                                MPID_Sched_t s)
@@ -952,7 +952,7 @@ int MPIR_Ireduce_scatter_inter(const void *sendbuf, void *recvbuf, const int rec
         root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
         mpi_errno = comm_ptr->coll_fns->Ireduce_sched(sendbuf, tmp_buf, total_count,
                                                 datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* sched barrier intentionally omitted here to allow both reductions to
          * proceed in parallel */
@@ -961,14 +961,14 @@ int MPIR_Ireduce_scatter_inter(const void *sendbuf, void *recvbuf, const int rec
         root = 0;
         mpi_errno = comm_ptr->coll_fns->Ireduce_sched(sendbuf, tmp_buf, total_count,
                                                 datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* reduce to rank 0 of right group */
         root = 0;
         mpi_errno = comm_ptr->coll_fns->Ireduce_sched(sendbuf, tmp_buf, total_count,
                                                 datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* sched barrier intentionally omitted here to allow both reductions to
          * proceed in parallel */
@@ -977,14 +977,14 @@ int MPIR_Ireduce_scatter_inter(const void *sendbuf, void *recvbuf, const int rec
         root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
         mpi_errno = comm_ptr->coll_fns->Ireduce_sched(sendbuf, tmp_buf, total_count,
                                                 datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     MPID_SCHED_BARRIER(s);
 
     /* Get the local intracommunicator */
     if (!comm_ptr->local_comm) {
         mpi_errno = MPIR_Setup_intercomm_localcomm(comm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     newcomm_ptr = comm_ptr->local_comm;
@@ -993,7 +993,7 @@ int MPIR_Ireduce_scatter_inter(const void *sendbuf, void *recvbuf, const int rec
     mpi_errno = newcomm_ptr->coll_fns->Iscatterv_sched(tmp_buf, recvcounts, disps, datatype,
                                                  recvbuf, recvcounts[rank], datatype, 0,
                                                  newcomm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIR_SCHED_CHKPMEM_COMMIT(s);
 fn_exit:
@@ -1006,7 +1006,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_impl(const void *sendbuf, void *recvbuf, const int recvcounts[],
                               MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
                               MPI_Request *request)
@@ -1026,26 +1026,26 @@ int MPIR_Ireduce_scatter_impl(const void *sendbuf, void *recvbuf, const int recv
                                                                   comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Ireduce_scatter_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Ireduce_scatter_sched(sendbuf, recvbuf, recvcounts, datatype, op, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -1058,7 +1058,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ireduce_scatter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ireduce_scatter - Combines values and scatters the results in
                       a nonblocking way
@@ -1089,7 +1089,7 @@ int MPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IREDUCE_SCATTER);
     i = 0;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IREDUCE_SCATTER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1153,13 +1153,13 @@ int MPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ireduce_scatter_impl(sendbuf, recvbuf, recvcounts, datatype, op, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IREDUCE_SCATTER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ired_scat_block.c b/src/mpi/coll/ired_scat_block.c
index 17042c2..8df4092 100644
--- a/src/mpi/coll/ired_scat_block.c
+++ b/src/mpi/coll/ired_scat_block.c
@@ -35,7 +35,7 @@ int MPI_Ireduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_block_rec_hlv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_block_rec_hlv(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -90,7 +90,7 @@ int MPIR_Ireduce_scatter_block_rec_hlv(const void *sendbuf, void *recvbuf, int r
     else
         mpi_errno = MPID_Sched_copy(recvbuf, total_count, datatype,
                                     tmp_results, total_count, datatype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(s);
 
     pof2 = 1;
@@ -108,7 +108,7 @@ int MPIR_Ireduce_scatter_block_rec_hlv(const void *sendbuf, void *recvbuf, int r
     if (rank < 2*rem) {
         if (rank % 2 == 0) { /* even */
             mpi_errno = MPID_Sched_send(tmp_results, total_count, datatype, rank+1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* temporarily set the rank to -1 so that this
@@ -118,14 +118,14 @@ int MPIR_Ireduce_scatter_block_rec_hlv(const void *sendbuf, void *recvbuf, int r
         }
         else { /* odd */
             mpi_errno = MPID_Sched_recv(tmp_recvbuf, total_count, datatype, rank-1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* do the reduction on received data. since the
                ordering is right, it doesn't matter whether
                the operation is commutative or not. */
             mpi_errno = MPID_Sched_reduce(tmp_recvbuf, tmp_results, total_count, datatype, op, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* change the rank */
@@ -192,10 +192,10 @@ int MPIR_Ireduce_scatter_block_rec_hlv(const void *sendbuf, void *recvbuf, int r
 
                 mpi_errno = MPID_Sched_send(((char *)tmp_results + newdisps[send_idx]*extent),
                                             send_cnt, datatype, send_dst, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 mpi_errno = MPID_Sched_recv(((char *) tmp_recvbuf + newdisps[recv_idx]*extent),
                                             recv_cnt, datatype, recv_dst, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
 
@@ -205,7 +205,7 @@ int MPIR_Ireduce_scatter_block_rec_hlv(const void *sendbuf, void *recvbuf, int r
                 mpi_errno = MPID_Sched_reduce(((char *)tmp_recvbuf + newdisps[recv_idx]*extent),
                                               ((char *)tmp_results + newdisps[recv_idx]*extent),
                                               recv_cnt, datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
 
@@ -219,7 +219,7 @@ int MPIR_Ireduce_scatter_block_rec_hlv(const void *sendbuf, void *recvbuf, int r
         mpi_errno = MPID_Sched_copy(((char *)tmp_results + disps[rank]*extent),
                                     recvcount, datatype,
                                     recvbuf, recvcount, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
     }
@@ -231,12 +231,12 @@ int MPIR_Ireduce_scatter_block_rec_hlv(const void *sendbuf, void *recvbuf, int r
         if (rank % 2) { /* odd */
             mpi_errno = MPID_Sched_send(((char *)tmp_results + disps[rank-1]*extent),
                                         recvcount, datatype, rank-1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
         else  {   /* even */
             mpi_errno = MPID_Sched_recv(recvbuf, recvcount, datatype, rank+1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
     }
@@ -255,7 +255,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_block_rec_pairwise
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_block_pairwise(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -297,7 +297,7 @@ int MPIR_Ireduce_scatter_block_pairwise(const void *sendbuf, void *recvbuf, int
         mpi_errno = MPID_Sched_copy(((char *)sendbuf+disps[rank]*extent),
                                     recvcount, datatype,
                                     recvbuf, recvcount, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -315,15 +315,15 @@ int MPIR_Ireduce_scatter_block_pairwise(const void *sendbuf, void *recvbuf, int
         if (sendbuf != MPI_IN_PLACE) {
             mpi_errno = MPID_Sched_send(((char *)sendbuf+disps[dst]*extent),
                                         recvcount, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             mpi_errno = MPID_Sched_send(((char *)recvbuf+disps[dst]*extent),
                                         recvcount, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         mpi_errno = MPID_Sched_recv(tmp_recvbuf, recvcount, datatype, src, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
         /* FIXME does this algorithm actually work correctly for noncommutative ops?
@@ -331,12 +331,12 @@ int MPIR_Ireduce_scatter_block_pairwise(const void *sendbuf, void *recvbuf, int
         if (is_commutative || (src < rank)) {
             if (sendbuf != MPI_IN_PLACE) {
                 mpi_errno = MPID_Sched_reduce(tmp_recvbuf, recvbuf, recvcount, datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             else {
                 mpi_errno = MPID_Sched_reduce(tmp_recvbuf, ((char *)recvbuf+disps[rank]*extent),
                                               recvcount, datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 /* We can't store the result at the beginning of
                    recvbuf right here because there is useful data there that
                    other process/processes need.  At the end we will copy back
@@ -347,23 +347,23 @@ int MPIR_Ireduce_scatter_block_pairwise(const void *sendbuf, void *recvbuf, int
         else {
             if (sendbuf != MPI_IN_PLACE) {
                 mpi_errno = MPID_Sched_reduce(recvbuf, tmp_recvbuf, recvcount, datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
                 /* copy result back into recvbuf */
                 mpi_errno = MPID_Sched_copy(tmp_recvbuf, recvcount, datatype,
                                             recvbuf, recvcount, datatype, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             else {
                 mpi_errno = MPID_Sched_reduce(((char *)recvbuf+disps[rank]*extent),
                                               tmp_recvbuf, recvcount, datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
                 /* copy result back into recvbuf */
                 mpi_errno = MPID_Sched_copy(tmp_recvbuf, recvcount, datatype,
                                             ((char *)recvbuf + disps[rank]*extent),
                                             recvcount, datatype, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             MPID_SCHED_BARRIER(s);
         }
@@ -375,7 +375,7 @@ int MPIR_Ireduce_scatter_block_pairwise(const void *sendbuf, void *recvbuf, int
         mpi_errno = MPID_Sched_copy(((char *)recvbuf + disps[rank]*extent),
                                     recvcount, datatype,
                                     recvbuf, recvcount, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -392,7 +392,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_block_rec_dbl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_block_rec_dbl(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -452,7 +452,7 @@ int MPIR_Ireduce_scatter_block_rec_dbl(const void *sendbuf, void *recvbuf, int r
         mpi_errno = MPID_Sched_copy(recvbuf, total_count, datatype,
                                     tmp_results, total_count, datatype, s);
 
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(s);
 
     mask = 0x1;
@@ -485,10 +485,10 @@ int MPIR_Ireduce_scatter_block_rec_dbl(const void *sendbuf, void *recvbuf, int r
         dis[1] = blklens[0] + recvcount * (MPIR_MIN((my_tree_root + mask), comm_size) - my_tree_root);
 
         mpi_errno = MPIR_Type_indexed_impl(2, blklens, dis, datatype, &sendtype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Type_commit_impl(&sendtype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* calculate recvtype */
         blklens[0] = recvcount * MPIR_MIN(dst_tree_root, comm_size);
@@ -501,10 +501,10 @@ int MPIR_Ireduce_scatter_block_rec_dbl(const void *sendbuf, void *recvbuf, int r
         dis[1] = blklens[0] + recvcount * (MPIR_MIN((dst_tree_root + mask), comm_size) - dst_tree_root);
 
         mpi_errno = MPIR_Type_indexed_impl(2, blklens, dis, datatype, &recvtype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Type_commit_impl(&recvtype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         received = 0;
         if (dst < comm_size) {
@@ -512,9 +512,9 @@ int MPIR_Ireduce_scatter_block_rec_dbl(const void *sendbuf, void *recvbuf, int r
                received in tmp_recvbuf and then accumulated into
                tmp_results. accumulation is done later below.   */
             mpi_errno = MPID_Sched_send(tmp_results, 1, sendtype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             mpi_errno = MPID_Sched_recv(tmp_recvbuf, 1, recvtype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
             received = 1;
         }
@@ -557,7 +557,7 @@ int MPIR_Ireduce_scatter_block_rec_dbl(const void *sendbuf, void *recvbuf, int r
                 {
                     /* send the current result */
                     mpi_errno = MPID_Sched_send(tmp_recvbuf, 1, recvtype, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
                 /* recv only if this proc. doesn't have data and sender
@@ -567,7 +567,7 @@ int MPIR_Ireduce_scatter_block_rec_dbl(const void *sendbuf, void *recvbuf, int r
                          (rank >= tree_root + nprocs_completed))
                 {
                     mpi_errno = MPID_Sched_recv(tmp_recvbuf, 1, recvtype, dst, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                     received = 1;
                 }
@@ -591,26 +591,26 @@ int MPIR_Ireduce_scatter_block_rec_dbl(const void *sendbuf, void *recvbuf, int r
         if (received) {
             if (is_commutative || (dst_tree_root < my_tree_root)) {
                 mpi_errno = MPID_Sched_reduce(tmp_recvbuf, tmp_results, blklens[0], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 mpi_errno = MPID_Sched_reduce(((char *)tmp_recvbuf + dis[1]*extent),
                                               ((char *)tmp_results + dis[1]*extent),
                                               blklens[1], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
             else {
                 mpi_errno = MPID_Sched_reduce(tmp_results, tmp_recvbuf, blklens[0], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 mpi_errno = MPID_Sched_reduce(((char *)tmp_results + dis[1]*extent),
                                               ((char *)tmp_recvbuf + dis[1]*extent),
                                               blklens[1], datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
 
                 /* copy result back into tmp_results */
                 mpi_errno = MPID_Sched_copy(tmp_recvbuf, 1, recvtype,
                                             tmp_results, 1, recvtype, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
         }
@@ -626,7 +626,7 @@ int MPIR_Ireduce_scatter_block_rec_dbl(const void *sendbuf, void *recvbuf, int r
     mpi_errno = MPID_Sched_copy(((char *)tmp_results+disps[rank]*extent),
                                 recvcount, datatype,
                                 recvbuf, recvcount, datatype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(s);
 
     MPIR_SCHED_CHKPMEM_COMMIT(s);
@@ -644,7 +644,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_scatter_block_noncomm
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_block_noncomm(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -692,7 +692,7 @@ int MPIR_Ireduce_scatter_block_noncomm(const void *sendbuf, void *recvbuf, int r
                                     block_size, datatype,
                                     ((char *)tmp_buf0 + (MPIU_Mirror_permutation(i, log2_comm_size) * true_extent * block_size)),
                                      block_size, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     MPID_SCHED_BARRIER(s);
     buf0_was_inout = 1;
@@ -718,10 +718,10 @@ int MPIR_Ireduce_scatter_block_noncomm(const void *sendbuf, void *recvbuf, int r
 
         mpi_errno = MPID_Sched_send((outgoing_data + send_offset*true_extent),
                                     size, datatype, peer, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_Sched_recv((incoming_data + recv_offset*true_extent),
                                     size, datatype, peer, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
         /* always perform the reduction at recv_offset, the data at send_offset
@@ -731,14 +731,14 @@ int MPIR_Ireduce_scatter_block_noncomm(const void *sendbuf, void *recvbuf, int r
             mpi_errno = MPID_Sched_reduce((incoming_data + recv_offset*true_extent),
                                           (outgoing_data + recv_offset*true_extent),
                                           size, datatype, op, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             /* lower ranked value so need to call op(my_data, received_data) */
             mpi_errno = MPID_Sched_reduce((outgoing_data + recv_offset*true_extent),
                                           (incoming_data + recv_offset*true_extent),
                                           size, datatype, op, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             buf0_was_inout = !buf0_was_inout;
         }
         MPID_SCHED_BARRIER(s);
@@ -754,7 +754,7 @@ int MPIR_Ireduce_scatter_block_noncomm(const void *sendbuf, void *recvbuf, int r
     result_ptr = (char *)(buf0_was_inout ? tmp_buf0 : tmp_buf1) + recv_offset * true_extent;
     mpi_errno = MPID_Sched_copy(result_ptr, size, datatype,
                                 recvbuf, size, datatype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIR_SCHED_CHKPMEM_COMMIT(s);
 fn_exit:
@@ -767,7 +767,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_block_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_block_intra(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -788,22 +788,22 @@ int MPIR_Ireduce_scatter_block_intra(const void *sendbuf, void *recvbuf, int rec
     /* select an appropriate algorithm based on commutivity and message size */
     if (is_commutative && (nbytes < MPIR_CVAR_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE)) {
         mpi_errno = MPIR_Ireduce_scatter_block_rec_hlv(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else if (is_commutative && (nbytes >= MPIR_CVAR_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE)) {
         mpi_errno = MPIR_Ireduce_scatter_block_pairwise(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else /* (!is_commutative) */ {
         if (MPIU_is_pof2(comm_size, NULL)) {
             /* noncommutative, pof2 size */
             mpi_errno = MPIR_Ireduce_scatter_block_noncomm(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             /* noncommutative and non-pof2, use recursive doubling. */
             mpi_errno = MPIR_Ireduce_scatter_block_rec_dbl(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -817,7 +817,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_block_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
 /* Intercommunicator Ireduce_scatter_block.
@@ -857,7 +857,7 @@ int MPIR_Ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, int rec
         root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
         mpi_errno = comm_ptr->coll_fns->Ireduce_sched(sendbuf, tmp_buf, total_count,
                                                 datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* sched barrier intentionally omitted here to allow both reductions to
          * proceed in parallel */
@@ -866,14 +866,14 @@ int MPIR_Ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, int rec
         root = 0;
         mpi_errno = comm_ptr->coll_fns->Ireduce_sched(sendbuf, tmp_buf, total_count,
                                                 datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* reduce to rank 0 of right group */
         root = 0;
         mpi_errno = comm_ptr->coll_fns->Ireduce_sched(sendbuf, tmp_buf, total_count,
                                                 datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* sched barrier intentionally omitted here to allow both reductions to
          * proceed in parallel */
@@ -882,14 +882,14 @@ int MPIR_Ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, int rec
         root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
         mpi_errno = comm_ptr->coll_fns->Ireduce_sched(sendbuf, tmp_buf, total_count,
                                                 datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     MPID_SCHED_BARRIER(s);
 
     /* Get the local intracommunicator */
     if (!comm_ptr->local_comm) {
         mpi_errno = MPIR_Setup_intercomm_localcomm(comm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     newcomm_ptr = comm_ptr->local_comm;
@@ -898,7 +898,7 @@ int MPIR_Ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, int rec
     mpi_errno = newcomm_ptr->coll_fns->Iscatter_sched(tmp_buf, recvcount, datatype,
                                                 recvbuf, recvcount, datatype, 0,
                                                 newcomm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIR_SCHED_CHKPMEM_COMMIT(s);
 fn_exit:
@@ -911,7 +911,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_scatter_block_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_scatter_block_impl(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -929,26 +929,26 @@ int MPIR_Ireduce_scatter_block_impl(const void *sendbuf, void *recvbuf, int recv
                                                                         comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Ireduce_scatter_block_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Ireduce_scatter_block_sched(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -961,7 +961,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ireduce_scatter_block
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ireduce_scatter_block - Combines values and scatters the results in
                             a nonblocking way
@@ -992,7 +992,7 @@ int MPI_Ireduce_scatter_block(const void *sendbuf, void *recvbuf,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IREDUCE_SCATTER_BLOCK);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IREDUCE_SCATTER_BLOCK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1051,13 +1051,13 @@ int MPI_Ireduce_scatter_block(const void *sendbuf, void *recvbuf,
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ireduce_scatter_block_impl(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IREDUCE_SCATTER_BLOCK);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/ireduce.c b/src/mpi/coll/ireduce.c
index a4a659e..0c529b7 100644
--- a/src/mpi/coll/ireduce.c
+++ b/src/mpi/coll/ireduce.c
@@ -32,7 +32,7 @@ int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_binomial
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_binomial(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -84,9 +84,9 @@ int MPIR_Ireduce_binomial(const void *sendbuf, void *recvbuf, int count, MPI_Dat
         /* could do this up front as an MPIR_Localcopy instead, but we'll defer
          * it to the progress engine */
         mpi_errno = MPID_Sched_copy(sendbuf, count, datatype, recvbuf, count, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_Sched_barrier(s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* This code is from MPICH-1. */
@@ -134,26 +134,26 @@ int MPIR_Ireduce_binomial(const void *sendbuf, void *recvbuf, int count, MPI_Dat
             if (source < comm_size) {
                 source = (source + lroot) % comm_size;
                 mpi_errno = MPID_Sched_recv(tmp_buf, count, datatype, source, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 mpi_errno = MPID_Sched_barrier(s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 /* The sender is above us, so the received buffer must be
                    the second argument (in the noncommutative case). */
                 if (is_commutative) {
                     mpi_errno = MPID_Sched_reduce(tmp_buf, recvbuf, count, datatype, op, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 else {
                     mpi_errno = MPID_Sched_reduce(recvbuf, tmp_buf, count, datatype, op, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     mpi_errno = MPID_Sched_barrier(s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     mpi_errno = MPID_Sched_copy(tmp_buf, count, datatype, recvbuf, count, datatype, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 mpi_errno = MPID_Sched_barrier(s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         }
         else {
@@ -161,9 +161,9 @@ int MPIR_Ireduce_binomial(const void *sendbuf, void *recvbuf, int count, MPI_Dat
                my parent */
             source = ((relrank & (~ mask)) + lroot) % comm_size;
             mpi_errno = MPID_Sched_send(recvbuf, count, datatype, source, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             mpi_errno = MPID_Sched_barrier(s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             break;
         }
@@ -175,16 +175,16 @@ int MPIR_Ireduce_binomial(const void *sendbuf, void *recvbuf, int count, MPI_Dat
         if (rank == 0)
         {
             mpi_errno = MPID_Sched_send(recvbuf, count, datatype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             mpi_errno = MPID_Sched_barrier(s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else if (rank == root)
         {
             mpi_errno = MPID_Sched_recv(recvbuf, count, datatype, 0, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             mpi_errno = MPID_Sched_barrier(s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -226,7 +226,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_redscat_gather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_redscat_gather(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -278,7 +278,7 @@ int MPIR_Ireduce_redscat_gather(const void *sendbuf, void *recvbuf, int count, M
     if ((rank != root) || (sendbuf != MPI_IN_PLACE)) {
         mpi_errno = MPID_Sched_copy(sendbuf, count, datatype,
                                     recvbuf, count, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* In the non-power-of-two case, all odd-numbered
@@ -300,7 +300,7 @@ int MPIR_Ireduce_redscat_gather(const void *sendbuf, void *recvbuf, int count, M
     if (rank < 2*rem) {
         if (rank % 2 != 0) { /* odd */
             mpi_errno = MPID_Sched_send(recvbuf, count, datatype, rank-1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* temporarily set the rank to -1 so that this
@@ -310,14 +310,14 @@ int MPIR_Ireduce_redscat_gather(const void *sendbuf, void *recvbuf, int count, M
         }
         else { /* even */
             mpi_errno = MPID_Sched_recv(tmp_buf, count, datatype, rank+1, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* do the reduction on received data. */
             /* This algorithm is used only for predefined ops
                and predefined ops are always commutative. */
             mpi_errno = MPID_Sched_reduce(tmp_buf, recvbuf, count, datatype, op, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* change the rank */
@@ -377,11 +377,11 @@ int MPIR_Ireduce_redscat_gather(const void *sendbuf, void *recvbuf, int count, M
             mpi_errno = MPID_Sched_send(((char *)recvbuf + disps[send_idx]*extent),
                                         send_cnt, datatype,
                                         dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             /* sendrecv, no barrier here */
             mpi_errno = MPID_Sched_recv(((char *)tmp_buf + disps[recv_idx]*extent),
                                         recv_cnt, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* tmp_buf contains data received in this step.
@@ -392,7 +392,7 @@ int MPIR_Ireduce_redscat_gather(const void *sendbuf, void *recvbuf, int count, M
             mpi_errno = MPID_Sched_reduce(((char *)tmp_buf + disps[recv_idx]*extent),
                                           ((char *)recvbuf + disps[recv_idx]*extent),
                                           recv_cnt, datatype, op, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             /* update send_idx for next iteration */
@@ -426,7 +426,7 @@ int MPIR_Ireduce_redscat_gather(const void *sendbuf, void *recvbuf, int count, M
                     disps[i] = disps[i-1] + cnts[i-1];
 
                 mpi_errno = MPID_Sched_recv(recvbuf, cnts[0], datatype, 0, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
 
                 newrank = 0;
@@ -435,7 +435,7 @@ int MPIR_Ireduce_redscat_gather(const void *sendbuf, void *recvbuf, int count, M
             }
             else if (newrank == 0) {  /* send */
                 mpi_errno = MPID_Sched_send(recvbuf, cnts[0], datatype, root, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
                 newrank = -1;
             }
@@ -501,7 +501,7 @@ int MPIR_Ireduce_redscat_gather(const void *sendbuf, void *recvbuf, int count, M
                 /* Send data from recvbuf. Recv into tmp_buf */
                 mpi_errno = MPID_Sched_send(((char *)recvbuf + disps[send_idx]*extent),
                                             send_cnt, datatype, dst, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
                 break;
             }
@@ -509,7 +509,7 @@ int MPIR_Ireduce_redscat_gather(const void *sendbuf, void *recvbuf, int count, M
                 /* recv and continue */
                 mpi_errno = MPID_Sched_recv(((char *)recvbuf + disps[recv_idx]*extent),
                                             recv_cnt, datatype, dst, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
 
@@ -532,7 +532,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_intra(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -555,12 +555,12 @@ int MPIR_Ireduce_intra(const void *sendbuf, void *recvbuf, int count, MPI_Dataty
     {
         /* do a reduce-scatter followed by gather to root. */
         mpi_errno = MPIR_Ireduce_redscat_gather(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* use a binomial tree algorithm */
         mpi_errno = MPIR_Ireduce_binomial(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -572,7 +572,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_SMP
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -595,7 +595,7 @@ int MPIR_Ireduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
     is_commutative = MPIR_Op_is_commutative(op);
     if (!is_commutative) {
         mpi_errno = MPIR_Ireduce_intra(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
@@ -617,7 +617,7 @@ int MPIR_Ireduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
     if (nc != NULL && MPIU_Get_intranode_rank(comm_ptr, root) == -1) {
         MPIU_Assert(nc->coll_fns && nc->coll_fns->Ireduce_sched);
         mpi_errno = nc->coll_fns->Ireduce_sched(sendbuf, tmp_buf, count, datatype, op, 0, nc, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -631,7 +631,7 @@ int MPIR_Ireduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
             mpi_errno = nrc->coll_fns->Ireduce_sched(buf, NULL, count, datatype,
                                                op, MPIU_Get_internode_rank(comm_ptr, root),
                                                nrc, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
         else { /* I am on root's node. I have not participated in the earlier reduce. */
@@ -642,7 +642,7 @@ int MPIR_Ireduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
                 mpi_errno = nrc->coll_fns->Ireduce_sched(sendbuf, tmp_buf, count, datatype,
                                                    op, MPIU_Get_internode_rank(comm_ptr, root),
                                                    nrc, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
 
                 /* point sendbuf at tmp_buf to make final intranode reduce easy */
@@ -654,7 +654,7 @@ int MPIR_Ireduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
                 mpi_errno = nrc->coll_fns->Ireduce_sched(sendbuf, recvbuf, count, datatype,
                                                    op, MPIU_Get_internode_rank(comm_ptr, root),
                                                    nrc, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
 
                 /* set sendbuf to MPI_IN_PLACE to make final intranode reduce easy. */
@@ -668,7 +668,7 @@ int MPIR_Ireduce_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
         mpi_errno = nc->coll_fns->Ireduce_sched(sendbuf, recvbuf, count, datatype,
                                           op, MPIU_Get_intranode_rank(comm_ptr, root),
                                           nc, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -684,7 +684,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_inter(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -708,9 +708,9 @@ int MPIR_Ireduce_inter(const void *sendbuf, void *recvbuf, int count, MPI_Dataty
     if (root == MPI_ROOT) {
         /* root receives data from rank 0 on remote group */
         mpi_errno = MPID_Sched_recv(recvbuf, count, datatype, 0, comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_Sched_barrier(s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* remote group. Rank 0 allocates temporary buffer, does
@@ -733,19 +733,19 @@ int MPIR_Ireduce_inter(const void *sendbuf, void *recvbuf, int count, MPI_Dataty
 
         if (!comm_ptr->local_comm) {
             mpi_errno = MPIR_Setup_intercomm_localcomm(comm_ptr);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         mpi_errno = MPIR_Ireduce_intra(sendbuf, tmp_buf, count, datatype, op, 0, comm_ptr->local_comm, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_Sched_barrier(s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (rank == 0) {
             mpi_errno = MPID_Sched_send(tmp_buf, count, datatype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             mpi_errno = MPID_Sched_barrier(s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -760,7 +760,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ireduce_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ireduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -778,26 +778,26 @@ int MPIR_Ireduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatyp
                                                           comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Ireduce_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Ireduce_sched(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -810,7 +810,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ireduce
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ireduce - Reduces values on all processes to a single value
               in a nonblocking way
@@ -840,7 +840,7 @@ int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IREDUCE);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IREDUCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -916,13 +916,13 @@ int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ireduce_impl(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IREDUCE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iscan.c b/src/mpi/coll/iscan.c
index 588c921..2374918 100644
--- a/src/mpi/coll/iscan.c
+++ b/src/mpi/coll/iscan.c
@@ -68,7 +68,7 @@ int MPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iscan_rec_dbl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iscan_rec_dbl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -111,7 +111,7 @@ int MPIR_Iscan_rec_dbl(const void *sendbuf, void *recvbuf, int count, MPI_Dataty
     if (sendbuf != MPI_IN_PLACE) {
         mpi_errno = MPID_Sched_copy(sendbuf, count, datatype,
                                     recvbuf, count, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     if (sendbuf != MPI_IN_PLACE)
@@ -120,7 +120,7 @@ int MPIR_Iscan_rec_dbl(const void *sendbuf, void *recvbuf, int count, MPI_Dataty
     else
         mpi_errno = MPID_Sched_copy(recvbuf, count, datatype,
                                     partial_scan, count, datatype, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mask = 0x1;
     while (mask < comm_size) {
@@ -128,33 +128,33 @@ int MPIR_Iscan_rec_dbl(const void *sendbuf, void *recvbuf, int count, MPI_Dataty
         if (dst < comm_size) {
             /* Send partial_scan to dst. Recv into tmp_buf */
             mpi_errno = MPID_Sched_send(partial_scan, count, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             /* sendrecv, no barrier here */
             mpi_errno = MPID_Sched_recv(tmp_buf, count, datatype, dst, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
 
             if (rank > dst) {
                 mpi_errno = MPID_Sched_reduce(tmp_buf, partial_scan, count, datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 mpi_errno = MPID_Sched_reduce(tmp_buf, recvbuf, count, datatype, op, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
             else {
                 if (is_commutative) {
                     mpi_errno = MPID_Sched_reduce(tmp_buf, partial_scan, count, datatype, op, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
                 else {
                     mpi_errno = MPID_Sched_reduce(partial_scan, tmp_buf, count, datatype, op, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
 
                     mpi_errno = MPID_Sched_copy(tmp_buf, count, datatype,
                                                 partial_scan, count, datatype, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
             }
@@ -173,7 +173,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iscan_rec_dbl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iscan_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -231,13 +231,13 @@ int MPIR_Iscan_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype d
        one process, just copy the raw data. */
     if (node_comm != NULL) {
         mpi_errno = node_comm->coll_fns->Iscan_sched(sendbuf, recvbuf, count, datatype, op, node_comm, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
     else if (sendbuf != MPI_IN_PLACE) {
         mpi_errno = MPID_Sched_copy(sendbuf, count, datatype,
                                     recvbuf, count, datatype, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
 
@@ -248,12 +248,12 @@ int MPIR_Iscan_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype d
     if (roots_comm != NULL && node_comm != NULL) {
         mpi_errno = MPID_Sched_recv(localfulldata, count, datatype,
                                     (node_comm->local_size - 1), node_comm, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
     else if (roots_comm == NULL && node_comm != NULL && node_comm->rank == node_comm->local_size - 1) {
         mpi_errno = MPID_Sched_send(recvbuf, count, datatype, 0, node_comm, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
     }
     else if (roots_comm != NULL) {
@@ -270,17 +270,17 @@ int MPIR_Iscan_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype d
         MPIU_Assert(roots_rank == roots_comm->rank);
 
         mpi_errno = roots_comm->coll_fns->Iscan_sched(localfulldata, prefulldata, count, datatype, op, roots_comm, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(s);
 
         if (roots_rank != roots_comm->local_size-1) {
             mpi_errno = MPID_Sched_send(prefulldata, count, datatype, (roots_rank + 1), roots_comm, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
         if (roots_rank != 0) {
             mpi_errno = MPID_Sched_recv(tempbuf, count, datatype, (roots_rank - 1), roots_comm, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
     }
@@ -297,13 +297,13 @@ int MPIR_Iscan_SMP(const void *sendbuf, void *recvbuf, int count, MPI_Datatype d
 
         if (node_comm != NULL) {
             mpi_errno = node_comm->coll_fns->Ibcast_sched(tempbuf, count, datatype, 0, node_comm, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
 
         /* do reduce on tempbuf and recvbuf, finish scan. */
         mpi_errno = MPID_Sched_reduce(tempbuf, recvbuf, count, datatype, op, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPIR_SCHED_CHKPMEM_COMMIT(s);
@@ -317,7 +317,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iscan_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iscan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -335,25 +335,25 @@ int MPIR_Iscan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
                                                         comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns->Iscan_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Iscan_sched(sendbuf, recvbuf, count, datatype, op, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -366,7 +366,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Iscan
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Iscan - Computes the scan (partial reductions) of data on a collection of
             processes in a nonblocking way
@@ -395,7 +395,7 @@ int MPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_ISCAN);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ISCAN);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -458,13 +458,13 @@ int MPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Iscan_impl(sendbuf, recvbuf, count, datatype, op, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ISCAN);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iscatter.c b/src/mpi/coll/iscatter.c
index fcdd2d3..0bbc35f 100644
--- a/src/mpi/coll/iscatter.c
+++ b/src/mpi/coll/iscatter.c
@@ -87,7 +87,7 @@ static int calc_curr_count(MPID_Comm *comm, int tag, void *state)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iscatter_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                         void *recvbuf, int recvcount, MPI_Datatype recvtype,
                         int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
@@ -169,12 +169,12 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
                                                 sendcount*(comm_size-rank-1), sendtype,
                                                 ((char *)tmp_buf + ss->nbytes),
                                                 ss->nbytes*(comm_size-rank-1), MPI_BYTE, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 mpi_errno = MPID_Sched_copy(sendbuf, sendcount*rank, sendtype,
                                             ((char *) tmp_buf + ss->nbytes*(comm_size-rank)),
                                             ss->nbytes*rank, MPI_BYTE, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 MPID_SCHED_BARRIER(s);
                 ss->curr_count = ss->nbytes*comm_size;
@@ -196,7 +196,7 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
                    receive data into a temporary buffer. */
                 if (relative_rank % 2) {
                     mpi_errno = MPID_Sched_recv(recvbuf, recvcount, recvtype, src, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
                 else {
@@ -204,10 +204,10 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
                     /* the recv size is larger than what may be sent in
                        some cases. query amount of data actually received */
                     mpi_errno = MPID_Sched_recv_status(tmp_buf, tmp_buf_size, MPI_BYTE, src, comm_ptr, &ss->status, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                     mpi_errno = MPID_Sched_cb(&get_count, ss, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
                 break;
@@ -235,32 +235,32 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
                     send_subtree_cnt = curr_cnt - sendcount * mask;
 #endif
                     mpi_errno = MPID_Sched_cb2(&calc_send_count_root, ss, ((void *)(size_t)mask), s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
 
                     /* mask is also the size of this process's subtree */
                     mpi_errno = MPID_Sched_send_defer(((char *)sendbuf + extent*sendcount*mask),
                                                       &ss->send_subtree_count, sendtype, dst,
                                                       comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
                 else
                 {
                     /* non-zero root and others */
                     mpi_errno = MPID_Sched_cb2(&calc_send_count_non_root, ss, ((void *)(size_t)mask), s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
 
                     /* mask is also the size of this process's subtree */
                     mpi_errno = MPID_Sched_send_defer(((char *)tmp_buf + ss->nbytes*mask),
                                                       &ss->send_subtree_count, MPI_BYTE, dst,
                                                       comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_SCHED_BARRIER(s);
                 }
                 mpi_errno = MPID_Sched_cb(&calc_curr_count, ss, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
             mask >>= 1;
@@ -270,7 +270,7 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
             /* for root=0, put root's data in recvbuf if not MPI_IN_PLACE */
             mpi_errno = MPID_Sched_copy(sendbuf, sendcount, sendtype,
                                         recvbuf, recvcount, recvtype, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
         else if (!(relative_rank % 2) && (recvbuf != MPI_IN_PLACE)) {
@@ -278,7 +278,7 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
                into recvbuf */
             mpi_errno = MPID_Sched_copy(tmp_buf, ss->nbytes, MPI_BYTE,
                                         recvbuf, recvcount, recvtype, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
 
@@ -303,7 +303,7 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
 
             position = 0;
             mpi_errno = MPIR_Pack_impl(sendbuf, 1, sendtype, tmp_buf, tmp_buf_size, &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             nbytes = position*sendcount;
 
@@ -314,14 +314,14 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
                     position = 0;
                     mpi_errno = MPIR_Pack_impl(sendbuf, sendcount*comm_size, sendtype, tmp_buf,
                                                tmp_buf_size, &position);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 else {
                     position = nbytes;
                     mpi_errno = MPIR_Pack_impl(((char *) sendbuf + extent*sendcount),
                                                sendcount*(comm_size-1), sendtype, tmp_buf,
                                                tmp_buf_size, &position);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
             else {
@@ -330,18 +330,18 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
                     mpi_errno = MPIR_Pack_impl(((char *) sendbuf + extent*sendcount*rank),
                                                sendcount*(comm_size-rank), sendtype, tmp_buf,
                                                tmp_buf_size, &position);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 else {
                     position = nbytes;
                     mpi_errno = MPIR_Pack_impl(((char *) sendbuf + extent*sendcount*(rank+1)),
                                                sendcount*(comm_size-rank-1), sendtype, tmp_buf,
                                                tmp_buf_size, &position);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 mpi_errno = MPIR_Pack_impl(sendbuf, sendcount*rank, sendtype, tmp_buf,
                                            tmp_buf_size, &position);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         }
         else {
@@ -351,7 +351,7 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
             /* calculate nbytes */
             position = 0;
             mpi_errno = MPIR_Pack_impl(recvbuf, 1, recvtype, tmp_buf, tmp_buf_size, &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             nbytes = position*recvcount;
 
             curr_cnt = 0;
@@ -368,8 +368,8 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     curr_cnt = 0;
                 } else
                     /* the recv size is larger than what may be sent in
@@ -399,8 +399,8 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 curr_cnt -= send_subtree_cnt;
             }
@@ -412,7 +412,7 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
         if (recvbuf != MPI_IN_PLACE) {
             mpi_errno = MPIR_Unpack_impl(tmp_buf, tmp_buf_size, &position, recvbuf,
                                          recvcount, recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 #endif /* MPID_HAS_HETERO */
@@ -429,7 +429,7 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iscatter_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iscatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                         void *recvbuf, int recvcount, MPI_Datatype recvtype,
                         int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
@@ -472,7 +472,7 @@ int MPIR_Iscatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
         if (root == MPI_ROOT) {
             /* root sends all data to rank 0 on remote group and returns */
             mpi_errno = MPID_Sched_send(sendbuf, sendcount*remote_size, sendtype, 0, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
             goto fn_exit;
         }
@@ -496,7 +496,7 @@ int MPIR_Iscatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
                 tmp_buf = (void *)((char*)tmp_buf - true_lb);
 
                 mpi_errno = MPID_Sched_recv(tmp_buf, recvcount*local_size, recvtype, root, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_SCHED_BARRIER(s);
             }
 
@@ -512,7 +512,7 @@ int MPIR_Iscatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
             mpi_errno = newcomm_ptr->coll_fns->Iscatter_sched(tmp_buf, recvcount, recvtype,
                                                         recvbuf, recvcount, recvtype,
                                                         0, newcomm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
     }
@@ -523,13 +523,13 @@ int MPIR_Iscatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
             for (i = 0; i < remote_size; i++) {
                 mpi_errno = MPID_Sched_send(((char *)sendbuf+sendcount*i*extent),
                                             sendcount, sendtype, i, comm_ptr, s);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             MPID_SCHED_BARRIER(s);
         }
         else {
             mpi_errno = MPID_Sched_recv(recvbuf, recvcount, recvtype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(s);
         }
     }
@@ -546,7 +546,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iscatter_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iscatter_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -564,25 +564,25 @@ int MPIR_Iscatter_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                                                            root, comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns->Iscatter_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Iscatter_sched(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -595,7 +595,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Iscatter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Iscatter - Sends data from one process to all other processes in a
                communicator in a nonblocking way
@@ -627,7 +627,7 @@ int MPI_Iscatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_ISCATTER);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ISCATTER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -731,13 +731,13 @@ int MPI_Iscatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Iscatter_impl(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ISCATTER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/iscatterv.c b/src/mpi/coll/iscatterv.c
index 6e229f7..9d2c420 100644
--- a/src/mpi/coll/iscatterv.c
+++ b/src/mpi/coll/iscatterv.c
@@ -49,7 +49,7 @@ int MPI_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs[
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iscatterv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs[],
                    MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype,
                    int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
@@ -86,13 +86,13 @@ int MPIR_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs
                         mpi_errno = MPID_Sched_copy(((char *)sendbuf+displs[rank]*extent),
                                                     sendcounts[rank], sendtype,
                                                     recvbuf, recvcount, recvtype, s);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
                 else {
                     mpi_errno = MPID_Sched_send(((char *)sendbuf+displs[i]*extent),
                                                 sendcounts[i], sendtype, i, comm_ptr, s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -102,7 +102,7 @@ int MPIR_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs
         /* non-root nodes, and in the intercomm. case, non-root nodes on remote side */
         if (recvcount) {
             mpi_errno = MPID_Sched_recv(recvbuf, recvcount, recvtype, root, comm_ptr, s);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -115,7 +115,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Iscatterv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Iscatterv_impl(const void *sendbuf, const int sendcounts[], const int displs[],
                         MPI_Datatype sendtype, void *recvbuf, int recvcount,
                         MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr, MPI_Request *request)
@@ -135,25 +135,25 @@ int MPIR_Iscatterv_impl(const void *sendbuf, const int sendcounts[], const int d
                                                            root, comm_ptr, &reqp);
         if (reqp) {
             *request = reqp->handle;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         /* --END USEREXTENSION-- */
     }
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(comm_ptr->coll_fns->Iscatterv_sched != NULL);
     mpi_errno = comm_ptr->coll_fns->Iscatterv_sched(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -166,7 +166,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Iscatterv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Iscatterv - Scatters a buffer in parts to all processes in a communicator
                 in a nonblocking way
@@ -199,7 +199,7 @@ int MPI_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs[
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_ISCATTERV);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ISCATTERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -333,13 +333,13 @@ int MPI_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs[
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Iscatterv_impl(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ISCATTERV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/coll/nbcutil.c b/src/mpi/coll/nbcutil.c
index 7752736..080df12 100644
--- a/src/mpi/coll/nbcutil.c
+++ b/src/mpi/coll/nbcutil.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_Sched_cb_free_buf
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Sched_cb_free_buf(MPID_Comm *comm, int tag, void *state)
 {
     MPIU_Free(state);
diff --git a/src/mpi/coll/op_commutative.c b/src/mpi/coll/op_commutative.c
index 990fe59..6367619 100644
--- a/src/mpi/coll/op_commutative.c
+++ b/src/mpi/coll/op_commutative.c
@@ -30,7 +30,7 @@ int MPI_Op_commutative(MPI_Op op, int *commute) __attribute__((weak,alias("PMPI_
 #undef FUNCNAME
 #define FUNCNAME MPI_Op_commutative
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
   MPI_Op_commute - Queries an MPI reduction operation for its commutativity.
 
@@ -60,7 +60,7 @@ int MPI_Op_commutative(MPI_Op op, int *commute)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_OP_COMMUTATIVE);
 
     MPID_Op_get_ptr( op, op_ptr );
@@ -70,7 +70,7 @@ int MPI_Op_commutative(MPI_Op op, int *commute)
         MPID_BEGIN_ERROR_CHECKS;
         {
             MPID_Op_valid_ptr( op_ptr, mpi_errno );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         MPID_END_ERROR_CHECKS;
     }
@@ -92,7 +92,7 @@ int MPI_Op_commutative(MPI_Op op, int *commute)
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_OP_COMMUTATIVE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/coll/op_create.c b/src/mpi/coll/op_create.c
index 48e99b8..cfb88e1 100644
--- a/src/mpi/coll/op_create.c
+++ b/src/mpi/coll/op_create.c
@@ -108,7 +108,7 @@ int MPI_Op_create(MPI_User_function *user_fn, int commute, MPI_Op *op)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_OP_CREATE);
 
     /* ... body of routine ...  */
@@ -134,7 +134,7 @@ int MPI_Op_create(MPI_User_function *user_fn, int commute, MPI_Op *op)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_OP_CREATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/coll/op_free.c b/src/mpi/coll/op_free.c
index e929185..9a28f5e 100644
--- a/src/mpi/coll/op_free.c
+++ b/src/mpi/coll/op_free.c
@@ -64,7 +64,7 @@ int MPI_Op_free(MPI_Op *op)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_OP_FREE);
     
     MPID_Op_get_ptr( *op, op_ptr );
@@ -100,7 +100,7 @@ int MPI_Op_free(MPI_Op *op)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_OP_FREE);
-        MPIU_THREAD_CS_EXIT(ALLFUNC,);
+        MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 	return mpi_errno;
 	
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/coll/opband.c b/src/mpi/coll/opband.c
index fe6f991..4cd501b 100644
--- a/src/mpi/coll/opband.c
+++ b/src/mpi/coll/opband.c
@@ -19,7 +19,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_BAND
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_BAND (
     void *invec,
     void *inoutvec,
@@ -55,7 +55,7 @@ void MPIR_BAND (
 #undef FUNCNAME
 #define FUNCNAME MPIR_BAND_check_dtype
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_BAND_check_dtype ( MPI_Datatype type )
 {
     switch (type) {
diff --git a/src/mpi/coll/opbor.c b/src/mpi/coll/opbor.c
index 1ba9199..c15dc5c 100644
--- a/src/mpi/coll/opbor.c
+++ b/src/mpi/coll/opbor.c
@@ -19,7 +19,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_BOR
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_BOR (
     void *invec,
     void *inoutvec,
@@ -55,7 +55,7 @@ void MPIR_BOR (
 #undef FUNCNAME
 #define FUNCNAME MPIR_BAND_check_dtype
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_BOR_check_dtype ( MPI_Datatype type )
 {
     switch (type) {
diff --git a/src/mpi/coll/opbxor.c b/src/mpi/coll/opbxor.c
index 9d449b0..78eb17f 100644
--- a/src/mpi/coll/opbxor.c
+++ b/src/mpi/coll/opbxor.c
@@ -19,7 +19,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_BXOR
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_BXOR (
     void *invec,
     void *inoutvec,
@@ -55,7 +55,7 @@ void MPIR_BXOR (
 #undef FUNCNAME
 #define FUNCNAME MPIR_BXOR
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_BXOR_check_dtype ( MPI_Datatype type )
 {
     switch (type) {
diff --git a/src/mpi/coll/opland.c b/src/mpi/coll/opland.c
index 8144fc7..509de0c 100644
--- a/src/mpi/coll/opland.c
+++ b/src/mpi/coll/opland.c
@@ -22,7 +22,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_LAND
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_LAND (
     void *invec,
     void *inoutvec,
@@ -86,7 +86,7 @@ void MPIR_LAND (
 #undef FUNCNAME
 #define FUNCNAME MPIR_LAND
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_LAND_check_dtype ( MPI_Datatype type )
 {
     switch (type) {
diff --git a/src/mpi/coll/oplor.c b/src/mpi/coll/oplor.c
index 51b33be..ac1f0a7 100644
--- a/src/mpi/coll/oplor.c
+++ b/src/mpi/coll/oplor.c
@@ -22,7 +22,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_LOR
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_LOR (
     void *invec,
     void *inoutvec,
@@ -86,7 +86,7 @@ void MPIR_LOR (
 #undef FUNCNAME
 #define FUNCNAME MPIR_LOR
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_LOR_check_dtype ( MPI_Datatype type )
 {
     switch (type) {
diff --git a/src/mpi/coll/oplxor.c b/src/mpi/coll/oplxor.c
index 89431f9..17c6542 100644
--- a/src/mpi/coll/oplxor.c
+++ b/src/mpi/coll/oplxor.c
@@ -22,7 +22,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_LXOR
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_LXOR (
     void *invec,
     void *inoutvec,
@@ -86,7 +86,7 @@ void MPIR_LXOR (
 #undef FUNCNAME
 #define FUNCNAME MPIR_LXOR
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_LXOR_check_dtype ( MPI_Datatype type )
 {
     switch (type) {
diff --git a/src/mpi/coll/opmax.c b/src/mpi/coll/opmax.c
index 1e57a28..f5795d6 100644
--- a/src/mpi/coll/opmax.c
+++ b/src/mpi/coll/opmax.c
@@ -16,7 +16,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_MAXF
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_MAXF(
     void *invec,
     void *inoutvec,
@@ -52,7 +52,7 @@ void MPIR_MAXF(
 #undef FUNCNAME
 #define FUNCNAME MPIR_MAXF_check_dtype
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_MAXF_check_dtype( MPI_Datatype type )
 {
     switch (type) {
diff --git a/src/mpi/coll/opmaxloc.c b/src/mpi/coll/opmaxloc.c
index cf4ada7..3a6949f 100644
--- a/src/mpi/coll/opmaxloc.c
+++ b/src/mpi/coll/opmaxloc.c
@@ -75,7 +75,7 @@ typedef struct MPIR_longdoubleint_loctype {
 #undef FUNCNAME
 #define FUNCNAME MPIR_MAXLOC
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_MAXLOC( 
 	void *invec, 
 	void *inoutvec, 
@@ -114,7 +114,7 @@ void MPIR_MAXLOC(
     default: {
 	MPIU_THREADPRIV_DECL;
 	MPIU_THREADPRIV_GET;
-        MPIU_ERR_SET1(mpi_errno, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_MAXLOC" );
+        MPIR_ERR_SET1(mpi_errno, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_MAXLOC" );
         MPIU_THREADPRIV_FIELD(op_errno) = mpi_errno;
         break;
     }
@@ -127,7 +127,7 @@ void MPIR_MAXLOC(
 #undef FUNCNAME
 #define FUNCNAME MPIR_MAXLOC_check_dtype
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_MAXLOC_check_dtype( MPI_Datatype type )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -152,7 +152,7 @@ int MPIR_MAXLOC_check_dtype( MPI_Datatype type )
 #endif
         break;
 
-    default: MPIU_ERR_SET1(mpi_errno, MPI_ERR_OP, "**opundefined", "**opundefined %s", "MPI_MAXLOC");
+    default: MPIR_ERR_SET1(mpi_errno, MPI_ERR_OP, "**opundefined", "**opundefined %s", "MPI_MAXLOC");
     }
     
     return mpi_errno;
diff --git a/src/mpi/coll/opmin.c b/src/mpi/coll/opmin.c
index b7b8f93..d73929d 100644
--- a/src/mpi/coll/opmin.c
+++ b/src/mpi/coll/opmin.c
@@ -15,7 +15,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_MINF
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_MINF (
     void *invec,
     void *inoutvec,
@@ -51,7 +51,7 @@ void MPIR_MINF (
 #undef FUNCNAME
 #define FUNCNAME MPIR_MINF_check_dtype
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_MINF_check_dtype ( MPI_Datatype type )
 {
     switch (type) {
diff --git a/src/mpi/coll/opminloc.c b/src/mpi/coll/opminloc.c
index c55c59a..46aebdf 100644
--- a/src/mpi/coll/opminloc.c
+++ b/src/mpi/coll/opminloc.c
@@ -74,7 +74,7 @@ typedef struct MPIR_longdoubleint_loctype {
 #undef FUNCNAME
 #define FUNCNAME MPIR_MINLOC
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_MINLOC( 
 	void *invec, 
 	void *inoutvec, 
@@ -113,7 +113,7 @@ void MPIR_MINLOC(
     default: {
 	MPIU_THREADPRIV_DECL;
 	MPIU_THREADPRIV_GET;
-        MPIU_ERR_SET1(mpi_errno, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_MINLOC" );
+        MPIR_ERR_SET1(mpi_errno, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_MINLOC" );
         MPIU_THREADPRIV_FIELD(op_errno) = mpi_errno;
         break;
     }
@@ -128,7 +128,7 @@ void MPIR_MINLOC(
 #undef FUNCNAME
 #define FUNCNAME MPIR_MINLOC_check_dtype
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_MINLOC_check_dtype( MPI_Datatype type )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -153,7 +153,7 @@ int MPIR_MINLOC_check_dtype( MPI_Datatype type )
 #endif
         break;
 
-    default: MPIU_ERR_SET1(mpi_errno, MPI_ERR_OP, "**opundefined", "**opundefined %s", "MPI_MINLOC");
+    default: MPIR_ERR_SET1(mpi_errno, MPI_ERR_OP, "**opundefined", "**opundefined %s", "MPI_MINLOC");
     }
     
     return mpi_errno;
diff --git a/src/mpi/coll/opno_op.c b/src/mpi/coll/opno_op.c
index 6c0cef7..cd7c246 100644
--- a/src/mpi/coll/opno_op.c
+++ b/src/mpi/coll/opno_op.c
@@ -11,7 +11,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_NO_OP
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_NO_OP( void *invec, void *inoutvec, int *Len, MPI_Datatype *type )
 {
     return;
@@ -21,7 +21,7 @@ void MPIR_NO_OP( void *invec, void *inoutvec, int *Len, MPI_Datatype *type )
 #undef FUNCNAME
 #define FUNCNAME MPIR_NO_OP_check_dtype
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_NO_OP_check_dtype( MPI_Datatype type )
 {
     return MPI_SUCCESS;
diff --git a/src/mpi/coll/opprod.c b/src/mpi/coll/opprod.c
index 0901d5f..277b235 100644
--- a/src/mpi/coll/opprod.c
+++ b/src/mpi/coll/opprod.c
@@ -17,7 +17,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_PROD
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_PROD (
     void *invec,
     void *inoutvec,
@@ -90,7 +90,7 @@ void MPIR_PROD (
 #undef FUNCNAME
 #define FUNCNAME MPIR_PROD_check_dtype
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_PROD_check_dtype( MPI_Datatype type )
 {
     switch (type) {
diff --git a/src/mpi/coll/opreplace.c b/src/mpi/coll/opreplace.c
index 0b5006c..e491079 100644
--- a/src/mpi/coll/opreplace.c
+++ b/src/mpi/coll/opreplace.c
@@ -11,13 +11,13 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_REPLACE
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_REPLACE( void *invec, void *inoutvec, int *Len, MPI_Datatype *type )
 {
     int mpi_errno = MPI_SUCCESS;
 
     mpi_errno = MPIR_Localcopy(invec, *Len, *type, inoutvec, *Len, *type);
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 
   fn_exit:
     return;
@@ -31,7 +31,7 @@ void MPIR_REPLACE( void *invec, void *inoutvec, int *Len, MPI_Datatype *type )
 #undef FUNCNAME
 #define FUNCNAME MPIR_REPLACE_check_dtype
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_REPLACE_check_dtype( MPI_Datatype type )
 {
     return MPI_SUCCESS;
diff --git a/src/mpi/coll/opsum.c b/src/mpi/coll/opsum.c
index 292d5fc..b256c91 100644
--- a/src/mpi/coll/opsum.c
+++ b/src/mpi/coll/opsum.c
@@ -17,7 +17,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_SUM
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_SUM (
     void *invec,
     void *inoutvec,
@@ -74,7 +74,7 @@ void MPIR_SUM (
 #undef FUNCNAME
 #define FUNCNAME MPIR_SUM_check_dtype
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_SUM_check_dtype( MPI_Datatype type )
 {
     switch (type) {
diff --git a/src/mpi/coll/red_scat.c b/src/mpi/coll/red_scat.c
index b907811..7d494fb 100644
--- a/src/mpi/coll/red_scat.c
+++ b/src/mpi/coll/red_scat.c
@@ -54,7 +54,7 @@ int MPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_scatter_noncomm
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Reduce_scatter_noncomm(const void *sendbuf, void *recvbuf, const int recvcounts[],
                                        MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
                                        MPIR_Errflag_t *errflag)
@@ -108,7 +108,7 @@ static int MPIR_Reduce_scatter_noncomm(const void *sendbuf, void *recvbuf, const
         mpi_errno = MPIR_Localcopy((char *)(sendbuf == MPI_IN_PLACE ? (const void *)recvbuf : sendbuf) + (i * true_extent * block_size),
                                    block_size, datatype,
                                    (char *)tmp_buf0 + (MPIU_Mirror_permutation(i, log2_comm_size) * true_extent * block_size), block_size, datatype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     buf0_was_inout = 1;
 
@@ -139,8 +139,8 @@ static int MPIR_Reduce_scatter_noncomm(const void *sendbuf, void *recvbuf, const
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
         /* always perform the reduction at recv_offset, the data at send_offset
            is now our peer's responsibility */
@@ -150,7 +150,7 @@ static int MPIR_Reduce_scatter_noncomm(const void *sendbuf, void *recvbuf, const
 		     incoming_data + recv_offset*true_extent,
                      outgoing_data + recv_offset*true_extent,
                      size, datatype, op );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             /* lower ranked value so need to call op(my_data, received_data) */
@@ -158,7 +158,7 @@ static int MPIR_Reduce_scatter_noncomm(const void *sendbuf, void *recvbuf, const
 		     outgoing_data + recv_offset*true_extent,
                      incoming_data + recv_offset*true_extent,
                      size, datatype, op);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             buf0_was_inout = !buf0_was_inout;
         }
 
@@ -173,14 +173,14 @@ static int MPIR_Reduce_scatter_noncomm(const void *sendbuf, void *recvbuf, const
     result_ptr = (char *)(buf0_was_inout ? tmp_buf0 : tmp_buf1) + recv_offset * true_extent;
     mpi_errno = MPIR_Localcopy(result_ptr, size, datatype,
                                recvbuf, size, datatype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     MPIU_CHKLMEM_FREEALL();
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
 fn_fail:
     goto fn_exit;
@@ -236,7 +236,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_scatter_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /* not declared static because a machine-specific function may call this one in some cases */
 int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recvcounts[],
@@ -324,7 +324,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
             mpi_errno = MPIR_Localcopy(recvbuf, total_count, datatype,
                                        tmp_results, total_count, datatype);
         
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         pof2 = 1;
         while (pof2 <= comm_size) pof2 <<= 1;
@@ -346,8 +346,8 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 
                 /* temporarily set the rank to -1 so that this
@@ -363,8 +363,8 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 
                 /* do the reduction on received data. since the
@@ -459,8 +459,8 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 
                 /* tmp_recvbuf contains data received in this step.
@@ -485,7 +485,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                                            disps[rank]*extent, 
                                            recvcounts[rank], datatype, recvbuf,
                                            recvcounts[rank], datatype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             
         }
@@ -503,8 +503,8 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
             }
@@ -517,8 +517,8 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
             }
@@ -535,7 +535,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
             mpi_errno = MPIR_Localcopy(((char *)sendbuf+disps[rank]*extent),
                                        recvcounts[rank], datatype, recvbuf,
                                        recvcounts[rank], datatype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         
         /* allocate temporary buffer to store incoming data */
@@ -567,8 +567,8 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             
             if (is_commutative || (src < rank)) {
@@ -596,7 +596,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                     mpi_errno = MPIR_Localcopy(tmp_recvbuf, recvcounts[rank],
                                                datatype, recvbuf,
                                                recvcounts[rank], datatype);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 else {
 		    mpi_errno = MPIR_Reduce_local_impl( 
@@ -608,7 +608,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                                                ((char *)recvbuf +
                                                 disps[rank]*extent), 
                                                recvcounts[rank], datatype);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -621,7 +621,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                                        recvcounts[rank], datatype,
                                        recvbuf, 
                                        recvcounts[rank], datatype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
     
@@ -644,8 +644,8 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
         else {
@@ -670,7 +670,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                 mpi_errno = MPIR_Localcopy(recvbuf, total_count, datatype,
                                            tmp_results, total_count, datatype);
 
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             mask = 0x1;
             i = 0;
@@ -705,10 +705,10 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                     dis[1] += recvcounts[j];
 
                 mpi_errno = MPIR_Type_indexed_impl(2, blklens, dis, datatype, &sendtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 
                 mpi_errno = MPIR_Type_commit_impl(&sendtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 /* calculate recvtype */
                 blklens[0] = blklens[1] = 0;
@@ -723,10 +723,10 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                     dis[1] += recvcounts[j];
 
                 mpi_errno = MPIR_Type_indexed_impl(2, blklens, dis, datatype, &recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 
                 mpi_errno = MPIR_Type_commit_impl(&recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 received = 0;
                 if (dst < comm_size) {
@@ -743,8 +743,8 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
 
@@ -790,8 +790,8 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                             }
                         }
                         /* recv only if this proc. doesn't have data and sender
@@ -806,8 +806,8 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                             }
                         }
                         tmp_mask >>= 1;
@@ -848,7 +848,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
                         /* copy result back into tmp_results */
                         mpi_errno = MPIR_Localcopy(tmp_recvbuf, 1, recvtype, 
                                                    tmp_results, 1, recvtype);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
 
@@ -863,7 +863,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
             mpi_errno = MPIR_Localcopy(((char *)tmp_results+disps[rank]*extent),
                                        recvcounts[rank], datatype, recvbuf,
                                        recvcounts[rank], datatype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -879,7 +879,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
 fn_fail:
     goto fn_exit;
@@ -889,7 +889,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_scatter_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /* not declared static because a machine-specific function may call this one in some cases */
 int MPIR_Reduce_scatter_inter(const void *sendbuf, void *recvbuf, const int recvcounts[],
@@ -947,8 +947,8 @@ int MPIR_Reduce_scatter_inter(const void *sendbuf, void *recvbuf, const int recv
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
 
         /* reduce to rank 0 of right group */
@@ -958,8 +958,8 @@ int MPIR_Reduce_scatter_inter(const void *sendbuf, void *recvbuf, const int recv
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     else {
@@ -970,8 +970,8 @@ int MPIR_Reduce_scatter_inter(const void *sendbuf, void *recvbuf, const int recv
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
 
         /* reduce from right group to rank 0 */
@@ -981,15 +981,15 @@ int MPIR_Reduce_scatter_inter(const void *sendbuf, void *recvbuf, const int recv
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
     /* Get the local intracommunicator */
     if (!comm_ptr->local_comm) {
 	mpi_errno = MPIR_Setup_intercomm_localcomm( comm_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     newcomm_ptr = comm_ptr->local_comm;
@@ -999,8 +999,8 @@ int MPIR_Reduce_scatter_inter(const void *sendbuf, void *recvbuf, const int recv
     if (mpi_errno) {
         /* for communication errors, just record the error but continue */
         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
     }
     
  fn_exit:
@@ -1008,7 +1008,7 @@ int MPIR_Reduce_scatter_inter(const void *sendbuf, void *recvbuf, const int recv
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
@@ -1022,7 +1022,7 @@ int MPIR_Reduce_scatter_inter(const void *sendbuf, void *recvbuf, const int recv
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_scatter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[],
                         MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
@@ -1032,12 +1032,12 @@ int MPIR_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts
         /* intracommunicator */
         mpi_errno = MPIR_Reduce_scatter_intra(sendbuf, recvbuf, recvcounts,
                                               datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         /* intercommunicator */
         mpi_errno = MPIR_Reduce_scatter_inter(sendbuf, recvbuf, recvcounts,
                                               datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -1053,7 +1053,7 @@ int MPIR_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_scatter_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Reduce_scatter_impl(const void *sendbuf, void *recvbuf, const int recvcounts[],
                              MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
@@ -1064,12 +1064,12 @@ int MPIR_Reduce_scatter_impl(const void *sendbuf, void *recvbuf, const int recvc
 	/* --BEGIN USEREXTENSION-- */
 	mpi_errno = comm_ptr->coll_fns->Reduce_scatter(sendbuf, recvbuf, recvcounts,
                                                        datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Reduce_scatter(sendbuf, recvbuf, recvcounts,
                                         datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
  fn_exit:
@@ -1083,7 +1083,7 @@ int MPIR_Reduce_scatter_impl(const void *sendbuf, void *recvbuf, const int recvc
 #undef FUNCNAME
 #define FUNCNAME MPI_Reduce_scatter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Reduce_scatter - Combines values and scatters the results
@@ -1125,7 +1125,7 @@ int MPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_REDUCE_SCATTER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1206,7 +1206,7 @@ int MPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_REDUCE_SCATTER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/red_scat_block.c b/src/mpi/coll/red_scat_block.c
index 1f5e92f..486a392 100644
--- a/src/mpi/coll/red_scat_block.c
+++ b/src/mpi/coll/red_scat_block.c
@@ -45,7 +45,7 @@ int MPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_scatter_block_noncomm
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Reduce_scatter_block_noncomm (
     const void *sendbuf,
     void *recvbuf,
@@ -100,7 +100,7 @@ static int MPIR_Reduce_scatter_block_noncomm (
         mpi_errno = MPIR_Localcopy((char *)(sendbuf == MPI_IN_PLACE ? (const void *)recvbuf : sendbuf) + (i * true_extent * block_size),
                                    block_size, datatype,
                                    (char *)tmp_buf0 + (MPIU_Mirror_permutation(i, log2_comm_size) * true_extent * block_size), block_size, datatype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     buf0_was_inout = 1;
 
@@ -131,8 +131,8 @@ static int MPIR_Reduce_scatter_block_noncomm (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
         /* always perform the reduction at recv_offset, the data at send_offset
            is now our peer's responsibility */
@@ -142,7 +142,7 @@ static int MPIR_Reduce_scatter_block_noncomm (
                      incoming_data + recv_offset*true_extent,
                      outgoing_data + recv_offset*true_extent,
                      size, datatype, op);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             /* lower ranked value so need to call op(my_data, received_data) */
@@ -150,7 +150,7 @@ static int MPIR_Reduce_scatter_block_noncomm (
                      outgoing_data + recv_offset*true_extent,
                      incoming_data + recv_offset*true_extent,
                      size, datatype, op);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             buf0_was_inout = !buf0_was_inout;
         }
 
@@ -165,7 +165,7 @@ static int MPIR_Reduce_scatter_block_noncomm (
     result_ptr = (char *)(buf0_was_inout ? tmp_buf0 : tmp_buf1) + recv_offset * true_extent;
     mpi_errno = MPIR_Localcopy(result_ptr, size, datatype,
                                recvbuf, size, datatype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
 fn_exit:
     MPIU_CHKLMEM_FREEALL();
@@ -173,7 +173,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     /* --END ERROR HANDLING-- */
     return mpi_errno;
 fn_fail:
@@ -230,7 +230,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_scatter_block_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /* not declared static because a machine-specific function may call this one in some cases */
 int MPIR_Reduce_scatter_block_intra ( 
@@ -323,7 +323,7 @@ int MPIR_Reduce_scatter_block_intra (
             mpi_errno = MPIR_Localcopy(recvbuf, total_count, datatype,
                                        tmp_results, total_count, datatype);
         
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         pof2 = 1;
         while (pof2 <= comm_size) pof2 <<= 1;
@@ -345,8 +345,8 @@ int MPIR_Reduce_scatter_block_intra (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 
                 /* temporarily set the rank to -1 so that this
@@ -362,8 +362,8 @@ int MPIR_Reduce_scatter_block_intra (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 
                 /* do the reduction on received data. since the
@@ -458,8 +458,8 @@ int MPIR_Reduce_scatter_block_intra (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 
                 /* tmp_recvbuf contains data received in this step.
@@ -483,7 +483,7 @@ int MPIR_Reduce_scatter_block_intra (
                                        disps[rank]*extent, 
                                        recvcount, datatype, recvbuf,
                                        recvcount, datatype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         /* In the non-power-of-two case, all odd-numbered
@@ -505,8 +505,8 @@ int MPIR_Reduce_scatter_block_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -521,7 +521,7 @@ int MPIR_Reduce_scatter_block_intra (
             mpi_errno = MPIR_Localcopy(((char *)sendbuf+disps[rank]*extent),
                                        recvcount, datatype, recvbuf,
                                        recvcount, datatype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         
         /* allocate temporary buffer to store incoming data */
@@ -553,8 +553,8 @@ int MPIR_Reduce_scatter_block_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             
             if (is_commutative || (src < rank)) {
@@ -581,7 +581,7 @@ int MPIR_Reduce_scatter_block_intra (
                     mpi_errno = MPIR_Localcopy(tmp_recvbuf, recvcount, 
                                                datatype, recvbuf,
                                                recvcount, datatype);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 else {
                     mpi_errno = MPIR_Reduce_local_impl( 
@@ -593,7 +593,7 @@ int MPIR_Reduce_scatter_block_intra (
                                                ((char *)recvbuf +
                                                 disps[rank]*extent), 
                                                recvcount, datatype);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -606,7 +606,7 @@ int MPIR_Reduce_scatter_block_intra (
                                        recvcount, datatype, 
                                        recvbuf, 
                                        recvcount, datatype); 
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
     
@@ -619,8 +619,8 @@ int MPIR_Reduce_scatter_block_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
         else {
@@ -645,7 +645,7 @@ int MPIR_Reduce_scatter_block_intra (
                 mpi_errno = MPIR_Localcopy(recvbuf, total_count, datatype,
                                            tmp_results, total_count, datatype);
 
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             mask = 0x1;
             i = 0;
@@ -680,10 +680,10 @@ int MPIR_Reduce_scatter_block_intra (
                     dis[1] += recvcount;
 
                 mpi_errno = MPIR_Type_indexed_impl(2, blklens, dis, datatype, &sendtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 
                 mpi_errno = MPIR_Type_commit_impl(&sendtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 /* calculate recvtype */
                 blklens[0] = blklens[1] = 0;
@@ -698,10 +698,10 @@ int MPIR_Reduce_scatter_block_intra (
                     dis[1] += recvcount;
 
                 mpi_errno = MPIR_Type_indexed_impl(2, blklens, dis, datatype, &recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 
                 mpi_errno = MPIR_Type_commit_impl(&recvtype);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 received = 0;
                 if (dst < comm_size) {
@@ -718,8 +718,8 @@ int MPIR_Reduce_scatter_block_intra (
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
 
@@ -765,8 +765,8 @@ int MPIR_Reduce_scatter_block_intra (
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                             }
                         }
                         /* recv only if this proc. doesn't have data and sender
@@ -781,8 +781,8 @@ int MPIR_Reduce_scatter_block_intra (
                             if (mpi_errno) {
                                 /* for communication errors, just record the error but continue */
                                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                             }
                         }
                         tmp_mask >>= 1;
@@ -819,7 +819,7 @@ int MPIR_Reduce_scatter_block_intra (
                         /* copy result back into tmp_results */
                         mpi_errno = MPIR_Localcopy(tmp_recvbuf, 1, recvtype, 
                                                    tmp_results, 1, recvtype);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
 
@@ -834,7 +834,7 @@ int MPIR_Reduce_scatter_block_intra (
             mpi_errno = MPIR_Localcopy(((char *)tmp_results+disps[rank]*extent),
                                        recvcount, datatype, recvbuf,
                                        recvcount, datatype); 
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -851,7 +851,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     /* --END ERROR HANDLING-- */
     return mpi_errno;
 fn_fail:
@@ -862,7 +862,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_scatter_block_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /* not declared static because a machine-specific function may call this one in some cases */
 int MPIR_Reduce_scatter_block_inter ( 
@@ -914,8 +914,8 @@ int MPIR_Reduce_scatter_block_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
         
         /* reduce to rank 0 of right group */
@@ -925,8 +925,8 @@ int MPIR_Reduce_scatter_block_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     else {
@@ -937,8 +937,8 @@ int MPIR_Reduce_scatter_block_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
 
         /* reduce from right group to rank 0 */
@@ -948,8 +948,8 @@ int MPIR_Reduce_scatter_block_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -964,8 +964,8 @@ int MPIR_Reduce_scatter_block_inter (
     if (mpi_errno) {
         /* for communication errors, just record the error but continue */
         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
     }
     
  fn_exit:
@@ -974,7 +974,7 @@ int MPIR_Reduce_scatter_block_inter (
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     /* --END ERROR HANDLING-- */
     return mpi_errno;
  fn_fail:
@@ -989,7 +989,7 @@ int MPIR_Reduce_scatter_block_inter (
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_scatter_block
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Reduce_scatter_block(const void *sendbuf, void *recvbuf, 
                               int recvcount, MPI_Datatype datatype,
                               MPI_Op op, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -999,11 +999,11 @@ int MPIR_Reduce_scatter_block(const void *sendbuf, void *recvbuf,
     if (comm_ptr->comm_kind == MPID_INTRACOMM) {
         /* intracommunicator */
         mpi_errno = MPIR_Reduce_scatter_block_intra(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         /* intercommunicator */
         mpi_errno = MPIR_Reduce_scatter_block_inter(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -1020,7 +1020,7 @@ int MPIR_Reduce_scatter_block(const void *sendbuf, void *recvbuf,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_scatter_block_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Reduce_scatter_block_impl(const void *sendbuf, void *recvbuf, 
                                    int recvcount, MPI_Datatype datatype,
                                    MPI_Op op, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -1030,17 +1030,17 @@ int MPIR_Reduce_scatter_block_impl(const void *sendbuf, void *recvbuf,
     if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Reduce_scatter_block != NULL) {
 	/* --BEGIN USEREXTENSION-- */
 	mpi_errno = comm_ptr->coll_fns->Reduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         if (comm_ptr->comm_kind == MPID_INTRACOMM) {
             /* intracommunicator */
             mpi_errno = MPIR_Reduce_scatter_block_intra(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, errflag);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         } else {
             /* intercommunicator */
             mpi_errno = MPIR_Reduce_scatter_block_inter(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, errflag);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -1056,7 +1056,7 @@ int MPIR_Reduce_scatter_block_impl(const void *sendbuf, void *recvbuf,
 #undef FUNCNAME
 #define FUNCNAME MPI_Reduce_scatter_block
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Reduce_scatter_block - Combines values and scatters the results
@@ -1097,7 +1097,7 @@ int MPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_REDUCE_SCATTER_BLOCK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1172,7 +1172,7 @@ int MPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_REDUCE_SCATTER_BLOCK);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/reduce.c b/src/mpi/coll/reduce.c
index fb3f574..7817e00 100644
--- a/src/mpi/coll/reduce.c
+++ b/src/mpi/coll/reduce.c
@@ -75,7 +75,7 @@ int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_binomial
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Reduce_binomial ( 
     const void *sendbuf,
     void *recvbuf,
@@ -129,7 +129,7 @@ static int MPIR_Reduce_binomial (
     if ((rank != root) || (sendbuf != MPI_IN_PLACE)) {
         mpi_errno = MPIR_Localcopy(sendbuf, count, datatype, recvbuf,
                                    count, datatype);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
     }
 
     MPID_Datatype_get_size_macro(datatype, type_size);
@@ -183,23 +183,23 @@ static int MPIR_Reduce_binomial (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
 
                 /* The sender is above us, so the received buffer must be
                    the second argument (in the noncommutative case). */
                 if (is_commutative) {
                     mpi_errno = MPIR_Reduce_local_impl(tmp_buf, recvbuf, count, datatype, op);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 else {
                     mpi_errno = MPIR_Reduce_local_impl(recvbuf, tmp_buf, count, datatype, op);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                     mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype,
                                                recvbuf, count, datatype);
-                    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
                 }
             }
         }
@@ -212,8 +212,8 @@ static int MPIR_Reduce_binomial (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             break;
         }
@@ -235,8 +235,8 @@ static int MPIR_Reduce_binomial (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -245,7 +245,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
 fn_fail:
     goto fn_exit;
@@ -281,7 +281,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_redscat_gather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Reduce_redscat_gather ( 
     const void *sendbuf,
     void *recvbuf,
@@ -338,7 +338,7 @@ static int MPIR_Reduce_redscat_gather (
     if ((rank != root) || (sendbuf != MPI_IN_PLACE)) {
         mpi_errno = MPIR_Localcopy(sendbuf, count, datatype, recvbuf,
                                    count, datatype);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
     }
 
     MPID_Datatype_get_size_macro(datatype, type_size);
@@ -374,8 +374,8 @@ static int MPIR_Reduce_redscat_gather (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             
             /* temporarily set the rank to -1 so that this
@@ -391,8 +391,8 @@ static int MPIR_Reduce_redscat_gather (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             
             /* do the reduction on received data. */
@@ -466,8 +466,8 @@ static int MPIR_Reduce_redscat_gather (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             
             /* tmp_buf contains data received in this step.
@@ -515,8 +515,8 @@ static int MPIR_Reduce_redscat_gather (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 newrank = 0;
                 send_idx = 0;
@@ -528,8 +528,8 @@ static int MPIR_Reduce_redscat_gather (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 newrank = -1;
             }
@@ -602,8 +602,8 @@ static int MPIR_Reduce_redscat_gather (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 break;
             }
@@ -619,8 +619,8 @@ static int MPIR_Reduce_redscat_gather (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             }
             
@@ -645,7 +645,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
 fn_fail:
     goto fn_exit;
@@ -711,7 +711,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Reduce_intra ( 
     const void *sendbuf,
     void *recvbuf,
@@ -772,8 +772,8 @@ int MPIR_Reduce_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
 
@@ -789,8 +789,8 @@ int MPIR_Reduce_intra (
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             }
             else { /* I am on root's node. I have not participated in the earlier reduce. */
@@ -804,8 +804,8 @@ int MPIR_Reduce_intra (
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
 
                     /* point sendbuf at tmp_buf to make final intranode reduce easy */
@@ -820,8 +820,8 @@ int MPIR_Reduce_intra (
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
 
                     /* set sendbuf to MPI_IN_PLACE to make final intranode reduce easy. */
@@ -840,8 +840,8 @@ int MPIR_Reduce_intra (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
         
@@ -865,8 +865,8 @@ int MPIR_Reduce_intra (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     else {
@@ -875,8 +875,8 @@ int MPIR_Reduce_intra (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
         
@@ -890,7 +890,7 @@ int MPIR_Reduce_intra (
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
   fn_fail:
     goto fn_exit;
@@ -902,7 +902,7 @@ int MPIR_Reduce_intra (
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Reduce_inter ( 
     const void *sendbuf,
     void *recvbuf,
@@ -943,8 +943,8 @@ int MPIR_Reduce_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     else {
@@ -970,7 +970,7 @@ int MPIR_Reduce_inter (
         /* Get the local intracommunicator */
         if (!comm_ptr->local_comm) {
             mpi_errno = MPIR_Setup_intercomm_localcomm( comm_ptr );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         newcomm_ptr = comm_ptr->local_comm;
@@ -981,8 +981,8 @@ int MPIR_Reduce_inter (
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
 
         if (rank == 0)
@@ -992,8 +992,8 @@ int MPIR_Reduce_inter (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -1004,7 +1004,7 @@ int MPIR_Reduce_inter (
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
 
   fn_fail:
@@ -1019,7 +1019,7 @@ int MPIR_Reduce_inter (
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
                 MPI_Op op, int root, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
@@ -1029,12 +1029,12 @@ int MPIR_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
         /* intracommunicator */
         mpi_errno = MPIR_Reduce_intra(sendbuf, recvbuf, count, datatype,
                                       op, root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         /* intercommunicator */
         mpi_errno = MPIR_Reduce_inter(sendbuf, recvbuf, count, datatype,
                                       op, root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -1050,7 +1050,7 @@ int MPIR_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Reduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
                      MPI_Op op, int root, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
@@ -1060,19 +1060,19 @@ int MPIR_Reduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
 	/* --BEGIN USEREXTENSION-- */
 	mpi_errno = comm_ptr->coll_fns->Reduce(sendbuf, recvbuf, count,
                                                datatype, op, root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         if (comm_ptr->comm_kind == MPID_INTRACOMM) {
             /* intracommunicator */
             mpi_errno = MPIR_Reduce_intra(sendbuf, recvbuf, count, datatype,
                                           op, root, comm_ptr, errflag);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	} else {
             /* intercommunicator */
             mpi_errno = MPIR_Reduce_inter(sendbuf, recvbuf, count, datatype,
                                           op, root, comm_ptr, errflag);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -1089,7 +1089,7 @@ int MPIR_Reduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
 #undef FUNCNAME
 #define FUNCNAME MPI_Reduce
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 
@@ -1132,7 +1132,7 @@ int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_REDUCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -1247,7 +1247,7 @@ int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_REDUCE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/reduce_local.c b/src/mpi/coll/reduce_local.c
index 52b11b9..df008ce 100644
--- a/src/mpi/coll/reduce_local.c
+++ b/src/mpi/coll/reduce_local.c
@@ -32,7 +32,7 @@ int MPI_Reduce_local(const void *inbuf, void *inoutbuf, int count, MPI_Datatype
 #undef FUNCNAME
 #define FUNCNAME MPIR_Reduce_local_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Reduce_local_impl(const void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -118,7 +118,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Reduce_local
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Reduce_local - Applies a reduction operator to local arguments.
 
@@ -151,7 +151,7 @@ int MPI_Reduce_local(const void *inbuf, void *inoutbuf, int count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_REDUCE_LOCAL);
 
     /* Validate parameters */
@@ -190,7 +190,7 @@ int MPI_Reduce_local(const void *inbuf, void *inoutbuf, int count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_REDUCE_LOCAL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/scan.c b/src/mpi/coll/scan.c
index 2e4a080..ee8ba5f 100644
--- a/src/mpi/coll/scan.c
+++ b/src/mpi/coll/scan.c
@@ -68,7 +68,7 @@ int MPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
 #undef FUNCNAME
 #define FUNCNAME MPIR_Scan_generic
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Scan_generic ( 
     const void *sendbuf,
     void *recvbuf,
@@ -136,7 +136,7 @@ static int MPIR_Scan_generic (
     if (sendbuf != MPI_IN_PLACE) {
         mpi_errno = MPIR_Localcopy(sendbuf, count, datatype,
                                    recvbuf, count, datatype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
     if (sendbuf != MPI_IN_PLACE)
@@ -145,7 +145,7 @@ static int MPIR_Scan_generic (
     else 
         mpi_errno = MPIR_Localcopy(recvbuf, count, datatype,
                                    partial_scan, count, datatype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     mask = 0x1;
     while (mask < comm_size) {
@@ -160,32 +160,32 @@ static int MPIR_Scan_generic (
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             
             if (rank > dst) {
 		mpi_errno = MPIR_Reduce_local_impl( 
 			   tmp_buf, partial_scan, count, datatype, op);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		mpi_errno = MPIR_Reduce_local_impl( 
 			   tmp_buf, recvbuf, count, datatype, op);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             else {
                 if (is_commutative) {
 		    mpi_errno = MPIR_Reduce_local_impl( 
 			       tmp_buf, partial_scan, count, datatype, op);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		}
                 else {
 		    mpi_errno = MPIR_Reduce_local_impl( 
 			       partial_scan, tmp_buf, count, datatype, op);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		    mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype,
 					       partial_scan,
 					       count, datatype);
-		    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+		    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -194,7 +194,7 @@ static int MPIR_Scan_generic (
     
     if (MPIU_THREADPRIV_FIELD(op_errno)) {
 	mpi_errno = MPIU_THREADPRIV_FIELD(op_errno);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
  fn_exit:
@@ -205,7 +205,7 @@ static int MPIR_Scan_generic (
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
@@ -220,7 +220,7 @@ static int MPIR_Scan_generic (
 #undef FUNCNAME
 #define FUNCNAME MPIR_Scan
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Scan(
     const void *sendbuf,
     void *recvbuf,
@@ -284,15 +284,15 @@ int MPIR_Scan(
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     else if (sendbuf != MPI_IN_PLACE)
     {
         mpi_errno = MPIR_Localcopy(sendbuf, count, datatype,
                                    recvbuf, count, datatype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* get result from local node's last processor which 
@@ -307,8 +307,8 @@ int MPIR_Scan(
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     else if (comm_ptr->node_roots_comm == NULL && 
@@ -320,8 +320,8 @@ int MPIR_Scan(
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
     else if (comm_ptr->node_roots_comm != NULL)
@@ -340,8 +340,8 @@ int MPIR_Scan(
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
 
         if (MPIU_Get_internode_rank(comm_ptr, rank) != 
@@ -353,8 +353,8 @@ int MPIR_Scan(
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
         if (MPIU_Get_internode_rank(comm_ptr, rank) != 0)
@@ -366,8 +366,8 @@ int MPIR_Scan(
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -383,8 +383,8 @@ int MPIR_Scan(
         if (mpi_errno) {
             /* for communication errors, just record the error but continue */
             *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-            MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-            MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+            MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+            MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
         }
     }
 
@@ -395,8 +395,8 @@ int MPIR_Scan(
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
 
@@ -410,7 +410,7 @@ int MPIR_Scan(
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
 
   fn_fail:
@@ -424,7 +424,7 @@ int MPIR_Scan(
 #undef FUNCNAME
 #define FUNCNAME MPIR_Scan_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Scan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
                    MPI_Op op, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
@@ -434,12 +434,12 @@ int MPIR_Scan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype d
 	/* --BEGIN USEREXTENSION-- */
 	mpi_errno = comm_ptr->coll_fns->Scan(sendbuf, recvbuf, count,
                                              datatype, op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Scan(sendbuf, recvbuf, count, datatype,
                               op, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
         
  fn_exit:
@@ -454,7 +454,7 @@ int MPIR_Scan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype d
 #undef FUNCNAME
 #define FUNCNAME MPI_Scan
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Scan - Computes the scan (partial reductions) of data on a collection of
@@ -494,7 +494,7 @@ int MPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_SCAN);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -566,7 +566,7 @@ int MPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_SCAN);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/scatter.c b/src/mpi/coll/scatter.c
index c0e1295..6edf0de 100644
--- a/src/mpi/coll/scatter.c
+++ b/src/mpi/coll/scatter.c
@@ -71,7 +71,7 @@ int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void
 #undef FUNCNAME
 #define FUNCNAME MPIR_Scatter_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                        void *recvbuf, int recvcount, MPI_Datatype recvtype, int root,
                        MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -156,12 +156,12 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                                    sendcount*(comm_size-rank-1),
                                    sendtype, (char *)tmp_buf + nbytes, 
                                    nbytes*(comm_size-rank-1), MPI_BYTE);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 mpi_errno = MPIR_Localcopy(sendbuf, sendcount*rank, sendtype,
                                ((char *) tmp_buf + nbytes*(comm_size-rank)),
                                nbytes*rank, MPI_BYTE);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                 curr_cnt = nbytes*comm_size;
             } 
@@ -187,8 +187,8 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
                 else {
@@ -197,8 +197,8 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                         curr_cnt = 0;
                     } else
                         /* the recv size is larger than what may be sent in
@@ -244,8 +244,8 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 curr_cnt -= send_subtree_cnt;
             }
@@ -256,14 +256,14 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
             /* for root=0, put root's data in recvbuf if not MPI_IN_PLACE */
             mpi_errno = MPIR_Localcopy ( sendbuf, sendcount, sendtype,
                                          recvbuf, recvcount, recvtype );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else if (!(relative_rank % 2) && (recvbuf != MPI_IN_PLACE)) {
             /* for non-zero root and non-leaf nodes, copy from tmp_buf
                into recvbuf */ 
             mpi_errno = MPIR_Localcopy ( tmp_buf, nbytes, MPI_BYTE, 
                                          recvbuf, recvcount, recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
     }
@@ -286,7 +286,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
 
             position = 0;
             mpi_errno = MPIR_Pack_impl(sendbuf, 1, sendtype, tmp_buf, tmp_buf_size, &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             
             nbytes = position*sendcount;
 
@@ -297,14 +297,14 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                     position = 0;
                     mpi_errno = MPIR_Pack_impl(sendbuf, sendcount*comm_size, sendtype, tmp_buf,
                                                tmp_buf_size, &position);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 else {
                     position = nbytes;
                     mpi_errno = MPIR_Pack_impl(((char *) sendbuf + extent*sendcount),
                                                sendcount*(comm_size-1), sendtype, tmp_buf,
                                                tmp_buf_size, &position);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
             else {
@@ -313,18 +313,18 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                     mpi_errno = MPIR_Pack_impl(((char *) sendbuf + extent*sendcount*rank),
                                                sendcount*(comm_size-rank), sendtype, tmp_buf,
                                                tmp_buf_size, &position);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 else {
                     position = nbytes;
                     mpi_errno = MPIR_Pack_impl(((char *) sendbuf + extent*sendcount*(rank+1)),
                                                sendcount*(comm_size-rank-1), sendtype, tmp_buf,
                                                tmp_buf_size, &position);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
                 mpi_errno = MPIR_Pack_impl(sendbuf, sendcount*rank, sendtype, tmp_buf,
                                            tmp_buf_size, &position);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         }
         else {
@@ -334,7 +334,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
             /* calculate nbytes */
             position = 0;
             mpi_errno = MPIR_Pack_impl(recvbuf, 1, recvtype, tmp_buf, tmp_buf_size, &position);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             nbytes = position*recvcount;
 
             curr_cnt = 0;
@@ -351,8 +351,8 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     curr_cnt = 0;
                 } else
                     /* the recv size is larger than what may be sent in
@@ -382,8 +382,8 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
                 curr_cnt -= send_subtree_cnt;
             }
@@ -395,7 +395,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
         if (recvbuf != MPI_IN_PLACE) {
             mpi_errno = MPIR_Unpack_impl(tmp_buf, tmp_buf_size, &position, recvbuf,
                                          recvcount, recvtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 #endif /* MPID_HAS_HETERO */
@@ -407,7 +407,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
@@ -419,7 +419,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
 #undef FUNCNAME
 #define FUNCNAME MPIR_Scatter_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
                        int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr,
                        MPIR_Errflag_t *errflag)
@@ -469,8 +469,8 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
             goto fn_exit;
         }
@@ -499,8 +499,8 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             }
             
@@ -517,8 +517,8 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -533,8 +533,8 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
                 if (mpi_errno) {
                     /* for communication errors, just record the error but continue */
                     *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                    MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                    MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                    MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                    MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                 }
             }
         }
@@ -544,8 +544,8 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -557,7 +557,7 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
  fn_fail:
     goto fn_exit;
@@ -570,7 +570,7 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
 #undef FUNCNAME
 #define FUNCNAME MPIR_Scatter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                  void *recvbuf, int recvcount, MPI_Datatype recvtype,
                  int root, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -582,13 +582,13 @@ int MPIR_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
         mpi_errno = MPIR_Scatter_intra(sendbuf, sendcount, sendtype,
                                        recvbuf, recvcount, recvtype, root,
                                        comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         /* intercommunicator */ 
         mpi_errno = MPIR_Scatter_inter(sendbuf, sendcount, sendtype,
                                        recvbuf, recvcount, recvtype, root,
                                        comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
   
  fn_exit:
@@ -605,7 +605,7 @@ int MPIR_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Scatter_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Scatter_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                       void *recvbuf, int recvcount, MPI_Datatype recvtype,
                       int root, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -616,12 +616,12 @@ int MPIR_Scatter_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 	/* --BEGIN USEREXTENSION-- */
 	mpi_errno = comm_ptr->coll_fns->Scatter(sendbuf, sendcount, sendtype,
                                                 recvbuf, recvcount, recvtype, root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Scatter(sendbuf, sendcount, sendtype,
                                  recvbuf, recvcount, recvtype, root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
  fn_exit:
@@ -635,7 +635,7 @@ int MPIR_Scatter_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 #undef FUNCNAME
 #define FUNCNAME MPI_Scatter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Scatter - Sends data from one process to all other processes in a 
@@ -678,7 +678,7 @@ int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_SCATTER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -793,7 +793,7 @@ int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_SCATTER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/coll/scatterv.c b/src/mpi/coll/scatterv.c
index bbcf201..9370b7d 100644
--- a/src/mpi/coll/scatterv.c
+++ b/src/mpi/coll/scatterv.c
@@ -52,7 +52,7 @@ int MPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Scatterv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
                   MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype,
                   int root, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -98,20 +98,20 @@ int MPIR_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
                         mpi_errno = MPIR_Localcopy(((char *)sendbuf+displs[rank]*extent), 
                                                    sendcounts[rank], sendtype,
                                                    recvbuf, recvcount, recvtype);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
                 else {
                     mpi_errno = MPIC_Isend(((char *)sendbuf+displs[i]*extent),
                                               sendcounts[i], sendtype, i,
                                               MPIR_SCATTERV_TAG, comm_ptr, &reqarray[reqs++], errflag);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
         /* ... then wait for *all* of them to finish: */
         mpi_errno = MPIC_Waitall(reqs, reqarray, starray, errflag);
-        if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS) MPIR_ERR_POP(mpi_errno);
         /* --BEGIN ERROR HANDLING-- */
         if (mpi_errno == MPI_ERR_IN_STATUS) {
             for (i = 0; i < reqs; i++) {
@@ -120,8 +120,8 @@ int MPIR_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
                     if (mpi_errno) {
                         /* for communication errors, just record the error but continue */
                         *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                        MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                        MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                        MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                        MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
                     }
                 }
             }
@@ -136,8 +136,8 @@ int MPIR_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
             if (mpi_errno) {
                 /* for communication errors, just record the error but continue */
                 *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
-                MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
-                MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
+                MPIR_ERR_SET(mpi_errno, *errflag, "**fail");
+                MPIR_ERR_ADD(mpi_errno_ret, mpi_errno);
             }
         }
     }
@@ -150,7 +150,7 @@ fn_exit:
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
     else if (*errflag != MPIR_ERR_NONE)
-        MPIU_ERR_SET(mpi_errno, *errflag, "**coll_fail");
+        MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
     return mpi_errno;
 fn_fail:
     goto fn_exit;
@@ -163,7 +163,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Scatterv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Scatterv_impl(const void *sendbuf, const int *sendcounts, const int *displs,
                        MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype,
                        int root, MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
@@ -175,13 +175,13 @@ int MPIR_Scatterv_impl(const void *sendbuf, const int *sendcounts, const int *di
 	mpi_errno = comm_ptr->coll_fns->Scatterv(sendbuf, sendcounts, displs,
                                                  sendtype, recvbuf, recvcount,
                                                  recvtype, root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
         mpi_errno = MPIR_Scatterv(sendbuf, sendcounts, displs, sendtype,
                                   recvbuf, recvcount, recvtype,
                                   root, comm_ptr, errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -195,7 +195,7 @@ int MPIR_Scatterv_impl(const void *sendbuf, const int *sendcounts, const int *di
 #undef FUNCNAME
 #define FUNCNAME MPI_Scatterv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Scatterv - Scatters a buffer in parts to all processes in a communicator
@@ -239,7 +239,7 @@ int MPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_COLL_FUNC_ENTER(MPID_STATE_MPI_SCATTERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -375,7 +375,7 @@ int MPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
     
   fn_exit:
     MPID_MPI_COLL_FUNC_EXIT(MPID_STATE_MPI_SCATTERV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_agree.c b/src/mpi/comm/comm_agree.c
index 2149fdb..e3faf53 100644
--- a/src/mpi/comm/comm_agree.c
+++ b/src/mpi/comm/comm_agree.c
@@ -30,7 +30,7 @@ int MPIX_Comm_agree(MPI_Comm comm, int *flag) __attribute__((weak,alias("PMPIX_C
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_agree
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_agree(MPID_Comm *comm_ptr, int *flag)
 {
     int mpi_errno = MPI_SUCCESS, mpi_errno_tmp = MPI_SUCCESS;
@@ -46,18 +46,18 @@ int MPIR_Comm_agree(MPID_Comm *comm_ptr, int *flag)
 
     /* Get the locally known (not acknowledged) group of failed procs */
     mpi_errno = MPID_Comm_failure_get_acked(comm_ptr, &failed_grp);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* First decide on the group of failed procs. */
     mpi_errno = MPID_Comm_get_all_failed_procs(comm_ptr, &global_failed, MPIR_AGREE_TAG);
     if (mpi_errno) errflag = MPIR_ERR_PROC_FAILED;
 
     mpi_errno = MPIR_Group_compare_impl(failed_grp, global_failed, &result);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Create a subgroup without the failed procs */
     mpi_errno = MPIR_Group_difference_impl(comm_grp, global_failed, &new_group_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* If that group isn't the same as what we think is failed locally, then
      * mark it as such. */
@@ -95,8 +95,8 @@ int MPIR_Comm_agree(MPID_Comm *comm_ptr, int *flag)
     *flag = values[1];
 
     if (!success) {
-        MPIU_ERR_SET(mpi_errno_tmp, MPIX_ERR_PROC_FAILED, "**mpix_comm_agree");
-        MPIU_ERR_ADD(mpi_errno, mpi_errno_tmp);
+        MPIR_ERR_SET(mpi_errno_tmp, MPIX_ERR_PROC_FAILED, "**mpix_comm_agree");
+        MPIR_ERR_ADD(mpi_errno, mpi_errno_tmp);
     }
 
   fn_exit:
@@ -109,7 +109,7 @@ int MPIR_Comm_agree(MPID_Comm *comm_ptr, int *flag)
 #undef FUNCNAME
 #define FUNCNAME MPIX_Comm_agree
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPIX_Comm_agree - Performs agreement operation on comm
 
@@ -136,7 +136,7 @@ int MPIX_Comm_agree(MPI_Comm comm, int *flag)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_AGREE);
 
     /* Validate parameters, and convert MPI object handles to object pointers */
@@ -166,13 +166,13 @@ int MPIX_Comm_agree(MPI_Comm comm, int *flag)
 
     /* ... body of routine ... */
     mpi_errno = MPIR_Comm_agree(comm_ptr, flag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_AGREE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_compare.c b/src/mpi/comm/comm_compare.c
index 42ee9e1..2990d31 100644
--- a/src/mpi/comm/comm_compare.c
+++ b/src/mpi/comm/comm_compare.c
@@ -77,7 +77,7 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_COMPARE);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -122,19 +122,19 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
 	MPID_Group *group_ptr1, *group_ptr2;
 
         mpi_errno = MPIR_Comm_group_impl(comm_ptr1, &group_ptr1);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPIR_Comm_group_impl(comm_ptr2, &group_ptr2);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPIR_Group_compare_impl(group_ptr1, group_ptr2, result);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* If the groups are the same but the contexts are different, then
 	   the communicators are congruent */
 	if (*result == MPI_IDENT)
 	    *result = MPI_CONGRUENT;
 	mpi_errno = MPIR_Group_free_impl(group_ptr1);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	mpi_errno = MPIR_Group_free_impl(group_ptr2);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else { 
 	/* INTER_COMM */
@@ -144,18 +144,18 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
 	
 	/* Get the groups and see what their relationship is */
 	mpi_errno = MPIR_Comm_group_impl(comm_ptr1, &group_ptr1);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	mpi_errno = MPIR_Comm_group_impl(comm_ptr2, &group_ptr2);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPIR_Group_compare_impl(group_ptr1, group_ptr2, &lresult);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 	mpi_errno = MPIR_Comm_remote_group_impl(comm_ptr1, &rgroup_ptr1);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	mpi_errno = MPIR_Comm_remote_group_impl(comm_ptr2, &rgroup_ptr2);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPIR_Group_compare_impl(rgroup_ptr1, rgroup_ptr2, &rresult);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 	/* Choose the result that is "least" strong. This works 
 	   due to the ordering of result types in mpi.h */
@@ -168,19 +168,19 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
 
 	/* Free the groups */
 	mpi_errno = MPIR_Group_free_impl(group_ptr1);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	mpi_errno = MPIR_Group_free_impl(group_ptr2);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	mpi_errno = MPIR_Group_free_impl(rgroup_ptr1);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	mpi_errno = MPIR_Group_free_impl(rgroup_ptr2);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     /* ... end of body of routine ... */
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_COMPARE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/comm/comm_create.c b/src/mpi/comm/comm_create.c
index d5e9615..92f0c3e 100644
--- a/src/mpi/comm/comm_create.c
+++ b/src/mpi/comm/comm_create.c
@@ -40,7 +40,7 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_create_calculate_mapping
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_create_calculate_mapping(MPID_Group  *group_ptr,
                                        MPID_Comm   *comm_ptr,
                                        int        **mapping_out,
@@ -107,7 +107,7 @@ int MPIR_Comm_create_calculate_mapping(MPID_Group  *group_ptr,
             MPID_BEGIN_ERROR_CHECKS;
             {
                 mpi_errno = MPIR_Group_check_subset( group_ptr, comm_ptr );
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             MPID_END_ERROR_CHECKS;
         }
@@ -123,13 +123,13 @@ int MPIR_Comm_create_calculate_mapping(MPID_Group  *group_ptr,
             mapping[i] = -1;
             for (j=0; j<comm_ptr->local_size; j++) {
                 int comm_lpid;
-                MPID_Comm_get_lpid( comm_ptr, j, &comm_lpid, MPIU_FALSE );
+                MPID_Comm_get_lpid( comm_ptr, j, &comm_lpid, FALSE );
                 if (comm_lpid == group_ptr->lrank_to_lpid[i].lpid) {
                     mapping[i] = j;
                     break;
                 }
             }
-            MPIU_ERR_CHKANDJUMP1(mapping[i] == -1,mpi_errno,MPI_ERR_GROUP,
+            MPIR_ERR_CHKANDJUMP1(mapping[i] == -1,mpi_errno,MPI_ERR_GROUP,
                                  "**groupnotincomm", "**groupnotincomm %d", i );
         }
     }
@@ -157,7 +157,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_create_map
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_create_map(int         local_n,
                          int         remote_n,
                          int        *local_mapping,
@@ -184,7 +184,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_create_intra
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* comm create impl for intracommunicators, assumes that the standard error
  * checking has already taken place in the calling function */
 int MPIR_Comm_create_intra(MPID_Comm *comm_ptr, MPID_Group *group_ptr,
@@ -212,7 +212,7 @@ int MPIR_Comm_create_intra(MPID_Comm *comm_ptr, MPID_Group *group_ptr,
        calling routine already holds the single criticial section */
     mpi_errno = MPIR_Get_contextid_sparse( comm_ptr, &new_context_id,
                                            group_ptr->rank == MPI_UNDEFINED );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(new_context_id != 0);
 
     if (group_ptr->rank != MPI_UNDEFINED) {
@@ -220,12 +220,12 @@ int MPIR_Comm_create_intra(MPID_Comm *comm_ptr, MPID_Group *group_ptr,
 
         mpi_errno = MPIR_Comm_create_calculate_mapping(group_ptr, comm_ptr,
                                                        &mapping, &mapping_comm);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* Get the new communicator structure and context id */
 
         mpi_errno = MPIR_Comm_create( newcomm_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         (*newcomm_ptr)->recvcontext_id = new_context_id;
         (*newcomm_ptr)->rank           = group_ptr->rank;
@@ -248,10 +248,10 @@ int MPIR_Comm_create_intra(MPID_Comm *comm_ptr, MPID_Group *group_ptr,
                                          NULL,
                                          mapping_comm,
                                          *newcomm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Comm_commit(*newcomm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* This process is not in the group */
@@ -280,7 +280,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_create_inter
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* comm create impl for intercommunicators, assumes that the standard error
  * checking has already taken place in the calling function */
 PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr,
@@ -314,13 +314,13 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
         MPIR_Setup_intercomm_localcomm( comm_ptr );
     }
     mpi_errno = MPIR_Get_contextid_sparse( comm_ptr->local_comm, &new_context_id, FALSE );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(new_context_id != 0);
     MPIU_Assert(new_context_id != comm_ptr->recvcontext_id);
 
     mpi_errno = MPIR_Comm_create_calculate_mapping(group_ptr, comm_ptr, 
 						   &mapping, &mapping_comm);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     *newcomm_ptr = NULL;
 
@@ -360,7 +360,7 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
         mpi_errno = MPIC_Sendrecv(info, 2, MPI_INT, 0, 0,
                                      rinfo, 2, MPI_INT, 0, 0,
                                      comm_ptr, MPI_STATUS_IGNORE, &errflag );
-        if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
+        if (mpi_errno) { MPIR_ERR_POP( mpi_errno ); }
         if (*newcomm_ptr != NULL) {
             (*newcomm_ptr)->context_id = rinfo[0];
         }
@@ -374,24 +374,24 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
         mpi_errno = MPIC_Sendrecv( mapping, group_ptr->size, MPI_INT, 0, 0,
                                       remote_mapping, remote_size, MPI_INT, 0, 0,
                                       comm_ptr, MPI_STATUS_IGNORE, &errflag );
-        if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
+        if (mpi_errno) { MPIR_ERR_POP( mpi_errno ); }
 
         /* Broadcast to the other members of the local group */
         mpi_errno = MPIR_Bcast_impl( rinfo, 2, MPI_INT, 0,
                                      comm_ptr->local_comm, &errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPIR_Bcast_impl( remote_mapping, remote_size, MPI_INT, 0,
                                      comm_ptr->local_comm, &errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
     }
     else {
         /* The other processes */
         /* Broadcast to the other members of the local group */
         mpi_errno = MPIR_Bcast_impl( rinfo, 2, MPI_INT, 0,
                                      comm_ptr->local_comm, &errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
         if (*newcomm_ptr != NULL) {
             (*newcomm_ptr)->context_id = rinfo[0];
         }
@@ -401,8 +401,8 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
                             mpi_errno,"remote_mapping");
         mpi_errno = MPIR_Bcast_impl( remote_mapping, remote_size, MPI_INT, 0,
                                      comm_ptr->local_comm, &errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
     }
 
     MPIU_Assert(remote_size >= 0);
@@ -419,10 +419,10 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
                                          remote_mapping,
                                          mapping_comm,
                                          *newcomm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Comm_commit(*newcomm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (remote_size <= 0) {
             /* It's possible that no members of the other side of comm were
@@ -433,7 +433,7 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
              * MPIR_Comm_release won't work correctly with a half-constructed
              * comm. */
             mpi_errno = MPIR_Comm_release(*newcomm_ptr);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             *newcomm_ptr = NULL;
         }
     }
@@ -459,7 +459,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Comm_create - Creates a new communicator
@@ -491,7 +491,7 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_CREATE);
 
     /* Validate parameters, and convert MPI object handles to object pointers */
@@ -538,12 +538,12 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm)
     /* ... body of routine ...  */
     if (comm_ptr->comm_kind == MPID_INTRACOMM) {
         mpi_errno = MPIR_Comm_create_intra(comm_ptr, group_ptr, &newcomm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         MPIU_Assert(comm_ptr->comm_kind == MPID_INTERCOMM);
         mpi_errno = MPIR_Comm_create_inter(comm_ptr, group_ptr, &newcomm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     if (newcomm_ptr)
         MPIU_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
@@ -553,7 +553,7 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_CREATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_create_group.c b/src/mpi/comm/comm_create_group.c
index 2f28e11..262b435 100644
--- a/src/mpi/comm/comm_create_group.c
+++ b/src/mpi/comm/comm_create_group.c
@@ -30,7 +30,7 @@ int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *new
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_create_group
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* comm create group impl; assumes that the standard error checking
  * has already taken place in the calling function */
 int MPIR_Comm_create_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr, int tag,
@@ -58,17 +58,17 @@ int MPIR_Comm_create_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr, int tag
            *group*, so processes not in the group do not participate. */
 
         mpi_errno = MPIR_Get_contextid_sparse_group( comm_ptr, group_ptr, tag, &new_context_id, 0 );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPIU_Assert(new_context_id != 0);
 
         mpi_errno = MPIR_Comm_create_calculate_mapping(group_ptr, comm_ptr, 
                                                        &mapping, &mapping_comm);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* Get the new communicator structure and context id */
 
         mpi_errno = MPIR_Comm_create( newcomm_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         (*newcomm_ptr)->recvcontext_id = new_context_id;
         (*newcomm_ptr)->rank           = group_ptr->rank;
@@ -91,10 +91,10 @@ int MPIR_Comm_create_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr, int tag
                                          NULL,
                                          mapping_comm,
                                          *newcomm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Comm_commit(*newcomm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* This process is not in the group */
@@ -125,7 +125,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_create_group
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Comm_create_group - Creates a new communicator
@@ -158,7 +158,7 @@ int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm * ne
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_CREATE_GROUP);
 
     /* Validate parameters, and convert MPI object handles to object pointers */
@@ -206,7 +206,7 @@ int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm * ne
 
     /* ... body of routine ...  */
     mpi_errno = MPIR_Comm_create_group(comm_ptr, group_ptr, tag, &newcomm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (newcomm_ptr)
         MPIU_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
@@ -216,7 +216,7 @@ int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm * ne
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_CREATE_GROUP);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_dup.c b/src/mpi/comm/comm_dup.c
index 0137833..34dd170 100644
--- a/src/mpi/comm/comm_dup.c
+++ b/src/mpi/comm/comm_dup.c
@@ -29,7 +29,7 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm) __attribute__((weak,alias("PM
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_dup_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_dup_impl(MPID_Comm *comm_ptr, MPID_Comm **newcomm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -45,7 +45,7 @@ int MPIR_Comm_dup_impl(MPID_Comm *comm_ptr, MPID_Comm **newcomm_ptr)
 	mpi_errno = MPIR_Process.attr_dup( comm_ptr->handle,
                                            comm_ptr->attributes,
                                            &new_attributes );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     
@@ -54,7 +54,7 @@ int MPIR_Comm_dup_impl(MPID_Comm *comm_ptr, MPID_Comm **newcomm_ptr)
        rank of the process in the communicator.  For intercomms,
        this must be the local size */
     mpi_errno = MPIR_Comm_copy( comm_ptr, comm_ptr->local_size, newcomm_ptr );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     (*newcomm_ptr)->attributes = new_attributes;
 
@@ -70,7 +70,7 @@ int MPIR_Comm_dup_impl(MPID_Comm *comm_ptr, MPID_Comm **newcomm_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_dup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Comm_dup - Duplicates an existing communicator with all its cached
@@ -124,7 +124,7 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_DUP);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -159,14 +159,14 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)
     /* ... body of routine ...  */
     
     mpi_errno = MPIR_Comm_dup_impl(comm_ptr, &newcomm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     /* ... end of body of routine ... */
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_DUP);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/comm/comm_dup_with_info.c b/src/mpi/comm/comm_dup_with_info.c
index dc82c4d..5e20710 100644
--- a/src/mpi/comm/comm_dup_with_info.c
+++ b/src/mpi/comm/comm_dup_with_info.c
@@ -29,7 +29,7 @@ int MPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm *newcomm) __at
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_dup_with_info_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_dup_with_info_impl(MPID_Comm * comm_ptr, MPID_Info * info_ptr,
                                  MPID_Comm ** newcomm_p_p)
 {
@@ -39,7 +39,7 @@ int MPIR_Comm_dup_with_info_impl(MPID_Comm * comm_ptr, MPID_Info * info_ptr,
      * Comm_dup */
     mpi_errno = MPIR_Comm_dup_impl(comm_ptr, newcomm_p_p);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     return mpi_errno;
@@ -53,7 +53,7 @@ int MPIR_Comm_dup_with_info_impl(MPID_Comm * comm_ptr, MPID_Info * info_ptr,
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_dup_with_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Comm_dup_with_info - Duplicates an existing communicator with all its cached
@@ -94,7 +94,7 @@ int MPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_DUP_WITH_INFO);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -130,14 +130,14 @@ int MPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm)
     /* ... body of routine ...  */
     mpi_errno = MPIR_Comm_dup_with_info_impl(comm_ptr, info_ptr, &newcomm_ptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     MPIU_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     /* ... end of body of routine ... */
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_DUP_WITH_INFO);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_failure_ack.c b/src/mpi/comm/comm_failure_ack.c
index 14c929e..8ec8718 100644
--- a/src/mpi/comm/comm_failure_ack.c
+++ b/src/mpi/comm/comm_failure_ack.c
@@ -31,7 +31,7 @@ int MPIX_Comm_failure_ack( MPI_Comm comm ) __attribute__((weak,alias("PMPIX_Comm
 #undef FUNCNAME
 #define FUNCNAME MPIX_Comm_failure_ack
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPIX_Comm_failure_ack - Acknowledge the current group of failed processes
@@ -58,7 +58,7 @@ int MPIX_Comm_failure_ack( MPI_Comm comm )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_FAILURE_ACK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -98,7 +98,7 @@ int MPIX_Comm_failure_ack( MPI_Comm comm )
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_FAILURE_ACK);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/comm/comm_failure_get_acked.c b/src/mpi/comm/comm_failure_get_acked.c
index 2289a89..82df0ca 100644
--- a/src/mpi/comm/comm_failure_get_acked.c
+++ b/src/mpi/comm/comm_failure_get_acked.c
@@ -31,7 +31,7 @@ int MPIX_Comm_failure_get_acked( MPI_Comm comm, MPI_Group *failedgrp ) __attribu
 #undef FUNCNAME
 #define FUNCNAME MPIX_Comm_failure_get_acked
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPIX_Comm_failure_get_acked - Get the group of acknowledged failures.
@@ -62,7 +62,7 @@ int MPIX_Comm_failure_get_acked( MPI_Comm comm, MPI_Group *failedgrp )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_FAILURE_GET_ACKED);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -102,7 +102,7 @@ int MPIX_Comm_failure_get_acked( MPI_Comm comm, MPI_Group *failedgrp )
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_FAILURE_GET_ACKED);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/comm/comm_free.c b/src/mpi/comm/comm_free.c
index 000ee6d..9f1ab29 100644
--- a/src/mpi/comm/comm_free.c
+++ b/src/mpi/comm/comm_free.c
@@ -29,7 +29,7 @@ int MPI_Comm_free(MPI_Comm *comm) __attribute__((weak,alias("PMPI_Comm_free")));
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_free_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_free_impl(MPID_Comm * comm_ptr)
 {
     return MPIR_Comm_release(comm_ptr);
@@ -39,7 +39,7 @@ int MPIR_Comm_free_impl(MPID_Comm * comm_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Comm_free - Marks the communicator object for deallocation
 
@@ -82,7 +82,7 @@ int MPI_Comm_free(MPI_Comm *comm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_FREE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -132,7 +132,7 @@ int MPI_Comm_free(MPI_Comm *comm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_FREE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_get_info.c b/src/mpi/comm/comm_get_info.c
index 75d99c4..c463606 100644
--- a/src/mpi/comm/comm_get_info.c
+++ b/src/mpi/comm/comm_get_info.c
@@ -29,7 +29,7 @@ int MPI_Comm_get_info(MPI_Comm comm, MPI_Info *info) __attribute__((weak,alias("
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_get_info_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_get_info_impl(MPID_Comm * comm_ptr, MPID_Info ** info_p_p)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -50,7 +50,7 @@ int MPIR_Comm_get_info_impl(MPID_Comm * comm_ptr, MPID_Info ** info_p_p)
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_get_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Comm_get_info - Returns a new info object containing the hints
    of the communicator associated with comm. The current setting of
@@ -84,7 +84,7 @@ int MPI_Comm_get_info(MPI_Comm comm, MPI_Info * info_used)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_GET_INFO);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -126,7 +126,7 @@ int MPI_Comm_get_info(MPI_Comm comm, MPI_Info * info_used)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_GET_INFO);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_group.c b/src/mpi/comm/comm_group.c
index 72fff39..34bd903 100644
--- a/src/mpi/comm/comm_group.c
+++ b/src/mpi/comm/comm_group.c
@@ -29,7 +29,7 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group) __attribute__((weak,alias("P
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_group_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_group_impl(MPID_Comm *comm_ptr, MPID_Group **group_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -43,11 +43,11 @@ int MPIR_Comm_group_impl(MPID_Comm *comm_ptr, MPID_Group **group_ptr)
     if (!comm_ptr->local_group) {
 	n = comm_ptr->local_size;
 	mpi_errno = MPIR_Group_create( n, group_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         
         (*group_ptr)->is_local_dense_monotonic = TRUE;
 	for (i=0; i<n; i++) {
-	    (void) MPID_Comm_get_lpid( comm_ptr, i, &lpid, MPIU_FALSE );
+	    (void) MPID_Comm_get_lpid( comm_ptr, i, &lpid, FALSE );
 	    (*group_ptr)->lrank_to_lpid[i].lpid  = lpid;
             if (lpid > comm_world_size ||
                 (i > 0 && (*group_ptr)->lrank_to_lpid[i-1].lpid != (lpid-1)))
@@ -84,7 +84,7 @@ int MPIR_Comm_group_impl(MPID_Comm *comm_ptr, MPID_Group **group_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_group
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Comm_group - Accesses the group associated with given communicator
@@ -115,7 +115,7 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_GROUP);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -156,7 +156,7 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_GROUP);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_idup.c b/src/mpi/comm/comm_idup.c
index d434761..6014962 100644
--- a/src/mpi/comm/comm_idup.c
+++ b/src/mpi/comm/comm_idup.c
@@ -29,7 +29,7 @@ int MPI_Comm_idup(MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request) __attr
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_idup_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_idup_impl(MPID_Comm *comm_ptr, MPID_Comm **newcommp, MPID_Request **reqp)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -45,11 +45,11 @@ int MPIR_Comm_idup_impl(MPID_Comm *comm_ptr, MPID_Comm **newcommp, MPID_Request
         mpi_errno = MPIR_Process.attr_dup(comm_ptr->handle,
                                           comm_ptr->attributes,
                                           &new_attributes);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     mpi_errno = MPIR_Comm_copy_data(comm_ptr, newcommp);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     (*newcommp)->attributes = new_attributes;
 
@@ -57,11 +57,11 @@ int MPIR_Comm_idup_impl(MPID_Comm *comm_ptr, MPID_Comm **newcommp, MPID_Request
      * allocating a context ID to use for actual communication */
     if (comm_ptr->comm_kind == MPID_INTERCOMM) {
         mpi_errno = MPIR_Get_intercomm_contextid_nonblock(comm_ptr, *newcommp, reqp);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         mpi_errno = MPIR_Get_contextid_nonblock(comm_ptr, *newcommp, reqp);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_exit:
@@ -75,7 +75,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_idup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Comm_idup - nonblocking communicator duplication
 
@@ -100,7 +100,7 @@ int MPI_Comm_idup(MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request)
     MPID_Request *dreq = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_COMM_IDUP);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_IDUP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -138,7 +138,7 @@ int MPI_Comm_idup(MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request)
     *newcomm = MPI_COMM_NULL;
 
     mpi_errno = MPIR_Comm_idup_impl(comm_ptr, &newcomm_ptr, &dreq);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* NOTE: this is a publication for most of the comm, but the context ID
      * won't be valid yet, so we must "republish" relative to the request
@@ -150,7 +150,7 @@ int MPI_Comm_idup(MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request)
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_IDUP);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/comm/comm_rank.c b/src/mpi/comm/comm_rank.c
index 89ece48..aaf0e83 100644
--- a/src/mpi/comm/comm_rank.c
+++ b/src/mpi/comm/comm_rank.c
@@ -29,7 +29,7 @@ int MPI_Comm_rank(MPI_Comm comm, int *rank) __attribute__((weak,alias("PMPI_Comm
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_rank
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 
@@ -57,7 +57,7 @@ int MPI_Comm_rank( MPI_Comm comm, int *rank )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_RANK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -99,7 +99,7 @@ int MPI_Comm_rank( MPI_Comm comm, int *rank )
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_RANK);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/comm/comm_remote_group.c b/src/mpi/comm/comm_remote_group.c
index 27b3b75..3ff3a99 100644
--- a/src/mpi/comm/comm_remote_group.c
+++ b/src/mpi/comm/comm_remote_group.c
@@ -29,7 +29,7 @@ int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group) __attribute__((weak,a
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_remote_group_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_remote_group_impl(MPID_Comm *comm_ptr, MPID_Group **group_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -41,10 +41,10 @@ int MPIR_Comm_remote_group_impl(MPID_Comm *comm_ptr, MPID_Group **group_ptr)
     if (!comm_ptr->remote_group) {
         n = comm_ptr->remote_size;
         mpi_errno = MPIR_Group_create( n, group_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         for (i=0; i<n; i++) {
-            (void) MPID_Comm_get_lpid( comm_ptr, i, &lpid, MPIU_TRUE );
+            (void) MPID_Comm_get_lpid( comm_ptr, i, &lpid, TRUE );
             (*group_ptr)->lrank_to_lpid[i].lpid  = lpid;
             /* TODO calculate is_local_dense_monotonic */
         }
@@ -71,7 +71,7 @@ int MPIR_Comm_remote_group_impl(MPID_Comm *comm_ptr, MPID_Group **group_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_remote_group
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Comm_remote_group - Accesses the remote group associated with 
@@ -105,7 +105,7 @@ int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_REMOTE_GROUP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -144,7 +144,7 @@ int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group)
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Comm_remote_group_impl(comm_ptr, &group_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     *group = group_ptr->handle;
     
@@ -152,7 +152,7 @@ int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_REMOTE_GROUP);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_revoke.c b/src/mpi/comm/comm_revoke.c
index d134e67..0a2e629 100644
--- a/src/mpi/comm/comm_revoke.c
+++ b/src/mpi/comm/comm_revoke.c
@@ -33,7 +33,7 @@ int MPIX_Comm_revoke(MPI_Comm comm) __attribute__((weak,alias("PMPIX_Comm_revoke
 #undef FUNCNAME
 #define FUNCNAME MPIX_Comm_revoke
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPIX_Comm_revoke - Prevent a communicator from being used in the future
 
@@ -58,7 +58,7 @@ int MPIX_Comm_revoke(MPI_Comm comm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_REVOKE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -91,13 +91,13 @@ int MPIX_Comm_revoke(MPI_Comm comm)
     /* ... body of routine ... */
 
     mpi_errno = MPID_Comm_revoke(comm_ptr, 0);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_REVOKE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
   fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/comm/comm_set_info.c b/src/mpi/comm/comm_set_info.c
index 0acbfbe..ff5c506 100644
--- a/src/mpi/comm/comm_set_info.c
+++ b/src/mpi/comm/comm_set_info.c
@@ -30,7 +30,7 @@ int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info) __attribute__((weak,alias("P
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_set_info_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_set_info_impl(MPID_Comm * comm_ptr, MPID_Info * info_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -58,7 +58,7 @@ int MPIR_Comm_set_info_impl(MPID_Comm * comm_ptr, MPID_Info * info_ptr)
         if (curr_info->key == NULL) continue;
 
         mpi_errno = MPIR_Info_set_impl(comm_ptr->info, curr_info->key, curr_info->value);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -73,7 +73,7 @@ int MPIR_Comm_set_info_impl(MPID_Comm * comm_ptr, MPID_Info * info_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_set_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Comm_set_info - Set new values for the hints of the
    communicator associated with comm.  The call is collective on the
@@ -104,7 +104,7 @@ int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SET_INFO);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -143,7 +143,7 @@ int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SET_INFO);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_set_name.c b/src/mpi/comm/comm_set_name.c
index 3196b4f..daa9bf3 100644
--- a/src/mpi/comm/comm_set_name.c
+++ b/src/mpi/comm/comm_set_name.c
@@ -88,9 +88,9 @@ int MPI_Comm_set_name(MPI_Comm comm, const char *comm_name)
 
     /* ... body of routine ...  */
 
-    MPIU_THREAD_CS_ENTER(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, comm_ptr->pobj_mutex);
     MPIU_Strncpy( comm_ptr->name, comm_name, MPI_MAX_OBJECT_NAME );
-    MPIU_THREAD_CS_EXIT(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/comm/comm_shrink.c b/src/mpi/comm/comm_shrink.c
index 40a04ea..dbbe3e4 100644
--- a/src/mpi/comm/comm_shrink.c
+++ b/src/mpi/comm/comm_shrink.c
@@ -44,7 +44,7 @@ int MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm) __attribute__((weak,alias
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_shrink
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* comm shrink impl; assumes that standard error checking has already taken
  * place in the calling function */
 int MPIR_Comm_shrink(MPID_Comm *comm_ptr, MPID_Comm **newcomm_ptr)
@@ -68,7 +68,7 @@ int MPIR_Comm_shrink(MPID_Comm *comm_ptr, MPID_Comm **newcomm_ptr)
          * with failed procs */
 
         mpi_errno = MPIR_Group_difference_impl(comm_grp, global_failed, &new_group_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         if (MPID_Group_empty != global_failed) MPIR_Group_release(global_failed);
 
         mpi_errno = MPIR_Comm_create_group(comm_ptr, new_group_ptr, MPIR_SHRINK_TAG, newcomm_ptr);
@@ -112,7 +112,7 @@ int MPIR_Comm_shrink(MPID_Comm *comm_ptr, MPID_Comm **newcomm_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIX_Comm_shrink
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPIX_Comm_shrink - Creates a new communitor from an existing communicator while
                   excluding failed processes
@@ -140,7 +140,7 @@ int MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_SHRINK);
 
     /* Validate parameters, and convert MPI object handles to object pointers */
@@ -170,7 +170,7 @@ int MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm)
 
     /* ... body of routine ... */
     mpi_errno = MPIR_Comm_shrink(comm_ptr, &newcomm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (newcomm_ptr)
         MPIU_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
@@ -180,7 +180,7 @@ int MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_SHRINK);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/comm_size.c b/src/mpi/comm/comm_size.c
index 412c5ff..b8239a7 100644
--- a/src/mpi/comm/comm_size.c
+++ b/src/mpi/comm/comm_size.c
@@ -28,7 +28,7 @@ int MPI_Comm_size(MPI_Comm comm, int *size) __attribute__((weak,alias("PMPI_Comm
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_size
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 
diff --git a/src/mpi/comm/comm_split.c b/src/mpi/comm/comm_split.c
index 1d11b69..c606eeb 100644
--- a/src/mpi/comm/comm_split.c
+++ b/src/mpi/comm/comm_split.c
@@ -126,7 +126,7 @@ static void MPIU_Sort_inttable( sorttype *keytable, int size )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_split_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_split_impl(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **newcomm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -164,8 +164,8 @@ int MPIR_Comm_split_impl(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **ne
     }
     /* Gather information on the local group of processes */
     mpi_errno = MPIR_Allgather_impl( MPI_IN_PLACE, 2, MPI_INT, table, 2, MPI_INT, local_comm_ptr, &errflag );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
     /* Step 2: How many processes have our same color? */
     new_size = 0;
@@ -212,8 +212,8 @@ int MPIR_Comm_split_impl(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **ne
 	mypair.key   = key;
 	mpi_errno = MPIR_Allgather_impl( &mypair, 2, MPI_INT, remotetable, 2, MPI_INT,
                                          comm_ptr, &errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
         
 	/* Each process can now match its color with the entries in the table */
 	new_remote_size = 0;
@@ -249,7 +249,7 @@ int MPIR_Comm_split_impl(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **ne
     /* In the multi-threaded case, MPIR_Get_contextid_sparse assumes that the
        calling routine already holds the single criticial section */
     mpi_errno = MPIR_Get_contextid_sparse(local_comm_ptr, &new_context_id, !in_newcomm);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(new_context_id != 0);
 
     /* In the intercomm case, we need to exchange the context ids */
@@ -258,16 +258,16 @@ int MPIR_Comm_split_impl(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **ne
 	    mpi_errno = MPIC_Sendrecv( &new_context_id, 1, MPIU_CONTEXT_ID_T_DATATYPE, 0, 0,
 				       &remote_context_id, 1, MPIU_CONTEXT_ID_T_DATATYPE, 
 				       0, 0, comm_ptr, MPI_STATUS_IGNORE, &errflag );
-	    if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
+	    if (mpi_errno) { MPIR_ERR_POP( mpi_errno ); }
 	    mpi_errno = MPIR_Bcast_impl( &remote_context_id, 1, MPIU_CONTEXT_ID_T_DATATYPE, 0, local_comm_ptr, &errflag );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 	}
 	else {
 	    /* Broadcast to the other members of the local group */
 	    mpi_errno = MPIR_Bcast_impl( &remote_context_id, 1, MPIU_CONTEXT_ID_T_DATATYPE, 0, local_comm_ptr, &errflag );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 	}
     }
 
@@ -370,15 +370,15 @@ int MPIR_Comm_split_impl(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **ne
 	}
 
 	/* Inherit the error handler (if any) */
-        MPIU_THREAD_CS_ENTER(MPI_OBJ, comm_ptr);
+        MPID_THREAD_CS_ENTER(POBJ, comm_ptr->pobj_mutex);
 	(*newcomm_ptr)->errhandler = comm_ptr->errhandler;
 	if (comm_ptr->errhandler) {
 	    MPIR_Errhandler_add_ref( comm_ptr->errhandler );
 	}
-        MPIU_THREAD_CS_EXIT(MPI_OBJ, comm_ptr);
+        MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
 
         mpi_errno = MPIR_Comm_commit(*newcomm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
  fn_exit:
@@ -396,7 +396,7 @@ int MPIR_Comm_split_impl(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **ne
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_split
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Comm_split - Creates new communicators based on colors and keys
@@ -441,7 +441,7 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SPLIT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -476,7 +476,7 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm)
     /* ... body of routine ...  */
     
     mpi_errno = MPIR_Comm_split_impl(comm_ptr, color, key, &newcomm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     if (newcomm_ptr)
         MPIU_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     else
@@ -486,7 +486,7 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SPLIT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/comm/comm_split_type.c b/src/mpi/comm/comm_split_type.c
index 829e352..f358792 100644
--- a/src/mpi/comm/comm_split_type.c
+++ b/src/mpi/comm/comm_split_type.c
@@ -29,7 +29,7 @@ int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info, M
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_split_type_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_split_type_impl(MPID_Comm * comm_ptr, int split_type, int key,
                               MPID_Info * info_ptr, MPID_Comm ** newcomm_ptr)
 {
@@ -51,7 +51,7 @@ int MPIR_Comm_split_type_impl(MPID_Comm * comm_ptr, int split_type, int key,
             MPID_Comm_fns->split_type(comm_ptr, split_type, key, info_ptr, newcomm_ptr);
     }
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     return mpi_errno;
@@ -64,7 +64,7 @@ int MPIR_Comm_split_type_impl(MPID_Comm * comm_ptr, int split_type, int key,
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_split_type
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Comm_split_type - Creates new communicators based on split types and keys
@@ -102,7 +102,7 @@ int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SPLIT_TYPE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -140,7 +140,7 @@ int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info,
 
     mpi_errno = MPIR_Comm_split_type_impl(comm_ptr, split_type, key, info_ptr, &newcomm_ptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     if (newcomm_ptr)
         MPIU_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     else
@@ -150,7 +150,7 @@ int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SPLIT_TYPE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c
index b733eae..84decc1 100644
--- a/src/mpi/comm/commutil.c
+++ b/src/mpi/comm/commutil.c
@@ -74,8 +74,6 @@ int MPIR_Comm_init(MPID_Comm * comm_p)
 
     MPIU_Object_set_ref(comm_p, 1);
 
-    MPIU_THREAD_MPI_OBJ_INIT(comm_p);
-
     /* initialize local and remote sizes to -1 to allow other parts of
      * the stack to detect errors more easily */
     comm_p->local_size = -1;
@@ -136,13 +134,13 @@ int MPIR_Comm_create(MPID_Comm ** newcomm_ptr)
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_COMM_CREATE);
 
     newptr = (MPID_Comm *) MPIU_Handle_obj_alloc(&MPID_Comm_mem);
-    MPIU_ERR_CHKANDJUMP(!newptr, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP(!newptr, mpi_errno, MPI_ERR_OTHER, "**nomem");
 
     *newcomm_ptr = newptr;
 
     mpi_errno = MPIR_Comm_init(newptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Insert this new communicator into the list of known communicators.
      * Make this conditional on debugger support to match the test in
@@ -171,12 +169,12 @@ int MPIR_Setup_intercomm_localcomm(MPID_Comm * intercomm_ptr)
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_SETUP_INTERCOMM_LOCALCOMM);
 
     localcomm_ptr = (MPID_Comm *) MPIU_Handle_obj_alloc(&MPID_Comm_mem);
-    MPIU_ERR_CHKANDJUMP(!localcomm_ptr, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP(!localcomm_ptr, mpi_errno, MPI_ERR_OTHER, "**nomem");
 
     /* get sensible default values for most fields (usually zeros) */
     mpi_errno = MPIR_Comm_init(localcomm_ptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* use the parent intercomm's recv ctx as the basis for our ctx */
     localcomm_ptr->recvcontext_id =
@@ -209,7 +207,7 @@ int MPIR_Setup_intercomm_localcomm(MPID_Comm * intercomm_ptr)
     /* sets up the SMP-aware sub-communicators and tables */
     mpi_errno = MPIR_Comm_commit(localcomm_ptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_fail:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_SETUP_INTERCOMM_LOCALCOMM);
@@ -228,7 +226,7 @@ static struct MPID_Collops *ic_default_collops = NULL;
 #undef FUNCNAME
 #define FUNCNAME cleanup_default_collops
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int cleanup_default_collops(void *unused)
 {
     int i;
@@ -251,7 +249,7 @@ static int cleanup_default_collops(void *unused)
 #undef FUNCNAME
 #define FUNCNAME init_default_collops
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int init_default_collops(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -378,7 +376,7 @@ static int init_default_collops(void)
 #undef FUNCNAME
 #define FUNCNAME set_collops
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int set_collops(MPID_Comm * comm)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -390,7 +388,7 @@ static int set_collops(MPID_Comm * comm)
     if (unlikely(!initialized)) {
         mpi_errno = init_default_collops();
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         initialized = TRUE;
     }
@@ -414,7 +412,7 @@ static int set_collops(MPID_Comm * comm)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_map_irregular
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_map_irregular(MPID_Comm * newcomm, MPID_Comm * src_comm,
                             int *src_mapping, int src_mapping_size,
                             MPIR_Comm_map_dir_t dir, MPIR_Comm_map_t ** map)
@@ -462,7 +460,7 @@ int MPIR_Comm_map_irregular(MPID_Comm * newcomm, MPID_Comm * src_comm,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_map_dup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_map_dup(MPID_Comm * newcomm, MPID_Comm * src_comm, MPIR_Comm_map_dir_t dir)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -495,7 +493,7 @@ int MPIR_Comm_map_dup(MPID_Comm * newcomm, MPID_Comm * src_comm, MPIR_Comm_map_d
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_map_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_map_free(MPID_Comm * comm)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -528,7 +526,7 @@ int MPIR_Comm_map_free(MPID_Comm * comm)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_commit
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_commit(MPID_Comm * comm)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -547,12 +545,12 @@ int MPIR_Comm_commit(MPID_Comm * comm)
 
     mpi_errno = set_collops(comm);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Notify device of communicator creation */
     mpi_errno = MPID_Dev_comm_create_hook(comm);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     MPIR_Comm_map_free(comm);
 
@@ -565,7 +563,7 @@ int MPIR_Comm_commit(MPID_Comm * comm)
         /* --BEGIN ERROR HANDLING-- */
         if (mpi_errno) {
             if (MPIR_Err_is_fatal(mpi_errno))
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             /* Non-fatal errors simply mean that this communicator will not have
              * any node awareness.  Node-aware collectives are an optimization. */
@@ -597,7 +595,7 @@ int MPIR_Comm_commit(MPID_Comm * comm)
         if (num_local > 1) {
             mpi_errno = MPIR_Comm_create(&comm->node_comm);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             comm->node_comm->context_id = comm->context_id + MPID_CONTEXT_INTRANODE_OFFSET;
             comm->node_comm->recvcontext_id = comm->node_comm->context_id;
@@ -615,12 +613,12 @@ int MPIR_Comm_commit(MPID_Comm * comm)
 
             mpi_errno = set_collops(comm->node_comm);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             /* Notify device of communicator creation */
             mpi_errno = MPID_Dev_comm_create_hook(comm->node_comm);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             /* don't call MPIR_Comm_commit here */
 
             MPIR_Comm_map_free(comm->node_comm);
@@ -631,7 +629,7 @@ int MPIR_Comm_commit(MPID_Comm * comm)
         if (local_rank == 0) {
             mpi_errno = MPIR_Comm_create(&comm->node_roots_comm);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             comm->node_roots_comm->context_id = comm->context_id + MPID_CONTEXT_INTERNODE_OFFSET;
             comm->node_roots_comm->recvcontext_id = comm->node_roots_comm->context_id;
@@ -648,12 +646,12 @@ int MPIR_Comm_commit(MPID_Comm * comm)
 
             mpi_errno = set_collops(comm->node_roots_comm);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             /* Notify device of communicator creation */
             mpi_errno = MPID_Dev_comm_create_hook(comm->node_roots_comm);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             /* don't call MPIR_Comm_commit here */
 
             MPIR_Comm_map_free(comm->node_roots_comm);
@@ -737,13 +735,13 @@ int MPIR_Comm_copy(MPID_Comm * comm_ptr, int size, MPID_Comm ** outcomm_ptr)
     if (comm_ptr->comm_kind == MPID_INTERCOMM) {
         mpi_errno = MPIR_Get_intercomm_contextid(comm_ptr, &new_context_id, &new_recvcontext_id);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     else {
         mpi_errno = MPIR_Get_contextid_sparse(comm_ptr, &new_context_id, FALSE);
         new_recvcontext_id = new_context_id;
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         MPIU_Assert(new_context_id != 0);
     }
 
@@ -813,18 +811,18 @@ int MPIR_Comm_copy(MPID_Comm * comm_ptr, int size, MPID_Comm ** outcomm_ptr)
     }
 
     /* Inherit the error handler (if any) */
-    MPIU_THREAD_CS_ENTER(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, comm_ptr->pobj_mutex);
     newcomm_ptr->errhandler = comm_ptr->errhandler;
     if (comm_ptr->errhandler) {
         MPIR_Errhandler_add_ref(comm_ptr->errhandler);
     }
-    MPIU_THREAD_CS_EXIT(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
 
     /* FIXME do we want to copy coll_fns here? */
 
     mpi_errno = MPIR_Comm_commit(newcomm_ptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Start with no attributes on this communicator */
     newcomm_ptr->attributes = 0;
@@ -832,10 +830,10 @@ int MPIR_Comm_copy(MPID_Comm * comm_ptr, int size, MPID_Comm ** outcomm_ptr)
     /* Copy over the info hints from the original communicator. */
     mpi_errno = MPIR_Info_dup_impl(comm_ptr->info, &(newcomm_ptr->info));
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPIR_Comm_apply_hints(newcomm_ptr, newcomm_ptr->info);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     *outcomm_ptr = newcomm_ptr;
 
@@ -856,7 +854,7 @@ int MPIR_Comm_copy(MPID_Comm * comm_ptr, int size, MPID_Comm ** outcomm_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_copy_data
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_copy_data(MPID_Comm * comm_ptr, MPID_Comm ** outcomm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -894,12 +892,12 @@ int MPIR_Comm_copy_data(MPID_Comm * comm_ptr, MPID_Comm ** outcomm_ptr)
     newcomm_ptr->is_low_group = comm_ptr->is_low_group; /* only relevant for intercomms */
 
     /* Inherit the error handler (if any) */
-    MPIU_THREAD_CS_ENTER(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, comm_ptr->pobj_mutex);
     newcomm_ptr->errhandler = comm_ptr->errhandler;
     if (comm_ptr->errhandler) {
         MPIR_Errhandler_add_ref(comm_ptr->errhandler);
     }
-    MPIU_THREAD_CS_EXIT(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
 
     /* FIXME do we want to copy coll_fns here? */
 
@@ -924,7 +922,7 @@ int MPIR_Comm_copy_data(MPID_Comm * comm_ptr, MPID_Comm ** outcomm_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_delete_internal
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_delete_internal(MPID_Comm * comm_ptr)
 {
     int in_use;
@@ -962,7 +960,7 @@ int MPIR_Comm_delete_internal(MPID_Comm * comm_ptr)
          * destroyed */
         mpi_errno = MPID_Dev_comm_destroy_hook(comm_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         /* Free info hints */
         if (comm_ptr->info != NULL) {
@@ -1006,7 +1004,6 @@ int MPIR_Comm_delete_internal(MPID_Comm * comm_ptr)
         MPIR_Free_contextid(comm_ptr->recvcontext_id);
 
         /* We need to release the error handler */
-        /* no MPI_OBJ CS needed */
         if (comm_ptr->errhandler &&
             !(HANDLE_GET_KIND(comm_ptr->errhandler->handle) == HANDLE_KIND_BUILTIN)) {
             int errhInuse;
@@ -1047,7 +1044,7 @@ int MPIR_Comm_delete_internal(MPID_Comm * comm_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_release_always
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_release_always(MPID_Comm * comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1062,7 +1059,7 @@ int MPIR_Comm_release_always(MPID_Comm * comm_ptr)
     if (!in_use) {
         mpi_errno = MPIR_Comm_delete_internal(comm_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -1077,7 +1074,7 @@ int MPIR_Comm_release_always(MPID_Comm * comm_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_apply_hints
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_apply_hints(MPID_Comm * comm_ptr, MPID_Info * info_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1101,7 +1098,7 @@ int MPIR_Comm_apply_hints(MPID_Comm * comm_ptr, MPID_Info * info_ptr)
         if (hint_fn) {
             mpi_errno = hint_fn->fn(comm_ptr, hint, hint_fn->state);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -1115,7 +1112,7 @@ int MPIR_Comm_apply_hints(MPID_Comm * comm_ptr, MPID_Info * info_ptr)
 #undef FUNCNAME
 #define FUNCNAME free_hint_handles
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int free_hint_handles(void *ignore)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1143,7 +1140,7 @@ static int free_hint_handles(void *ignore)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_register_hint
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_register_hint(const char *hint_key, MPIR_Comm_hint_fn_t fn, void *state)
 {
     int mpi_errno = MPI_SUCCESS;
diff --git a/src/mpi/comm/contextid.c b/src/mpi/comm/contextid.c
index 18feb18..a60e184 100644
--- a/src/mpi/comm/contextid.c
+++ b/src/mpi/comm/contextid.c
@@ -294,7 +294,7 @@ static volatile int lowest_tag = -1;
 #undef FUNCNAME
 #define FUNCNAME MPIR_Get_contextid_sparse
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Get_contextid_sparse(MPID_Comm * comm_ptr, MPIU_Context_id_t * context_id, int ignore_id)
 {
     return MPIR_Get_contextid_sparse_group(comm_ptr, NULL /*group_ptr */ ,
@@ -320,7 +320,7 @@ int MPIR_Get_contextid_sparse(MPID_Comm * comm_ptr, MPIU_Context_id_t * context_
 #undef FUNCNAME
 #define FUNCNAME MPIR_Get_contextid_sparse_group
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr, int tag,
                                     MPIU_Context_id_t * context_id, int ignore_id)
 {
@@ -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. */
-        MPIU_THREAD_CS_ENTER(CONTEXTID,);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.ctx_mutex);
 
         if (initialize_context_mask) {
             context_id_init();
@@ -424,7 +424,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
                 MPIU_DBG_MSG(COMM, VERBOSE, "Copied local_mask");
             }
         }
-        MPIU_THREAD_CS_EXIT(CONTEXTID,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.ctx_mutex);
 
         /* Note: MPIR_MAX_CONTEXT_MASK elements of local_mask are used by the
          * context ID allocation algorithm.  The additional element is ignored
@@ -452,12 +452,12 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
                                             MPI_INT, MPI_BAND, comm_ptr, &errflag);
         }
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+            MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
         /* MT FIXME 2/3 cases don't seem to need the CONTEXTID CS, check and
          * narrow this region */
-        MPIU_THREAD_CS_ENTER(CONTEXTID,);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.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 */
@@ -478,7 +478,11 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
                  * there is another thread (with a lower input context id)
                  * waiting for it.  We need to ensure that any other threads
                  * have the opportunity to run, hence yielding */
-                MPIU_THREAD_CS_YIELD(CONTEXTID,);
+                /* FIXME: Do we need to do an GLOBAL yield here?
+                 * When we do a collective operation, we anyway yield
+                 * for other others */
+                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
+                MPID_THREAD_CS_YIELD(POBJ, MPIR_ThreadInfo.ctx_mutex);
             }
         }
         else if (own_mask) {
@@ -504,14 +508,22 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
                  * there is another thread (with a lower input context id)
                  * waiting for it.  We need to ensure that any other threads
                  * have the opportunity to run, hence yielding */
-                MPIU_THREAD_CS_YIELD(CONTEXTID,);
+                /* FIXME: Do we need to do an GLOBAL yield here?
+                 * When we do a collective operation, we anyway yield
+                 * for other others */
+                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
+                MPID_THREAD_CS_YIELD(POBJ, MPIR_ThreadInfo.ctx_mutex);
             }
         }
         else {
             /* As above, force this thread to yield */
-            MPIU_THREAD_CS_YIELD(CONTEXTID,);
+            /* FIXME: Do we need to do an GLOBAL yield here?  When we
+             * do a collective operation, we anyway yield for other
+             * others */
+            MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
+            MPID_THREAD_CS_YIELD(POBJ, MPIR_ThreadInfo.ctx_mutex);
         }
-        MPIU_THREAD_CS_EXIT(CONTEXTID,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.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
@@ -525,13 +537,13 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
             int minfree;
 
             if (own_mask) {
-                MPIU_THREAD_CS_ENTER(CONTEXTID,);
+                MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.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;
                 }
-                MPIU_THREAD_CS_EXIT(CONTEXTID,);
+                MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.ctx_mutex);
             }
 
             context_mask_stats(&nfree, &ntotal);
@@ -551,12 +563,12 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
             }
 
             if (minfree > 0) {
-                MPIU_ERR_SETANDJUMP3(mpi_errno, MPI_ERR_OTHER,
+                MPIR_ERR_SETANDJUMP3(mpi_errno, MPI_ERR_OTHER,
                                      "**toomanycommfrag", "**toomanycommfrag %d %d %d",
                                      nfree, ntotal, ignore_id);
             }
             else {
-                MPIU_ERR_SETANDJUMP3(mpi_errno, MPI_ERR_OTHER,
+                MPIR_ERR_SETANDJUMP3(mpi_errno, MPI_ERR_OTHER,
                                      "**toomanycomm", "**toomanycomm %d %d %d",
                                      nfree, ntotal, ignore_id);
             }
@@ -608,7 +620,7 @@ static int sched_cb_gcn_bcast(MPID_Comm * comm, int tag, void *state);
 #undef FUNCNAME
 #define FUNCNAME sched_cb_commit_comm
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int sched_cb_commit_comm(MPID_Comm * comm, int tag, void *state)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -616,7 +628,7 @@ static int sched_cb_commit_comm(MPID_Comm * comm, int tag, void *state)
 
     mpi_errno = MPIR_Comm_commit(st->new_comm);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_fail:
     return mpi_errno;
@@ -626,7 +638,7 @@ static int sched_cb_commit_comm(MPID_Comm * comm, int tag, void *state)
 #undef FUNCNAME
 #define FUNCNAME sched_cb_gcn_bcast
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int sched_cb_gcn_bcast(MPID_Comm * comm, int tag, void *state)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -638,12 +650,12 @@ static int sched_cb_gcn_bcast(MPID_Comm * comm, int tag, void *state)
                 MPID_Sched_recv(st->ctx1, 1, MPIU_CONTEXT_ID_T_DATATYPE, 0, st->comm_ptr_inter,
                                 st->s);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             mpi_errno =
                 MPID_Sched_send(st->ctx0, 1, MPIU_CONTEXT_ID_T_DATATYPE, 0, st->comm_ptr_inter,
                                 st->s);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             MPID_SCHED_BARRIER(st->s);
         }
 
@@ -651,16 +663,16 @@ static int sched_cb_gcn_bcast(MPID_Comm * comm, int tag, void *state)
                                                          MPIU_CONTEXT_ID_T_DATATYPE, 0,
                                                          st->comm_ptr, st->s);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(st->s);
     }
 
     mpi_errno = MPID_Sched_cb(&sched_cb_commit_comm, st, st->s);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_cb(&MPIR_Sched_cb_free_buf, st, st->s);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_fail:
     return mpi_errno;
@@ -682,7 +694,7 @@ static int sched_cb_gcn_bcast(MPID_Comm * comm, int tag, void *state)
 #undef FUNCNAME
 #define FUNCNAME sched_cb_gcn_allocate_cid
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int sched_cb_gcn_allocate_cid(MPID_Comm * comm, int tag, void *state)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -720,7 +732,7 @@ static int sched_cb_gcn_allocate_cid(MPID_Comm * comm, int tag, void *state)
         /* do not own mask, try again */
         mpi_errno = MPID_Sched_cb(&sched_cb_gcn_copy_mask, st, st->s);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(st->s);
     }
     else {
@@ -731,7 +743,7 @@ static int sched_cb_gcn_allocate_cid(MPID_Comm * comm, int tag, void *state)
 
         mpi_errno = MPID_Sched_cb(&sched_cb_gcn_bcast, st, st->s);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         MPID_SCHED_BARRIER(st->s);
     }
 
@@ -744,7 +756,7 @@ static int sched_cb_gcn_allocate_cid(MPID_Comm * comm, int tag, void *state)
 #undef FUNCNAME
 #define FUNCNAME sched_cb_gcn_copy_mask
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int sched_cb_gcn_copy_mask(MPID_Comm * comm, int tag, void *state)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -802,12 +814,12 @@ static int sched_cb_gcn_copy_mask(MPID_Comm * comm, int tag, void *state)
                                                  MPIR_MAX_CONTEXT_MASK, MPI_UINT32_T, MPI_BAND,
                                                  st->comm_ptr, st->s);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(st->s);
 
     mpi_errno = MPID_Sched_cb(&sched_cb_gcn_allocate_cid, st, st->s);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(st->s);
 
   fn_fail:
@@ -854,7 +866,7 @@ static int sched_cb_gcn_copy_mask(MPID_Comm * comm, int tag, void *state)
 #undef FUNCNAME
 #define FUNCNAME sched_get_cid_nonblock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int sched_get_cid_nonblock(MPID_Comm * comm_ptr, MPID_Comm * newcomm,
                                   MPIU_Context_id_t * ctx0, MPIU_Context_id_t * ctx1,
                                   MPID_Sched_t s, MPID_Comm_kind_t gcn_cid_kind)
@@ -900,7 +912,7 @@ static int sched_get_cid_nonblock(MPID_Comm * comm_ptr, MPID_Comm * newcomm,
 
     mpi_errno = MPID_Sched_cb(&sched_cb_gcn_copy_mask, st, s);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     MPID_SCHED_BARRIER(s);
 
     MPIU_CHKPMEM_COMMIT();
@@ -916,7 +928,7 @@ static int sched_get_cid_nonblock(MPID_Comm * comm_ptr, MPID_Comm * newcomm,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Get_contextid_nonblock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Get_contextid_nonblock(MPID_Comm * comm_ptr, MPID_Comm * newcommp, MPID_Request ** req)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -930,22 +942,22 @@ int MPIR_Get_contextid_nonblock(MPID_Comm * comm_ptr, MPID_Comm * newcommp, MPID
     /* now create a schedule */
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* add some entries to it */
     mpi_errno =
         sched_get_cid_nonblock(comm_ptr, newcommp, &newcommp->context_id, &newcommp->recvcontext_id,
                                s, MPID_INTRACOMM);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* finally, kick off the schedule and give the caller a request */
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, req);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_GET_CONTEXTID_NONBLOCK);
@@ -959,7 +971,7 @@ int MPIR_Get_contextid_nonblock(MPID_Comm * comm_ptr, MPID_Comm * newcommp, MPID
 #undef FUNCNAME
 #define FUNCNAME MPIR_Get_intercomm_contextid_nonblock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Get_intercomm_contextid_nonblock(MPID_Comm * comm_ptr, MPID_Comm * newcommp,
                                           MPID_Request ** req)
 {
@@ -974,16 +986,16 @@ int MPIR_Get_intercomm_contextid_nonblock(MPID_Comm * comm_ptr, MPID_Comm * newc
     if (!comm_ptr->local_comm) {
         mpi_errno = MPIR_Setup_intercomm_localcomm(comm_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     /* now create a schedule */
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* add some entries to it */
 
@@ -992,12 +1004,12 @@ int MPIR_Get_intercomm_contextid_nonblock(MPID_Comm * comm_ptr, MPID_Comm * newc
         sched_get_cid_nonblock(comm_ptr, newcommp, &newcommp->recvcontext_id, &newcommp->context_id,
                                s, MPID_INTERCOMM);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* finally, kick off the schedule and give the caller a request */
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, req);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_fail:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_GET_INTERCOMM_CONTEXTID_NONBLOCK);
@@ -1048,12 +1060,12 @@ int MPIR_Get_intercomm_contextid(MPID_Comm * comm_ptr, MPIU_Context_id_t * conte
         /* Manufacture the local communicator */
         mpi_errno = MPIR_Setup_intercomm_localcomm(comm_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     mpi_errno = MPIR_Get_contextid_sparse(comm_ptr->local_comm, &mycontext_id, FALSE);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(mycontext_id != 0);
 
     /* MPIC routine uses an internal context id.  The local leads (process 0)
@@ -1064,7 +1076,7 @@ int MPIR_Get_intercomm_contextid(MPID_Comm * comm_ptr, MPIU_Context_id_t * conte
                                   &remote_context_id, 1, MPIU_CONTEXT_ID_T_DATATYPE, 0, tag,
                                   comm_ptr, MPI_STATUS_IGNORE, &errflag);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     /* Make sure that all of the local processes now have this
@@ -1072,8 +1084,8 @@ int MPIR_Get_intercomm_contextid(MPID_Comm * comm_ptr, MPIU_Context_id_t * conte
     mpi_errno = MPIR_Bcast_impl(&remote_context_id, 1, MPIU_CONTEXT_ID_T_DATATYPE,
                                 0, comm_ptr->local_comm, &errflag);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        MPIR_ERR_POP(mpi_errno);
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
     /* The recvcontext_id must be the one that was allocated out of the local
      * group, not the remote group.  Otherwise we could end up posting two
      * MPI_ANY_SOURCE,MPI_ANY_TAG recvs on the same context IDs even though we
@@ -1088,7 +1100,7 @@ int MPIR_Get_intercomm_contextid(MPID_Comm * comm_ptr, MPIU_Context_id_t * conte
 #undef FUNCNAME
 #define FUNCNAME MPIR_Free_contextid
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Free_contextid(MPIU_Context_id_t context_id)
 {
     int idx, bitpos, raw_prefix;
@@ -1147,12 +1159,12 @@ void MPIR_Free_contextid(MPIU_Context_id_t context_id)
     }
     /* --END ERROR HANDLING-- */
 
-    MPIU_THREAD_CS_ENTER(CONTEXTID,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.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);
-    MPIU_THREAD_CS_EXIT(CONTEXTID,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.ctx_mutex);
 
     MPIU_DBG_MSG_FMT(COMM, VERBOSE,
                      (MPIU_DBG_FDEST,
diff --git a/src/mpi/comm/intercomm_create.c b/src/mpi/comm/intercomm_create.c
index 28180d9..f5103fa 100644
--- a/src/mpi/comm/intercomm_create.c
+++ b/src/mpi/comm/intercomm_create.c
@@ -41,7 +41,7 @@ PMPI_LOCAL int MPID_LPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
 #undef FUNCNAME
 #define FUNCNAME MPIR_CheckDisjointLpids
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 PMPI_LOCAL int MPIR_CheckDisjointLpids( int lpids1[], int n1, 
 					 int lpids2[], int n2 )
 {
@@ -85,7 +85,7 @@ PMPI_LOCAL int MPIR_CheckDisjointLpids( int lpids1[], int n1,
 	idx = lpids2[i] / 32;
 	bit = lpids2[i] % 32;
 	if (lpidmask[idx] & (1 << bit)) {
-	    MPIU_ERR_SET1(mpi_errno,MPI_ERR_COMM, 
+	    MPIR_ERR_SET1(mpi_errno,MPI_ERR_COMM, 
 			  "**dupprocesses", "**dupprocesses %d", lpids2[i] );
 	    goto fn_fail;
 	}
@@ -110,7 +110,7 @@ PMPI_LOCAL int MPID_LPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
     /* FIXME: Should be using the local_size argument */
     MPIU_Assert( comm_ptr->local_size == local_size );
     for (i=0; i<comm_ptr->local_size; i++) {
-	(void)MPID_Comm_get_lpid( comm_ptr, i, &local_lpids[i], MPIU_FALSE );
+	(void)MPID_Comm_get_lpid( comm_ptr, i, &local_lpids[i], FALSE );
     }
     return 0;
 }
@@ -118,7 +118,7 @@ PMPI_LOCAL int MPID_LPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Intercomm_create_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
                                MPID_Comm *peer_comm_ptr, int remote_leader, int tag,
                                MPID_Comm **new_intercomm_ptr)
@@ -171,7 +171,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
                                       &remote_size, 1, MPI_INT,
                                       remote_leader, cts_tag,
                                       peer_comm_ptr, MPI_STATUS_IGNORE, &errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         MPIU_DBG_MSG_FMT(COMM,VERBOSE,(MPIU_DBG_FDEST, "local size = %d, remote size = %d", local_size,
                                        remote_size ));
@@ -183,7 +183,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
         MPIU_CHKLMEM_MALLOC(local_lpids,int*,local_size*sizeof(int), mpi_errno,"local_lpids");
 
         mpi_errno = MPID_GPID_GetAllInComm( local_comm_ptr, local_size, local_gpids, &singlePG );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* Exchange the lpid arrays */
         mpi_errno = MPIC_Sendrecv( local_gpids, local_size*sizeof(MPID_Gpid), MPI_BYTE,
@@ -191,16 +191,16 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
                                       remote_gpids, remote_size*sizeof(MPID_Gpid), MPI_BYTE,
                                       remote_leader, cts_tag, peer_comm_ptr,
                                       MPI_STATUS_IGNORE, &errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 
         /* Convert the remote gpids to the lpids */
         mpi_errno = MPID_GPID_ToLpidArray( remote_size, remote_gpids, remote_lpids );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* Get our own lpids */
         mpi_errno = MPID_LPID_GetAllInComm( local_comm_ptr, local_size, local_lpids );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 #       ifdef HAVE_ERROR_CHECKING
         {
@@ -209,7 +209,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
                 /* Now that we have both the local and remote processes,
                    check for any overlap */
                 mpi_errno = MPIR_CheckDisjointLpids( local_lpids, local_size, remote_lpids, remote_size );
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             MPID_END_ERROR_CHECKS;
         }
@@ -237,7 +237,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
        calling routine already holds the single criticial section */
     /* TODO: Make sure this is tag-safe */
     mpi_errno = MPIR_Get_contextid_sparse( local_comm_ptr, &recvcontext_id, FALSE );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(recvcontext_id != 0);
     MPIU_DBG_MSG_FMT(COMM,VERBOSE, (MPIU_DBG_FDEST,"Got contextid=%d", recvcontext_id));
 
@@ -249,7 +249,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
         mpi_errno = MPIC_Sendrecv( &recvcontext_id, 1, MPIU_CONTEXT_ID_T_DATATYPE, remote_leader, cts_tag,
                                       &remote_context_id, 1, MPIU_CONTEXT_ID_T_DATATYPE, remote_leader, cts_tag,
                                       peer_comm_ptr, MPI_STATUS_IGNORE, &errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         final_context_id = remote_context_id;
 
@@ -260,12 +260,12 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
         comm_info[2] = is_low_group;
         MPIU_DBG_MSG(COMM,VERBOSE,"About to bcast on local_comm");
         mpi_errno = MPIR_Bcast_impl( comm_info, 3, MPI_INT, local_leader, local_comm_ptr, &errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
         mpi_errno = MPIR_Bcast_impl( remote_gpids, remote_size*sizeof(MPID_Gpid), MPI_BYTE, local_leader,
                                      local_comm_ptr, &errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
         MPIU_DBG_MSG_D(COMM,VERBOSE,"end of bcast on local_comm of size %d",
                        local_comm_ptr->local_size );
     }
@@ -274,15 +274,15 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
         /* we're the other processes */
         MPIU_DBG_MSG(COMM,VERBOSE,"About to receive bcast on local_comm");
         mpi_errno = MPIR_Bcast_impl( comm_info, 3, MPI_INT, local_leader, local_comm_ptr, &errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
         remote_size = comm_info[0];
         MPIU_CHKLMEM_MALLOC(remote_gpids,MPID_Gpid*,remote_size*sizeof(MPID_Gpid), mpi_errno,"remote_gpids");
         MPIU_CHKLMEM_MALLOC(remote_lpids,int*,remote_size*sizeof(int), mpi_errno,"remote_lpids");
         mpi_errno = MPIR_Bcast_impl( remote_gpids, remote_size*sizeof(MPID_Gpid), MPI_BYTE, local_leader,
                                      local_comm_ptr, &errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
         /* Extract the context and group sign informatin */
         final_context_id = comm_info[1];
@@ -313,7 +313,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
        group information */
     if (local_comm_ptr->rank != local_leader) {
         mpi_errno = MPID_GPID_ToLpidArray( remote_size, remote_gpids, remote_lpids );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 
@@ -340,15 +340,15 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
     MPIR_Comm_map_dup(*new_intercomm_ptr, local_comm_ptr, MPIR_COMM_MAP_DIR_L2L);
 
     /* Inherit the error handler (if any) */
-    MPIU_THREAD_CS_ENTER(MPI_OBJ, local_comm_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, local_comm_ptr->pobj_mutex);
     (*new_intercomm_ptr)->errhandler = local_comm_ptr->errhandler;
     if (local_comm_ptr->errhandler) {
         MPIR_Errhandler_add_ref( local_comm_ptr->errhandler );
     }
-    MPIU_THREAD_CS_EXIT(MPI_OBJ, local_comm_ptr);
+    MPID_THREAD_CS_EXIT(POBJ, local_comm_ptr->pobj_mutex);
 
     mpi_errno = MPIR_Comm_commit(*new_intercomm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 
  fn_exit:
@@ -366,7 +366,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
 #undef FUNCNAME
 #define FUNCNAME MPI_Intercomm_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Intercomm_create - Creates an intercommuncator from two intracommunicators
@@ -427,7 +427,7 @@ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INTERCOMM_CREATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -457,7 +457,7 @@ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader,
 		MPIR_ERRTEST_COMM_INTRA(local_comm_ptr, mpi_errno );
 		if ((local_leader < 0 || 
 		     local_leader >= local_comm_ptr->local_size)) {
-		    MPIU_ERR_SET2(mpi_errno,MPI_ERR_RANK, 
+		    MPIR_ERR_SET2(mpi_errno,MPI_ERR_RANK, 
 				  "**ranklocal", "**ranklocal %d %d", 
 				  local_leader, local_comm_ptr->local_size - 1 );
                     /* If local_comm_ptr is not valid, it will be reset to null */
@@ -489,7 +489,7 @@ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader,
 		if (!mpi_errno && peer_comm_ptr && 
 		    (remote_leader < 0 || 
 		     remote_leader >= peer_comm_ptr->remote_size)) {
-		    MPIU_ERR_SET2(mpi_errno,MPI_ERR_RANK, 
+		    MPIR_ERR_SET2(mpi_errno,MPI_ERR_RANK, 
 				  "**rankremote", "**rankremote %d %d", 
 				  remote_leader, peer_comm_ptr->remote_size - 1 );
 		}
@@ -506,7 +506,7 @@ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader,
 		if (peer_comm_ptr->comm_kind == MPID_INTRACOMM &&
 		    local_comm_ptr->rank == local_leader && 
 		    peer_comm_ptr->rank == remote_leader) {
-		    MPIU_ERR_SET(mpi_errno,MPI_ERR_RANK,"**ranksdistinct");
+		    MPIR_ERR_SET(mpi_errno,MPI_ERR_RANK,"**ranksdistinct");
 		}
 		if (mpi_errno) goto fn_fail;
 	    }
@@ -525,7 +525,7 @@ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader,
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INTERCOMM_CREATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/comm/intercomm_merge.c b/src/mpi/comm/intercomm_merge.c
index 798dda3..13aaca9 100644
--- a/src/mpi/comm/intercomm_merge.c
+++ b/src/mpi/comm/intercomm_merge.c
@@ -34,7 +34,7 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm) __
 #undef FUNCNAME
 #define FUNCNAME create_and_map
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int create_and_map(MPID_Comm *comm_ptr, int local_high, MPID_Comm *new_intracomm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -68,7 +68,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Intercomm_merge_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_intracomm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -82,7 +82,7 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
     if (!comm_ptr->local_comm) {
         /* Manufacture the local communicator */
         mpi_errno = MPIR_Setup_intercomm_localcomm( comm_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* Find the "high" value of the other group of processes.  This
@@ -95,7 +95,7 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
         mpi_errno = MPIC_Sendrecv( &local_high, 1, MPI_INT, 0, 0,
                                       &remote_high, 1, MPI_INT, 0, 0, comm_ptr,
                                       MPI_STATUS_IGNORE, &errflag );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         
         /* If local_high and remote_high are the same, then order is arbitrary.
            we use the gpids of the rank 0 member of the local and remote
@@ -104,12 +104,12 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
             MPID_Gpid ingpid, outgpid;
             
             mpi_errno = MPID_GPID_Get( comm_ptr, 0, &ingpid );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             
             mpi_errno = MPIC_Sendrecv( &ingpid, sizeof(MPID_Gpid), MPI_BYTE, 0, 1,
                                           &outgpid, sizeof(MPID_Gpid), MPI_BYTE, 0, 1, comm_ptr,
                                           MPI_STATUS_IGNORE, &errflag );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             /* Note that the gpids cannot be the same because we are
                starting from a valid intercomm */
@@ -133,11 +133,11 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
        of processes had the same value for high
     */
     mpi_errno = MPIR_Bcast_impl( &local_high, 1, MPI_INT, 0, comm_ptr->local_comm, &errflag );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
     mpi_errno = MPIR_Comm_create( new_intracomm_ptr );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     new_size = comm_ptr->local_size + comm_ptr->remote_size;
 
@@ -158,7 +158,7 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
     /* Now we know which group comes first.  Build the new mapping
        from the existing comm */
     mpi_errno = create_and_map(comm_ptr, local_high, (*new_intracomm_ptr));
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* We've setup a temporary context id, based on the context id
        used by the intercomm.  This allows us to perform the allreduce
@@ -166,24 +166,24 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
        have a valid (almost - see comm_create_hook) communicator.
     */
     mpi_errno = MPIR_Comm_commit((*new_intracomm_ptr));
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* printf( "About to get context id \n" ); fflush( stdout ); */
     /* In the multi-threaded case, MPIR_Get_contextid_sparse assumes that the
        calling routine already holds the single criticial section */
     new_context_id = 0;
     mpi_errno = MPIR_Get_contextid_sparse( (*new_intracomm_ptr), &new_context_id, FALSE );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(new_context_id != 0);
 
     /* We release this communicator that was involved just to
      * get valid context id and create true one
      */
     mpi_errno = MPIR_Comm_release(*new_intracomm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIR_Comm_create( new_intracomm_ptr );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     (*new_intracomm_ptr)->remote_size    = (*new_intracomm_ptr)->local_size   = new_size;
     (*new_intracomm_ptr)->rank           = -1;
@@ -192,10 +192,10 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
     (*new_intracomm_ptr)->recvcontext_id = new_context_id;
 
     mpi_errno = create_and_map(comm_ptr, local_high, (*new_intracomm_ptr));
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIR_Comm_commit((*new_intracomm_ptr));
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_INTERCOMM_MERGE_IMPL);
@@ -210,7 +210,7 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
 #undef FUNCNAME
 #define FUNCNAME MPI_Intercomm_merge
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 MPI_Intercomm_merge - Creates an intracommuncator from an intercommunicator
@@ -260,7 +260,7 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);  
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);  
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INTERCOMM_MERGE);
 
     MPIU_THREADPRIV_GET;
@@ -316,8 +316,8 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm)
 	    acthigh = high ? 1 : 0;   /* Clamp high into 1 or 0 */
 	    mpi_errno = MPIR_Allreduce_impl( MPI_IN_PLACE, &acthigh, 1, MPI_INT,
                                              MPI_SUM, comm_ptr->local_comm, &errflag );
-	    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+	    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 	    /* acthigh must either == 0 or the size of the local comm */
 	    if (acthigh != 0 && acthigh != comm_ptr->local_size) {
 		mpi_errno = MPIR_Err_create_code( MPI_SUCCESS, 
@@ -343,7 +343,7 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INTERCOMM_MERGE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/get_count.c b/src/mpi/datatype/get_count.c
index 258fb86..a96f7a3 100644
--- a/src/mpi/datatype/get_count.c
+++ b/src/mpi/datatype/get_count.c
@@ -27,7 +27,7 @@ int MPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count) _
 #undef FUNCNAME
 #define FUNCNAME MPIR_Get_count_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Get_count_impl(const MPI_Status *status, MPI_Datatype datatype, int *count)
 {
     MPI_Count size;
@@ -66,7 +66,7 @@ void MPIR_Get_count_impl(const MPI_Status *status, MPI_Datatype datatype, int *c
 #undef FUNCNAME
 #define FUNCNAME MPI_Get_count
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
   MPI_Get_count - Gets the number of "top level" elements
 
diff --git a/src/mpi/datatype/get_elements.c b/src/mpi/datatype/get_elements.c
index 1dcd949..38c9bf7 100644
--- a/src/mpi/datatype/get_elements.c
+++ b/src/mpi/datatype/get_elements.c
@@ -32,7 +32,7 @@ int MPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count
 #undef FUNCNAME
 #define FUNCNAME MPI_Get_elements
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Get_elements - Returns the number of basic elements
                       in a datatype
@@ -105,7 +105,7 @@ int MPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Get_elements_x_impl(status, datatype, &count_x);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* clip the value if it cannot be correctly returned to the user */
     *count = (count_x > INT_MAX) ? MPI_UNDEFINED : (int)count_x;
diff --git a/src/mpi/datatype/get_elements_x.c b/src/mpi/datatype/get_elements_x.c
index 8a84ca5..5ec9a8a 100644
--- a/src/mpi/datatype/get_elements_x.c
+++ b/src/mpi/datatype/get_elements_x.c
@@ -278,7 +278,7 @@ PMPI_LOCAL MPI_Count MPIR_Type_get_elements(MPI_Count *bytes_p,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Get_elements_x_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Get_elements_x_impl(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *elements)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -360,7 +360,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Get_elements_x
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* N.B. "count" is the name mandated by the MPI-3 standard, but it should
  * probably be called "elements" instead and is handled that way in the _impl
  * routine [goodell@ 2012-11-05 */
@@ -386,7 +386,7 @@ int MPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Coun
     int mpi_errno = MPI_SUCCESS;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_GET_ELEMENTS_X);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GET_ELEMENTS_X);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -427,13 +427,13 @@ int MPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Coun
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Get_elements_x_impl(status, datatype, count);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GET_ELEMENTS_X);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/datatype/pack.c b/src/mpi/datatype/pack.c
index 5be1767..760554b 100644
--- a/src/mpi/datatype/pack.c
+++ b/src/mpi/datatype/pack.c
@@ -29,7 +29,7 @@ int MPI_Pack(const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf
 #undef FUNCNAME
 #define FUNCNAME MPIR_Pack_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Pack_impl(const void *inbuf,
                    MPI_Aint incount,
                    MPI_Datatype datatype,
@@ -73,10 +73,10 @@ int MPIR_Pack_impl(const void *inbuf,
     /* TODO: CHECK RETURN VALUES?? */
     /* TODO: SHOULD THIS ALL BE IN A MPID_PACK??? */
     segp = MPID_Segment_alloc();
-    MPIU_ERR_CHKANDJUMP1(segp == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment");
+    MPIR_ERR_CHKANDJUMP1(segp == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment");
     
     mpi_errno = MPID_Segment_init(inbuf, incount, datatype, segp, 0);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* NOTE: the use of buffer values and positions in MPI_Pack and in
      * MPID_Segment_pack are quite different.  See code or docs or something.
@@ -111,7 +111,7 @@ int MPIR_Pack_impl(const void *inbuf,
 #undef FUNCNAME
 #define FUNCNAME MPI_Pack
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Pack - Packs a datatype into contiguous memory
 
@@ -220,20 +220,20 @@ int MPI_Pack(const void *inbuf,
 
 	if (tmp_sz * incount > outsize - *position) {
 	    if (*position < 0) {
-		MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_ARG,
+		MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_ARG,
 				     "**argposneg","**argposneg %d",
 				     *position);
 	    }
 	    else if (outsize < 0) {
-		MPIU_ERR_SETANDJUMP2(mpi_errno,MPI_ERR_ARG,"**argneg",
+		MPIR_ERR_SETANDJUMP2(mpi_errno,MPI_ERR_ARG,"**argneg",
 				     "**argneg %s %d","outsize",outsize);
 	    }
 	    else if (incount < 0) {
-		MPIU_ERR_SETANDJUMP2(mpi_errno,MPI_ERR_ARG,"**argneg",
+		MPIR_ERR_SETANDJUMP2(mpi_errno,MPI_ERR_ARG,"**argneg",
 				     "**argneg %s %d","incount",incount);
 	    }
 	    else {
-		MPIU_ERR_SETANDJUMP2(mpi_errno,MPI_ERR_ARG,"**argpackbuf",
+		MPIR_ERR_SETANDJUMP2(mpi_errno,MPI_ERR_ARG,"**argpackbuf",
 				     "**argpackbuf %d %d", tmp_sz * incount,
 				     outsize - *position);
 	    }
diff --git a/src/mpi/datatype/pack_size.c b/src/mpi/datatype/pack_size.c
index 49b1cdf..33de867 100644
--- a/src/mpi/datatype/pack_size.c
+++ b/src/mpi/datatype/pack_size.c
@@ -28,7 +28,7 @@ int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int *size)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Pack_size_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Pack_size_impl(int incount, MPI_Datatype datatype, MPI_Aint *size)
 {
     MPI_Aint typesize;
@@ -42,7 +42,7 @@ void MPIR_Pack_size_impl(int incount, MPI_Datatype datatype, MPI_Aint *size)
 #undef FUNCNAME
 #define FUNCNAME MPI_Pack_size
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Pack_size - Returns the upper bound on the amount of space needed to
                     pack a message
diff --git a/src/mpi/datatype/register_datarep.c b/src/mpi/datatype/register_datarep.c
index 336e1cb..43b321a 100644
--- a/src/mpi/datatype/register_datarep.c
+++ b/src/mpi/datatype/register_datarep.c
@@ -60,7 +60,7 @@ int MPI_Register_datarep(char *datarep,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_REGISTER_DATAREP);
     
     /* Validate parameters and objects (post conversion) */
@@ -85,7 +85,7 @@ int MPI_Register_datarep(char *datarep,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_REGISTER_DATAREP);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/status_set_elements.c b/src/mpi/datatype/status_set_elements.c
index cf8798c..0d0753c 100644
--- a/src/mpi/datatype/status_set_elements.c
+++ b/src/mpi/datatype/status_set_elements.c
@@ -83,7 +83,7 @@ int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype,
     /* ... body of routine ... */
 
     mpi_errno = MPIR_Status_set_elements_x_impl(status, datatype, (MPI_Count)count);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/datatype/status_set_elements_x.c b/src/mpi/datatype/status_set_elements_x.c
index ce5a19c..4e7c78f 100644
--- a/src/mpi/datatype/status_set_elements_x.c
+++ b/src/mpi/datatype/status_set_elements_x.c
@@ -29,7 +29,7 @@ int MPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Cou
 #undef FUNCNAME
 #define FUNCNAME MPIR_Status_set_elements_x_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Status_set_elements_x_impl(MPI_Status *status, MPI_Datatype datatype, MPI_Count count)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -56,7 +56,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Status_set_elements_x
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Status_set_elements_x - XXX description here
 
@@ -78,7 +78,7 @@ int MPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Cou
     int mpi_errno = MPI_SUCCESS;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_STATUS_SET_ELEMENTS_X);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_STATUS_SET_ELEMENTS_X);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -119,13 +119,13 @@ int MPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Cou
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Status_set_elements_x_impl(status, datatype, count);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_STATUS_SET_ELEMENTS_X);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/datatype/type_commit.c b/src/mpi/datatype/type_commit.c
index 8ed3fcb..895d669 100644
--- a/src/mpi/datatype/type_commit.c
+++ b/src/mpi/datatype/type_commit.c
@@ -28,7 +28,7 @@ int MPI_Type_commit(MPI_Datatype *datatype) __attribute__((weak,alias("PMPI_Type
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_commit_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_commit_impl(MPI_Datatype *datatype)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -43,7 +43,7 @@ int MPIR_Type_commit_impl(MPI_Datatype *datatype)
 	*datatype == MPI_LONG_DOUBLE_INT) goto fn_exit;
 
     mpi_errno = MPID_Type_commit(datatype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
  fn_exit:
     return mpi_errno;
@@ -56,7 +56,7 @@ int MPIR_Type_commit_impl(MPI_Datatype *datatype)
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_commit
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Type_commit - Commits the datatype
 
@@ -78,7 +78,7 @@ int MPI_Type_commit(MPI_Datatype *datatype)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_COMMIT);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -114,13 +114,13 @@ int MPI_Type_commit(MPI_Datatype *datatype)
     /* ... body of routine ... */
 
     mpi_errno = MPIR_Type_commit_impl(datatype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     /* ... end of body of routine ... */
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_COMMIT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_contiguous.c b/src/mpi/datatype/type_contiguous.c
index ee4de6c..aa974f9 100644
--- a/src/mpi/datatype/type_contiguous.c
+++ b/src/mpi/datatype/type_contiguous.c
@@ -28,7 +28,7 @@ int MPI_Type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype *newtype)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_contiguous_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_contiguous_impl(int count,
                               MPI_Datatype oldtype,
                               MPI_Datatype *newtype)
@@ -66,7 +66,7 @@ int MPIR_Type_contiguous_impl(int count,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_contiguous_x_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_contiguous_x_impl(MPI_Count count,
                               MPI_Datatype oldtype,
 			      MPI_Datatype *newtype)
@@ -116,7 +116,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_contiguous
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Type_contiguous - Creates a contiguous datatype
 
@@ -146,7 +146,7 @@ int MPI_Type_contiguous(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CONTIGUOUS);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -171,13 +171,13 @@ int MPI_Type_contiguous(int count,
     /* ... body of routine ... */
 
     mpi_errno = MPIR_Type_contiguous_impl(count, oldtype, newtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CONTIGUOUS);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_darray.c b/src/mpi/datatype/type_create_darray.c
index 5c85f47..005b6ec 100644
--- a/src/mpi/datatype/type_create_darray.c
+++ b/src/mpi/datatype/type_create_darray.c
@@ -392,7 +392,7 @@ int MPI_Type_create_darray(int size,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_DARRAY);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -418,7 +418,7 @@ int MPI_Type_create_darray(int size,
 	    /* Check parameters */
 	    MPIR_ERRTEST_ARGNONPOS(size, "size", mpi_errno, MPI_ERR_ARG);
             /* use MPI_ERR_RANK class for PE-MPI compatibility */
-            MPIU_ERR_CHKANDJUMP3((rank < 0 || rank >= size), mpi_errno, MPI_ERR_RANK,
+            MPIR_ERR_CHKANDJUMP3((rank < 0 || rank >= size), mpi_errno, MPI_ERR_RANK,
                                  "**argrange", "**argrange %s %d %d", "rank", rank, (size-1));
 	    MPIR_ERRTEST_ARGNONPOS(ndims, "ndims", mpi_errno, MPI_ERR_DIMS);
 
@@ -488,7 +488,7 @@ int MPI_Type_create_darray(int size,
                 tmp_size *= array_of_psizes[i];
 	    }
 
-            MPIU_ERR_CHKANDJUMP1((tmp_size != size), mpi_errno, MPI_ERR_ARG,
+            MPIR_ERR_CHKANDJUMP1((tmp_size != size), mpi_errno, MPI_ERR_ARG,
                                  "**arg", "**arg %s", "array_of_psizes");
 
 	    /* TODO: GET THIS CHECK IN ALSO */
@@ -745,7 +745,7 @@ int MPI_Type_create_darray(int size,
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_DARRAY);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_hindexed.c b/src/mpi/datatype/type_create_hindexed.c
index b65dffc..7a79f7f 100644
--- a/src/mpi/datatype/type_create_hindexed.c
+++ b/src/mpi/datatype/type_create_hindexed.c
@@ -71,7 +71,7 @@ int MPI_Type_create_hindexed(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_HINDEXED);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -139,7 +139,7 @@ int MPI_Type_create_hindexed(int count,
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_HINDEXED);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_hindexed_block.c b/src/mpi/datatype/type_create_hindexed_block.c
index 3164e4d..15bf367 100644
--- a/src/mpi/datatype/type_create_hindexed_block.c
+++ b/src/mpi/datatype/type_create_hindexed_block.c
@@ -30,7 +30,7 @@ int MPI_Type_create_hindexed_block(int count, int blocklength,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_create_hindexed_block_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_create_hindexed_block_impl(int count, int blocklength,
                                          const MPI_Aint array_of_displacements[],
                                          MPI_Datatype oldtype, MPI_Datatype * newtype)
@@ -43,7 +43,7 @@ int MPIR_Type_create_hindexed_block_impl(int count, int blocklength,
     mpi_errno = MPID_Type_blockindexed(count, blocklength, array_of_displacements, 1,
                                        oldtype, &new_handle);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     ints[0] = count;
     ints[1] = blocklength;
@@ -57,7 +57,7 @@ int MPIR_Type_create_hindexed_block_impl(int count, int blocklength,
                                            ints,
                                            array_of_displacements,
                                            &oldtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
 
@@ -73,7 +73,7 @@ int MPIR_Type_create_hindexed_block_impl(int count, int blocklength,
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_create_hindexed_block
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Type_create_hindexed_block - Create an hindexed
      datatype with constant-sized blocks
@@ -106,7 +106,7 @@ int MPI_Type_create_hindexed_block(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_HINDEXED_BLOCK);
 
     /* Validate parameters and objects */
@@ -147,7 +147,7 @@ int MPI_Type_create_hindexed_block(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_HINDEXED_BLOCK);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_hvector.c b/src/mpi/datatype/type_create_hvector.c
index d1b1cfb..830e9e7 100644
--- a/src/mpi/datatype/type_create_hvector.c
+++ b/src/mpi/datatype/type_create_hvector.c
@@ -68,7 +68,7 @@ int MPI_Type_create_hvector(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_HVECTOR);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -121,7 +121,7 @@ int MPI_Type_create_hvector(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_HVECTOR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_indexed_block.c b/src/mpi/datatype/type_create_indexed_block.c
index 0107d0f..97a8d66 100644
--- a/src/mpi/datatype/type_create_indexed_block.c
+++ b/src/mpi/datatype/type_create_indexed_block.c
@@ -29,7 +29,7 @@ int MPI_Type_create_indexed_block(int count, int blocklength, const int array_of
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_create_indexed_block_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_create_indexed_block_impl(int count,
                                         int blocklength,
                                         const int array_of_displacements[],
@@ -48,7 +48,7 @@ int MPIR_Type_create_indexed_block_impl(int count,
 				       0, /* dispinbytes */
 				       oldtype,
 				       &new_handle);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_CHKLMEM_MALLOC_ORJUMP(ints, int *, (count + 2) * sizeof(int), mpi_errno, "content description");
 
@@ -67,7 +67,7 @@ int MPIR_Type_create_indexed_block_impl(int count,
 				           ints,
 				           NULL,
 				           &oldtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
 
@@ -84,7 +84,7 @@ int MPIR_Type_create_indexed_block_impl(int count,
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_create_indexed_block
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Type_create_indexed_block - Create an indexed
      datatype with constant-sized blocks
@@ -140,7 +140,7 @@ int MPI_Type_create_indexed_block(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_INDEXED_BLOCK);
     
     /* Validate parameters and objects */
@@ -180,7 +180,7 @@ int MPI_Type_create_indexed_block(int count,
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_INDEXED_BLOCK);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_resized.c b/src/mpi/datatype/type_create_resized.c
index b6049b2..7567dde 100644
--- a/src/mpi/datatype/type_create_resized.c
+++ b/src/mpi/datatype/type_create_resized.c
@@ -65,7 +65,7 @@ int MPI_Type_create_resized(MPI_Datatype oldtype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_RESIZED);
 
     /* Get handles to MPI objects. */
@@ -115,7 +115,7 @@ int MPI_Type_create_resized(MPI_Datatype oldtype,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_RESIZED);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_struct.c b/src/mpi/datatype/type_create_struct.c
index 13e1bb0..2a979d5 100644
--- a/src/mpi/datatype/type_create_struct.c
+++ b/src/mpi/datatype/type_create_struct.c
@@ -30,7 +30,7 @@ int MPI_Type_create_struct(int count, const int array_of_blocklengths[],
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_create_struct_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_create_struct_impl(int count,
                                  const int array_of_blocklengths[],
                                  const MPI_Aint array_of_displacements[],
@@ -49,7 +49,7 @@ int MPIR_Type_create_struct_impl(int count,
 				 array_of_types,
 				 &new_handle);
 
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 
     MPIU_CHKLMEM_MALLOC_ORJUMP(ints, int *, (count + 1) * sizeof(int), mpi_errno, "content description");
@@ -67,7 +67,7 @@ int MPIR_Type_create_struct_impl(int count,
 				           ints,
 				           array_of_displacements,
 				           array_of_types);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
         
@@ -83,7 +83,7 @@ int MPIR_Type_create_struct_impl(int count,
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_create_struct
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Type_create_struct - Create an MPI datatype from a general set of
    datatypes, displacements, and block sizes
@@ -119,7 +119,7 @@ int MPI_Type_create_struct(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_STRUCT);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -162,7 +162,7 @@ int MPI_Type_create_struct(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_STRUCT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_create_subarray.c b/src/mpi/datatype/type_create_subarray.c
index 906f865..bcdba9c 100644
--- a/src/mpi/datatype/type_create_subarray.c
+++ b/src/mpi/datatype/type_create_subarray.c
@@ -88,7 +88,7 @@ int MPI_Type_create_subarray(int ndims,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_CREATE_SUBARRAY);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -199,7 +199,7 @@ int MPI_Type_create_subarray(int ndims,
 					 0, /* stride in types */
 					 oldtype,
 					 &tmp1);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 	    size = ((MPI_Aint)(array_of_sizes[0])) * extent;
 	    for (i=2; i<ndims; i++) {
@@ -210,12 +210,12 @@ int MPI_Type_create_subarray(int ndims,
 					     1, /* stride in bytes */
 					     tmp1,
 					     &tmp2);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		MPIR_Type_free_impl(&tmp1);
 		tmp1 = tmp2;
 	    }
 	}
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	
 	/* add displacement and UB */
 	
@@ -233,7 +233,7 @@ int MPI_Type_create_subarray(int ndims,
 	    mpi_errno = MPID_Type_contiguous(array_of_subsizes[0],
 					     oldtype,
 					     &tmp1);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 	}
 	else {
@@ -243,7 +243,7 @@ int MPI_Type_create_subarray(int ndims,
 					 0, /* stride in types */
 					 oldtype,
 					 &tmp1);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 	    size = (MPI_Aint)(array_of_sizes[ndims-1]) * extent;
 	    for (i=ndims-3; i>=0; i--) {
@@ -254,7 +254,7 @@ int MPI_Type_create_subarray(int ndims,
 					     1,    /* stride in bytes */
 					     tmp1, /* old type */
 					     &tmp2);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 		MPIR_Type_free_impl(&tmp1);
 		tmp1 = tmp2;
@@ -287,10 +287,10 @@ int MPI_Type_create_subarray(int ndims,
     mpi_errno = MPID_Type_blockindexed(1, 1, &disps[1],
                                        1, /* 1 means disp is in bytes */
                                        tmp1, &tmp2);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Type_create_resized(tmp2, 0, disps[2], &new_handle);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIR_Type_free_impl(&tmp1);
     MPIR_Type_free_impl(&tmp2);
@@ -324,7 +324,7 @@ int MPI_Type_create_subarray(int ndims,
 					   ints,
 					   NULL,
 					   &oldtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 
     MPIU_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
@@ -333,7 +333,7 @@ int MPI_Type_create_subarray(int ndims,
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_CREATE_SUBARRAY);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_dup.c b/src/mpi/datatype/type_dup.c
index f8626a1..3965991 100644
--- a/src/mpi/datatype/type_dup.c
+++ b/src/mpi/datatype/type_dup.c
@@ -58,7 +58,7 @@ int MPI_Type_dup(MPI_Datatype oldtype, MPI_Datatype *newtype)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_DUP);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -106,7 +106,7 @@ int MPI_Type_dup(MPI_Datatype oldtype, MPI_Datatype *newtype)
 				           &oldtype);
 
     mpi_errno = MPID_Type_commit(&new_handle);
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 
     /* Copy attributes, executing the attribute copy functions */
     /* This accesses the attribute dup function through the perprocess
@@ -134,7 +134,7 @@ int MPI_Type_dup(MPI_Datatype oldtype, MPI_Datatype *newtype)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_DUP);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_extent.c b/src/mpi/datatype/type_extent.c
index 82caf09..7f8db44 100644
--- a/src/mpi/datatype/type_extent.c
+++ b/src/mpi/datatype/type_extent.c
@@ -30,7 +30,7 @@ int MPI_Type_extent(MPI_Datatype datatype, MPI_Aint *extent) __attribute__((weak
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_extent
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Type_extent - Returns the extent of a datatype
 
diff --git a/src/mpi/datatype/type_free.c b/src/mpi/datatype/type_free.c
index cb1c5f1..a6ae104 100644
--- a/src/mpi/datatype/type_free.c
+++ b/src/mpi/datatype/type_free.c
@@ -28,7 +28,7 @@ int MPI_Type_free(MPI_Datatype *datatype) __attribute__((weak,alias("PMPI_Type_f
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_free_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Type_free_impl(MPI_Datatype *datatype)
 {
     MPID_Datatype *datatype_ptr = NULL;
@@ -43,7 +43,7 @@ void MPIR_Type_free_impl(MPI_Datatype *datatype)
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Type_free - Frees the datatype
 
@@ -77,7 +77,7 @@ int MPI_Type_free(MPI_Datatype *datatype)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_FREE);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -146,7 +146,7 @@ int MPI_Type_free(MPI_Datatype *datatype)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_FREE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/datatype/type_get_contents.c b/src/mpi/datatype/type_get_contents.c
index c4b4230..1222be3 100644
--- a/src/mpi/datatype/type_get_contents.c
+++ b/src/mpi/datatype/type_get_contents.c
@@ -67,7 +67,7 @@ int MPI_Type_get_contents(MPI_Datatype datatype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_GET_CONTENTS);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -142,7 +142,7 @@ int MPI_Type_get_contents(MPI_Datatype datatype,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_GET_CONTENTS);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_get_envelope.c b/src/mpi/datatype/type_get_envelope.c
index 486953d..aa033ef 100644
--- a/src/mpi/datatype/type_get_envelope.c
+++ b/src/mpi/datatype/type_get_envelope.c
@@ -29,7 +29,7 @@ int MPI_Type_get_envelope(MPI_Datatype datatype, int *num_integers, int *num_add
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_get_envelope_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Type_get_envelope_impl(MPI_Datatype datatype,
                                  int *num_integers,
                                  int *num_addresses,
@@ -66,7 +66,7 @@ void MPIR_Type_get_envelope_impl(MPI_Datatype datatype,
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_get_envelope
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Type_get_envelope - get type envelope
 
diff --git a/src/mpi/datatype/type_get_extent.c b/src/mpi/datatype/type_get_extent.c
index d378df0..f2a7149 100644
--- a/src/mpi/datatype/type_get_extent.c
+++ b/src/mpi/datatype/type_get_extent.c
@@ -28,7 +28,7 @@ int MPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent) _
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_get_extent_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Type_get_extent_impl(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent)
 {
     MPI_Count lb_x, extent_x;
@@ -43,7 +43,7 @@ void MPIR_Type_get_extent_impl(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *ex
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_get_extent
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Type_get_extent - Get the lower bound and extent for a Datatype
 
diff --git a/src/mpi/datatype/type_get_extent_x.c b/src/mpi/datatype/type_get_extent_x.c
index a3fc110..c98fdf7 100644
--- a/src/mpi/datatype/type_get_extent_x.c
+++ b/src/mpi/datatype/type_get_extent_x.c
@@ -29,7 +29,7 @@ int MPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *exten
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_get_extent_x_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Type_get_extent_x_impl(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent)
 {
     MPID_Datatype *datatype_ptr = NULL;
@@ -51,7 +51,7 @@ void MPIR_Type_get_extent_x_impl(MPI_Datatype datatype, MPI_Count *lb, MPI_Count
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_get_extent_x
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Type_get_extent_x - XXX description here
 
@@ -73,7 +73,7 @@ int MPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *exten
     int mpi_errno = MPI_SUCCESS;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_GET_EXTENT_X);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_GET_EXTENT_X);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *exten
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_GET_EXTENT_X);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/datatype/type_get_name.c b/src/mpi/datatype/type_get_name.c
index 90c0b80..1296916 100644
--- a/src/mpi/datatype/type_get_name.c
+++ b/src/mpi/datatype/type_get_name.c
@@ -144,17 +144,17 @@ int MPIR_Datatype_init_names(void)
     int mpi_errno = MPI_SUCCESS;
     int i;
     MPID_Datatype *datatype_ptr = NULL;
-    MPIU_THREADSAFE_INIT_DECL(needsInit);
+    static volatile int needsInit = 1;
 
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
     if (needsInit) {
-	MPIU_THREADSAFE_INIT_BLOCK_BEGIN(needsInit);
 	/* Make sure that the basics have datatype structures allocated
 	 * and filled in for them.  They are just integers prior to this
 	 * call.
 	 */
 	mpi_errno = MPIR_Datatype_builtin_fillin();
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POPFATAL(mpi_errno);
+	    MPIR_ERR_POPFATAL(mpi_errno);
 	}
 	
 	/* For each predefined type, ensure that there is a corresponding
@@ -170,11 +170,11 @@ int MPIR_Datatype_init_names(void)
 	    if (datatype_ptr < MPID_Datatype_builtin ||
 		datatype_ptr > MPID_Datatype_builtin + MPID_DATATYPE_N_BUILTIN)
 		{
-		    MPIU_ERR_SETFATALANDJUMP1(mpi_errno,MPI_ERR_INTERN,
+		    MPIR_ERR_SETFATALANDJUMP1(mpi_errno,MPI_ERR_INTERN,
 			      "**typeinitbadmem","**typeinitbadmem %d", i);
 		}
 	    if (!datatype_ptr) {
-		MPIU_ERR_SETFATALANDJUMP1(mpi_errno,MPI_ERR_INTERN,
+		MPIR_ERR_SETFATALANDJUMP1(mpi_errno,MPI_ERR_INTERN,
 			      "**typeinitfail", "**typeinitfail %d", i - 1);
 	    }
 
@@ -194,16 +194,17 @@ int MPIR_Datatype_init_names(void)
 	    MPID_Datatype_get_ptr(mpi_maxloc_names[i].dtype,
 				  datatype_ptr);
 	    if (!datatype_ptr) {
-		MPIU_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_INTERN, "**typeinitminmaxloc");
+		MPIR_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_INTERN, "**typeinitminmaxloc");
 	    }
 	    MPIU_Strncpy(datatype_ptr->name, mpi_maxloc_names[i].name,
 			 MPI_MAX_OBJECT_NAME);
 	}
-	MPIU_THREADSAFE_INIT_CLEAR(needsInit);
-    fn_fail:;
-    MPIU_THREADSAFE_INIT_BLOCK_END(needsInit);
+        needsInit = 0;
     }
 
+fn_fail:
+    /* empty statement */ ;
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 }
 #endif
diff --git a/src/mpi/datatype/type_get_true_extent.c b/src/mpi/datatype/type_get_true_extent.c
index 8cfcd57..e5e064b 100644
--- a/src/mpi/datatype/type_get_true_extent.c
+++ b/src/mpi/datatype/type_get_true_extent.c
@@ -28,7 +28,7 @@ int MPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_get_true_extent_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Type_get_true_extent_impl(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent)
 {
     MPI_Count true_lb_x, true_extent_x;
@@ -43,7 +43,7 @@ void MPIR_Type_get_true_extent_impl(MPI_Datatype datatype, MPI_Aint *true_lb, MP
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_get_true_extent
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Type_get_true_extent - Get the true lower bound and extent for a
      datatype
diff --git a/src/mpi/datatype/type_get_true_extent_x.c b/src/mpi/datatype/type_get_true_extent_x.c
index 3c5653d..8ccfdf9 100644
--- a/src/mpi/datatype/type_get_true_extent_x.c
+++ b/src/mpi/datatype/type_get_true_extent_x.c
@@ -29,7 +29,7 @@ int MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_get_true_extent_x_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Type_get_true_extent_x_impl(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent)
 {
     MPID_Datatype *datatype_ptr = NULL;
@@ -51,7 +51,7 @@ void MPIR_Type_get_true_extent_x_impl(MPI_Datatype datatype, MPI_Count *true_lb,
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_get_true_extent_x
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Type_get_true_extent_x - XXX description here
 
@@ -73,7 +73,7 @@ int MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Co
     int mpi_errno = MPI_SUCCESS;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_GET_TRUE_EXTENT_X);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_GET_TRUE_EXTENT_X);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Co
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_GET_TRUE_EXTENT_X);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/datatype/type_hindexed.c b/src/mpi/datatype/type_hindexed.c
index f14a7cf..35dbd73 100644
--- a/src/mpi/datatype/type_hindexed.c
+++ b/src/mpi/datatype/type_hindexed.c
@@ -96,7 +96,7 @@ int MPI_Type_hindexed(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_HINDEXED);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -165,7 +165,7 @@ int MPI_Type_hindexed(int count,
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_HINDEXED);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_hvector.c b/src/mpi/datatype/type_hvector.c
index 30f5903..d303264 100644
--- a/src/mpi/datatype/type_hvector.c
+++ b/src/mpi/datatype/type_hvector.c
@@ -29,7 +29,7 @@ int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype o
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_hvector_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_hvector_impl(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -43,7 +43,7 @@ int MPIR_Type_hvector_impl(int count, int blocklength, MPI_Aint stride, MPI_Data
 				 1, /* stride in bytes */
 				 oldtype,
 				 &new_handle);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     ints[0] = count;
     ints[1] = blocklength;
@@ -56,7 +56,7 @@ int MPIR_Type_hvector_impl(int count, int blocklength, MPI_Aint stride, MPI_Data
 				           ints,
 				           &stride,
 				           &oldtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     MPIU_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
 
@@ -72,7 +72,7 @@ int MPIR_Type_hvector_impl(int count, int blocklength, MPI_Aint stride, MPI_Data
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_hvector
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Type_hvector - type_hvector
 
@@ -104,7 +104,7 @@ int MPI_Type_hvector(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_HVECTOR);
 
 #   ifdef HAVE_ERROR_CHECKING
@@ -138,7 +138,7 @@ int MPI_Type_hvector(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_HVECTOR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_indexed.c b/src/mpi/datatype/type_indexed.c
index b78cb04..199d6f5 100644
--- a/src/mpi/datatype/type_indexed.c
+++ b/src/mpi/datatype/type_indexed.c
@@ -30,7 +30,7 @@ int MPI_Type_indexed(int count, const int *array_of_blocklengths,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_indexed_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_indexed_impl(int count, const int *array_of_blocklengths,
                            const int *array_of_displacements,
                            MPI_Datatype oldtype, MPI_Datatype *newtype)
@@ -47,7 +47,7 @@ int MPIR_Type_indexed_impl(int count, const int *array_of_blocklengths,
 				  0, /* displacements not in bytes */
 				  oldtype,
 				  &new_handle);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     /* copy all integer values into a temporary buffer; this
      * includes the count, the blocklengths, and the displacements.
@@ -71,7 +71,7 @@ int MPIR_Type_indexed_impl(int count, const int *array_of_blocklengths,
 					   ints,
 					   NULL,
 					   &oldtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     MPIU_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
 
@@ -88,7 +88,7 @@ int MPIR_Type_indexed_impl(int count, const int *array_of_blocklengths,
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_indexed
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Type_indexed - Creates an indexed datatype
 
@@ -145,7 +145,7 @@ int MPI_Type_indexed(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_INDEXED);
 
     /* Validate parameters and objects (post conversion) */
@@ -187,7 +187,7 @@ int MPI_Type_indexed(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_INDEXED);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_lb.c b/src/mpi/datatype/type_lb.c
index f357a81..2f0778f 100644
--- a/src/mpi/datatype/type_lb.c
+++ b/src/mpi/datatype/type_lb.c
@@ -28,7 +28,7 @@ int MPI_Type_lb(MPI_Datatype datatype, MPI_Aint *displacement) __attribute__((we
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_lb_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Type_lb_impl(MPI_Datatype datatype, MPI_Aint *displacement)
 {
     if (HANDLE_GET_KIND(datatype) == HANDLE_KIND_BUILTIN) {
diff --git a/src/mpi/datatype/type_match_size.c b/src/mpi/datatype/type_match_size.c
index 755673d..ca2e377 100644
--- a/src/mpi/datatype/type_match_size.c
+++ b/src/mpi/datatype/type_match_size.c
@@ -88,8 +88,8 @@ int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *datatype)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    /* FIXME: This routine does not require the allfunc critical section */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    /* FIXME: This routine does not require the global critical section */
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_MATCH_SIZE);
 
     MPIU_THREADPRIV_GET;
@@ -167,14 +167,14 @@ int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *datatype)
 	break;
     default:
 	/* --BEGIN ERROR HANDLING-- */
-	MPIU_ERR_SETANDSTMT(mpi_errno, MPI_ERR_ARG, break, "**typematchnoclass");
+	MPIR_ERR_SETANDSTMT(mpi_errno, MPI_ERR_ARG, break, "**typematchnoclass");
 	/* --END ERROR HANDLING-- */
     }
 
     if (mpi_errno == MPI_SUCCESS) {
 	if (matched_datatype == MPI_DATATYPE_NULL) {
 	    /* --BEGIN ERROR HANDLING-- */
-	    MPIU_ERR_SETANDSTMT2(mpi_errno, MPI_ERR_ARG,;, "**typematchsize", "**typematchsize %s %d", tname, size);
+	    MPIR_ERR_SETANDSTMT2(mpi_errno, MPI_ERR_ARG,;, "**typematchsize", "**typematchsize %s %d", tname, size);
 	    /* --END ERROR HANDLING-- */
 	}
 	else {
@@ -187,7 +187,7 @@ int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *datatype)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_MATCH_SIZE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_set_name.c b/src/mpi/datatype/type_set_name.c
index e050bf3..d590331 100644
--- a/src/mpi/datatype/type_set_name.c
+++ b/src/mpi/datatype/type_set_name.c
@@ -86,7 +86,7 @@ int MPI_Type_set_name(MPI_Datatype datatype, const char *type_name)
 	    MPIR_ERRTEST_ARGNULL(type_name,"type_name", mpi_errno);
 
 	    slen = (int)strlen( type_name );
-	    MPIU_ERR_CHKANDSTMT1((slen >= MPI_MAX_OBJECT_NAME), mpi_errno, 
+	    MPIR_ERR_CHKANDSTMT1((slen >= MPI_MAX_OBJECT_NAME), mpi_errno, 
 				 MPI_ERR_ARG,goto fn_fail, "**typenamelen",
 				    "**typenamelen %d", slen );
         }
diff --git a/src/mpi/datatype/type_size.c b/src/mpi/datatype/type_size.c
index 2347e2f..cc9a3f4 100644
--- a/src/mpi/datatype/type_size.c
+++ b/src/mpi/datatype/type_size.c
@@ -31,7 +31,7 @@ int MPI_Type_size(MPI_Datatype datatype, int *size) __attribute__((weak,alias("P
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_size
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Type_size - Return the number of bytes occupied by entries
                     in the datatype
@@ -100,7 +100,7 @@ int MPI_Type_size(MPI_Datatype datatype, int *size)
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Type_size_x_impl(datatype, &size_x);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(size_x >= 0);
     /* handle overflow: see MPI-3 p.104 */
diff --git a/src/mpi/datatype/type_size_x.c b/src/mpi/datatype/type_size_x.c
index 2f3fa90..759fe8d 100644
--- a/src/mpi/datatype/type_size_x.c
+++ b/src/mpi/datatype/type_size_x.c
@@ -29,7 +29,7 @@ int MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size) __attribute__((weak,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_size_x_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_size_x_impl(MPI_Datatype datatype, MPI_Count *size)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -47,7 +47,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_size_x
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Type_size_x - Return the number of bytes occupied by entries
                   in the datatype
@@ -69,7 +69,7 @@ int MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size)
     int mpi_errno = MPI_SUCCESS;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_SIZE_X);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_SIZE_X);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -109,13 +109,13 @@ int MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size)
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Type_size_x_impl(datatype, size);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_SIZE_X);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/datatype/type_struct.c b/src/mpi/datatype/type_struct.c
index 6e7cedf..6a3abcf 100644
--- a/src/mpi/datatype/type_struct.c
+++ b/src/mpi/datatype/type_struct.c
@@ -29,7 +29,7 @@ int MPI_Type_struct(int count, const int *array_of_blocklengths,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_struct_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_struct_impl(int count, const int *array_of_blocklengths,
                           const MPI_Aint *array_of_displacements,
                           const MPI_Datatype *array_of_types, MPI_Datatype *newtype)
@@ -45,7 +45,7 @@ int MPIR_Type_struct_impl(int count, const int *array_of_blocklengths,
 				 array_of_displacements,
 				 array_of_types,
 				 &new_handle);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 
     MPIU_CHKLMEM_MALLOC(ints, int *, (count + 1) * sizeof(int), mpi_errno, "contents integer array");
@@ -65,7 +65,7 @@ int MPIR_Type_struct_impl(int count, const int *array_of_blocklengths,
                                            array_of_displacements,
                                            array_of_types);
     
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
 
@@ -81,7 +81,7 @@ int MPIR_Type_struct_impl(int count, const int *array_of_blocklengths,
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_struct
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Type_struct - Creates a struct datatype
 
@@ -159,7 +159,7 @@ int MPI_Type_struct(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_STRUCT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -202,7 +202,7 @@ int MPI_Type_struct(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_STRUCT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/type_vector.c b/src/mpi/datatype/type_vector.c
index 0ca1bbf..13a57b2 100644
--- a/src/mpi/datatype/type_vector.c
+++ b/src/mpi/datatype/type_vector.c
@@ -29,7 +29,7 @@ int MPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype
 #undef FUNCNAME
 #define FUNCNAME MPIR_Type_vector_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_vector_impl(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -44,7 +44,7 @@ int MPIR_Type_vector_impl(int count, int blocklength, int stride, MPI_Datatype o
 				 oldtype,
 				 &new_handle);
 
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     ints[0] = count;
     ints[1] = blocklength;
@@ -58,7 +58,7 @@ int MPIR_Type_vector_impl(int count, int blocklength, int stride, MPI_Datatype o
                                            ints,
                                            NULL,
                                            &oldtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
     
@@ -73,7 +73,7 @@ int MPIR_Type_vector_impl(int count, int blocklength, int stride, MPI_Datatype o
 #undef FUNCNAME
 #define FUNCNAME MPI_Type_vector
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Type_vector - Creates a vector (strided) datatype
 
@@ -107,7 +107,7 @@ int MPI_Type_vector(int count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_VECTOR);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -140,7 +140,7 @@ int MPI_Type_vector(int count,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_TYPE_VECTOR);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/datatype/typeutil.c b/src/mpi/datatype/typeutil.c
index 958c6b8..b3c58b4 100644
--- a/src/mpi/datatype/typeutil.c
+++ b/src/mpi/datatype/typeutil.c
@@ -142,7 +142,7 @@ static MPI_Datatype mpi_pairtypes[] = {
 #undef FUNCNAME
 #define FUNCNAME MPIR_Datatype_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Datatype_init(void)
 {
     int i;
@@ -176,7 +176,7 @@ int MPIR_Datatype_init(void)
         MPIU_Assert((void *) ptr == (void *) (MPID_Datatype_direct + HANDLE_INDEX(mpi_pairtypes[i])));
 
         mpi_errno = MPID_Type_create_pairtype(mpi_pairtypes[i], (MPID_Datatype *) ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPIR_Add_finalize(MPIR_Datatype_finalize, 0,
@@ -189,7 +189,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Datatype_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Datatype_finalize(void *dummy ATTRIBUTE((unused)) )
 {
     int i;
@@ -212,7 +212,7 @@ static int MPIR_Datatype_finalize(void *dummy ATTRIBUTE((unused)) )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Datatype_builtin_fillin
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Datatype_builtin_fillin(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -265,8 +265,6 @@ int MPIR_Datatype_builtin_fillin(void)
 	    dptr->ub	   = dptr->size;
 	    dptr->true_ub	   = dptr->size;
 	    dptr->contents     = NULL; /* should never get referenced? */
-
-            MPIU_THREAD_MPI_OBJ_INIT(dptr);
 	}
 	/* --BEGIN ERROR HANDLING-- */
  	if (d != -1 && i < sizeof(mpi_dtypes)/sizeof(*mpi_dtypes) && mpi_dtypes[i] != -1) { 
diff --git a/src/mpi/datatype/unpack.c b/src/mpi/datatype/unpack.c
index 869faf7..52057a0 100644
--- a/src/mpi/datatype/unpack.c
+++ b/src/mpi/datatype/unpack.c
@@ -29,7 +29,7 @@ int MPI_Unpack(const void *inbuf, int insize, int *position, void *outbuf, int o
 #undef FUNCNAME
 #define FUNCNAME MPIR_Unpack_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Unpack_impl(const void *inbuf, MPI_Aint insize, MPI_Aint *position,
                      void *outbuf, int outcount, MPI_Datatype datatype)
 {
@@ -65,7 +65,7 @@ int MPIR_Unpack_impl(const void *inbuf, MPI_Aint insize, MPI_Aint *position,
 
     /* non-contig case */
     segp = MPID_Segment_alloc();
-    MPIU_ERR_CHKANDJUMP1(segp == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+    MPIR_ERR_CHKANDJUMP1(segp == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
     mpi_errno = MPID_Segment_init(outbuf, outcount, datatype, segp, 0);
     MPIU_Assert(mpi_errno == MPI_SUCCESS);
 
@@ -104,7 +104,7 @@ int MPIR_Unpack_impl(const void *inbuf, MPI_Aint insize, MPI_Aint *position,
 #undef FUNCNAME
 #define FUNCNAME MPI_Unpack
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Unpack - Unpack a buffer according to a datatype into contiguous memory
 
diff --git a/src/mpi/datatype/unpack_external.c b/src/mpi/datatype/unpack_external.c
index abed09d..2f4db11 100644
--- a/src/mpi/datatype/unpack_external.c
+++ b/src/mpi/datatype/unpack_external.c
@@ -111,7 +111,7 @@ int MPI_Unpack_external(const char datarep[],
     }
 
     segp = MPID_Segment_alloc();
-    MPIU_ERR_CHKANDJUMP1((segp == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+    MPIR_ERR_CHKANDJUMP1((segp == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
     mpi_errno = MPID_Segment_init(outbuf, outcount, datatype, segp, 1);
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
diff --git a/src/mpi/debugger/dbginit.c b/src/mpi/debugger/dbginit.c
index 115720b..54f608f 100644
--- a/src/mpi/debugger/dbginit.c
+++ b/src/mpi/debugger/dbginit.c
@@ -353,7 +353,7 @@ void MPIR_Sendq_remember( MPID_Request *req,
 {
     MPIR_Sendq *p;
 
-    MPIU_THREAD_CS_ENTER(HANDLE,req);
+    MPID_THREAD_CS_ENTER(POBJ, req->pobj_mutex);
     if (pool) {
 	p = pool;
 	pool = p->next;
@@ -376,18 +376,18 @@ void MPIR_Sendq_remember( MPID_Request *req,
     if (p->next) p->next->prev = p;
     req->dbg_next = p;
 fn_exit:
-    MPIU_THREAD_CS_EXIT(HANDLE,req);
+    MPID_THREAD_CS_EXIT(POBJ, req->pobj_mutex);
 }
 
 void MPIR_Sendq_forget( MPID_Request *req )
 {
     MPIR_Sendq *p, *prev;
 
-    MPIU_THREAD_CS_ENTER(HANDLE,req);
+    MPID_THREAD_CS_ENTER(POBJ, req->pobj_mutex);
     p    = req->dbg_next;
     if (!p) {
         /* Just ignore it */
-        MPIU_THREAD_CS_EXIT(HANDLE,req);
+        MPID_THREAD_CS_EXIT(POBJ, req->pobj_mutex);
         return;
     }
     prev = p->prev;
@@ -397,7 +397,7 @@ void MPIR_Sendq_forget( MPID_Request *req )
     /* Return this element to the pool */
     p->next = pool;
     pool    = p;
-    MPIU_THREAD_CS_EXIT(HANDLE,req);
+    MPID_THREAD_CS_EXIT(POBJ, req->pobj_mutex);
 }
 
 static int SendqFreePool( void *d )
@@ -456,7 +456,7 @@ void MPIR_CommL_remember( MPID_Comm *comm_ptr )
 		   "Adding communicator %p to remember list",comm_ptr);
     MPIU_DBG_MSG_P(COMM,VERBOSE,
 		   "Remember list structure address is %p",&MPIR_All_communicators);
-    MPIU_THREAD_CS_ENTER(HANDLE,comm_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, comm_ptr->pobj_mutex);
     if (comm_ptr == MPIR_All_communicators.head) {
 	MPL_internal_error_printf( "Internal error: communicator is already on free list\n" );
 	return;
@@ -467,7 +467,7 @@ void MPIR_CommL_remember( MPID_Comm *comm_ptr )
     MPIU_DBG_MSG_P(COMM,VERBOSE,
 		   "master head is %p", MPIR_All_communicators.head );
 
-    MPIU_THREAD_CS_EXIT(HANDLE,comm_ptr);
+    MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
 }
 
 void MPIR_CommL_forget( MPID_Comm *comm_ptr )
@@ -476,7 +476,7 @@ void MPIR_CommL_forget( MPID_Comm *comm_ptr )
 
     MPIU_DBG_MSG_P(COMM,VERBOSE,
 		   "Forgetting communicator %p from remember list",comm_ptr);
-    MPIU_THREAD_CS_ENTER(HANDLE,comm_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, comm_ptr->pobj_mutex);
     p = MPIR_All_communicators.head;
     prev = 0;
     while (p) {
@@ -494,7 +494,7 @@ void MPIR_CommL_forget( MPID_Comm *comm_ptr )
     }
     /* Record a change to the list */
     MPIR_All_communicators.sequence_number++;
-    MPIU_THREAD_CS_EXIT(HANDLE,comm_ptr);
+    MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
 }
 
 #ifdef MPIU_PROCTABLE_NEEDED
diff --git a/src/mpi/errhan/add_error_class.c b/src/mpi/errhan/add_error_class.c
index 1f4622f..c35a7bb 100644
--- a/src/mpi/errhan/add_error_class.c
+++ b/src/mpi/errhan/add_error_class.c
@@ -54,7 +54,7 @@ int MPI_Add_error_class(int *errorclass)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ADD_ERROR_CLASS);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -71,7 +71,7 @@ int MPI_Add_error_class(int *errorclass)
     /* ... body of routine ...  */
     
     new_class = MPIR_Err_add_class( );
-    MPIU_ERR_CHKANDJUMP(new_class<0,mpi_errno,MPI_ERR_OTHER,"**noerrclasses");
+    MPIR_ERR_CHKANDJUMP(new_class<0,mpi_errno,MPI_ERR_OTHER,"**noerrclasses");
 
     *errorclass = ERROR_DYN_MASK | new_class;
 
@@ -84,7 +84,7 @@ int MPI_Add_error_class(int *errorclass)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ADD_ERROR_CLASS);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/add_error_code.c b/src/mpi/errhan/add_error_code.c
index f32e383..3fc704d 100644
--- a/src/mpi/errhan/add_error_code.c
+++ b/src/mpi/errhan/add_error_code.c
@@ -57,7 +57,7 @@ int MPI_Add_error_code(int errorclass, int *errorcode)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ADD_ERROR_CODE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -75,7 +75,7 @@ int MPI_Add_error_code(int errorclass, int *errorcode)
     /* ... body of routine ...  */
     
     new_code = MPIR_Err_add_code( errorclass );
-    MPIU_ERR_CHKANDJUMP(new_code<0,mpi_errno,MPI_ERR_OTHER,"**noerrcodes");
+    MPIR_ERR_CHKANDJUMP(new_code<0,mpi_errno,MPI_ERR_OTHER,"**noerrcodes");
 
     *errorcode = new_code;
     
@@ -83,7 +83,7 @@ int MPI_Add_error_code(int errorclass, int *errorcode)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ADD_ERROR_CODE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/add_error_string.c b/src/mpi/errhan/add_error_string.c
index 493bed3..8c79a9e 100644
--- a/src/mpi/errhan/add_error_string.c
+++ b/src/mpi/errhan/add_error_string.c
@@ -66,7 +66,7 @@ int MPI_Add_error_string(int errorcode, const char *string)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ADD_ERROR_STRING);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -89,7 +89,7 @@ int MPI_Add_error_string(int errorcode, const char *string)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ADD_ERROR_STRING);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/comm_call_errhandler.c b/src/mpi/errhan/comm_call_errhandler.c
index 2f780eb..39884cd 100644
--- a/src/mpi/errhan/comm_call_errhandler.c
+++ b/src/mpi/errhan/comm_call_errhandler.c
@@ -77,7 +77,7 @@ int MPI_Comm_call_errhandler(MPI_Comm comm, int errorcode)
     /* Convert MPI object handles to object pointers */
     MPID_Comm_get_ptr( comm, comm_ptr );
 
-    MPIU_THREAD_CS_ENTER(MPI_OBJ, comm_ptr); /* protect access to comm_ptr->errhandler */
+    MPID_THREAD_CS_ENTER(POBJ, comm_ptr->pobj_mutex); /* protect access to comm_ptr->errhandler */
     in_cs = TRUE;
     
     /* Validate parameters and objects (post conversion) */
@@ -156,7 +156,7 @@ int MPI_Comm_call_errhandler(MPI_Comm comm, int errorcode)
 
   fn_exit:
     if (in_cs)
-        MPIU_THREAD_CS_EXIT(MPI_OBJ, comm_ptr);
+        MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
 
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_CALL_ERRHANDLER);
     return mpi_errno;
diff --git a/src/mpi/errhan/comm_create_errhandler.c b/src/mpi/errhan/comm_create_errhandler.c
index c0b3828..d9031c9 100644
--- a/src/mpi/errhan/comm_create_errhandler.c
+++ b/src/mpi/errhan/comm_create_errhandler.c
@@ -29,7 +29,7 @@ int MPI_Comm_create_errhandler(MPI_Comm_errhandler_function *comm_errhandler_fn,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_create_errhandler_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_create_errhandler_impl(MPI_Comm_errhandler_function *comm_errhandler_fn,
                                      MPI_Errhandler *errhandler)
 {
@@ -37,7 +37,7 @@ int MPIR_Comm_create_errhandler_impl(MPI_Comm_errhandler_function *comm_errhandl
     MPID_Errhandler *errhan_ptr;
         
     errhan_ptr = (MPID_Errhandler *)MPIU_Handle_obj_alloc( &MPID_Errhandler_mem );
-    MPIU_ERR_CHKANDJUMP(!errhan_ptr, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP(!errhan_ptr, mpi_errno, MPI_ERR_OTHER, "**nomem");
 
     errhan_ptr->language = MPID_LANG_C;
     errhan_ptr->kind	 = MPID_COMM;
@@ -57,7 +57,7 @@ int MPIR_Comm_create_errhandler_impl(MPI_Comm_errhandler_function *comm_errhandl
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_create_errhandler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Comm_create_errhandler - Create a communicator error handler
 
@@ -89,7 +89,7 @@ int MPI_Comm_create_errhandler(MPI_Comm_errhandler_function *comm_errhandler_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_CREATE_ERRHANDLER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -113,7 +113,7 @@ int MPI_Comm_create_errhandler(MPI_Comm_errhandler_function *comm_errhandler_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_CREATE_ERRHANDLER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/comm_get_errhandler.c b/src/mpi/errhan/comm_get_errhandler.c
index e705cf2..c39d3ff 100644
--- a/src/mpi/errhan/comm_get_errhandler.c
+++ b/src/mpi/errhan/comm_get_errhandler.c
@@ -30,14 +30,14 @@ int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler) __attribu
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_get_errhandler_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Comm_get_errhandler_impl(MPID_Comm *comm_ptr, MPID_Errhandler **errhandler_ptr)
 {
-    MPIU_THREAD_CS_ENTER(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, comm_ptr->pobj_mutex);
     *errhandler_ptr = comm_ptr->errhandler;
     if (comm_ptr->errhandler)
 	MPIR_Errhandler_add_ref(comm_ptr->errhandler);
-    MPIU_THREAD_CS_EXIT(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
 
     return;
 }
@@ -47,7 +47,7 @@ void MPIR_Comm_get_errhandler_impl(MPID_Comm *comm_ptr, MPID_Errhandler **errhan
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_get_errhandler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Comm_get_errhandler - Get the error handler attached to a communicator
 
@@ -74,7 +74,7 @@ int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_GET_ERRHANDLER);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -119,7 +119,7 @@ int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_GET_ERRHANDLER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/errhan/comm_set_errhandler.c b/src/mpi/errhan/comm_set_errhandler.c
index 872de46..524a345 100644
--- a/src/mpi/errhan/comm_set_errhandler.c
+++ b/src/mpi/errhan/comm_set_errhandler.c
@@ -28,12 +28,12 @@ int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler) __attribut
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_set_errhandler_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Comm_set_errhandler_impl(MPID_Comm *comm_ptr, MPID_Errhandler *errhandler_ptr)
 {
     int in_use;
 
-    MPIU_THREAD_CS_ENTER(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, comm_ptr->pobj_mutex);
 
     /* We don't bother with the case where the errhandler is NULL;
        in this case, the error handler was the original, MPI_ERRORS_ARE_FATAL,
@@ -48,7 +48,7 @@ void MPIR_Comm_set_errhandler_impl(MPID_Comm *comm_ptr, MPID_Errhandler *errhand
     MPIR_Errhandler_add_ref(errhandler_ptr);
     comm_ptr->errhandler = errhandler_ptr;
 
-    MPIU_THREAD_CS_EXIT(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
     return;
 }
 
@@ -57,7 +57,7 @@ void MPIR_Comm_set_errhandler_impl(MPID_Comm *comm_ptr, MPID_Errhandler *errhand
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_set_errhandler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
    MPI_Comm_set_errhandler - Set the error handler for a communicator
@@ -86,7 +86,7 @@ int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SET_ERRHANDLER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -131,7 +131,7 @@ int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SET_ERRHANDLER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/errhan/errhandler_create.c b/src/mpi/errhan/errhandler_create.c
index 32f1721..fdbb4bb 100644
--- a/src/mpi/errhan/errhandler_create.c
+++ b/src/mpi/errhan/errhandler_create.c
@@ -69,7 +69,7 @@ int MPI_Errhandler_create(MPI_Handler_function *function,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ERRHANDLER_CREATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -92,7 +92,7 @@ int MPI_Errhandler_create(MPI_Handler_function *function,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ERRHANDLER_CREATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/errhandler_free.c b/src/mpi/errhan/errhandler_free.c
index 312262b..6ce0e26 100644
--- a/src/mpi/errhan/errhandler_free.c
+++ b/src/mpi/errhan/errhandler_free.c
@@ -57,7 +57,7 @@ int MPI_Errhandler_free(MPI_Errhandler *errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ERRHANDLER_FREE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -101,7 +101,7 @@ int MPI_Errhandler_free(MPI_Errhandler *errhandler)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ERRHANDLER_FREE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/errhan/errhandler_get.c b/src/mpi/errhan/errhandler_get.c
index 9d58d6b..b1ce71d 100644
--- a/src/mpi/errhan/errhandler_get.c
+++ b/src/mpi/errhan/errhandler_get.c
@@ -30,7 +30,7 @@ int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler) __attribute__(
 #undef FUNCNAME
 #define FUNCNAME MPI_Errhandler_get
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
   MPI_Errhandler_get - Gets the error handler for a communicator
 
@@ -70,7 +70,7 @@ int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ERRHANDLER_GET);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -115,7 +115,7 @@ int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
   fn_exit:
 #   endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ERRHANDLER_GET);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 #   ifdef HAVE_ERROR_CHECKING
diff --git a/src/mpi/errhan/errhandler_set.c b/src/mpi/errhan/errhandler_set.c
index f2947ef..5f19a23 100644
--- a/src/mpi/errhan/errhandler_set.c
+++ b/src/mpi/errhan/errhandler_set.c
@@ -30,7 +30,7 @@ int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) __attribute__((
 #undef FUNCNAME
 #define FUNCNAME MPI_Errhandler_set
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
   MPI_Errhandler_set - Sets the error handler for a communicator
 
@@ -61,7 +61,7 @@ int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ERRHANDLER_SET);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -108,7 +108,7 @@ int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
   fn_exit:
 #   endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ERRHANDLER_SET);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 #   ifdef HAVE_ERROR_CHECKING
diff --git a/src/mpi/errhan/errutil.c b/src/mpi/errhan/errutil.c
index 6469190..299ce9a 100644
--- a/src/mpi/errhan/errutil.c
+++ b/src/mpi/errhan/errutil.c
@@ -256,9 +256,9 @@ int MPIR_Err_return_comm( MPID_Comm  *comm_ptr, const char fcname[],
     MPIU_DBG_MSG_FMT(ERRHAND, TERSE, (MPIU_DBG_FDEST, "MPIR_Err_return_comm(comm_ptr=%p, fcname=%s, errcode=%d)", comm_ptr, fcname, errcode));
 
     if (comm_ptr) {
-        MPIU_THREAD_CS_ENTER(MPI_OBJ, comm_ptr);
+        MPID_THREAD_CS_ENTER(POBJ, comm_ptr->pobj_mutex);
         errhandler = comm_ptr->errhandler;
-        MPIU_THREAD_CS_EXIT(MPI_OBJ, comm_ptr);
+        MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
     }
 
     if (errhandler == NULL) {
@@ -284,12 +284,12 @@ int MPIR_Err_return_comm( MPID_Comm  *comm_ptr, const char fcname[],
     /* comm_ptr may have changed to comm_world.  Keep this locked as long as we
      * are using the errhandler to prevent it from disappearing out from under
      * us. */
-    MPIU_THREAD_CS_ENTER(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, comm_ptr->pobj_mutex);
     errhandler = comm_ptr->errhandler;
 
     /* --BEGIN ERROR HANDLING-- */
     if (errhandler == NULL || errhandler->handle == MPI_ERRORS_ARE_FATAL) {
-        MPIU_THREAD_CS_EXIT(MPI_OBJ, comm_ptr);
+        MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
 	/* Calls MPID_Abort */
 	MPIR_Handle_fatal_error( comm_ptr, fcname, errcode );
         /* never get here */
@@ -338,7 +338,7 @@ int MPIR_Err_return_comm( MPID_Comm  *comm_ptr, const char fcname[],
 
     }
 
-    MPIU_THREAD_CS_EXIT(MPI_OBJ, comm_ptr);
+    MPID_THREAD_CS_EXIT(POBJ, comm_ptr->pobj_mutex);
     return errcode;
 }
 
@@ -816,34 +816,42 @@ static volatile unsigned int max_error_ring_loc = 0;
    since in the "global" thread level, an extra thread mutex is not required. */
 #if defined(MPID_REQUIRES_THREAD_SAFETY)
 /* if the device requires internal MPICH routines to be thread safe, the
-   MPIU_THREAD_CHECK macros are not appropriate */
+   MPID_THREAD_CHECK macros are not appropriate */
 static MPID_Thread_mutex_t error_ring_mutex;
 #define error_ring_mutex_create(_mpi_errno_p_)			\
     MPID_Thread_mutex_create(&error_ring_mutex, _mpi_errno_p_)
 #define error_ring_mutex_destroy(_mpi_errno_p)				\
     MPID_Thread_mutex_destroy(&error_ring_mutex, _mpi_errno_p_)
-#define error_ring_mutex_lock()			\
-    MPID_Thread_mutex_lock(&error_ring_mutex)
-#define error_ring_mutex_unlock()		\
-    MPID_Thread_mutex_unlock(&error_ring_mutex)
+#define error_ring_mutex_lock()                                 \
+    do {                                                        \
+        int err;                                                \
+        MPID_Thread_mutex_lock(&error_ring_mutex, &err);        \
+    } while (0)
+#define error_ring_mutex_unlock()                               \
+    do {                                                        \
+        int err;                                                \
+        MPID_Thread_mutex_unlock(&error_ring_mutex, &err);      \
+    } while (0)
 #elif defined(MPICH_IS_THREADED)
 static MPID_Thread_mutex_t error_ring_mutex;
 #define error_ring_mutex_create(_mpi_errno_p) MPID_Thread_mutex_create(&error_ring_mutex,_mpi_errno_p)
 #define error_ring_mutex_destroy(_mpi_errno_p) MPID_Thread_mutex_destroy(&error_ring_mutex,_mpi_errno_p)
 #define error_ring_mutex_lock()                          \
     do {                                                 \
+        int err;                                         \
         if (did_err_init) {                              \
-            MPIU_THREAD_CHECK_BEGIN                      \
-            MPID_Thread_mutex_lock(&error_ring_mutex);   \
-            MPIU_THREAD_CHECK_END                        \
+            MPID_THREAD_CHECK_BEGIN                      \
+            MPID_Thread_mutex_lock(&error_ring_mutex,&err); \
+            MPID_THREAD_CHECK_END                        \
         }                                                \
     } while (0)
 #define error_ring_mutex_unlock()                        \
     do {                                                 \
+        int err;                                         \
         if (did_err_init) {                              \
-            MPIU_THREAD_CHECK_BEGIN                      \
-            MPID_Thread_mutex_unlock(&error_ring_mutex); \
-            MPIU_THREAD_CHECK_END                        \
+            MPID_THREAD_CHECK_BEGIN                      \
+            MPID_Thread_mutex_unlock(&error_ring_mutex,&err); \
+            MPID_THREAD_CHECK_END                        \
         }                                                \
     } while (0)
 #else
diff --git a/src/mpi/errhan/file_call_errhandler.c b/src/mpi/errhan/file_call_errhandler.c
index 4ef7671..3b86c7c 100644
--- a/src/mpi/errhan/file_call_errhandler.c
+++ b/src/mpi/errhan/file_call_errhandler.c
@@ -153,7 +153,7 @@ int MPI_File_call_errhandler(MPI_File fh, int errorcode)
 #undef FUNCNAME
 #define FUNCNAME MPIR_File_call_cxx_errhandler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_File_call_cxx_errhandler( MPI_File *fh, int *errorcode, 
 			   void (*c_errhandler)(MPI_File *, int *, ... ) )
 {
diff --git a/src/mpi/errhan/file_create_errhandler.c b/src/mpi/errhan/file_create_errhandler.c
index 8560ff3..251a815 100644
--- a/src/mpi/errhan/file_create_errhandler.c
+++ b/src/mpi/errhan/file_create_errhandler.c
@@ -57,7 +57,7 @@ int MPI_File_create_errhandler(MPI_File_errhandler_function *file_errhandler_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_FILE_CREATE_ERRHANDLER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -75,7 +75,7 @@ int MPI_File_create_errhandler(MPI_File_errhandler_function *file_errhandler_fn,
     /* ... body of routine ...  */
     
     errhan_ptr = (MPID_Errhandler *)MPIU_Handle_obj_alloc( &MPID_Errhandler_mem );
-    MPIU_ERR_CHKANDJUMP(!errhan_ptr,mpi_errno,MPI_ERR_OTHER,"**nomem");
+    MPIR_ERR_CHKANDJUMP(!errhan_ptr,mpi_errno,MPI_ERR_OTHER,"**nomem");
     errhan_ptr->language = MPID_LANG_C;
     errhan_ptr->kind	 = MPID_FILE;
     MPIU_Object_set_ref(errhan_ptr,1);
@@ -86,7 +86,7 @@ int MPI_File_create_errhandler(MPI_File_errhandler_function *file_errhandler_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_FILE_CREATE_ERRHANDLER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/file_get_errhandler.c b/src/mpi/errhan/file_get_errhandler.c
index e03a830..7816541 100644
--- a/src/mpi/errhan/file_get_errhandler.c
+++ b/src/mpi/errhan/file_get_errhandler.c
@@ -64,7 +64,7 @@ int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_FILE_GET_ERRHANDLER);
 
 #ifdef MPI_MODE_RDONLY
@@ -107,7 +107,7 @@ int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_FILE_GET_ERRHANDLER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/errhan/file_set_errhandler.c b/src/mpi/errhan/file_set_errhandler.c
index d2ff503..1f841d1 100644
--- a/src/mpi/errhan/file_set_errhandler.c
+++ b/src/mpi/errhan/file_set_errhandler.c
@@ -163,7 +163,7 @@ int MPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler)
    to get the PMPI and MPI versions without weak symbols */
 #undef FUNCNAME
 #define FUNCNAME MPIR_Get_file_error_routine
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Get_file_error_routine( MPI_Errhandler e, 
 				  void (**c)(MPI_File *, int *, ...), 
 				   int *kind )
diff --git a/src/mpi/errhan/win_call_errhandler.c b/src/mpi/errhan/win_call_errhandler.c
index 0499a93..9d3ae40 100644
--- a/src/mpi/errhan/win_call_errhandler.c
+++ b/src/mpi/errhan/win_call_errhandler.c
@@ -96,7 +96,7 @@ int MPI_Win_call_errhandler(MPI_Win win, int errorcode)
 
     /* ... body of routine ...  */
 
-    MPIU_THREAD_CS_ENTER(MPI_OBJ, win_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, win_ptr->pobj_mutex);
     in_cs = TRUE;
 
     if (!win_ptr->errhandler || 
@@ -151,7 +151,7 @@ int MPI_Win_call_errhandler(MPI_Win win, int errorcode)
 
   fn_exit:
     if (in_cs)
-        MPIU_THREAD_CS_EXIT(MPI_OBJ, win_ptr);
+        MPID_THREAD_CS_EXIT(POBJ, win_ptr->pobj_mutex);
 
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_CALL_ERRHANDLER);
     return mpi_errno;
diff --git a/src/mpi/errhan/win_create_errhandler.c b/src/mpi/errhan/win_create_errhandler.c
index 10f7d01..733e5d9 100644
--- a/src/mpi/errhan/win_create_errhandler.c
+++ b/src/mpi/errhan/win_create_errhandler.c
@@ -59,7 +59,7 @@ int MPI_Win_create_errhandler(MPI_Win_errhandler_function *win_errhandler_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_CREATE_ERRHANDLER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -77,7 +77,7 @@ int MPI_Win_create_errhandler(MPI_Win_errhandler_function *win_errhandler_fn,
     /* ... body of routine ...  */
     
     errhan_ptr = (MPID_Errhandler *)MPIU_Handle_obj_alloc( &MPID_Errhandler_mem );
-    MPIU_ERR_CHKANDJUMP1(!errhan_ptr,mpi_errno,MPI_ERR_OTHER,"**nomem",
+    MPIR_ERR_CHKANDJUMP1(!errhan_ptr,mpi_errno,MPI_ERR_OTHER,"**nomem",
 			 "**nomem %s", "MPI_Errhandler");
     errhan_ptr->language = MPID_LANG_C;
     errhan_ptr->kind	 = MPID_WIN;
@@ -89,7 +89,7 @@ int MPI_Win_create_errhandler(MPI_Win_errhandler_function *win_errhandler_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_CREATE_ERRHANDLER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/errhan/win_get_errhandler.c b/src/mpi/errhan/win_get_errhandler.c
index 89950eb..73d9aa5 100644
--- a/src/mpi/errhan/win_get_errhandler.c
+++ b/src/mpi/errhan/win_get_errhandler.c
@@ -59,7 +59,7 @@ int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_GET_ERRHANDLER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -93,7 +93,7 @@ int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler)
 
     /* ... body of routine ...  */
 
-    MPIU_THREAD_CS_ENTER(MPI_OBJ, win_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, win_ptr->pobj_mutex);
 
     if (win_ptr->errhandler) {
 	*errhandler = win_ptr->errhandler->handle;
@@ -104,7 +104,7 @@ int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler)
 	*errhandler = MPI_ERRORS_ARE_FATAL;
     }
 
-    MPIU_THREAD_CS_EXIT(MPI_OBJ, win_ptr);
+    MPID_THREAD_CS_EXIT(POBJ, win_ptr->pobj_mutex);
 
     /* ... end of body of routine ... */
 
@@ -112,7 +112,7 @@ int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler)
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_GET_ERRHANDLER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/errhan/win_set_errhandler.c b/src/mpi/errhan/win_set_errhandler.c
index 49e53cc..3c638d3 100644
--- a/src/mpi/errhan/win_set_errhandler.c
+++ b/src/mpi/errhan/win_set_errhandler.c
@@ -104,7 +104,7 @@ int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler)
 
     /* ... body of routine ...  */
 
-    MPIU_THREAD_CS_ENTER(MPI_OBJ, win_ptr);
+    MPID_THREAD_CS_ENTER(POBJ, win_ptr->pobj_mutex);
 
     if (win_ptr->errhandler != NULL) {
         MPIR_Errhandler_release_ref(win_ptr->errhandler,&in_use);
@@ -116,7 +116,7 @@ int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler)
     MPIR_Errhandler_add_ref(errhan_ptr);
     win_ptr->errhandler = errhan_ptr;
 
-    MPIU_THREAD_CS_EXIT(MPI_OBJ, win_ptr);
+    MPID_THREAD_CS_EXIT(POBJ, win_ptr->pobj_mutex);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/group/group_compare.c b/src/mpi/group/group_compare.c
index ca361bf..bf7c1e4 100644
--- a/src/mpi/group/group_compare.c
+++ b/src/mpi/group/group_compare.c
@@ -84,7 +84,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Group_compare
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Group_compare - Compares two groups
@@ -119,7 +119,7 @@ int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
     /* The routines that setup the group data structures must be executed
        within a mutex.  As most of the group routines are not performance
        critical, we simple run these routines within the SINGLE_CS */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_COMPARE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -157,13 +157,13 @@ int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Group_compare_impl(group_ptr1, group_ptr2, result);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_COMPARE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/group/group_difference.c b/src/mpi/group/group_difference.c
index 7e8ccec..4ead944 100644
--- a/src/mpi/group/group_difference.c
+++ b/src/mpi/group/group_difference.c
@@ -29,7 +29,7 @@ int MPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup
 #undef FUNCNAME
 #define FUNCNAME MPIR_Group_difference_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Group_difference_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2, MPID_Group **new_group_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -109,7 +109,7 @@ int MPIR_Group_difference_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2, M
 #undef FUNCNAME
 #define FUNCNAME MPI_Group_difference
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 
@@ -146,7 +146,7 @@ int MPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_DIFFERENCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -191,7 +191,7 @@ int MPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_DIFFERENCE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_excl.c b/src/mpi/group/group_excl.c
index bf33ae1..8fffc31 100644
--- a/src/mpi/group/group_excl.c
+++ b/src/mpi/group/group_excl.c
@@ -29,7 +29,7 @@ int MPI_Group_excl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
 #undef FUNCNAME
 #define FUNCNAME MPIR_Group_excl_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Group_excl_impl(MPID_Group *group_ptr, int n, const int ranks[], MPID_Group **new_group_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -42,7 +42,7 @@ int MPIR_Group_excl_impl(MPID_Group *group_ptr, int n, const int ranks[], MPID_G
 
     /* Allocate a new group and lrank_to_lpid array */
     mpi_errno = MPIR_Group_create( size - n, new_group_ptr );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     (*new_group_ptr)->rank = MPI_UNDEFINED;
     /* Use flag fields to mark the members to *exclude* . */
@@ -81,7 +81,7 @@ int MPIR_Group_excl_impl(MPID_Group *group_ptr, int n, const int ranks[], MPID_G
 #undef FUNCNAME
 #define FUNCNAME MPI_Group_excl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 
@@ -123,7 +123,7 @@ int MPI_Group_excl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_EXCL);
     /* Validate parameters, especially handles needing to be converted */
 #   ifdef HAVE_ERROR_CHECKING
@@ -172,7 +172,7 @@ int MPI_Group_excl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_EXCL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_free.c b/src/mpi/group/group_free.c
index f292449..c80dc36 100644
--- a/src/mpi/group/group_free.c
+++ b/src/mpi/group/group_free.c
@@ -28,7 +28,7 @@ int MPI_Group_free(MPI_Group *group) __attribute__((weak,alias("PMPI_Group_free"
 #undef FUNCNAME
 #define FUNCNAME MPIR_Group_free_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Group_free_impl(MPID_Group *group_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -36,7 +36,7 @@ int MPIR_Group_free_impl(MPID_Group *group_ptr)
     /* Do not free MPI_GROUP_EMPTY */
     if (group_ptr->handle != MPI_GROUP_EMPTY) {
         mpi_errno = MPIR_Group_release(group_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -50,7 +50,7 @@ int MPIR_Group_free_impl(MPID_Group *group_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPI_Group_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Group_free - Frees a group
@@ -78,7 +78,7 @@ int MPI_Group_free(MPI_Group *group)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_FREE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -128,7 +128,7 @@ int MPI_Group_free(MPI_Group *group)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_FREE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_incl.c b/src/mpi/group/group_incl.c
index 4ed64d9..5a3f321 100644
--- a/src/mpi/group/group_incl.c
+++ b/src/mpi/group/group_incl.c
@@ -29,7 +29,7 @@ int MPI_Group_incl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
 #undef FUNCNAME
 #define FUNCNAME MPIR_Group_incl_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Group_incl_impl(MPID_Group *group_ptr, int n, const int ranks[], MPID_Group **new_group_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -71,7 +71,7 @@ int MPIR_Group_incl_impl(MPID_Group *group_ptr, int n, const int ranks[], MPID_G
 #undef FUNCNAME
 #define FUNCNAME MPI_Group_incl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 
@@ -109,7 +109,7 @@ int MPI_Group_incl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_INCL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -161,7 +161,7 @@ int MPI_Group_incl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_INCL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_intersection.c b/src/mpi/group/group_intersection.c
index 0deea2a..1ff108a 100644
--- a/src/mpi/group/group_intersection.c
+++ b/src/mpi/group/group_intersection.c
@@ -29,7 +29,7 @@ int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgro
 #undef FUNCNAME
 #define FUNCNAME MPIR_Group_intersection_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Group_intersection_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2, MPID_Group **new_group_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -74,7 +74,7 @@ int MPIR_Group_intersection_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2,
     }
     
     mpi_errno = MPIR_Group_create( nnew, new_group_ptr );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     (*new_group_ptr)->rank = MPI_UNDEFINED;
     (*new_group_ptr)->is_local_dense_monotonic = TRUE;
@@ -107,7 +107,7 @@ int MPIR_Group_intersection_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2,
 #undef FUNCNAME
 #define FUNCNAME MPI_Group_intersection
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 
@@ -146,7 +146,7 @@ int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgro
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_INTERSECTION);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -191,7 +191,7 @@ int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgro
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_INTERSECTION);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_range_excl.c b/src/mpi/group/group_range_excl.c
index 0de4457..b050e7c 100644
--- a/src/mpi/group/group_range_excl.c
+++ b/src/mpi/group/group_range_excl.c
@@ -28,7 +28,7 @@ int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], MPI_Group *new
 #undef FUNCNAME
 #define FUNCNAME MPIR_Group_range_excl_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Group_range_excl_impl(MPID_Group *group_ptr, int n, int ranges[][3], MPID_Group **new_group_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -114,7 +114,7 @@ int MPIR_Group_range_excl_impl(MPID_Group *group_ptr, int n, int ranges[][3], MP
 #undef FUNCNAME
 #define FUNCNAME MPI_Group_range_excl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 
@@ -159,7 +159,7 @@ int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_RANGE_EXCL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -208,7 +208,7 @@ int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_RANGE_EXCL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_range_incl.c b/src/mpi/group/group_range_incl.c
index f230c4f..1b78dc1 100644
--- a/src/mpi/group/group_range_incl.c
+++ b/src/mpi/group/group_range_incl.c
@@ -29,7 +29,7 @@ int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], MPI_Group *new
 #undef FUNCNAME
 #define FUNCNAME MPIR_Group_range_incl_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Group_range_incl_impl(MPID_Group *group_ptr, int n, int ranges[][3], MPID_Group **new_group_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -98,7 +98,7 @@ int MPIR_Group_range_incl_impl(MPID_Group *group_ptr, int n, int ranges[][3], MP
 #undef FUNCNAME
 #define FUNCNAME MPI_Group_range_incl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 
@@ -138,7 +138,7 @@ int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_RANGE_INCL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -184,7 +184,7 @@ int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_RANGE_INCL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/group_translate_ranks.c b/src/mpi/group/group_translate_ranks.c
index 6e794c3..573ef28 100644
--- a/src/mpi/group/group_translate_ranks.c
+++ b/src/mpi/group/group_translate_ranks.c
@@ -30,7 +30,7 @@ int MPI_Group_translate_ranks(MPI_Group group1, int n, const int ranks1[], MPI_G
 #undef FUNCNAME
 #define FUNCNAME MPIR_Group_translate_ranks_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Group_translate_ranks_impl(MPID_Group *gp1, int n, const int ranks1[],
                                     MPID_Group *gp2, int ranks2[])
 {
@@ -112,7 +112,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Group_translate_ranks
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
  MPI_Group_translate_ranks - Translates the ranks of processes in one group to 
                              those in another group
@@ -150,7 +150,7 @@ int MPI_Group_translate_ranks(MPI_Group group1, int n, const int ranks1[],
     /* The routines that setup the group data structures must be executed
        within a mutex.  As most of the group routines are not performance
        critical, we simple run these routines within the SINGLE_CS */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_TRANSLATE_RANKS);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -204,13 +204,13 @@ int MPI_Group_translate_ranks(MPI_Group group1, int n, const int ranks1[],
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Group_translate_ranks_impl(group_ptr1, n, ranks1, group_ptr2, ranks2);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_TRANSLATE_RANKS);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/group/group_union.c b/src/mpi/group/group_union.c
index 97e9554..a091413 100644
--- a/src/mpi/group/group_union.c
+++ b/src/mpi/group/group_union.c
@@ -29,7 +29,7 @@ int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) __a
 #undef FUNCNAME
 #define FUNCNAME MPIR_Group_union_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Group_union_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2, MPID_Group **new_group_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -96,7 +96,7 @@ int MPIR_Group_union_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2, MPID_G
     
     /* Allocate a new group and lrank_to_lpid array */
     mpi_errno = MPIR_Group_create( nnew, new_group_ptr );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* If this process is in group1, then we can set the rank now. 
        If we are not in this group, this assignment will set the
@@ -145,7 +145,7 @@ int MPIR_Group_union_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2, MPID_G
 #undef FUNCNAME
 #define FUNCNAME MPI_Group_union
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 
@@ -179,7 +179,7 @@ int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,); 
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex); 
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GROUP_UNION);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -224,7 +224,7 @@ int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GROUP_UNION);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/group/grouputil.c b/src/mpi/group/grouputil.c
index 91ab9a0..9f0b28c 100644
--- a/src/mpi/group/grouputil.c
+++ b/src/mpi/group/grouputil.c
@@ -33,9 +33,6 @@ int MPIR_Group_init(void)
     MPID_Group_builtin[0].idx_of_first_lpid = -1;
     MPID_Group_builtin[0].lrank_to_lpid = NULL;
 
-    /* the mutex is probably never used, but initializing it doesn't hurt */
-    MPIU_THREAD_MPI_OBJ_INIT(&MPID_Group_builtin[0]);
-
     /* TODO hook for device here? */
     return mpi_errno;
 }
@@ -285,7 +282,7 @@ int MPIR_Group_check_valid_ranges( MPID_Group *group_ptr,
     int i, j, size, first, last, stride, mpi_errno = MPI_SUCCESS;
 
     if (n < 0) {
-	MPIU_ERR_SETANDSTMT2(mpi_errno,MPI_ERR_ARG,;,
+	MPIR_ERR_SETANDSTMT2(mpi_errno,MPI_ERR_ARG,;,
                              "**argneg", "**argneg %s %d", "n", n );
 	return mpi_errno;
     }
@@ -391,7 +388,7 @@ int MPIR_Group_check_subset( MPID_Group *group_ptr, MPID_Comm *comm_ptr )
 			vsize*sizeof(MPID_Group_pmap_t),mpi_errno, "" );
     /* Initialize the vmap */
     for (i=0; i<vsize; i++) {
-	MPID_Comm_get_lpid(comm_ptr, i, &vmap[i].lpid, MPIU_FALSE);
+	MPID_Comm_get_lpid(comm_ptr, i, &vmap[i].lpid, FALSE);
 	vmap[i].next_lpid = 0;
 	vmap[i].flag      = 0;
     }
@@ -424,7 +421,7 @@ int MPIR_Group_check_subset( MPID_Group *group_ptr, MPID_Comm *comm_ptr )
     }
 
     if (g1_idx >= 0) {
-	MPIU_ERR_SET1(mpi_errno, MPI_ERR_GROUP,
+	MPIR_ERR_SET1(mpi_errno, MPI_ERR_GROUP,
 		      "**groupnotincomm", "**groupnotincomm %d", g1_idx );
     }
 
diff --git a/src/mpi/info/info_create.c b/src/mpi/info/info_create.c
index c974b9a..33f1f65 100644
--- a/src/mpi/info/info_create.c
+++ b/src/mpi/info/info_create.c
@@ -52,7 +52,7 @@ int MPI_Info_create( MPI_Info *info )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_CREATE);
 
     /* Validate parameters and objects (post conversion) */
@@ -69,7 +69,7 @@ int MPI_Info_create( MPI_Info *info )
     /* ... body of routine ...  */
 
     mpi_errno = MPIU_Info_alloc(&info_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     *info	     = info_ptr->handle;
     /* (info_ptr)->cookie = MPIR_INFO_COOKIE; */
@@ -80,7 +80,7 @@ int MPI_Info_create( MPI_Info *info )
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_CREATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/info/info_delete.c b/src/mpi/info/info_delete.c
index 6571e0f..84c088b 100644
--- a/src/mpi/info/info_delete.c
+++ b/src/mpi/info/info_delete.c
@@ -52,7 +52,7 @@ int MPI_Info_delete( MPI_Info info, const char *key )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_DELETE);
     
 
@@ -82,10 +82,10 @@ int MPI_Info_delete( MPI_Info info, const char *key )
             if (mpi_errno) goto fn_fail;
 	    
 	    /* Check key */
-	    MPIU_ERR_CHKANDJUMP((!key), mpi_errno, MPI_ERR_INFO_KEY, "**infokeynull");
+	    MPIR_ERR_CHKANDJUMP((!key), mpi_errno, MPI_ERR_INFO_KEY, "**infokeynull");
 	    keylen = (int)strlen(key);
-	    MPIU_ERR_CHKANDJUMP((keylen > MPI_MAX_INFO_KEY), mpi_errno, MPI_ERR_INFO_KEY, "**infokeylong");
-	    MPIU_ERR_CHKANDJUMP((keylen == 0), mpi_errno, MPI_ERR_INFO_KEY, "**infokeyempty");
+	    MPIR_ERR_CHKANDJUMP((keylen > MPI_MAX_INFO_KEY), mpi_errno, MPI_ERR_INFO_KEY, "**infokeylong");
+	    MPIR_ERR_CHKANDJUMP((keylen == 0), mpi_errno, MPI_ERR_INFO_KEY, "**infokeyempty");
         }
         MPID_END_ERROR_CHECKS;
     }
@@ -109,13 +109,13 @@ int MPI_Info_delete( MPI_Info info, const char *key )
     }
 
     /* If curr_ptr is not defined, we never found the key */
-    MPIU_ERR_CHKANDJUMP1((!curr_ptr), mpi_errno, MPI_ERR_INFO_NOKEY, "**infonokey", "**infonokey %s", key);
+    MPIR_ERR_CHKANDJUMP1((!curr_ptr), mpi_errno, MPI_ERR_INFO_NOKEY, "**infonokey", "**infonokey %s", key);
     
     /* ... end of body of routine ... */
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_DELETE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/info/info_dup.c b/src/mpi/info/info_dup.c
index cc4d67b..d31299b 100644
--- a/src/mpi/info/info_dup.c
+++ b/src/mpi/info/info_dup.c
@@ -30,7 +30,7 @@ int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo) __attribute__((weak,alias("PM
 #undef FUNCNAME
 #define FUNCNAME MPIR_Info_dup_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Info_dup_impl(MPID_Info *info_ptr, MPID_Info **new_info_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -46,14 +46,14 @@ int MPIR_Info_dup_impl(MPID_Info *info_ptr, MPID_Info **new_info_ptr)
        it two steps: count and then allocate */
     /* FIXME : multithreaded */
     mpi_errno = MPIU_Info_alloc(&curr_new);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     *new_info_ptr = curr_new;
 
     curr_old = info_ptr->next;
     while (curr_old)
     {
         mpi_errno = MPIU_Info_alloc(&curr_new->next);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         curr_new         = curr_new->next;
         curr_new->key    = MPIU_Strdup(curr_old->key);
@@ -73,7 +73,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Info_dup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Info_dup - Returns a duplicate of the info object
 
@@ -99,7 +99,7 @@ int MPI_Info_dup( MPI_Info info, MPI_Info *newinfo )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_DUP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -140,7 +140,7 @@ int MPI_Info_dup( MPI_Info info, MPI_Info *newinfo )
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_DUP);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/info/info_free.c b/src/mpi/info/info_free.c
index 7bf31d7..0840005 100644
--- a/src/mpi/info/info_free.c
+++ b/src/mpi/info/info_free.c
@@ -55,7 +55,7 @@ int MPI_Info_free( MPI_Info *info )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_FREE);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -96,7 +96,7 @@ int MPI_Info_free( MPI_Info *info )
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_FREE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/info/info_get.c b/src/mpi/info/info_get.c
index b5bbef6..4508b79 100644
--- a/src/mpi/info/info_get.c
+++ b/src/mpi/info/info_get.c
@@ -28,7 +28,7 @@ int MPI_Info_get(MPI_Info info, const char *key, int valuelen, char *value, int
 #undef FUNCNAME
 #define FUNCNAME MPIR_Info_get_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Info_get_impl(MPID_Info *info_ptr, const char *key, int valuelen, char *value, int *flag)
 {
     MPID_Info *curr_ptr;
@@ -89,7 +89,7 @@ Output Parameters:
 #undef FUNCNAME
 #define FUNCNAME MPI_Info_get
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPI_Info_get(MPI_Info info, const char *key, int valuelen, char *value,
 		 int *flag)
 {
@@ -99,7 +99,7 @@ int MPI_Info_get(MPI_Info info, const char *key, int valuelen, char *value,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_GET);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -128,17 +128,17 @@ int MPI_Info_get(MPI_Info info, const char *key, int valuelen, char *value,
             if (mpi_errno) goto fn_fail;
 	    
 	    /* Check key */
-	    MPIU_ERR_CHKANDJUMP((!key), mpi_errno, MPI_ERR_INFO_KEY, 
+	    MPIR_ERR_CHKANDJUMP((!key), mpi_errno, MPI_ERR_INFO_KEY, 
 				"**infokeynull");
 	    keylen = (int)strlen(key);
-	    MPIU_ERR_CHKANDJUMP((keylen > MPI_MAX_INFO_KEY), mpi_errno, 
+	    MPIR_ERR_CHKANDJUMP((keylen > MPI_MAX_INFO_KEY), mpi_errno, 
 				MPI_ERR_INFO_KEY, "**infokeylong");
-	    MPIU_ERR_CHKANDJUMP((keylen == 0), mpi_errno, MPI_ERR_INFO_KEY, 
+	    MPIR_ERR_CHKANDJUMP((keylen == 0), mpi_errno, MPI_ERR_INFO_KEY, 
 				"**infokeyempty");
 
 	    /* Check value arguments */
 	    MPIR_ERRTEST_ARGNEG(valuelen, "valuelen", mpi_errno);
-	    MPIU_ERR_CHKANDSTMT((!value), mpi_errno, MPI_ERR_INFO_VALUE,goto fn_fail,
+	    MPIR_ERR_CHKANDSTMT((!value), mpi_errno, MPI_ERR_INFO_VALUE,goto fn_fail,
 				"**infovalnull");
         }
         MPID_END_ERROR_CHECKS;
@@ -152,7 +152,7 @@ int MPI_Info_get(MPI_Info info, const char *key, int valuelen, char *value,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_GET);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/info/info_getn.c b/src/mpi/info/info_getn.c
index fa1a699..2725b60 100644
--- a/src/mpi/info/info_getn.c
+++ b/src/mpi/info/info_getn.c
@@ -28,7 +28,7 @@ int MPI_Info_get_nkeys(MPI_Info info, int *nkeys) __attribute__((weak,alias("PMP
 #undef FUNCNAME
 #define FUNCNAME MPIR_Info_get_nkeys_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Info_get_nkeys_impl(MPID_Info *info_ptr, int *nkeys)
 {
     int n;
@@ -68,7 +68,7 @@ Output Parameters:
 #undef FUNCNAME
 #define FUNCNAME MPI_Info_get_nkeys
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPI_Info_get_nkeys( MPI_Info info, int *nkeys )
 {
     MPID_Info *info_ptr=0;
@@ -77,7 +77,7 @@ int MPI_Info_get_nkeys( MPI_Info info, int *nkeys )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_GET_NKEYS);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -119,7 +119,7 @@ int MPI_Info_get_nkeys( MPI_Info info, int *nkeys )
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_GET_NKEYS);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/info/info_getnth.c b/src/mpi/info/info_getnth.c
index 5c17bf1..bb1b69d 100644
--- a/src/mpi/info/info_getnth.c
+++ b/src/mpi/info/info_getnth.c
@@ -28,7 +28,7 @@ int MPI_Info_get_nthkey(MPI_Info info, int n, char *key) __attribute__((weak,ali
 #undef FUNCNAME
 #define FUNCNAME MPIR_Info_get_nthkey_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Info_get_nthkey_impl(MPID_Info *info_ptr, int n, char *key)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -43,7 +43,7 @@ int MPIR_Info_get_nthkey_impl(MPID_Info *info_ptr, int n, char *key)
     }
 
     /* verify that n is valid */
-    MPIU_ERR_CHKANDJUMP2((!curr_ptr), mpi_errno, MPI_ERR_ARG, "**infonkey", "**infonkey %d %d", n, nkeys);
+    MPIR_ERR_CHKANDJUMP2((!curr_ptr), mpi_errno, MPI_ERR_ARG, "**infonkey", "**infonkey %d %d", n, nkeys);
 
     MPIU_Strncpy( key, curr_ptr->key, MPI_MAX_INFO_KEY+1 );
     /* Eventually, we could remember the location of this key in
@@ -79,7 +79,7 @@ Output Parameters:
 #undef FUNCNAME
 #define FUNCNAME MPI_Info_get_nthkey
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPI_Info_get_nthkey( MPI_Info info, int n, char *key )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -88,7 +88,7 @@ int MPI_Info_get_nthkey( MPI_Info info, int n, char *key )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_GET_NTHKEY);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -114,7 +114,7 @@ int MPI_Info_get_nthkey( MPI_Info info, int n, char *key )
             MPID_Info_valid_ptr( info_ptr, mpi_errno );
             if (mpi_errno) goto fn_fail;
 
-	    MPIU_ERR_CHKANDJUMP((!key), mpi_errno, MPI_ERR_INFO_KEY, "**infokeynull");
+	    MPIR_ERR_CHKANDJUMP((!key), mpi_errno, MPI_ERR_INFO_KEY, "**infokeynull");
         }
         MPID_END_ERROR_CHECKS;
     }
@@ -127,7 +127,7 @@ int MPI_Info_get_nthkey( MPI_Info info, int n, char *key )
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_GET_NTHKEY);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/info/info_getvallen.c b/src/mpi/info/info_getvallen.c
index 546ee4b..09bc93f 100644
--- a/src/mpi/info/info_getvallen.c
+++ b/src/mpi/info/info_getvallen.c
@@ -28,7 +28,7 @@ int MPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen, int *fl
 #undef FUNCNAME
 #define FUNCNAME MPIR_Info_get_valuelen_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Info_get_valuelen_impl(MPID_Info *info_ptr, const char *key, int *valuelen, int *flag)
 {
     MPID_Info *curr_ptr;
@@ -74,7 +74,7 @@ Output Parameters:
 #undef FUNCNAME
 #define FUNCNAME MPIRInfo_get_valuelen
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPI_Info_get_valuelen( MPI_Info info, const char *key, int *valuelen, int *flag )
 {
     MPID_Info *info_ptr=0;
@@ -83,7 +83,7 @@ int MPI_Info_get_valuelen( MPI_Info info, const char *key, int *valuelen, int *f
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_GET_VALUELEN);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -112,12 +112,12 @@ int MPI_Info_get_valuelen( MPI_Info info, const char *key, int *valuelen, int *f
             if (mpi_errno) goto fn_fail;
 	    
 	    /* Check key */
-	    MPIU_ERR_CHKANDJUMP((!key), mpi_errno, MPI_ERR_INFO_KEY, 
+	    MPIR_ERR_CHKANDJUMP((!key), mpi_errno, MPI_ERR_INFO_KEY, 
 				"**infokeynull");
 	    keylen = (int)strlen(key);
-	    MPIU_ERR_CHKANDJUMP((keylen > MPI_MAX_INFO_KEY), mpi_errno, 
+	    MPIR_ERR_CHKANDJUMP((keylen > MPI_MAX_INFO_KEY), mpi_errno, 
 				MPI_ERR_INFO_KEY, "**infokeylong");
-	    MPIU_ERR_CHKANDJUMP((keylen == 0), mpi_errno, MPI_ERR_INFO_KEY, 
+	    MPIR_ERR_CHKANDJUMP((keylen == 0), mpi_errno, MPI_ERR_INFO_KEY, 
 				"**infokeyempty");
 
 	    MPIR_ERRTEST_ARGNULL(valuelen, "valuelen", mpi_errno);
@@ -136,7 +136,7 @@ int MPI_Info_get_valuelen( MPI_Info info, const char *key, int *valuelen, int *f
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_GET_VALUELEN);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/info/info_set.c b/src/mpi/info/info_set.c
index da1f033..8550d3b 100644
--- a/src/mpi/info/info_set.c
+++ b/src/mpi/info/info_set.c
@@ -58,7 +58,7 @@ int MPI_Info_set( MPI_Info info, const char *key, const char *value )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,); 
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex); 
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INFO_SET);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -87,14 +87,14 @@ int MPI_Info_set( MPI_Info info, const char *key, const char *value )
             if (mpi_errno) goto fn_fail;
 	    
 	    /* Check key */
-	    MPIU_ERR_CHKANDJUMP((!key), mpi_errno, MPI_ERR_INFO_KEY, "**infokeynull");
+	    MPIR_ERR_CHKANDJUMP((!key), mpi_errno, MPI_ERR_INFO_KEY, "**infokeynull");
 	    keylen = (int)strlen(key);
-	    MPIU_ERR_CHKANDJUMP((keylen > MPI_MAX_INFO_KEY), mpi_errno, MPI_ERR_INFO_KEY, "**infokeylong");
-	    MPIU_ERR_CHKANDJUMP((keylen == 0), mpi_errno, MPI_ERR_INFO_KEY, "**infokeyempty");
+	    MPIR_ERR_CHKANDJUMP((keylen > MPI_MAX_INFO_KEY), mpi_errno, MPI_ERR_INFO_KEY, "**infokeylong");
+	    MPIR_ERR_CHKANDJUMP((keylen == 0), mpi_errno, MPI_ERR_INFO_KEY, "**infokeyempty");
 
 	    /* Check value arguments */
-	    MPIU_ERR_CHKANDJUMP((!value), mpi_errno, MPI_ERR_INFO_VALUE, "**infovalnull");
-	    MPIU_ERR_CHKANDJUMP((strlen(value) > MPI_MAX_INFO_VAL), mpi_errno, MPI_ERR_INFO_VALUE, "**infovallong");
+	    MPIR_ERR_CHKANDJUMP((!value), mpi_errno, MPI_ERR_INFO_VALUE, "**infovalnull");
+	    MPIR_ERR_CHKANDJUMP((strlen(value) > MPI_MAX_INFO_VAL), mpi_errno, MPI_ERR_INFO_VALUE, "**infovallong");
         }
         MPID_END_ERROR_CHECKS;
     }
@@ -106,7 +106,7 @@ int MPI_Info_set( MPI_Info info, const char *key, const char *value )
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INFO_SET);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
@@ -129,7 +129,7 @@ int MPI_Info_set( MPI_Info info, const char *key, const char *value )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Info_set_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Info_set_impl(MPID_Info *info_ptr, const char *key, const char *value)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -155,7 +155,7 @@ int MPIR_Info_set_impl(MPID_Info *info_ptr, const char *key, const char *value)
     if (!curr_ptr) {
         /* Key not present, insert value */
         mpi_errno = MPIU_Info_alloc(&curr_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /*printf( "Inserting new elm %x at %x\n", curr_ptr->id, prev_ptr->id );*/
         prev_ptr->next   = curr_ptr;
diff --git a/src/mpi/info/infoutil.c b/src/mpi/info/infoutil.c
index 36ac7d7..9c3df05 100644
--- a/src/mpi/info/infoutil.c
+++ b/src/mpi/info/infoutil.c
@@ -26,7 +26,7 @@ MPIU_Object_alloc_t MPID_Info_mem = { 0, 0, 0, 0, MPID_INFO,
 #undef FUNCNAME
 #define FUNCNAME MPIU_Info_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIU_Info_free( MPID_Info *info_ptr )
 {
     MPID_Info *curr_ptr, *last_ptr;
@@ -53,12 +53,12 @@ void MPIU_Info_free( MPID_Info *info_ptr )
 #undef FUNCNAME
 #define FUNCNAME MPIU_Info_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIU_Info_alloc(MPID_Info **info_p_p)
 {
     int mpi_errno = MPI_SUCCESS;
     *info_p_p = (MPID_Info *)MPIU_Handle_obj_alloc(&MPID_Info_mem);
-    MPIU_ERR_CHKANDJUMP1(!*info_p_p, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPI_Info");
+    MPIR_ERR_CHKANDJUMP1(!*info_p_p, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPI_Info");
 
     MPIU_Object_set_ref(*info_p_p, 0);
     (*info_p_p)->next  = NULL;
diff --git a/src/mpi/init/abort.c b/src/mpi/init/abort.c
index 2acf9b3..fda7232 100644
--- a/src/mpi/init/abort.c
+++ b/src/mpi/init/abort.c
@@ -86,7 +86,7 @@ int MPI_Abort(MPI_Comm comm, int errorcode)
        since that could result in the Abort hanging if another routine is
        hung holding the critical section.  Also note the "not thread-safe"
        comment in the description of MPI_Abort above. */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ABORT);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -144,7 +144,7 @@ int MPI_Abort(MPI_Comm comm, int errorcode)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ABORT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/init/async.c b/src/mpi/init/async.c
index c003827..ba64278 100644
--- a/src/mpi/init/async.c
+++ b/src/mpi/init/async.c
@@ -24,7 +24,7 @@ static volatile int progress_thread_done = 0;
 #undef FUNCNAME
 #define FUNCNAME progress_fn
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void progress_fn(void * data)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -35,7 +35,7 @@ static void progress_fn(void * data)
     /* Explicitly add CS_ENTER/EXIT since this thread is created from
      * within an internal function and will call NMPI functions
      * directly. */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     /* FIXME: We assume that waiting on some request forces progress
      * on all requests. With fine-grained threads, will this still
@@ -65,7 +65,7 @@ static void progress_fn(void * data)
     MPIU_Thread_cond_signal(&progress_cond, &mpi_errno);
     MPIU_Assert(!mpi_errno);
 
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return;
 }
@@ -75,7 +75,7 @@ static void progress_fn(void * data)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Init_async_thread
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Init_async_thread(void)
 {
 #if MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE
@@ -90,16 +90,16 @@ int MPIR_Init_async_thread(void)
     /* Dup comm world for the progress thread */
     MPID_Comm_get_ptr(MPI_COMM_SELF, comm_self_ptr);
     mpi_errno = MPIR_Comm_dup_impl(comm_self_ptr, &progress_comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Thread_cond_create(&progress_cond, &err);
-    MPIU_ERR_CHKANDJUMP1(err, mpi_errno, MPI_ERR_OTHER, "**cond_create", "**cond_create %s", strerror(err));
+    MPIR_ERR_CHKANDJUMP1(err, mpi_errno, MPI_ERR_OTHER, "**cond_create", "**cond_create %s", strerror(err));
     
     MPIU_Thread_mutex_create(&progress_mutex, &err);
-    MPIU_ERR_CHKANDJUMP1(err, mpi_errno, MPI_ERR_OTHER, "**mutex_create", "**mutex_create %s", strerror(err));
+    MPIR_ERR_CHKANDJUMP1(err, mpi_errno, MPI_ERR_OTHER, "**mutex_create", "**mutex_create %s", strerror(err));
     
     MPIU_Thread_create((MPIU_Thread_func_t) progress_fn, NULL, &progress_thread_id, &err);
-    MPIU_ERR_CHKANDJUMP1(err, mpi_errno, MPI_ERR_OTHER, "**mutex_create", "**mutex_create %s", strerror(err));
+    MPIR_ERR_CHKANDJUMP1(err, mpi_errno, MPI_ERR_OTHER, "**mutex_create", "**mutex_create %s", strerror(err));
     
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_INIT_ASYNC_THREAD);
 
@@ -115,7 +115,7 @@ int MPIR_Init_async_thread(void)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Finalize_async_thread
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Finalize_async_thread(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -135,7 +135,7 @@ int MPIR_Finalize_async_thread(void)
     MPIU_Assert(!mpi_errno);
 
     /* XXX DJG why is this unlock/lock necessary?  Should we just YIELD here or later?  */
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     MPIU_Thread_mutex_lock(&progress_mutex, &mpi_errno);
     MPIU_Assert(!mpi_errno);
@@ -151,7 +151,7 @@ int MPIR_Finalize_async_thread(void)
     mpi_errno = MPIR_Comm_free_impl(progress_comm_ptr);
     MPIU_Assert(!mpi_errno);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     MPIU_Thread_cond_destroy(&progress_cond, &mpi_errno);
     MPIU_Assert(!mpi_errno);
diff --git a/src/mpi/init/finalize.c b/src/mpi/init/finalize.c
index 53d854a..c617a7a 100644
--- a/src/mpi/init/finalize.c
+++ b/src/mpi/init/finalize.c
@@ -151,7 +151,7 @@ int MPI_Finalize( void )
 
     /* Note: Only one thread may ever call MPI_Finalize (MPI_Finalize may
        be called at most once in any program) */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FINALIZE_FUNC_ENTER(MPID_STATE_MPI_FINALIZE);
     
     /* ... body of routine ... */
@@ -178,13 +178,13 @@ int MPI_Finalize( void )
     if (MPIR_Process.attr_free && MPIR_Process.comm_self->attributes) {
         mpi_errno = MPIR_Process.attr_free( MPI_COMM_SELF,
 					    &MPIR_Process.comm_self->attributes);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	MPIR_Process.comm_self->attributes = 0;
     }
     if (MPIR_Process.attr_free && MPIR_Process.comm_world->attributes) {
         mpi_errno = MPIR_Process.attr_free( MPI_COMM_WORLD, 
                                             &MPIR_Process.comm_world->attributes);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	MPIR_Process.comm_world->attributes = 0;
     }
 
@@ -193,7 +193,6 @@ int MPI_Finalize( void )
      * At this point, we will release any user-defined error handlers on 
      * comm self and comm world
      */
-    /* no MPI_OBJ CS needed here */
     if (MPIR_Process.comm_world->errhandler && 
 	! (HANDLE_GET_KIND(MPIR_Process.comm_world->errhandler->handle) == 
 	   HANDLE_KIND_BUILTIN) ) {
@@ -237,7 +236,7 @@ int MPI_Finalize( void )
 
     mpi_errno = MPID_Finalize();
     if (mpi_errno) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     /* Call the low-priority (post Finalize) callbacks */
@@ -258,10 +257,12 @@ int MPI_Finalize( void )
     /* If memory debugging is enabled, check the memory here, after all
        finalize callbacks */
 
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     OPA_store_int(&MPIR_Process.mpich_state, MPICH_POST_FINALIZED);
 
-    MPIU_THREAD_CS_FINALIZE;
+#if defined(MPICH_IS_THREADED)
+    MPIR_Thread_CS_Finalize();
+#endif
 
     /* We place the memory tracing at the very end because any of the other
        steps may have allocated memory that they still need to release*/
@@ -318,7 +319,7 @@ int MPI_Finalize( void )
 #   endif
     mpi_errno = MPIR_Err_return_comm( 0, FCNAME, mpi_errno );
     if (OPA_load_int(&MPIR_Process.mpich_state) < MPICH_POST_FINALIZED) {
-        MPIU_THREAD_CS_EXIT(ALLFUNC,);
+        MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     }
     goto fn_exit;
     /* --END ERROR HANDLING-- */
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 6be0c7b..daf9903 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -156,41 +156,19 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
 }
 #endif
 
-
-#if !defined(MPICH_IS_THREADED)
-/* If single threaded, we preallocate this.  Otherwise, we create it */
-MPICH_PerThread_t  MPIR_Thread = { 0 };
-#elif defined(MPIU_TLS_SPECIFIER)
-MPIU_TLS_SPECIFIER MPICH_PerThread_t MPIR_Thread = { 0 };
-#else
-/* If we may be single threaded, we need a preallocated version to use
-   if we are single threaded case */
-MPICH_PerThread_t  MPIR_ThreadSingle = { 0 };
-#endif
-
 #if defined(MPICH_IS_THREADED)
-/* This routine is called when a thread exits; it is passed the value 
-   associated with the key.  In our case, this is simply storage allocated
-   with MPIU_Calloc */
-void MPIR_CleanupThreadStorage( void *a )
-{
-    if (a != 0) {
-	MPIU_Free( a );
-    }
-}
 
-#if !defined(MPID_DEVICE_DEFINES_THREAD_CS)
 /* These routine handle any thread initialization that my be required */
 #undef FUNCNAME
-#define FUNCNAME MPIR_Thread_CS_Init
+#define FUNCNAME thread_cs_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static int MPIR_Thread_CS_Init( void )
+#define FCNAME MPL_QUOTE(FUNCNAME)
+static int thread_cs_init( void )
 {
     int err;
     MPIU_THREADPRIV_DECL;
 
-    MPIU_Assert(MPICH_MAX_LOCKS >= MPIU_Nest_NUM_MUTEXES);
+    MPIU_Assert(MPICH_MAX_LOCKS >= MPIU_NEST_NUM_MUTEXES);
 
     /* we create this at all granularities right now */
     MPID_Thread_mutex_create(&MPIR_ThreadInfo.memalloc_mutex, &err);
@@ -200,15 +178,15 @@ static int MPIR_Thread_CS_Init( void )
     MPIU_THREADPRIV_INITKEY;
     MPIU_THREADPRIV_INIT;
 
-#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL
+#if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL
 /* There is a single, global lock, held for the duration of an MPI call */
     MPID_Thread_mutex_create(&MPIR_ThreadInfo.global_mutex, &err);
     MPIU_Assert(err == 0);
     MPID_Thread_mutex_create(&MPIR_ThreadInfo.handle_mutex, &err);
     MPIU_Assert(err == 0);
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
-    /* MPIU_THREAD_GRANULARITY_PER_OBJECT: Multiple locks */
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT
+    /* MPIR_THREAD_GRANULARITY_PER_OBJECT: Multiple locks */
     MPID_Thread_mutex_create(&MPIR_ThreadInfo.global_mutex, &err);
     MPIU_Assert(err == 0);
     MPID_Thread_mutex_create(&MPIR_ThreadInfo.handle_mutex, &err);
@@ -222,12 +200,12 @@ static int MPIR_Thread_CS_Init( void )
     MPID_Thread_mutex_create(&MPIR_ThreadInfo.pmi_mutex, &err);
     MPIU_Assert(err == 0);
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_LOCK_FREE
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_LOCK_FREE
 /* Updates to shared data and access to shared services is handled without 
    locks where ever possible. */
 #error lock-free not yet implemented
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_SINGLE
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_SINGLE
 /* No thread support, make all operations a no-op */
 
 #else
@@ -240,21 +218,21 @@ static int MPIR_Thread_CS_Init( void )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Thread_CS_Finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Thread_CS_Finalize( void )
 {
     int err;
 
     MPIU_DBG_MSG(THREAD,TYPICAL,"Freeing global mutex and private storage");
-#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL
+#if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL
 /* There is a single, global lock, held for the duration of an MPI call */
     MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.global_mutex, &err);
     MPIU_Assert(err == 0);
     MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.handle_mutex, &err);
     MPIU_Assert(err == 0);
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
-    /* MPIU_THREAD_GRANULARITY_PER_OBJECT: There are multiple locks,
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT
+    /* MPIR_THREAD_GRANULARITY_PER_OBJECT: There are multiple locks,
      * one for each logical class (e.g., each type of object) */
     MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.global_mutex, &err);
     MPIU_Assert(err == 0);
@@ -270,12 +248,12 @@ int MPIR_Thread_CS_Finalize( void )
     MPIU_Assert(err == 0);
 
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_LOCK_FREE
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_LOCK_FREE
 /* Updates to shared data and access to shared services is handled without 
    locks where ever possible. */
 #error lock-free not yet implemented
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_SINGLE
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_SINGLE
 /* No thread support, make all operations a no-op */
 
 #else
@@ -286,7 +264,6 @@ int MPIR_Thread_CS_Finalize( void )
 
     return MPI_SUCCESS;
 }
-#endif /* !MPID_DEVICE_DEFINES_THREAD_CS */
 #endif /* MPICH_IS_THREADED */
 
 #ifdef HAVE_F08_BINDING
@@ -311,7 +288,7 @@ MPI_F08_Status *MPI_F08_STATUSES_IGNORE = &MPIR_F08_MPI_STATUSES_IGNORE_OBJ[0];
 #undef FUNCNAME
 #define FUNCNAME MPIR_Init_thread
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -328,7 +305,11 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
     MPIR_ThreadInfo.isThreaded = required == MPI_THREAD_MULTIPLE;
 #endif /* MPICH_IS_THREADED */
 
-    MPIU_THREAD_CS_INIT;
+#if defined(MPICH_IS_THREADED)
+    mpi_errno = thread_cs_init();
+    if (mpi_errno)
+        MPIR_ERR_POP(mpi_errno);
+#endif
 
     /* FIXME: Move to os-dependent interface? */
 #ifdef HAVE_WINDOWS_H
@@ -481,7 +462,7 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
 
     /* We can't acquire any critical sections until this point.  Any
      * earlier the basic data structures haven't been initialized */
-    MPIU_THREAD_CS_ENTER(INIT,required);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     exit_init_cs_on_failure = 1;
 
     /* create MPI_INFO_NULL object */
@@ -490,14 +471,13 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
     info_ptr = MPID_Info_builtin + 1;
     info_ptr->handle = MPI_INFO_ENV;
     MPIU_Object_set_ref(info_ptr, 1);
-    MPIU_THREAD_MPI_OBJ_INIT(info_ptr);
     info_ptr->next  = NULL;
     info_ptr->key   = NULL;
     info_ptr->value = NULL;
     
     mpi_errno = MPID_Init(argc, argv, required, &thread_provided, 
 			  &has_args, &has_env);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Assert: tag_ub should be a power of 2 minus 1 */
     MPIU_Assert(((unsigned)MPIR_Process.attrs.tag_ub & ((unsigned)MPIR_Process.attrs.tag_ub + 1)) == 0);
@@ -561,7 +541,7 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
 	mpi_errno = MPID_InitCompleted();
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(INIT,required);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     /* Make fields of MPIR_Process global visible and set mpich_state
        atomically so that MPI_Initialized() etc. are thread safe */
     OPA_write_barrier();
@@ -574,9 +554,11 @@ fn_fail:
     OPA_store_int(&MPIR_Process.mpich_state, MPICH_PRE_INIT);
 
     if (exit_init_cs_on_failure) {
-        MPIU_THREAD_CS_EXIT(INIT,required);
+        MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     }
-    MPIU_THREAD_CS_FINALIZE;
+#if defined(MPICH_IS_THREADED)
+    MPIR_Thread_CS_Finalize();
+#endif
     return mpi_errno;
     /* --END ERROR HANDLING-- */
 }
@@ -585,7 +567,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Init_thread
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Init_thread - Initialize the MPI execution environment
 
@@ -701,7 +683,7 @@ int MPI_Init_thread( int *argc, char ***argv, int required, int *provided )
     mpi_errno = MPIR_Err_return_comm( 0, FCNAME, mpi_errno );
     MPID_MPI_INIT_FUNC_EXIT(MPID_STATE_MPI_INIT_THREAD);
 
-    MPIU_THREAD_CS_EXIT(INIT,*provided);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return mpi_errno;
     /* --END ERROR HANDLING-- */
diff --git a/src/mpi/misc/library_version.c b/src/mpi/misc/library_version.c
index 3fa210c..7cb3655 100644
--- a/src/mpi/misc/library_version.c
+++ b/src/mpi/misc/library_version.c
@@ -44,7 +44,7 @@ Output Parameters:
 #undef FUNCNAME
 #define FUNCNAME MPI_Get_library_version
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPI_Get_library_version(char *version, int *resultlen)
 {
     int mpi_errno = MPI_SUCCESS;
diff --git a/src/mpi/pt2pt/bsend.c b/src/mpi/pt2pt/bsend.c
index d4d3088..9c260ba 100644
--- a/src/mpi/pt2pt/bsend.c
+++ b/src/mpi/pt2pt/bsend.c
@@ -97,7 +97,7 @@ int MPI_Bsend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_BSEND);
     
     /* Validate handle parameters needing to be converted */
@@ -173,7 +173,7 @@ int MPI_Bsend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_BSEND);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 	
   fn_fail:
diff --git a/src/mpi/pt2pt/bsend_init.c b/src/mpi/pt2pt/bsend_init.c
index b495e5f..6f7887d 100644
--- a/src/mpi/pt2pt/bsend_init.c
+++ b/src/mpi/pt2pt/bsend_init.c
@@ -70,7 +70,7 @@ int MPI_Bsend_init(const void *buf, int count, MPI_Datatype datatype,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_BSEND_INIT);
     
     /* Validate handle parameters needing to be converted */
@@ -131,7 +131,7 @@ int MPI_Bsend_init(const void *buf, int count, MPI_Datatype datatype,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_BSEND_INIT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/bsendutil.c b/src/mpi/pt2pt/bsendutil.c
index 7d8c06f..aa48a8f 100644
--- a/src/mpi/pt2pt/bsendutil.c
+++ b/src/mpi/pt2pt/bsendutil.c
@@ -90,7 +90,7 @@ static void MPIR_Bsend_free_segment( MPIR_Bsend_data_t * );
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bsend_attach
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Bsend_attach( void *buffer, int buffer_size )
 {
     MPIR_Bsend_data_t *p;
@@ -165,7 +165,7 @@ int MPIR_Bsend_attach( void *buffer, int buffer_size )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bsend_detach
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Bsend_detach( void *bufferp, int *size )
 {
     if (BsendBuffer.pending) {
@@ -206,7 +206,7 @@ int MPIR_Bsend_detach( void *bufferp, int *size )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bsend_isend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
                      int dest, int tag, MPID_Comm *comm_ptr,
                      MPIR_Bsend_kind_t kind, MPID_Request **request )
@@ -229,7 +229,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
     /* We check the active buffer first.  This helps avoid storage 
        fragmentation */
     mpi_errno = MPIR_Bsend_check_active();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (dtype != MPI_PACKED)
         MPIR_Pack_size_impl( count, dtype, &packsize );
@@ -261,7 +261,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
             if (dtype != MPI_PACKED)
             {
                 mpi_errno = MPIR_Pack_impl( buf, count, dtype, p->msg.msgbuf, packsize, &p->msg.count);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             else
             {
@@ -273,7 +273,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
 	    mpi_errno = MPID_Isend(msg->msgbuf, msg->count, MPI_PACKED, 
 				   dest, tag, comm_ptr,
 				   MPID_CONTEXT_INTRA_PT2PT, &p->request );
-            MPIU_ERR_CHKINTERNAL(mpi_errno, mpi_errno, "Bsend internal error: isend returned err");
+            MPIR_ERR_CHKINTERNAL(mpi_errno, mpi_errno, "Bsend internal error: isend returned err");
             /* If the error is "request not available", we should 
                put this on the pending list.  This will depend on
                how we signal failure to send. */
@@ -308,7 +308,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
 	   packsize could not be found */
 	MPIU_DBG_MSG(BSEND,TYPICAL,"Could not find space; dumping arena" );
 	MPIU_DBG_STMT(BSEND,TYPICAL,MPIR_Bsend_dump());
-        MPIU_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_BUFFER, "**bufbsend", "**bufbsend %d %d", packsize, BsendBuffer.buffer_size);
+        MPIR_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_BUFFER, "**bufbsend", "**bufbsend %d %d", packsize, BsendBuffer.buffer_size);
     }
     
  fn_exit:
@@ -325,7 +325,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bsend_free_seg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Bsend_free_req_seg( MPID_Request* req )
 {
     int mpi_errno = MPI_ERR_INTERN;
@@ -363,7 +363,7 @@ int MPIR_Bsend_free_req_seg( MPID_Request* req )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bsend_free_segment
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void MPIR_Bsend_free_segment( MPIR_Bsend_data_t *p )
 {
     MPIR_Bsend_data_t *prev = p->prev, *avail = BsendBuffer.avail, *avail_prev;
@@ -457,7 +457,7 @@ static void MPIR_Bsend_free_segment( MPIR_Bsend_data_t *p )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Bsend_check_active
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Bsend_check_active( void )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -481,7 +481,7 @@ static int MPIR_Bsend_check_active( void )
             /* XXX DJG FIXME-MT should we be checking this? */
 	    if (MPIU_Object_get_ref(active->request) == 1) {
 		mpi_errno = MPIR_Test_impl(&r, &flag, MPI_STATUS_IGNORE );
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    } else {
 		/* We need to invoke the progress engine in case we 
 		 need to advance other, incomplete communication.  */
@@ -489,11 +489,11 @@ static int MPIR_Bsend_check_active( void )
 		MPID_Progress_start(&progress_state);
 		mpi_errno = MPID_Progress_test( );
 		MPID_Progress_end(&progress_state);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    }
 	} else {
 	    mpi_errno = MPIR_Test_impl( &r, &flag, MPI_STATUS_IGNORE );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	}
 	if (flag) {
 	    /* We're done.  Remove this segment */
diff --git a/src/mpi/pt2pt/bufattach.c b/src/mpi/pt2pt/bufattach.c
index 3dbf3ea..bbb09dd 100644
--- a/src/mpi/pt2pt/bufattach.c
+++ b/src/mpi/pt2pt/bufattach.c
@@ -82,7 +82,7 @@ int MPI_Buffer_attach(void *buffer, int size)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_BUFFER_ATTACH);
     
 #   ifdef HAVE_ERROR_CHECKING
@@ -104,7 +104,7 @@ int MPI_Buffer_attach(void *buffer, int size)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_BUFFER_ATTACH);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/buffree.c b/src/mpi/pt2pt/buffree.c
index 29ba64e..fa190f9 100644
--- a/src/mpi/pt2pt/buffree.c
+++ b/src/mpi/pt2pt/buffree.c
@@ -99,7 +99,7 @@ int MPI_Buffer_detach(void *buffer_addr, int *size)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_BUFFER_DETACH);
     
 #   ifdef HAVE_ERROR_CHECKING
@@ -121,7 +121,7 @@ int MPI_Buffer_detach(void *buffer_addr, int *size)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_BUFFER_DETACH);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/cancel.c b/src/mpi/pt2pt/cancel.c
index b16c156..8085639 100644
--- a/src/mpi/pt2pt/cancel.c
+++ b/src/mpi/pt2pt/cancel.c
@@ -29,7 +29,7 @@ int MPI_Cancel(MPI_Request *request) __attribute__((weak,alias("PMPI_Cancel")));
 #undef FUNCNAME
 #define FUNCNAME MPIR_Cancel_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Cancel_impl(MPID_Request *request_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -39,14 +39,14 @@ int MPIR_Cancel_impl(MPID_Request *request_ptr)
 	case MPID_REQUEST_SEND:
 	{
 	    mpi_errno = MPID_Cancel_send(request_ptr);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    break;
 	}
 
 	case MPID_REQUEST_RECV:
 	{
 	    mpi_errno = MPID_Cancel_recv(request_ptr);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    break;
 	}
 
@@ -70,7 +70,7 @@ int MPIR_Cancel_impl(MPID_Request *request_ptr)
                      */
 		    request_ptr->cc_ptr = request_ptr->partner_request->cc_ptr;
 		    mpi_errno = MPID_Cancel_send(request_ptr->partner_request);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		} else {
 		    /* This is needed for persistent Bsend requests */
                     /* FIXME why do we directly access the partner request's
@@ -78,10 +78,10 @@ int MPIR_Cancel_impl(MPID_Request *request_ptr)
                      * of the partner req's cc field? */
                     mpi_errno = MPIR_Grequest_cancel(request_ptr->partner_request,
                                                      MPID_cc_is_complete(&request_ptr->partner_request->cc));
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		}
 	    } else {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_REQUEST,"**requestpersistactive");
+		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_REQUEST,"**requestpersistactive");
 	    }
 	    break;
 	}
@@ -90,9 +90,9 @@ int MPIR_Cancel_impl(MPID_Request *request_ptr)
 	{
 	    if (request_ptr->partner_request != NULL) {
 		mpi_errno = MPID_Cancel_recv(request_ptr->partner_request);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    } else {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_REQUEST,"**requestpersistactive");
+		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_REQUEST,"**requestpersistactive");
 	    }
 	    break;
 	}
@@ -100,14 +100,14 @@ int MPIR_Cancel_impl(MPID_Request *request_ptr)
 	case MPID_UREQUEST:
 	{
             mpi_errno = MPIR_Grequest_cancel(request_ptr, MPID_cc_is_complete(&request_ptr->cc));
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    break;
 	}
 
 	/* --BEGIN ERROR HANDLING-- */
 	default:
 	{
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,"**cancelunknown");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,"**cancelunknown");
 	}
 	/* --END ERROR HANDLING-- */
     }
@@ -124,7 +124,7 @@ int MPIR_Cancel_impl(MPID_Request *request_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPI_Cancel
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Cancel - Cancels a communication request
 
@@ -164,7 +164,7 @@ int MPI_Cancel(MPI_Request *request)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_CANCEL);
     
     /* Convert MPI object handles to object pointers */
@@ -192,7 +192,7 @@ int MPI_Cancel(MPI_Request *request)
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_CANCEL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/greq_complete.c b/src/mpi/pt2pt/greq_complete.c
index 8c70240..5bb5dfc 100644
--- a/src/mpi/pt2pt/greq_complete.c
+++ b/src/mpi/pt2pt/greq_complete.c
@@ -32,7 +32,7 @@ int MPI_Grequest_complete(MPI_Request request) __attribute__((weak,alias("PMPI_G
 #undef FUNCNAME
 #define FUNCNAME MPIR_Grequest_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Grequest_complete_impl(MPID_Request *request_ptr)
 {
     /* Set the request as completed.  This does not change the
@@ -48,7 +48,7 @@ void MPIR_Grequest_complete_impl(MPID_Request *request_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPI_Grequest_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Grequest_complete - Notify MPI that a user-defined request is complete
 
@@ -72,7 +72,7 @@ int MPI_Grequest_complete( MPI_Request request )
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GREQUEST_COMPLETE);
     
     /* Validate handle parameters needing to be converted */
@@ -115,7 +115,7 @@ int MPI_Grequest_complete( MPI_Request request )
   fn_exit:
 #endif
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GREQUEST_COMPLETE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/pt2pt/greq_start.c b/src/mpi/pt2pt/greq_start.c
index 23da864..c8d1ecd 100644
--- a/src/mpi/pt2pt/greq_start.c
+++ b/src/mpi/pt2pt/greq_start.c
@@ -73,7 +73,7 @@ PMPI_LOCAL int MPIR_Grequest_free_classes_on_finalize(void *extra_data ATTRIBUTE
 #undef FUNCNAME
 #define FUNCNAME MPIR_Grequest_start
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Grequest_start_impl(MPI_Grequest_query_function *query_fn,
                              MPI_Grequest_free_function *free_fn,
                              MPI_Grequest_cancel_function *cancel_fn,
@@ -85,7 +85,7 @@ int MPIR_Grequest_start_impl(MPI_Grequest_query_function *query_fn,
     /* MT FIXME this routine is not thread-safe in the non-global case */
     
     *request_ptr = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP1(request_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "generalized request");
+    MPIR_ERR_CHKANDJUMP1(request_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "generalized request");
     
     (*request_ptr)->kind                 = MPID_UREQUEST;
     MPIU_Object_set_ref( *request_ptr, 1 );
@@ -126,7 +126,7 @@ extern MPID_Grequest_class *MPIR_Grequest_class_list;
 #undef FUNCNAME
 #define FUNCNAME MPI_Grequest_start
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Grequest_start - Create and return a user-defined request
 
@@ -184,7 +184,7 @@ int MPI_Grequest_start( MPI_Grequest_query_function *query_fn,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GREQUEST_START);
 
     /* Validate parameters if error checking is enabled */
@@ -209,7 +209,7 @@ int MPI_Grequest_start( MPI_Grequest_query_function *query_fn,
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GREQUEST_START);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
@@ -255,7 +255,7 @@ int MPIX_Grequest_class_create(MPI_Grequest_query_function *query_fn,
 #undef FUNCNAME
 #define FUNCNAME MPIX_Grequest_class_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* extensions for Generalized Request redesign paper */
 int MPIX_Grequest_class_create(MPI_Grequest_query_function *query_fn,
 		               MPI_Grequest_free_function *free_fn,
@@ -424,7 +424,7 @@ int MPIX_Grequest_start( MPI_Grequest_query_function *query_fn,
 #undef FUNCNAME
 #define FUNCNAME MPIX_Grequest_start_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIX_Grequest_start_impl( MPI_Grequest_query_function *query_fn,
                               MPI_Grequest_free_function *free_fn,
                               MPI_Grequest_cancel_function *cancel_fn,
diff --git a/src/mpi/pt2pt/ibsend.c b/src/mpi/pt2pt/ibsend.c
index 1696759..0ee0788 100644
--- a/src/mpi/pt2pt/ibsend.c
+++ b/src/mpi/pt2pt/ibsend.c
@@ -53,7 +53,7 @@ PMPI_LOCAL int MPIR_Ibsend_free( void *extra )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibsend_cancel
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 PMPI_LOCAL int MPIR_Ibsend_cancel( void *extra, int complete )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -71,16 +71,16 @@ PMPI_LOCAL int MPIR_Ibsend_cancel( void *extra, int complete )
 
     /* Try to cancel the underlying request */
     mpi_errno = MPIR_Cancel_impl(req);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPIR_Wait_impl( &req_hdl, &status );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIR_Test_cancelled_impl( &status, &ibsend_info->cancelled );
 
     /* If the cancelation is successful, free the memory in the
        attached buffer used by the request */
     if (ibsend_info->cancelled) {
         mpi_errno = MPIR_Bsend_free_req_seg(ibsend_info->req);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
  fn_exit:
     return mpi_errno;
@@ -91,7 +91,7 @@ PMPI_LOCAL int MPIR_Ibsend_cancel( void *extra, int complete )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ibsend_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ibsend_impl(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
                      MPID_Comm *comm_ptr, MPI_Request *request)
 {
@@ -113,7 +113,7 @@ int MPIR_Ibsend_impl(const void *buf, int count, MPI_Datatype datatype, int dest
     ibinfo->cancelled = 0;
     mpi_errno = MPIR_Grequest_start_impl( MPIR_Ibsend_query, MPIR_Ibsend_free,
                                           MPIR_Ibsend_cancel, ibinfo, &new_request_ptr );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     /* The request is immediately complete because the MPIR_Bsend_isend has
        already moved the data out of the user's buffer */
     MPIR_Grequest_complete_impl(new_request_ptr);
@@ -131,7 +131,7 @@ int MPIR_Ibsend_impl(const void *buf, int count, MPI_Datatype datatype, int dest
 #undef FUNCNAME
 #define FUNCNAME MPI_Ibsend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Ibsend - Starts a nonblocking buffered send
 
@@ -169,7 +169,7 @@ int MPI_Ibsend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_IBSEND);
 
     /* Validate handle parameters needing to be converted */
@@ -232,7 +232,7 @@ int MPI_Ibsend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_IBSEND);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/improbe.c b/src/mpi/pt2pt/improbe.c
index 400f2df..e9eb080 100644
--- a/src/mpi/pt2pt/improbe.c
+++ b/src/mpi/pt2pt/improbe.c
@@ -32,7 +32,7 @@ int MPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *mess
 #undef FUNCNAME
 #define FUNCNAME MPI_Improbe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Improbe - Nonblocking matched probe.
 
@@ -59,7 +59,7 @@ int MPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *mess
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IMPROBE);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IMPROBE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -97,7 +97,7 @@ int MPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *mess
 
     *message = MPI_MESSAGE_NULL;
     mpi_errno = MPID_Improbe(source, tag, comm_ptr, MPID_CONTEXT_INTRA_PT2PT, flag, &msgp, status);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (*flag) {
 	if (msgp == NULL) {
@@ -113,7 +113,7 @@ int MPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *mess
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IMPROBE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/pt2pt/imrecv.c b/src/mpi/pt2pt/imrecv.c
index 3fad7c6..60553ed 100644
--- a/src/mpi/pt2pt/imrecv.c
+++ b/src/mpi/pt2pt/imrecv.c
@@ -32,7 +32,7 @@ int MPI_Imrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message
 #undef FUNCNAME
 #define FUNCNAME MPI_Imrecv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Imrecv - Nonblocking receive of message matched by MPI_Mprobe or MPI_Improbe.
 
@@ -60,7 +60,7 @@ int MPI_Imrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message
     MPID_Request *msgp = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_IMRECV);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_IMRECV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -96,8 +96,8 @@ int MPI_Imrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message
             /* MPI_MESSAGE_NO_PROC should yield a "proc null" status */
             if (*message != MPI_MESSAGE_NO_PROC) {
                 MPID_Request_valid_ptr(msgp, mpi_errno);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-                MPIU_ERR_CHKANDJUMP((msgp->kind != MPID_REQUEST_MPROBE),
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+                MPIR_ERR_CHKANDJUMP((msgp->kind != MPID_REQUEST_MPROBE),
                                      mpi_errno, MPI_ERR_ARG, "**reqnotmsg");
             }
 
@@ -111,7 +111,7 @@ int MPI_Imrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message
     /* ... body of routine ...  */
 
     mpi_errno = MPID_Imrecv(buf, count, datatype, msgp, &rreq);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(rreq != NULL);
     *request = rreq->handle;
@@ -121,7 +121,7 @@ int MPI_Imrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_IMRECV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/pt2pt/iprobe.c b/src/mpi/pt2pt/iprobe.c
index 96f74d3..1784b53 100644
--- a/src/mpi/pt2pt/iprobe.c
+++ b/src/mpi/pt2pt/iprobe.c
@@ -64,7 +64,7 @@ int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_IPROBE);
     
     /* Validate handle parameters needing to be converted */
@@ -111,7 +111,7 @@ int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_IPROBE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/irecv.c b/src/mpi/pt2pt/irecv.c
index ab75840..55959ac 100644
--- a/src/mpi/pt2pt/irecv.c
+++ b/src/mpi/pt2pt/irecv.c
@@ -69,7 +69,7 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_BACK(MPID_STATE_MPI_IRECV);
 
     /* Validate handle parameters needing to be converted */
@@ -142,7 +142,7 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT_BACK(MPID_STATE_MPI_IRECV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/irsend.c b/src/mpi/pt2pt/irsend.c
index e2c6f5e..b8b81cd 100644
--- a/src/mpi/pt2pt/irsend.c
+++ b/src/mpi/pt2pt/irsend.c
@@ -70,7 +70,7 @@ int MPI_Irsend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_IRSEND);
 
     /* Validate handle parameters needing to be converted */
@@ -139,7 +139,7 @@ int MPI_Irsend(const void *buf, int count, MPI_Datatype datatype, int dest, int
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_IRSEND);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/isend.c b/src/mpi/pt2pt/isend.c
index cbb6324..33d0c6c 100644
--- a/src/mpi/pt2pt/isend.c
+++ b/src/mpi/pt2pt/isend.c
@@ -31,7 +31,7 @@ int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
 #undef FUNCNAME
 #define FUNCNAME MPI_Isend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Isend - Begins a nonblocking send
 
@@ -68,7 +68,7 @@ int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_ISEND);
 
     /* Validate handle parameters needing to be converted */
@@ -138,7 +138,7 @@ int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_ISEND);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/issend.c b/src/mpi/pt2pt/issend.c
index 642082c..ac8d603 100644
--- a/src/mpi/pt2pt/issend.c
+++ b/src/mpi/pt2pt/issend.c
@@ -69,7 +69,7 @@ int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_ISSEND);
 
     /* Validate handle parameters needing to be converted */
@@ -138,7 +138,7 @@ int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_ISSEND);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/mpir_request.c b/src/mpi/pt2pt/mpir_request.c
index 89bb891..2c0264f 100644
--- a/src/mpi/pt2pt/mpir_request.c
+++ b/src/mpi/pt2pt/mpir_request.c
@@ -12,7 +12,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_Progress_wait_request
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
   MPIR_Progress_wait_request
 
@@ -35,7 +35,7 @@ int MPIR_Progress_wait_request(MPID_Request *req)
             {
                 /* --BEGIN ERROR HANDLING-- */
                 MPID_Progress_end(&progress_state);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 /* --END ERROR HANDLING-- */
             }
         }
@@ -49,7 +49,7 @@ fn_exit:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Request_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* Complete a request, saving the status data if necessary.
    "active" has meaning only if the request is a persistent request; this 
    allows the completion routines to indicate that a persistent request 
@@ -229,7 +229,7 @@ int MPIR_Request_complete(MPI_Request * request, MPID_Request * request_ptr,
 	{
 	    /* --BEGIN ERROR HANDLING-- */
 	    /* This should not happen */
-	    MPIU_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN,;, "**badcase",
+	    MPIR_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN,;, "**badcase",
 		"**badcase %d", request_ptr->kind);
 	    break;
 	    /* --END ERROR HANDLING-- */
@@ -243,7 +243,7 @@ int MPIR_Request_complete(MPI_Request * request, MPID_Request * request_ptr,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Request_get_error
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* FIXME: What is this routine for?
  *  
  * [BRT] it is used by testall, although looking at testall now, I think the
@@ -315,7 +315,7 @@ int MPIR_Request_get_error(MPID_Request * request_ptr)
 		    rc = (request_ptr->greq_fns->query_fn)(
 			request_ptr->greq_fns->grequest_extra_state,
 			&request_ptr->status);
-		    MPIU_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno,
+		    MPIR_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno,
 			MPI_ERR_OTHER,;, "**user", "**userquery %d", rc);
 		    break;
 #ifdef HAVE_FORTRAN_BINDING
@@ -330,7 +330,7 @@ int MPIR_Request_get_error(MPID_Request * request_ptr)
 		    rc = (int) ierr;
 		    if (rc == MPI_SUCCESS)
 			PMPI_Status_f2c( is, &request_ptr->status );
-		    MPIU_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno,
+		    MPIR_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno,
 			MPI_ERR_OTHER,;, "**user", "**userquery %d", rc);
 		    break;
 		}
@@ -340,7 +340,7 @@ int MPIR_Request_get_error(MPID_Request * request_ptr)
 		{
 		    /* --BEGIN ERROR HANDLING-- */
 		    /* This should not happen */
-		    MPIU_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN,;, 
+		    MPIR_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN,;, 
 				 "**badcase", 
 				 "**badcase %d", request_ptr->greq_fns->greq_lang);
 		    break;
@@ -355,7 +355,7 @@ int MPIR_Request_get_error(MPID_Request * request_ptr)
 	{
 	    /* --BEGIN ERROR HANDLING-- */
 	    /* This should not happen */
-	    MPIU_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN,;, "**badcase", 
+	    MPIR_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN,;, "**badcase", 
 				 "**badcase %d", request_ptr->kind);
 	    break;
 	    /* --END ERROR HANDLING-- */
@@ -381,7 +381,7 @@ void MPIR_Grequest_set_lang_f77( MPI_Request greq )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Grequest_cancel
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Grequest_cancel(MPID_Request * request_ptr, int complete)
 {
     int rc;
@@ -395,7 +395,7 @@ int MPIR_Grequest_cancel(MPID_Request * request_ptr, int complete)
 #endif
 	    rc = (request_ptr->greq_fns->cancel_fn)(
 		request_ptr->greq_fns->grequest_extra_state, complete);
-	    MPIU_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno,
+	    MPIR_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno,
 		MPI_ERR_OTHER,;, "**user", "**usercancel %d", rc);
 	    break;
 #ifdef HAVE_FORTRAN_BINDING
@@ -408,7 +408,7 @@ int MPIR_Grequest_cancel(MPID_Request * request_ptr, int complete)
 	    ((MPIR_Grequest_f77_cancel_function *)(request_ptr->greq_fns->cancel_fn))(
 		request_ptr->greq_fns->grequest_extra_state, &icomplete, &ierr);
 	    rc = (int) ierr;
-	    MPIU_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER,
+	    MPIR_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER,
 		{;}, "**user", "**usercancel %d", rc);
 	    break;
 	}
@@ -418,7 +418,7 @@ int MPIR_Grequest_cancel(MPID_Request * request_ptr, int complete)
 	{
 	    /* --BEGIN ERROR HANDLING-- */
 	    /* This should not happen */
-	    MPIU_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN,;, "**badcase",
+	    MPIR_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN,;, "**badcase",
 		"**badcase %d", request_ptr->greq_fns->greq_lang);
 	    break;
 	    /* --END ERROR HANDLING-- */
@@ -432,7 +432,7 @@ int MPIR_Grequest_cancel(MPID_Request * request_ptr, int complete)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Grequest_query
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Grequest_query(MPID_Request * request_ptr)
 {
     int rc;
@@ -446,7 +446,7 @@ int MPIR_Grequest_query(MPID_Request * request_ptr)
 #endif
 	    rc = (request_ptr->greq_fns->query_fn)(request_ptr->greq_fns->grequest_extra_state,
 		&request_ptr->status);
-	    MPIU_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER,
+	    MPIR_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER,
 		{;}, "**user", "**userquery %d", rc);
 	    break;
 #ifdef HAVE_FORTRAN_BINDING
@@ -460,7 +460,7 @@ int MPIR_Grequest_query(MPID_Request * request_ptr)
 	    rc = (int)ierr;
 	    if (rc == MPI_SUCCESS) 
 		PMPI_Status_f2c( is, &request_ptr->status );
-	    MPIU_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER,
+	    MPIR_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER,
 		{;}, "**user", "**userquery %d", rc);
 	}
 	break;
@@ -469,7 +469,7 @@ int MPIR_Grequest_query(MPID_Request * request_ptr)
 	{
 	    /* --BEGIN ERROR HANDLING-- */
 	    /* This should not happen */
-	    MPIU_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN,;, "**badcase",
+	    MPIR_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN,;, "**badcase",
 		"**badcase %d", request_ptr->greq_fns->greq_lang);
 	    break;
 	    /* --END ERROR HANDLING-- */
@@ -483,7 +483,7 @@ int MPIR_Grequest_query(MPID_Request * request_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Grequest_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Grequest_free(MPID_Request * request_ptr)
 {
     int rc;
@@ -496,7 +496,7 @@ int MPIR_Grequest_free(MPID_Request * request_ptr)
 	case MPID_LANG_CXX:
 #endif
 	    rc = (request_ptr->greq_fns->free_fn)(request_ptr->greq_fns->grequest_extra_state);
-	    MPIU_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER,
+	    MPIR_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER,
 		{;}, "**user", "**userfree %d", rc);
 	    break;
 #ifdef HAVE_FORTRAN_BINDING
@@ -508,7 +508,7 @@ int MPIR_Grequest_free(MPID_Request * request_ptr)
 	    ((MPIR_Grequest_f77_free_function *)(request_ptr->greq_fns->free_fn))(
 		request_ptr->greq_fns->grequest_extra_state, &ierr);
 	    rc = (int) ierr;
-	    MPIU_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER,
+	    MPIR_ERR_CHKANDSTMT1((rc != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER,
 		{;}, "**user", "**userfree %d", rc);
 	    break;
 	}
@@ -518,7 +518,7 @@ int MPIR_Grequest_free(MPID_Request * request_ptr)
 	{
 	    /* --BEGIN ERROR HANDLING-- */
 	    /* This should not happen */
-	    MPIU_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN, {;}, "**badcase",
+	    MPIR_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_INTERN, {;}, "**badcase",
 		"**badcase %d", request_ptr->greq_fns->greq_lang);
 	    break;
 	    /* --END ERROR HANDLING-- */
@@ -535,7 +535,7 @@ int MPIR_Grequest_free(MPID_Request * request_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIR_Grequest_progress_poke
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Grequest_progress_poke(int count, 
 		MPID_Request **request_ptrs, 
 		MPI_Status array_of_statuses[] )
@@ -582,7 +582,7 @@ int MPIR_Grequest_progress_poke(int count,
                 request_ptrs[i]->greq_fns->poll_fn != NULL)
             {
 		mpi_errno = (request_ptrs[i]->greq_fns->poll_fn)(request_ptrs[i]->greq_fns->grequest_extra_state, &(array_of_statuses[i]));
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    }
 	}
     }
@@ -599,7 +599,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Grequest_waitall
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Grequest_waitall(int count, MPID_Request * const * request_ptrs)
 {
     void ** state_ptrs;
@@ -647,7 +647,7 @@ int MPIR_Grequest_waitall(int count, MPID_Request * const * request_ptrs)
             /* greq with a new class: wait on the list of greqs we've
                created, then start a new list*/
             mpi_error = (wait_fn)(n_greq, state_ptrs, 0, NULL);
-            if (mpi_error) MPIU_ERR_POP(mpi_error);
+            if (mpi_error) MPIR_ERR_POP(mpi_error);
 
             curr_class = request_ptrs[i]->greq_fns->greq_class;
             wait_fn = request_ptrs[i]->greq_fns->wait_fn;
@@ -660,7 +660,7 @@ int MPIR_Grequest_waitall(int count, MPID_Request * const * request_ptrs)
     {
         /* wait on the last group of greqs */
         mpi_error = (wait_fn)(n_greq, state_ptrs, 0, NULL);
-        if (mpi_error) MPIU_ERR_POP(mpi_error);
+        if (mpi_error) MPIR_ERR_POP(mpi_error);
 
     }
 #else
@@ -676,7 +676,7 @@ int MPIR_Grequest_waitall(int count, MPID_Request * const * request_ptrs)
         }
 
         mpi_error = (request_ptrs[i]->greq_fns->wait_fn)(1, &request_ptrs[i]->greq_fns->grequest_extra_state, 0, NULL);
-        if (mpi_error) MPIU_ERR_POP(mpi_error);
+        if (mpi_error) MPIR_ERR_POP(mpi_error);
         MPIU_Assert(MPID_Request_is_complete(request_ptrs[i]));
     }
 
diff --git a/src/mpi/pt2pt/mprobe.c b/src/mpi/pt2pt/mprobe.c
index e791ef5..e4dde5e 100644
--- a/src/mpi/pt2pt/mprobe.c
+++ b/src/mpi/pt2pt/mprobe.c
@@ -31,7 +31,7 @@ int MPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Sta
 #undef FUNCNAME
 #define FUNCNAME MPI_Mprobe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Mprobe - Blocking matched probe.
 
@@ -57,7 +57,7 @@ int MPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Sta
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_MPROBE);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_MPROBE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -93,7 +93,7 @@ int MPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Sta
 
     *message = MPI_MESSAGE_NULL;
     mpi_errno = MPID_Mprobe(source, tag, comm_ptr, MPID_CONTEXT_INTRA_PT2PT, &msgp, status);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (msgp == NULL) {
 	MPIU_Assert(source == MPI_PROC_NULL);
@@ -107,7 +107,7 @@ int MPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Sta
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_MPROBE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/pt2pt/mrecv.c b/src/mpi/pt2pt/mrecv.c
index 5a2f1b6..1953cbe 100644
--- a/src/mpi/pt2pt/mrecv.c
+++ b/src/mpi/pt2pt/mrecv.c
@@ -32,7 +32,7 @@ int MPI_Mrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message,
 #undef FUNCNAME
 #define FUNCNAME MPI_Mrecv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Mrecv - Blocking receive of message matched by MPI_Mprobe or MPI_Improbe.
 
@@ -59,7 +59,7 @@ int MPI_Mrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message,
     MPID_Request *msgp = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_MRECV);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_MRECV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -95,8 +95,8 @@ int MPI_Mrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message,
             /* MPI_MESSAGE_NO_PROC should yield a "proc null" status */
             if (*message != MPI_MESSAGE_NO_PROC) {
                 MPID_Request_valid_ptr(msgp, mpi_errno);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-                MPIU_ERR_CHKANDJUMP((msgp->kind != MPID_REQUEST_MPROBE),
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+                MPIR_ERR_CHKANDJUMP((msgp->kind != MPID_REQUEST_MPROBE),
                                     mpi_errno, MPI_ERR_ARG, "**reqnotmsg");
             }
 
@@ -109,7 +109,7 @@ int MPI_Mrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message,
     /* ... body of routine ...  */
 
     mpi_errno = MPID_Mrecv(buf, count, datatype, msgp, status);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     *message = MPI_MESSAGE_NULL;
 
@@ -117,7 +117,7 @@ int MPI_Mrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message,
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_MRECV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/pt2pt/probe.c b/src/mpi/pt2pt/probe.c
index 00eaa20..2c18ab1 100644
--- a/src/mpi/pt2pt/probe.c
+++ b/src/mpi/pt2pt/probe.c
@@ -60,7 +60,7 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_PROBE);
     
     /* Validate handle parameters needing to be converted */
@@ -104,7 +104,7 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
 
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_PROBE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/recv.c b/src/mpi/pt2pt/recv.c
index 210548c..8f8df21 100644
--- a/src/mpi/pt2pt/recv.c
+++ b/src/mpi/pt2pt/recv.c
@@ -75,7 +75,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_BACK(MPID_STATE_MPI_RECV);
     
     /* Validate handle parameters needing to be converted */
@@ -170,7 +170,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
                 /* --BEGIN ERROR HANDLING-- */
                 MPID_Cancel_recv(request_ptr);
                 MPIR_STATUS_SET_CANCEL_BIT(request_ptr->status, FALSE);
-                MPIU_ERR_SET(request_ptr->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**proc_failed");
+                MPIR_ERR_SET(request_ptr->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**proc_failed");
                 mpi_errno = request_ptr->status.MPI_ERROR;
                 goto fn_fail;
                 /* --END ERROR HANDLING-- */
@@ -189,7 +189,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT_BACK(MPID_STATE_MPI_RECV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/recv_init.c b/src/mpi/pt2pt/recv_init.c
index 3f16c60..bb1d561 100644
--- a/src/mpi/pt2pt/recv_init.c
+++ b/src/mpi/pt2pt/recv_init.c
@@ -71,7 +71,7 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_RECV_INIT);
 
     /* Validate handle parameters needing to be converted */
@@ -136,7 +136,7 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_RECV_INIT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/request_free.c b/src/mpi/pt2pt/request_free.c
index cbc9c74..d85fd06 100644
--- a/src/mpi/pt2pt/request_free.c
+++ b/src/mpi/pt2pt/request_free.c
@@ -72,7 +72,7 @@ int MPI_Request_free(MPI_Request *request)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_REQUEST_FREE);
     
     /* Validate handle parameters needing to be converted */
@@ -174,7 +174,7 @@ int MPI_Request_free(MPI_Request *request)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_REQUEST_FREE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/request_get_status.c b/src/mpi/pt2pt/request_get_status.c
index 4712ebf..07269e8 100644
--- a/src/mpi/pt2pt/request_get_status.c
+++ b/src/mpi/pt2pt/request_get_status.c
@@ -62,7 +62,7 @@ int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_REQUEST_GET_STATUS);
 
     /* Check the arguments */
@@ -246,7 +246,7 @@ int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status)
     
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_REQUEST_GET_STATUS);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/rsend.c b/src/mpi/pt2pt/rsend.c
index eaf6f09..12f4736 100644
--- a/src/mpi/pt2pt/rsend.c
+++ b/src/mpi/pt2pt/rsend.c
@@ -66,7 +66,7 @@ int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_RSEND);
     
     /* Validate handle parameters needing to be converted */
@@ -158,7 +158,7 @@ int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_RSEND);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/rsend_init.c b/src/mpi/pt2pt/rsend_init.c
index f39284d..8e5e851 100644
--- a/src/mpi/pt2pt/rsend_init.c
+++ b/src/mpi/pt2pt/rsend_init.c
@@ -71,7 +71,7 @@ int MPI_Rsend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_RSEND_INIT);
     
     /* Validate handle parameters needing to be converted */
@@ -136,7 +136,7 @@ int MPI_Rsend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_RSEND_INIT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/send.c b/src/mpi/pt2pt/send.c
index 77dc0fe..7098471 100644
--- a/src/mpi/pt2pt/send.c
+++ b/src/mpi/pt2pt/send.c
@@ -71,7 +71,7 @@ int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int ta
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_SEND);
     
     /* Validate handle parameters needing to be converted */
@@ -163,7 +163,7 @@ int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int ta
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_SEND);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/send_init.c b/src/mpi/pt2pt/send_init.c
index c20b136..49eaa5a 100644
--- a/src/mpi/pt2pt/send_init.c
+++ b/src/mpi/pt2pt/send_init.c
@@ -71,7 +71,7 @@ int MPI_Send_init(const void *buf, int count, MPI_Datatype datatype, int dest,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_SEND_INIT);
     
     /* Validate handle parameters needing to be converted */
@@ -137,7 +137,7 @@ int MPI_Send_init(const void *buf, int count, MPI_Datatype datatype, int dest,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_SEND_INIT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/sendrecv.c b/src/mpi/pt2pt/sendrecv.c
index 44a2c2a..652320a 100644
--- a/src/mpi/pt2pt/sendrecv.c
+++ b/src/mpi/pt2pt/sendrecv.c
@@ -82,7 +82,7 @@ int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_BOTH(MPID_STATE_MPI_SENDRECV);
     
     /* Validate handle parameters needing to be converted */
@@ -197,7 +197,7 @@ int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                 /* --BEGIN ERROR HANDLING-- */
                 MPID_Cancel_recv(rreq);
                 MPIR_STATUS_SET_CANCEL_BIT(rreq->status, FALSE);
-                MPIU_ERR_SET(rreq->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**proc_failed");
+                MPIR_ERR_SET(rreq->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**proc_failed");
                 mpi_errno = rreq->status.MPI_ERROR;
                 if (!MPID_Request_is_complete(sreq)) {
                     MPID_Cancel_send(sreq);
@@ -226,7 +226,7 @@ int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT_BOTH(MPID_STATE_MPI_SENDRECV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/sendrecv_rep.c b/src/mpi/pt2pt/sendrecv_rep.c
index 3c48c9d..972ab47 100644
--- a/src/mpi/pt2pt/sendrecv_rep.c
+++ b/src/mpi/pt2pt/sendrecv_rep.c
@@ -81,7 +81,7 @@ int MPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
     
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_BOTH(MPID_STATE_MPI_SENDRECV_REPLACE);
 
     /* Convert handles to MPI objects. */
@@ -220,7 +220,7 @@ int MPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_PT2PT_FUNC_EXIT_BOTH(MPID_STATE_MPI_SENDRECV_REPLACE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/ssend.c b/src/mpi/pt2pt/ssend.c
index 60dd92e..c17a02b 100644
--- a/src/mpi/pt2pt/ssend.c
+++ b/src/mpi/pt2pt/ssend.c
@@ -65,7 +65,7 @@ int MPI_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_SSEND);
     
     /* Validate handle parameters needing to be converted */
@@ -130,7 +130,7 @@ int MPI_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
     /* If a request was returned, then we need to block until the request 
        is complete */
     mpi_errno = MPIR_Progress_wait_request(request_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = request_ptr->status.MPI_ERROR;
     MPID_Request_release(request_ptr);
@@ -141,7 +141,7 @@ int MPI_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_SSEND);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/ssend_init.c b/src/mpi/pt2pt/ssend_init.c
index 2b30a47..10d86be 100644
--- a/src/mpi/pt2pt/ssend_init.c
+++ b/src/mpi/pt2pt/ssend_init.c
@@ -68,7 +68,7 @@ int MPI_Ssend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_SSEND_INIT);
     
     /* Validate handle parameters needing to be converted */
@@ -133,7 +133,7 @@ int MPI_Ssend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_SSEND_INIT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/start.c b/src/mpi/pt2pt/start.c
index 0ff9a9c..8efdb3d 100644
--- a/src/mpi/pt2pt/start.c
+++ b/src/mpi/pt2pt/start.c
@@ -54,7 +54,7 @@ int MPI_Start(MPI_Request *request)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_START);
 
     /* Validate handle parameters needing to be converted */
@@ -95,7 +95,7 @@ int MPI_Start(MPI_Request *request)
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_START);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/startall.c b/src/mpi/pt2pt/startall.c
index 27b9148..b1de944 100644
--- a/src/mpi/pt2pt/startall.c
+++ b/src/mpi/pt2pt/startall.c
@@ -70,7 +70,7 @@ int MPI_Startall(int count, MPI_Request array_of_requests[])
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_STARTALL);
 
     /* Validate handle parameters needing to be converted */
@@ -132,7 +132,7 @@ int MPI_Startall(int count, MPI_Request array_of_requests[])
     }
 
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_STARTALL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/test.c b/src/mpi/pt2pt/test.c
index dbecd57..18cf606 100644
--- a/src/mpi/pt2pt/test.c
+++ b/src/mpi/pt2pt/test.c
@@ -28,7 +28,7 @@ int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status) __attribute__(
 #undef FUNCNAME
 #define FUNCNAME MPIR_Test_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Test_impl(MPI_Request *request, int *flag, MPI_Status *status)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -57,20 +57,20 @@ int MPIR_Test_impl(MPI_Request *request, int *flag, MPI_Status *status)
         request_ptr->greq_fns->poll_fn != NULL)
     {
         mpi_errno = (request_ptr->greq_fns->poll_fn)(request_ptr->greq_fns->grequest_extra_state, status);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     if (MPID_Request_is_complete(request_ptr)) {
 	mpi_errno = MPIR_Request_complete(request, request_ptr, status,
 					  &active_flag);
 	*flag = TRUE;
-	if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+	if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* Fall through to the exit */
     } else if (unlikely(
                 MPIR_CVAR_ENABLE_FT &&
                 MPID_Request_is_anysource(request_ptr) &&
                 !MPID_Comm_AS_enabled(request_ptr->comm))) {
-        MPIU_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
+        MPIR_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
         if (status != MPI_STATUS_IGNORE) status->MPI_ERROR = mpi_errno;
         goto fn_fail;
     }
@@ -85,7 +85,7 @@ int MPIR_Test_impl(MPI_Request *request, int *flag, MPI_Status *status)
 #undef FUNCNAME
 #define FUNCNAME MPI_Test
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Test  - Tests for the completion of a request
 
@@ -117,7 +117,7 @@ int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_TEST);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -163,7 +163,7 @@ int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status)
     
   fn_exit:
 	MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_TEST);
-	MPIU_THREAD_CS_EXIT(ALLFUNC,);
+	MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 	return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/pt2pt/test_cancelled.c b/src/mpi/pt2pt/test_cancelled.c
index f73a474..de502b8 100644
--- a/src/mpi/pt2pt/test_cancelled.c
+++ b/src/mpi/pt2pt/test_cancelled.c
@@ -30,7 +30,7 @@ int MPI_Test_cancelled(const MPI_Status *status, int *flag) __attribute__((weak,
 #undef FUNCNAME
 #define FUNCNAME MPI_Test_cancelled
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
   MPI_Test_cancelled - Tests to see if a request was cancelled
 
diff --git a/src/mpi/pt2pt/testall.c b/src/mpi/pt2pt/testall.c
index dccc138..99699d2 100644
--- a/src/mpi/pt2pt/testall.c
+++ b/src/mpi/pt2pt/testall.c
@@ -34,7 +34,7 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Testall_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Testall_impl(int count, MPI_Request array_of_requests[], int *flag,
                       MPI_Status array_of_statuses[])
 {
@@ -111,7 +111,7 @@ int MPIR_Testall_impl(int count, MPI_Request array_of_requests[], int *flag,
                         !MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
             {
                 mpi_errno = MPI_ERR_IN_STATUS;
-                MPIU_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
+                MPIR_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
                 status_ptr = (array_of_statuses != MPI_STATUSES_IGNORE) ? &array_of_statuses[i] : MPI_STATUS_IGNORE;
                 if (status_ptr != MPI_STATUS_IGNORE) status_ptr->MPI_ERROR = rc;
                 proc_failure = TRUE;
@@ -187,7 +187,7 @@ int MPIR_Testall_impl(int count, MPI_Request array_of_requests[], int *flag,
 #undef FUNCNAME
 #define FUNCNAME MPI_Testall
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Testall - Tests for the completion of all previously initiated
     requests
@@ -238,7 +238,7 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_TESTALL);
 
     /* Check the arguments */
@@ -273,7 +273,7 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
   fn_exit:
     
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_TESTALL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/testany.c b/src/mpi/pt2pt/testany.c
index a7bfe9e..17e51a7 100644
--- a/src/mpi/pt2pt/testany.c
+++ b/src/mpi/pt2pt/testany.c
@@ -80,7 +80,7 @@ int MPI_Testany(int count, MPI_Request array_of_requests[], int *indx,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_TESTANY);
 
     /* Check the arguments */
@@ -199,7 +199,7 @@ int MPI_Testany(int count, MPI_Request array_of_requests[], int *indx,
      * pending failure. */
     if (unlikely(last_disabled_anysource != -1))
     {
-        MPIU_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
+        MPIR_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
         if (status != MPI_STATUS_IGNORE) status->MPI_ERROR = mpi_errno;
         *flag = TRUE;
         goto fn_fail;
@@ -221,7 +221,7 @@ int MPI_Testany(int count, MPI_Request array_of_requests[], int *indx,
     }
 
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_TESTANY);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/testsome.c b/src/mpi/pt2pt/testsome.c
index c157820..95ceadf 100644
--- a/src/mpi/pt2pt/testsome.c
+++ b/src/mpi/pt2pt/testsome.c
@@ -84,7 +84,7 @@ int MPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_TESTSOME);
 
     /* Check the arguments */
@@ -203,7 +203,7 @@ int MPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount,
                         !MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
             {
                 mpi_errno = MPI_ERR_IN_STATUS;
-                MPIU_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
+                MPIR_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
                 status_ptr = (array_of_statuses != MPI_STATUSES_IGNORE) ? &array_of_statuses[i] : MPI_STATUS_IGNORE;
                 if (status_ptr != MPI_STATUS_IGNORE) status_ptr->MPI_ERROR = rc;
             }
@@ -244,7 +244,7 @@ int MPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount,
     }
 
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_TESTSOME);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/pt2pt/wait.c b/src/mpi/pt2pt/wait.c
index 6773c82..64f7520 100644
--- a/src/mpi/pt2pt/wait.c
+++ b/src/mpi/pt2pt/wait.c
@@ -27,7 +27,7 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status) __attribute__((weak,alias
 #undef FUNCNAME
 #define FUNCNAME MPIR_Wait_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -67,7 +67,7 @@ int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status)
 		if (mpi_errno) {
 		    /* --BEGIN ERROR HANDLING-- */
 		    MPID_Progress_end(&progress_state);
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                     /* --END ERROR HANDLING-- */
 		}
 		continue; /* treating UREQUEST like normal request means we'll
@@ -78,7 +78,7 @@ int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status)
 	    if (mpi_errno) {
 		/* --BEGIN ERROR HANDLING-- */
 		MPID_Progress_end(&progress_state);
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 		/* --END ERROR HANDLING-- */
 	    }
 
@@ -88,7 +88,7 @@ int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status)
                         !MPID_Request_is_complete(request_ptr) &&
                         !MPID_Comm_AS_enabled(request_ptr->comm))) {
                 MPID_Progress_end(&progress_state);
-                MPIU_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
+                MPIR_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
                 if (status != MPI_STATUS_IGNORE) status->MPI_ERROR = mpi_errno;
                 goto fn_fail;
             }
@@ -97,7 +97,7 @@ int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status)
     }
 
     mpi_errno = MPIR_Request_complete(request, request_ptr, status, &active_flag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
  fn_exit:
     return mpi_errno;
@@ -110,7 +110,7 @@ int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status)
 #undef FUNCNAME
 #define FUNCNAME MPI_Wait
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Wait - Waits for an MPI request to complete
 
@@ -142,7 +142,7 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_WAIT);
 
     /* Check the arguments */
@@ -193,7 +193,7 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status)
     
   fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_WAIT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 	
   fn_fail:
diff --git a/src/mpi/pt2pt/waitall.c b/src/mpi/pt2pt/waitall.c
index 15096e1..a89dd6e 100644
--- a/src/mpi/pt2pt/waitall.c
+++ b/src/mpi/pt2pt/waitall.c
@@ -41,7 +41,7 @@ int MPI_Waitall(int count, MPI_Request array_of_requests[], MPI_Status array_of_
 #undef FUNCNAME
 #define FUNCNAME request_complete_fastpath
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int request_complete_fastpath(MPI_Request *request, MPID_Request *request_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -66,7 +66,7 @@ static inline int request_complete_fastpath(MPI_Request *request, MPID_Request *
 #undef FUNCNAME
 #define FUNCNAME MPIR_Waitall_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
                       MPI_Status array_of_statuses[])
 {
@@ -105,8 +105,8 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
 		MPID_BEGIN_ERROR_CHECKS;
 		{
 		    MPID_Request_valid_ptr( request_ptrs[i], mpi_errno );
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-                    MPIU_ERR_CHKANDJUMP1((request_ptrs[i]->kind == MPID_REQUEST_MPROBE),
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+                    MPIR_ERR_CHKANDJUMP1((request_ptrs[i]->kind == MPID_REQUEST_MPROBE),
                                          mpi_errno, MPI_ERR_ARG, "**msgnotreq", "**msgnotreq %d", i);
 		}
 		MPID_END_ERROR_CHECKS;
@@ -170,15 +170,15 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
                                 MPID_Request_is_anysource(request_ptrs[i]) &&
                                 !MPID_Request_is_complete(request_ptrs[i]) &&
                                 !MPID_Comm_AS_enabled(request_ptrs[i]->comm))) {
-                        MPIU_ERR_SET(mpi_errno, MPI_ERR_IN_STATUS, "**instatus");
+                        MPIR_ERR_SET(mpi_errno, MPI_ERR_IN_STATUS, "**instatus");
                     }
                     MPID_Progress_end(&progress_state);
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                     /* --END ERROR HANDLING-- */
                 }
             }
             mpi_errno = request_complete_fastpath(&array_of_requests[i], request_ptrs[i]);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         MPID_Progress_end(&progress_state);
@@ -194,7 +194,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
     if (n_greqs)
     {
         mpi_errno = MPIR_Grequest_waitall(count, request_ptrs);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
     MPID_Progress_start(&progress_state);
@@ -218,7 +218,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
             if (mpi_errno != MPI_SUCCESS) {
                 /* --BEGIN ERROR HANDLING-- */
                 MPID_Progress_end(&progress_state);
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
                 /* --END ERROR HANDLING-- */
             } else if (unlikely(MPIR_CVAR_ENABLE_FT &&
                         MPID_Request_is_anysource(request_ptrs[i]) &&
@@ -226,7 +226,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
                         !MPID_Comm_AS_enabled(request_ptrs[i]->comm))) {
                 /* Check for pending failures */
                 MPID_Progress_end(&progress_state);
-                MPIU_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
+                MPIR_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
                 status_ptr = (ignoring_statuses) ? MPI_STATUS_IGNORE : &array_of_statuses[i];
                 if (status_ptr != MPI_STATUS_IGNORE) status_ptr->MPI_ERROR = mpi_errno;
                 proc_failure = TRUE;
@@ -249,7 +249,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
         else
         {
             /* req completed with an error */
-            MPIU_ERR_SET(mpi_errno, MPI_ERR_IN_STATUS, "**instatus");
+            MPIR_ERR_SET(mpi_errno, MPI_ERR_IN_STATUS, "**instatus");
 
             if (!proc_failure) {
                 if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(rc))
@@ -302,7 +302,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
 #undef FUNCNAME
 #define FUNCNAME MPI_Waitall
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
     MPI_Waitall - Waits for all given MPI Requests to complete
 
@@ -347,7 +347,7 @@ int MPI_Waitall(int count, MPI_Request array_of_requests[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_WAITALL);
 
     /* Check the arguments */
@@ -382,7 +382,7 @@ int MPI_Waitall(int count, MPI_Request array_of_requests[],
     
  fn_exit:
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_WAITALL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
  fn_fail:
diff --git a/src/mpi/pt2pt/waitany.c b/src/mpi/pt2pt/waitany.c
index 7653f51..16d1259 100644
--- a/src/mpi/pt2pt/waitany.c
+++ b/src/mpi/pt2pt/waitany.c
@@ -84,7 +84,7 @@ int MPI_Waitany(int count, MPI_Request array_of_requests[], int *indx,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_WAITANY);
 
     /* Check the arguments */
@@ -206,7 +206,7 @@ int MPI_Waitany(int count, MPI_Request array_of_requests[], int *indx,
          * as pending failure and break out. */
         if (unlikely(last_disabled_anysource != -1))
         {
-            MPIU_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
+            MPIR_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
             if (status != MPI_STATUS_IGNORE) status->MPI_ERROR = mpi_errno;
             goto fn_progress_end_fail;
         }
@@ -226,7 +226,7 @@ int MPI_Waitany(int count, MPI_Request array_of_requests[], int *indx,
     }
 
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_WAITANY);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_progress_end_fail:
diff --git a/src/mpi/pt2pt/waitsome.c b/src/mpi/pt2pt/waitsome.c
index d1465f8..c80d1eb 100644
--- a/src/mpi/pt2pt/waitsome.c
+++ b/src/mpi/pt2pt/waitsome.c
@@ -103,7 +103,7 @@ int MPI_Waitsome(int incount, MPI_Request array_of_requests[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_PT2PT_FUNC_ENTER(MPID_STATE_MPI_WAITSOME);
 
     /* Check the arguments */
@@ -244,7 +244,7 @@ int MPI_Waitsome(int incount, MPI_Request array_of_requests[],
                             !MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
                 {
                     mpi_errno = MPI_ERR_IN_STATUS;
-                    MPIU_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
+                    MPIR_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
                     status_ptr = (array_of_statuses != MPI_STATUSES_IGNORE) ? &array_of_statuses[n_active] : MPI_STATUS_IGNORE;
                     if (status_ptr != MPI_STATUS_IGNORE) status_ptr->MPI_ERROR = rc;
                 }
@@ -297,7 +297,7 @@ int MPI_Waitsome(int incount, MPI_Request array_of_requests[],
     }
 
     MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_WAITSOME);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/accumulate.c b/src/mpi/rma/accumulate.c
index c9521e4..d711f4a 100644
--- a/src/mpi/rma/accumulate.c
+++ b/src/mpi/rma/accumulate.c
@@ -77,7 +77,7 @@ int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_ACCUMULATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -155,7 +155,7 @@ int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_ACCUMULATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/alloc_mem.c b/src/mpi/rma/alloc_mem.c
index b68ee5a..d6179ec 100644
--- a/src/mpi/rma/alloc_mem.c
+++ b/src/mpi/rma/alloc_mem.c
@@ -70,7 +70,7 @@ int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_ALLOC_MEM);
     
 #   ifdef HAVE_ERROR_CHECKING
@@ -106,7 +106,7 @@ int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_ALLOC_MEM);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/compare_and_swap.c b/src/mpi/rma/compare_and_swap.c
index 5b134d2..f694811 100644
--- a/src/mpi/rma/compare_and_swap.c
+++ b/src/mpi/rma/compare_and_swap.c
@@ -83,7 +83,7 @@ int MPI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_COMPARE_AND_SWAP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -143,7 +143,7 @@ int MPI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_COMPARE_AND_SWAP);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/fetch_and_op.c b/src/mpi/rma/fetch_and_op.c
index cdb2765..f128f76 100644
--- a/src/mpi/rma/fetch_and_op.c
+++ b/src/mpi/rma/fetch_and_op.c
@@ -88,7 +88,7 @@ int MPI_Fetch_and_op(const void *origin_addr, void *result_addr,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_FETCH_AND_OP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -127,7 +127,7 @@ int MPI_Fetch_and_op(const void *origin_addr, void *result_addr,
 
             if (!MPIR_DATATYPE_IS_PREDEFINED(datatype))
             {
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_TYPE, "**typenotpredefined");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_TYPE, "**typenotpredefined");
             }
 
             if (win_ptr->create_flavor != MPI_WIN_FLAVOR_DYNAMIC)
@@ -140,7 +140,7 @@ int MPI_Fetch_and_op(const void *origin_addr, void *result_addr,
 
             if (HANDLE_GET_KIND(op) != HANDLE_KIND_BUILTIN)
             {
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OP, "**opnotpredefined");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OP, "**opnotpredefined");
             }
         }
         MPID_END_ERROR_CHECKS;
@@ -159,7 +159,7 @@ int MPI_Fetch_and_op(const void *origin_addr, void *result_addr,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_FETCH_AND_OP);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/free_mem.c b/src/mpi/rma/free_mem.c
index 313da39..cde79bb 100644
--- a/src/mpi/rma/free_mem.c
+++ b/src/mpi/rma/free_mem.c
@@ -52,7 +52,7 @@ int MPI_Free_mem(void *base)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_FREE_MEM);
 
     /* ... body of routine ...  */
@@ -66,7 +66,7 @@ int MPI_Free_mem(void *base)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_FREE_MEM);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/get.c b/src/mpi/rma/get.c
index 438de38..c5e5f5c 100644
--- a/src/mpi/rma/get.c
+++ b/src/mpi/rma/get.c
@@ -72,7 +72,7 @@ int MPI_Get(void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_GET);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -148,7 +148,7 @@ int MPI_Get(void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_GET);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/get_accumulate.c b/src/mpi/rma/get_accumulate.c
index 0489d59..b541bfe 100644
--- a/src/mpi/rma/get_accumulate.c
+++ b/src/mpi/rma/get_accumulate.c
@@ -108,7 +108,7 @@ int MPI_Get_accumulate(const void *origin_addr, int origin_count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_GET_ACCUMULATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -209,7 +209,7 @@ int MPI_Get_accumulate(const void *origin_addr, int origin_count,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_GET_ACCUMULATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/put.c b/src/mpi/rma/put.c
index e5511cc..7f58379 100644
--- a/src/mpi/rma/put.c
+++ b/src/mpi/rma/put.c
@@ -72,7 +72,7 @@ int MPI_Put(const void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_PUT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -148,7 +148,7 @@ int MPI_Put(const void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_PUT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/raccumulate.c b/src/mpi/rma/raccumulate.c
index c861c70..d8fd28d 100644
--- a/src/mpi/rma/raccumulate.c
+++ b/src/mpi/rma/raccumulate.c
@@ -91,7 +91,7 @@ int MPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_RACCUMULATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -172,7 +172,7 @@ int MPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_RACCUMULATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/rget.c b/src/mpi/rma/rget.c
index edf092e..cf5470e 100644
--- a/src/mpi/rma/rget.c
+++ b/src/mpi/rma/rget.c
@@ -86,7 +86,7 @@ int MPI_Rget(void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_RGET);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -165,7 +165,7 @@ int MPI_Rget(void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_RGET);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/rget_accumulate.c b/src/mpi/rma/rget_accumulate.c
index 28a592c..514556b 100644
--- a/src/mpi/rma/rget_accumulate.c
+++ b/src/mpi/rma/rget_accumulate.c
@@ -101,7 +101,7 @@ int MPI_Rget_accumulate(const void *origin_addr, int origin_count,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_RGET_ACCUMULATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -201,7 +201,7 @@ int MPI_Rget_accumulate(const void *origin_addr, int origin_count,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_RGET_ACCUMULATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/rmatypeutil.c b/src/mpi/rma/rmatypeutil.c
index 1b05a54..1bd81ea 100644
--- a/src/mpi/rma/rmatypeutil.c
+++ b/src/mpi/rma/rmatypeutil.c
@@ -19,7 +19,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIR_Sched_cb_free_buf
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Type_is_rma_atomic(MPI_Datatype type)
 {
     switch (type) {
@@ -49,7 +49,7 @@ int MPIR_Type_is_rma_atomic(MPI_Datatype type)
 #undef FUNCNAME
 #define FUNCNAME MPIR_COMPARE_EQUAL
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Compare_equal(const void *a, const void *b, MPI_Datatype type)
 {
     switch (type) {
diff --git a/src/mpi/rma/rput.c b/src/mpi/rma/rput.c
index fd4393e..166812a 100644
--- a/src/mpi/rma/rput.c
+++ b/src/mpi/rma/rput.c
@@ -88,7 +88,7 @@ int MPI_Rput(const void *origin_addr, int origin_count, MPI_Datatype
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_RPUT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -167,7 +167,7 @@ int MPI_Rput(const void *origin_addr, int origin_count, MPI_Datatype
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_RPUT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_allocate.c b/src/mpi/rma/win_allocate.c
index 82348f5..2cc2914 100644
--- a/src/mpi/rma/win_allocate.c
+++ b/src/mpi/rma/win_allocate.c
@@ -80,7 +80,7 @@ int MPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_ALLOCATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -153,7 +153,7 @@ int MPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_ALLOCATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_allocate_shared.c b/src/mpi/rma/win_allocate_shared.c
index 8da1b5d..edc18fd 100644
--- a/src/mpi/rma/win_allocate_shared.c
+++ b/src/mpi/rma/win_allocate_shared.c
@@ -31,7 +31,7 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Com
 #undef FUNCNAME
 #define FUNCNAME MPI_Win_allocate_shared
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 MPI_Win_allocate_shared - Create an MPI Window object for one-sided
@@ -90,7 +90,7 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Com
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_ALLOCATE_SHARED);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -119,13 +119,13 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Com
 	    MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
             if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
-            MPIU_ERR_CHKANDJUMP1(disp_unit <= 0, mpi_errno, MPI_ERR_ARG,
+            MPIR_ERR_CHKANDJUMP1(disp_unit <= 0, mpi_errno, MPI_ERR_ARG,
                                  "**arg", "**arg %s", "disp_unit must be positive");
 
-            MPIU_ERR_CHKANDJUMP1(size < 0, mpi_errno, MPI_ERR_SIZE,
+            MPIR_ERR_CHKANDJUMP1(size < 0, mpi_errno, MPI_ERR_SIZE,
                                  "**rmasize", "**rmasize %d", size);
 
-            MPIU_ERR_CHKANDJUMP1(size > 0 && baseptr == NULL, mpi_errno, MPI_ERR_ARG,
+            MPIR_ERR_CHKANDJUMP1(size > 0 && baseptr == NULL, mpi_errno, MPI_ERR_ARG,
                                  "**nullptr", "**nullptr %s",
                                  "NULL base pointer is invalid when size is nonzero");
 
@@ -151,7 +151,7 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Com
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_ALLOCATE_SHARED);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_attach.c b/src/mpi/rma/win_attach.c
index ffad72f..2e545a2 100644
--- a/src/mpi/rma/win_attach.c
+++ b/src/mpi/rma/win_attach.c
@@ -69,7 +69,7 @@ int MPI_Win_attach(MPI_Win win, void *base, MPI_Aint size)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_ATTACH);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -127,7 +127,7 @@ int MPI_Win_attach(MPI_Win win, void *base, MPI_Aint size)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_ATTACH);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_complete.c b/src/mpi/rma/win_complete.c
index 95e8f7b..9dd42d2 100644
--- a/src/mpi/rma/win_complete.c
+++ b/src/mpi/rma/win_complete.c
@@ -54,7 +54,7 @@ int MPI_Win_complete(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_COMPLETE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -94,7 +94,7 @@ int MPI_Win_complete(MPI_Win win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_COMPLETE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_create.c b/src/mpi/rma/win_create.c
index 96e84b9..9b3d921 100644
--- a/src/mpi/rma/win_create.c
+++ b/src/mpi/rma/win_create.c
@@ -108,7 +108,7 @@ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_CREATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -181,7 +181,7 @@ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_CREATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_create_dynamic.c b/src/mpi/rma/win_create_dynamic.c
index 2acf081..a88ab4a 100644
--- a/src/mpi/rma/win_create_dynamic.c
+++ b/src/mpi/rma/win_create_dynamic.c
@@ -96,7 +96,7 @@ int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_CREATE_DYNAMIC);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -145,7 +145,7 @@ int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_CREATE_DYNAMIC);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_detach.c b/src/mpi/rma/win_detach.c
index 0cf90e3..fc87847 100644
--- a/src/mpi/rma/win_detach.c
+++ b/src/mpi/rma/win_detach.c
@@ -68,7 +68,7 @@ int MPI_Win_detach(MPI_Win win, const void *base)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_DETACH);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -109,7 +109,7 @@ int MPI_Win_detach(MPI_Win win, const void *base)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_DETACH);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_fence.c b/src/mpi/rma/win_fence.c
index bfff382..c238012 100644
--- a/src/mpi/rma/win_fence.c
+++ b/src/mpi/rma/win_fence.c
@@ -72,7 +72,7 @@ int MPI_Win_fence(int assert, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_FENCE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -115,7 +115,7 @@ int MPI_Win_fence(int assert, MPI_Win win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_FENCE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_flush.c b/src/mpi/rma/win_flush.c
index 2fa6e67..cdcf825 100644
--- a/src/mpi/rma/win_flush.c
+++ b/src/mpi/rma/win_flush.c
@@ -63,7 +63,7 @@ int MPI_Win_flush(int rank, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_FLUSH);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -110,7 +110,7 @@ int MPI_Win_flush(int rank, MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_FLUSH);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_flush_all.c b/src/mpi/rma/win_flush_all.c
index e5aedac..5403a47 100644
--- a/src/mpi/rma/win_flush_all.c
+++ b/src/mpi/rma/win_flush_all.c
@@ -62,7 +62,7 @@ int MPI_Win_flush_all(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_FLUSH_ALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -104,7 +104,7 @@ int MPI_Win_flush_all(MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_FLUSH_ALL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_flush_local.c b/src/mpi/rma/win_flush_local.c
index 7a63b2c..f04dc70 100644
--- a/src/mpi/rma/win_flush_local.c
+++ b/src/mpi/rma/win_flush_local.c
@@ -65,7 +65,7 @@ int MPI_Win_flush_local(int rank, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_FLUSH_LOCAL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -112,7 +112,7 @@ int MPI_Win_flush_local(int rank, MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_FLUSH_LOCAL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_flush_local_all.c b/src/mpi/rma/win_flush_local_all.c
index 829e216..133558e 100644
--- a/src/mpi/rma/win_flush_local_all.c
+++ b/src/mpi/rma/win_flush_local_all.c
@@ -61,7 +61,7 @@ int MPI_Win_flush_local_all(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_FLUSH_LOCAL_ALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -102,7 +102,7 @@ int MPI_Win_flush_local_all(MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_FLUSH_LOCAL_ALL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_free.c b/src/mpi/rma/win_free.c
index b96be5a..3630cf3 100644
--- a/src/mpi/rma/win_free.c
+++ b/src/mpi/rma/win_free.c
@@ -57,7 +57,7 @@ int MPI_Win_free(MPI_Win *win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_FREE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -106,7 +106,6 @@ int MPI_Win_free(MPI_Win *win)
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
     /* We need to release the error handler */
-    /* no MPI_OBJ CS is needed here */
     if (win_ptr->errhandler && 
 	! (HANDLE_GET_KIND(win_ptr->errhandler->handle) == 
 	   HANDLE_KIND_BUILTIN) ) {
@@ -125,7 +124,7 @@ int MPI_Win_free(MPI_Win *win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_FREE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_get_group.c b/src/mpi/rma/win_get_group.c
index 5db66d5..83d8e46 100644
--- a/src/mpi/rma/win_get_group.c
+++ b/src/mpi/rma/win_get_group.c
@@ -66,7 +66,7 @@ int MPI_Win_get_group(MPI_Win win, MPI_Group *group)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_GET_GROUP);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -110,7 +110,7 @@ int MPI_Win_get_group(MPI_Win win, MPI_Group *group)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_GET_GROUP);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_get_info.c b/src/mpi/rma/win_get_info.c
index 31cb305..d5a5ffa 100644
--- a/src/mpi/rma/win_get_info.c
+++ b/src/mpi/rma/win_get_info.c
@@ -76,7 +76,7 @@ int MPI_Win_get_info(MPI_Win win, MPI_Info *info_used)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_GET_INFO);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Win_get_info(MPI_Win win, MPI_Info *info_used)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_GET_INFO);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_lock.c b/src/mpi/rma/win_lock.c
index 4cc647d..bbea9ac 100644
--- a/src/mpi/rma/win_lock.c
+++ b/src/mpi/rma/win_lock.c
@@ -82,7 +82,7 @@ int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_LOCK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -112,14 +112,14 @@ int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win)
             if (mpi_errno) goto fn_fail;
 	    
 	    if (assert != 0 && assert != MPI_MODE_NOCHECK) {
-		MPIU_ERR_SET1(mpi_errno,MPI_ERR_ARG,
+		MPIR_ERR_SET1(mpi_errno,MPI_ERR_ARG,
 			      "**lockassertval", 
 			      "**lockassertval %d", assert );
 		if (mpi_errno) goto fn_fail;
 	    }
             if (lock_type != MPI_LOCK_SHARED && 
 		lock_type != MPI_LOCK_EXCLUSIVE) {
-		MPIU_ERR_SET(mpi_errno,MPI_ERR_OTHER, "**locktype" );
+		MPIR_ERR_SET(mpi_errno,MPI_ERR_OTHER, "**locktype" );
                 if (mpi_errno) goto fn_fail;
 	    }
 
@@ -143,7 +143,7 @@ int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_LOCK);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_lock_all.c b/src/mpi/rma/win_lock_all.c
index c50b5c2..471018e 100644
--- a/src/mpi/rma/win_lock_all.c
+++ b/src/mpi/rma/win_lock_all.c
@@ -86,7 +86,7 @@ int MPI_Win_lock_all(int assert, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_LOCK_ALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -113,7 +113,7 @@ int MPI_Win_lock_all(int assert, MPI_Win win)
             if (mpi_errno) goto fn_fail;
             
             if (assert != 0 && assert != MPI_MODE_NOCHECK) {
-                MPIU_ERR_SET1(mpi_errno,MPI_ERR_ARG,
+                MPIR_ERR_SET1(mpi_errno,MPI_ERR_ARG,
                               "**lockassertval", 
                               "**lockassertval %d", assert );
                 if (mpi_errno) goto fn_fail;
@@ -137,7 +137,7 @@ int MPI_Win_lock_all(int assert, MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_LOCK_ALL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_post.c b/src/mpi/rma/win_post.c
index c89cd7f..4d0d176 100644
--- a/src/mpi/rma/win_post.c
+++ b/src/mpi/rma/win_post.c
@@ -71,7 +71,7 @@ int MPI_Win_post(MPI_Group group, int assert, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_POST);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Win_post(MPI_Group group, int assert, MPI_Win win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_POST);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_set_info.c b/src/mpi/rma/win_set_info.c
index bab6f18..eedc5e4 100644
--- a/src/mpi/rma/win_set_info.c
+++ b/src/mpi/rma/win_set_info.c
@@ -73,7 +73,7 @@ int MPI_Win_set_info(MPI_Win win, MPI_Info info)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_SET_INFO);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -117,7 +117,7 @@ int MPI_Win_set_info(MPI_Win win, MPI_Info info)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_SET_INFO);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_shared_query.c b/src/mpi/rma/win_shared_query.c
index a7140b0..03ecfb5 100644
--- a/src/mpi/rma/win_shared_query.c
+++ b/src/mpi/rma/win_shared_query.c
@@ -80,7 +80,7 @@ int MPI_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size, int *disp_unit,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_SHARED_QUERY);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -129,7 +129,7 @@ int MPI_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size, int *disp_unit,
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_SHARED_QUERY);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_start.c b/src/mpi/rma/win_start.c
index 373cfab..84ff952 100644
--- a/src/mpi/rma/win_start.c
+++ b/src/mpi/rma/win_start.c
@@ -72,7 +72,7 @@ int MPI_Win_start(MPI_Group group, int assert, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_START);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -119,7 +119,7 @@ int MPI_Win_start(MPI_Group group, int assert, MPI_Win win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_START);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_sync.c b/src/mpi/rma/win_sync.c
index 1719a18..6762dc1 100644
--- a/src/mpi/rma/win_sync.c
+++ b/src/mpi/rma/win_sync.c
@@ -64,7 +64,7 @@ int MPI_Win_sync(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_SYNC);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -104,7 +104,7 @@ int MPI_Win_sync(MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_SYNC);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_test.c b/src/mpi/rma/win_test.c
index 804e02a..4f9c256 100644
--- a/src/mpi/rma/win_test.c
+++ b/src/mpi/rma/win_test.c
@@ -63,7 +63,7 @@ int MPI_Win_test(MPI_Win win, int *flag)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_TEST);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -105,7 +105,7 @@ int MPI_Win_test(MPI_Win win, int *flag)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_TEST);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_unlock.c b/src/mpi/rma/win_unlock.c
index cbfa6f8..fba5778 100644
--- a/src/mpi/rma/win_unlock.c
+++ b/src/mpi/rma/win_unlock.c
@@ -58,7 +58,7 @@ int MPI_Win_unlock(int rank, MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_UNLOCK);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -105,7 +105,7 @@ int MPI_Win_unlock(int rank, MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_UNLOCK);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_unlock_all.c b/src/mpi/rma/win_unlock_all.c
index a4bc0f8..c396f87 100644
--- a/src/mpi/rma/win_unlock_all.c
+++ b/src/mpi/rma/win_unlock_all.c
@@ -65,7 +65,7 @@ int MPI_Win_unlock_all(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_UNLOCK_ALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -107,7 +107,7 @@ int MPI_Win_unlock_all(MPI_Win win)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_UNLOCK_ALL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/rma/win_wait.c b/src/mpi/rma/win_wait.c
index c51dcf5..8d49f5f 100644
--- a/src/mpi/rma/win_wait.c
+++ b/src/mpi/rma/win_wait.c
@@ -54,7 +54,7 @@ int MPI_Win_wait(MPI_Win win)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_RMA_FUNC_ENTER(MPID_STATE_MPI_WIN_WAIT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -95,7 +95,7 @@ int MPI_Win_wait(MPI_Win win)
 
   fn_exit:
     MPID_MPI_RMA_FUNC_EXIT(MPID_STATE_MPI_WIN_WAIT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/romio/adio/common/ad_iread_coll.c b/src/mpi/romio/adio/common/ad_iread_coll.c
index 0ec9dc1..20c7308 100644
--- a/src/mpi/romio/adio/common/ad_iread_coll.c
+++ b/src/mpi/romio/adio/common/ad_iread_coll.c
@@ -1336,7 +1336,7 @@ static int ADIOI_GEN_irc_wait_fn(int count, void **array_of_states,
 
             /* If the progress engine is blocked, we have to yield for another
                thread to be able to unblock the progress engine. */
-            MPIU_THREAD_CS_YIELD(ALLFUNC,_if_progress_blocked);
+            MPID_THREAD_CS_YIELD(GLOBAL,_if_progress_blocked);
         }
     }
 
diff --git a/src/mpi/romio/adio/common/ad_iwrite_coll.c b/src/mpi/romio/adio/common/ad_iwrite_coll.c
index 83da6ef..b4e0fc4 100644
--- a/src/mpi/romio/adio/common/ad_iwrite_coll.c
+++ b/src/mpi/romio/adio/common/ad_iwrite_coll.c
@@ -1561,7 +1561,7 @@ static int ADIOI_GEN_iwc_wait_fn(int count, void **array_of_states,
 
             /* If the progress engine is blocked, we have to yield for another
                thread to be able to unblock the progress engine. */
-            MPIU_THREAD_CS_YIELD(ALLFUNC,_if_progress_blocked);
+            MPID_THREAD_CS_YIELD(GLOBAL,_if_progress_blocked);
         }
     }
 
diff --git a/src/mpi/romio/mpi-io/close.c b/src/mpi/romio/mpi-io/close.c
index 520f206..ddc2a99 100644
--- a/src/mpi/romio/mpi-io/close.c
+++ b/src/mpi/romio/mpi-io/close.c
@@ -44,7 +44,7 @@ int MPI_File_close(MPI_File *fh)
     HPMP_IO_WSTART(fl_xmpi, BLKMPIFILECLOSE, TRDTBLOCK, *adio_fh);
 #endif /* MPI_hpux */
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(*fh);
 
@@ -90,7 +90,7 @@ int MPI_File_close(MPI_File *fh)
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/romio/mpi-io/delete.c b/src/mpi/romio/mpi-io/delete.c
index 7335136..414d270 100644
--- a/src/mpi/romio/mpi-io/delete.c
+++ b/src/mpi/romio/mpi-io/delete.c
@@ -48,7 +48,7 @@ int MPI_File_delete(ROMIO_CONST char *filename, MPI_Info info)
 
     MPIU_UNREFERENCED_ARG(info);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     MPIR_MPIOInit(&error_code);
     if (error_code != MPI_SUCCESS) goto fn_exit;
@@ -90,6 +90,6 @@ int MPI_File_delete(ROMIO_CONST char *filename, MPI_Info info)
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/fsync.c b/src/mpi/romio/mpi-io/fsync.c
index 0e4f1b9..021d01a 100644
--- a/src/mpi/romio/mpi-io/fsync.c
+++ b/src/mpi/romio/mpi-io/fsync.c
@@ -45,7 +45,7 @@ int MPI_File_sync(MPI_File fh)
     HPMP_IO_START(fl_xmpi, BLKMPIFILESYNC, TRDTBLOCK, adio_fh,
 		  MPI_DATATYPE_NULL, -1);
 #endif /* MPI_hpux */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
     /* --BEGIN ERROR HANDLING-- */
@@ -71,6 +71,6 @@ int MPI_File_sync(MPI_File fh)
 #endif /* MPI_hpux */
  
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/get_errh.c b/src/mpi/romio/mpi-io/get_errh.c
index 5a4d9ee..304ac68 100644
--- a/src/mpi/romio/mpi-io/get_errh.c
+++ b/src/mpi/romio/mpi-io/get_errh.c
@@ -44,7 +44,7 @@ int MPI_File_get_errhandler(MPI_File mpi_fh, MPI_Errhandler *errhandler)
     static char myname[] = "MPI_FILE_GET_ERRHANDLER";
     MPIU_THREADPRIV_DECL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     if (mpi_fh == MPI_FILE_NULL) {
 	*errhandler = ADIOI_DFLT_ERR_HANDLER;
@@ -66,6 +66,6 @@ int MPI_File_get_errhandler(MPI_File mpi_fh, MPI_Errhandler *errhandler)
     }
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/mpi-io/get_group.c b/src/mpi/romio/mpi-io/get_group.c
index 4d82ed8..cf8ade0 100644
--- a/src/mpi/romio/mpi-io/get_group.c
+++ b/src/mpi/romio/mpi-io/get_group.c
@@ -43,7 +43,7 @@ int MPI_File_get_group(MPI_File fh, MPI_Group *group)
     ADIO_File adio_fh;
     static char myname[] = "MPI_FILE_GET_GROUP";
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -59,6 +59,6 @@ int MPI_File_get_group(MPI_File fh, MPI_Group *group)
     error_code = MPI_Comm_group(adio_fh->comm, group);
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/get_info.c b/src/mpi/romio/mpi-io/get_info.c
index 1d0b397..65b737f 100644
--- a/src/mpi/romio/mpi-io/get_info.c
+++ b/src/mpi/romio/mpi-io/get_info.c
@@ -42,7 +42,7 @@ int MPI_File_get_info(MPI_File fh, MPI_Info *info_used)
     ADIO_File adio_fh;
     static char myname[] = "MPI_FILE_GET_INFO";
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -57,6 +57,6 @@ int MPI_File_get_info(MPI_File fh, MPI_Info *info_used)
     /* --END ERROR HANDLING-- */
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return  error_code;
 }
diff --git a/src/mpi/romio/mpi-io/get_view.c b/src/mpi/romio/mpi-io/get_view.c
index f2d2889..5d8672d 100644
--- a/src/mpi/romio/mpi-io/get_view.c
+++ b/src/mpi/romio/mpi-io/get_view.c
@@ -52,7 +52,7 @@ int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype,
     int i, j, k, combiner;
     MPI_Datatype copy_etype, copy_filetype;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -96,7 +96,7 @@ int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype,
     }
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/mpi-io/ioreq_c2f.c b/src/mpi/romio/mpi-io/ioreq_c2f.c
index 30f4b95..6791b94 100644
--- a/src/mpi/romio/mpi-io/ioreq_c2f.c
+++ b/src/mpi/romio/mpi-io/ioreq_c2f.c
@@ -49,14 +49,14 @@ MPI_Fint MPIO_Request_c2f(MPIO_Request request)
     int i;
     MPIU_THREADPRIV_DECL;
 
-    /* We can make this test outside of the ALLFUNC mutex because it does
+    /* We can make this test outside of the GLOBAL mutex because it does
        not access any shared data */
     if ((request <= (MPIO_Request) 0) || (request->cookie != ADIOI_REQ_COOKIE))
     {
 	    return (MPI_Fint) 0;
     }
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     if (!ADIOI_Reqtable) {
 	ADIOI_Reqtable_max = 1024;
 	ADIOI_Reqtable = (MPIO_Request *)
@@ -75,7 +75,7 @@ MPI_Fint MPIO_Request_c2f(MPIO_Request request)
     ADIOI_Reqtable_ptr++;
     ADIOI_Reqtable[ADIOI_Reqtable_ptr] = request;
 
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return (MPI_Fint) ADIOI_Reqtable_ptr;
 #endif
 }
diff --git a/src/mpi/romio/mpi-io/ioreq_f2c.c b/src/mpi/romio/mpi-io/ioreq_f2c.c
index 339f34f..a264cda 100644
--- a/src/mpi/romio/mpi-io/ioreq_f2c.c
+++ b/src/mpi/romio/mpi-io/ioreq_f2c.c
@@ -49,7 +49,7 @@ MPIO_Request MPIO_Request_f2c(MPI_Fint request)
     return (MPIO_Request) request;
 #else
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     
     if (!request) {
 	return MPIO_REQUEST_NULL;
@@ -65,7 +65,7 @@ MPIO_Request MPIO_Request_f2c(MPI_Fint request)
     /* --END ERROR HANDLING-- */
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return ADIOI_Reqtable[request];
 #endif
 }
diff --git a/src/mpi/romio/mpi-io/iotest.c b/src/mpi/romio/mpi-io/iotest.c
index 9ca273d..d85fb94 100644
--- a/src/mpi/romio/mpi-io/iotest.c
+++ b/src/mpi/romio/mpi-io/iotest.c
@@ -56,7 +56,7 @@ int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status)
     }
 #endif /* MPI_hpux */
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     if (*request == MPIO_REQUEST_NULL) {
 	    error_code = MPI_SUCCESS;
@@ -89,7 +89,7 @@ int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status)
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 }
 #endif
diff --git a/src/mpi/romio/mpi-io/iotestall.c b/src/mpi/romio/mpi-io/iotestall.c
index d88aeb7..5572061 100644
--- a/src/mpi/romio/mpi-io/iotestall.c
+++ b/src/mpi/romio/mpi-io/iotestall.c
@@ -34,7 +34,7 @@ int MPIO_Testall(int count, MPIO_Request requests[], int *flag,
     int done, i, err; 
     MPIU_THREADPRIV_DECL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     if (count == 1)  {
 	    err = MPIO_Test( requests, flag, statuses );
 	    goto fn_exit;
@@ -71,7 +71,7 @@ int MPIO_Testall(int count, MPIO_Request requests[], int *flag,
 
     err = MPI_SUCCESS;
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return err;
 }
 
diff --git a/src/mpi/romio/mpi-io/iotestany.c b/src/mpi/romio/mpi-io/iotestany.c
index 56c1a5e..e7d12df 100644
--- a/src/mpi/romio/mpi-io/iotestany.c
+++ b/src/mpi/romio/mpi-io/iotestany.c
@@ -34,7 +34,7 @@ int MPIO_Testany(int count, MPIO_Request requests[], int *index,
     int i, err; 
     MPIU_THREADPRIV_DECL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     if (count == 1) {
 	err = MPIO_Test( requests, flag, status );
@@ -76,6 +76,6 @@ int MPIO_Testany(int count, MPIO_Request requests[], int *index,
 
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return err;
 }
diff --git a/src/mpi/romio/mpi-io/iotestsome.c b/src/mpi/romio/mpi-io/iotestsome.c
index 994376a..c9395a9 100644
--- a/src/mpi/romio/mpi-io/iotestsome.c
+++ b/src/mpi/romio/mpi-io/iotestsome.c
@@ -35,7 +35,7 @@ int MPIO_Testsome(int count, MPIO_Request requests[], int *outcount,
     int flag;
     MPIU_THREADPRIV_DECL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     if (count == 1) {
 	err = MPIO_Test( requests, &flag, statuses );
@@ -81,6 +81,6 @@ int MPIO_Testsome(int count, MPIO_Request requests[], int *outcount,
 
 fn_exit:
 
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return err;
 }
diff --git a/src/mpi/romio/mpi-io/iowait.c b/src/mpi/romio/mpi-io/iowait.c
index 4b592bf..0b8220d 100644
--- a/src/mpi/romio/mpi-io/iowait.c
+++ b/src/mpi/romio/mpi-io/iowait.c
@@ -56,7 +56,7 @@ int MPIO_Wait(MPIO_Request *request, MPI_Status *status)
     }
 #endif /* MPI_hpux */
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     if (*request == MPIO_REQUEST_NULL) {
 	    error_code = MPI_SUCCESS;
@@ -90,7 +90,7 @@ int MPIO_Wait(MPIO_Request *request, MPI_Status *status)
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 }
 #endif
diff --git a/src/mpi/romio/mpi-io/iowaitall.c b/src/mpi/romio/mpi-io/iowaitall.c
index 84c15cd..b03208b 100644
--- a/src/mpi/romio/mpi-io/iowaitall.c
+++ b/src/mpi/romio/mpi-io/iowaitall.c
@@ -33,7 +33,7 @@ int MPIO_Waitall( int count, MPIO_Request requests[], MPI_Status statuses[] )
     int notdone, i, flag, err; 
     MPIU_THREADPRIV_DECL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     if (count == 1)  {
 	    err = MPIO_Wait(requests, statuses);
@@ -68,7 +68,7 @@ int MPIO_Waitall( int count, MPIO_Request requests[], MPI_Status statuses[] )
     err = MPI_SUCCESS;
 fn_exit:
 
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return err;
 }
 
diff --git a/src/mpi/romio/mpi-io/iowaitany.c b/src/mpi/romio/mpi-io/iowaitany.c
index 1f4779e..84fa2b6 100644
--- a/src/mpi/romio/mpi-io/iowaitany.c
+++ b/src/mpi/romio/mpi-io/iowaitany.c
@@ -34,7 +34,7 @@ int MPIO_Waitany(int count, MPIO_Request requests[], int *index,
     int i, flag, err; 
     MPIU_THREADPRIV_DECL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     if (count == 1) {
 	err = MPIO_Wait( requests, status );
@@ -78,7 +78,7 @@ int MPIO_Waitany(int count, MPIO_Request requests[], int *index,
     } while (flag == 0);
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return err;
 }
diff --git a/src/mpi/romio/mpi-io/iowaitsome.c b/src/mpi/romio/mpi-io/iowaitsome.c
index 8b899f5..7145fb9 100644
--- a/src/mpi/romio/mpi-io/iowaitsome.c
+++ b/src/mpi/romio/mpi-io/iowaitsome.c
@@ -34,7 +34,7 @@ int MPIO_Waitsome(int count, MPIO_Request requests[], int *outcount,
     int i, flag, err; 
     MPIU_THREADPRIV_DECL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     if (count == 1) {
 	err = MPIO_Wait( requests, statuses );
@@ -76,6 +76,6 @@ int MPIO_Waitsome(int count, MPIO_Request requests[], int *outcount,
     } while (*outcount == 0);
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return err;
 }
diff --git a/src/mpi/romio/mpi-io/iread.c b/src/mpi/romio/mpi-io/iread.c
index beca4aa..4779dd1 100644
--- a/src/mpi/romio/mpi-io/iread.c
+++ b/src/mpi/romio/mpi-io/iread.c
@@ -83,7 +83,7 @@ int MPIOI_File_iread(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *bu
     ADIO_Offset off, bufsize;
     MPI_Offset nbytes=0;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -154,7 +154,7 @@ int MPIOI_File_iread(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *bu
 			   offset, request, &error_code); 
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/iread_all.c b/src/mpi/romio/mpi-io/iread_all.c
index 4aa980b..5cd8b60 100644
--- a/src/mpi/romio/mpi-io/iread_all.c
+++ b/src/mpi/romio/mpi-io/iread_all.c
@@ -89,7 +89,7 @@ int MPIOI_File_iread_all(MPI_File fh,
     ADIO_File adio_fh;
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -142,7 +142,7 @@ int MPIOI_File_iread_all(MPI_File fh,
     }
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/iread_sh.c b/src/mpi/romio/mpi-io/iread_sh.c
index b671346..7e76fb3 100644
--- a/src/mpi/romio/mpi-io/iread_sh.c
+++ b/src/mpi/romio/mpi-io/iread_sh.c
@@ -55,7 +55,7 @@ int MPI_File_iread_shared(MPI_File fh, void *buf, int count,
     ADIO_Offset off, shared_fp;
     MPI_Offset nbytes=0;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -134,7 +134,7 @@ int MPI_File_iread_shared(MPI_File fh, void *buf, int count,
     /* --END ERROR HANDLING-- */
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 }
 #endif
diff --git a/src/mpi/romio/mpi-io/iwrite.c b/src/mpi/romio/mpi-io/iwrite.c
index cd4f69f..5d8eb84 100644
--- a/src/mpi/romio/mpi-io/iwrite.c
+++ b/src/mpi/romio/mpi-io/iwrite.c
@@ -90,7 +90,7 @@ int MPIOI_File_iwrite(MPI_File fh,
     ADIO_File adio_fh;
     MPI_Offset nbytes=0;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     adio_fh = MPIO_File_resolve(fh);
 
     /* --BEGIN ERROR HANDLING-- */
@@ -162,7 +162,7 @@ int MPIOI_File_iwrite(MPI_File fh,
 			   offset, request, &error_code);
     }
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 }
 #endif
diff --git a/src/mpi/romio/mpi-io/iwrite_all.c b/src/mpi/romio/mpi-io/iwrite_all.c
index 81de3b5..3c36867 100644
--- a/src/mpi/romio/mpi-io/iwrite_all.c
+++ b/src/mpi/romio/mpi-io/iwrite_all.c
@@ -84,7 +84,7 @@ int MPIOI_File_iwrite_all(MPI_File fh,
     void *e32buf=NULL;
     const void *xbuf=NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -131,7 +131,7 @@ int MPIOI_File_iwrite_all(MPI_File fh,
 
 fn_exit:
     if (e32buf != NULL) ADIOI_Free(e32buf);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/iwrite_sh.c b/src/mpi/romio/mpi-io/iwrite_sh.c
index c436221..eff87c8 100644
--- a/src/mpi/romio/mpi-io/iwrite_sh.c
+++ b/src/mpi/romio/mpi-io/iwrite_sh.c
@@ -55,7 +55,7 @@ int MPI_File_iwrite_shared(MPI_File fh, ROMIO_CONST void *buf, int count,
     ADIO_Offset off, shared_fp;
     static char myname[] = "MPI_FILE_IWRITE_SHARED";
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -114,7 +114,7 @@ int MPI_File_iwrite_shared(MPI_File fh, ROMIO_CONST void *buf, int count,
 			   shared_fp, request, &error_code); 
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/mpioimpl.h b/src/mpi/romio/mpi-io/mpioimpl.h
index 1cb92bf..ee186ac 100644
--- a/src/mpi/romio/mpi-io/mpioimpl.h
+++ b/src/mpi/romio/mpi-io/mpioimpl.h
@@ -18,12 +18,12 @@
 #ifdef ROMIO_INSIDE_MPICH
 #include "glue_romio.h"
 
-#define MPIU_THREAD_CS_ENTER(name_,ctx_) MPIU_THREAD_CS_ENTER_##name_(ctx_)
-#define MPIU_THREAD_CS_EXIT(name_,ctx_)  MPIU_THREAD_CS_EXIT_##name_(ctx_)
-#define MPIU_THREAD_CS_YIELD(name_,ctx_) MPIU_THREAD_CS_YIELD_##name_(ctx_)
-#define MPIU_THREAD_CS_ENTER_ALLFUNC(ctx_) MPIR_Ext_cs_enter_allfunc()
-#define MPIU_THREAD_CS_EXIT_ALLFUNC(ctx_) MPIR_Ext_cs_exit_allfunc()
-#define MPIU_THREAD_CS_YIELD_ALLFUNC(ctx_) MPIR_Ext_cs_yield_allfunc##ctx_()
+#define MPID_THREAD_CS_ENTER(name_,ctx_) MPID_THREAD_CS_ENTER_##name_(ctx_)
+#define MPID_THREAD_CS_EXIT(name_,ctx_)  MPID_THREAD_CS_EXIT_##name_(ctx_)
+#define MPID_THREAD_CS_YIELD(name_,ctx_) MPID_THREAD_CS_YIELD_##name_(ctx_)
+#define MPID_THREAD_CS_ENTER_GLOBAL(ctx_) MPIR_Ext_cs_enter_global()
+#define MPID_THREAD_CS_EXIT_GLOBAL(ctx_) MPIR_Ext_cs_exit_global()
+#define MPID_THREAD_CS_YIELD_GLOBAL(ctx_) MPIR_Ext_cs_yield_global##ctx_()
 
 /* committed datatype checking support in ROMIO */
 #define MPIO_DATATYPE_ISCOMMITTED(dtype_, err_)        \
@@ -36,9 +36,9 @@
    error reporting features provided by MPICH must implement these 
    four functions.  Defining these as empty should not change the behavior 
    of correct programs */
-#define MPIU_THREAD_CS_ENTER(x,y)
-#define MPIU_THREAD_CS_EXIT(x,y)
-#define MPIU_THREAD_CS_YIELD(x,y)
+#define MPID_THREAD_CS_ENTER(x,y)
+#define MPID_THREAD_CS_EXIT(x,y)
+#define MPID_THREAD_CS_YIELD(x,y)
 #define MPIO_DATATYPE_ISCOMMITTED(dtype_, err_) do {} while (0)
 #ifdef HAVE_WINDOWS_H
 #define MPIU_UNREFERENCED_ARG(a) a
diff --git a/src/mpi/romio/mpi-io/open.c b/src/mpi/romio/mpi-io/open.c
index a2a68c9..45b7fd9 100644
--- a/src/mpi/romio/mpi-io/open.c
+++ b/src/mpi/romio/mpi-io/open.c
@@ -59,7 +59,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode,
     HPMP_IO_OPEN_START(fl_xmpi, comm);
 #endif /* MPI_hpux */
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     /* --BEGIN ERROR HANDLING-- */
     MPIO_CHECK_COMM(comm, myname, error_code);
@@ -198,7 +198,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode,
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/romio/mpi-io/prealloc.c b/src/mpi/romio/mpi-io/prealloc.c
index 3853f8d..8784049 100644
--- a/src/mpi/romio/mpi-io/prealloc.c
+++ b/src/mpi/romio/mpi-io/prealloc.c
@@ -48,7 +48,7 @@ int MPI_File_preallocate(MPI_File fh, MPI_Offset size)
 		  adio_fh, MPI_DATATYPE_NULL, -1);
 #endif /* MPI_hpux */
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -99,7 +99,7 @@ int MPI_File_preallocate(MPI_File fh, MPI_Offset size)
 
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     /* TODO: bcast result? */
     if (!mynod) return error_code;
diff --git a/src/mpi/romio/mpi-io/read.c b/src/mpi/romio/mpi-io/read.c
index ff109bd..adbdf97 100644
--- a/src/mpi/romio/mpi-io/read.c
+++ b/src/mpi/romio/mpi-io/read.c
@@ -79,7 +79,7 @@ int MPIOI_File_read(MPI_File fh,
     ADIO_Offset off, bufsize;
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -180,7 +180,7 @@ int MPIOI_File_read(MPI_File fh,
     }
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_all.c b/src/mpi/romio/mpi-io/read_all.c
index 72ea518..babd719 100644
--- a/src/mpi/romio/mpi-io/read_all.c
+++ b/src/mpi/romio/mpi-io/read_all.c
@@ -80,7 +80,7 @@ int MPIOI_File_read_all(MPI_File fh,
     ADIO_File adio_fh;
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -135,7 +135,7 @@ int MPIOI_File_read_all(MPI_File fh,
     }
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_allb.c b/src/mpi/romio/mpi-io/read_allb.c
index 3f0fd90..80c79a4 100644
--- a/src/mpi/romio/mpi-io/read_allb.c
+++ b/src/mpi/romio/mpi-io/read_allb.c
@@ -67,7 +67,7 @@ int MPIOI_File_read_all_begin(MPI_File fh,
     ADIO_File adio_fh;
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -132,7 +132,7 @@ int MPIOI_File_read_all_begin(MPI_File fh,
     }
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_alle.c b/src/mpi/romio/mpi-io/read_alle.c
index a86c465..7cb5ef0 100644
--- a/src/mpi/romio/mpi-io/read_alle.c
+++ b/src/mpi/romio/mpi-io/read_alle.c
@@ -60,7 +60,7 @@ int MPIOI_File_read_all_end(MPI_File fh,
 
     MPIU_UNREFERENCED_ARG(buf);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -83,7 +83,7 @@ int MPIOI_File_read_all_end(MPI_File fh,
     adio_fh->split_coll_count = 0;
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_ord.c b/src/mpi/romio/mpi-io/read_ord.c
index 5bfe77c..dd6aede 100644
--- a/src/mpi/romio/mpi-io/read_ord.c
+++ b/src/mpi/romio/mpi-io/read_ord.c
@@ -53,7 +53,7 @@ int MPI_File_read_ordered(MPI_File fh, void *buf, int count,
     ADIO_Offset shared_fp=0;
     ADIO_File adio_fh;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -104,7 +104,7 @@ int MPI_File_read_ordered(MPI_File fh, void *buf, int count,
     /* --END ERROR HANDLING-- */
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     /* FIXME: Check for error code from ReadStridedColl? */
     return error_code;
diff --git a/src/mpi/romio/mpi-io/read_ordb.c b/src/mpi/romio/mpi-io/read_ordb.c
index 32971f1..488d038 100644
--- a/src/mpi/romio/mpi-io/read_ordb.c
+++ b/src/mpi/romio/mpi-io/read_ordb.c
@@ -50,7 +50,7 @@ int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count,
     static char myname[] = "MPI_FILE_READ_ORDERED_BEGIN";
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -131,7 +131,7 @@ int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count,
     }
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_orde.c b/src/mpi/romio/mpi-io/read_orde.c
index 5bf853e..5220cdc 100644
--- a/src/mpi/romio/mpi-io/read_orde.c
+++ b/src/mpi/romio/mpi-io/read_orde.c
@@ -45,7 +45,7 @@ int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status)
 
     MPIU_UNREFERENCED_ARG(buf);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -69,7 +69,7 @@ int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status)
     adio_fh->split_coll_count = 0;
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/read_sh.c b/src/mpi/romio/mpi-io/read_sh.c
index 8f2ed6d..4040739 100644
--- a/src/mpi/romio/mpi-io/read_sh.c
+++ b/src/mpi/romio/mpi-io/read_sh.c
@@ -52,7 +52,7 @@ int MPI_File_read_shared(MPI_File fh, void *buf, int count,
     ADIO_File adio_fh;
     void *xbuf=NULL, *e32_buf=NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -149,7 +149,7 @@ int MPI_File_read_shared(MPI_File fh, void *buf, int count,
 	ADIOI_Free(e32_buf);
     }
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/register_datarep.c b/src/mpi/romio/mpi-io/register_datarep.c
index b6f1d68..3029f5d 100644
--- a/src/mpi/romio/mpi-io/register_datarep.c
+++ b/src/mpi/romio/mpi-io/register_datarep.c
@@ -62,7 +62,7 @@ int MPI_Register_datarep(ROMIO_CONST char *datarep,
     ADIOI_Datarep *adio_datarep;
     static char myname[] = "MPI_REGISTER_DATAREP";
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     /* --BEGIN ERROR HANDLING-- */
     /* check datarep name (use strlen instead of strnlen because
@@ -139,7 +139,7 @@ int MPI_Register_datarep(ROMIO_CONST char *datarep,
     error_code = MPI_SUCCESS;
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/seek.c b/src/mpi/romio/mpi-io/seek.c
index c4ed20f..0b1b057 100644
--- a/src/mpi/romio/mpi-io/seek.c
+++ b/src/mpi/romio/mpi-io/seek.c
@@ -49,7 +49,7 @@ int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence)
     HPMP_IO_START(fl_xmpi, BLKMPIFILESEEK, TRDTBLOCK, adio_fh, MPI_DATATYPE_NULL, -1);
 #endif /* MPI_hpux */
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -134,6 +134,6 @@ int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence)
     error_code = MPI_SUCCESS;
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/seek_sh.c b/src/mpi/romio/mpi-io/seek_sh.c
index 772852c..ea49fad 100644
--- a/src/mpi/romio/mpi-io/seek_sh.c
+++ b/src/mpi/romio/mpi-io/seek_sh.c
@@ -41,7 +41,7 @@ int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence)
     MPI_Offset curr_offset, eof_offset, tmp_offset;
     ADIO_File adio_fh;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -178,7 +178,7 @@ int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence)
     error_code = MPI_SUCCESS;
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/set_atom.c b/src/mpi/romio/mpi-io/set_atom.c
index 2012116..0e60ba7 100644
--- a/src/mpi/romio/mpi-io/set_atom.c
+++ b/src/mpi/romio/mpi-io/set_atom.c
@@ -41,7 +41,7 @@ int MPI_File_set_atomicity(MPI_File fh, int flag)
     ADIO_Fcntl_t *fcntl_struct;
     ADIO_File adio_fh;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -86,6 +86,6 @@ int MPI_File_set_atomicity(MPI_File fh, int flag)
     ADIOI_Free(fcntl_struct);
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/set_errh.c b/src/mpi/romio/mpi-io/set_errh.c
index 793f480..07641ed 100644
--- a/src/mpi/romio/mpi-io/set_errh.c
+++ b/src/mpi/romio/mpi-io/set_errh.c
@@ -42,7 +42,7 @@ int MPI_File_set_errhandler(MPI_File mpi_fh, MPI_Errhandler errhandler)
     ADIO_File fh;
     MPIU_THREADPRIV_DECL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     if (mpi_fh == MPI_FILE_NULL) {
 	ADIOI_DFLT_ERR_HANDLER = errhandler;
@@ -71,6 +71,6 @@ int MPI_File_set_errhandler(MPI_File mpi_fh, MPI_Errhandler errhandler)
     }
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/set_info.c b/src/mpi/romio/mpi-io/set_info.c
index 1d95f2c..c05b0f5 100644
--- a/src/mpi/romio/mpi-io/set_info.c
+++ b/src/mpi/romio/mpi-io/set_info.c
@@ -40,7 +40,7 @@ int MPI_File_set_info(MPI_File fh, MPI_Info info)
     static char myname[] = "MPI_FILE_SET_INFO";
     ADIO_File adio_fh;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -58,7 +58,7 @@ fn_exit:
 	error_code = MPIO_Err_return_file(adio_fh, error_code);
     /* --END ERROR HANDLING-- */
 
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 fn_fail:
diff --git a/src/mpi/romio/mpi-io/set_size.c b/src/mpi/romio/mpi-io/set_size.c
index 74c3f6c..9e3094f 100644
--- a/src/mpi/romio/mpi-io/set_size.c
+++ b/src/mpi/romio/mpi-io/set_size.c
@@ -48,7 +48,7 @@ int MPI_File_set_size(MPI_File fh, MPI_Offset size)
 		  MPI_DATATYPE_NULL, -1);
 #endif /* MPI_hpux */
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -99,7 +99,7 @@ int MPI_File_set_size(MPI_File fh, MPI_Offset size)
 #endif /* MPI_hpux */
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/set_view.c b/src/mpi/romio/mpi-io/set_view.c
index 4a820a8..5470178 100644
--- a/src/mpi/romio/mpi-io/set_view.c
+++ b/src/mpi/romio/mpi-io/set_view.c
@@ -48,7 +48,7 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
     ADIO_Offset shared_fp, byte_off;
     ADIO_File adio_fh;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -193,7 +193,7 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
 	adio_fh->is_external32 = 1;
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 fn_fail:
diff --git a/src/mpi/romio/mpi-io/write.c b/src/mpi/romio/mpi-io/write.c
index 899991d..b6b92a5 100644
--- a/src/mpi/romio/mpi-io/write.c
+++ b/src/mpi/romio/mpi-io/write.c
@@ -80,7 +80,7 @@ int MPIOI_File_write(MPI_File fh,
     void *e32buf=NULL;
     const void *xbuf=NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -179,7 +179,7 @@ int MPIOI_File_write(MPI_File fh,
 
 fn_exit:
     if (e32buf!= NULL) ADIOI_Free(e32buf);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/write_all.c b/src/mpi/romio/mpi-io/write_all.c
index ab77a95..1957271 100644
--- a/src/mpi/romio/mpi-io/write_all.c
+++ b/src/mpi/romio/mpi-io/write_all.c
@@ -81,7 +81,7 @@ int MPIOI_File_write_all(MPI_File fh,
     void *e32buf=NULL;
     const void *xbuf=NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -127,7 +127,7 @@ int MPIOI_File_write_all(MPI_File fh,
 
 fn_exit:
     if (e32buf != NULL) ADIOI_Free(e32buf);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/write_allb.c b/src/mpi/romio/mpi-io/write_allb.c
index 4678477..7abe14d 100644
--- a/src/mpi/romio/mpi-io/write_allb.c
+++ b/src/mpi/romio/mpi-io/write_allb.c
@@ -67,7 +67,7 @@ int MPIOI_File_write_all_begin(MPI_File fh,
     void *e32buf=NULL;
     const void *xbuf=NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -125,7 +125,7 @@ int MPIOI_File_write_all_begin(MPI_File fh,
 
 fn_exit:
     if ( e32buf != NULL) ADIOI_Free(e32buf);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/write_alle.c b/src/mpi/romio/mpi-io/write_alle.c
index 8b999a1..6fd684a 100644
--- a/src/mpi/romio/mpi-io/write_alle.c
+++ b/src/mpi/romio/mpi-io/write_alle.c
@@ -59,7 +59,7 @@ int MPIOI_File_write_all_end(MPI_File fh,
 
     MPIU_UNREFERENCED_ARG(buf);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -88,7 +88,7 @@ int MPIOI_File_write_all_end(MPI_File fh,
     error_code = MPI_SUCCESS;
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     return error_code;
 }
diff --git a/src/mpi/romio/mpi-io/write_ord.c b/src/mpi/romio/mpi-io/write_ord.c
index 60c14f3..94aec40 100644
--- a/src/mpi/romio/mpi-io/write_ord.c
+++ b/src/mpi/romio/mpi-io/write_ord.c
@@ -56,7 +56,7 @@ int MPI_File_write_ordered(MPI_File fh, ROMIO_CONST void *buf, int count,
     void *e32buf=NULL;
     const void *xbuf;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -120,7 +120,7 @@ int MPI_File_write_ordered(MPI_File fh, ROMIO_CONST void *buf, int count,
 
 fn_exit:
     if (e32buf != NULL) ADIOI_Free(e32buf);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     /* FIXME: Check for error code from WriteStridedColl? */
     return error_code;
diff --git a/src/mpi/romio/mpi-io/write_ordb.c b/src/mpi/romio/mpi-io/write_ordb.c
index 77bbab0..5584640 100644
--- a/src/mpi/romio/mpi-io/write_ordb.c
+++ b/src/mpi/romio/mpi-io/write_ordb.c
@@ -52,7 +52,7 @@ int MPI_File_write_ordered_begin(MPI_File fh, ROMIO_CONST void *buf, int count,
     void *e32buf = NULL;
     const void *xbuf=NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -125,7 +125,7 @@ int MPI_File_write_ordered_begin(MPI_File fh, ROMIO_CONST void *buf, int count,
     /* --END ERROR HANDLING-- */
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     /* FIXME: Check for error code from WriteStridedColl? */
     return error_code;
diff --git a/src/mpi/romio/mpi-io/write_orde.c b/src/mpi/romio/mpi-io/write_orde.c
index a0a6eea..8500b9a 100644
--- a/src/mpi/romio/mpi-io/write_orde.c
+++ b/src/mpi/romio/mpi-io/write_orde.c
@@ -45,7 +45,7 @@ int MPI_File_write_ordered_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *s
 
     MPIU_UNREFERENCED_ARG(buf);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -70,6 +70,6 @@ int MPI_File_write_ordered_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *s
 
 
 fn_exit:
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/mpi-io/write_sh.c b/src/mpi/romio/mpi-io/write_sh.c
index fc2b7b2..b21d1f4 100644
--- a/src/mpi/romio/mpi-io/write_sh.c
+++ b/src/mpi/romio/mpi-io/write_sh.c
@@ -54,7 +54,7 @@ int MPI_File_write_shared(MPI_File fh, ROMIO_CONST void *buf, int count,
     void *e32buf = NULL;
     const void *xbuf = NULL;
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
     adio_fh = MPIO_File_resolve(fh);
 
@@ -144,6 +144,6 @@ int MPI_File_write_shared(MPI_File fh, ROMIO_CONST void *buf, int count,
 
 fn_exit:
     if (e32buf != NULL) ADIOI_Free(e32buf);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return error_code;
 }
diff --git a/src/mpi/spawn/close_port.c b/src/mpi/spawn/close_port.c
index 8f23382..95a8d5c 100644
--- a/src/mpi/spawn/close_port.c
+++ b/src/mpi/spawn/close_port.c
@@ -36,7 +36,7 @@ int MPIR_Close_port_impl(const char *port_name)
 #undef FUNCNAME
 #define FUNCNAME MPI_Close_port
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Close_port - close port
 
@@ -57,7 +57,7 @@ int MPI_Close_port(const char *port_name)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_CLOSE_PORT);
 
     /* ... body of routine ...  */
@@ -69,7 +69,7 @@ int MPI_Close_port(const char *port_name)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_CLOSE_PORT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_accept.c b/src/mpi/spawn/comm_accept.c
index d1ab223..389874c 100644
--- a/src/mpi/spawn/comm_accept.c
+++ b/src/mpi/spawn/comm_accept.c
@@ -29,7 +29,7 @@ int MPI_Comm_accept(const char *port_name, MPI_Info info, int root, MPI_Comm com
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_accept_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_accept_impl(const char * port_name, MPID_Info * info_ptr, int root,
                           MPID_Comm * comm_ptr, MPID_Comm ** newcomm_ptr)
 {
@@ -42,7 +42,7 @@ int MPIR_Comm_accept_impl(const char * port_name, MPID_Info * info_ptr, int root
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_accept
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Comm_accept - Accept a request to form a new intercommunicator
 
@@ -75,7 +75,7 @@ int MPI_Comm_accept(const char *port_name, MPI_Info info, int root, MPI_Comm com
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_ACCEPT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Comm_accept(const char *port_name, MPI_Info info, int root, MPI_Comm com
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_ACCEPT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_connect.c b/src/mpi/spawn/comm_connect.c
index 6d16e46..2cd0e21 100644
--- a/src/mpi/spawn/comm_connect.c
+++ b/src/mpi/spawn/comm_connect.c
@@ -28,7 +28,7 @@ int MPI_Comm_connect(const char *port_name, MPI_Info info, int root, MPI_Comm co
 #undef FUNCNAME
 #define FUNCNAME MPIR_Comm_connect_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Comm_connect_impl(const char * port_name, MPID_Info * info_ptr, int root,
                           MPID_Comm * comm_ptr, MPID_Comm ** newcomm_ptr)
 {
@@ -40,7 +40,7 @@ int MPIR_Comm_connect_impl(const char * port_name, MPID_Info * info_ptr, int roo
 #undef FUNCNAME
 #define FUNCNAME MPI_Comm_connect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Comm_connect - Make a request to form a new intercommunicator
 
@@ -74,7 +74,7 @@ int MPI_Comm_connect(const char *port_name, MPI_Info info, int root, MPI_Comm co
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_CONNECT);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -118,7 +118,7 @@ int MPI_Comm_connect(const char *port_name, MPI_Info info, int root, MPI_Comm co
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_CONNECT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_disconnect.c b/src/mpi/spawn/comm_disconnect.c
index 5812a25..08c30b4 100644
--- a/src/mpi/spawn/comm_disconnect.c
+++ b/src/mpi/spawn/comm_disconnect.c
@@ -59,7 +59,7 @@ int MPI_Comm_disconnect(MPI_Comm * comm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_DISCONNECT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -132,7 +132,7 @@ int MPI_Comm_disconnect(MPI_Comm * comm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_DISCONNECT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_join.c b/src/mpi/spawn/comm_join.c
index 2bbccf6..7793117 100644
--- a/src/mpi/spawn/comm_join.c
+++ b/src/mpi/spawn/comm_join.c
@@ -144,7 +144,7 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_JOIN);
 
     /* ... body of routine ...  */
@@ -153,31 +153,31 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
     MPIU_CHKLMEM_MALLOC(remote_port, char *, MPI_MAX_PORT_NAME, mpi_errno, "remote port name");
     
     mpi_errno = MPIR_Open_port_impl(NULL, local_port);
-    MPIU_ERR_CHKANDJUMP((mpi_errno != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER, "**openportfailed");
+    MPIR_ERR_CHKANDJUMP((mpi_errno != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER, "**openportfailed");
 
     err = MPIR_fd_send(fd, local_port, MPI_MAX_PORT_NAME);
-    MPIU_ERR_CHKANDJUMP1((err != 0), mpi_errno, MPI_ERR_INTERN, "**join_send", "**join_send %d", err);
+    MPIR_ERR_CHKANDJUMP1((err != 0), mpi_errno, MPI_ERR_INTERN, "**join_send", "**join_send %d", err);
 
     err = MPIR_fd_recv(fd, remote_port, MPI_MAX_PORT_NAME);
-    MPIU_ERR_CHKANDJUMP1((err != 0), mpi_errno, MPI_ERR_INTERN, "**join_recv", "**join_recv %d", err);
+    MPIR_ERR_CHKANDJUMP1((err != 0), mpi_errno, MPI_ERR_INTERN, "**join_recv", "**join_recv %d", err);
 
-    MPIU_ERR_CHKANDJUMP2((strcmp(local_port, remote_port) == 0), mpi_errno, MPI_ERR_INTERN, "**join_portname",
+    MPIR_ERR_CHKANDJUMP2((strcmp(local_port, remote_port) == 0), mpi_errno, MPI_ERR_INTERN, "**join_portname",
 			 "**join_portname %s %s", local_port, remote_port);
 
     if (strcmp(local_port, remote_port) < 0) {
         MPID_Comm *comm_self_ptr;
         MPID_Comm_get_ptr( MPI_COMM_SELF, comm_self_ptr );
         mpi_errno = MPIR_Comm_accept_impl(local_port, NULL, 0, comm_self_ptr, &intercomm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         MPID_Comm *comm_self_ptr;
         MPID_Comm_get_ptr( MPI_COMM_SELF, comm_self_ptr );
         mpi_errno = MPIR_Comm_connect_impl(remote_port, NULL, 0, comm_self_ptr, &intercomm_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     mpi_errno = MPIR_Close_port_impl(local_port);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_OBJ_PUBLISH_HANDLE(*intercomm, intercomm_ptr->handle);
 
@@ -186,7 +186,7 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_JOIN);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_spawn.c b/src/mpi/spawn/comm_spawn.c
index 7749ab2..c596d7c 100644
--- a/src/mpi/spawn/comm_spawn.c
+++ b/src/mpi/spawn/comm_spawn.c
@@ -72,7 +72,7 @@ int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info inf
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SPAWN);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -133,7 +133,7 @@ int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info inf
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SPAWN);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/comm_spawn_multiple.c b/src/mpi/spawn/comm_spawn_multiple.c
index 845ef62..3d65fe3 100644
--- a/src/mpi/spawn/comm_spawn_multiple.c
+++ b/src/mpi/spawn/comm_spawn_multiple.c
@@ -78,7 +78,7 @@ int MPI_Comm_spawn_multiple(int count, char *array_of_commands[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_COMM_SPAWN_MULTIPLE);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -151,7 +151,7 @@ int MPI_Comm_spawn_multiple(int count, char *array_of_commands[],
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_COMM_SPAWN_MULTIPLE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/lookup_name.c b/src/mpi/spawn/lookup_name.c
index 8204688..24a449f 100644
--- a/src/mpi/spawn/lookup_name.c
+++ b/src/mpi/spawn/lookup_name.c
@@ -112,7 +112,7 @@ int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name)
 	{
 	    mpi_errno = MPID_NS_Create( info_ptr, &MPIR_Namepub );
 	    /* FIXME: change **fail to something more meaningful */
-	    MPIU_ERR_CHKANDJUMP((mpi_errno != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER, "**fail");
+	    MPIR_ERR_CHKANDJUMP((mpi_errno != MPI_SUCCESS), mpi_errno, MPI_ERR_OTHER, "**fail");
 	    MPIR_Add_finalize( (int (*)(void*))MPID_NS_Free, &MPIR_Namepub, 9 );
 	}
 
@@ -125,13 +125,13 @@ int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name)
 	   if there is no obvious communicator. A previous version of 
 	   this routine erroneously did not invoke the error handler
 	   when the error was of class MPI_ERR_NAME. */
-	MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS,
+	MPIR_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS,
 			    mpi_errno, MPI_ERR_OTHER, "**fail");
     }
 #   else
     {
 	/* No name publishing service available */
-	MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nonamepub");
+	MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nonamepub");
     }
 #   endif
     
diff --git a/src/mpi/spawn/open_port.c b/src/mpi/spawn/open_port.c
index 37699d1..3c3fcb5 100644
--- a/src/mpi/spawn/open_port.c
+++ b/src/mpi/spawn/open_port.c
@@ -34,7 +34,7 @@ int MPIR_Open_port_impl(MPID_Info *info_ptr, char *port_name)
 #undef FUNCNAME
 #define FUNCNAME MPI_Open_port
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
    MPI_Open_port - Establish an address that can be used to establish 
    connections between groups of MPI processes
@@ -73,7 +73,7 @@ int MPI_Open_port(MPI_Info info, char *port_name)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_OPEN_PORT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -112,7 +112,7 @@ int MPI_Open_port(MPI_Info info, char *port_name)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_OPEN_PORT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/spawn/publish_name.c b/src/mpi/spawn/publish_name.c
index c804caa..ad8f753 100644
--- a/src/mpi/spawn/publish_name.c
+++ b/src/mpi/spawn/publish_name.c
@@ -62,7 +62,7 @@ int MPI_Publish_name(const char *service_name, MPI_Info info, const char *port_n
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_PUBLISH_NAME);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -114,7 +114,7 @@ int MPI_Publish_name(const char *service_name, MPI_Info info, const char *port_n
 #   else
     {
 	/* No name publishing service available */
-	MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nonamepub");
+	MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nonamepub");
     }
 #   endif
 
@@ -122,7 +122,7 @@ int MPI_Publish_name(const char *service_name, MPI_Info info, const char *port_n
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_PUBLISH_NAME);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
     
   fn_fail:
diff --git a/src/mpi/spawn/unpublish_name.c b/src/mpi/spawn/unpublish_name.c
index fba560e..54bbe59 100644
--- a/src/mpi/spawn/unpublish_name.c
+++ b/src/mpi/spawn/unpublish_name.c
@@ -59,7 +59,7 @@ int MPI_Unpublish_name(const char *service_name, MPI_Info info, const char *port
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);  
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);  
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_UNPUBLISH_NAME);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -114,7 +114,7 @@ int MPI_Unpublish_name(const char *service_name, MPI_Info info, const char *port
 #   else
     {
 	/* No name publishing service available */
-	MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nonamepub");
+	MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nonamepub");
     }
 #   endif
 
@@ -122,7 +122,7 @@ int MPI_Unpublish_name(const char *service_name, MPI_Info info, const char *port
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_UNPUBLISH_NAME);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/timer/Makefile.mk b/src/mpi/timer/Makefile.mk
index 58fc82f..043095c 100644
--- a/src/mpi/timer/Makefile.mk
+++ b/src/mpi/timer/Makefile.mk
@@ -7,7 +7,3 @@
 mpi_sources +=            \
     src/mpi/timer/wtime.c \
     src/mpi/timer/wtick.c
-
-mpi_core_sources += \
-    src/mpi/timer/mpidtime.c
-
diff --git a/src/mpi/timer/mpidtime.c b/src/mpi/timer/mpidtime.c
deleted file mode 100644
index cdf6c06..0000000
--- a/src/mpi/timer/mpidtime.c
+++ /dev/null
@@ -1,424 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include "mpiimpl.h"
-
-#if MPICH_TIMER_KIND == USE_GETHRTIME 
-/* 
- * MPID_Time_t is hrtime_t, which under Solaris is defined as a 64bit
- * longlong_t .  However, the Solaris header files will define
- * longlong_t as a structure in some circumstances, making arithmetic
- * with hrtime_t invalid.  FIXME.  
- * To fix this, we'll need to test hrtime_t arithmetic in the configure
- * program, and if it fails, check for the Solaris defintions (
- * union { double _d; int32_t _l[2]; }.  Alternately, we may decide that
- * if hrtime_t is not supported, then neither is gethrtime.
- *
- * Note that the Solaris sys/types.h file *assumes* that no other compiler
- * supports an 8 byte long long.  We can also cast hrtime_t to long long 
- * if long long is available and 8 bytes.
- */
-void MPID_Wtime( MPID_Time_t *timeval )
-{
-    *timeval = gethrtime();
-}
-void MPID_Wtime_diff( MPID_Time_t *t1, MPID_Time_t *t2, double *diff )
-{
-    *diff = 1.0e-9 * (double)( *t2 - *t1 );
-}
-void MPID_Wtime_todouble( MPID_Time_t *t, double *val )
-{
-    *val = 1.0e-9 * (*t);
-}
-void MPID_Wtime_acc( MPID_Time_t *t1,MPID_Time_t *t2, MPID_Time_t *t3 )
-{
-    *t3 += ((*t2) - (*t1));
-}
-double MPID_Wtick( void )
-{
-    /* According to the documentation, ticks should be in nanoseconds.  This 
-       is untested */ 
-    return 1.0e-9;
-}
-
-#elif MPICH_TIMER_KIND == USE_CLOCK_GETTIME
-void MPID_Wtime( MPID_Time_t *timeval )
-{
-    /* POSIX timer (14.2.1, page 311) */
-    clock_gettime( CLOCK_REALTIME, timeval );
-}
-void MPID_Wtime_diff( MPID_Time_t *t1, MPID_Time_t *t2, double *diff )
-{
-    *diff = ((double) (t2->tv_sec - t1->tv_sec) + 
-		1.0e-9 * (double) (t2->tv_nsec - t1->tv_nsec) );
-}
-void MPID_Wtime_todouble( MPID_Time_t *t, double *val )
-{
-    *val = ((double) t->tv_sec + 1.0e-9 * (double) t->tv_nsec );
-}
-void MPID_Wtime_acc( MPID_Time_t *t1, MPID_Time_t *t2, MPID_Time_t *t3 )
-{
-    int nsec, sec;
-    
-    nsec = t2->tv_nsec - t1->tv_nsec;
-    sec  = t2->tv_sec - t1->tv_sec;
-
-    t3->tv_sec  += sec;
-    t3->tv_nsec += nsec;
-    while (t3->tv_nsec > 1000000000) {
-	t3->tv_nsec -= 1000000000;
-	t3->tv_sec ++;
-    }
-}
-
-/* FIXME: We need to cleanup the use of the MPID_Generic_wtick prototype */
-double MPID_Generic_wtick(void);
-
-double MPID_Wtick( void )
-{
-    struct timespec res;
-    int rc;
-
-    rc = clock_getres( CLOCK_REALTIME, &res );
-    if (!rc) 
-	/* May return -1 for unimplemented ! */
-	return res.tv_sec + 1.0e-9 * res.tv_nsec;
-
-    /* Sigh.  If not implemented (POSIX allows that), 
-       then we need to use the generic tick routine */
-    return MPID_Generic_wtick();
-}
-#define MPICH_NEEDS_GENERIC_WTICK
-/* Rename the function so that we can access it */
-#define MPID_Wtick MPID_Generic_wtick
-
-#elif MPICH_TIMER_KIND == USE_GETTIMEOFDAY
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-void MPID_Wtime( MPID_Time_t *tval )
-{
-    gettimeofday(tval,NULL);
-}
-void MPID_Wtime_diff( MPID_Time_t *t1, MPID_Time_t *t2, double *diff )
-{
-    *diff = ((double) (t2->tv_sec - t1->tv_sec) + 
-		.000001 * (double) (t2->tv_usec - t1->tv_usec) );
-}
-void MPID_Wtime_todouble( MPID_Time_t *t, double *val )
-{
-    *val = (double) t->tv_sec + .000001 * (double) t->tv_usec;
-}
-void MPID_Wtime_acc( MPID_Time_t *t1, MPID_Time_t *t2, MPID_Time_t *t3 )
-{
-    int usec, sec;
-    
-    usec = t2->tv_usec - t1->tv_usec;
-    sec  = t2->tv_sec - t1->tv_sec;
-    t3->tv_usec += usec;
-    t3->tv_sec += sec;
-    /* Handle carry to the integer seconds field */
-    while (t3->tv_usec > 1000000) {
-	t3->tv_usec -= 1000000;
-	t3->tv_sec++;
-    }
-}
-#define MPICH_NEEDS_GENERIC_WTICK
-
-
-#elif MPICH_TIMER_KIND == USE_LINUX86_CYCLE
-#include <sys/time.h>
-double MPID_Seconds_per_tick=0.0;
-double MPID_Wtick(void)
-{
-    return MPID_Seconds_per_tick;
-}
-int MPID_Wtime_init(void)
-{
-    unsigned long long t1, t2;
-    struct timeval tv1, tv2;
-    double td1, td2;
-
-    gettimeofday(&tv1, NULL);
-    MPID_Wtime(&t1);
-    usleep(250000);
-    gettimeofday(&tv2, NULL);
-    MPID_Wtime(&t2);
-
-    td1 = tv1.tv_sec + tv1.tv_usec / 1000000.0;
-    td2 = tv2.tv_sec + tv2.tv_usec / 1000000.0;
-
-    MPID_Seconds_per_tick = (td2 - td1) / (double)(t2 - t1);
-    return 0;
-}
-/* Time stamps created by a macro */
-void MPID_Wtime_diff( MPID_Time_t *t1, MPID_Time_t *t2, double *diff )
-{
-    *diff = (double)( *t2 - *t1 ) * MPID_Seconds_per_tick;
-}
-void MPID_Wtime_todouble( MPID_Time_t *t, double *val )
-{
-    /* This returns the number of cycles as the "time".  This isn't correct
-       for implementing MPI_Wtime, but it does allow us to insert cycle
-       counters into test programs */
-    *val = (double)*t * MPID_Seconds_per_tick;
-}
-void MPID_Wtime_acc( MPID_Time_t *t1,MPID_Time_t *t2, MPID_Time_t *t3 )
-{
-    *t3 += (*t2 - *t1);
-}
-
-
-
-#elif MPICH_TIMER_KIND == USE_GCC_IA64_CYCLE
-#include <sys/time.h>
-double MPID_Seconds_per_tick = 0.0;
-double MPID_Wtick(void)
-{
-    return MPID_Seconds_per_tick;
-}
-int MPID_Wtime_init(void)
-{
-    unsigned long long t1, t2;
-    struct timeval tv1, tv2;
-    double td1, td2;
-
-    gettimeofday(&tv1, NULL);
-    MPID_Wtime(&t1);
-    usleep(250000);
-    gettimeofday(&tv2, NULL);
-    MPID_Wtime(&t2);
-
-    td1 = tv1.tv_sec + tv1.tv_usec / 1000000.0;
-    td2 = tv2.tv_sec + tv2.tv_usec / 1000000.0;
-
-    MPID_Seconds_per_tick = (td2 - td1) / (double)(t2 - t1);
-    return 0;
-}
-/* Time stamps created by a macro */
-void MPID_Wtime_diff( MPID_Time_t *t1, MPID_Time_t *t2, double *diff )
-{
-    *diff = (double)( *t2 - *t1 ) * MPID_Seconds_per_tick;
-}
-void MPID_Wtime_todouble( MPID_Time_t *t, double *val )
-{
-    /* This returns the number of cycles as the "time".  This isn't correct
-       for implementing MPI_Wtime, but it does allow us to insert cycle
-       counters into test programs */
-    *val = (double)*t * MPID_Seconds_per_tick;
-}
-void MPID_Wtime_acc( MPID_Time_t *t1,MPID_Time_t *t2, MPID_Time_t *t3 )
-{
-    *t3 += (*t2 - *t1);
-}
-
-#elif MPICH_TIMER_KIND == USE_LINUXALPHA_CYCLE
-/* FIXME: This should have been fixed in the configure, rather than as a 
-   make-time error message */
-#error "LinuxAlpha cycle counter not supported"
-
-#elif (MPICH_TIMER_KIND == USE_WIN86_CYCLE) || (MPICH_TIMER_KIND == USE_WIN64_CYCLE)
-double MPID_Seconds_per_tick = 0.0;
-double MPID_Wtick(void)
-{
-    return MPID_Seconds_per_tick;
-}
-void MPID_Wtime_todouble( MPID_Time_t *t, double *d)
-{
-    *d = (double)(__int64)*t * MPID_Seconds_per_tick;
-}
-void MPID_Wtime_diff( MPID_Time_t *t1, MPID_Time_t *t2, double *diff)
-{
-    *diff = (double)((__int64)( *t2 - *t1 )) * MPID_Seconds_per_tick;
-}
-int MPID_Wtime_init( void )
-{
-    MPID_Time_t t1, t2;
-    DWORD s1, s2;
-    double d;
-    int i;
-
-    MPID_Wtime(&t1);
-    MPID_Wtime(&t1);
-
-    /* time an interval using both timers */
-    s1 = GetTickCount();
-    MPID_Wtime(&t1);
-    /*Sleep(250);*/ /* Sleep causes power saving cpu's to stop which stops the counter */
-    while (GetTickCount() - s1 < 200)
-    {
-	for (i=2; i<1000; i++)
-	    d = (double)i / (double)(i-1);
-    }
-    s2 = GetTickCount();
-    MPID_Wtime(&t2);
-
-    /* calculate the frequency of the assembly cycle counter */
-    MPID_Seconds_per_tick = ((double)(s2 - s1) / 1000.0) / (double)((__int64)(t2 - t1));
-    /*
-    printf("t2-t1 %10d\nsystime diff %d\nfrequency %g\n CPU MHz %g\n", 
-	(int)(t2-t1), (int)(s2 - s1), MPID_Seconds_per_tick, MPID_Seconds_per_tick * 1.0e6);
-    */
-    return 0;
-}
-/*
-void TIMER_INIT()
-{
-    TIMER_TYPE t1, t2;
-    FILETIME ft1, ft2;
-    SYSTEMTIME st1, st2;
-    ULARGE_INTEGER u1, u2;
-
-    t1 = 5;
-    t2 = 5;
-
-    GET_TIME(&t1);
-    GET_TIME(&t1);
-
-    GetSystemTime(&st1);
-    GET_TIME(&t1);
-    Sleep(500);
-    GetSystemTime(&st2);
-    GET_TIME(&t2);
-
-    SystemTimeToFileTime(&st1, &ft1);
-    SystemTimeToFileTime(&st2, &ft2);
-
-    u1.QuadPart = ft1.dwHighDateTime;
-    u1.QuadPart = u1.QuadPart << 32;
-    u1.QuadPart |= ft1.dwLowDateTime;
-    u2.QuadPart = ft2.dwHighDateTime;
-    u2.QuadPart = u2.QuadPart << 32;
-    u2.QuadPart |= ft2.dwLowDateTime;
-
-    MPID_Seconds_per_tick = (1e-7 * (double)((__int64)(u2.QuadPart - u1.QuadPart))) / (double)((__int64)(t2 - t1));
-    printf("t2   %10d\nt1   %10d\ndiff %10d\nsystime diff %d\nfrequency %g\n CPU MHz %g\n", 
-	(int)t2, (int)t1, (int)(t2-t1), (int)(u2.QuadPart - u1.QuadPart), MPID_Seconds_per_tick, MPID_Seconds_per_tick * 1.0e6);
-    printf("t2-t1 %10d\nsystime diff %d\nfrequency %g\n CPU MHz %g\n", 
-	(int)(t2-t1), (int)(u2.QuadPart - u1.QuadPart), MPID_Seconds_per_tick, MPID_Seconds_per_tick * 1.0e6);
-}
-*/
-
-
-
-#elif MPICH_TIMER_KIND == USE_QUERYPERFORMANCECOUNTER
-double MPID_Seconds_per_tick=0.0;  /* High performance counter frequency */
-int MPID_Wtime_init(void)
-{
-    LARGE_INTEGER n;
-    QueryPerformanceFrequency(&n);
-    MPID_Seconds_per_tick = 1.0 / (double)n.QuadPart;
-    return 0;
-}
-double MPID_Wtick(void)
-{
-    return MPID_Seconds_per_tick;
-}
-void MPID_Wtime_todouble( MPID_Time_t *t, double *val )
-{
-    *val = (double)t->QuadPart * MPID_Seconds_per_tick;
-}
-void MPID_Wtime_diff( MPID_Time_t *t1, MPID_Time_t *t2, double *diff )
-{
-    LARGE_INTEGER n;
-    n.QuadPart = t2->QuadPart - t1->QuadPart;
-    *diff = (double)n.QuadPart * MPID_Seconds_per_tick;
-}
-void MPID_Wtime_acc( MPID_Time_t *t1, MPID_Time_t *t2, MPID_Time_t *t3 )
-{
-    t3->QuadPart += ((t2->QuadPart) - (t1->QuadPart));
-}
-
-
-#elif MPICH_TIMER_KIND == USE_MACH_ABSOLUTE_TIME
-static double MPIR_Wtime_mult;
-int MPID_Wtime_init(void)
-{
-    mach_timebase_info_data_t info;
-    mach_timebase_info(&info);
-    MPIR_Wtime_mult = 1.0e-9 * ((double)info.numer / (double)info.denom);
-
-    return MPI_SUCCESS;
-}
-void MPID_Wtime( MPID_Time_t *timeval )
-{
-    *timeval = mach_absolute_time();  
-}
-void MPID_Wtime_diff( MPID_Time_t *t1, MPID_Time_t *t2, double *diff )
-{
-    *diff = (*t2 - *t1) * MPIR_Wtime_mult;
-}
-void MPID_Wtime_todouble( MPID_Time_t *t, double *val )
-{
-    *val = *t * MPIR_Wtime_mult;
-}
-void MPID_Wtime_acc( MPID_Time_t *t1, MPID_Time_t *t2, MPID_Time_t *t3 )
-{
-    *t3 += *t2 - *t1;
-}
-
-/* FIXME: We need to cleanup the use of the MPID_Generic_wtick prototype */
-double MPID_Generic_wtick(void);
-
-double MPID_Wtick( void )
-{
-    return MPID_Generic_wtick();
-}
-#define MPICH_NEEDS_GENERIC_WTICK
-/* Rename the function so that we can access it */
-#define MPID_Wtick MPID_Generic_wtick
-
-
-#endif
-
-#ifdef MPICH_NEEDS_GENERIC_WTICK
-/*
- * For timers that do not have defined resolutions, compute the resolution
- * by sampling the clock itself.
- *
- * Note that this uses a thread-safe initialization procedure in the
- * event that multiple threads invoke this routine
- */
-#undef FUNCNAME
-#define FUNCNAME MPID_Wtick
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-double MPID_Wtick( void )
-{
-    MPIU_THREADSAFE_INIT_DECL(initTick);
-    static double tickval = -1.0;
-    double timediff;  /* Keep compiler happy about timediff set before use*/
-    MPID_Time_t t1, t2;
-    int    cnt;
-    int    icnt;
-
-    if (initTick) {
-	MPIU_THREADSAFE_INIT_BLOCK_BEGIN(initTick);
-	tickval = 1.0e6;
-	for (icnt=0; icnt<10; icnt++) {
-	    cnt = 1000;
-	    MPID_Wtime( &t1 );
-	    /* Make it abundently clear to the compiler that this block is
-	       executed at least once. */
-	    do {
-		MPID_Wtime( &t2 );
-		MPID_Wtime_diff( &t1, &t2, &timediff );
-		if (timediff > 0) break;
-	    }
-	    while (cnt--);
-	    if (cnt && timediff > 0.0 && timediff < tickval) {
-		MPID_Wtime_diff( &t1, &t2, &tickval );
-	    }
-	}
-	MPIU_THREADSAFE_INIT_CLEAR(initTick);
-	MPIU_THREADSAFE_INIT_BLOCK_END(initTick);
-    }
-    return tickval;
-}
-#endif
diff --git a/src/mpi/topo/cart_coords.c b/src/mpi/topo/cart_coords.c
index 67f3681..5ffbf3c 100644
--- a/src/mpi/topo/cart_coords.c
+++ b/src/mpi/topo/cart_coords.c
@@ -104,8 +104,8 @@ int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int coords[])
     {
         MPID_BEGIN_ERROR_CHECKS;
         {
-	    MPIU_ERR_CHKANDJUMP((!cart_ptr || cart_ptr->kind != MPI_CART), mpi_errno, MPI_ERR_TOPOLOGY, "**notcarttopo");
-	    MPIU_ERR_CHKANDJUMP2((cart_ptr->topo.cart.ndims > maxdims), mpi_errno, MPI_ERR_ARG, "**dimsmany",
+	    MPIR_ERR_CHKANDJUMP((!cart_ptr || cart_ptr->kind != MPI_CART), mpi_errno, MPI_ERR_TOPOLOGY, "**notcarttopo");
+	    MPIR_ERR_CHKANDJUMP2((cart_ptr->topo.cart.ndims > maxdims), mpi_errno, MPI_ERR_ARG, "**dimsmany",
 				 "**dimsmany %d %d", cart_ptr->topo.cart.ndims, maxdims);
 	    if (cart_ptr->topo.cart.ndims) {
 		MPIR_ERRTEST_ARGNULL(coords,"coords",mpi_errno);
diff --git a/src/mpi/topo/cart_create.c b/src/mpi/topo/cart_create.c
index ff26d5f..ef1e73f 100644
--- a/src/mpi/topo/cart_create.c
+++ b/src/mpi/topo/cart_create.c
@@ -35,7 +35,7 @@ int MPI_Cart_create(MPI_Comm comm_old, int ndims, const int dims[], const int pe
 #undef FUNCNAME
 #define FUNCNAME MPIR_Cart_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Cart_create( MPID_Comm *comm_ptr, int ndims, const int dims[], 
 		      const int periods[], int reorder, MPI_Comm *comm_cart )
 {
@@ -53,7 +53,7 @@ int MPIR_Cart_create( MPID_Comm *comm_ptr, int ndims, const int dims[],
 	newsize *= dims[i];
 
     /* Use ERR_ARG instead of ERR_TOPOLOGY because there is no topology yet */
-    MPIU_ERR_CHKANDJUMP2((newsize > comm_ptr->remote_size), mpi_errno, 
+    MPIR_ERR_CHKANDJUMP2((newsize > comm_ptr->remote_size), mpi_errno, 
 			 MPI_ERR_ARG, "**cartdim",
 			 "**cartdim %d %d", comm_ptr->remote_size, newsize);
 
@@ -68,7 +68,7 @@ int MPIR_Cart_create( MPID_Comm *comm_ptr, int ndims, const int dims[],
             MPID_Comm *comm_self_ptr;
             MPID_Comm_get_ptr(MPI_COMM_SELF, comm_self_ptr);
 	    mpi_errno = MPIR_Comm_dup_impl(comm_self_ptr, &newcomm_ptr);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    
 	    /* Create the topology structure */
 	    MPIU_CHKPMEM_MALLOC(cart_ptr,MPIR_Topology*,sizeof(MPIR_Topology),
@@ -102,7 +102,7 @@ int MPIR_Cart_create( MPID_Comm *comm_ptr, int ndims, const int dims[],
 	       processes */
 	    mpi_errno = MPIR_Cart_map_impl( comm_ptr, ndims, (const int *)dims,
                                             (const int *)periods, &rank );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             
 	    /* Create the new communicator with split, since we need to reorder
 	       the ranks (including the related internals, such as the connection
@@ -110,12 +110,12 @@ int MPIR_Cart_create( MPID_Comm *comm_ptr, int ndims, const int dims[],
             mpi_errno = MPIR_Comm_split_impl( comm_ptr,
                                               rank == MPI_UNDEFINED ? MPI_UNDEFINED : 1,
                                               rank, &newcomm_ptr );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         } else {
 	    mpi_errno = MPIR_Comm_copy( (MPID_Comm *)comm_ptr, newsize, 
 					&newcomm_ptr );
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    rank   = comm_ptr->rank;
 	}
 
@@ -154,7 +154,7 @@ int MPIR_Cart_create( MPID_Comm *comm_ptr, int ndims, const int dims[],
 
     /* Place this topology onto the communicator */
     mpi_errno = MPIR_Topology_put( newcomm_ptr, cart_ptr );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_OBJ_PUBLISH_HANDLE(*comm_cart, newcomm_ptr->handle);
 
@@ -171,7 +171,7 @@ int MPIR_Cart_create( MPID_Comm *comm_ptr, int ndims, const int dims[],
 #undef FUNCNAME
 #define FUNCNAME MPIR_Cart_create_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Cart_create_impl(MPID_Comm *comm_ptr, int ndims, const int dims[],
                           const int periods[], int reorder, MPI_Comm *comm_cart)
 {
@@ -184,14 +184,14 @@ int MPIR_Cart_create_impl(MPID_Comm *comm_ptr, int ndims, const int dims[],
 						    (const int*) periods,
 						    reorder,
 						    comm_cart );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
 	mpi_errno = MPIR_Cart_create( comm_ptr, ndims,
 				      (const int*) dims,
 				      (const int*) periods, reorder,
 				      comm_cart );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -205,7 +205,7 @@ int MPIR_Cart_create_impl(MPID_Comm *comm_ptr, int ndims, const int dims[],
 #undef FUNCNAME
 #define FUNCNAME MPI_Cart_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Cart_create - Makes a new communicator to which topology information
@@ -245,7 +245,7 @@ int MPI_Cart_create(MPI_Comm comm_old, int ndims, const int dims[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_CART_CREATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -307,7 +307,7 @@ int MPI_Cart_create(MPI_Comm comm_old, int ndims, const int dims[],
 
  fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_CART_CREATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
  fn_fail:
diff --git a/src/mpi/topo/cart_get.c b/src/mpi/topo/cart_get.c
index 2789010..bc2c8e4 100644
--- a/src/mpi/topo/cart_get.c
+++ b/src/mpi/topo/cart_get.c
@@ -108,8 +108,8 @@ int MPI_Cart_get(MPI_Comm comm, int maxdims, int dims[], int periods[],
     {
         MPID_BEGIN_ERROR_CHECKS;
         {
-	    MPIU_ERR_CHKANDJUMP((!cart_ptr || cart_ptr->kind != MPI_CART), mpi_errno, MPI_ERR_TOPOLOGY, "**notcarttopo");
-	    MPIU_ERR_CHKANDJUMP2((cart_ptr->topo.cart.ndims > maxdims), mpi_errno, MPI_ERR_ARG, "**dimsmany",
+	    MPIR_ERR_CHKANDJUMP((!cart_ptr || cart_ptr->kind != MPI_CART), mpi_errno, MPI_ERR_TOPOLOGY, "**notcarttopo");
+	    MPIR_ERR_CHKANDJUMP2((cart_ptr->topo.cart.ndims > maxdims), mpi_errno, MPI_ERR_ARG, "**dimsmany",
 			 "**dimsmany %d %d", cart_ptr->topo.cart.ndims, maxdims);
 
 	    if (cart_ptr->topo.cart.ndims) {
diff --git a/src/mpi/topo/cart_map.c b/src/mpi/topo/cart_map.c
index 2bd4c81..ccdd8d4 100644
--- a/src/mpi/topo/cart_map.c
+++ b/src/mpi/topo/cart_map.c
@@ -29,7 +29,7 @@ int MPI_Cart_map(MPI_Comm comm, int ndims, const int dims[], const int periods[]
 #undef FUNCNAME
 #define FUNCNAME MPIR_Cart_map
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Cart_map( const MPID_Comm *comm_ptr, int ndims, const int dims[], 
 		   const int periodic[], int *newrank )
 {
@@ -48,7 +48,7 @@ int MPIR_Cart_map( const MPID_Comm *comm_ptr, int ndims, const int dims[],
     size = comm_ptr->remote_size;
     
     /* Test that the communicator is large enough */
-    MPIU_ERR_CHKANDJUMP2(size < nranks, mpi_errno, MPI_ERR_DIMS, "**topotoolarge",
+    MPIR_ERR_CHKANDJUMP2(size < nranks, mpi_errno, MPI_ERR_DIMS, "**topotoolarge",
                          "**topotoolarge %d %d", size, nranks);
 
     /* Am I in this range? */
@@ -69,7 +69,7 @@ int MPIR_Cart_map( const MPID_Comm *comm_ptr, int ndims, const int dims[],
 #undef FUNCNAME
 #define FUNCNAME MPIR_Cart_map_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Cart_map_impl(const MPID_Comm *comm_ptr, int ndims, const int dims[],
                        const int periods[], int *newrank)
 {
@@ -81,13 +81,13 @@ int MPIR_Cart_map_impl(const MPID_Comm *comm_ptr, int ndims, const int dims[],
 						 (const int*) dims,
 						 (const int*) periods,
 						 newrank );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
 	mpi_errno = MPIR_Cart_map( comm_ptr, ndims,
 				   (const int*) dims,
 				   (const int*) periods, newrank );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -101,7 +101,7 @@ int MPIR_Cart_map_impl(const MPID_Comm *comm_ptr, int ndims, const int dims[],
 #undef FUNCNAME
 #define FUNCNAME MPI_Cart_map
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Cart_map - Maps process to Cartesian topology information 
 
@@ -180,7 +180,7 @@ int MPI_Cart_map(MPI_Comm comm, int ndims, const int dims[], const int periods[]
     mpi_errno = MPIR_Cart_map_impl( comm_ptr, ndims, 
                                     (const int*) dims,
                                     (const int*) periods, newrank );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/topo/cart_rank.c b/src/mpi/topo/cart_rank.c
index 9b1963e..bf67ba4 100644
--- a/src/mpi/topo/cart_rank.c
+++ b/src/mpi/topo/cart_rank.c
@@ -29,7 +29,7 @@ int MPI_Cart_rank(MPI_Comm comm, const int coords[], int *rank) __attribute__((w
 #undef FUNCNAME
 #define FUNCNAME MPIR_Cart_rank_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIR_Cart_rank_impl(MPIR_Topology *cart_ptr, const int coords[], int *rank)
 {
     int i, ndims, coord, multiplier;
@@ -59,7 +59,7 @@ void MPIR_Cart_rank_impl(MPIR_Topology *cart_ptr, const int coords[], int *rank)
 #undef FUNCNAME
 #define FUNCNAME MPI_Cart_rank
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Cart_rank - Determines process rank in communicator given Cartesian
                 location
@@ -127,7 +127,7 @@ int MPI_Cart_rank(MPI_Comm comm, const int coords[], int *rank)
 #   endif /* HAVE_ERROR_CHECKING */
 
     cart_ptr = MPIR_Topology_get( comm_ptr );
-    MPIU_ERR_CHKANDJUMP((!cart_ptr || cart_ptr->kind != MPI_CART), mpi_errno, MPI_ERR_TOPOLOGY, "**notcarttopo");
+    MPIR_ERR_CHKANDJUMP((!cart_ptr || cart_ptr->kind != MPI_CART), mpi_errno, MPI_ERR_TOPOLOGY, "**notcarttopo");
 
     /* Validate coordinates */
 #   ifdef HAVE_ERROR_CHECKING
@@ -142,7 +142,7 @@ int MPI_Cart_rank(MPI_Comm comm, const int coords[], int *rank)
 	    for (i=0; i<ndims; i++) {
 		if (!cart_ptr->topo.cart.periodic[i]) {
 		    coord = coords[i];
-		    MPIU_ERR_CHKANDJUMP3(
+		    MPIR_ERR_CHKANDJUMP3(
 			(coord < 0 || coord >= cart_ptr->topo.cart.dims[i] ), mpi_errno, MPI_ERR_ARG, "**cartcoordinvalid",
 			"**cartcoordinvalid %d %d %d",i, coords[i], cart_ptr->topo.cart.dims[i]-1 );
 		}
diff --git a/src/mpi/topo/cart_shift.c b/src/mpi/topo/cart_shift.c
index 626527c..c58eeb3 100644
--- a/src/mpi/topo/cart_shift.c
+++ b/src/mpi/topo/cart_shift.c
@@ -29,7 +29,7 @@ int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source, int
 #undef FUNCNAME
 #define FUNCNAME MPIR_Cart_shift_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Cart_shift_impl(MPID_Comm *comm_ptr, int direction, int disp, int *rank_source, int *rank_dest)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -39,9 +39,9 @@ int MPIR_Cart_shift_impl(MPID_Comm *comm_ptr, int direction, int disp, int *rank
 
     cart_ptr = MPIR_Topology_get( comm_ptr );
 
-    MPIU_ERR_CHKANDJUMP((!cart_ptr || cart_ptr->kind != MPI_CART), mpi_errno, MPI_ERR_TOPOLOGY, "**notcarttopo");
-    MPIU_ERR_CHKANDJUMP((cart_ptr->topo.cart.ndims == 0), mpi_errno, MPI_ERR_TOPOLOGY, "**dimszero");
-    MPIU_ERR_CHKANDJUMP2((direction >= cart_ptr->topo.cart.ndims), mpi_errno, MPI_ERR_ARG, "**dimsmany",
+    MPIR_ERR_CHKANDJUMP((!cart_ptr || cart_ptr->kind != MPI_CART), mpi_errno, MPI_ERR_TOPOLOGY, "**notcarttopo");
+    MPIR_ERR_CHKANDJUMP((cart_ptr->topo.cart.ndims == 0), mpi_errno, MPI_ERR_TOPOLOGY, "**dimszero");
+    MPIR_ERR_CHKANDJUMP2((direction >= cart_ptr->topo.cart.ndims), mpi_errno, MPI_ERR_ARG, "**dimsmany",
                          "**dimsmany %d %d", cart_ptr->topo.cart.ndims, direction);
 
     /* Check for the case of a 0 displacement */
@@ -91,7 +91,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Cart_shift
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Cart_shift - Returns the shifted source and destination ranks, given a 
                  shift direction and amount
@@ -167,7 +167,7 @@ int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source,
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Cart_shift_impl(comm_ptr, direction, disp, rank_source, rank_dest);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/topo/cart_sub.c b/src/mpi/topo/cart_sub.c
index 7a7527c..e163633 100644
--- a/src/mpi/topo/cart_sub.c
+++ b/src/mpi/topo/cart_sub.c
@@ -31,7 +31,7 @@ int MPI_Cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm) __at
 #undef FUNCNAME
 #define FUNCNAME MPI_Cart_sub
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 
 MPI_Cart_sub - Partitions a communicator into subgroups which 
@@ -68,7 +68,7 @@ int MPI_Cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm)
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_CART_SUB);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -104,8 +104,8 @@ int MPI_Cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm)
     /* Check that the communicator already has a Cartesian topology */
     topo_ptr = MPIR_Topology_get( comm_ptr );
 
-    MPIU_ERR_CHKANDJUMP(!topo_ptr,mpi_errno,MPI_ERR_TOPOLOGY,"**notopology");
-    MPIU_ERR_CHKANDJUMP(topo_ptr->kind != MPI_CART,mpi_errno,MPI_ERR_TOPOLOGY,
+    MPIR_ERR_CHKANDJUMP(!topo_ptr,mpi_errno,MPI_ERR_TOPOLOGY,"**notopology");
+    MPIR_ERR_CHKANDJUMP(topo_ptr->kind != MPI_CART,mpi_errno,MPI_ERR_TOPOLOGY,
 			"**notcarttopo");
 
     ndims = topo_ptr->topo.cart.ndims;
@@ -123,7 +123,7 @@ int MPI_Cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm)
         /* ndims=0, or all entries in remain_dims are false.
            MPI 2.1 says return a 0D Cartesian topology. */
 	mpi_errno = MPIR_Cart_create_impl(comm_ptr, 0, NULL, NULL, 0, newcomm);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
 	/* Determine the number of remaining dimensions */
 	ndims_in_subcomm = 0;
@@ -150,7 +150,7 @@ int MPI_Cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm)
 	    }
 	}
 	mpi_errno = MPIR_Comm_split_impl( comm_ptr, color, key, &newcomm_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         *newcomm = newcomm_ptr->handle;
 	
@@ -199,7 +199,7 @@ int MPI_Cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm)
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_CART_SUB);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/topo/cartdim_get.c b/src/mpi/topo/cartdim_get.c
index 0fffc29..201e6eb 100644
--- a/src/mpi/topo/cartdim_get.c
+++ b/src/mpi/topo/cartdim_get.c
@@ -96,7 +96,7 @@ int MPI_Cartdim_get(MPI_Comm comm, int *ndims)
     
     cart_ptr = MPIR_Topology_get( comm_ptr );
 
-    MPIU_ERR_CHKANDJUMP((!cart_ptr || cart_ptr->kind != MPI_CART), mpi_errno, MPI_ERR_TOPOLOGY, "**notcarttopo");
+    MPIR_ERR_CHKANDJUMP((!cart_ptr || cart_ptr->kind != MPI_CART), mpi_errno, MPI_ERR_TOPOLOGY, "**notcarttopo");
 
     *ndims = cart_ptr->topo.cart.ndims;
     
diff --git a/src/mpi/topo/dims_create.c b/src/mpi/topo/dims_create.c
index ba9ae91..72d34c2 100644
--- a/src/mpi/topo/dims_create.c
+++ b/src/mpi/topo/dims_create.c
@@ -379,7 +379,7 @@ int MPI_Dims_create(int nnodes, int ndims, int dims[])
     else {
 	mpi_errno = MPIR_Dims_create( nnodes, ndims, dims );
     }
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/topo/dist_gr_create.c b/src/mpi/topo/dist_gr_create.c
index a34b485..170c587 100644
--- a/src/mpi/topo/dist_gr_create.c
+++ b/src/mpi/topo/dist_gr_create.c
@@ -34,7 +34,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[], const i
 #undef FUNCNAME
 #define FUNCNAME MPI_Dist_graph_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Dist_graph_create - MPI_DIST_GRAPH_CREATE returns a handle to a new
 communicator to which the distributed graph topology information is
@@ -99,7 +99,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_DIST_GRAPH_CREATE);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -165,7 +165,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
     /* following the spirit of the old topo interface, attributes do not
      * propagate to the new communicator (see MPI-2.1 pp. 243 line 11) */
     mpi_errno = MPIR_Comm_copy(comm_ptr, comm_size, &comm_dist_graph_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(comm_dist_graph_ptr != NULL);
 
     /* rin is an array of size comm_size containing pointers to arrays of
@@ -262,8 +262,8 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
 
     /* compute the number of peers I will recv from */
     mpi_errno = MPIR_Reduce_scatter_block_impl(rs, in_out_peers, 2, MPI_INT, MPI_SUM, comm_ptr, &errflag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
     MPIU_Assert(in_out_peers[0] <= comm_size && in_out_peers[0] >= 0);
     MPIU_Assert(in_out_peers[1] <= comm_size && in_out_peers[1] >= 0);
@@ -276,12 +276,12 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
         if (rin_sizes[i]) {
             /* send edges where i is a destination to process i */
             mpi_errno = MPIC_Isend(&rin[i][0], rin_sizes[i], MPI_INT, i, MPIR_TOPO_A_TAG, comm_ptr, &reqs[idx++], &errflag);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         if (rout_sizes[i]) {
             /* send edges where i is a source to process i */
             mpi_errno = MPIC_Isend(&rout[i][0], rout_sizes[i], MPI_INT, i, MPIR_TOPO_B_TAG, comm_ptr, &reqs[idx++], &errflag);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
     MPIU_Assert(idx <= (2 * comm_size));
@@ -314,17 +314,17 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
         int *buf;
         /* receive inbound edges */
         mpi_errno = MPIC_Probe(MPI_ANY_SOURCE, MPIR_TOPO_A_TAG, comm_old, &status);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPIR_Get_count_impl(&status, MPI_INT, &count);
         /* can't use CHKLMEM macros b/c we are in a loop */
         /* FIXME: Why not - there is only one allocated at a time. Is it only 
            that there is no defined macro to pop and free an item? */
         buf = MPIU_Malloc(count*sizeof(int));
-        MPIU_ERR_CHKANDJUMP(!buf, mpi_errno, MPI_ERR_OTHER, "**nomem");
+        MPIR_ERR_CHKANDJUMP(!buf, mpi_errno, MPI_ERR_OTHER, "**nomem");
 
         mpi_errno = MPIC_Recv(buf, count, MPI_INT, MPI_ANY_SOURCE, MPIR_TOPO_A_TAG, comm_ptr, MPI_STATUS_IGNORE, &errflag);
         /* FIXME: buf is never freed on error! */
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         
         for (j = 0; j < count/2; ++j) {
             int deg = dist_graph_ptr->indegree++;
@@ -349,16 +349,16 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
         int *buf;
         /* receive outbound edges */
         mpi_errno = MPIC_Probe(MPI_ANY_SOURCE, MPIR_TOPO_B_TAG, comm_old, &status);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPIR_Get_count_impl(&status, MPI_INT, &count);
         /* can't use CHKLMEM macros b/c we are in a loop */
         /* Why not? */
         buf = MPIU_Malloc(count*sizeof(int));
-        MPIU_ERR_CHKANDJUMP(!buf, mpi_errno, MPI_ERR_OTHER, "**nomem");
+        MPIR_ERR_CHKANDJUMP(!buf, mpi_errno, MPI_ERR_OTHER, "**nomem");
 
         mpi_errno = MPIC_Recv(buf, count, MPI_INT, MPI_ANY_SOURCE, MPIR_TOPO_B_TAG, comm_ptr, MPI_STATUS_IGNORE, &errflag);
         /* FIXME: buf is never freed on error! */
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         for (j = 0; j < count/2; ++j) {
             int deg = dist_graph_ptr->outdegree++;
@@ -378,7 +378,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
     }
 
     mpi_errno = MPIC_Waitall(idx, reqs, MPI_STATUSES_IGNORE, &errflag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* remove any excess memory allocation */
     MPIU_REALLOC_ORJUMP(dist_graph_ptr->in, dist_graph_ptr->indegree*sizeof(int), mpi_errno);
@@ -389,7 +389,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
     }
 
     mpi_errno = MPIR_Topology_put(comm_dist_graph_ptr, topo_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_CHKPMEM_COMMIT();
 
@@ -408,7 +408,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
     MPIU_CHKLMEM_FREEALL();
 
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_DIST_GRAPH_CREATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/topo/dist_gr_create_adj.c b/src/mpi/topo/dist_gr_create_adj.c
index ddeed10..a6df38b 100644
--- a/src/mpi/topo/dist_gr_create_adj.c
+++ b/src/mpi/topo/dist_gr_create_adj.c
@@ -35,7 +35,7 @@ int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old, int indegree, const int so
 #undef FUNCNAME
 #define FUNCNAME MPI_Dist_graph_create_adjacent
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Dist_graph_create_adjacent - returns a handle to a new communicator to
 which the distributed graph topology information is attached.
@@ -84,7 +84,7 @@ int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old,
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_DIST_GRAPH_CREATE_ADJACENT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -121,7 +121,7 @@ int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old,
             if (indegree > 0) {
                 MPIR_ERRTEST_ARGNULL(sources, "sources", mpi_errno);
                 if (sourceweights == MPI_UNWEIGHTED && destweights != MPI_UNWEIGHTED) {
-                    MPIU_ERR_SET(mpi_errno, MPI_ERR_TOPOLOGY, "**unweightedboth");
+                    MPIR_ERR_SET(mpi_errno, MPI_ERR_TOPOLOGY, "**unweightedboth");
                     goto fn_fail;
                 }
                 /* TODO check ranges for array elements too (**argarrayneg / **rankarray)*/
@@ -129,7 +129,7 @@ int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old,
             if (outdegree > 0) {
                 MPIR_ERRTEST_ARGNULL(destinations, "destinations", mpi_errno);
                 if (destweights == MPI_UNWEIGHTED && sourceweights != MPI_UNWEIGHTED) {
-                    MPIU_ERR_SET(mpi_errno, MPI_ERR_TOPOLOGY, "**unweightedboth");
+                    MPIR_ERR_SET(mpi_errno, MPI_ERR_TOPOLOGY, "**unweightedboth");
                     goto fn_fail;
                 }
             }
@@ -148,7 +148,7 @@ int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old,
     /* following the spirit of the old topo interface, attributes do not
      * propagate to the new communicator (see MPI-2.1 pp. 243 line 11) */
     mpi_errno = MPIR_Comm_copy(comm_ptr, comm_ptr->local_size, &comm_dist_graph_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Create the topology structure */
     MPIU_CHKPMEM_MALLOC(topo_ptr, MPIR_Topology *, sizeof(MPIR_Topology), mpi_errno, "topo_ptr");
@@ -175,14 +175,14 @@ int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old,
     }
 
     mpi_errno = MPIR_Topology_put(comm_dist_graph_ptr, topo_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_OBJ_PUBLISH_HANDLE(*comm_dist_graph, comm_dist_graph_ptr->handle);
     MPIU_CHKPMEM_COMMIT();
     /* ... end of body of routine ... */
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_DIST_GRAPH_CREATE_ADJACENT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpi/topo/dist_gr_neighb.c b/src/mpi/topo/dist_gr_neighb.c
index d9cb333..8d1d261 100644
--- a/src/mpi/topo/dist_gr_neighb.c
+++ b/src/mpi/topo/dist_gr_neighb.c
@@ -32,7 +32,7 @@ int MPI_Dist_graph_neighbors(MPI_Comm comm, int maxindegree, int sources[], int
 #undef FUNCNAME
 #define FUNCNAME MPIR_Dist_graph_neighbors_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Dist_graph_neighbors_impl(MPID_Comm *comm_ptr,
                                    int maxindegree, int sources[], int sourceweights[],
                                    int maxoutdegree, int destinations[], int destweights[])
@@ -41,7 +41,7 @@ int MPIR_Dist_graph_neighbors_impl(MPID_Comm *comm_ptr,
     MPIR_Topology *topo_ptr = NULL;
 
     topo_ptr = MPIR_Topology_get(comm_ptr);
-    MPIU_ERR_CHKANDJUMP(!topo_ptr || topo_ptr->kind != MPI_DIST_GRAPH, mpi_errno, MPI_ERR_TOPOLOGY, "**notdistgraphtopo");
+    MPIR_ERR_CHKANDJUMP(!topo_ptr || topo_ptr->kind != MPI_DIST_GRAPH, mpi_errno, MPI_ERR_TOPOLOGY, "**notdistgraphtopo");
 
     MPIU_Memcpy(sources, topo_ptr->topo.dist_graph.in, maxindegree*sizeof(int));
     MPIU_Memcpy(destinations, topo_ptr->topo.dist_graph.out, maxoutdegree*sizeof(int));
@@ -64,7 +64,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Dist_graph_neighbors
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Dist_graph_neighbors - Provides adjacency information for a distributed graph topology.
 
@@ -97,7 +97,7 @@ int MPI_Dist_graph_neighbors(MPI_Comm comm,
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
     /* FIXME: Why does this routine need a CS */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_DIST_GRAPH_NEIGHBORS);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -121,12 +121,12 @@ int MPI_Dist_graph_neighbors(MPI_Comm comm,
         {
             MPIR_Topology *topo_ptr = NULL;
             topo_ptr = MPIR_Topology_get(comm_ptr);
-            MPIU_ERR_CHKANDJUMP(!topo_ptr || topo_ptr->kind != MPI_DIST_GRAPH, mpi_errno, MPI_ERR_TOPOLOGY, "**notdistgraphtopo");
+            MPIR_ERR_CHKANDJUMP(!topo_ptr || topo_ptr->kind != MPI_DIST_GRAPH, mpi_errno, MPI_ERR_TOPOLOGY, "**notdistgraphtopo");
 
             MPIR_ERRTEST_ARGNEG(maxindegree, "maxindegree", mpi_errno);
             MPIR_ERRTEST_ARGNEG(maxoutdegree, "maxoutdegree", mpi_errno);
-            MPIU_ERR_CHKANDJUMP3((maxindegree < topo_ptr->topo.dist_graph.indegree), mpi_errno, MPI_ERR_ARG, "**argtoosmall", "**argtoosmall %s %d %d", "maxindegree", maxindegree, topo_ptr->topo.dist_graph.indegree);
-            MPIU_ERR_CHKANDJUMP3((maxoutdegree < topo_ptr->topo.dist_graph.outdegree), mpi_errno, MPI_ERR_ARG, "**argtoosmall", "**argtoosmall %s %d %d", "maxoutdegree", maxoutdegree, topo_ptr->topo.dist_graph.outdegree);
+            MPIR_ERR_CHKANDJUMP3((maxindegree < topo_ptr->topo.dist_graph.indegree), mpi_errno, MPI_ERR_ARG, "**argtoosmall", "**argtoosmall %s %d %d", "maxindegree", maxindegree, topo_ptr->topo.dist_graph.indegree);
+            MPIR_ERR_CHKANDJUMP3((maxoutdegree < topo_ptr->topo.dist_graph.outdegree), mpi_errno, MPI_ERR_ARG, "**argtoosmall", "**argtoosmall %s %d %d", "maxoutdegree", maxoutdegree, topo_ptr->topo.dist_graph.outdegree);
         }
         MPID_END_ERROR_CHECKS;
     }
@@ -138,13 +138,13 @@ int MPI_Dist_graph_neighbors(MPI_Comm comm,
     mpi_errno = MPIR_Dist_graph_neighbors_impl(comm_ptr,
                                                maxindegree, sources, sourceweights,
                                                maxoutdegree, destinations, destweights);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_DIST_GRAPH_NEIGHBORS);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/topo/dist_gr_neighb_count.c b/src/mpi/topo/dist_gr_neighb_count.c
index 39598d4..94087ea 100644
--- a/src/mpi/topo/dist_gr_neighb_count.c
+++ b/src/mpi/topo/dist_gr_neighb_count.c
@@ -31,14 +31,14 @@ int MPI_Dist_graph_neighbors_count(MPI_Comm comm, int *indegree, int *outdegree,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Dist_graph_neighbors_count_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Dist_graph_neighbors_count_impl(MPID_Comm *comm_ptr, int *indegree, int *outdegree, int *weighted)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIR_Topology *topo_ptr = NULL;
 
     topo_ptr = MPIR_Topology_get(comm_ptr);
-    MPIU_ERR_CHKANDJUMP(!topo_ptr || topo_ptr->kind != MPI_DIST_GRAPH, mpi_errno, MPI_ERR_TOPOLOGY, "**notdistgraphtopo");
+    MPIR_ERR_CHKANDJUMP(!topo_ptr || topo_ptr->kind != MPI_DIST_GRAPH, mpi_errno, MPI_ERR_TOPOLOGY, "**notdistgraphtopo");
     *indegree = topo_ptr->topo.dist_graph.indegree;
     *outdegree = topo_ptr->topo.dist_graph.outdegree;
     *weighted = topo_ptr->topo.dist_graph.is_weighted;
@@ -54,7 +54,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Dist_graph_neighbors_count
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Dist_graph_neighbors_count - Provides adjacency information for a distributed graph topology.
 
@@ -82,7 +82,7 @@ int MPI_Dist_graph_neighbors_count(MPI_Comm comm, int *indegree, int *outdegree,
     MPIR_ERRTEST_INITIALIZED_ORDIE();
 
     /* FIXME: Why does this routine require a CS? */
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_DIST_GRAPH_NEIGHBORS_COUNT);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -118,13 +118,13 @@ int MPI_Dist_graph_neighbors_count(MPI_Comm comm, int *indegree, int *outdegree,
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Dist_graph_neighbors_count_impl(comm_ptr, indegree, outdegree, weighted);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_DIST_GRAPH_NEIGHBORS_COUNT);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/topo/graph_get.c b/src/mpi/topo/graph_get.c
index 74d8590..a61e6bb 100644
--- a/src/mpi/topo/graph_get.c
+++ b/src/mpi/topo/graph_get.c
@@ -104,10 +104,10 @@ int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges,
     
     topo_ptr = MPIR_Topology_get( comm_ptr );
 
-    MPIU_ERR_CHKANDJUMP((!topo_ptr || topo_ptr->kind != MPI_GRAPH), mpi_errno, MPI_ERR_TOPOLOGY, "**notgraphtopo");
-    MPIU_ERR_CHKANDJUMP3((topo_ptr->topo.graph.nnodes > maxindex), mpi_errno, MPI_ERR_ARG, "**argtoosmall",
+    MPIR_ERR_CHKANDJUMP((!topo_ptr || topo_ptr->kind != MPI_GRAPH), mpi_errno, MPI_ERR_TOPOLOGY, "**notgraphtopo");
+    MPIR_ERR_CHKANDJUMP3((topo_ptr->topo.graph.nnodes > maxindex), mpi_errno, MPI_ERR_ARG, "**argtoosmall",
 			 "**argtoosmall %s %d %d", "maxindex", maxindex, topo_ptr->topo.graph.nnodes);
-    MPIU_ERR_CHKANDJUMP3((topo_ptr->topo.graph.nedges > maxedges), mpi_errno, MPI_ERR_ARG, "**argtoosmall",
+    MPIR_ERR_CHKANDJUMP3((topo_ptr->topo.graph.nedges > maxedges), mpi_errno, MPI_ERR_ARG, "**argtoosmall",
 			 "**argtoosmall %s %d %d", "maxedges", maxedges, topo_ptr->topo.graph.nedges);
     
     /* Get index */
diff --git a/src/mpi/topo/graph_map.c b/src/mpi/topo/graph_map.c
index 475676b..9e9cd05 100644
--- a/src/mpi/topo/graph_map.c
+++ b/src/mpi/topo/graph_map.c
@@ -45,7 +45,7 @@ int MPIR_Graph_map( const MPID_Comm *comm_ptr, int nnodes,
 #undef FUNCNAME
 #define FUNCNAME MPIR_Graph_map_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Graph_map_impl(const MPID_Comm *comm_ptr, int nnodes,
                         const int indx[], const int edges[], int *newrank)
 {
@@ -57,13 +57,13 @@ int MPIR_Graph_map_impl(const MPID_Comm *comm_ptr, int nnodes,
 						  (const int*) indx,
 						  (const int*) edges,
 						  newrank );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END USEREXTENSION-- */
     } else {
 	mpi_errno = MPIR_Graph_map( comm_ptr, nnodes,
 				   (const int*) indx,
 				   (const int*) edges, newrank );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
         
  fn_exit:
@@ -77,7 +77,7 @@ int MPIR_Graph_map_impl(const MPID_Comm *comm_ptr, int nnodes,
 #undef FUNCNAME
 #define FUNCNAME MPI_Graph_map
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Graph_map - Maps process to graph topology information
 
@@ -146,11 +146,11 @@ int MPI_Graph_map(MPI_Comm comm, int nnodes, const int indx[], const int edges[]
 
     /* ... body of routine ...  */
     
-    MPIU_ERR_CHKANDJUMP(comm_ptr->local_size < nnodes,mpi_errno,MPI_ERR_ARG, "**graphnnodes");
+    MPIR_ERR_CHKANDJUMP(comm_ptr->local_size < nnodes,mpi_errno,MPI_ERR_ARG, "**graphnnodes");
 
     mpi_errno = MPIR_Graph_map_impl(comm_ptr, nnodes, (const int*) indx,
                                     (const int*) edges, newrank);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/topo/graph_nbr.c b/src/mpi/topo/graph_nbr.c
index 51c1e0d..83229cb 100644
--- a/src/mpi/topo/graph_nbr.c
+++ b/src/mpi/topo/graph_nbr.c
@@ -31,7 +31,7 @@ int MPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int neighbors
 #undef FUNCNAME
 #define FUNCNAME MPIR_Graph_neighbors_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Graph_neighbors_impl(MPID_Comm *comm_ptr, int rank, int maxneighbors, int neighbors[])
 {
     int mpi_errno = MPI_SUCCESS;
@@ -40,8 +40,8 @@ int MPIR_Graph_neighbors_impl(MPID_Comm *comm_ptr, int rank, int maxneighbors, i
 
     graph_ptr = MPIR_Topology_get(comm_ptr);
 
-    MPIU_ERR_CHKANDJUMP((!graph_ptr || graph_ptr->kind != MPI_GRAPH), mpi_errno, MPI_ERR_TOPOLOGY, "**notgraphtopo");
-    MPIU_ERR_CHKANDJUMP2((rank < 0 || rank >= graph_ptr->topo.graph.nnodes), mpi_errno, MPI_ERR_RANK, "**rank",
+    MPIR_ERR_CHKANDJUMP((!graph_ptr || graph_ptr->kind != MPI_GRAPH), mpi_errno, MPI_ERR_TOPOLOGY, "**notgraphtopo");
+    MPIR_ERR_CHKANDJUMP2((rank < 0 || rank >= graph_ptr->topo.graph.nnodes), mpi_errno, MPI_ERR_RANK, "**rank",
                          "**rank %d %d", rank, graph_ptr->topo.graph.nnodes);
 
     /* Get location in edges array of the neighbors of the specified rank */
@@ -63,7 +63,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Graph_neighbors
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
  MPI_Graph_neighbors - Returns the neighbors of a node associated 
@@ -132,7 +132,7 @@ int MPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors,
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Graph_neighbors_impl(comm_ptr, rank, maxneighbors, neighbors);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     
     /* ... end of body of routine ... */
diff --git a/src/mpi/topo/graphcreate.c b/src/mpi/topo/graphcreate.c
index e13b073..b97f31d 100644
--- a/src/mpi/topo/graphcreate.c
+++ b/src/mpi/topo/graphcreate.c
@@ -41,7 +41,7 @@ int MPI_Graph_create(MPI_Comm comm_old, int nnodes, const int indx[], const int
 #undef FUNCNAME
 #define FUNCNAME MPIR_Graph_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Graph_create( MPID_Comm *comm_ptr, int nnodes, 
 		       const int indx[], const int edges[], int reorder, 
 		       MPI_Comm *comm_graph)
@@ -62,19 +62,19 @@ int MPIR_Graph_create( MPID_Comm *comm_ptr, int nnodes,
 	/* Allow the cart map routine to remap the assignment of ranks to 
 	   processes */
 	mpi_errno = MPIR_Graph_map_impl(comm_ptr, nnodes, indx, edges, &nrank);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* Create the new communicator with split, since we need to reorder
 	   the ranks (including the related internals, such as the connection
 	   tables */
         mpi_errno = MPIR_Comm_split_impl( comm_ptr,
                                           nrank == MPI_UNDEFINED ? MPI_UNDEFINED : 1,
                                           nrank, &newcomm_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
 	/* Just use the first nnodes processes in the communicator */
 	mpi_errno = MPIR_Comm_copy( (MPID_Comm *)comm_ptr, nnodes, 
 				    &newcomm_ptr );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 
@@ -135,7 +135,7 @@ int MPIR_Graph_create( MPID_Comm *comm_ptr, int nnodes,
 #undef FUNCNAME
 #define FUNCNAME MPI_Graph_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Graph_create - Makes a new communicator to which topology information
                  has been attached
@@ -177,7 +177,7 @@ int MPI_Graph_create(MPI_Comm comm_old, int nnodes, const int indx[],
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_GRAPH_CREATE);
     
     /* Validate parameters, especially handles needing to be converted */
@@ -310,7 +310,7 @@ int MPI_Graph_create(MPI_Comm comm_old, int nnodes, const int indx[],
 
   fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_GRAPH_CREATE);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
   fn_fail:
diff --git a/src/mpi/topo/graphdimsget.c b/src/mpi/topo/graphdimsget.c
index ff13528..2a84b86 100644
--- a/src/mpi/topo/graphdimsget.c
+++ b/src/mpi/topo/graphdimsget.c
@@ -99,7 +99,7 @@ int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges)
     
     topo_ptr = MPIR_Topology_get( comm_ptr );
 
-    MPIU_ERR_CHKANDJUMP((!topo_ptr || topo_ptr->kind != MPI_GRAPH), mpi_errno, MPI_ERR_TOPOLOGY, "**notgraphtopo");
+    MPIR_ERR_CHKANDJUMP((!topo_ptr || topo_ptr->kind != MPI_GRAPH), mpi_errno, MPI_ERR_TOPOLOGY, "**notgraphtopo");
 
     /* Set nnodes */
     *nnodes = topo_ptr->topo.graph.nnodes;
diff --git a/src/mpi/topo/graphnbrcnt.c b/src/mpi/topo/graphnbrcnt.c
index cf0faab..8d1014d 100644
--- a/src/mpi/topo/graphnbrcnt.c
+++ b/src/mpi/topo/graphnbrcnt.c
@@ -29,7 +29,7 @@ int MPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors) __attrib
 #undef FUNCNAME
 #define FUNCNAME MPIR_Graph_neighbors_count_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Graph_neighbors_count_impl(MPID_Comm *comm_ptr, int rank, int *nneighbors)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -37,8 +37,8 @@ int MPIR_Graph_neighbors_count_impl(MPID_Comm *comm_ptr, int rank, int *nneighbo
 
     graph_ptr = MPIR_Topology_get( comm_ptr );
 
-    MPIU_ERR_CHKANDJUMP((!graph_ptr || graph_ptr->kind != MPI_GRAPH), mpi_errno, MPI_ERR_TOPOLOGY, "**notgraphtopo");
-    MPIU_ERR_CHKANDJUMP2((rank < 0 || rank >= graph_ptr->topo.graph.nnodes), mpi_errno, MPI_ERR_RANK, "**rank",
+    MPIR_ERR_CHKANDJUMP((!graph_ptr || graph_ptr->kind != MPI_GRAPH), mpi_errno, MPI_ERR_TOPOLOGY, "**notgraphtopo");
+    MPIR_ERR_CHKANDJUMP2((rank < 0 || rank >= graph_ptr->topo.graph.nnodes), mpi_errno, MPI_ERR_RANK, "**rank",
                          "**rank %d %d", rank, graph_ptr->topo.graph.nnodes );
 
     if ( rank == 0 )
@@ -58,7 +58,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Graph_neighbors_count
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /*@
 MPI_Graph_neighbors_count - Returns the number of neighbors of a node
@@ -124,7 +124,7 @@ int MPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors)
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Graph_neighbors_count_impl(comm_ptr, rank, nneighbors);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/topo/inhb_allgather.c b/src/mpi/topo/inhb_allgather.c
index 635425a..fe512dc 100644
--- a/src/mpi/topo/inhb_allgather.c
+++ b/src/mpi/topo/inhb_allgather.c
@@ -33,7 +33,7 @@ int MPI_Ineighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sen
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ineighbor_allgather_default
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ineighbor_allgather_default(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -50,23 +50,23 @@ int MPIR_Ineighbor_allgather_default(const void *sendbuf, int sendcount, MPI_Dat
                                      (comm_ptr->local_size * recvcount * recvtype_extent));
 
     mpi_errno = MPIR_Topo_canon_nhb_count(comm_ptr, &indegree, &outdegree, &weighted);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_CHKLMEM_MALLOC(srcs, int *, indegree*sizeof(int), mpi_errno, "srcs");
     MPIU_CHKLMEM_MALLOC(dsts, int *, outdegree*sizeof(int), mpi_errno, "dsts");
     mpi_errno = MPIR_Topo_canon_nhb(comm_ptr,
                                     indegree, srcs, MPI_UNWEIGHTED,
                                     outdegree, dsts, MPI_UNWEIGHTED);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     for (k = 0; k < outdegree; ++k) {
         mpi_errno = MPID_Sched_send(sendbuf, sendcount, sendtype, dsts[k], comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     for (l = 0; l < indegree; ++l) {
         char *rb = ((char *)recvbuf) + l * recvcount * recvtype_extent;
         mpi_errno = MPID_Sched_recv(rb, recvcount, recvtype, srcs[l], comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPID_SCHED_BARRIER(s);
@@ -81,7 +81,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ineighbor_allgather_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ineighbor_allgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -92,20 +92,20 @@ int MPIR_Ineighbor_allgather_impl(const void *sendbuf, int sendcount, MPI_Dataty
     *request = MPI_REQUEST_NULL;
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Ineighbor_allgather != NULL);
     mpi_errno = comm_ptr->coll_fns->Ineighbor_allgather(sendbuf, sendcount, sendtype,
                                                         recvbuf, recvcount, recvtype,
                                                         comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -118,7 +118,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ineighbor_allgather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ineighbor_allgather - Nonblocking version of MPI_Neighbor_allgather.
 
@@ -146,7 +146,7 @@ int MPI_Ineighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sen
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_INEIGHBOR_ALLGATHER);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INEIGHBOR_ALLGATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -202,13 +202,13 @@ int MPI_Ineighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sen
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ineighbor_allgather_impl(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INEIGHBOR_ALLGATHER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/inhb_allgatherv.c b/src/mpi/topo/inhb_allgatherv.c
index 820bc4c..70ba414 100644
--- a/src/mpi/topo/inhb_allgatherv.c
+++ b/src/mpi/topo/inhb_allgatherv.c
@@ -33,7 +33,7 @@ int MPI_Ineighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype se
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ineighbor_allgatherv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ineighbor_allgatherv_default(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -54,23 +54,23 @@ int MPIR_Ineighbor_allgatherv_default(const void *sendbuf, int sendcount, MPI_Da
     }
 
     mpi_errno = MPIR_Topo_canon_nhb_count(comm_ptr, &indegree, &outdegree, &weighted);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_CHKLMEM_MALLOC(srcs, int *, indegree*sizeof(int), mpi_errno, "srcs");
     MPIU_CHKLMEM_MALLOC(dsts, int *, outdegree*sizeof(int), mpi_errno, "dsts");
     mpi_errno = MPIR_Topo_canon_nhb(comm_ptr,
                                     indegree, srcs, MPI_UNWEIGHTED,
                                     outdegree, dsts, MPI_UNWEIGHTED);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     for (k = 0; k < outdegree; ++k) {
         mpi_errno = MPID_Sched_send(sendbuf, sendcount, sendtype, dsts[k], comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     for (l = 0; l < indegree; ++l) {
         char *rb = ((char *)recvbuf) + displs[l] * recvtype_extent;
         mpi_errno = MPID_Sched_recv(rb, recvcounts[l], recvtype, srcs[l], comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPID_SCHED_BARRIER(s);
@@ -85,7 +85,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ineighbor_allgatherv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ineighbor_allgatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -96,20 +96,20 @@ int MPIR_Ineighbor_allgatherv_impl(const void *sendbuf, int sendcount, MPI_Datat
     *request = MPI_REQUEST_NULL;
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Ineighbor_allgatherv != NULL);
     mpi_errno = comm_ptr->coll_fns->Ineighbor_allgatherv(sendbuf, sendcount, sendtype,
                                                          recvbuf, recvcounts, displs, recvtype,
                                                          comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -122,7 +122,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ineighbor_allgatherv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ineighbor_allgatherv - Nonblocking version of MPI_Neighbor_allgatherv.
 
@@ -151,7 +151,7 @@ int MPI_Ineighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype se
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_INEIGHBOR_ALLGATHERV);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INEIGHBOR_ALLGATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -208,13 +208,13 @@ int MPI_Ineighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype se
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ineighbor_allgatherv_impl(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INEIGHBOR_ALLGATHERV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/inhb_alltoall.c b/src/mpi/topo/inhb_alltoall.c
index dcd06cd..8f0bc52 100644
--- a/src/mpi/topo/inhb_alltoall.c
+++ b/src/mpi/topo/inhb_alltoall.c
@@ -33,7 +33,7 @@ int MPI_Ineighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype send
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ineighbor_alltoall_default
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ineighbor_alltoall_default(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -54,24 +54,24 @@ int MPIR_Ineighbor_alltoall_default(const void *sendbuf, int sendcount, MPI_Data
                                      (comm_ptr->local_size * recvcount * recvtype_extent));
 
     mpi_errno = MPIR_Topo_canon_nhb_count(comm_ptr, &indegree, &outdegree, &weighted);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_CHKLMEM_MALLOC(srcs, int *, indegree*sizeof(int), mpi_errno, "srcs");
     MPIU_CHKLMEM_MALLOC(dsts, int *, outdegree*sizeof(int), mpi_errno, "dsts");
     mpi_errno = MPIR_Topo_canon_nhb(comm_ptr,
                                     indegree, srcs, MPI_UNWEIGHTED,
                                     outdegree, dsts, MPI_UNWEIGHTED);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     for (k = 0; k < outdegree; ++k) {
         char *sb = ((char *)sendbuf) + k * sendcount * sendtype_extent;
         mpi_errno = MPID_Sched_send(sb, sendcount, sendtype, dsts[k], comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     for (l = 0; l < indegree; ++l) {
         char *rb = ((char *)recvbuf) + l * recvcount * recvtype_extent;
         mpi_errno = MPID_Sched_recv(rb, recvcount, recvtype, srcs[l], comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPID_SCHED_BARRIER(s);
@@ -86,7 +86,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ineighbor_alltoall_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ineighbor_alltoall_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -97,20 +97,20 @@ int MPIR_Ineighbor_alltoall_impl(const void *sendbuf, int sendcount, MPI_Datatyp
     *request = MPI_REQUEST_NULL;
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Ineighbor_alltoall != NULL);
     mpi_errno = comm_ptr->coll_fns->Ineighbor_alltoall(sendbuf, sendcount, sendtype,
                                                        recvbuf, recvcount, recvtype,
                                                        comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 
 fn_exit:
@@ -124,7 +124,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ineighbor_alltoall
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ineighbor_alltoall - Nonblocking version of MPI_Neighbor_alltoall.
 
@@ -152,7 +152,7 @@ int MPI_Ineighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype send
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_INEIGHBOR_ALLTOALL);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INEIGHBOR_ALLTOALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -208,13 +208,13 @@ int MPI_Ineighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype send
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ineighbor_alltoall_impl(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INEIGHBOR_ALLTOALL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/inhb_alltoallv.c b/src/mpi/topo/inhb_alltoallv.c
index ee8c4c9..af999f1 100644
--- a/src/mpi/topo/inhb_alltoallv.c
+++ b/src/mpi/topo/inhb_alltoallv.c
@@ -34,7 +34,7 @@ int MPI_Ineighbor_alltoallv(const void *sendbuf, const int sendcounts[], const i
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ineighbor_alltoallv_default
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ineighbor_alltoallv_default(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -58,24 +58,24 @@ int MPIR_Ineighbor_alltoallv_default(const void *sendbuf, const int sendcounts[]
     }
 
     mpi_errno = MPIR_Topo_canon_nhb_count(comm_ptr, &indegree, &outdegree, &weighted);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_CHKLMEM_MALLOC(srcs, int *, indegree*sizeof(int), mpi_errno, "srcs");
     MPIU_CHKLMEM_MALLOC(dsts, int *, outdegree*sizeof(int), mpi_errno, "dsts");
     mpi_errno = MPIR_Topo_canon_nhb(comm_ptr,
                                     indegree, srcs, MPI_UNWEIGHTED,
                                     outdegree, dsts, MPI_UNWEIGHTED);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     for (k = 0; k < outdegree; ++k) {
         char *sb = ((char *)sendbuf) + sdispls[k] * sendtype_extent;
         mpi_errno = MPID_Sched_send(sb, sendcounts[k], sendtype, dsts[k], comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     for (l = 0; l < indegree; ++l) {
         char *rb = ((char *)recvbuf) + rdispls[l] * recvtype_extent;
         mpi_errno = MPID_Sched_recv(rb, recvcounts[l], recvtype, srcs[l], comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPID_SCHED_BARRIER(s);
@@ -90,7 +90,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ineighbor_alltoallv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ineighbor_alltoallv_impl(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -101,20 +101,20 @@ int MPIR_Ineighbor_alltoallv_impl(const void *sendbuf, const int sendcounts[], c
     *request = MPI_REQUEST_NULL;
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Ineighbor_alltoallv != NULL);
     mpi_errno = comm_ptr->coll_fns->Ineighbor_alltoallv(sendbuf, sendcounts, sdispls, sendtype,
                                                         recvbuf, recvcounts, rdispls, recvtype,
                                                         comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -127,7 +127,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ineighbor_alltoallv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ineighbor_alltoallv - Nonblocking version of MPI_Neighbor_alltoallv.
 
@@ -157,7 +157,7 @@ int MPI_Ineighbor_alltoallv(const void *sendbuf, const int sendcounts[], const i
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_INEIGHBOR_ALLTOALLV);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INEIGHBOR_ALLTOALLV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -212,13 +212,13 @@ int MPI_Ineighbor_alltoallv(const void *sendbuf, const int sendcounts[], const i
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ineighbor_alltoallv_impl(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INEIGHBOR_ALLTOALLV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/inhb_alltoallw.c b/src/mpi/topo/inhb_alltoallw.c
index d30c702..b492a7c 100644
--- a/src/mpi/topo/inhb_alltoallw.c
+++ b/src/mpi/topo/inhb_alltoallw.c
@@ -33,7 +33,7 @@ int MPI_Ineighbor_alltoallw(const void *sendbuf, const int sendcounts[],
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ineighbor_alltoallw_default
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ineighbor_alltoallw_default(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPID_Comm *comm_ptr, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -43,13 +43,13 @@ int MPIR_Ineighbor_alltoallw_default(const void *sendbuf, const int sendcounts[]
     MPIU_CHKLMEM_DECL(2);
 
     mpi_errno = MPIR_Topo_canon_nhb_count(comm_ptr, &indegree, &outdegree, &weighted);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_CHKLMEM_MALLOC(srcs, int *, indegree*sizeof(int), mpi_errno, "srcs");
     MPIU_CHKLMEM_MALLOC(dsts, int *, outdegree*sizeof(int), mpi_errno, "dsts");
     mpi_errno = MPIR_Topo_canon_nhb(comm_ptr,
                                     indegree, srcs, MPI_UNWEIGHTED,
                                     outdegree, dsts, MPI_UNWEIGHTED);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     for (k = 0; k < outdegree; ++k) {
         char *sb;
@@ -57,7 +57,7 @@ int MPIR_Ineighbor_alltoallw_default(const void *sendbuf, const int sendcounts[]
 
         sb = ((char *)sendbuf) + sdispls[k];
         mpi_errno = MPID_Sched_send(sb, sendcounts[k], sendtypes[k], dsts[k], comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     for (l = 0; l < indegree; ++l) {
@@ -66,7 +66,7 @@ int MPIR_Ineighbor_alltoallw_default(const void *sendbuf, const int sendcounts[]
 
         rb = ((char *)recvbuf) + rdispls[l];
         mpi_errno = MPID_Sched_recv(rb, recvcounts[l], recvtypes[l], srcs[l], comm_ptr, s);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPID_SCHED_BARRIER(s);
@@ -81,7 +81,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Ineighbor_alltoallw_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Ineighbor_alltoallw_impl(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPID_Comm *comm_ptr, MPI_Request *request)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -92,20 +92,20 @@ int MPIR_Ineighbor_alltoallw_impl(const void *sendbuf, const int sendcounts[], c
     *request = MPI_REQUEST_NULL;
 
     mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_Sched_create(&s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(comm_ptr->coll_fns != NULL);
     MPIU_Assert(comm_ptr->coll_fns->Ineighbor_alltoallw != NULL);
     mpi_errno = comm_ptr->coll_fns->Ineighbor_alltoallw(sendbuf, sendcounts, sdispls, sendtypes,
                                                         recvbuf, recvcounts, rdispls, recvtypes,
                                                         comm_ptr, s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
     if (reqp)
         *request = reqp->handle;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -118,7 +118,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Ineighbor_alltoallw
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Ineighbor_alltoallw - Nonblocking version of MPI_Neighbor_alltoallw.
 
@@ -148,7 +148,7 @@ int MPI_Ineighbor_alltoallw(const void *sendbuf, const int sendcounts[], const M
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_INEIGHBOR_ALLTOALLW);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INEIGHBOR_ALLTOALLW);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -185,13 +185,13 @@ int MPI_Ineighbor_alltoallw(const void *sendbuf, const int sendcounts[], const M
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Ineighbor_alltoallw_impl(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm_ptr, request);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_INEIGHBOR_ALLTOALLW);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/nhb_allgather.c b/src/mpi/topo/nhb_allgather.c
index f8823cc..3ef42ea 100644
--- a/src/mpi/topo/nhb_allgather.c
+++ b/src/mpi/topo/nhb_allgather.c
@@ -31,7 +31,7 @@ int MPI_Neighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype send
 #undef FUNCNAME
 #define FUNCNAME MPIR_Neighbor_allgather_default
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Neighbor_allgather_default(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -39,9 +39,9 @@ int MPIR_Neighbor_allgather_default(const void *sendbuf, int sendcount, MPI_Data
 
     /* just call the nonblocking version and wait on it */
     mpi_errno = MPIR_Ineighbor_allgather_impl(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, &req);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPIR_Wait_impl(&req, MPI_STATUS_IGNORE);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -52,7 +52,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Neighbor_allgather_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Neighbor_allgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -62,7 +62,7 @@ int MPIR_Neighbor_allgather_impl(const void *sendbuf, int sendcount, MPI_Datatyp
     mpi_errno = comm_ptr->coll_fns->Neighbor_allgather(sendbuf, sendcount, sendtype,
                                                        recvbuf, recvcount, recvtype,
                                                        comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -75,7 +75,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Neighbor_allgather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Neighbor_allgather - In this function, each process i gathers data items
 from each process j if an edge (j,i) exists in the topology graph, and each
@@ -106,7 +106,7 @@ int MPI_Neighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype send
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_NEIGHBOR_ALLGATHER);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_NEIGHBOR_ALLGATHER);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -157,13 +157,13 @@ int MPI_Neighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype send
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Neighbor_allgather_impl(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_NEIGHBOR_ALLGATHER);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/nhb_allgatherv.c b/src/mpi/topo/nhb_allgatherv.c
index 22d9171..97b621d 100644
--- a/src/mpi/topo/nhb_allgatherv.c
+++ b/src/mpi/topo/nhb_allgatherv.c
@@ -32,7 +32,7 @@ int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sen
 #undef FUNCNAME
 #define FUNCNAME MPIR_Neighbor_allgatherv_default
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Neighbor_allgatherv_default(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -43,9 +43,9 @@ int MPIR_Neighbor_allgatherv_default(const void *sendbuf, int sendcount, MPI_Dat
     mpi_errno = MPIR_Ineighbor_allgatherv_impl(sendbuf, sendcount, sendtype,
                                                recvbuf, recvcounts, displs, recvtype,
                                                comm_ptr, &req);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPIR_Wait_impl(&req, MPI_STATUS_IGNORE);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -56,7 +56,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Neighbor_allgatherv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Neighbor_allgatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -66,7 +66,7 @@ int MPIR_Neighbor_allgatherv_impl(const void *sendbuf, int sendcount, MPI_Dataty
     mpi_errno = comm_ptr->coll_fns->Neighbor_allgatherv(sendbuf, sendcount, sendtype,
                                                         recvbuf, recvcounts, displs, recvtype,
                                                         comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -79,7 +79,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Neighbor_allgatherv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Neighbor_allgatherv - The vector variant of MPI_Neighbor_allgather.
 
@@ -107,7 +107,7 @@ int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sen
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_NEIGHBOR_ALLGATHERV);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_NEIGHBOR_ALLGATHERV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -158,13 +158,13 @@ int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sen
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Neighbor_allgatherv_impl(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_NEIGHBOR_ALLGATHERV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/nhb_alltoall.c b/src/mpi/topo/nhb_alltoall.c
index 2f4d4fc..c6629d8 100644
--- a/src/mpi/topo/nhb_alltoall.c
+++ b/src/mpi/topo/nhb_alltoall.c
@@ -31,7 +31,7 @@ int MPI_Neighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendt
 #undef FUNCNAME
 #define FUNCNAME MPIR_Neighbor_alltoall_default
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Neighbor_alltoall_default(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -41,9 +41,9 @@ int MPIR_Neighbor_alltoall_default(const void *sendbuf, int sendcount, MPI_Datat
     mpi_errno = MPIR_Ineighbor_alltoall_impl(sendbuf, sendcount, sendtype,
                                              recvbuf, recvcount, recvtype,
                                              comm_ptr, &req);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPIR_Wait_impl(&req, MPI_STATUS_IGNORE);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -54,7 +54,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Neighbor_alltoall_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Neighbor_alltoall_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -64,7 +64,7 @@ int MPIR_Neighbor_alltoall_impl(const void *sendbuf, int sendcount, MPI_Datatype
     mpi_errno = comm_ptr->coll_fns->Neighbor_alltoall(sendbuf, sendcount, sendtype,
                                                       recvbuf, recvcount, recvtype,
                                                       comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -77,7 +77,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Neighbor_alltoall
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Neighbor_alltoall - In this function, each process i receives data items
 from each process j if an edge (j,i) exists in the topology graph or Cartesian
@@ -110,7 +110,7 @@ int MPI_Neighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendt
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_NEIGHBOR_ALLTOALL);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_NEIGHBOR_ALLTOALL);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -161,13 +161,13 @@ int MPI_Neighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendt
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Neighbor_alltoall_impl(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_NEIGHBOR_ALLTOALL);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/nhb_alltoallv.c b/src/mpi/topo/nhb_alltoallv.c
index 1a67fe7..1233985 100644
--- a/src/mpi/topo/nhb_alltoallv.c
+++ b/src/mpi/topo/nhb_alltoallv.c
@@ -32,7 +32,7 @@ int MPI_Neighbor_alltoallv(const void *sendbuf, const int sendcounts[], const in
 #undef FUNCNAME
 #define FUNCNAME MPIR_Neighbor_alltoallv_default
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Neighbor_alltoallv_default(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -40,9 +40,9 @@ int MPIR_Neighbor_alltoallv_default(const void *sendbuf, const int sendcounts[],
 
     /* just call the nonblocking version and wait on it */
     mpi_errno = MPIR_Ineighbor_alltoallv_impl(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm_ptr, &req);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPIR_Wait_impl(&req, MPI_STATUS_IGNORE);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -53,7 +53,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Neighbor_alltoallv_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Neighbor_alltoallv_impl(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -63,7 +63,7 @@ int MPIR_Neighbor_alltoallv_impl(const void *sendbuf, const int sendcounts[], co
     mpi_errno = comm_ptr->coll_fns->Neighbor_alltoallv(sendbuf, sendcounts, sdispls, sendtype,
                                                        recvbuf, recvcounts, rdispls, recvtype,
                                                        comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 fn_exit:
     return mpi_errno;
 fn_fail:
@@ -75,7 +75,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Neighbor_alltoallv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Neighbor_alltoallv - The vector variant of MPI_Neighbor_alltoall allows
 sending/receiving different numbers of elements to and from each neighbor.
@@ -105,7 +105,7 @@ int MPI_Neighbor_alltoallv(const void *sendbuf, const int sendcounts[], const in
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_NEIGHBOR_ALLTOALLV);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_NEIGHBOR_ALLTOALLV);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -156,13 +156,13 @@ int MPI_Neighbor_alltoallv(const void *sendbuf, const int sendcounts[], const in
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Neighbor_alltoallv_impl(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_NEIGHBOR_ALLTOALLV);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/nhb_alltoallw.c b/src/mpi/topo/nhb_alltoallw.c
index 8be4077..f67d187 100644
--- a/src/mpi/topo/nhb_alltoallw.c
+++ b/src/mpi/topo/nhb_alltoallw.c
@@ -31,7 +31,7 @@ int MPI_Neighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MP
 #undef FUNCNAME
 #define FUNCNAME MPIR_Neighbor_alltoallw_default
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Neighbor_alltoallw_default(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -39,9 +39,9 @@ int MPIR_Neighbor_alltoallw_default(const void *sendbuf, const int sendcounts[],
 
     /* just call the nonblocking version and wait on it */
     mpi_errno = MPIR_Ineighbor_alltoallw_impl(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm_ptr, &req);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPIR_Wait_impl(&req, MPI_STATUS_IGNORE);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -52,7 +52,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Neighbor_alltoallw_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Neighbor_alltoallw_impl(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -62,7 +62,7 @@ int MPIR_Neighbor_alltoallw_impl(const void *sendbuf, const int sendcounts[], co
     mpi_errno = comm_ptr->coll_fns->Neighbor_alltoallw(sendbuf, sendcounts, sdispls, sendtypes,
                                                        recvbuf, recvcounts, rdispls, recvtypes,
                                                        comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -75,7 +75,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_Neighbor_alltoallw
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_Neighbor_alltoallw - Like MPI_Neighbor_alltoallv but it allows one to send
 and receive with different types to and from each neighbor.
@@ -105,7 +105,7 @@ int MPI_Neighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MP
     MPID_Comm *comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_NEIGHBOR_ALLTOALLW);
 
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_NEIGHBOR_ALLTOALLW);
 
     /* Validate parameters, especially handles needing to be converted */
@@ -141,13 +141,13 @@ int MPI_Neighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MP
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_Neighbor_alltoallw_impl(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
 fn_exit:
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_NEIGHBOR_ALLTOALLW);
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     return mpi_errno;
 
 fn_fail:
diff --git a/src/mpi/topo/topoutil.c b/src/mpi/topo/topoutil.c
index 445d9ac..5055673 100644
--- a/src/mpi/topo/topoutil.c
+++ b/src/mpi/topo/topoutil.c
@@ -48,7 +48,7 @@ MPIR_Topology *MPIR_Topology_get( MPID_Comm *comm_ptr )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Topology_put
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Topology_put( MPID_Comm *comm_ptr, MPIR_Topology *topo_ptr )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -64,12 +64,12 @@ int MPIR_Topology_put( MPID_Comm *comm_ptr, MPIR_Topology *topo_ptr )
                                                   MPIR_Topology_delete_fn,
                                                   &MPIR_Topology_keyval, 0 );
 	/* Register the finalize handler */
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPIR_Add_finalize( MPIR_Topology_finalize, (void*)0,
 			   MPIR_FINALIZE_CALLBACK_PRIO-1);
     }
     mpi_errno = MPIR_Comm_set_attr_impl(comm_ptr, MPIR_Topology_keyval, topo_ptr, MPIR_ATTR_PTR);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
  fn_exit:
     return mpi_errno;
@@ -124,7 +124,7 @@ static int *MPIR_Copy_array( int n, const int a[], int *err )
 #undef FUNCNAME
 #define FUNCNAME MPIR_Topology_copy_fn
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Topology_copy_fn ( MPI_Comm comm ATTRIBUTE((unused)), 
 				   int keyval ATTRIBUTE((unused)), 
 				   void *extra_data ATTRIBUTE((unused)),
@@ -152,7 +152,7 @@ static int MPIR_Topology_copy_fn ( MPI_Comm comm ATTRIBUTE((unused)),
                 MPIR_Copy_array(old_topology->topo.kind_.count_field_, \
                                 old_topology->topo.kind_.array_field_, \
                                 &mpi_errno); \
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno); \
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno); \
             MPIU_CHKPMEM_REGISTER(copy_topology->topo.kind_.array_field_); \
         } while (0)
 
@@ -202,7 +202,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Topology_delete_fn
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIR_Topology_delete_fn ( MPI_Comm comm ATTRIBUTE((unused)), 
 				     int keyval ATTRIBUTE((unused)), 
 				     void *attr_val, 
@@ -271,7 +271,7 @@ static int MPIR_Topology_delete_fn ( MPI_Comm comm ATTRIBUTE((unused)),
 #undef FUNCNAME
 #define FUNCNAME MPIR_Topo_canon_nhb_count
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Topo_canon_nhb_count(MPID_Comm *comm_ptr, int *indegree, int *outdegree, int *weighted)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -282,12 +282,12 @@ int MPIR_Topo_canon_nhb_count(MPID_Comm *comm_ptr, int *indegree, int *outdegree
     /* TODO consider dispatching via a vtable instead of doing if/else */
     if (topo_ptr->kind == MPI_DIST_GRAPH) {
         mpi_errno = MPIR_Dist_graph_neighbors_count_impl(comm_ptr, indegree, outdegree, weighted);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else if (topo_ptr->kind == MPI_GRAPH) {
         int nneighbors = 0;
         mpi_errno = MPIR_Graph_neighbors_count_impl(comm_ptr, comm_ptr->rank, &nneighbors);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         *indegree = *outdegree = nneighbors;
         *weighted = FALSE;
     }
@@ -309,7 +309,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIR_Topo_canon_nhb
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Topo_canon_nhb(MPID_Comm *comm_ptr,
                         int indegree, int sources[], int inweights[],
                         int outdegree, int dests[], int outweights[])
@@ -327,12 +327,12 @@ int MPIR_Topo_canon_nhb(MPID_Comm *comm_ptr,
         mpi_errno = MPIR_Dist_graph_neighbors_impl(comm_ptr,
                                                    indegree, sources, inweights,
                                                    outdegree, dests, outweights);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else if (topo_ptr->kind == MPI_GRAPH) {
         MPIU_Assert(indegree == outdegree);
         mpi_errno = MPIR_Graph_neighbors_impl(comm_ptr, comm_ptr->rank, indegree, sources);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPIU_Memcpy(dests, sources, outdegree*sizeof(*dests));
         /* ignore inweights/outweights */
     }
@@ -344,7 +344,7 @@ int MPIR_Topo_canon_nhb(MPID_Comm *comm_ptr,
 
         for (d = 0; d < topo_ptr->topo.cart.ndims; ++d) {
             mpi_errno = MPIR_Cart_shift_impl(comm_ptr, d, 1, &sources[2*d], &sources[2*d+1]);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             dests[2*d]   = sources[2*d];
             dests[2*d+1] = sources[2*d+1];
diff --git a/src/mpi_t/cat_changed.c b/src/mpi_t/cat_changed.c
index 2ca22fc..a77ac52 100644
--- a/src/mpi_t/cat_changed.c
+++ b/src/mpi_t/cat_changed.c
@@ -28,7 +28,7 @@ int MPI_T_category_changed(int *stamp) __attribute__((weak,alias("PMPI_T_categor
 #undef FUNCNAME
 #define FUNCNAME MPI_T_category_changed
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_category_changed - Get the timestamp indicating the last change to the categories
 
diff --git a/src/mpi_t/cat_get_categories.c b/src/mpi_t/cat_get_categories.c
index eaf94a3..3f992b7 100644
--- a/src/mpi_t/cat_get_categories.c
+++ b/src/mpi_t/cat_get_categories.c
@@ -29,7 +29,7 @@ int MPI_T_category_get_categories(int cat_index, int len, int indices[]) __attri
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_category_get_categories_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_category_get_categories_impl(int cat_index, int len, int indices[])
 {
     int mpi_errno = MPI_SUCCESS;
@@ -55,7 +55,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_category_get_categories
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_category_get_categories - Get sub-categories in a category
 
@@ -100,7 +100,7 @@ int MPI_T_category_get_categories(int cat_index, int len, int indices[])
     if (len == 0) goto fn_exit;
 
     mpi_errno = MPIR_T_category_get_categories_impl(cat_index, len, indices);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi_t/cat_get_cvars.c b/src/mpi_t/cat_get_cvars.c
index 0bb525f..a49fccb 100644
--- a/src/mpi_t/cat_get_cvars.c
+++ b/src/mpi_t/cat_get_cvars.c
@@ -29,7 +29,7 @@ int MPI_T_category_get_cvars(int cat_index, int len, int indices[]) __attribute_
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_category_get_cvars_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_category_get_cvars_impl(int cat_index, int len, int indices[])
 {
     int mpi_errno = MPI_SUCCESS;
@@ -55,7 +55,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_category_get_cvars
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_category_get_cvars - Get control variables in a category
 
@@ -100,7 +100,7 @@ int MPI_T_category_get_cvars(int cat_index, int len, int indices[])
     if (len == 0) goto fn_exit;
 
     mpi_errno = MPIR_T_category_get_cvars_impl(cat_index, len, indices);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi_t/cat_get_index.c b/src/mpi_t/cat_get_index.c
index 331ef2b..e66349f 100644
--- a/src/mpi_t/cat_get_index.c
+++ b/src/mpi_t/cat_get_index.c
@@ -28,7 +28,7 @@ int MPI_T_category_get_index(const char *name, int *cat_index) __attribute__((we
 #undef FUNCNAME
 #define FUNCNAME MPI_T_category_get_index
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_category_get_index - Get the index of a category
 
diff --git a/src/mpi_t/cat_get_info.c b/src/mpi_t/cat_get_info.c
index b9b196b..fa76a54 100644
--- a/src/mpi_t/cat_get_info.c
+++ b/src/mpi_t/cat_get_info.c
@@ -29,7 +29,7 @@ int MPI_T_category_get_info(int cat_index, char *name, int *name_len, char *desc
 #undef FUNCNAME
 #define FUNCNAME MPI_T_category_get_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_category_get_info - Get the information about a category
 
diff --git a/src/mpi_t/cat_get_num.c b/src/mpi_t/cat_get_num.c
index beda624..b3a83df 100644
--- a/src/mpi_t/cat_get_num.c
+++ b/src/mpi_t/cat_get_num.c
@@ -28,7 +28,7 @@ int MPI_T_category_get_num(int *num_cat) __attribute__((weak,alias("PMPI_T_categ
 #undef FUNCNAME
 #define FUNCNAME MPI_T_category_get_num
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_category_get_num - Get the number of categories
 
diff --git a/src/mpi_t/cat_get_pvars.c b/src/mpi_t/cat_get_pvars.c
index c189097..788b3dd 100644
--- a/src/mpi_t/cat_get_pvars.c
+++ b/src/mpi_t/cat_get_pvars.c
@@ -29,7 +29,7 @@ int MPI_T_category_get_pvars(int cat_index, int len, int indices[]) __attribute_
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_category_get_pvars_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_category_get_pvars_impl(int cat_index, int len, int indices[])
 {
     int mpi_errno = MPI_SUCCESS;
@@ -55,7 +55,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_category_get_pvars
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_category_get_pvars - Get performance variables in a category
 
@@ -100,7 +100,7 @@ int MPI_T_category_get_pvars(int cat_index, int len, int indices[])
     if (len == 0) goto fn_exit;
 
     mpi_errno = MPIR_T_category_get_pvars_impl(cat_index, len, indices);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi_t/cvar_get_index.c b/src/mpi_t/cvar_get_index.c
index e40abbb..f1a5d76 100644
--- a/src/mpi_t/cvar_get_index.c
+++ b/src/mpi_t/cvar_get_index.c
@@ -28,7 +28,7 @@ int MPI_T_cvar_get_index(const char *name, int *cvar_index) __attribute__((weak,
 #undef FUNCNAME
 #define FUNCNAME MPI_T_cvar_get_index
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_cvar_get_index - Get the index of a control variable
 
diff --git a/src/mpi_t/cvar_get_info.c b/src/mpi_t/cvar_get_info.c
index 8bbbe94..354b6b1 100644
--- a/src/mpi_t/cvar_get_info.c
+++ b/src/mpi_t/cvar_get_info.c
@@ -30,7 +30,7 @@ int MPI_T_cvar_get_info(int cvar_index, char *name, int *name_len, int *verbosit
 #undef FUNCNAME
 #define FUNCNAME MPI_T_cvar_get_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_cvar_get_info - Get the information about a control variable
 
diff --git a/src/mpi_t/cvar_get_num.c b/src/mpi_t/cvar_get_num.c
index bd55221..eece0d1 100644
--- a/src/mpi_t/cvar_get_num.c
+++ b/src/mpi_t/cvar_get_num.c
@@ -28,7 +28,7 @@ int MPI_T_cvar_get_num(int *num_cvar) __attribute__((weak,alias("PMPI_T_cvar_get
 #undef FUNCNAME
 #define FUNCNAME MPI_T_cvar_get_num
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_cvar_get_num - Get the number of control variables
 
diff --git a/src/mpi_t/cvar_handle_alloc.c b/src/mpi_t/cvar_handle_alloc.c
index e0ea9fa..3b502a8 100644
--- a/src/mpi_t/cvar_handle_alloc.c
+++ b/src/mpi_t/cvar_handle_alloc.c
@@ -30,7 +30,7 @@ int MPI_T_cvar_handle_alloc(int cvar_index, void *obj_handle, MPI_T_cvar_handle
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_cvar_handle_alloc_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_cvar_handle_alloc_impl(int cvar_index, void *obj_handle, MPI_T_cvar_handle *handle, int *count)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -78,7 +78,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_cvar_handle_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_cvar_handle_alloc - Allocate a handle for a control variable
 
@@ -126,7 +126,7 @@ int MPI_T_cvar_handle_alloc(int cvar_index, void *obj_handle, MPI_T_cvar_handle
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_T_cvar_handle_alloc_impl(cvar_index, obj_handle, handle, count);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi_t/cvar_handle_free.c b/src/mpi_t/cvar_handle_free.c
index 1d2e2a6..da2544f 100644
--- a/src/mpi_t/cvar_handle_free.c
+++ b/src/mpi_t/cvar_handle_free.c
@@ -28,7 +28,7 @@ int MPI_T_cvar_handle_free(MPI_T_cvar_handle *handle) __attribute__((weak,alias(
 #undef FUNCNAME
 #define FUNCNAME MPI_T_cvar_handle_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_cvar_handle_free - Free an existing handle for a control variable
 
diff --git a/src/mpi_t/cvar_read.c b/src/mpi_t/cvar_read.c
index 19413ae..789bc36 100644
--- a/src/mpi_t/cvar_read.c
+++ b/src/mpi_t/cvar_read.c
@@ -29,7 +29,7 @@ int MPI_T_cvar_read(MPI_T_cvar_handle handle, void *buf) __attribute__((weak,ali
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_cvar_read_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_cvar_read_impl(MPI_T_cvar_handle handle, void *buf)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -67,7 +67,7 @@ int MPIR_T_cvar_read_impl(MPI_T_cvar_handle handle, void *buf)
         break;
     default:
          /* FIXME the error handling code may not have been setup yet */
-        MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_INTERN, "**intern", "**intern %s", "unexpected parameter type");
+        MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_INTERN, "**intern", "**intern %s", "unexpected parameter type");
         break;
     }
 
@@ -82,7 +82,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_cvar_read
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_cvar_read - Read the value of a control variable
 
@@ -123,7 +123,7 @@ int MPI_T_cvar_read(MPI_T_cvar_handle handle, void *buf)
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_T_cvar_read_impl(handle, buf);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi_t/cvar_write.c b/src/mpi_t/cvar_write.c
index 8573332..3fdc908 100644
--- a/src/mpi_t/cvar_write.c
+++ b/src/mpi_t/cvar_write.c
@@ -29,7 +29,7 @@ int MPI_T_cvar_write(MPI_T_cvar_handle handle, const void *buf) __attribute__((w
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_cvar_write_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_cvar_write_impl(MPI_T_cvar_handle handle, const void *buf)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -76,7 +76,7 @@ int MPIR_T_cvar_write_impl(MPI_T_cvar_handle handle, const void *buf)
         break;
     default:
          /* FIXME the error handling code may not have been setup yet */
-        MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_INTERN, "**intern", "**intern %s", "unexpected parameter type");
+        MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_INTERN, "**intern", "**intern %s", "unexpected parameter type");
         break;
     }
 
@@ -91,7 +91,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_cvar_write
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_cvar_write - Write a control variable
 
@@ -132,7 +132,7 @@ int MPI_T_cvar_write(MPI_T_cvar_handle handle, const void *buf)
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_T_cvar_write_impl(handle, buf);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi_t/enum_get_info.c b/src/mpi_t/enum_get_info.c
index 0a85c64..ff4a8b7 100644
--- a/src/mpi_t/enum_get_info.c
+++ b/src/mpi_t/enum_get_info.c
@@ -28,7 +28,7 @@ int MPI_T_enum_get_info(MPI_T_enum enumtype, int *num, char *name, int *name_len
 #undef FUNCNAME
 #define FUNCNAME MPI_T_enum_get_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_enum_get_info - Get the information about an enumeration
 
diff --git a/src/mpi_t/enum_get_item.c b/src/mpi_t/enum_get_item.c
index af8ce7a..49574cc 100644
--- a/src/mpi_t/enum_get_item.c
+++ b/src/mpi_t/enum_get_item.c
@@ -28,7 +28,7 @@ int MPI_T_enum_get_item(MPI_T_enum enumtype, int indx, int *value, char *name, i
 #undef FUNCNAME
 #define FUNCNAME MPI_T_enum_get_item
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_enum_get_item - Get the information about an item in an enumeration
 
diff --git a/src/mpi_t/mpit_finalize.c b/src/mpi_t/mpit_finalize.c
index 5ef7a9e..13923e2 100644
--- a/src/mpi_t/mpit_finalize.c
+++ b/src/mpi_t/mpit_finalize.c
@@ -171,7 +171,7 @@ void MPIR_T_env_finalize(void)
 #undef FUNCNAME
 #define FUNCNAME MPI_T_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_finalize - Finalize the MPI tool information interface
 
diff --git a/src/mpi_t/mpit_initthread.c b/src/mpi_t/mpit_initthread.c
index 7b09dfe..af1469a 100644
--- a/src/mpi_t/mpit_initthread.c
+++ b/src/mpi_t/mpit_initthread.c
@@ -83,7 +83,7 @@ void MPIR_T_env_init(void)
 #undef FUNCNAME
 #define FUNCNAME MPI_T_init_thread
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_init_thread - Initialize the MPI_T execution environment
 
diff --git a/src/mpi_t/pvar_get_index.c b/src/mpi_t/pvar_get_index.c
index bb1639c..af5fce4 100644
--- a/src/mpi_t/pvar_get_index.c
+++ b/src/mpi_t/pvar_get_index.c
@@ -28,7 +28,7 @@ int MPI_T_pvar_get_index(const char *name, int var_class, int *pvar_index) __att
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_get_index
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_get_index - Get the index of a performance variable
 
diff --git a/src/mpi_t/pvar_get_info.c b/src/mpi_t/pvar_get_info.c
index 0116454..06dddda 100644
--- a/src/mpi_t/pvar_get_info.c
+++ b/src/mpi_t/pvar_get_info.c
@@ -30,7 +30,7 @@ int MPI_T_pvar_get_info(int pvar_index, char *name, int *name_len, int *verbosit
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_get_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_get_info - Get the inforamtion about a performance variable
 
diff --git a/src/mpi_t/pvar_get_num.c b/src/mpi_t/pvar_get_num.c
index 858c1b4..462d70c 100644
--- a/src/mpi_t/pvar_get_num.c
+++ b/src/mpi_t/pvar_get_num.c
@@ -28,7 +28,7 @@ int MPI_T_pvar_get_num(int *num_pvar) __attribute__((weak,alias("PMPI_T_pvar_get
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_get_num
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_get_num - Get the number of performance variables
 
diff --git a/src/mpi_t/pvar_handle_alloc.c b/src/mpi_t/pvar_handle_alloc.c
index e4c97ee..846ed1e 100644
--- a/src/mpi_t/pvar_handle_alloc.c
+++ b/src/mpi_t/pvar_handle_alloc.c
@@ -41,7 +41,7 @@ MPIR_T_pvar_handle_t * const MPI_T_PVAR_ALL_HANDLES = &MPIR_T_pvar_all_handles_o
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_pvar_handle_alloc_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_pvar_handle_alloc_impl(MPI_T_pvar_session session, int pvar_index,
                                   void *obj_handle, MPI_T_pvar_handle *handle,int *count)
 {
@@ -176,7 +176,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_handle_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_handle_alloc - Allocate a handle for a performance variable
 
diff --git a/src/mpi_t/pvar_handle_free.c b/src/mpi_t/pvar_handle_free.c
index 0aa5117..e75d470 100644
--- a/src/mpi_t/pvar_handle_free.c
+++ b/src/mpi_t/pvar_handle_free.c
@@ -30,7 +30,7 @@ int MPI_T_pvar_handle_free(MPI_T_pvar_session session, MPI_T_pvar_handle *handle
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_pvar_handle_free_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_pvar_handle_free_impl(MPI_T_pvar_session session, MPI_T_pvar_handle *handle)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -73,7 +73,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_handle_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_handle_free - Free an existing handle for a performance variable
 
@@ -121,7 +121,7 @@ int MPI_T_pvar_handle_free(MPI_T_pvar_session session, MPI_T_pvar_handle *handle
     /* ... body of routine ...  */
 
     mpi_errno = MPIR_T_pvar_handle_free_impl(session, handle);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi_t/pvar_read.c b/src/mpi_t/pvar_read.c
index 8de6e01..62f3d58 100644
--- a/src/mpi_t/pvar_read.c
+++ b/src/mpi_t/pvar_read.c
@@ -29,7 +29,7 @@ int MPI_T_pvar_read(MPI_T_pvar_session session, MPI_T_pvar_handle handle, void *
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_pvar_read_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_pvar_read_impl(MPI_T_pvar_session session, MPI_T_pvar_handle handle, void *restrict buf)
 {
     int i, mpi_errno = MPI_SUCCESS;
@@ -209,7 +209,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_read
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_read - Read the value of a performance variable
 
diff --git a/src/mpi_t/pvar_readreset.c b/src/mpi_t/pvar_readreset.c
index 23751aa..0c3c514 100644
--- a/src/mpi_t/pvar_readreset.c
+++ b/src/mpi_t/pvar_readreset.c
@@ -29,7 +29,7 @@ int MPI_T_pvar_readreset(MPI_T_pvar_session session, MPI_T_pvar_handle handle, v
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_pvar_readreset_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_pvar_readreset_impl(MPI_T_pvar_session session, MPI_T_pvar_handle handle, void *buf)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -51,7 +51,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_readreset
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_readreset - Read the value of a performance variable and then reset it
 
diff --git a/src/mpi_t/pvar_reset.c b/src/mpi_t/pvar_reset.c
index e12cee0..f50e43f 100644
--- a/src/mpi_t/pvar_reset.c
+++ b/src/mpi_t/pvar_reset.c
@@ -30,7 +30,7 @@ int MPI_T_pvar_reset(MPI_T_pvar_session session, MPI_T_pvar_handle handle) __att
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_pvar_reset_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_pvar_reset_impl(MPI_T_pvar_session session, MPI_T_pvar_handle handle)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -78,7 +78,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_reset
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_reset - Reset a performance variable
 
diff --git a/src/mpi_t/pvar_session_create.c b/src/mpi_t/pvar_session_create.c
index 1777cd5..8fde7f2 100644
--- a/src/mpi_t/pvar_session_create.c
+++ b/src/mpi_t/pvar_session_create.c
@@ -29,7 +29,7 @@ int MPI_T_pvar_session_create(MPI_T_pvar_session *session) __attribute__((weak,a
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_pvar_session_create_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_pvar_session_create_impl(MPI_T_pvar_session *session)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -59,7 +59,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_session_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_session_create - Create a new session for accessing performance variables
 
diff --git a/src/mpi_t/pvar_session_free.c b/src/mpi_t/pvar_session_free.c
index 3cade54..4f68b9f 100644
--- a/src/mpi_t/pvar_session_free.c
+++ b/src/mpi_t/pvar_session_free.c
@@ -30,7 +30,7 @@ int MPI_T_pvar_session_free(MPI_T_pvar_session *session) __attribute__((weak,ali
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_pvar_session_free_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_pvar_session_free_impl(MPI_T_pvar_session *session)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -60,7 +60,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_session_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_session_free - Free an existing performance variable session
 
diff --git a/src/mpi_t/pvar_start.c b/src/mpi_t/pvar_start.c
index 3a700ad..1853fef 100644
--- a/src/mpi_t/pvar_start.c
+++ b/src/mpi_t/pvar_start.c
@@ -30,7 +30,7 @@ int MPI_T_pvar_start(MPI_T_pvar_session session, MPI_T_pvar_handle handle) __att
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_pvar_start_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_pvar_start_impl(MPI_T_pvar_session session, MPI_T_pvar_handle handle)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -78,7 +78,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_start
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_start - Start a performance variable
 
diff --git a/src/mpi_t/pvar_stop.c b/src/mpi_t/pvar_stop.c
index 8473316..aa6b451 100644
--- a/src/mpi_t/pvar_stop.c
+++ b/src/mpi_t/pvar_stop.c
@@ -30,7 +30,7 @@ int MPI_T_pvar_stop(MPI_T_pvar_session session, MPI_T_pvar_handle handle) __attr
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_pvar_stop_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_pvar_stop_impl(MPI_T_pvar_session session, MPI_T_pvar_handle handle)
 {
     int i, mpi_errno = MPI_SUCCESS;
@@ -104,7 +104,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_stop
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_stop - Stop a performance variable
 
diff --git a/src/mpi_t/pvar_write.c b/src/mpi_t/pvar_write.c
index 76a7a16..888d018 100644
--- a/src/mpi_t/pvar_write.c
+++ b/src/mpi_t/pvar_write.c
@@ -29,7 +29,7 @@ int MPI_T_pvar_write(MPI_T_pvar_session session, MPI_T_pvar_handle handle, const
 #undef FUNCNAME
 #define FUNCNAME MPIR_T_pvar_write_impl
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_T_pvar_write_impl(MPI_T_pvar_session session, MPI_T_pvar_handle handle, const void *buf)
 {
     /* This function should never be called */
@@ -41,7 +41,7 @@ int MPIR_T_pvar_write_impl(MPI_T_pvar_session session, MPI_T_pvar_handle handle,
 #undef FUNCNAME
 #define FUNCNAME MPI_T_pvar_write
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
 MPI_T_pvar_write - Write a performance variable
 
diff --git a/src/mpid/ch3/channels/nemesis/include/mpid_nem_impl.h b/src/mpid/ch3/channels/nemesis/include/mpid_nem_impl.h
index 9c2fdc9..c9065f3 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_impl.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_impl.h
@@ -161,7 +161,7 @@ typedef union MPIDI_CH3_nem_pkt
                 MPID_Request_release(_rts_req);                                                         \
                 MPID_Request_release(_rts_req);                                                         \
             }                                                                                           \
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**rtspkt");                                  \
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**rtspkt");                                  \
         }                                                                                               \
         /* --END ERROR HANDLING-- */                                                                    \
         if (_rts_req != NULL)                                                                           \
@@ -173,7 +173,7 @@ typedef union MPIDI_CH3_nem_pkt
                  * references, so the request can be cleanly freed */                                   \
                 MPID_Request_release(_rts_req);                                                         \
                 MPID_Request_release(_rts_req);                                                         \
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**rtspkt");                              \
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**rtspkt");                              \
             }                                                                                           \
             MPID_Request_release(_rts_req);                                                             \
         }                                                                                               \
@@ -197,10 +197,10 @@ typedef union MPIDI_CH3_nem_pkt
         _iov[1].MPL_IOV_LEN = (r_cookie_len);                                                          \
                                                                                                         \
         mpi_errno = MPIDI_CH3_iStartMsgv((vc), _iov, (r_cookie_len) ? 2 : 1, &_cts_req);                \
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ctspkt");                           \
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ctspkt");                           \
         if (_cts_req != NULL)                                                                           \
         {                                                                                               \
-            MPIU_ERR_CHKANDJUMP(_cts_req->status.MPI_ERROR, mpi_errno, MPI_ERR_OTHER, "**ctspkt");      \
+            MPIR_ERR_CHKANDJUMP(_cts_req->status.MPI_ERROR, mpi_errno, MPI_ERR_OTHER, "**ctspkt");      \
             MPID_Request_release(_cts_req);                                                             \
         }                                                                                               \
     } while (0)
@@ -208,7 +208,7 @@ typedef union MPIDI_CH3_nem_pkt
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_send_COOKIE
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPID_nem_lmt_send_COOKIE(MPIDI_VC_t *vc, MPID_Request *req,
                                            void *cookie_buf, MPI_Aint cookie_len)
 {
@@ -238,7 +238,7 @@ static inline int MPID_nem_lmt_send_COOKIE(MPIDI_VC_t *vc, MPID_Request *req,
             cookie_pkt->receiver_req_id = (req)->ch.lmt_req_id;
             break;
         default:
-            MPIU_ERR_INTERNALANDJUMP(mpi_errno, "unexpected request type");
+            MPIR_ERR_INTERNALANDJUMP(mpi_errno, "unexpected request type");
             break;
     }
 
@@ -248,10 +248,10 @@ static inline int MPID_nem_lmt_send_COOKIE(MPIDI_VC_t *vc, MPID_Request *req,
     iov[1].MPL_IOV_LEN = cookie_len;
 
     mpi_errno = MPIDI_CH3_iStartMsgv(vc, iov, (cookie_len ? 2 : 1), &cookie_req);
-    MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**cookiepkt");
+    MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**cookiepkt");
     if (cookie_req != NULL)
     {
-        MPIU_ERR_CHKANDJUMP(cookie_req->status.MPI_ERROR, mpi_errno, MPI_ERR_OTHER, "**cookiepkt");
+        MPIR_ERR_CHKANDJUMP(cookie_req->status.MPI_ERROR, mpi_errno, MPI_ERR_OTHER, "**cookiepkt");
         MPID_Request_release(cookie_req);
     }
 
@@ -268,10 +268,10 @@ fn_fail:
         _done_pkt->req_id = (rreq)->ch.lmt_req_id;                                                              \
                                                                                                                 \
         mpi_errno = MPIDI_CH3_iStartMsg((vc), _done_pkt, sizeof(*_done_pkt), &_done_req);                       \
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**donepkt");                                  \
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**donepkt");                                  \
         if (_done_req != NULL)                                                                                  \
         {                                                                                                       \
-            MPIU_ERR_CHKANDJUMP(_done_req->status.MPI_ERROR, mpi_errno, MPI_ERR_OTHER, "**donepkt");            \
+            MPIR_ERR_CHKANDJUMP(_done_req->status.MPI_ERROR, mpi_errno, MPI_ERR_OTHER, "**donepkt");            \
             MPID_Request_release(_done_req);                                                                    \
         }                                                                                                       \
     } while (0)   
diff --git a/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h b/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
index 22af4d6..deb3bf8 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
@@ -33,6 +33,56 @@ static inline void MPID_nem_mpich_send_seg_header (MPID_Segment *segment, MPIDI_
 static inline void MPID_nem_mpich_send_seg (MPID_Segment *segment, MPIDI_msg_sz_t *segment_first, MPIDI_msg_sz_t segment_size,
                                                     MPIDI_VC_t *vc, int *again);
 
+
+/*
+=== BEGIN_MPI_T_CVAR_INFO_BLOCK ===
+
+cvars:
+    - name        : MPIR_CVAR_POLLS_BEFORE_YIELD
+      category    : NEMESIS
+      type        : int
+      default     : 1000
+      class       : none
+      verbosity   : MPI_T_VERBOSITY_USER_BASIC
+      scope       : MPI_T_SCOPE_ALL_EQ
+      description : >-
+        When MPICH is in a busy waiting loop, it will periodically
+        call a function to yield the processor.  This cvar sets
+        the number of loops before the yield function is called.  A
+        value of 0 disables yielding.
+
+=== END_MPI_T_CVAR_INFO_BLOCK ===
+*/
+
+/* -------------------------------------------------------------------------- */
+
+/*
+ * MPIU_Busy_wait()
+ *
+ * Call this in every busy wait loop to periodically yield the processor.  The
+ * MPIR_CVAR_POLLS_BEFORE_YIELD parameter can be used to adjust the number of
+ * times MPIU_Busy_wait is called before the yield function is called.
+ */
+#ifdef USE_NOTHING_FOR_YIELD
+/* optimize if we're not yielding the processor */
+#define MPIU_Busy_wait() do {} while (0)
+#else
+/* MT: Updating the static int poll_count variable isn't thread safe and will
+   need to be changed for fine-grained multithreading.  A possible alternative
+   is to make it a global thread-local variable. */
+#define MPIU_Busy_wait() do {                                   \
+        if (MPIR_CVAR_POLLS_BEFORE_YIELD) {                    \
+            static int poll_count_ = 0;                         \
+            if (poll_count_ >= MPIR_CVAR_POLLS_BEFORE_YIELD) { \
+                poll_count_ = 0;                                \
+                MPIU_PW_Sched_yield();                          \
+            } else {                                            \
+                ++poll_count_;                                  \
+            }                                                   \
+        }                                                       \
+    } while (0)
+#endif
+
 /* evaluates to TRUE if it is safe to block on recv operations in the progress
  * loop, FALSE otherwise */
 #define MPID_nem_safe_to_block_recv()           \
@@ -45,7 +95,7 @@ static inline void MPID_nem_mpich_send_seg (MPID_Segment *segment, MPIDI_msg_sz_
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_send_header
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int
 MPID_nem_mpich_send_header (void* buf, int size, MPIDI_VC_t *vc, int *again)
 {
@@ -169,7 +219,7 @@ MPID_nem_mpich_send_header (void* buf, int size, MPIDI_VC_t *vc, int *again)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_sendv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int
 MPID_nem_mpich_sendv (MPL_IOV **iov, int *n_iov, MPIDI_VC_t *vc, int *again)
 {
@@ -271,7 +321,7 @@ MPID_nem_mpich_sendv (MPL_IOV **iov, int *n_iov, MPIDI_VC_t *vc, int *again)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_sendv_header
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int
 MPID_nem_mpich_sendv_header (MPL_IOV **iov, int *n_iov,
                              void *ext_hdr_ptr, MPIDI_msg_sz_t ext_hdr_sz,
@@ -432,7 +482,7 @@ MPID_nem_mpich_sendv_header (MPL_IOV **iov, int *n_iov,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_send_seg_header
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void
 MPID_nem_mpich_send_seg_header (MPID_Segment *segment, MPIDI_msg_sz_t *segment_first, MPIDI_msg_sz_t segment_size,
                                 void *header, MPIDI_msg_sz_t header_sz, void *ext_header, MPIDI_msg_sz_t ext_header_sz,
@@ -578,7 +628,7 @@ MPID_nem_mpich_send_seg_header (MPID_Segment *segment, MPIDI_msg_sz_t *segment_f
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_send_seg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void
 MPID_nem_mpich_send_seg (MPID_Segment *segment, MPIDI_msg_sz_t *segment_first, MPIDI_msg_sz_t segment_size, MPIDI_VC_t *vc, int *again)
 {
@@ -665,7 +715,7 @@ MPID_nem_mpich_send_seg (MPID_Segment *segment, MPIDI_msg_sz_t *segment_first, M
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_dequeue_fastbox
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void MPID_nem_mpich_dequeue_fastbox(int local_rank)
 {
     MPID_nem_fboxq_elem_t *el;
@@ -709,7 +759,7 @@ static inline void MPID_nem_mpich_dequeue_fastbox(int local_rank)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_dequeue_fastbox
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void MPID_nem_mpich_enqueue_fastbox(int local_rank)
 {
     MPID_nem_fboxq_elem_t *el;
@@ -750,7 +800,7 @@ static inline void MPID_nem_mpich_enqueue_fastbox(int local_rank)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_recv_seqno_matches
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int
 MPID_nem_recv_seqno_matches (MPID_nem_queue_ptr_t qhead)
 {
@@ -771,7 +821,7 @@ MPID_nem_recv_seqno_matches (MPID_nem_queue_ptr_t qhead)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_test_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int
 MPID_nem_mpich_test_recv(MPID_nem_cell_ptr_t *cell, int *in_fbox, int in_blocking_progress)
 {
@@ -786,7 +836,7 @@ MPID_nem_mpich_test_recv(MPID_nem_cell_ptr_t *cell, int *in_fbox, int in_blockin
     if (MPID_nem_num_netmods)
     {
 	mpi_errno = MPID_nem_network_poll(in_blocking_progress);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     }
 
     if (MPID_nem_queue_empty (MPID_nem_mem_region.my_recvQ) || !MPID_nem_recv_seqno_matches (MPID_nem_mem_region.my_recvQ))
@@ -845,7 +895,7 @@ MPID_nem_mpich_test_recv(MPID_nem_cell_ptr_t *cell, int *in_fbox, int in_blockin
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_test_recv_wait
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int
 MPID_nem_mpich_test_recv_wait (MPID_nem_cell_ptr_t *cell, int *in_fbox, int timeout)
 {
@@ -858,7 +908,7 @@ MPID_nem_mpich_test_recv_wait (MPID_nem_cell_ptr_t *cell, int *in_fbox, int time
     if (MPID_nem_num_netmods)
     {
 	mpi_errno = MPID_nem_network_poll(TRUE /* blocking */);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     }
 
     while ((--timeout > 0) && (MPID_nem_queue_empty (MPID_nem_mem_region.my_recvQ) || !MPID_nem_recv_seqno_matches (MPID_nem_mem_region.my_recvQ)))
@@ -903,7 +953,7 @@ MPID_nem_mpich_test_recv_wait (MPID_nem_cell_ptr_t *cell, int *in_fbox, int time
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_blocking_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int
 MPID_nem_mpich_blocking_recv(MPID_nem_cell_ptr_t *cell, int *in_fbox, int completions)
 {
@@ -922,7 +972,7 @@ MPID_nem_mpich_blocking_recv(MPID_nem_cell_ptr_t *cell, int *in_fbox, int comple
     if (MPID_nem_num_netmods)
     {
 	mpi_errno = MPID_nem_network_poll(TRUE /* blocking */);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     }
 
     while (MPID_nem_queue_empty (MPID_nem_mem_region.my_recvQ) || !MPID_nem_recv_seqno_matches (MPID_nem_mem_region.my_recvQ))
@@ -937,7 +987,7 @@ MPID_nem_mpich_blocking_recv(MPID_nem_cell_ptr_t *cell, int *in_fbox, int comple
 	if (MPID_nem_num_netmods)
 	{            
 	    mpi_errno = MPID_nem_network_poll(TRUE /* blocking */);
-            if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
             if (!MPID_nem_safe_to_block_recv())
             {
@@ -988,7 +1038,7 @@ MPID_nem_mpich_blocking_recv(MPID_nem_cell_ptr_t *cell, int *in_fbox, int comple
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_release_cell
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int
 MPID_nem_mpich_release_cell (MPID_nem_cell_ptr_t cell, MPIDI_VC_t *vc)
 {
diff --git a/src/mpid/ch3/channels/nemesis/include/mpid_nem_queue.h b/src/mpid/ch3/channels/nemesis/include/mpid_nem_queue.h
index a01d917..cead514 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_queue.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_queue.h
@@ -36,7 +36,7 @@ int MPID_nem_network_poll(int in_blocking_progress);
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_cell_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void MPID_nem_cell_init(MPID_nem_cell_ptr_t cell)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_CELL_INIT);
@@ -54,7 +54,7 @@ static inline void MPID_nem_cell_init(MPID_nem_cell_ptr_t cell)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_queue_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void MPID_nem_queue_init(MPID_nem_queue_ptr_t qhead)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_QUEUE_INIT);
@@ -242,7 +242,7 @@ MPID_nem_queue_dequeue (MPID_nem_queue_ptr_t qhead, MPID_nem_cell_ptr_t *e)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_queue_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void MPID_nem_queue_init(MPID_nem_queue_ptr_t qhead)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_QUEUE_INIT);
diff --git a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
index d883ea9..7f1989f 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
@@ -95,14 +95,14 @@ int MPIDI_CH3_SHM_Win_free(MPID_Win **win_ptr);
 #define MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr)                                              \
     do {                                                                                \
         int pt_err = pthread_mutex_lock((win_ptr)->shm_mutex);                          \
-        MPIU_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_lock",        \
+        MPIR_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_lock",        \
                              "**pthread_lock %s", strerror(pt_err));                    \
     } while (0)
 
 #define MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr)                                            \
     do {                                                                                \
         int pt_err = pthread_mutex_unlock((win_ptr)->shm_mutex);                        \
-        MPIU_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_unlock",      \
+        MPIR_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_unlock",      \
                              "**pthread_unlock %s", strerror(pt_err));                  \
     } while (0)
 
@@ -112,23 +112,23 @@ int MPIDI_CH3_SHM_Win_free(MPID_Win **win_ptr);
         pthread_mutexattr_t attr;                                                       \
                                                                                         \
         pt_err = pthread_mutexattr_init(&attr);                                         \
-        MPIU_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_mutex",       \
+        MPIR_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_mutex",       \
                              "**pthread_mutex %s", strerror(pt_err));                   \
         pt_err = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);           \
-        MPIU_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_mutex",       \
+        MPIR_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_mutex",       \
                              "**pthread_mutex %s", strerror(pt_err));                   \
         pt_err = pthread_mutex_init((win_ptr)->shm_mutex, &attr);                       \
-        MPIU_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_mutex",       \
+        MPIR_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_mutex",       \
                              "**pthread_mutex %s", strerror(pt_err));                   \
         pt_err = pthread_mutexattr_destroy(&attr);                                      \
-        MPIU_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_mutex",       \
+        MPIR_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_mutex",       \
                              "**pthread_mutex %s", strerror(pt_err));                   \
     } while (0);
 
 #define MPIDI_CH3I_SHM_MUTEX_DESTROY(win_ptr)                                           \
     do {                                                                                \
         int pt_err = pthread_mutex_destroy((win_ptr)->shm_mutex);                       \
-        MPIU_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_mutex",       \
+        MPIR_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**pthread_mutex",       \
                              "**pthread_mutex %s", strerror(pt_err));                   \
     } while (0);
 #else
@@ -152,7 +152,7 @@ int MPIDI_CH3_SHM_Win_free(MPID_Win **win_ptr);
             MPIU_Strncpy(error_msg, str, MPIU_STRERROR_BUF_SIZE);                       \
             LocalFree(str);                                                             \
             strtok(error_msg, "\r\n");                                                  \
-            MPIU_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**windows_mutex",   \
+            MPIR_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**windows_mutex",   \
                                  "**windows_mutex %s", error_msg);                      \
         }                                                                               \
     } while (0);
@@ -208,7 +208,7 @@ extern MPIDI_SHM_Wins_list_t shm_wins_list;
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_SHM_Wins_append
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_SHM_Wins_append(MPIDI_SHM_Wins_list_t * list, MPID_Win * win)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -240,7 +240,7 @@ static inline int MPIDI_CH3I_SHM_Wins_append(MPIDI_SHM_Wins_list_t * list, MPID_
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_SHM_Wins_unlink
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void MPIDI_CH3I_SHM_Wins_unlink(MPIDI_SHM_Wins_list_t * list, MPID_Win * shm_win)
 {
     MPIDI_SHM_Win_t *elem = NULL;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c
index 190f508..797ea63 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c
@@ -19,7 +19,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_cancel_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* returns zero in case request is canceled */
 int MPID_nem_llc_cancel_recv(struct MPIDI_VC *vc, struct MPID_Request *req)
 {
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c
index 9f46294..c937260 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c
@@ -13,7 +13,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -23,7 +23,7 @@ int MPID_nem_llc_finalize(void)
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_FINALIZE);
 
     rc = LLC_finalize();
-    MPIU_ERR_CHKANDJUMP(rc != 0, mpi_errno, MPI_ERR_OTHER, "**fail");
+    MPIR_ERR_CHKANDJUMP(rc != 0, mpi_errno, MPI_ERR_OTHER, "**fail");
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_FINALIZE);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c
index 4887aea..9bd2a53 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c
@@ -44,7 +44,7 @@ int MPID_nem_llc_my_llc_rank;
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_kvs_put_binary
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_kvs_put_binary(int from, const char *postfix, const uint8_t * buf, int length)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -57,7 +57,7 @@ int MPID_nem_llc_kvs_put_binary(int from, const char *postfix, const uint8_t * b
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_KVS_PUT_BINARY);
 
     mpi_errno = MPIDI_PG_GetConnKVSname(&kvs_name);
-    MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPIDI_PG_GetConnKVSname");
+    MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPIDI_PG_GetConnKVSname");
     dprintf("kvs_put_binary,kvs_name=%s\n", kvs_name);
 
     sprintf(key, "bc/%d/%s", from, postfix);
@@ -69,7 +69,7 @@ int MPID_nem_llc_kvs_put_binary(int from, const char *postfix, const uint8_t * b
     dprintf("kvs_put_binary,rank=%d,from=%d,PMI_KVS_Put(%s, %s, %s)\n",
             MPIDI_Process.my_pg_rank, from, kvs_name, key, val);
     pmi_errno = PMI_KVS_Put(kvs_name, key, val);
-    MPIU_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**PMI_KVS_Put");
+    MPIR_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**PMI_KVS_Put");
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_KVS_PUT_BINARY);
     return mpi_errno;
@@ -80,7 +80,7 @@ int MPID_nem_llc_kvs_put_binary(int from, const char *postfix, const uint8_t * b
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_kvs_get_binary
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_kvs_get_binary(int from, const char *postfix, char *buf, int length)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -94,13 +94,13 @@ int MPID_nem_llc_kvs_get_binary(int from, const char *postfix, char *buf, int le
 
     mpi_errno = MPIDI_PG_GetConnKVSname(&kvs_name);
     dprintf("kvs_get_binary,kvs_name=%s\n", kvs_name);
-    MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPIDI_PG_GetConnKVSname");
+    MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPIDI_PG_GetConnKVSname");
 
     sprintf(key, "bc/%d/%s", from, postfix);
     dprintf("kvs_put_binary,rank=%d,from=%d,PMI_KVS_Get(%s, %s, %s)\n",
             MPIDI_Process.my_pg_rank, from, kvs_name, key, val);
     pmi_errno = PMI_KVS_Get(kvs_name, key, val, 256);
-    MPIU_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**PMS_KVS_Get");
+    MPIR_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**PMS_KVS_Get");
 
     dprintf("rank=%d,obtained val=%s\n", MPIDI_Process.my_pg_rank, val);
     char *strp = val;
@@ -121,7 +121,7 @@ int MPID_nem_llc_kvs_get_binary(int from, const char *postfix, char *buf, int le
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p)
 {
     int mpi_errno = MPI_SUCCESS, pmi_errno, llc_errno;
@@ -131,22 +131,22 @@ int MPID_nem_llc_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_INIT);
 
     llc_errno = LLC_init(TYPE_MPI);
-    MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_init");
+    MPIR_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_init");
 
     llc_errno = LLC_comm_rank(LLC_COMM_MPICH, &MPID_nem_llc_my_llc_rank);
-    MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_comm_rank");
+    MPIR_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_comm_rank");
 
     /* Announce my LLC rank */
     mpi_errno =
         MPID_nem_llc_kvs_put_binary(pg_rank, "llc_rank",
                                     (uint8_t *) & MPID_nem_llc_my_llc_rank, sizeof(int));
-    MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_kvs_put_binary");
+    MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_kvs_put_binary");
     dprintf("llc_init,my_pg_rank=%d,my_llc_rank=%d\n",
             MPIDI_Process.my_pg_rank, MPID_nem_llc_my_llc_rank);
 
     /* Wait until the key-value propagates among all ranks */
     pmi_errno = PMI_Barrier();
-    MPIU_ERR_CHKANDJUMP(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**PMI_Barrier");
+    MPIR_ERR_CHKANDJUMP(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**PMI_Barrier");
 
     mpi_errno =
         MPIDI_CH3I_Register_anysource_notification(MPID_nem_llc_anysource_posted,
@@ -164,7 +164,7 @@ int MPID_nem_llc_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_get_business_card
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -182,7 +182,7 @@ int MPID_nem_llc_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_connect_to_root
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -204,7 +204,7 @@ int MPID_nem_llc_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_anysource_iprobe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_anysource_iprobe(int tag, MPID_Comm * comm, int context_offset, int *flag,
                                   MPI_Status * status)
 {
@@ -215,7 +215,7 @@ int MPID_nem_llc_anysource_iprobe(int tag, MPID_Comm * comm, int context_offset,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_anysource_improbe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_anysource_improbe(int tag, MPID_Comm * comm, int context_offset, int *flag,
                                    MPID_Request ** message, MPI_Status * status)
 {
@@ -226,7 +226,7 @@ int MPID_nem_llc_anysource_improbe(int tag, MPID_Comm * comm, int context_offset
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_get_ordering
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_get_ordering(int *ordering)
 {
     (*ordering) = 1;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
index 1a900de..4b1be26 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
@@ -24,7 +24,7 @@ static void MPID_nem_llc_recv_handler(void *vp_vc, uint64_t raddr, void *buf, si
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_poll
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_poll(int in_blocking_progress)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -37,7 +37,7 @@ int MPID_nem_llc_poll(int in_blocking_progress)
         rc = llc_poll(in_blocking_progress, MPID_nem_llc_send_handler, MPID_nem_llc_recv_handler);
         if (rc != 0) {
             mpi_errno = MPI_ERR_OTHER;
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -51,7 +51,7 @@ int MPID_nem_llc_poll(int in_blocking_progress)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_send_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
 {
     /* int mpi_errno = 0; */
@@ -136,7 +136,7 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
 
                     r_mpi_errno = MPID_Request_complete(sreq);
                     if (r_mpi_errno != MPI_SUCCESS) {
-                        MPIU_ERR_POP(r_mpi_errno);
+                        MPIR_ERR_POP(r_mpi_errno);
                     }
                     MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
                 }
@@ -144,7 +144,7 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
                     complete = 0;
                     r_mpi_errno = reqFn(vc, sreq, &complete);
                     if (r_mpi_errno)
-                        MPIU_ERR_POP(r_mpi_errno);
+                        MPIR_ERR_POP(r_mpi_errno);
                     if (complete == 0) {
                         MPIU_Assert(complete == TRUE);
                     }
@@ -176,7 +176,7 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_recv_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void MPID_nem_llc_recv_handler(void *vp_vc, uint64_t raddr, void *buf, size_t bsz)
 {
     int mpi_errno = 0;
@@ -230,7 +230,7 @@ static void MPID_nem_llc_recv_handler(void *vp_vc, uint64_t raddr, void *buf, si
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_recv_posted
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
 {
     int mpi_errno = MPI_SUCCESS, llc_errno;
@@ -265,7 +265,7 @@ int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
     }
     else {
         REQ_FIELD(req, pack_buf) = MPIU_Malloc(data_sz);
-        MPIU_ERR_CHKANDJUMP(!REQ_FIELD(req, pack_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+        MPIR_ERR_CHKANDJUMP(!REQ_FIELD(req, pack_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
         write_to_buf = REQ_FIELD(req, pack_buf);
     }
 
@@ -333,7 +333,7 @@ int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
     REQ_FIELD(req, cmds) = cmd;
 
     llc_errno = LLC_post(cmd, 1);
-    MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
+    MPIR_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_RECV_POSTED);
@@ -345,7 +345,7 @@ int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_anysource_posted
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPID_nem_llc_anysource_posted(MPID_Request * req)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -361,7 +361,7 @@ void MPID_nem_llc_anysource_posted(MPID_Request * req)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_anysource_matched
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_anysource_matched(MPID_Request * req)
 {
     int matched = FALSE;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
index f491121..d9c11ba 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
@@ -20,7 +20,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_probe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_probe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
                        MPI_Status * status)
 {
@@ -41,7 +41,7 @@ int MPID_nem_llc_probe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, i
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_iprobe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_iprobe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
                         int *flag, MPI_Status * status)
 {
@@ -111,7 +111,7 @@ int MPID_nem_llc_iprobe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_improbe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
                          int *flag, MPID_Request ** message, MPI_Status * status)
 {
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
index 3fffc69..5e3f1a2 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
@@ -19,7 +19,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_isend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
                        int dest, int tag, MPID_Comm * comm, int context_offset,
                        struct MPID_Request **req_out)
@@ -117,7 +117,7 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
     else {
         /* See MPIDI_CH3_EagerNoncontigSend (in ch3u_eager.c) */
         struct MPID_Segment *segment_ptr = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP(!segment_ptr, mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+        MPIR_ERR_CHKANDJUMP(!segment_ptr, mpi_errno, MPI_ERR_OTHER, "**outofmemory");
 #ifndef	notdef_leak_0001_hack
         /* See also MPIDI_CH3_Request_create and _destory() */
         /*     in src/mpid/ch3/src/ch3u_request.c */
@@ -130,7 +130,7 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
         MPIDI_msg_sz_t last = segment_size;
         MPIU_Assert(last > 0);
         REQ_FIELD(sreq, pack_buf) = MPIU_Malloc((size_t) data_sz);
-        MPIU_ERR_CHKANDJUMP(!REQ_FIELD(sreq, pack_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+        MPIR_ERR_CHKANDJUMP(!REQ_FIELD(sreq, pack_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
         MPID_Segment_pack(segment_ptr, segment_first, &last, (char *) (REQ_FIELD(sreq, pack_buf)));
         MPIU_Assert(last == data_sz);
         write_from_buf = REQ_FIELD(sreq, pack_buf);
@@ -148,7 +148,7 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
     ((struct llc_cmd_area *) cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
 
     llc_errno = LLC_post(cmd, 1);
-    MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
+    MPIR_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
 
   fn_exit:
     *req_out = sreq;
@@ -161,7 +161,7 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_iStartContigMsg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data,
                                  MPIDI_msg_sz_t data_sz, MPID_Request ** sreq_ptr)
 {
@@ -225,7 +225,7 @@ int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
                          sreq->dev.iov, sreq->dev.iov_count, sreq, &REQ_LLC(sreq)->cmds);
         if (ret < 0) {
             mpi_errno = MPI_ERR_OTHER;
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
         MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
                        "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
@@ -253,7 +253,7 @@ int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_iSendContig
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MPIDI_msg_sz_t hdr_sz,
                              void *data, MPIDI_msg_sz_t data_sz)
 {
@@ -313,7 +313,7 @@ int MPID_nem_llc_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
                          sreq->dev.iov, sreq->dev.iov_count, sreq, &REQ_LLC(sreq)->cmds);
         if (ret < 0) {
             mpi_errno = MPI_ERR_OTHER;
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
         MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "WRITEV()   = %d", ret);
         if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
@@ -337,7 +337,7 @@ int MPID_nem_llc_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_SendNoncontig
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
                                MPIDI_msg_sz_t hdr_sz)
 {
@@ -364,7 +364,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     data_sz = sreq->dev.segment_size;
     if (data_sz > 0) {
         REQ_FIELD(sreq, rma_buf) = MPIU_Malloc((size_t) sreq->dev.segment_size);
-        MPIU_ERR_CHKANDJUMP(!REQ_FIELD(sreq, rma_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+        MPIR_ERR_CHKANDJUMP(!REQ_FIELD(sreq, rma_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
         MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, &data_sz,
                           (char *) REQ_FIELD(sreq, rma_buf));
 
@@ -389,7 +389,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
                          sreq->dev.iov, sreq->dev.iov_count, sreq, &REQ_LLC(sreq)->cmds);
         if (ret < 0) {
             mpi_errno = MPI_ERR_OTHER;
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
@@ -413,7 +413,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_send_queued
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t * send_queue)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -471,7 +471,7 @@ int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t * send_queue)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_nem_llc_Rqst_iov_update
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_nem_llc_Rqst_iov_update(MPID_Request * mreq, MPIDI_msg_sz_t consume)
 {
     int ret = TRUE;
@@ -715,7 +715,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
 
     while (1) {
         llc_errno = LLC_poll(LLC_COMM_MPICH, 1, events, &nevents);
-        MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_poll");
+        MPIR_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_poll");
 
         LLC_cmd_t *lcmd;
         void *vp_sreq;
@@ -744,7 +744,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
                 /* Don't free iov_local[0].addr */
 
                 llc_errno = LLC_cmd_free(lcmd, 1);
-                MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
+                MPIR_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
                 break;
             }
 
@@ -771,7 +771,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
                     lcmd->iov_local[0].addr = 0;
                 }
                 llc_errno = LLC_cmd_free(lcmd, 1);
-                MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
+                MPIR_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
 
                 break;
             }
@@ -805,7 +805,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
                          bsiz - sizeof(MPID_nem_llc_netmod_hdr_t));
 #endif /* notdef_hsiz_hack */
                 llc_errno = LLC_release_buffer(&events[0]);
-                MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_release_buffer");
+                MPIR_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_release_buffer");
 
                 break;
             }
@@ -884,7 +884,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
                 MPID_Request_complete(req);
 
                 llc_errno = LLC_cmd_free(lcmd, 1);
-                MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
+                MPIR_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
                 break;
             }
         case LLC_EVENT_TARGET_PROC_FAIL:{
@@ -903,7 +903,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
                     UNSOLICITED_NUM_DEC(vp_sreq);
 
                     req->status.MPI_ERROR = MPI_SUCCESS;
-                    MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
+                    MPIR_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
 
                     MPID_Request_complete(req);
 
@@ -914,7 +914,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
                 }
                 else if (lcmd->opcode == LLC_OPCODE_SEND || lcmd->opcode == LLC_OPCODE_SSEND) {
                     req->status.MPI_ERROR = MPI_SUCCESS;
-                    MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
+                    MPIR_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
 
                     MPID_Request_complete(req);
                 }
@@ -923,7 +923,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
 #if 0
                     MPIDI_CH3U_Recvq_DP(req);
                     req->status.MPI_ERROR = MPI_SUCCESS;
-                    MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
+                    MPIR_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
                     MPID_Request_complete(req);
 #endif
                 }
@@ -933,7 +933,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
                 }
 
                 llc_errno = LLC_cmd_free(lcmd, 1);
-                MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
+                MPIR_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
 
                 break;
             }
@@ -952,7 +952,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_issend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
                         int dest, int tag, MPID_Comm * comm, int context_offset,
                         struct MPID_Request **request)
@@ -1040,7 +1040,7 @@ int MPID_nem_llc_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
     else {
         /* See MPIDI_CH3_EagerNoncontigSend (in ch3u_eager.c) */
         struct MPID_Segment *segment_ptr = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP(!segment_ptr, mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+        MPIR_ERR_CHKANDJUMP(!segment_ptr, mpi_errno, MPI_ERR_OTHER, "**outofmemory");
         /* See also MPIDI_CH3_Request_create and _destory() */
         /*     in src/mpid/ch3/src/ch3u_request.c */
         sreq->dev.segment_ptr = segment_ptr;
@@ -1051,7 +1051,7 @@ int MPID_nem_llc_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
         MPIDI_msg_sz_t last = segment_size;
         MPIU_Assert(last > 0);
         REQ_FIELD(sreq, pack_buf) = MPIU_Malloc((size_t) data_sz);
-        MPIU_ERR_CHKANDJUMP(!REQ_FIELD(sreq, pack_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+        MPIR_ERR_CHKANDJUMP(!REQ_FIELD(sreq, pack_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
         MPID_Segment_pack(segment_ptr, segment_first, &last, (char *) (REQ_FIELD(sreq, pack_buf)));
         MPIU_Assert(last == data_sz);
         write_from_buf = REQ_FIELD(sreq, pack_buf);
@@ -1069,7 +1069,7 @@ int MPID_nem_llc_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
     ((struct llc_cmd_area *) cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
 
     llc_errno = LLC_post(cmd, 1);
-    MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
+    MPIR_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
 
   fn_exit:
     *request = sreq;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
index ad28278..eb00c01 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
@@ -46,7 +46,7 @@ static MPIDI_Comm_ops_t comm_ops = {
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_vc_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_vc_init(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -56,7 +56,7 @@ int MPID_nem_llc_vc_init(MPIDI_VC_t * vc)
 
     mpi_errno = llc_vc_init(vc);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_VC_INIT);
@@ -68,7 +68,7 @@ int MPID_nem_llc_vc_init(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_vc_destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_vc_destroy(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -98,7 +98,7 @@ int MPID_nem_llc_vc_destroy(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_vc_terminate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_llc_vc_terminate(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -122,7 +122,7 @@ int MPID_nem_llc_vc_terminate(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME llc_vc_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int llc_vc_init(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -148,7 +148,7 @@ static int llc_vc_init(MPIDI_VC_t * vc)
             MPID_nem_llc_kvs_get_binary(vc->pg_rank,
                                         "llc_rank",
                                         (char *) &vc_llc->remote_endpoint_addr, sizeof(int));
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_kvs_get_binary");
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_kvs_get_binary");
         dprintf("llc_vc_init,my_pg_rank=%d,pg_rank=%d,my_llc_rank=%d,llc_rank=%ld\n",
                 MPIDI_Process.my_pg_rank, vc->pg_rank, MPID_nem_llc_my_llc_rank,
                 vc_llc->remote_endpoint_addr);
@@ -187,7 +187,7 @@ static int llc_vc_init(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_llc_vc_prnt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPID_nem_llc_vc_prnt(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -195,7 +195,6 @@ static int MPID_nem_llc_vc_prnt(MPIDI_VC_t * vc)
     /* MPIU_OBJECT_HEADER; */
     /* src/include/mpihandlemem.h */
     /* int handle; */
-    /* MPIU_THREAD_OBJECT_HOOK */
     /* MPIU_Handle_ref_count ref_count; */
     /* MPIDI_VC_State_t state; */
     /* struct MPIDI_PG *pg; */
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c
index 7de0229..c6b1e97 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c
@@ -12,7 +12,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_cancel_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_cancel_send(MPIDI_VC_t * vc, MPID_Request * req)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -47,7 +47,7 @@ int MPID_nem_mxm_cancel_send(MPIDI_VC_t * vc, MPID_Request * req)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_cancel_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_cancel_recv(MPIDI_VC_t * vc, MPID_Request * req)
 {
     int mpi_errno ATTRIBUTE((unused)) = MPI_SUCCESS;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
index ebbdda7..1e98488 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
@@ -117,7 +117,7 @@ static int _mxm_conf(void);
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p)
 {
     int r;
@@ -136,7 +136,7 @@ int MPID_nem_mxm_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
      * before resetting it */
     if (getenv("MXM_TLS") == NULL) {
         r = MPL_putenv("MXM_TLS=rc,dc,ud");
-        MPIU_ERR_CHKANDJUMP(r, mpi_errno, MPI_ERR_OTHER, "**putenv");
+        MPIR_ERR_CHKANDJUMP(r, mpi_errno, MPI_ERR_OTHER, "**putenv");
     }
 
     /* [PB @ 2014-10-06] If hugepage support is not enabled, we force
@@ -148,36 +148,36 @@ int MPID_nem_mxm_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
     if (MPIR_CVAR_NEMESIS_MXM_HUGEPAGE == 0) {
         if (getenv("MXM_MEM_ALLOC") == NULL) {
             r = MPL_putenv("MXM_MEM_ALLOC=mmap,libc,sysv");
-            MPIU_ERR_CHKANDJUMP(r, mpi_errno, MPI_ERR_OTHER, "**putenv");
+            MPIR_ERR_CHKANDJUMP(r, mpi_errno, MPI_ERR_OTHER, "**putenv");
         }
     }
 
 
     mpi_errno = _mxm_init(pg_rank, pg_p->size);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_nem_mxm_get_business_card(pg_rank, bc_val_p, val_max_sz_p);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     mpi_errno =
         MPIDI_CH3I_Register_anysource_notification(MPID_nem_mxm_anysource_posted,
                                                    MPID_nem_mxm_anysource_matched);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_nem_register_initcomp_cb(_mxm_post_init);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIDI_CH3U_Comm_register_create_hook(_mxm_add_comm, NULL);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIDI_CH3U_Comm_register_destroy_hook(_mxm_del_comm, NULL);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     MPIDI_Anysource_improbe_fn = MPID_nem_mxm_anysource_improbe;
 
@@ -191,7 +191,7 @@ int MPID_nem_mxm_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -203,7 +203,7 @@ int MPID_nem_mxm_finalize(void)
 
     mpi_errno = _mxm_fini();
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MXM_FINALIZE);
@@ -215,7 +215,7 @@ int MPID_nem_mxm_finalize(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_get_business_card
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -227,8 +227,8 @@ int MPID_nem_mxm_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz
     str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, MXM_MPICH_ENDPOINT_KEY,
                                         _mxm_obj.mxm_ep_addr, _mxm_obj.mxm_ep_addr_size);
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
 
   fn_exit:
@@ -241,7 +241,7 @@ int MPID_nem_mxm_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_connect_to_root
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -249,7 +249,7 @@ int MPID_nem_mxm_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
     MPIDI_STATE_DECL(MPID_STATE_MXM_CONNECT_TO_ROOT);
     MPIDI_FUNC_ENTER(MPID_STATE_MXM_CONNECT_TO_ROOT);
 
-    MPIU_ERR_SETFATAL(mpi_errno, MPI_ERR_OTHER, "**notimpl");
+    MPIR_ERR_SETFATAL(mpi_errno, MPI_ERR_OTHER, "**notimpl");
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MXM_CONNECT_TO_ROOT);
@@ -261,7 +261,7 @@ int MPID_nem_mxm_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_vc_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -284,19 +284,19 @@ int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc)
 #else
         mpi_errno = PMI_KVS_Get_value_length_max(&val_max_sz);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 #endif
 
         business_card = (char *) MPIU_Malloc(val_max_sz);
         mpi_errno = vc->pg->getConnInfo(vc->pg_rank, business_card, val_max_sz, vc->pg);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         vc_area->ctx = vc;
         vc_area->mxm_ep = &_mxm_obj.endpoint[vc->pg_rank];
         mpi_errno = _mxm_connect(&_mxm_obj.endpoint[vc->pg_rank], business_card, vc_area);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIU_Free(business_card);
     }
@@ -327,7 +327,7 @@ int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_vc_destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_vc_destroy(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -344,7 +344,7 @@ int MPID_nem_mxm_vc_destroy(MPIDI_VC_t * vc)
     if (vc_area->ctx == vc) {
         mpi_errno = _mxm_disconnect(vc_area->mxm_ep);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 #endif
 
@@ -358,7 +358,7 @@ int MPID_nem_mxm_vc_destroy(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_vc_terminate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_vc_terminate(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -371,7 +371,7 @@ int MPID_nem_mxm_vc_terminate(MPIDI_VC_t * vc)
         /* VC is terminated as a result of a fault.  Complete
          * outstanding sends with an error and terminate connection
          * immediately. */
-        MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+        MPIR_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
     }
     else {
         while (vc_area->pending_sends > 0)
@@ -380,7 +380,7 @@ int MPID_nem_mxm_vc_terminate(MPIDI_VC_t * vc)
 
     mpi_errno = MPIDI_CH3U_Handle_connection(vc, MPIDI_VC_EVENT_TERMINATED);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MXM_VC_TERMINATE);
@@ -392,7 +392,7 @@ int MPID_nem_mxm_vc_terminate(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_get_ordering
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_get_ordering(int *ordering)
 {
     (*ordering) = 1;
@@ -453,35 +453,35 @@ static int _mxm_init(int rank, int size)
     ret = _mxm_conf();
 
     ret = mxm_config_read_opts(&_mxm_obj.mxm_ctx_opts, &_mxm_obj.mxm_ep_opts, "MPICH2", NULL, 0);
-    MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
+    MPIR_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
                          "**mxm_config_read_opts",
                          "**mxm_config_read_opts %s", mxm_error_string(ret));
 
     ret = mxm_init(_mxm_obj.mxm_ctx_opts, &_mxm_obj.mxm_context);
-    MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
+    MPIR_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
                          "**mxm_init", "**mxm_init %s", mxm_error_string(ret));
 
     ret =
         mxm_set_am_handler(_mxm_obj.mxm_context, MXM_MPICH_HID_ADI_MSG, MPID_nem_mxm_get_adi_msg,
                            0);
-    MPIU_ERR_CHKANDJUMP1(ret != MXM_OK, mpi_errno, MPI_ERR_OTHER, "**mxm_set_am_handler",
+    MPIR_ERR_CHKANDJUMP1(ret != MXM_OK, mpi_errno, MPI_ERR_OTHER, "**mxm_set_am_handler",
                          "**mxm_set_am_handler %s", mxm_error_string(ret));
 
     ret = mxm_mq_create(_mxm_obj.mxm_context, MXM_MPICH_MQ_ID, &_mxm_obj.mxm_mq);
-    MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
+    MPIR_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
                          "**mxm_mq_create", "**mxm_mq_create %s", mxm_error_string(ret));
 
     ret = mxm_ep_create(_mxm_obj.mxm_context, _mxm_obj.mxm_ep_opts, &_mxm_obj.mxm_ep);
-    MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
+    MPIR_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
                          "**mxm_ep_create", "**mxm_ep_create %s", mxm_error_string(ret));
 
     _mxm_obj.mxm_ep_addr_size = MXM_MPICH_MAX_ADDR_SIZE;
     ret = mxm_ep_get_address(_mxm_obj.mxm_ep, &_mxm_obj.mxm_ep_addr, &_mxm_obj.mxm_ep_addr_size);
-    MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
+    MPIR_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
                          "**mxm_ep_get_address", "**mxm_ep_get_address %s", mxm_error_string(ret));
 
@@ -582,10 +582,10 @@ static int _mxm_connect(MPID_nem_mxm_ep_t * ep, const char *business_card,
     str_errno =
         MPIU_Str_get_binary_arg(business_card, MXM_MPICH_ENDPOINT_KEY, mxm_ep_addr,
                                 sizeof(mxm_ep_addr), &len);
-    MPIU_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**buscard");
+    MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**buscard");
 
     ret = mxm_ep_connect(_mxm_obj.mxm_ep, mxm_ep_addr, &ep->mxm_conn);
-    MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
+    MPIR_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
                          "**mxm_ep_connect", "**mxm_ep_connect %s", mxm_error_string(ret));
 
@@ -610,7 +610,7 @@ static int _mxm_disconnect(MPID_nem_mxm_ep_t * ep)
 
     if (ep->mxm_conn) {
         ret = mxm_ep_disconnect(ep->mxm_conn);
-        MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
+        MPIR_ERR_CHKANDJUMP1(ret != MXM_OK,
                              mpi_errno, MPI_ERR_OTHER,
                              "**mxm_ep_disconnect",
                              "**mxm_ep_disconnect %s", mxm_error_string(ret));
@@ -641,13 +641,13 @@ static int _mxm_add_comm(MPID_Comm * comm, void *param)
                     comm->context_id, comm->recvcontext_id, comm->local_size, comm->remote_size);
 
     ret = mxm_mq_create(_mxm_obj.mxm_context, comm->recvcontext_id, &mq_h_v[0]);
-    MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
+    MPIR_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
                          "**mxm_mq_create", "**mxm_mq_create %s", mxm_error_string(ret));
 
     if (comm->recvcontext_id != comm->context_id) {
         ret = mxm_mq_create(_mxm_obj.mxm_context, comm->context_id, &mq_h_v[1]);
-        MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
+        MPIR_ERR_CHKANDJUMP1(ret != MXM_OK,
                              mpi_errno, MPI_ERR_OTHER,
                              "**mxm_mq_create", "**mxm_mq_create %s", mxm_error_string(ret));
     }
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 770aacb..c03be70 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
@@ -20,7 +20,7 @@ static int _mxm_process_rdtype(MPID_Request ** rreq_p, MPI_Datatype datatype,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_poll
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_poll(int in_blocking_progress)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -36,7 +36,7 @@ int MPID_nem_mxm_poll(int in_blocking_progress)
 
     mpi_errno = _mxm_poll();
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MXM_POLL);
@@ -67,7 +67,7 @@ static int _mxm_poll(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_get_adi_msg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPID_nem_mxm_get_adi_msg(mxm_conn_h conn, mxm_imm_t imm, void *data,
                               size_t length, size_t offset, int last)
 {
@@ -87,7 +87,7 @@ void MPID_nem_mxm_get_adi_msg(mxm_conn_h conn, mxm_imm_t imm, void *data,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_anysource_posted
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPID_nem_mxm_anysource_posted(MPID_Request * req)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -109,7 +109,7 @@ void MPID_nem_mxm_anysource_posted(MPID_Request * req)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_anysource_matched
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_anysource_matched(MPID_Request * req)
 {
     mxm_error_t ret = MXM_OK;
@@ -147,7 +147,7 @@ int MPID_nem_mxm_anysource_matched(MPID_Request * req)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -202,7 +202,7 @@ int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
                                             rreq->dev.user_buf, rreq->dev.user_count,
                                             &req_area->iov_buf, &req_area->iov_count);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
 
         mpi_errno = _mxm_irecv((vc_area ? vc_area->mxm_ep : NULL), req_area,
@@ -210,7 +210,7 @@ int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
                                (rreq->comm ? mq_h_v[0] : mxm_obj->mxm_mq), _mxm_tag_mpi2mxm(tag,
                                                                                             context_id));
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     if (vc)
@@ -236,9 +236,9 @@ static int _mxm_handle_rreq(MPID_Request * req)
     MPID_nem_mxm_req_area *req_area = NULL;
     void *tmp_buf = NULL;
 
-    MPIU_THREAD_CS_ENTER(MSGQUEUE, req);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
     found = MPIDI_CH3U_Recvq_DP(req);
-    MPIU_THREAD_CS_EXIT(MSGQUEUE, req);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.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) {
@@ -324,7 +324,7 @@ static int _mxm_handle_rreq(MPID_Request * req)
                  *  mismatch between the datatype and the amount of
                  *  data received.  Throw away received data.
                  */
-                MPIU_ERR_SETSIMPLE(req->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
+                MPIR_ERR_SETSIMPLE(req->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
             }
         }
     }
@@ -445,7 +445,7 @@ static int _mxm_process_rdtype(MPID_Request ** rreq_p, MPI_Datatype datatype,
 
     if (rreq->dev.segment_ptr == NULL) {
         rreq->dev.segment_ptr = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
+        MPIR_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
                              "**nomem %s", "MPID_Segment_alloc");
     }
     MPID_Segment_init(buf, count, datatype, rreq->dev.segment_ptr, 0);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
index 6cc2c02..0151b9c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
@@ -12,7 +12,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_probe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_probe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
                        MPI_Status * status)
 {
@@ -58,7 +58,7 @@ int MPID_nem_mxm_probe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, i
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_iprobe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_iprobe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
                         int *flag, MPI_Status * status)
 {
@@ -104,7 +104,7 @@ int MPID_nem_mxm_iprobe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_improbe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
                          int *flag, MPID_Request ** message, MPI_Status * status)
 {
@@ -160,7 +160,7 @@ int MPID_nem_mxm_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
 
         mpi_errno = MPID_Request_complete(req);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         *message = req;
@@ -196,7 +196,7 @@ int MPID_nem_mxm_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_anysource_iprobe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_anysource_iprobe(int tag, MPID_Comm * comm, int context_offset, int *flag,
                                   MPI_Status * status)
 {
@@ -207,7 +207,7 @@ int MPID_nem_mxm_anysource_iprobe(int tag, MPID_Comm * comm, int context_offset,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_anysource_iprobe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_anysource_improbe(int tag, MPID_Comm * comm, int context_offset, int *flag,
                                    MPID_Request ** message, MPI_Status * status)
 {
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
index 1bd254b..280eed8 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
@@ -27,7 +27,7 @@ static int _mxm_process_sdtype(MPID_Request ** rreq_p, MPI_Datatype datatype,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_iSendContig
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MPIDI_msg_sz_t hdr_sz,
                              void *data, MPIDI_msg_sz_t data_sz)
 {
@@ -79,7 +79,7 @@ int MPID_nem_mxm_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
     mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_AM,
                            mxm_obj->mxm_mq, mxm_obj->mxm_rank, MXM_MPICH_HID_ADI_MSG, 0, 0);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_MXM_ISENDCONTIGMSG);
@@ -92,7 +92,7 @@ int MPID_nem_mxm_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_iStartContigMsg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data,
                                  MPIDI_msg_sz_t data_sz, MPID_Request ** sreq_ptr)
 {
@@ -143,7 +143,7 @@ int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
     mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_AM,
                            mxm_obj->mxm_mq, mxm_obj->mxm_rank, MXM_MPICH_HID_ADI_MSG, 0, 0);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     *sreq_ptr = sreq;
@@ -157,7 +157,7 @@ int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_SendNoncontig
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
                                MPIDI_msg_sz_t hdr_sz)
 {
@@ -222,7 +222,7 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_AM,
                            mxm_obj->mxm_mq, mxm_obj->mxm_rank, MXM_MPICH_HID_ADI_MSG, 0, 0);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_MXM_SENDNONCONTIGMSG);
@@ -235,7 +235,7 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
                       int rank, int tag, MPID_Comm * comm, int context_offset,
                       MPID_Request ** sreq_ptr)
@@ -296,7 +296,7 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Data
             MPI_Aint packsize = 0;
 
             sreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
+            MPIR_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
                                  "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPIR_Pack_size_impl(count, datatype, &packsize);
 
@@ -322,7 +322,7 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Data
                                                                         comm->context_id
                                                                         + context_offset), 0);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     _dbg_mxm_out_req(sreq);
 
@@ -338,7 +338,7 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Data
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_ssend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
                        int rank, int tag, MPID_Comm * comm, int context_offset,
                        MPID_Request ** sreq_ptr)
@@ -399,7 +399,7 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
             MPI_Aint packsize = 0;
 
             sreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
+            MPIR_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
                                  "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPIR_Pack_size_impl(count, datatype, &packsize);
 
@@ -425,7 +425,7 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
                                                                         comm->context_id
                                                                         + context_offset), 0);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     _dbg_mxm_out_req(sreq);
 
@@ -441,7 +441,7 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_isend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
                        int rank, int tag, MPID_Comm * comm, int context_offset,
                        MPID_Request ** sreq_ptr)
@@ -502,7 +502,7 @@ int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
             MPI_Aint packsize = 0;
 
             sreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
+            MPIR_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
                                  "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPIR_Pack_size_impl(count, datatype, &packsize);
 
@@ -528,7 +528,7 @@ int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
                                                                         comm->context_id
                                                                         + context_offset), 0);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     _dbg_mxm_out_req(sreq);
 
@@ -544,7 +544,7 @@ int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_issend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
                         int rank, int tag, MPID_Comm * comm, int context_offset,
                         MPID_Request ** sreq_ptr)
@@ -606,7 +606,7 @@ int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Da
 
             sreq->ch.noncontig = TRUE;
             sreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
+            MPIR_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
                                  "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPIR_Pack_size_impl(count, datatype, &packsize);
 
@@ -631,7 +631,7 @@ int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Da
                                                                         comm->context_id
                                                                         + context_offset), 0);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     _dbg_mxm_out_req(sreq);
 
@@ -795,7 +795,7 @@ static int _mxm_process_sdtype(MPID_Request ** sreq_p, MPI_Datatype datatype,
     int size_to_copy = 0;
 
     sreq->dev.segment_ptr = MPID_Segment_alloc();
-    MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
+    MPIR_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
                          "**nomem %s", "MPID_Segment_alloc");
 
     MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
index 095e991..04974e7 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
@@ -126,7 +126,7 @@ static inline int MPID_nem_ofi_conn_req_callback(cq_tagged_entry_t * wc, MPID_Re
     MPIDI_VC_Init(vc, NULL, 0);
     MPIDI_CH3I_NM_OFI_RC(MPIDI_GetTagFromPort(bc, &vc->port_name_tag));
     ret = MPIU_Str_get_binary_arg(bc, "OFI", addr, gl_data.bound_addrlen, &len);
-    MPIU_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
+    MPIR_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
                         (size_t) len != gl_data.bound_addrlen,
                         mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
@@ -260,7 +260,7 @@ static inline int MPID_nem_ofi_preposted_callback(cq_tagged_entry_t * wc, MPID_R
                    GET_RCD_IGNORE_MASK(),
                    &(REQ_OFI(rreq)->ofi_context)), trecv);
     /* Return a proper error to MPI to indicate out of memory condition */
-    MPIU_ERR_CHKANDJUMP1(pack_buffer == NULL, mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP1(pack_buffer == NULL, mpi_errno, MPI_ERR_OTHER,
                          "**nomem", "**nomem %s", "Pack Buffer alloc");
     END_FUNC_RC(FCNAME);
 }
@@ -410,7 +410,7 @@ int MPID_nem_ofi_vc_connect(MPIDI_VC_t * vc)
 
     MPIDI_CH3I_NM_OFI_RC(vc->pg->getConnInfo(vc->pg_rank, bc, OFI_KVSAPPSTRLEN, vc->pg));
     ret = MPIU_Str_get_binary_arg(bc, "OFI", addr, gl_data.bound_addrlen, &len);
-    MPIU_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
+    MPIR_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
                         (size_t) len != gl_data.bound_addrlen,
                         mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
     FI_RC(fi_av_insert(gl_data.av, addr, 1, &(VC_OFI(vc)->direct_addr), 0ULL, NULL), avmap);
@@ -539,14 +539,14 @@ int MPID_nem_ofi_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
     }
     MPIDI_CH3I_NM_OFI_RC(MPIDI_GetTagFromPort(business_card, &new_vc->port_name_tag));
     ret = MPIU_Str_get_binary_arg(business_card, "OFI", addr, gl_data.bound_addrlen, &len);
-    MPIU_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
+    MPIR_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
                         (size_t) len != gl_data.bound_addrlen,
                         mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
     FI_RC(fi_av_insert(gl_data.av, addr, 1, &(VC_OFI(new_vc)->direct_addr), 0ULL, NULL), avmap);
 
     VC_OFI(new_vc)->ready = 1;
     str_errno = MPIU_Str_add_int_arg(&bc, &my_bc_len, "tag", new_vc->port_name_tag);
-    MPIU_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**argstr_port_name_tag");
+    MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**argstr_port_name_tag");
     MPIDI_CH3I_NM_OFI_RC(MPID_nem_ofi_get_business_card(MPIR_Process.comm_world->rank, &bc, &my_bc_len));
     my_bc_len = OFI_KVSAPPSTRLEN - my_bc_len;
 
@@ -601,8 +601,8 @@ int MPID_nem_ofi_get_business_card(int my_rank ATTRIBUTE((unused)),
                                         "OFI",
                                         (char *) &gl_data.bound_addr, gl_data.bound_addrlen);
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
     END_FUNC_RC(FCNAME);
 }
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_impl.h b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_impl.h
index d0a3169..390f2ec 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_impl.h
@@ -145,7 +145,7 @@ fn_fail:                      \
    ? strrchr(__FILE__,'/')+1                    \
    : __FILE__                                   \
 )
-#define DECL_FUNC(FUNCNAME)  MPIU_QUOTE(FUNCNAME)
+#define DECL_FUNC(FUNCNAME)  MPL_QUOTE(FUNCNAME)
 #define OFI_COMPILE_TIME_ASSERT(expr_)                                  \
   do { switch(0) { case 0: case (expr_): default: break; } } while (0)
 
@@ -153,7 +153,7 @@ fn_fail:                      \
   do                                                            \
     {                                                           \
       ssize_t _ret = FUNC;                                      \
-      MPIU_ERR_##CHKANDJUMP4(_ret<0,                            \
+      MPIR_ERR_##CHKANDJUMP4(_ret<0,                            \
                            mpi_errno,                           \
                            MPI_ERR_OTHER,                       \
                            "**ofi_"#STR,                        \
@@ -170,7 +170,7 @@ fn_fail:                      \
 		do {							\
 			_ret = FUNC;                                    \
 			if(likely(_ret==0)) break;			\
-			MPIU_ERR_##CHKANDJUMP4(_ret != -FI_EAGAIN,	\
+			MPIR_ERR_##CHKANDJUMP4(_ret != -FI_EAGAIN,	\
 					       mpi_errno,		\
 					       MPI_ERR_OTHER,		\
 					       "**ofi_"#STR,		\
@@ -181,7 +181,7 @@ fn_fail:                      \
 					       fi_strerror(-_ret));	\
 				mpi_errno = MPID_nem_ofi_poll(0);	\
 				if(mpi_errno != MPI_SUCCESS)		\
-					MPIU_ERR_POP(mpi_errno);	\
+					MPIR_ERR_POP(mpi_errno);	\
 		} while (_ret == -FI_EAGAIN);				\
 	} while (0)
 
@@ -190,7 +190,7 @@ fn_fail:                      \
   do                                                            \
     {                                                           \
       pmi_errno  = FUNC;                                        \
-      MPIU_ERR_##CHKANDJUMP4(pmi_errno!=PMI_SUCCESS,            \
+      MPIR_ERR_##CHKANDJUMP4(pmi_errno!=PMI_SUCCESS,            \
                            mpi_errno,                           \
                            MPI_ERR_OTHER,                       \
                            "**ofi_"#STR,                        \
@@ -205,7 +205,7 @@ fn_fail:                      \
   do                                                        \
     {                                                       \
       mpi_errno  = FUNC;                                    \
-      if (mpi_errno) MPIU_ERR_POP(mpi_errno);               \
+      if (mpi_errno) MPIR_ERR_POP(mpi_errno);               \
     } while (0);
 
 #define VC_READY_CHECK(vc)                      \
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c
index bb5530e..5de47b7 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c
@@ -111,7 +111,7 @@ int MPID_nem_ofi_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
                      hints,         /* In:  Hints to filter available providers  */
                      &prov_tagged), /* Out: List of providers that match hints   */
           getinfo);
-    MPIU_ERR_CHKANDJUMP4(prov_tagged == NULL, mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP4(prov_tagged == NULL, mpi_errno, MPI_ERR_OTHER,
                          "**ofi_getinfo", "**ofi_getinfo %s %d %s %s",
                          __SHORT_FILE__, __LINE__, FCNAME, "No tag matching provider found");
     /* ------------------------------------------------------------------------ */
@@ -252,7 +252,7 @@ int MPID_nem_ofi_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
         ret = MPIU_Str_get_binary_arg(bc, "OFI",
                                       (char *) &addrs[i * gl_data.bound_addrlen],
                                       gl_data.bound_addrlen, &len);
-        MPIU_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
+        MPIR_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
                             (size_t) len != gl_data.bound_addrlen,
                             mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
     }
@@ -347,32 +347,32 @@ static inline int compile_time_checking()
 
     /* ------------------------------------------------------------------------ */
     /* Generate the MPICH catalog files                                         */
-    /* The high level mpich build scripts inspect MPIU_ERR_ macros to generate  */
+    /* The high level mpich build scripts inspect MPIR_ERR_ macros to generate  */
     /* the message catalog.  However, this netmod buries the messages under the */
     /* FI_RC macros, so the catalog doesn't get generated.  The build system    */
-    /* likely needs a MPIU_ERR_REGISTER macro                                   */
+    /* likely needs a MPIR_ERR_REGISTER macro                                   */
     /* ------------------------------------------------------------------------ */
 #if 0
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_avmap", "**ofi_avmap %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_tsend", "**ofi_tsend %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_trecv", "**ofi_trecv %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_getinfo", "**ofi_getinfo %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_openep", "**ofi_openep %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_openfabric", "**ofi_openfabric %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_opendomain", "**ofi_opendomain %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_opencq", "**ofi_opencq %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_avopen", "**ofi_avopen %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_bind", "**ofi_bind %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_ep_enable", "**ofi_ep_enable %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_getname", "**ofi_getname %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_avclose", "**ofi_avclose %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_epclose", "**ofi_epclose %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_cqclose", "**ofi_cqclose %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_fabricclose", "**ofi_fabricclose %s %d %s %s", a, b, a,a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_domainclose", "**ofi_domainclose %s %d %s %s", a, b, a,a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_peek", "**ofi_peek %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_poll", "**ofi_poll %s %d %s %s", a, b, a, a);
-    MPIU_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_cancel", "**ofi_cancel %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_avmap", "**ofi_avmap %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_tsend", "**ofi_tsend %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_trecv", "**ofi_trecv %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_getinfo", "**ofi_getinfo %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_openep", "**ofi_openep %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_openfabric", "**ofi_openfabric %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_opendomain", "**ofi_opendomain %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_opencq", "**ofi_opencq %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_avopen", "**ofi_avopen %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_bind", "**ofi_bind %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_ep_enable", "**ofi_ep_enable %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_getname", "**ofi_getname %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_avclose", "**ofi_avclose %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_epclose", "**ofi_epclose %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_cqclose", "**ofi_cqclose %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_fabricclose", "**ofi_fabricclose %s %d %s %s", a, b, a,a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_domainclose", "**ofi_domainclose %s %d %s %s", a, b, a,a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_peek", "**ofi_peek %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_poll", "**ofi_poll %s %d %s %s", a, b, a, a);
+    MPIR_ERR_SET2(e, MPI_ERR_OTHER, "**ofi_cancel", "**ofi_cancel %s %d %s %s", a, b, a, a);
 #endif
     return 0;
 }
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_msg.c b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_msg.c
index f6b7177..58491ce 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_msg.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_msg.c
@@ -211,7 +211,7 @@ int MPID_nem_ofi_iSendContig(MPIDI_VC_t * vc,
     pkt_len = sizeof(MPIDI_CH3_Pkt_t) + sreq->dev.ext_hdr_sz + data_sz;
     if (sreq->dev.ext_hdr_sz > 0 && gl_data.iov_limit > 2) {
       REQ_OFI(sreq)->real_hdr        = MPIU_Malloc(sizeof(MPIDI_CH3_Pkt_t)+sreq->dev.ext_hdr_sz);
-      MPIU_ERR_CHKANDJUMP1(REQ_OFI(sreq)->real_hdr == NULL, mpi_errno, MPI_ERR_OTHER,
+      MPIR_ERR_CHKANDJUMP1(REQ_OFI(sreq)->real_hdr == NULL, mpi_errno, MPI_ERR_OTHER,
                             "**nomem", "**nomem %s", "iSendContig extended header allocation");
       REQ_OFI(sreq)->iov[0].iov_base = REQ_OFI(sreq)->real_hdr;
       REQ_OFI(sreq)->iov[0].iov_len  = hdr_sz;
@@ -226,7 +226,7 @@ int MPID_nem_ofi_iSendContig(MPIDI_VC_t * vc,
       }
     else if(sreq->dev.ext_hdr_sz == 0 && gl_data.iov_limit > 1) {
         REQ_OFI(sreq)->real_hdr = MPIU_Malloc(sizeof(MPIDI_CH3_Pkt_t));
-        MPIU_ERR_CHKANDJUMP1(REQ_OFI(sreq)->real_hdr == NULL, mpi_errno, MPI_ERR_OTHER,
+        MPIR_ERR_CHKANDJUMP1(REQ_OFI(sreq)->real_hdr == NULL, mpi_errno, MPI_ERR_OTHER,
                              "**nomem", "**nomem %s", "iSendContig header allocation");
         MPIU_Memcpy(REQ_OFI(sreq)->real_hdr, hdr, hdr_sz);
         REQ_OFI(sreq)->iov[0].iov_base = REQ_OFI(sreq)->real_hdr;
@@ -237,7 +237,7 @@ int MPID_nem_ofi_iSendContig(MPIDI_VC_t * vc,
     }
     else {
       pack_buffer = MPIU_Malloc(pkt_len);
-      MPIU_ERR_CHKANDJUMP1(pack_buffer == NULL, mpi_errno, MPI_ERR_OTHER,
+      MPIR_ERR_CHKANDJUMP1(pack_buffer == NULL, mpi_errno, MPI_ERR_OTHER,
                            "**nomem", "**nomem %s", "iSendContig pack buffer allocation");
       MPIU_Memcpy(pack_buffer, hdr, hdr_sz);
       buf_offset += sizeof(MPIDI_CH3_Pkt_t);
@@ -273,7 +273,7 @@ int MPID_nem_ofi_SendNoncontig(MPIDI_VC_t * vc,
     data_sz = sreq->dev.segment_size - sreq->dev.segment_first;
     pkt_len = sizeof(MPIDI_CH3_Pkt_t) + sreq->dev.ext_hdr_sz + data_sz;
     pack_buffer = MPIU_Malloc(pkt_len);
-    MPIU_ERR_CHKANDJUMP1(pack_buffer == NULL, mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP1(pack_buffer == NULL, mpi_errno, MPI_ERR_OTHER,
                          "**nomem", "**nomem %s", "SendNonContig pack buffer allocation");
     MPIU_Memcpy(pack_buffer, hdr, hdr_sz);
     buf_offset += sizeof(MPIDI_CH3_Pkt_t);
@@ -319,7 +319,7 @@ int MPID_nem_ofi_iStartContigMsg(MPIDI_VC_t * vc,
     }
     else {
       pack_buffer = MPIU_Malloc(pkt_len);
-      MPIU_ERR_CHKANDJUMP1(pack_buffer == NULL, mpi_errno, MPI_ERR_OTHER,
+      MPIR_ERR_CHKANDJUMP1(pack_buffer == NULL, mpi_errno, MPI_ERR_OTHER,
                            "**nomem", "**nomem %s", "iStartContig pack buffer allocation");
       MPIU_Memcpy((void *) pack_buffer, hdr, hdr_sz);
       if (data_sz)
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_probe_template.c b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_probe_template.c
index 73f4b7d..bda3e45 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_probe_template.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_probe_template.c
@@ -93,7 +93,7 @@ int ADD_SUFFIX(MPID_nem_ofi_iprobe_impl)(struct MPIDI_VC *vc,
       MPID_nem_ofi_poll(MPID_NONBLOCKING_POLL);
       goto fn_exit;
     }
-    MPIU_ERR_CHKANDJUMP4((ret < 0), mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP4((ret < 0), mpi_errno, MPI_ERR_OTHER,
                          "**ofi_peek", "**ofi_peek %s %d %s %s",
                          __SHORT_FILE__, __LINE__, FCNAME, fi_strerror(-ret));
 
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_progress.c b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_progress.c
index a067d27..2fe8a69 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_progress.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_progress.c
@@ -115,7 +115,7 @@ int MPID_nem_ofi_poll(int in_blocking_poll)
 		}
             }
             else {
-                MPIU_ERR_CHKANDJUMP4(1, mpi_errno, MPI_ERR_OTHER, "**ofi_poll",
+                MPIR_ERR_CHKANDJUMP4(1, mpi_errno, MPI_ERR_OTHER, "**ofi_poll",
                                      "**ofi_poll %s %d %s %s", __SHORT_FILE__,
                                      __LINE__, FCNAME, fi_strerror(-ret));
             }
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_tagged_template.c b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_tagged_template.c
index d7003f0..20db939 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_tagged_template.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_tagged_template.c
@@ -142,7 +142,7 @@ ADD_SUFFIX(do_isend)(struct MPIDI_VC *vc,
     send_buffer = (char *) buf + dt_true_lb;
     if (!dt_contig) {
         send_buffer = (char *) MPIU_Malloc(data_sz);
-        MPIU_ERR_CHKANDJUMP1(send_buffer == NULL, mpi_errno,
+        MPIR_ERR_CHKANDJUMP1(send_buffer == NULL, mpi_errno,
                              MPI_ERR_OTHER, "**nomem", "**nomem %s", "Send buffer alloc");
         MPIDI_CH3U_Buffer_copy(buf, count, datatype, &err0,
                                send_buffer, data_sz, MPI_BYTE, &data_sz, &err1);
@@ -307,7 +307,7 @@ int ADD_SUFFIX(MPID_nem_ofi_recv_posted)(struct MPIDI_VC *vc, struct MPID_Reques
     }
     else {
         recv_buffer = (char *) MPIU_Malloc(data_sz);
-        MPIU_ERR_CHKANDJUMP1(recv_buffer == NULL, mpi_errno, MPI_ERR_OTHER,
+        MPIR_ERR_CHKANDJUMP1(recv_buffer == NULL, mpi_errno, MPI_ERR_OTHER,
                              "**nomem", "**nomem %s", "Recv Pack Buffer alloc");
         REQ_OFI(rreq)->pack_buffer = recv_buffer;
     }
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
index 88dd68d..1c7cb6a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
@@ -96,7 +96,7 @@ static MPIDI_CH3_PktHandler_Fcn *MPID_nem_ptl_pkt_handlers[2]; /* for CANCEL_SEN
 #undef FUNCNAME
 #define FUNCNAME get_target_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int get_target_info(int rank, ptl_process_t *id, ptl_pt_index_t local_data_pt, ptl_pt_index_t *target_data_pt,
                            ptl_pt_index_t *target_control_pt)
 {
@@ -111,7 +111,7 @@ static int get_target_info(int rank, ptl_process_t *id, ptl_pt_index_t local_dat
     vc_ptl = VC_PTL(vc);
     if (!vc_ptl->id_initialized) {
         mpi_errno = MPID_nem_ptl_init_id(vc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     *id = vc_ptl->id;
@@ -144,7 +144,7 @@ static int get_target_info(int rank, ptl_process_t *id, ptl_pt_index_t local_dat
 #undef FUNCNAME
 #define FUNCNAME ptl_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int ptl_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -167,22 +167,22 @@ static int ptl_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max
             
 
     mpi_errno = MPIDI_CH3I_Register_anysource_notification(MPID_nem_ptl_anysource_posted, MPID_nem_ptl_anysource_matched);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIDI_Anysource_improbe_fn = MPID_nem_ptl_anysource_improbe;
 
     /* init portals */
     ret = PtlInit();
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlinit", "**ptlinit %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlinit", "**ptlinit %s", MPID_nem_ptl_strerror(ret));
     
     /* do an interface pre-init to get the default limits struct */
     ret = PtlNIInit(PTL_IFACE_DEFAULT, PTL_NI_MATCHING | PTL_NI_PHYSICAL,
                     PTL_PID_ANY, NULL, &desired, &MPIDI_nem_ptl_ni);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlniinit", "**ptlniinit %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlniinit", "**ptlniinit %s", MPID_nem_ptl_strerror(ret));
 
     /* finalize the interface so we can re-init with our desired maximums */
     ret = PtlNIFini(MPIDI_nem_ptl_ni);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlnifini", "**ptlnifini %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlnifini", "**ptlnifini %s", MPID_nem_ptl_strerror(ret));
 
     /* set higher limits if they are determined to be too low */
     if (desired.max_unexpected_headers < UNEXPECTED_HDR_COUNT && getenv("PTL_LIM_MAX_UNEXPECTED_HEADERS") == NULL)
@@ -195,55 +195,55 @@ static int ptl_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max
     /* do the real init */
     ret = PtlNIInit(PTL_IFACE_DEFAULT, PTL_NI_MATCHING | PTL_NI_PHYSICAL,
                     PTL_PID_ANY, &desired, &MPIDI_nem_ptl_ni_limits, &MPIDI_nem_ptl_ni);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlniinit", "**ptlniinit %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlniinit", "**ptlniinit %s", MPID_nem_ptl_strerror(ret));
 
     /* allocate EQs for each portal */
     ret = PtlEQAlloc(MPIDI_nem_ptl_ni, EVENT_COUNT, &MPIDI_nem_ptl_eq);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
 
     ret = PtlEQAlloc(MPIDI_nem_ptl_ni, EVENT_COUNT, &MPIDI_nem_ptl_get_eq);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
 
     ret = PtlEQAlloc(MPIDI_nem_ptl_ni, EVENT_COUNT, &MPIDI_nem_ptl_control_eq);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
 
     ret = PtlEQAlloc(MPIDI_nem_ptl_ni, EVENT_COUNT, &MPIDI_nem_ptl_rpt_eq);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
 
     /* allocate a separate EQ for origin events. with this, we can implement rate-limit operations
        to prevent a locally triggered flow control even */
     ret = PtlEQAlloc(MPIDI_nem_ptl_ni, EVENT_COUNT, &MPIDI_nem_ptl_origin_eq);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
 
     /* allocate portal for matching messages */
     ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_eq,
                      PTL_PT_ANY, &MPIDI_nem_ptl_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
 
     /* allocate portal for large messages where receiver does a get */
     ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_get_eq,
                      PTL_PT_ANY, &MPIDI_nem_ptl_get_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
 
     /* allocate portal for MPICH control messages */
     ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_control_eq,
                      PTL_PT_ANY, &MPIDI_nem_ptl_control_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
 
     /* allocate portal for MPICH control messages */
     ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_rpt_eq,
                      PTL_PT_ANY, &MPIDI_nem_ptl_rpt_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
 
     /* allocate portal for MPICH control messages */
     ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_rpt_eq,
                      PTL_PT_ANY, &MPIDI_nem_ptl_get_rpt_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
 
     /* allocate portal for MPICH control messages */
     ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_rpt_eq,
                      PTL_PT_ANY, &MPIDI_nem_ptl_control_rpt_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
 
     /* create an MD that covers all of memory */
     md.start = 0;
@@ -252,15 +252,15 @@ static int ptl_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max
     md.eq_handle = MPIDI_nem_ptl_origin_eq;
     md.ct_handle = PTL_CT_NONE;
     ret = PtlMDBind(MPIDI_nem_ptl_ni, &md, &MPIDI_nem_ptl_global_md);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdbind", "**ptlmdbind %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdbind", "**ptlmdbind %s", MPID_nem_ptl_strerror(ret));
 
     /* currently, rportlas only works with a single NI and EQ */
     ret = MPID_nem_ptl_rptl_init(MPIDI_Process.my_pg->size, ORIGIN_EVENTS, get_target_info);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlniinit", "**ptlniinit %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlniinit", "**ptlniinit %s", MPID_nem_ptl_strerror(ret));
 
     /* allow rportal to manage the primary portal and retransmit if needed */
     ret = MPID_nem_ptl_rptl_ptinit(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_origin_eq, MPIDI_nem_ptl_pt, MPIDI_nem_ptl_rpt_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
 
     /* allow rportal to manage the get and control portals, but we
      * don't expect retransmission to be needed on the get portal, so
@@ -268,21 +268,21 @@ static int ptl_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max
      * does not have an "invalid" PT constant, which would have been
      * more appropriate to pass over here. */
     ret = MPID_nem_ptl_rptl_ptinit(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_origin_eq, MPIDI_nem_ptl_get_pt, MPIDI_nem_ptl_get_rpt_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
 
     ret = MPID_nem_ptl_rptl_ptinit(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_origin_eq, MPIDI_nem_ptl_control_pt, MPIDI_nem_ptl_control_rpt_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
 
     /* create business card */
     mpi_errno = get_business_card(pg_rank, bc_val_p, val_max_sz_p);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* init other modules */
     mpi_errno = MPID_nem_ptl_poll_init();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_nem_ptl_nm_init();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_PTL_INIT);
@@ -294,7 +294,7 @@ static int ptl_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max
 #undef FUNCNAME
 #define FUNCNAME ptl_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int ptl_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -305,10 +305,10 @@ static int ptl_finalize(void)
 
     /* shut down other modules */
     mpi_errno = MPID_nem_ptl_nm_finalize();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_nem_ptl_poll_finalize();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* shut down portals */
     eqs[0] = MPIDI_nem_ptl_eq;
@@ -317,37 +317,37 @@ static int ptl_finalize(void)
     eqs[3] = MPIDI_nem_ptl_origin_eq;
     eqs[4] = MPIDI_nem_ptl_rpt_eq;
     ret = MPID_nem_ptl_rptl_drain_eq(5, eqs);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
 
     ret = MPID_nem_ptl_rptl_ptfini(MPIDI_nem_ptl_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
 
     ret = PtlPTFree(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
 
     ret = MPID_nem_ptl_rptl_ptfini(MPIDI_nem_ptl_get_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
 
     ret = PtlPTFree(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_get_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
 
     ret = MPID_nem_ptl_rptl_ptfini(MPIDI_nem_ptl_control_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
 
     ret = PtlPTFree(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
 
     ret = PtlPTFree(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_rpt_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
 
     ret = PtlPTFree(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_get_rpt_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
 
     ret = PtlPTFree(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_rpt_pt);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
 
     ret = PtlNIFini(MPIDI_nem_ptl_ni);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlnifini", "**ptlnifini %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlnifini", "**ptlnifini %s", MPID_nem_ptl_strerror(ret));
 
     PtlFini();
 
@@ -364,7 +364,7 @@ static int ptl_finalize(void)
 #undef FUNCNAME
 #define FUNCNAME get_business_card
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -376,54 +376,54 @@ static int get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
     MPIDI_FUNC_ENTER(MPID_STATE_GET_BUSINESS_CARD);
 
     ret = PtlGetId(MPIDI_nem_ptl_ni, &my_ptl_id);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlgetid", "**ptlgetid %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlgetid", "**ptlgetid %s", MPID_nem_ptl_strerror(ret));
     MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "Allocated NI and PT id=(%#x,%#x) pt=%#x",
                                             my_ptl_id.phys.nid, my_ptl_id.phys.pid, MPIDI_nem_ptl_pt));
 
     str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, NID_KEY, (char *)&my_ptl_id.phys.nid, sizeof(my_ptl_id.phys.nid));
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
     str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, PID_KEY, (char *)&my_ptl_id.phys.pid, sizeof(my_ptl_id.phys.pid));
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
     str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, PTI_KEY, (char *)&MPIDI_nem_ptl_pt, sizeof(MPIDI_nem_ptl_pt));
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
     str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, PTIG_KEY, (char *)&MPIDI_nem_ptl_get_pt,
                                         sizeof(MPIDI_nem_ptl_get_pt));
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
     str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, PTIC_KEY, (char *)&MPIDI_nem_ptl_control_pt,
                                         sizeof(MPIDI_nem_ptl_control_pt));
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
     str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, PTIR_KEY, (char *)&MPIDI_nem_ptl_rpt_pt,
                                         sizeof(MPIDI_nem_ptl_rpt_pt));
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
     str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, PTIRG_KEY, (char *)&MPIDI_nem_ptl_get_rpt_pt,
                                         sizeof(MPIDI_nem_ptl_get_rpt_pt));
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
     str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, PTIRC_KEY, (char *)&MPIDI_nem_ptl_control_rpt_pt,
                                         sizeof(MPIDI_nem_ptl_control_rpt_pt));
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
 
  fn_exit:
@@ -436,7 +436,7 @@ static int get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
 #undef FUNCNAME
 #define FUNCNAME connect_to_root
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int connect_to_root(const char *business_card, MPIDI_VC_t *new_vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -444,7 +444,7 @@ static int connect_to_root(const char *business_card, MPIDI_VC_t *new_vc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_CONNECT_TO_ROOT);
 
-    MPIU_ERR_SETFATAL(mpi_errno, MPI_ERR_OTHER, "**notimpl");
+    MPIR_ERR_SETFATAL(mpi_errno, MPI_ERR_OTHER, "**notimpl");
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_CONNECT_TO_ROOT);
@@ -457,7 +457,7 @@ static int connect_to_root(const char *business_card, MPIDI_VC_t *new_vc)
 #undef FUNCNAME
 #define FUNCNAME vc_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int vc_init(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -502,7 +502,7 @@ static int vc_init(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME vc_destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int vc_destroy(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -516,7 +516,7 @@ static int vc_destroy(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_get_id_from_bc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_get_id_from_bc(const char *business_card, ptl_process_t *id, ptl_pt_index_t *pt, ptl_pt_index_t *ptg, ptl_pt_index_t *ptc, ptl_pt_index_t *ptr, ptl_pt_index_t *ptrg, ptl_pt_index_t *ptrc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -527,28 +527,28 @@ int MPID_nem_ptl_get_id_from_bc(const char *business_card, ptl_process_t *id, pt
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_GET_ID_FROM_BC);
 
     ret = MPIU_Str_get_binary_arg(business_card, NID_KEY, (char *)&id->phys.nid, sizeof(id->phys.nid), &len);
-    MPIU_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(id->phys.nid), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(id->phys.nid), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
     ret = MPIU_Str_get_binary_arg(business_card, PID_KEY, (char *)&id->phys.pid, sizeof(id->phys.pid), &len);
-    MPIU_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(id->phys.pid), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(id->phys.pid), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
     ret = MPIU_Str_get_binary_arg(business_card, PTI_KEY, (char *)pt, sizeof(pt), &len);
-    MPIU_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*pt), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*pt), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
     ret = MPIU_Str_get_binary_arg(business_card, PTIG_KEY, (char *)ptg, sizeof(ptg), &len);
-    MPIU_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptg), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptg), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
     ret = MPIU_Str_get_binary_arg(business_card, PTIC_KEY, (char *)ptc, sizeof(ptc), &len);
-    MPIU_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptc), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptc), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
     ret = MPIU_Str_get_binary_arg(business_card, PTIR_KEY, (char *)ptr, sizeof(ptr), &len);
-    MPIU_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptr), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptr), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
     ret = MPIU_Str_get_binary_arg(business_card, PTIRG_KEY, (char *)ptrg, sizeof(ptr), &len);
-    MPIU_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptrc), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptrc), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
     ret = MPIU_Str_get_binary_arg(business_card, PTIRC_KEY, (char *)ptrc, sizeof(ptr), &len);
-    MPIU_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptrc), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptrc), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_GET_ID_FROM_BC);
@@ -560,7 +560,7 @@ int MPID_nem_ptl_get_id_from_bc(const char *business_card, ptl_process_t *id, pt
 #undef FUNCNAME
 #define FUNCNAME vc_terminate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int vc_terminate(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -574,12 +574,12 @@ int vc_terminate(MPIDI_VC_t *vc)
         /* VC is terminated as a result of a fault.  Complete
            outstanding sends with an error and terminate
            connection immediately. */
-        MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+        MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
         mpi_errno = MPID_nem_ptl_vc_terminated(vc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
      } else if (vc_ptl->num_queued_sends == 0) {
          mpi_errno = MPID_nem_ptl_vc_terminated(vc);
-         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
      } else {
          /* the send_queued function will call vc_terminated if vc->state is
             CLOSED and the last queued send has been sent*/
@@ -596,7 +596,7 @@ int vc_terminate(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_vc_terminated
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_vc_terminated(MPIDI_VC_t *vc)
 {
     /* This is called when the VC is to be terminated once all queued
@@ -607,7 +607,7 @@ int MPID_nem_ptl_vc_terminated(MPIDI_VC_t *vc)
     MPIDI_FUNC_ENTER(MPID_NEM_PTL_VC_TERMINATED);
 
     mpi_errno = MPIDI_CH3U_Handle_connection(vc, MPIDI_VC_EVENT_TERMINATED);
-    if(mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if(mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_NEM_PTL_VC_TERMINATED);
@@ -620,7 +620,7 @@ int MPID_nem_ptl_vc_terminated(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_init_id
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_init_id(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -634,14 +634,14 @@ int MPID_nem_ptl_init_id(MPIDI_VC_t *vc)
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_INIT_ID);
 
     pmi_errno = PMI_KVS_Get_value_length_max(&val_max_sz);
-    MPIU_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
+    MPIR_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
     MPIU_CHKLMEM_MALLOC(bc, char *, val_max_sz, mpi_errno, "bc");
 
     mpi_errno = vc->pg->getConnInfo(vc->pg_rank, bc, val_max_sz, vc->pg);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_nem_ptl_get_id_from_bc(bc, &vc_ptl->id, &vc_ptl->pt, &vc_ptl->ptg, &vc_ptl->ptc, &vc_ptl->ptr, &vc_ptl->ptrg, &vc_ptl->ptrc);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     vc_ptl->id_initialized = TRUE;
 
@@ -658,7 +658,7 @@ int MPID_nem_ptl_init_id(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_get_ordering
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_get_ordering(int *ordering)
 {
     (*ordering) = 1;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_lmt.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_lmt.c
index 3847617..a6f08ed 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_lmt.c
@@ -11,7 +11,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_lmt_initiate_lmt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_lmt_initiate_lmt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *rts_pkt, MPID_Request *req)
 {
     /* Nothing to do here, but has to be defined for CH3 to follow the right path to
@@ -29,7 +29,7 @@ int MPID_nem_ptl_lmt_initiate_lmt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *rts_pkt, MPID
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_lmt_start_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_lmt_start_send(MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV r_cookie)
 {
     MPIU_Assertp(0 && "This function shouldn't be called.");
@@ -40,7 +40,7 @@ int MPID_nem_ptl_lmt_start_send(MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV r_co
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_lmt_handle_cookie
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_lmt_handle_cookie(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV s_cookie)
 {
     MPIU_Assertp(0 && "This function shouldn't be called.");
@@ -51,7 +51,7 @@ int MPID_nem_ptl_lmt_handle_cookie(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV s_
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_lmt_done_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_lmt_done_send(MPIDI_VC_t *vc, MPID_Request *req)
 {
     MPIU_Assertp(0 && "This function shouldn't be called.");
@@ -62,7 +62,7 @@ int MPID_nem_ptl_lmt_done_send(MPIDI_VC_t *vc, MPID_Request *req)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_lmt_done_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_lmt_done_recv(MPIDI_VC_t *vc, MPID_Request *req)
 {
     MPIU_Assertp(0 && "This function shouldn't be called.");
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
index 41f0d5d..b5a8d38 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -32,7 +32,7 @@ static int expected_recv_idx;
 #undef FUNCNAME
 #define FUNCNAME incr_expected_recv_ptr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void incr_expected_recv_ptr(size_t size)
 {
     expected_recv_ptr += size > PTL_MAX_EAGER ? PTL_MAX_EAGER : size;
@@ -47,7 +47,7 @@ static inline void incr_expected_recv_ptr(size_t size)
 #undef FUNCNAME
 #define FUNCNAME handle_request
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int handle_request(MPID_Request *req)
 {
     int mpi_errno = MPID_nem_handle_pkt(req->ch.vc, TMPBUF(req), REQ_PTL(req)->bytes_put);
@@ -61,7 +61,7 @@ static inline int handle_request(MPID_Request *req)
 #undef FUNCNAME
 #define FUNCNAME progress_reorder
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int progress_reorder(void)
 {
     MPID_Request *req;
@@ -73,7 +73,7 @@ static inline int progress_reorder(void)
     while (req) {
         mpi_errno = handle_request(req);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         GENERIC_Q_SEARCH_REMOVE(&reorder_queue,
                                 REQ_PTL(_e)->recv_ptr == expected_recv_ptr,
                                 &req, MPID_Request, dev.next);
@@ -89,7 +89,7 @@ static inline int progress_reorder(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_nm_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_nm_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -122,7 +122,7 @@ int MPID_nem_ptl_nm_init(void)
         overflow_me.start = tmp_ptr;
         ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &overflow_me,
                           PTL_OVERFLOW_LIST, (void *)(size_t)i, &me_handles[i]);
-        MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
+        MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
                              MPID_nem_ptl_strerror(ret));
         tmp_ptr += BUFSIZE;
         max_recv_ptr[i] = tmp_ptr - overflow_me.min_free;
@@ -142,7 +142,7 @@ int MPID_nem_ptl_nm_init(void)
     get_me.min_free = 0;
     ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &get_me, PTL_PRIORITY_LIST, NULL,
                       &get_me_handle);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
 
     /* init the reorder queue */
     reorder_queue.head = reorder_queue.tail = NULL;
@@ -157,7 +157,7 @@ int MPID_nem_ptl_nm_init(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_nm_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_nm_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -169,12 +169,12 @@ int MPID_nem_ptl_nm_finalize(void)
 
     for (i = 0; i < NUM_RECV_BUFS; ++i) {
         ret = PtlMEUnlink(me_handles[i]);
-        MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink", "**ptlmeunlink %s",
+        MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink", "**ptlmeunlink %s",
                              MPID_nem_ptl_strerror(ret));
     }
 
     ret = PtlMEUnlink(get_me_handle);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink", "**ptlmeunlink %s",
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink", "**ptlmeunlink %s",
                          MPID_nem_ptl_strerror(ret));
 
     /* Freeing first element because the allocation was a single contiguous buffer */
@@ -190,7 +190,7 @@ int MPID_nem_ptl_nm_finalize(void)
 #undef FUNCNAME
 #define FUNCNAME send_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_sz_t data_sz,
                            MPID_Request *sreq)
 {
@@ -239,7 +239,7 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
 
     ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)sendbuf, sendbuf_sz, PTL_NO_ACK_REQ,
                                 vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, NPTL_HEADER(0, remaining));
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
                          MPID_nem_ptl_strerror(ret));
     MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
                                             sendbuf_sz, vc_ptl->id.phys.nid,
@@ -257,7 +257,7 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
 #undef FUNCNAME
 #define FUNCNAME send_noncontig_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -313,7 +313,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
 
     ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)sendbuf, sendbuf_sz, PTL_NO_ACK_REQ,
                                 vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, NPTL_HEADER(0, remaining));
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
                          MPID_nem_ptl_strerror(ret));
     MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
                                             sendbuf_sz, vc_ptl->id.phys.nid,
@@ -332,7 +332,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_SendNoncontig
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -342,7 +342,7 @@ int MPID_nem_ptl_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MP
     
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
     mpi_errno = send_noncontig_pkt(vc, sreq, hdr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_SENDNONCONTIG);
@@ -354,7 +354,7 @@ int MPID_nem_ptl_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MP
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_iStartContigMsg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data,
                                  MPIDI_msg_sz_t data_sz, MPID_Request **sreq_ptr)
 {
@@ -373,7 +373,7 @@ int MPID_nem_ptl_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
     (*sreq_ptr)->dev.user_buf = NULL;
 
     mpi_errno = send_pkt(vc, hdr, data, data_sz, *sreq_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_ISTARTCONTIGMSG);
@@ -385,7 +385,7 @@ int MPID_nem_ptl_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_iSendContig
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz,
                                void *data, MPIDI_msg_sz_t data_sz)
 {
@@ -396,7 +396,7 @@ int MPID_nem_ptl_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
     
     mpi_errno = send_pkt(vc, hdr, data, data_sz, sreq);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_ISENDCONTIG);
@@ -408,7 +408,7 @@ int MPID_nem_ptl_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
 #undef FUNCNAME
 #define FUNCNAME on_data_avail
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int on_data_avail(MPID_Request * req)
 {
     int (*reqFn) (MPIDI_VC_t *, MPID_Request *, int *);
@@ -424,7 +424,7 @@ static inline int on_data_avail(MPID_Request * req)
     if (!reqFn) {
         mpi_errno = MPID_Request_complete(req);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
@@ -450,7 +450,7 @@ static inline int on_data_avail(MPID_Request * req)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_nm_ctl_event_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -478,10 +478,10 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                     incr_expected_recv_ptr(packet_sz);
                     mpi_errno = MPID_nem_handle_pkt(vc, e->start, packet_sz);
                     if (mpi_errno)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                     mpi_errno = progress_reorder();
                     if (mpi_errno)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                 }
                 else {
                     MPID_Request *req = MPID_Request_create();
@@ -519,7 +519,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                     MPIDI_CH3U_Request_increment_cc(req, &incomplete);  /* Will be decremented - and eventually freed in REPLY */
                     ret = MPID_nem_ptl_rptl_get(MPIDI_nem_ptl_global_md, (ptl_size_t)buf_ptr,
                                                 size, vc_ptl->id, vc_ptl->ptc, NPTL_MATCH(sender_req_id, GET_TAG, MPIDI_Process.my_pg_rank), target_offset, req);
-                    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s",
+                    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s",
                                          MPID_nem_ptl_strerror(ret));
                     MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,
                                                             "PtlGet(size=%lu id=(%#x,%#x) pt=%#x tag=%d)", size,
@@ -554,7 +554,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                 if (REQ_PTL(req)->put_done) {
                     mpi_errno = on_data_avail(req);  /* Otherwise we'll do it on the SEND */
                     if (mpi_errno != MPI_SUCCESS) {
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                     }
                 }
             }
@@ -570,7 +570,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
             if (REQ_PTL(req)->num_gets == 0) {  /* Otherwise GET will do it */
                 mpi_errno = on_data_avail(req);
                 if (mpi_errno != MPI_SUCCESS) {
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -586,10 +586,10 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                 if (REQ_PTL(req)->recv_ptr == expected_recv_ptr) {
                     mpi_errno = handle_request(req);
                     if (mpi_errno)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                     mpi_errno = progress_reorder();
                     if (mpi_errno)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                 }
                 else
                     GENERIC_Q_ENQUEUE(&reorder_queue, req, dev.next);
@@ -606,7 +606,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
 
             ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &overflow_me,
                               PTL_OVERFLOW_LIST, e->user_ptr, &me_handles[buf_idx]);
-            MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
+            MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
                                  MPID_nem_ptl_strerror(ret));
         }
 
@@ -616,7 +616,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
 
     default:
         MPL_error_printf("Received unexpected event type: %d %s\n", e->type, MPID_nem_ptl_strevent(e));
-        MPIU_ERR_INTERNALANDJUMP(mpi_errno, "Unexpected event type");
+        MPIR_ERR_INTERNALANDJUMP(mpi_errno, "Unexpected event type");
         break;
     }
 
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
index e726610..0e06e1a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
@@ -18,7 +18,7 @@ static int append_overflow(int i);
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_poll_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_poll_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -32,7 +32,7 @@ int MPID_nem_ptl_poll_init(void)
     for (i = 0; i < NUM_OVERFLOW_ME; ++i) {
         MPIU_CHKPMEM_MALLOC(overflow_buf[i], void *, OVERFLOW_LENGTH, mpi_errno, "overflow buffer");
         mpi_errno = append_overflow(i);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
  fn_exit:
@@ -50,7 +50,7 @@ int MPID_nem_ptl_poll_init(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_poll_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_poll_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -63,7 +63,7 @@ int MPID_nem_ptl_poll_finalize(void)
     for (i = 0; i < NUM_OVERFLOW_ME; ++i) {
         if (overflow_me_handle[i] != PTL_INVALID_HANDLE) {
             ret = PtlMEUnlink(overflow_me_handle[i]);
-            MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink", "**ptlmeunlink %s", MPID_nem_ptl_strerror(ret));
+            MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink", "**ptlmeunlink %s", MPID_nem_ptl_strerror(ret));
         }
         MPIU_Free(overflow_buf[i]);
     }
@@ -78,7 +78,7 @@ int MPID_nem_ptl_poll_finalize(void)
 #undef FUNCNAME
 #define FUNCNAME append_overflow
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int append_overflow(int i)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -108,7 +108,7 @@ static int append_overflow(int i)
     /* if there is no space to append the entry, process outstanding events and try again */
     ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_pt, &me, PTL_OVERFLOW_LIST, (void *)(size_t)i,
                       &overflow_me_handle[i]);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_APPEND_OVERFLOW);
@@ -121,7 +121,7 @@ static int append_overflow(int i)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_poll
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_poll(int is_blocking_poll)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -140,18 +140,18 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
 
         /* check EQs for events */
         ret = MPID_nem_ptl_rptl_eqget(MPIDI_nem_ptl_eq, &event);
-        MPIU_ERR_CHKANDJUMP(ret == PTL_EQ_DROPPED, mpi_errno, MPI_ERR_OTHER, "**eqdropped");
+        MPIR_ERR_CHKANDJUMP(ret == PTL_EQ_DROPPED, mpi_errno, MPI_ERR_OTHER, "**eqdropped");
         if (ret == PTL_EQ_EMPTY) {
             ret = MPID_nem_ptl_rptl_eqget(MPIDI_nem_ptl_get_eq, &event);
-            MPIU_ERR_CHKANDJUMP(ret == PTL_EQ_DROPPED, mpi_errno, MPI_ERR_OTHER, "**eqdropped");
+            MPIR_ERR_CHKANDJUMP(ret == PTL_EQ_DROPPED, mpi_errno, MPI_ERR_OTHER, "**eqdropped");
 
             if (ret == PTL_EQ_EMPTY) {
                 ret = MPID_nem_ptl_rptl_eqget(MPIDI_nem_ptl_control_eq, &event);
-                MPIU_ERR_CHKANDJUMP(ret == PTL_EQ_DROPPED, mpi_errno, MPI_ERR_OTHER, "**eqdropped");
+                MPIR_ERR_CHKANDJUMP(ret == PTL_EQ_DROPPED, mpi_errno, MPI_ERR_OTHER, "**eqdropped");
 
                 if (ret == PTL_EQ_EMPTY) {
                     ret = MPID_nem_ptl_rptl_eqget(MPIDI_nem_ptl_origin_eq, &event);
-                    MPIU_ERR_CHKANDJUMP(ret == PTL_EQ_DROPPED, mpi_errno, MPI_ERR_OTHER, "**eqdropped");
+                    MPIR_ERR_CHKANDJUMP(ret == PTL_EQ_DROPPED, mpi_errno, MPI_ERR_OTHER, "**eqdropped");
                 } else {
                     ctl_event = TRUE;
                 }
@@ -161,16 +161,16 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
                     break;
             }
         }
-        MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqget", "**ptleqget %s", MPID_nem_ptl_strerror(ret));
+        MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqget", "**ptleqget %s", MPID_nem_ptl_strerror(ret));
         MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "Received event %s pt_idx=%d ni_fail=%s list=%s user_ptr=%p hdr_data=%#lx mlength=%lu rlength=%lu",
                                                 MPID_nem_ptl_strevent(&event), event.pt_index, MPID_nem_ptl_strnifail(event.ni_fail_type),
                                                 MPID_nem_ptl_strlist(event.ptl_list), event.user_ptr, event.hdr_data, event.mlength, event.rlength));
-        MPIU_ERR_CHKANDJUMP2(event.ni_fail_type != PTL_NI_OK && event.ni_fail_type != PTL_NI_NO_MATCH, mpi_errno, MPI_ERR_OTHER, "**ptlni_fail", "**ptlni_fail %s %s", MPID_nem_ptl_strevent(&event), MPID_nem_ptl_strnifail(event.ni_fail_type));
+        MPIR_ERR_CHKANDJUMP2(event.ni_fail_type != PTL_NI_OK && event.ni_fail_type != PTL_NI_NO_MATCH, mpi_errno, MPI_ERR_OTHER, "**ptlni_fail", "**ptlni_fail %s %s", MPID_nem_ptl_strevent(&event), MPID_nem_ptl_strnifail(event.ni_fail_type));
 
         /* special case for events on the control portal */
         if (ctl_event) {
             mpi_errno = MPID_nem_ptl_nm_ctl_event_handler(&event);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             continue;
         }
 
@@ -188,13 +188,13 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
             MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "REQ_PTL(req)->event_handler = %p", REQ_PTL(req)->event_handler);
             if (REQ_PTL(req)->event_handler) {
                 mpi_errno = REQ_PTL(req)->event_handler(&event);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
             break;
         }
         case PTL_EVENT_AUTO_FREE:
             mpi_errno = append_overflow((size_t)event.user_ptr);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             break;
         case PTL_EVENT_AUTO_UNLINK:
             overflow_me_handle[(size_t)event.user_ptr] = PTL_INVALID_HANDLE;
@@ -205,7 +205,7 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
         case PTL_EVENT_ACK:
         default:
             MPL_error_printf("Received unexpected event type: %d %s", event.type, MPID_nem_ptl_strevent(&event));
-            MPIU_ERR_INTERNALANDJUMP(mpi_errno, "Unexpected event type");
+            MPIR_ERR_INTERNALANDJUMP(mpi_errno, "Unexpected event type");
         }
     }
 
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
index f4eb6c5..9268ea5 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME handle_probe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int handle_probe(const ptl_event_t *e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -31,7 +31,7 @@ static int handle_probe(const ptl_event_t *e)
  finish_probe:
     mpi_errno = MPID_Request_complete(req);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -84,7 +84,7 @@ static int handle_mprobe(const ptl_event_t *e)
   finish_mprobe:
     mpi_errno = MPID_Request_complete(req);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -100,7 +100,7 @@ static int handle_mprobe(const ptl_event_t *e)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_probe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, MPI_Status *status)
 {
     MPIU_Assertp(0 && "This function shouldn't be called.");
@@ -110,7 +110,7 @@ int MPID_nem_ptl_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_iprobe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -128,7 +128,7 @@ int MPID_nem_ptl_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, in
     
     /* create a request */
     req = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP1(!req, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Request_create");
+    MPIR_ERR_CHKANDJUMP1(!req, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Request_create");
     MPIU_Object_set_ref(req, 2); /* 1 ref for progress engine and 1 ref for us */
     REQ_PTL(req)->event_handler = handle_probe;
 
@@ -146,7 +146,7 @@ int MPID_nem_ptl_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, in
     else {
         if (!vc_ptl->id_initialized) {
             mpi_errno = MPID_nem_ptl_init_id(vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         me.match_id = vc_ptl->id;
     }
@@ -158,13 +158,13 @@ int MPID_nem_ptl_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, in
 
     /* submit a search request */
     ret = PtlMESearch(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_pt, &me, PTL_SEARCH_ONLY, req);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmesearch", "**ptlmesearch %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmesearch", "**ptlmesearch %s", MPID_nem_ptl_strerror(ret));
     DBG_MSG_MESearch("REG", vc ? vc->pg_rank : MPI_ANY_SOURCE, me, req);
 
     /* wait for search request to complete */
     do {
         mpi_errno = MPID_nem_ptl_poll(FALSE);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } while (!MPID_Request_is_complete(req));
 
     *flag = REQ_PTL(req)->found;
@@ -183,7 +183,7 @@ int MPID_nem_ptl_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, in
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_improbe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, int *flag,
                          MPID_Request **message, MPI_Status *status)
 {
@@ -204,7 +204,7 @@ int MPID_nem_ptl_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, i
     /* create a request */
     req = MPID_Request_create();
     MPID_nem_ptl_init_req(req);
-    MPIU_ERR_CHKANDJUMP1(!req, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Request_create");
+    MPIR_ERR_CHKANDJUMP1(!req, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Request_create");
     MPIU_Object_set_ref(req, 2); /* 1 ref for progress engine and 1 ref for us */
     REQ_PTL(req)->event_handler = handle_mprobe;
     req->kind = MPID_REQUEST_MPROBE;
@@ -223,7 +223,7 @@ int MPID_nem_ptl_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, i
     else {
         if (!vc_ptl->id_initialized) {
             mpi_errno = MPID_nem_ptl_init_id(vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         me.match_id = vc_ptl->id;
     }
@@ -234,13 +234,13 @@ int MPID_nem_ptl_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, i
         me.ignore_bits = NPTL_MATCH_IGNORE;
     /* submit a search request */
     ret = PtlMESearch(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_pt, &me, PTL_SEARCH_DELETE, req);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmesearch", "**ptlmesearch %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmesearch", "**ptlmesearch %s", MPID_nem_ptl_strerror(ret));
     DBG_MSG_MESearch("REG", vc ? vc->pg_rank : 0, me, req);
 
     /* wait for search request to complete */
     do {
         mpi_errno = MPID_nem_ptl_poll(FALSE);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } while (!MPID_Request_is_complete(req));
 
     *flag = REQ_PTL(req)->found;
@@ -264,7 +264,7 @@ int MPID_nem_ptl_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, i
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_anysource_iprobe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_anysource_iprobe(int tag, MPID_Comm * comm, int context_offset, int *flag, MPI_Status * status)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -284,7 +284,7 @@ int MPID_nem_ptl_anysource_iprobe(int tag, MPID_Comm * comm, int context_offset,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_anysource_improbe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_anysource_improbe(int tag, MPID_Comm * comm, int context_offset, int *flag, MPID_Request **message,
                                    MPI_Status * status)
 {
@@ -305,7 +305,7 @@ int MPID_nem_ptl_anysource_improbe(int tag, MPID_Comm * comm, int context_offset
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_pkt_cancel_send_req_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_pkt_cancel_send_req_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
                                                     MPIDI_msg_sz_t *buflen, MPID_Request **rreqp)
 {
@@ -325,7 +325,7 @@ int MPID_nem_ptl_pkt_cancel_send_req_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pk
     /* create a request */
     search_req = MPID_Request_create();
     MPID_nem_ptl_init_req(search_req);
-    MPIU_ERR_CHKANDJUMP1(!search_req, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Request_create");
+    MPIR_ERR_CHKANDJUMP1(!search_req, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Request_create");
     MPIU_Object_set_ref(search_req, 2); /* 1 ref for progress engine and 1 ref for us */
     search_req->kind = MPID_REQUEST_MPROBE;
 
@@ -346,13 +346,13 @@ int MPID_nem_ptl_pkt_cancel_send_req_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pk
 
     /* submit a search request */
     ret = PtlMESearch(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_pt, &me, PTL_SEARCH_DELETE, search_req);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmesearch", "**ptlmesearch %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmesearch", "**ptlmesearch %s", MPID_nem_ptl_strerror(ret));
     DBG_MSG_MESearch("REG", vc ? vc->pg_rank : 0, me, search_req);
 
     /* wait for search request to complete */
     do {
         mpi_errno = MPID_nem_ptl_poll(FALSE);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } while (!MPID_Request_is_complete(search_req));
 
     /* send response */
@@ -381,7 +381,7 @@ int MPID_nem_ptl_pkt_cancel_send_req_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pk
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_pkt_cancel_send_resp_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_pkt_cancel_send_resp_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
                                               MPIDI_msg_sz_t *buflen, MPID_Request **rreqp)
 {
@@ -398,10 +398,10 @@ int MPID_nem_ptl_pkt_cancel_send_resp_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *p
         /* remove/free any remaining get MEs and handles */
         for (i = 0; i < REQ_PTL(sreq)->num_gets; i++) {
             ret = PtlMEUnlink(REQ_PTL(sreq)->get_me_p[i]);
-            MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink", "**ptlmeunlink %s", MPID_nem_ptl_strerror(ret));
+            MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink", "**ptlmeunlink %s", MPID_nem_ptl_strerror(ret));
             mpi_errno = MPID_Request_complete(sreq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
         }
         if (REQ_PTL(sreq)->get_me_p)
@@ -415,7 +415,7 @@ int MPID_nem_ptl_pkt_cancel_send_resp_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *p
 
     mpi_errno = MPID_Request_complete(sreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
      *rreqp = NULL;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
index 2282ea9..960073e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
@@ -10,7 +10,7 @@
 #undef FUNCNAME
 #define FUNCNAME dequeue_req
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void dequeue_req(const ptl_event_t *e)
 {
     int found;
@@ -39,7 +39,7 @@ static void dequeue_req(const ptl_event_t *e)
     if (s_len > r_len) {
         /* truncated data */
         MPIR_STATUS_SET_COUNT(rreq->status, r_len);
-        MPIU_ERR_SET2(rreq->status.MPI_ERROR, MPI_ERR_TRUNCATE, "**truncate", "**truncate %d %d", s_len, r_len);
+        MPIR_ERR_SET2(rreq->status.MPI_ERROR, MPI_ERR_TRUNCATE, "**truncate", "**truncate %d %d", s_len, r_len);
     } else {
         MPIR_STATUS_SET_COUNT(rreq->status, s_len);
     }
@@ -48,7 +48,7 @@ static void dequeue_req(const ptl_event_t *e)
 #undef FUNCNAME
 #define FUNCNAME handler_recv_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int handler_recv_complete(const ptl_event_t *e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -63,7 +63,7 @@ static int handler_recv_complete(const ptl_event_t *e)
 
     if (REQ_PTL(rreq)->md != PTL_INVALID_HANDLE) {
         ret = PtlMDRelease(REQ_PTL(rreq)->md);
-        MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdrelease", "**ptlmdrelease %s", MPID_nem_ptl_strerror(ret));
+        MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdrelease", "**ptlmdrelease %s", MPID_nem_ptl_strerror(ret));
     }
 
     for (i = 0; i < MPID_NEM_PTL_NUM_CHUNK_BUFFERS; ++i)
@@ -72,7 +72,7 @@ static int handler_recv_complete(const ptl_event_t *e)
     
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -85,7 +85,7 @@ static int handler_recv_complete(const ptl_event_t *e)
 #undef FUNCNAME
 #define FUNCNAME handler_recv_dequeue_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int handler_recv_dequeue_complete(const ptl_event_t *e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -116,11 +116,11 @@ static int handler_recv_dequeue_complete(const ptl_event_t *e)
             last = e->mlength;
             MPID_Segment_unpack(rreq->dev.segment_ptr, rreq->dev.segment_first, &last, e->start);
             if (last != e->mlength)
-                MPIU_ERR_SET(rreq->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
+                MPIR_ERR_SET(rreq->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
         }
     } else {
         if (!is_contig && data_sz != e->mlength)
-            MPIU_ERR_SET(rreq->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
+            MPIR_ERR_SET(rreq->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
     }
     
     mpi_errno = handler_recv_complete(e);
@@ -135,7 +135,7 @@ static int handler_recv_dequeue_complete(const ptl_event_t *e)
 #undef FUNCNAME
 #define FUNCNAME handler_recv_big_get
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int handler_recv_big_get(const ptl_event_t *e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -160,7 +160,7 @@ static int handler_recv_big_get(const ptl_event_t *e)
         mpi_errno = handler_recv_complete(e);
     }
 
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_HANDLER_RECV_UNPACK);
@@ -172,7 +172,7 @@ static int handler_recv_big_get(const ptl_event_t *e)
 #undef FUNCNAME
 #define FUNCNAME big_get
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void big_get(void *buf, ptl_size_t left_to_get, MPIDI_VC_t *vc, ptl_match_bits_t match_bits, MPID_Request *rreq)
 {
     int ret;
@@ -207,7 +207,7 @@ static void big_get(void *buf, ptl_size_t left_to_get, MPIDI_VC_t *vc, ptl_match
 #undef FUNCNAME
 #define FUNCNAME handler_recv_unpack_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int handler_recv_unpack_complete(const ptl_event_t *e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -231,7 +231,7 @@ static int handler_recv_unpack_complete(const ptl_event_t *e)
     MPIU_Assert(last == rreq->dev.segment_first + e->mlength);
     
     mpi_errno = handler_recv_complete(e);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_HANDLER_RECV_UNPACK_COMPLETE);
@@ -243,7 +243,7 @@ static int handler_recv_unpack_complete(const ptl_event_t *e)
 #undef FUNCNAME
 #define FUNCNAME handler_recv_dequeue_unpack_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int handler_recv_dequeue_unpack_complete(const ptl_event_t *e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -266,7 +266,7 @@ static int handler_recv_dequeue_unpack_complete(const ptl_event_t *e)
 #undef FUNCNAME
 #define FUNCNAME handler_recv_dequeue_large
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int handler_recv_dequeue_large(const ptl_event_t *e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -308,7 +308,7 @@ static int handler_recv_dequeue_large(const ptl_event_t *e)
     if (!(e->hdr_data & NPTL_LARGE)) {
         /* all data has already been received; we're done */
         mpi_errno = handler_recv_complete(e);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
         
@@ -337,12 +337,12 @@ static int handler_recv_dequeue_large(const ptl_event_t *e)
         md.eq_handle = MPIDI_nem_ptl_origin_eq;
         md.ct_handle = PTL_CT_NONE;
         ret = PtlMDBind(MPIDI_nem_ptl_ni, &md, &REQ_PTL(rreq)->md);
-        MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdbind", "**ptlmdbind %s", MPID_nem_ptl_strerror(ret));
+        MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdbind", "**ptlmdbind %s", MPID_nem_ptl_strerror(ret));
 
         REQ_PTL(rreq)->event_handler = handler_recv_complete;
         ret = MPID_nem_ptl_rptl_get(REQ_PTL(rreq)->md, 0, rreq->dev.segment_size - rreq->dev.segment_first, vc_ptl->id, vc_ptl->ptg,
                      e->match_bits, 0, rreq);
-        MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s", MPID_nem_ptl_strerror(ret));
+        MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s", MPID_nem_ptl_strerror(ret));
         goto fn_exit;
     }
         
@@ -366,7 +366,7 @@ static int handler_recv_dequeue_large(const ptl_event_t *e)
 #undef FUNCNAME
 #define FUNCNAME handler_recv_dequeue_unpack_large
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int handler_recv_dequeue_unpack_large(const ptl_event_t *e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -387,7 +387,7 @@ static int handler_recv_dequeue_unpack_large(const ptl_event_t *e)
     if (!(e->hdr_data & NPTL_LARGE)) {
         /* all data has already been received; we're done */
         mpi_errno = handler_recv_unpack_complete(e);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
@@ -420,7 +420,7 @@ static int handler_recv_dequeue_unpack_large(const ptl_event_t *e)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_recv_posted
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -453,7 +453,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
     } else {
         if (!vc_ptl->id_initialized) {
             mpi_errno = MPID_nem_ptl_init_id(vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         me.match_id = vc_ptl->id;
     }
@@ -486,7 +486,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
             /* small noncontig */
             MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Small noncontig message");
             rreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1(rreq->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+            MPIR_ERR_CHKANDJUMP1(rreq->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPID_Segment_init(rreq->dev.user_buf, rreq->dev.user_count, rreq->dev.datatype, rreq->dev.segment_ptr, 0);
             rreq->dev.segment_first = 0;
             rreq->dev.segment_size = data_sz;
@@ -524,7 +524,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
             /* large noncontig */
             MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Large noncontig message");
             rreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1(rreq->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+            MPIR_ERR_CHKANDJUMP1(rreq->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPID_Segment_init(rreq->dev.user_buf, rreq->dev.user_count, rreq->dev.datatype, rreq->dev.segment_ptr, 0);
             rreq->dev.segment_first = 0;
             rreq->dev.segment_size = data_sz;
@@ -555,7 +555,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
     }
 
     ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_pt, &me, PTL_PRIORITY_LIST, rreq, &REQ_PTL(rreq)->put_me);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
     DBG_MSG_MEAPPEND("REG", vc ? vc->pg_rank : MPI_ANY_SOURCE, me, rreq);
     MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "    buf=%p", me.start);
     MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "MPIDI_nem_ptl_pt = %d", MPIDI_nem_ptl_pt);
@@ -573,7 +573,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_anysource_posted
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPID_nem_ptl_anysource_posted(MPID_Request *rreq)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -594,7 +594,7 @@ void MPID_nem_ptl_anysource_posted(MPID_Request *rreq)
 #undef FUNCNAME
 #define FUNCNAME cancel_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int cancel_recv(MPID_Request *rreq, int *cancelled)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -626,7 +626,7 @@ static int cancel_recv(MPID_Request *rreq, int *cancelled)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_anysource_matched
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_anysource_matched(MPID_Request *rreq)
 {
     int mpi_errno, cancelled;
@@ -653,7 +653,7 @@ int MPID_nem_ptl_anysource_matched(MPID_Request *rreq)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_cancel_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_cancel_recv(MPIDI_VC_t *vc,  MPID_Request *rreq)
 {
     int mpi_errno, cancelled;
@@ -680,7 +680,7 @@ int MPID_nem_ptl_cancel_recv(MPIDI_VC_t *vc,  MPID_Request *rreq)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_lmt_start_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_lmt_start_recv(MPIDI_VC_t *vc,  MPID_Request *rreq, MPL_IOV s_cookie)
 {
     /* This function should only be called as a result of an Mrecv because of the CH3 protocol for
@@ -726,7 +726,7 @@ int MPID_nem_ptl_lmt_start_recv(MPIDI_VC_t *vc,  MPID_Request *rreq, MPL_IOV s_c
         MPI_Aint last;
 
         rreq->dev.segment_ptr = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP1(rreq->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem",
+        MPIR_ERR_CHKANDJUMP1(rreq->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem",
                              "**nomem %s", "MPID_Segment_alloc");
         MPID_Segment_init(rreq->dev.user_buf, rreq->dev.user_count, rreq->dev.datatype,
                           rreq->dev.segment_ptr, 0);
@@ -750,13 +750,13 @@ int MPID_nem_ptl_lmt_start_recv(MPIDI_VC_t *vc,  MPID_Request *rreq, MPL_IOV s_c
             md.eq_handle = MPIDI_nem_ptl_origin_eq;
             md.ct_handle = PTL_CT_NONE;
             ret = PtlMDBind(MPIDI_nem_ptl_ni, &md, &REQ_PTL(rreq)->md);
-            MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdbind", "**ptlmdbind %s",
+            MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdbind", "**ptlmdbind %s",
                                  MPID_nem_ptl_strerror(ret));
 
             REQ_PTL(rreq)->event_handler = handler_recv_complete;
             ret = MPID_nem_ptl_rptl_get(REQ_PTL(rreq)->md, 0, rreq->dev.segment_size - rreq->dev.segment_first,
                                         vc_ptl->id, vc_ptl->ptg, match_bits, 0, rreq);
-            MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s",
+            MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s",
                                  MPID_nem_ptl_strerror(ret));
         }
         else {
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
index e0e432b..f07ee0a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
@@ -10,7 +10,7 @@
 #undef FUNCNAME
 #define FUNCNAME big_meappend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void big_meappend(void *buf, ptl_size_t left_to_send, MPIDI_VC_t *vc, ptl_match_bits_t match_bits, MPID_Request *sreq)
 {
     int i, ret, was_incomplete;
@@ -58,7 +58,7 @@ static void big_meappend(void *buf, ptl_size_t left_to_send, MPIDI_VC_t *vc, ptl
 #undef FUNCNAME
 #define FUNCNAME handler_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int handler_send(const ptl_event_t *e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -76,7 +76,7 @@ static int handler_send(const ptl_event_t *e)
     if (MPID_cc_get(sreq->cc) == 1) {
         if (REQ_PTL(sreq)->md != PTL_INVALID_HANDLE) {
             ret = PtlMDRelease(REQ_PTL(sreq)->md);
-            MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdrelease", "**ptlmdrelease %s", MPID_nem_ptl_strerror(ret));
+            MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdrelease", "**ptlmdrelease %s", MPID_nem_ptl_strerror(ret));
         }
 
         for (i = 0; i < MPID_NEM_PTL_NUM_CHUNK_BUFFERS; ++i)
@@ -88,7 +88,7 @@ static int handler_send(const ptl_event_t *e)
     }
     mpi_errno = MPID_Request_complete(sreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -102,7 +102,7 @@ static int handler_send(const ptl_event_t *e)
 #undef FUNCNAME
 #define FUNCNAME send_msg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
                     int tag, MPID_Comm *comm, int context_offset, struct MPID_Request **request)
 {
@@ -131,7 +131,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
 
     if (!vc_ptl->id_initialized) {
         mpi_errno = MPID_nem_ptl_init_id(vc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
@@ -152,7 +152,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
                 ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)start, data_sz, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt,
                                             NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
                                             NPTL_HEADER(ssend_flag, data_sz));
-            MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
+            MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
             DBG_MSG_PUT("global", data_sz, vc->pg_rank, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), NPTL_HEADER(ssend_flag, data_sz));
             MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "id.nid = %#x", vc_ptl->id.phys.nid);
             MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "id.pid = %#x", vc_ptl->id.phys.pid);
@@ -165,7 +165,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
         /* noncontig data */
         MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Small noncontig message");
         sreq->dev.segment_ptr = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP1(sreq->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+        MPIR_ERR_CHKANDJUMP1(sreq->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
         MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
         sreq->dev.segment_first = 0;
         sreq->dev.segment_size = data_sz;
@@ -183,13 +183,13 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
             md.eq_handle = MPIDI_nem_ptl_origin_eq;
             md.ct_handle = PTL_CT_NONE;
             ret = PtlMDBind(MPIDI_nem_ptl_ni, &md, &REQ_PTL(sreq)->md);
-            MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdbind", "**ptlmdbind %s", MPID_nem_ptl_strerror(ret));
+            MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdbind", "**ptlmdbind %s", MPID_nem_ptl_strerror(ret));
                 
             REQ_PTL(sreq)->event_handler = handler_send;
             ret = MPID_nem_ptl_rptl_put(REQ_PTL(sreq)->md, 0, data_sz, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt,
                          NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
                                         NPTL_HEADER(ssend_flag, data_sz));
-            MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
+            MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
             DBG_MSG_PUT("sreq", data_sz, vc->pg_rank, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), NPTL_HEADER(ssend_flag, data_sz));
             goto fn_exit;
         }
@@ -206,7 +206,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
         ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)REQ_PTL(sreq)->chunk_buffer[0], data_sz, PTL_NO_ACK_REQ,
                      vc_ptl->id, vc_ptl->pt, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
                                     NPTL_HEADER(ssend_flag, data_sz));
-        MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
+        MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
         DBG_MSG_PUT("global", data_sz, vc->pg_rank, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), NPTL_HEADER(ssend_flag, data_sz));
         goto fn_exit;
     }
@@ -222,7 +222,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
         ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)((char *)buf + dt_true_lb), PTL_LARGE_THRESHOLD, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt,
                      NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
                                     NPTL_HEADER(ssend_flag | NPTL_LARGE, data_sz));
-        MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
+        MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
         DBG_MSG_PUT("global", PTL_LARGE_THRESHOLD, vc->pg_rank, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), NPTL_HEADER(ssend_flag | NPTL_LARGE, data_sz));
         goto fn_exit;
     }
@@ -230,7 +230,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
     /* Large noncontig data */
     MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Large noncontig message");
     sreq->dev.segment_ptr = MPID_Segment_alloc();
-    MPIU_ERR_CHKANDJUMP1(sreq->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+    MPIR_ERR_CHKANDJUMP1(sreq->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
     MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
     sreq->dev.segment_first = 0;
     sreq->dev.segment_size = data_sz;
@@ -275,7 +275,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
 
                 ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_get_pt, &me, PTL_PRIORITY_LIST, sreq,
                                   &REQ_PTL(sreq)->get_me_p[0]);
-                MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
+                MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
                 DBG_MSG_MEAPPEND("CTL", vc->pg_rank, me, sreq);
                 /* increment the cc for the get operation */
                 MPIDI_CH3U_Request_increment_cc(sreq, &was_incomplete);
@@ -288,13 +288,13 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
                 md.eq_handle = MPIDI_nem_ptl_origin_eq;
                 md.ct_handle = PTL_CT_NONE;
                 ret = PtlMDBind(MPIDI_nem_ptl_ni, &md, &REQ_PTL(sreq)->md);
-                MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdbind", "**ptlmdbind %s", MPID_nem_ptl_strerror(ret));
+                MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdbind", "**ptlmdbind %s", MPID_nem_ptl_strerror(ret));
 
                 REQ_PTL(sreq)->event_handler = handler_send;
                 ret = MPID_nem_ptl_rptl_put(REQ_PTL(sreq)->md, 0, PTL_LARGE_THRESHOLD, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt,
                              NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
                                             NPTL_HEADER(ssend_flag | NPTL_LARGE, data_sz));
-                MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
+                MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
                 DBG_MSG_PUT("req", PTL_LARGE_THRESHOLD, vc->pg_rank, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), NPTL_HEADER(ssend_flag | NPTL_LARGE, data_sz));
                 goto fn_exit;
             }
@@ -317,7 +317,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
     ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)REQ_PTL(sreq)->chunk_buffer[0], PTL_LARGE_THRESHOLD,
                                 PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank),
                                 0, sreq, NPTL_HEADER(ssend_flag | NPTL_LARGE, data_sz));
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
     DBG_MSG_PUT("global", PTL_LARGE_THRESHOLD, vc->pg_rank, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), NPTL_HEADER(ssend_flag | NPTL_LARGE, data_sz));
     
  fn_exit:
@@ -337,7 +337,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_isend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_isend(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
                        MPID_Comm *comm, int context_offset, struct MPID_Request **request)
 {
@@ -356,7 +356,7 @@ int MPID_nem_ptl_isend(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_issend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_issend(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
                         MPID_Comm *comm, int context_offset, struct MPID_Request **request)
 {
@@ -374,7 +374,7 @@ int MPID_nem_ptl_issend(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MP
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_cancel_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_cancel_send(struct MPIDI_VC *vc,  struct MPID_Request *sreq)
 {
     int mpi_errno = MPI_SUCCESS;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
index 0a3294b..4541275 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
@@ -70,7 +70,7 @@ struct rptl_info rptl_info;
 #undef FUNCNAME
 #define FUNCNAME find_target
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int find_target(ptl_process_t id, struct rptl_target **target)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -123,7 +123,7 @@ static int rptl_put(ptl_handle_md_t md_handle, ptl_size_t local_offset, ptl_size
 #undef FUNCNAME
 #define FUNCNAME poke_progress
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int poke_progress(void)
 {
     int ret = PTL_OK;
@@ -322,7 +322,7 @@ static int poke_progress(void)
 #undef FUNCNAME
 #define FUNCNAME rptl_put
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int rptl_put(ptl_handle_md_t md_handle, ptl_size_t local_offset, ptl_size_t length,
                     ptl_ack_req_t ack_req, ptl_process_t target_id, ptl_pt_index_t pt_index,
                     ptl_match_bits_t match_bits, ptl_size_t remote_offset, void *user_ptr,
@@ -383,7 +383,7 @@ static int rptl_put(ptl_handle_md_t md_handle, ptl_size_t local_offset, ptl_size
 #undef FUNCNAME
 #define FUNCNAME rptl_put
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_rptl_put(ptl_handle_md_t md_handle, ptl_size_t local_offset, ptl_size_t length,
                           ptl_ack_req_t ack_req, ptl_process_t target_id, ptl_pt_index_t pt_index,
                           ptl_match_bits_t match_bits, ptl_size_t remote_offset, void *user_ptr,
@@ -397,7 +397,7 @@ int MPID_nem_ptl_rptl_put(ptl_handle_md_t md_handle, ptl_size_t local_offset, pt
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_rptl_get
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_rptl_get(ptl_handle_md_t md_handle, ptl_size_t local_offset, ptl_size_t length,
                           ptl_process_t target_id, ptl_pt_index_t pt_index,
                           ptl_match_bits_t match_bits, ptl_size_t remote_offset, void *user_ptr)
@@ -448,7 +448,7 @@ int MPID_nem_ptl_rptl_get(ptl_handle_md_t md_handle, ptl_size_t local_offset, pt
 #undef FUNCNAME
 #define FUNCNAME send_pause_messages
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int send_pause_messages(struct rptl *rptl)
 {
     int i, mpi_errno = MPI_SUCCESS;
@@ -495,7 +495,7 @@ static int send_pause_messages(struct rptl *rptl)
 #undef FUNCNAME
 #define FUNCNAME clear_nacks
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int clear_nacks(ptl_process_t target_id)
 {
     struct rptl_target *target;
@@ -532,7 +532,7 @@ static int clear_nacks(ptl_process_t target_id)
 #undef FUNCNAME
 #define FUNCNAME get_event_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int get_event_info(ptl_event_t * event, struct rptl **ret_rptl, struct rptl_op **ret_op)
 {
     struct rptl *rptl;
@@ -583,7 +583,7 @@ static int get_event_info(ptl_event_t * event, struct rptl **ret_rptl, struct rp
 #undef FUNCNAME
 #define FUNCNAME stash_event
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int stash_event(struct rptl_op *op, ptl_event_t event)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -636,7 +636,7 @@ static int pending_event_valid = 0;
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_rptl_eqget
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
 {
     struct rptl_op *op = NULL;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_init.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_init.c
index ce6113d..8b875fe 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_init.c
@@ -10,7 +10,7 @@
 #undef FUNCNAME
 #define FUNCNAME rptli_post_control_buffer
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int rptli_post_control_buffer(ptl_handle_ni_t ni_handle, ptl_pt_index_t pt,
                               ptl_handle_me_t * me_handle)
 {
@@ -54,7 +54,7 @@ int rptli_post_control_buffer(ptl_handle_ni_t ni_handle, ptl_pt_index_t pt,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_rptl_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_rptl_init(int world_size, uint64_t max_origin_events,
                            int (*get_target_info) (int rank, ptl_process_t * id,
                                                    ptl_pt_index_t local_data_pt,
@@ -85,7 +85,7 @@ int MPID_nem_ptl_rptl_init(int world_size, uint64_t max_origin_events,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_rptl_drain_eq
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_rptl_drain_eq(int eq_count, ptl_handle_eq_t *eq)
 {
     int ret = PTL_OK;
@@ -136,7 +136,7 @@ int MPID_nem_ptl_rptl_drain_eq(int eq_count, ptl_handle_eq_t *eq)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_rptl_ptinit
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_rptl_ptinit(ptl_handle_ni_t ni_handle, ptl_handle_eq_t eq_handle, ptl_pt_index_t data_pt,
                              ptl_pt_index_t control_pt)
 {
@@ -204,7 +204,7 @@ int MPID_nem_ptl_rptl_ptinit(ptl_handle_ni_t ni_handle, ptl_handle_eq_t eq_handl
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_rptl_ptfini
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_ptl_rptl_ptfini(ptl_pt_index_t pt_index)
 {
     int i;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_op.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_op.c
index 44a287c..7997883 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_op.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_op.c
@@ -10,7 +10,7 @@
 #undef FUNCNAME
 #define FUNCNAME rptli_op_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int rptli_op_alloc(struct rptl_op **op, struct rptl_target *target)
 {
     int ret = PTL_OK;
@@ -52,7 +52,7 @@ int rptli_op_alloc(struct rptl_op **op, struct rptl_target *target)
 #undef FUNCNAME
 #define FUNCNAME rptli_op_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void rptli_op_free(struct rptl_op *op)
 {
     MPIDI_STATE_DECL(MPID_STATE_RPTLI_OP_FREE);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
index 0b66ef6..4af735f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
@@ -123,7 +123,7 @@ static int error_closed(struct MPIDI_VC *const vc, int req_errno);
 #undef FUNCNAME
 #define FUNCNAME is_same_connection
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int is_same_connection(sockconn_t *sc1, sockconn_t *sc2)
 {
 
@@ -149,7 +149,7 @@ static inline int is_same_connection(sockconn_t *sc1, sockconn_t *sc2)
 #undef FUNCNAME
 #define FUNCNAME alloc_sc_plfd_tbls
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int alloc_sc_plfd_tbls (void)
 {
     int i, mpi_errno = MPI_SUCCESS, idx = -1;
@@ -177,7 +177,7 @@ static int alloc_sc_plfd_tbls (void)
     MPIU_CHKPMEM_COMMIT();
 
     mpi_errno = find_free_entry(&idx);
-    if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno != MPI_SUCCESS) MPIR_ERR_POP (mpi_errno);
 
     MPIU_Assert(0 == idx); /* assumed in other parts of this file */
     MPIU_Memcpy (&g_sc_tbl[idx], &MPID_nem_tcp_g_lstn_sc, sizeof(MPID_nem_tcp_g_lstn_sc));
@@ -196,7 +196,7 @@ static int alloc_sc_plfd_tbls (void)
 #undef FUNCNAME
 #define FUNCNAME free_sc_plfd_tbls
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int free_sc_plfd_tbls (void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -216,7 +216,7 @@ static int free_sc_plfd_tbls (void)
 #undef FUNCNAME
 #define FUNCNAME expand_sc_plfd_tbls
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int expand_sc_plfd_tbls (void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -303,7 +303,7 @@ static int expand_sc_plfd_tbls (void)
 #undef FUNCNAME
 #define FUNCNAME find_free_entry
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int find_free_entry(int *idx)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -345,7 +345,7 @@ static int find_free_entry(int *idx)
 #undef FUNCNAME
 #define FUNCNAME found_better_sc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int found_better_sc(sockconn_t *sc, sockconn_t **fnd_sc)
 {
     int i, found = FALSE;
@@ -429,7 +429,7 @@ fn_exit:
 #undef FUNCNAME
 #define FUNCNAME vc_is_in_shutdown
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int vc_is_in_shutdown(MPIDI_VC_t *vc)
 {
     int retval = FALSE;
@@ -452,7 +452,7 @@ static int vc_is_in_shutdown(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME send_id_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int send_id_info(const sockconn_t *const sc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -494,8 +494,8 @@ static int send_id_info(const sockconn_t *const sc)
     }
     
     offset = MPL_large_writev(sc->fd, iov, iov_cnt);
-    MPIU_ERR_CHKANDJUMP1(offset == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
-    MPIU_ERR_CHKANDJUMP1(offset != buf_size, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(offset == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(offset != buf_size, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
 /*     FIXME log appropriate error */
 /*     FIXME-Z1  socket is just connected and we are sending a few bytes. So, there should not */
 /*     be a problem of partial data only being written to. If partial data written, */
@@ -513,7 +513,7 @@ static int send_id_info(const sockconn_t *const sc)
 #undef FUNCNAME
 #define FUNCNAME send_tmpvc_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int send_tmpvc_info(const sockconn_t *const sc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -544,8 +544,8 @@ static int send_tmpvc_info(const sockconn_t *const sc)
     buf_size = sizeof(hdr) + sizeof(port_info);
     
     offset = MPL_large_writev(sc->fd, iov, iov_cnt);
-    MPIU_ERR_CHKANDJUMP1(offset == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
-    MPIU_ERR_CHKANDJUMP1(offset != buf_size, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(offset == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(offset != buf_size, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
 /*     FIXME log appropriate error */
 /*     FIXME-Z1  socket is just connected and we are sending a few bytes. So, there should not */
 /*     be a problem of partial data only being written to. If partial data written, */
@@ -562,7 +562,7 @@ static int send_tmpvc_info(const sockconn_t *const sc)
 #undef FUNCNAME
 #define FUNCNAME recv_id_or_tmpvc_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -590,8 +590,8 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
         *got_sc_eof = 1;
         goto fn_exit;
     }
-    MPIU_ERR_CHKANDJUMP1(nread == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
-    MPIU_ERR_CHKANDJUMP(nread != hdr_len, mpi_errno, MPI_ERR_OTHER, "**read");  /* FIXME-Z1 */
+    MPIR_ERR_CHKANDJUMP1(nread == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP(nread != hdr_len, mpi_errno, MPI_ERR_OTHER, "**read");  /* FIXME-Z1 */
     MPIU_Assert(hdr.pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_ID_INFO ||
 		hdr.pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_TMPVC_INFO);
     MPIU_Assert(hdr.datalen != 0);
@@ -607,19 +607,19 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
 	    ++iov_cnt;
 	} 
 	nread = MPL_large_readv(sc->fd, iov, iov_cnt);
-        MPIU_ERR_CHKANDJUMP1(nread == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
-	MPIU_ERR_CHKANDJUMP(nread != hdr.datalen, mpi_errno, MPI_ERR_OTHER, "**read"); /* FIXME-Z1 */
+        MPIR_ERR_CHKANDJUMP1(nread == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
+	MPIR_ERR_CHKANDJUMP(nread != hdr.datalen, mpi_errno, MPI_ERR_OTHER, "**read"); /* FIXME-Z1 */
 	if (pg_id_len == 0) {
 	    sc->is_same_pg = TRUE;
             mpi_errno = MPID_nem_tcp_get_vc_from_conninfo (MPIDI_Process.my_pg->id,
                                                                      sc->pg_rank, &sc->vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    sc->pg_id = NULL;
 	}
 	else {
 	    sc->is_same_pg = FALSE;
             mpi_errno = MPID_nem_tcp_get_vc_from_conninfo (pg_id, sc->pg_rank, &sc->vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    sc->pg_id = sc->vc->pg->id;
 	}
 
@@ -667,8 +667,8 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
         iov[0].iov_len = sizeof(sc->vc->port_name_tag);
 
         nread = MPL_large_readv(sc->fd, iov, iov_cnt);
-        MPIU_ERR_CHKANDJUMP1(nread == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
-        MPIU_ERR_CHKANDJUMP(nread != hdr.datalen, mpi_errno, MPI_ERR_OTHER, "**read"); /* FIXME-Z1 */
+        MPIR_ERR_CHKANDJUMP1(nread == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
+        MPIR_ERR_CHKANDJUMP(nread != hdr.datalen, mpi_errno, MPI_ERR_OTHER, "**read"); /* FIXME-Z1 */
         sc->is_same_pg = FALSE;
         sc->pg_id = NULL;
         sc->is_tmpvc = TRUE;
@@ -697,7 +697,7 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
 #undef FUNCNAME
 #define FUNCNAME send_cmd_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int send_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t pkt_type)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -715,8 +715,8 @@ static int send_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t pkt_type)
     pkt.datalen = 0;
 
     CHECK_EINTR (offset, write(fd, &pkt, pkt_len));
-    MPIU_ERR_CHKANDJUMP1(offset == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
-    MPIU_ERR_CHKANDJUMP1(offset != pkt_len, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno)); /* FIXME-Z1 */
+    MPIR_ERR_CHKANDJUMP1(offset == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(offset != pkt_len, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno)); /* FIXME-Z1 */
  fn_exit:
     return mpi_errno;
  fn_fail:
@@ -732,7 +732,7 @@ static int send_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t pkt_type)
 #undef FUNCNAME
 #define FUNCNAME recv_cmd_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int recv_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t *pkt_type)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -744,8 +744,8 @@ static int recv_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t *pkt_type)
     MPIDI_FUNC_ENTER(MPID_STATE_RECV_CMD_PKT);
 
     CHECK_EINTR (nread, read(fd, &pkt, pkt_len));
-    MPIU_ERR_CHKANDJUMP1(nread == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
-    MPIU_ERR_CHKANDJUMP2(nread != pkt_len, mpi_errno, MPI_ERR_OTHER, "**read", "**read %d %s", nread, MPIU_Strerror(errno)); /* FIXME-Z1 */
+    MPIR_ERR_CHKANDJUMP1(nread == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP2(nread != pkt_len, mpi_errno, MPI_ERR_OTHER, "**read", "**read %d %s", nread, MPIU_Strerror(errno)); /* FIXME-Z1 */
     MPIU_Assert(pkt.datalen == 0);
     MPIU_Assert(pkt.pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_ID_ACK ||
                 pkt.pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_ID_NAK ||
@@ -769,7 +769,7 @@ static int recv_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t *pkt_type)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_connect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
 {
     MPID_nem_tcp_vc_area *const vc_tcp = VC_TCP(vc);
@@ -788,7 +788,7 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
     /* Handle error case */
     if (vc_tcp->state == MPID_NEM_TCP_VC_STATE_ERROR ||
         vc->state == MPIDI_VC_STATE_MORIBUND) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**vc_in_error_state");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**vc_in_error_state");
     }
 
     /* We have an active connection, start polling more often */
@@ -803,9 +803,9 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
 
         if (vc_tcp->connect_retry_count > MPIDI_NEM_TCP_MAX_CONNECT_RETRIES) {
             MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "exceeded retries, closing sc");
-            MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**exceeded_connect_tries", "**exceeded_connect_tries %d", vc->pg_rank);
+            MPIR_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**exceeded_connect_tries", "**exceeded_connect_tries %d", vc->pg_rank);
             mpi_errno = error_closed(vc, mpi_errno);
-            MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
+            MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
             goto fn_fail;
         }
         
@@ -813,7 +813,7 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
 
         MPIU_Assert(vc_tcp->sc == NULL);
         mpi_errno = find_free_entry(&idx);
-        if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno != MPI_SUCCESS) MPIR_ERR_POP (mpi_errno);
 
         sc = &g_sc_tbl[idx];
         plfd = &MPID_nem_tcp_plfd_tbl[idx];
@@ -833,18 +833,18 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
             val_max_sz = PMI2_MAX_VALLEN;
 #else
             pmi_errno = PMI_KVS_Get_value_length_max(&val_max_sz);
-            MPIU_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
+            MPIR_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
 #endif
             MPIU_CHKLMEM_MALLOC(bc, char *, val_max_sz, mpi_errno, "bc");
             
             sc->is_tmpvc = FALSE;
             
             mpi_errno = vc->pg->getConnInfo(vc->pg_rank, bc, val_max_sz, vc->pg);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             mpi_errno = MPID_nem_tcp_get_addr_port_from_bc(bc, &addr, &(vc_tcp->sock_id.sin_port));
             vc_tcp->sock_id.sin_addr.s_addr = addr.s_addr;
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         else {
             sc->is_tmpvc = TRUE;
@@ -854,17 +854,17 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
         sock_addr = &(vc_tcp->sock_id);
 
         CHECK_EINTR(sc->fd, socket(AF_INET, SOCK_STREAM, 0));
-        MPIU_ERR_CHKANDJUMP2(sc->fd == -1, mpi_errno, MPI_ERR_OTHER, "**sock_create", "**sock_create %s %d", MPIU_Strerror(errno), errno);
+        MPIR_ERR_CHKANDJUMP2(sc->fd == -1, mpi_errno, MPI_ERR_OTHER, "**sock_create", "**sock_create %s %d", MPIU_Strerror(errno), errno);
 
         plfd->fd = sc->fd;
 	MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "sc->fd=%d, plfd->events=%d, plfd->revents=%d, vc=%p, sc=%p", sc->fd, plfd->events, plfd->revents, vc, sc));
         mpi_errno = MPID_nem_tcp_set_sockopts(sc->fd);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
         MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "connecting to 0x%08X:%d", sock_addr->sin_addr.s_addr, sock_addr->sin_port));
         rc = connect(sc->fd, (SA*)sock_addr, sizeof(*sock_addr));
         /* connect should not be called with CHECK_EINTR macro */
-        MPIU_ERR_CHKANDJUMP2(rc < 0 && errno != EINPROGRESS, mpi_errno, MPI_ERR_OTHER, "**sock_connect", "**sock_connect %d %s", errno, MPIU_Strerror(errno));
+        MPIR_ERR_CHKANDJUMP2(rc < 0 && errno != EINPROGRESS, mpi_errno, MPI_ERR_OTHER, "**sock_connect", "**sock_connect %d %s", errno, MPIU_Strerror(errno));
         
         if (rc == 0) {
             CHANGE_STATE(sc, CONN_STATE_TC_C_CNTD);
@@ -926,7 +926,7 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
 #undef FUNCNAME
 #define FUNCNAME cleanup_and_free_sc_plfd
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int cleanup_and_free_sc_plfd(sockconn_t *const sc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -981,7 +981,7 @@ static int cleanup_and_free_sc_plfd(sockconn_t *const sc)
 #undef FUNCNAME
 #define FUNCNAME close_cleanup_and_free_sc_plfd
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int close_cleanup_and_free_sc_plfd(sockconn_t *const sc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -998,10 +998,10 @@ int close_cleanup_and_free_sc_plfd(sockconn_t *const sc)
 
     CHECK_EINTR(rc, close(sc->fd));
     if (rc == -1 && errno != EAGAIN && errno != EBADF)
-        MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**close", "**close %s", MPIU_Strerror(errno));
+        MPIR_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**close", "**close %s", MPIU_Strerror(errno));
 
     mpi_errno2 = cleanup_and_free_sc_plfd(sc);
-    if (mpi_errno2) MPIU_ERR_ADD(mpi_errno, mpi_errno2);
+    if (mpi_errno2) MPIR_ERR_ADD(mpi_errno, mpi_errno2);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_CLOSE_CLEANUP_AND_FREE_SC_PLFD);
@@ -1019,7 +1019,7 @@ int close_cleanup_and_free_sc_plfd(sockconn_t *const sc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_cleanup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_cleanup (struct MPIDI_VC *const vc)
 {
     int mpi_errno = MPI_SUCCESS, i;
@@ -1030,7 +1030,7 @@ int MPID_nem_tcp_cleanup (struct MPIDI_VC *const vc)
 
     if (vc_tcp->sc != NULL) {
         mpi_errno = close_cleanup_and_free_sc_plfd(vc_tcp->sc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     i = 0;
@@ -1040,7 +1040,7 @@ int MPID_nem_tcp_cleanup (struct MPIDI_VC *const vc)
                information to resolve the head-to-head situation.  If we don't
                clean him up he'll end up accessing the about-to-be-freed vc. */
             mpi_errno = close_cleanup_and_free_sc_plfd(&g_sc_tbl[i]);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPIU_Assert(g_sc_tbl[i].vc == NULL);
         }
         ++i;
@@ -1066,7 +1066,7 @@ int MPID_nem_tcp_cleanup (struct MPIDI_VC *const vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_ckpt_cleanup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_ckpt_cleanup(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1088,7 +1088,7 @@ int MPID_nem_tcp_ckpt_cleanup(void)
             
             /* cleanup vc */
             mpi_errno = cleanup_and_free_sc_plfd(vc_tcp->sc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -1104,7 +1104,7 @@ int MPID_nem_tcp_ckpt_cleanup(void)
 #undef FUNCNAME
 #define FUNCNAME state_tc_c_cnting_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int state_tc_c_cnting_handler(struct pollfd *const plfd, sockconn_t *const sc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1142,7 +1142,7 @@ static int state_tc_c_cnting_handler(struct pollfd *const plfd, sockconn_t *cons
 #undef FUNCNAME
 #define FUNCNAME state_tc_c_cntd_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int state_tc_c_cntd_handler(struct pollfd *const plfd, sockconn_t *const sc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1171,7 +1171,7 @@ static int state_tc_c_cntd_handler(struct pollfd *const plfd, sockconn_t *const
         }
         else { /* temp VC */
             mpi_errno = send_tmpvc_info(sc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             
             CHANGE_STATE(sc, CONN_STATE_TC_C_TMPVCSENT);
         }
@@ -1191,7 +1191,7 @@ static int state_tc_c_cntd_handler(struct pollfd *const plfd, sockconn_t *const
 #undef FUNCNAME
 #define FUNCNAME state_c_ranksent_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int state_c_ranksent_handler(struct pollfd *const plfd, sockconn_t *const sc)
 {
     MPIDI_VC_t *const sc_vc = sc->vc;
@@ -1204,7 +1204,7 @@ static int state_c_ranksent_handler(struct pollfd *const plfd, sockconn_t *const
 
     if (IS_READABLE(plfd)) {
         mpi_errno = recv_cmd_pkt(sc->fd, &pkt_type);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         
         MPIU_Assert(pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_ID_ACK ||
                     pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_ID_NAK ||
@@ -1226,7 +1226,7 @@ static int state_c_ranksent_handler(struct pollfd *const plfd, sockconn_t *const
         case MPIDI_NEM_TCP_SOCKSM_PKT_CLOSED:
             MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "received CLOSED, closing sc");
             mpi_errno = MPIDI_CH3U_Handle_connection(sc_vc, MPIDI_VC_EVENT_TERMINATED);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
             break;
         default:
@@ -1247,7 +1247,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME state_c_tmpvcsent_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int state_c_tmpvcsent_handler(struct pollfd *const plfd, sockconn_t *const sc)
 {
     MPIDI_VC_t *const sc_vc = sc->vc;
@@ -1265,10 +1265,10 @@ static int state_c_tmpvcsent_handler(struct pollfd *const plfd, sockconn_t *cons
             MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "error sending cmd pkt, closing sc");
             mpi_errno2 = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
             if (mpi_errno2) {
-                MPIU_ERR_SET(mpi_errno2, MPI_ERR_OTHER, "**tcp_cleanup_fail");
-                if (mpi_errno2) MPIU_ERR_ADD(mpi_errno, mpi_errno2);
+                MPIR_ERR_SET(mpi_errno2, MPI_ERR_OTHER, "**tcp_cleanup_fail");
+                if (mpi_errno2) MPIR_ERR_ADD(mpi_errno, mpi_errno2);
             }
-            MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**tmpvc_connect_fail");
+            MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**tmpvc_connect_fail");
             /* no head-to-head issues to deal with, if we failed to recv the
                packet then there really was a problem */
         }
@@ -1298,7 +1298,7 @@ static int state_c_tmpvcsent_handler(struct pollfd *const plfd, sockconn_t *cons
 #undef FUNCNAME
 #define FUNCNAME state_l_cntd_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int state_l_cntd_handler(struct pollfd *const plfd, sockconn_t *const sc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1320,7 +1320,7 @@ static int state_l_cntd_handler(struct pollfd *const plfd, sockconn_t *const sc)
 
     if (IS_READABLE(plfd)) {
         mpi_errno = recv_id_or_tmpvc_info(sc, &got_sc_eof);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (got_sc_eof) {
             MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "got eof, closing sc");
@@ -1357,7 +1357,7 @@ static int state_l_cntd_handler(struct pollfd *const plfd, sockconn_t *const sc)
 #undef FUNCNAME
 #define FUNCNAME do_i_win
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int do_i_win(sockconn_t *rmt_sc)
 {
     int win = FALSE;
@@ -1388,7 +1388,7 @@ static int do_i_win(sockconn_t *rmt_sc)
 #undef FUNCNAME
 #define FUNCNAME state_l_rankrcvd_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int state_l_rankrcvd_handler(struct pollfd *const plfd, sockconn_t *const sc)
 {
     MPIDI_VC_t *const sc_vc = sc->vc;
@@ -1409,7 +1409,7 @@ static int state_l_rankrcvd_handler(struct pollfd *const plfd, sockconn_t *const
 
         if (sc_vc->state == MPIDI_VC_STATE_INACTIVE_CLOSED) {
             mpi_errno = send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_SOCKSM_PKT_CLOSED);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         }
         
@@ -1422,7 +1422,7 @@ static int state_l_rankrcvd_handler(struct pollfd *const plfd, sockconn_t *const
     
         if (snd_nak) {
             mpi_errno = send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_SOCKSM_PKT_ID_NAK);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "lost head-to-head, closing sc");
             mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         } else {
@@ -1436,7 +1436,7 @@ static int state_l_rankrcvd_handler(struct pollfd *const plfd, sockconn_t *const
             if (sc_vc_tcp->sc_ref_count > 1) goto fn_exit;
 
             mpi_errno = send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_SOCKSM_PKT_ID_ACK);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             
             CHANGE_STATE(sc, CONN_STATE_TS_COMMRDY);
             ASSIGN_SC_TO_VC(sc_vc_tcp, sc);
@@ -1459,7 +1459,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME state_l_tmpvcrcvd_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int state_l_tmpvcrcvd_handler(struct pollfd *const plfd, sockconn_t *const sc)
 {
     MPIDI_VC_t *const sc_vc = sc->vc;
@@ -1479,7 +1479,7 @@ static int state_l_tmpvcrcvd_handler(struct pollfd *const plfd, sockconn_t *cons
     /* we don't want to perform any h2h resolution for temp vcs */
     if (IS_WRITEABLE(plfd)) {
         mpi_errno = send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_SOCKSM_PKT_TMPVC_ACK);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         CHANGE_STATE(sc, CONN_STATE_TS_COMMRDY);
         ASSIGN_SC_TO_VC(sc_vc_tcp, sc);
@@ -1497,8 +1497,8 @@ fn_exit:
         MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
         mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         if (cleanup_errno) {
-            MPIU_ERR_SET(cleanup_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
-            MPIU_ERR_ADD(mpi_errno, cleanup_errno);
+            MPIR_ERR_SET(cleanup_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
+            MPIR_ERR_ADD(mpi_errno, cleanup_errno);
         }
         goto fn_exit;
     }
@@ -1507,7 +1507,7 @@ fn_exit:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_recv_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
 {
     /* as a result of handling a message, the sc table might get
@@ -1556,19 +1556,19 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
                 else
                 {
                     MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "ERROR: sock (fd=%d) is closed: bytes_recvd == 0", sc->fd );
-                    MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
+                    MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
                 }
             }
             else
             {
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
+                MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
             }
         }
     
         MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "New recv " MPIDI_MSG_SZ_FMT " (fd=%d, vc=%p, sc=%p)", bytes_recvd, sc_fd, sc_vc, sc));
 
         mpi_errno = MPID_nem_handle_pkt(sc_vc, recv_buf, bytes_recvd);
-        if (mpi_errno) MPIU_ERR_POP_LABEL(mpi_errno, fn_noncomm_fail);
+        if (mpi_errno) MPIR_ERR_POP_LABEL(mpi_errno, fn_noncomm_fail);
     }
     else
     {
@@ -1588,9 +1588,9 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
                 goto fn_exit;
             
             if (bytes_recvd == 0) {
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
             } else {
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
+                MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
             }
         }
 
@@ -1621,7 +1621,7 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
             MPIU_Assert(MPIDI_Request_get_type(rreq) != MPIDI_REQUEST_TYPE_GET_RESP);
             mpi_errno = MPID_Request_complete(rreq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
             MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "...complete");
             sc_vc_ch->recv_active = NULL;
@@ -1631,7 +1631,7 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
             int complete = 0;
                 
             mpi_errno = reqFn(sc_vc, rreq, &complete);
-            if (mpi_errno) MPIU_ERR_POP_LABEL(mpi_errno, fn_noncomm_fail);
+            if (mpi_errno) MPIR_ERR_POP_LABEL(mpi_errno, fn_noncomm_fail);
 
             if (complete)
             {
@@ -1651,10 +1651,10 @@ fn_exit:
 fn_fail: /* comm related failures jump here */
     {
 
-        MPIU_ERR_SET1(mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", sc_vc->pg_rank);
+        MPIR_ERR_SET1(mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", sc_vc->pg_rank);
         mpi_errno = MPID_nem_tcp_cleanup_on_error(sc_vc, mpi_errno);
         if (mpi_errno) {
-            MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
+            MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
         }
     }
 fn_noncomm_fail: /* NON-comm related failures jump here */
@@ -1665,7 +1665,7 @@ fn_noncomm_fail: /* NON-comm related failures jump here */
 #undef FUNCNAME
 #define FUNCNAME state_commrdy_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int state_commrdy_handler(struct pollfd *const plfd, sockconn_t *const sc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1682,17 +1682,17 @@ static int state_commrdy_handler(struct pollfd *const plfd, sockconn_t *const sc
     if (IS_READABLE(plfd))
     {
         mpi_errno = MPID_nem_tcp_recv_handler(sc);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     }
     if (IS_WRITEABLE(plfd) && !MPIDI_CH3I_Sendq_empty(sc_vc_tcp->send_queue))
     {
         mpi_errno = MPID_nem_tcp_send_queued(sc_vc, &sc_vc_tcp->send_queue);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
         /* check to see if this VC is waiting for outstanding sends to
            finish in order to terminate */
         if (sc_vc->state == MPIDI_VC_STATE_CLOSED && MPIDI_CH3I_Sendq_empty(sc_vc_tcp->send_queue)) {
             mpi_errno = MPID_nem_tcp_vc_terminated(sc_vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
  fn_exit:
@@ -1706,7 +1706,7 @@ static int state_commrdy_handler(struct pollfd *const plfd, sockconn_t *const sc
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_sm_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_sm_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1753,7 +1753,7 @@ int MPID_nem_tcp_sm_init(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_sm_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_sm_finalize(void)
 {
     freenode_t *node;
@@ -1781,7 +1781,7 @@ Evaluate the need for it by testing and then do it, if needed.
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_connpoll
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_connpoll(int in_blocking_poll)
 {
     int mpi_errno = MPI_SUCCESS, n, i;
@@ -1807,7 +1807,7 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
     num_skipped_polls = 0;
 
     CHECK_EINTR(n, poll(MPID_nem_tcp_plfd_tbl, num_polled, 0));
-    MPIU_ERR_CHKANDJUMP1(n == -1, mpi_errno, MPI_ERR_OTHER, "**poll", "**poll %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(n == -1, mpi_errno, MPI_ERR_OTHER, "**poll", "**poll %s", MPIU_Strerror(errno));
     /* MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "some sc fd poll event")); */
     for(i = 0; i < num_polled; i++)
     {
@@ -1832,19 +1832,19 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
                 
                 MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "error polling fd, closing sc");
                 if (it_sc->vc) {
-                    MPIU_ERR_SET2(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d %s", it_sc->vc->pg_rank, err_str);
+                    MPIR_ERR_SET2(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d %s", it_sc->vc->pg_rank, err_str);
                     mpi_errno = MPID_nem_tcp_cleanup_on_error(it_sc->vc, req_errno);
-                    MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
+                    MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
                 } else {
-                    MPIU_ERR_SET2(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail_conn", "**comm_fail_conn %s %s", CONN_STATE_STR[it_sc->state.cstate], err_str);
+                    MPIR_ERR_SET2(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail_conn", "**comm_fail_conn %s %s", CONN_STATE_STR[it_sc->state.cstate], err_str);
                     mpi_errno = close_cleanup_and_free_sc_plfd(it_sc);
-                    MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
+                    MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
                 }
                 continue;
             }
             
             mpi_errno = it_sc->handler(it_plfd, it_sc);
-            if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP (mpi_errno);
             /* note that g_sc_tbl might have been expanded while
                inside handler, so the it_plfd and it_sc pointers may
                be invalid at this point. */
@@ -1887,7 +1887,7 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
 #undef FUNCNAME
 #define FUNCNAME state_listening_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_state_listening_handler(struct pollfd *const unused_1, sockconn_t *const unused_2)
         /*  listener fd poll struct and sockconn structure */
 {
@@ -1911,7 +1911,7 @@ int MPID_nem_tcp_state_listening_handler(struct pollfd *const unused_1, sockconn
             else if (errno == EWOULDBLOCK || errno == EAGAIN)
                 break; /*  no connection in the listen queue. get out of here.(N1) */
 
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**sock_accept", "**sock_accept %s", MPIU_Strerror(errno));
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**sock_accept", "**sock_accept %s", MPIU_Strerror(errno));
         }
         else {
             int idx = -1;
@@ -1920,7 +1920,7 @@ int MPID_nem_tcp_state_listening_handler(struct pollfd *const unused_1, sockconn
 
             MPID_nem_tcp_set_sockopts(connfd); /* (N2) */
             mpi_errno = find_free_entry(&idx);
-            if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP (mpi_errno);
+            if (mpi_errno != MPI_SUCCESS) MPIR_ERR_POP (mpi_errno);
             sc = &g_sc_tbl[idx];
             plfd = &MPID_nem_tcp_plfd_tbl[idx];
             
@@ -1949,7 +1949,7 @@ int MPID_nem_tcp_state_listening_handler(struct pollfd *const unused_1, sockconn
 #undef FUNCNAME
 #define FUNCNAME error_closed
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int error_closed(struct MPIDI_VC *const vc, int req_errno)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1961,10 +1961,10 @@ static int error_closed(struct MPIDI_VC *const vc, int req_errno)
     vc_tcp->state = MPID_NEM_TCP_VC_STATE_ERROR;
 
     mpi_errno = MPIDI_CH3U_Handle_connection(vc, MPIDI_VC_EVENT_TERMINATED);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_nem_tcp_error_out_send_queue(vc, req_errno);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_ERROR_CLOSED);
@@ -1979,7 +1979,7 @@ static int error_closed(struct MPIDI_VC *const vc, int req_errno)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_cleanup_on_error
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_cleanup_on_error(MPIDI_VC_t *const vc, int req_errno)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1992,7 +1992,7 @@ int MPID_nem_tcp_cleanup_on_error(MPIDI_VC_t *const vc, int req_errno)
     /* not jumping on error, keep going */
     
     mpi_errno2 = error_closed(vc, req_errno);
-    if (mpi_errno2) MPIU_ERR_ADD(mpi_errno, mpi_errno2);
+    if (mpi_errno2) MPIR_ERR_ADD(mpi_errno, mpi_errno2);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_CLEANUP_ON_ERROR);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_ckpt.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_ckpt.c
index cad5758..d398bd2 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_ckpt.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_ckpt.c
@@ -7,14 +7,14 @@
 #define SOCKSM_H_EXTERNS_ 1
 #include "tcp_impl.h"
 
-MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
+MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 #ifdef ENABLE_CHECKPOINTING
 
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_ckpt_pause_send_vc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_ckpt_pause_send_vc(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -36,7 +36,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_ckpt_unpause_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_pkt_unpause_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t *buflen, MPID_Request **rreqp)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -71,7 +71,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_ckpt_continue_vc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_ckpt_continue_vc(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -85,9 +85,9 @@ int MPID_nem_tcp_ckpt_continue_vc(MPIDI_VC_t *vc)
     unpause_pkt->subtype = MPIDI_NEM_TCP_PKT_UNPAUSE;
 
     mpi_errno = MPID_nem_tcp_iStartContigMsg_paused(vc, &upkt, sizeof(MPIDI_nem_tcp_pkt_unpause_t), NULL, 0, &unpause_req);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     if (unpause_req) {
-        if (unpause_req->status.MPI_ERROR) MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
+        if (unpause_req->status.MPI_ERROR) MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
         MPID_Request_release(unpause_req);
         if (mpi_errno) goto fn_fail;
     }
@@ -105,7 +105,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_ckpt_restart_vc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_ckpt_restart_vc(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -120,13 +120,13 @@ int MPID_nem_tcp_ckpt_restart_vc(MPIDI_VC_t *vc)
     pkt->subtype = MPIDI_NEM_TCP_PKT_UNPAUSE;
 
     mpi_errno = MPID_nem_tcp_iStartContigMsg_paused(vc, pkt, sizeof(pkt), NULL, 0, &sreq);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (sreq != NULL) {
         if (sreq->status.MPI_ERROR != MPI_SUCCESS) {
             mpi_errno = sreq->status.MPI_ERROR;
             MPID_Request_release(sreq);
-            MPIU_ERR_INTERNALANDJUMP(mpi_errno, "Failed to send checkpoint unpause pkt.");
+            MPIR_ERR_INTERNALANDJUMP(mpi_errno, "Failed to send checkpoint unpause pkt.");
         }
         MPID_Request_release(sreq);
     }
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_finalize.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_finalize.c
index 0b41683..a612c48 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_finalize.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_finalize.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -19,14 +19,14 @@ int MPID_nem_tcp_finalize(void)
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_FINALIZE);
 
     mpi_errno = MPID_nem_tcp_send_finalize();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_nem_tcp_sm_finalize();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
      
     if (MPID_nem_tcp_g_lstn_sc.fd)
     {
         CHECK_EINTR (ret, close(MPID_nem_tcp_g_lstn_sc.fd));
-        MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**closesocket", "**closesocket %s %d", errno, MPIU_Strerror (errno));
+        MPIR_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**closesocket", "**closesocket %s %d", errno, MPIU_Strerror (errno));
     }
         
  fn_exit:
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_getip.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_getip.c
index 9354ae9..71b2b49 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_getip.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_getip.c
@@ -57,7 +57,7 @@ static int dbg_ifname = 0;
 #undef FUNCNAME
 #define FUNCNAME MPIDI_GetIPInterface
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -78,7 +78,7 @@ int MPIDI_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found )
 
     fd = socket(AF_INET, SOCK_DGRAM, 0);
     if (fd < 0) {
-	MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sock_create");
+	MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sock_create");
     }
 
     /* Use MSB localhost if necessary */
@@ -104,7 +104,7 @@ int MPIDI_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found )
 
 	buf_ptr = (char *) MPIU_Malloc(buf_len);
 	if (buf_ptr == NULL) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d", buf_len);
+	    MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d", buf_len);
 	}
 	
 	ifconf.ifc_buf = buf_ptr;
@@ -113,7 +113,7 @@ int MPIDI_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found )
 	rc = ioctl(fd, SIOCGIFCONF, &ifconf);
 	if (rc < 0) {
 	    if (errno != EINVAL || buf_len_prev != 0) {
-		MPIU_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_OTHER, "**ioctl", "**ioctl %d %s", errno, MPIU_Strerror(errno));
+		MPIR_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_OTHER, "**ioctl", "**ioctl %d %s", errno, MPIU_Strerror(errno));
 	    }
 	}
         else {
@@ -243,7 +243,7 @@ int MPIDI_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Get_IP_for_iface
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_Get_IP_for_iface(const char *ifname, MPIDU_Sock_ifaddr_t *ifaddr, int *found)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -254,11 +254,11 @@ int MPIDI_Get_IP_for_iface(const char *ifname, MPIDU_Sock_ifaddr_t *ifaddr, int
         *found = FALSE;
 
     fd = socket(AF_INET, SOCK_DGRAM, 0);
-    MPIU_ERR_CHKANDJUMP2(fd < 0, mpi_errno, MPI_ERR_OTHER, "**sock_create", "**sock_create %s %d", MPIU_Strerror(errno), errno);
+    MPIR_ERR_CHKANDJUMP2(fd < 0, mpi_errno, MPI_ERR_OTHER, "**sock_create", "**sock_create %s %d", MPIU_Strerror(errno), errno);
     ifr.ifr_addr.sa_family = AF_INET; /* just IPv4 for now */
     MPIU_Strncpy(ifr.ifr_name, ifname, IFNAMSIZ-1);
     ret = ioctl(fd, SIOCGIFADDR, &ifr);
-    MPIU_ERR_CHKANDJUMP2(ret < 0, mpi_errno, MPI_ERR_OTHER, "**ioctl", "**ioctl %d %s", errno, MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP2(ret < 0, mpi_errno, MPI_ERR_OTHER, "**ioctl", "**ioctl %d %s", errno, MPIU_Strerror(errno));
 
     *found = TRUE;
     MPIU_Memcpy(ifaddr->ifaddr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr, 4);
@@ -269,7 +269,7 @@ fn_exit:
     if (fd != -1) {
         ret = close(fd);
         if (ret < 0) {
-            MPIU_ERR_SET2(mpi_errno, MPI_ERR_OTHER, "**sock_close", "**sock_close %s %d", MPIU_Strerror(errno), errno);
+            MPIR_ERR_SET2(mpi_errno, MPI_ERR_OTHER, "**sock_close", "**sock_close %s %d", MPIU_Strerror(errno), errno);
         }
     }
     return mpi_errno;
@@ -282,7 +282,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Get_IP_for_iface
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_Get_IP_for_iface(const char *ifname, MPIDU_Sock_ifaddr_t *ifaddr, int *found)
 {
     if (found != NULL)
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
index 9cb8115..73805fb 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
@@ -116,7 +116,7 @@ static MPIDI_CH3_PktHandler_Fcn *pkt_handlers[MPIDI_NEM_TCP_PKT_NUM_TYPES ? MPID
 #undef FUNCNAME
 #define FUNCNAME set_up_listener
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int set_up_listener(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -126,17 +126,17 @@ static int set_up_listener(void)
     MPIDI_FUNC_ENTER(MPID_STATE_SET_UP_LISTENER);
 
     MPID_nem_tcp_g_lstn_plfd.fd = MPID_nem_tcp_g_lstn_sc.fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-    MPIU_ERR_CHKANDJUMP2(MPID_nem_tcp_g_lstn_sc.fd == -1, mpi_errno, MPI_ERR_OTHER, "**sock_create", "**sock_create %s %d", MPIU_Strerror(errno), errno);
+    MPIR_ERR_CHKANDJUMP2(MPID_nem_tcp_g_lstn_sc.fd == -1, mpi_errno, MPI_ERR_OTHER, "**sock_create", "**sock_create %s %d", MPIU_Strerror(errno), errno);
 
     mpi_errno = MPID_nem_tcp_set_sockopts(MPID_nem_tcp_g_lstn_sc.fd);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPID_nem_tcp_g_lstn_plfd.events = POLLIN;
     mpi_errno = MPID_nem_tcp_bind(MPID_nem_tcp_g_lstn_sc.fd);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     ret = listen(MPID_nem_tcp_g_lstn_sc.fd, SOMAXCONN);
-    MPIU_ERR_CHKANDJUMP2(ret == -1, mpi_errno, MPI_ERR_OTHER, "**listen", "**listen %s %d", MPIU_Strerror(errno), errno);  
+    MPIR_ERR_CHKANDJUMP2(ret == -1, mpi_errno, MPI_ERR_OTHER, "**listen", "**listen %s %d", MPIU_Strerror(errno), errno);  
     MPID_nem_tcp_g_lstn_sc.state.lstate = LISTEN_STATE_LISTENING;
     MPID_nem_tcp_g_lstn_sc.handler = MPID_nem_tcp_state_listening_handler;
 
@@ -151,7 +151,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_init (MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -166,16 +166,16 @@ int MPID_nem_tcp_init (MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_
 
     /* set up listener socket */
     mpi_errno = set_up_listener();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     /* create business card */
     mpi_errno = MPID_nem_tcp_get_business_card(pg_rank, bc_val_p, val_max_sz_p);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPID_nem_tcp_sm_init();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_nem_tcp_send_init();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 #ifdef HAVE_SIGNAL
     {
@@ -187,11 +187,11 @@ int MPID_nem_tcp_init (MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_
         void *ret;
 
         ret = signal(SIGPIPE, SIG_IGN);
-        MPIU_ERR_CHKANDJUMP1(ret == SIG_ERR, mpi_errno, MPI_ERR_OTHER, "**signal", "**signal %s", MPIU_Strerror(errno));
+        MPIR_ERR_CHKANDJUMP1(ret == SIG_ERR, mpi_errno, MPI_ERR_OTHER, "**signal", "**signal %s", MPIU_Strerror(errno));
         if (ret != SIG_DFL && ret != SIG_IGN) {
             /* The app has set its own signal handler.  Replace the previous handler. */
             ret = signal(SIGPIPE, ret);
-            MPIU_ERR_CHKANDJUMP1(ret == SIG_ERR, mpi_errno, MPI_ERR_OTHER, "**signal", "**signal %s", MPIU_Strerror(errno));
+            MPIR_ERR_CHKANDJUMP1(ret == SIG_ERR, mpi_errno, MPI_ERR_OTHER, "**signal", "**signal %s", MPIU_Strerror(errno));
         }
     }
 #endif
@@ -210,7 +210,7 @@ int MPID_nem_tcp_init (MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_
 #undef FUNCNAME
 #define FUNCNAME ckpt_restart
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int ckpt_restart(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -225,24 +225,24 @@ static int ckpt_restart(void)
     /* First, clean up.  We didn't shut anything down before the
        checkpoint, so we need to go close and free any resources */
     mpi_errno = MPID_nem_tcp_ckpt_cleanup();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_nem_tcp_send_finalize();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_nem_tcp_sm_finalize();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Initialize the new business card */
     mpi_errno = MPIDI_CH3I_BCInit(&bc_val, &val_max_sz);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     publish_bc_orig = bc_val;
     
     /* Now we can restart */
     mpi_errno = MPID_nem_tcp_init(MPIDI_Process.my_pg, MPIDI_Process.my_pg_rank, &bc_val, &val_max_sz);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     /* publish business card */
     mpi_errno = MPIDI_PG_SetConnInfo(MPIDI_Process.my_pg_rank, (const char *)publish_bc_orig);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Free(publish_bc_orig);
 
     for (i = 0; i < MPIDI_Process.my_pg->size; ++i) {
@@ -254,7 +254,7 @@ static int ckpt_restart(void)
         vc_ch = &vc->ch;
         if (!vc_ch->is_local) {
             mpi_errno = vc_ch->ckpt_restart_vc(vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
     
@@ -299,7 +299,7 @@ static int GetSockInterfaceAddr(int myRank, char *ifname, int maxIfname,
     MPIU_Assert(maxIfname);
     ifname[0] = '\0';
 
-    MPIU_ERR_CHKANDJUMP(MPIR_CVAR_CH3_INTERFACE_HOSTNAME && MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE, mpi_errno, MPI_ERR_OTHER, "**ifname_and_hostname");
+    MPIR_ERR_CHKANDJUMP(MPIR_CVAR_CH3_INTERFACE_HOSTNAME && MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE, mpi_errno, MPI_ERR_OTHER, "**ifname_and_hostname");
     
     /* Set "not found" for ifaddr */
     ifaddr->len = 0;
@@ -308,7 +308,7 @@ static int GetSockInterfaceAddr(int myRank, char *ifname, int maxIfname,
     if (MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE) {
 	int len;
         mpi_errno = MPIDI_Get_IP_for_iface(MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE, ifaddr, &ifaddrFound);
-        MPIU_ERR_CHKANDJUMP1(mpi_errno || !ifaddrFound, mpi_errno, MPI_ERR_OTHER, "**iface_notfound", "**iface_notfound %s", MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE);
+        MPIR_ERR_CHKANDJUMP1(mpi_errno || !ifaddrFound, mpi_errno, MPI_ERR_OTHER, "**iface_notfound", "**iface_notfound %s", MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE);
         
         MPIU_DBG_MSG_FMT(CH3_CONNECT, VERBOSE, (MPIU_DBG_FDEST,
                                                 "ifaddrFound=TRUE ifaddr->type=%d ifaddr->len=%d ifaddr->ifaddr[0-3]=%d.%d.%d.%d",
@@ -317,7 +317,7 @@ static int GetSockInterfaceAddr(int myRank, char *ifname, int maxIfname,
 
         /* In this case, ifname is only used for debugging purposes */
 	mpi_errno = MPID_Get_processor_name(ifname, maxIfname, &len );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
@@ -351,7 +351,7 @@ static int GetSockInterfaceAddr(int myRank, char *ifname, int maxIfname,
 
 	/* User did not specify a hostname.  Look it up. */
 	mpi_errno = MPID_Get_processor_name(ifname, maxIfname, &len );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 	ifname_string = ifname;
 
@@ -360,7 +360,7 @@ static int GetSockInterfaceAddr(int myRank, char *ifname, int maxIfname,
 	   this platform.  Otherwise, we'll drop into the next step that uses 
 	   the ifname */
 	mpi_errno = MPIDI_GetIPInterface( ifaddr, &ifaddrFound );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
 	/* Copy this name into the output name */
@@ -376,7 +376,7 @@ static int GetSockInterfaceAddr(int myRank, char *ifname, int maxIfname,
             if (info || h_errno != TRY_AGAIN)
                 break;
         }
-        MPIU_ERR_CHKANDJUMP2(!info || !info->h_addr_list, mpi_errno, MPI_ERR_OTHER, "**gethostbyname", "**gethostbyname %s %d", ifname_string, h_errno);
+        MPIR_ERR_CHKANDJUMP2(!info || !info->h_addr_list, mpi_errno, MPI_ERR_OTHER, "**gethostbyname", "**gethostbyname %s %d", ifname_string, h_errno);
         
         /* Use the primary address */
         ifaddr->len  = info->h_length;
@@ -386,7 +386,7 @@ static int GetSockInterfaceAddr(int myRank, char *ifname, int maxIfname,
                no address */
             ifaddr->len = 0;
             ifaddr->type = -1;
-            MPIU_ERR_INTERNAL(mpi_errno, "Address too long to fit in field");
+            MPIR_ERR_INTERNAL(mpi_errno, "Address too long to fit in field");
         } else {
             MPIU_Memcpy( ifaddr->ifaddr, info->h_addr_list[0], ifaddr->len );
 	}
@@ -402,7 +402,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_get_business_card
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -417,23 +417,23 @@ int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_s
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_GET_BUSINESS_CARD);
     
     mpi_errno = GetSockInterfaceAddr(my_rank, ifname, sizeof(ifname), &ifaddr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     
     str_errno = MPIU_Str_add_string_arg(bc_val_p, val_max_sz_p, MPIDI_CH3I_HOST_DESCRIPTION_KEY, ifname);
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
 
     len = sizeof(sock_id);
     ret = getsockname (MPID_nem_tcp_g_lstn_sc.fd, (struct sockaddr *)&sock_id, &len);
-    MPIU_ERR_CHKANDJUMP1 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**getsockname", "**getsockname %s", MPIU_Strerror (errno));
+    MPIR_ERR_CHKANDJUMP1 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**getsockname", "**getsockname %s", MPIU_Strerror (errno));
 
     str_errno = MPIU_Str_add_int_arg (bc_val_p, val_max_sz_p, MPIDI_CH3I_PORT_KEY, ntohs(sock_id.sin_port));
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
     
     if (ifaddr.len > 0 && ifaddr.type == AF_INET)
@@ -444,8 +444,8 @@ int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_s
         MPIU_DBG_MSG_S(CH3_CONNECT,VERBOSE,"ifname = %s",ifname );
         str_errno = MPIU_Str_add_string_arg(bc_val_p, val_max_sz_p, MPIDI_CH3I_IFNAME_KEY, ifname);
         if (str_errno) {
-            MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+            MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
         }
     }
     
@@ -463,7 +463,7 @@ int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_s
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_connect_to_root
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -477,12 +477,12 @@ int MPID_nem_tcp_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc)
 
     mpi_errno = MPID_nem_tcp_get_addr_port_from_bc(business_card, &addr, &vc_tcp->sock_id.sin_port);
     vc_tcp->sock_id.sin_addr.s_addr = addr.s_addr;
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIDI_GetTagFromPort(business_card, &new_vc->port_name_tag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_nem_tcp_connect(new_vc);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_CONNECT_TO_ROOT);
@@ -495,7 +495,7 @@ int MPID_nem_tcp_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_vc_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_vc_init (MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -544,7 +544,7 @@ int MPID_nem_tcp_vc_init (MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_vc_destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_vc_destroy(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -563,7 +563,7 @@ int MPID_nem_tcp_vc_destroy(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_get_addr_port_from_bc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_get_addr_port_from_bc(const char *business_card, struct in_addr *addr, in_port_t *port)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -578,7 +578,7 @@ int MPID_nem_tcp_get_addr_port_from_bc(const char *business_card, struct in_addr
     /*     fprintf(stdout, FCNAME " Enter\n"); fflush(stdout); */
     /* desc_str is only used for debugging
     ret = MPIU_Str_get_string_arg (business_card, MPIDI_CH3I_HOST_DESCRIPTION_KEY, desc_str, sizeof(desc_str));
-    MPIU_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missinghost");
+    MPIR_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missinghost");
     */
 
     /* sizeof(in_port_t) != sizeof(int) on most platforms, so we need to use
@@ -586,16 +586,16 @@ int MPID_nem_tcp_get_addr_port_from_bc(const char *business_card, struct in_addr
     ret = MPIU_Str_get_int_arg (business_card, MPIDI_CH3I_PORT_KEY, &port_int);
     /* MPIU_STR_FAIL is not a valid MPI error code so we store the result in ret
      * instead of mpi_errno. */
-    MPIU_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missingport");
+    MPIR_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missingport");
     MPIU_Assert((port_int >> (8*sizeof(*port))) == 0); /* ensure port_int isn't too large for *port */
     *port = htons((in_port_t)port_int);
 
     ret = MPIU_Str_get_string_arg(business_card, MPIDI_CH3I_IFNAME_KEY, ifname, sizeof(ifname));
-    MPIU_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missingifname");
+    MPIR_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missingifname");
 
     ret = inet_pton (AF_INET, (const char *)ifname, addr);
-    MPIU_ERR_CHKANDJUMP(ret == 0, mpi_errno,MPI_ERR_OTHER,"**ifnameinvalid");
-    MPIU_ERR_CHKANDJUMP(ret < 0, mpi_errno, MPI_ERR_OTHER, "**afinetinvalid");
+    MPIR_ERR_CHKANDJUMP(ret == 0, mpi_errno,MPI_ERR_OTHER,"**ifnameinvalid");
+    MPIR_ERR_CHKANDJUMP(ret < 0, mpi_errno, MPI_ERR_OTHER, "**afinetinvalid");
     
  fn_exit:
 /*     fprintf(stdout, FCNAME " Exit\n"); fflush(stdout); */
@@ -613,7 +613,7 @@ int MPID_nem_tcp_get_addr_port_from_bc(const char *business_card, struct in_addr
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_bind
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_bind (int sockfd)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -624,7 +624,7 @@ int MPID_nem_tcp_bind (int sockfd)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_BIND);
    
-    MPIU_ERR_CHKANDJUMP(MPIR_CVAR_CH3_PORT_RANGE.low < 0 || MPIR_CVAR_CH3_PORT_RANGE.low > MPIR_CVAR_CH3_PORT_RANGE.high, mpi_errno, MPI_ERR_OTHER, "**badportrange");
+    MPIR_ERR_CHKANDJUMP(MPIR_CVAR_CH3_PORT_RANGE.low < 0 || MPIR_CVAR_CH3_PORT_RANGE.low > MPIR_CVAR_CH3_PORT_RANGE.high, mpi_errno, MPI_ERR_OTHER, "**badportrange");
 
     /* default MPICH_PORT_RANGE is {0,0} so bind will use any available port */
     ret = 0;
@@ -640,10 +640,10 @@ int MPID_nem_tcp_bind (int sockfd)
             break;
         
         /* check for real error */
-        MPIU_ERR_CHKANDJUMP3 (errno != EADDRINUSE && errno != EADDRNOTAVAIL, mpi_errno, MPI_ERR_OTHER, "**sock|poll|bind", "**sock|poll|bind %d %d %s", port, errno, MPIU_Strerror (errno));
+        MPIR_ERR_CHKANDJUMP3 (errno != EADDRINUSE && errno != EADDRNOTAVAIL, mpi_errno, MPI_ERR_OTHER, "**sock|poll|bind", "**sock|poll|bind %d %d %s", port, errno, MPIU_Strerror (errno));
     }
     /* check if an available port was found */
-    MPIU_ERR_CHKANDJUMP3 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**sock|poll|bind", "**sock|poll|bind %d %d %s", port-1, errno, MPIU_Strerror (errno));
+    MPIR_ERR_CHKANDJUMP3 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**sock|poll|bind", "**sock|poll|bind %d %d %s", port-1, errno, MPIU_Strerror (errno));
 
  fn_exit:
 /*     if (ret == 0) */
@@ -660,7 +660,7 @@ int MPID_nem_tcp_bind (int sockfd)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_vc_terminate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_vc_terminate(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -673,11 +673,11 @@ int MPID_nem_tcp_vc_terminate(MPIDI_VC_t *vc)
         /* VC is terminated as a result of a fault.  Complete
            outstanding sends with an error and terminate
            connection immediately. */
-        MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+        MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
         mpi_errno = MPID_nem_tcp_error_out_send_queue(vc, req_errno);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPID_nem_tcp_vc_terminated(vc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     } else {
         MPID_nem_tcp_vc_area *vc_tcp = VC_TCP(vc);
         /* VC is terminated as a result of the close protocol.
@@ -687,7 +687,7 @@ int MPID_nem_tcp_vc_terminate(MPIDI_VC_t *vc)
             /* The sendq is empty, so we can immediately terminate
                the connection. */
             mpi_errno = MPID_nem_tcp_vc_terminated(vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         /* else: just return.  We'll call vc_terminated() from the
            commrdy_handler once the sendq is empty. */
@@ -704,7 +704,7 @@ int MPID_nem_tcp_vc_terminate(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_vc_terminated
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_vc_terminated(MPIDI_VC_t *vc)
 {
     /* This is called when the VC is to be terminated once all queued
@@ -715,10 +715,10 @@ int MPID_nem_tcp_vc_terminated(MPIDI_VC_t *vc)
     MPIDI_FUNC_ENTER(MPID_NEM_TCP_VC_TERMINATED);
 
     mpi_errno = MPID_nem_tcp_cleanup(vc);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     mpi_errno = MPIDI_CH3U_Handle_connection(vc, MPIDI_VC_EVENT_TERMINATED);
-    if(mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if(mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_NEM_TCP_VC_TERMINATED);
@@ -731,7 +731,7 @@ int MPID_nem_tcp_vc_terminated(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_get_ordering
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_get_ordering(int *ordering)
 {
     (*ordering) = 1;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
index 81f0850..2a0e9cc 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
@@ -39,7 +39,7 @@ static struct {MPID_nem_tcp_send_q_element_t *top;} free_buffers = {0};
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_send_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_send_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -66,7 +66,7 @@ int MPID_nem_tcp_send_init(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_send_queued
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send_queue)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -96,10 +96,10 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
         if (offset == 0) {
             int req_errno = MPI_SUCCESS;
 
-            MPIU_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
-            MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+            MPIR_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
+            MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
             mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             goto fn_exit; /* this vc is closed now, just bail out */
         }
         if (offset == -1)
@@ -111,10 +111,10 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
                 break;
             } else {
                 int req_errno = MPI_SUCCESS;
-                MPIU_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
-                MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+                MPIR_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
+                MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
                 mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 goto fn_exit; /* this vc is closed now, just bail out */
             }
         }
@@ -151,7 +151,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
                 MPIU_Assert(MPIDI_Request_get_type(sreq) != MPIDI_REQUEST_TYPE_GET_RESP);
                 mpi_errno = MPID_Request_complete(sreq);
                 if (mpi_errno != MPI_SUCCESS) {
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 }
                 MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
                 MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
@@ -160,7 +160,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
 
             complete = 0;
             mpi_errno = reqFn(vc, sreq, &complete);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             
             if (complete)
             {
@@ -185,7 +185,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_send_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_send_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -204,7 +204,7 @@ int MPID_nem_tcp_send_finalize(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_conn_est
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_conn_est (MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -219,7 +219,7 @@ int MPID_nem_tcp_conn_est (MPIDI_VC_t *vc)
     {
         SET_PLFD(vc_tcp);
         mpi_errno = MPID_nem_tcp_send_queued(vc, &vc_tcp->send_queue);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     }
 
  fn_fail:
@@ -230,7 +230,7 @@ int MPID_nem_tcp_conn_est (MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_iStartContigMsg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data, MPIDI_msg_sz_t data_sz,
                                  MPID_Request **sreq_ptr)
 {
@@ -264,10 +264,10 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
                 if (offset == 0) {
                     int req_errno = MPI_SUCCESS;
 
-                    MPIU_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
-                    MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+                    MPIR_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
+                    MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
                     mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     goto fn_fail;
                 }
                 if (offset == -1)
@@ -276,10 +276,10 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
                         offset = 0;
                     else {
                         int req_errno = MPI_SUCCESS;
-                        MPIU_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
-                        MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+                        MPIR_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
+                        MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
                         mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                         goto fn_fail;
                     }
                 }
@@ -298,7 +298,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
             /* state may be DISCONNECTED or ERROR.  Calling tcp_connect in an ERROR state will return an
                appropriate error code. */
             mpi_errno = MPID_nem_tcp_connect(vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -350,7 +350,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
                 /* there are other sends in the queue before this one: try to send from the queue */
                 MPIDI_CH3I_Sendq_enqueue(&vc_tcp->send_queue, sreq);
                 mpi_errno = MPID_nem_tcp_send_queued(vc, &vc_tcp->send_queue);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         } else {
             MPIDI_CH3I_Sendq_enqueue(&vc_tcp->send_queue, sreq);
@@ -370,7 +370,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_iStartContigMsg_paused
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data, MPIDI_msg_sz_t data_sz,
                                         MPID_Request **sreq_ptr)
 {
@@ -403,10 +403,10 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
             if (offset == 0) {
                 int req_errno = MPI_SUCCESS;
 
-                MPIU_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
-                MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+                MPIR_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
+                MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
                 mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 goto fn_fail;
             }
             if (offset == -1)
@@ -415,11 +415,11 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
                     offset = 0;
                 else {
                     int req_errno = MPI_SUCCESS;
-                    MPIU_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
-                    MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+                    MPIR_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
+                    MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
 
                     mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     goto fn_fail;
                 }
             }
@@ -438,7 +438,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
         /* state may be DISCONNECTED or ERROR.  Calling tcp_connect in an ERROR state will return an
            appropriate error code. */
         mpi_errno = MPID_nem_tcp_connect(vc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* create and enqueue request */
@@ -486,7 +486,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
             /* there are other sends in the queue before this one: try to send from the queue */
             MPIDI_CH3I_Sendq_enqueue(&vc_tcp->send_queue, sreq);
             mpi_errno = MPID_nem_tcp_send_queued(vc, &vc_tcp->send_queue);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     } else {
         MPIDI_CH3I_Sendq_enqueue(&vc_tcp->send_queue, sreq);
@@ -504,7 +504,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_iSendContig
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz,
                              void *data, MPIDI_msg_sz_t data_sz)
 {
@@ -548,10 +548,10 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
                 if (offset == 0) {
                     int req_errno = MPI_SUCCESS;
 
-                    MPIU_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
-                    MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+                    MPIR_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
+                    MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
                     mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     goto fn_fail;
                 }
                 if (offset == -1)
@@ -560,10 +560,10 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
                         offset = 0;
                     else {
                         int req_errno = MPI_SUCCESS;
-                        MPIU_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
-                        MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+                        MPIR_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
+                        MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
                         mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                         goto fn_fail;
                     }
                 }
@@ -580,7 +580,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
                         MPIU_Assert(MPIDI_Request_get_type(sreq) != MPIDI_REQUEST_TYPE_GET_RESP);
                         mpi_errno = MPID_Request_complete(sreq);
                         if (mpi_errno != MPI_SUCCESS) {
-                            MPIU_ERR_POP(mpi_errno);
+                            MPIR_ERR_POP(mpi_errno);
                         }
                         MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
                         goto fn_exit;
@@ -590,7 +590,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
                         int complete = 0;
                         
                         mpi_errno = reqFn(vc, sreq, &complete);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                         
                         if (complete)
                         {
@@ -609,7 +609,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
             /* state may be DISCONNECTED or ERROR.  Calling tcp_connect in an ERROR state will return an
                appropriate error code. */
             mpi_errno = MPID_nem_tcp_connect(vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -676,7 +676,7 @@ enqueue_request:
                 /* there are other sends in the queue before this one: try to send from the queue */
                 MPIDI_CH3I_Sendq_enqueue(&vc_tcp->send_queue, sreq);
                 mpi_errno = MPID_nem_tcp_send_queued(vc, &vc_tcp->send_queue);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         } else {
             MPIDI_CH3I_Sendq_enqueue(&vc_tcp->send_queue, sreq);
@@ -694,7 +694,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_SendNoncontig
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header, MPIDI_msg_sz_t hdr_sz)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -726,7 +726,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
     iov_offset = iov_n;
 
     mpi_errno = MPIDI_CH3U_Request_load_send_iov(sreq, &iov[iov_offset], &iov_n);
-    MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|loadsendiov");
+    MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|loadsendiov");
 
     iov_n += iov_offset;
     offset = 0;
@@ -740,10 +740,10 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
                 if (offset == 0) {
                     int req_errno = MPI_SUCCESS;
 
-                    MPIU_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
-                    MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+                    MPIR_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
+                    MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
                     mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     goto fn_fail;
                 }
                 if (offset == -1)
@@ -752,10 +752,10 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
                         offset = 0;
                     else {
                         int req_errno = MPI_SUCCESS;
-                        MPIU_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
-                        MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+                        MPIR_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
+                        MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
                         mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                         goto fn_fail;
                     }
                 }
@@ -768,7 +768,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
             /* state may be DISCONNECTED or ERROR.  Calling tcp_connect in an ERROR state will return an
                appropriate error code. */
             mpi_errno = MPID_nem_tcp_connect(vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
     
@@ -807,7 +807,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
         {
             mpi_errno = MPID_Request_complete(sreq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
             MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
             goto fn_exit;
@@ -815,7 +815,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
 
         complete = 0;
         mpi_errno = reqFn(vc, sreq, &complete);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             
         if (complete)
         {
@@ -843,7 +843,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
                 /* there are other sends in the queue before this one: try to send from the queue */
                 MPIDI_CH3I_Sendq_enqueue(&vc_tcp->send_queue, sreq);
                 mpi_errno = MPID_nem_tcp_send_queued(vc, &vc_tcp->send_queue);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         } else {
             MPIDI_CH3I_Sendq_enqueue(&vc_tcp->send_queue, sreq);
@@ -861,7 +861,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_error_out_send_queue
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_error_out_send_queue(struct MPIDI_VC *const vc, int req_errno)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -881,7 +881,7 @@ int MPID_nem_tcp_error_out_send_queue(struct MPIDI_VC *const vc, int req_errno)
 
         mpi_errno = MPID_Request_complete(req);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -892,7 +892,7 @@ int MPID_nem_tcp_error_out_send_queue(struct MPIDI_VC *const vc, int req_errno)
 
         mpi_errno = MPID_Request_complete(req);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c
index 0eb9372..947d998 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c
@@ -14,7 +14,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_get_conninfo
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_get_conninfo (struct MPIDI_VC *vc, struct sockaddr_in *addr, char **pg_id, int *pg_rank)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -32,7 +32,7 @@ int MPID_nem_tcp_get_conninfo (struct MPIDI_VC *vc, struct sockaddr_in *addr, ch
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_get_vc_from_conninfo
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_get_vc_from_conninfo (char *pg_id, int pg_rank, struct MPIDI_VC **vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -44,10 +44,10 @@ int MPID_nem_tcp_get_vc_from_conninfo (char *pg_id, int pg_rank, struct MPIDI_VC
     MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "pg_id=%s pg_rank=%d", pg_id, pg_rank));
     
     mpi_errno = MPIDI_PG_Find (pg_id, &pg);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
-    MPIU_ERR_CHKINTERNAL(pg == NULL, mpi_errno, "invalid PG");
-    MPIU_ERR_CHKINTERNAL(pg_rank < 0 || pg_rank > MPIDI_PG_Get_size (pg), mpi_errno, "invalid pg_rank");
+    MPIR_ERR_CHKINTERNAL(pg == NULL, mpi_errno, "invalid PG");
+    MPIR_ERR_CHKINTERNAL(pg_rank < 0 || pg_rank > MPIDI_PG_Get_size (pg), mpi_errno, "invalid pg_rank");
         
     MPIDI_PG_Get_vc_set_active (pg, pg_rank, vc);
     
@@ -61,7 +61,7 @@ int MPID_nem_tcp_get_vc_from_conninfo (char *pg_id, int pg_rank, struct MPIDI_VC
 #undef FUNCNAME
 #define FUNCNAME set_sockopts
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_set_sockopts (int fd)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -75,30 +75,30 @@ int MPID_nem_tcp_set_sockopts (int fd)
     option = 1;
     len = sizeof(int);
     ret = setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &option, len);
-    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
+    MPIR_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
     ret = getsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &option, &len);
-    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
+    MPIR_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
 
     option = 128*1024;
     len = sizeof(int);
     ret = setsockopt (fd, SOL_SOCKET, SO_RCVBUF, &option, len);
-    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
+    MPIR_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
     ret = getsockopt (fd, SOL_SOCKET, SO_RCVBUF, &option, &len);
-    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
+    MPIR_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
     ret = setsockopt (fd, SOL_SOCKET, SO_SNDBUF, &option, len);
-    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
+    MPIR_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
     ret = getsockopt (fd, SOL_SOCKET, SO_SNDBUF, &option, &len);
-    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
+    MPIR_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
     
     flags = fcntl(fd, F_GETFL, 0);
-    MPIU_ERR_CHKANDJUMP2 (flags == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
+    MPIR_ERR_CHKANDJUMP2 (flags == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
     ret = fcntl(fd, F_SETFL, flags | SO_REUSEADDR);
-    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
+    MPIR_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
     
     flags = fcntl(fd, F_GETFL, 0);
-    MPIU_ERR_CHKANDJUMP2 (flags == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);    
+    MPIR_ERR_CHKANDJUMP2 (flags == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);    
     ret = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
-    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);    
+    MPIR_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);    
 
  fn_exit:
 /*     fprintf(stdout, FCNAME " Exit\n"); fflush(stdout); */
@@ -139,7 +139,7 @@ actually done now in this function.
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_check_sock_status
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 MPID_NEM_TCP_SOCK_STATUS_t 
 MPID_nem_tcp_check_sock_status(const struct pollfd *const plfd)
 {
@@ -174,7 +174,7 @@ MPID_nem_tcp_check_sock_status(const struct pollfd *const plfd)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_tcp_is_sock_connected
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_tcp_is_sock_connected(int fd)
 {
     int rc = FALSE;
@@ -205,7 +205,7 @@ int MPID_nem_tcp_is_sock_connected(int fd)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_dbg_print_all_sendq
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPID_nem_tcp_vc_dbg_print_sendq(FILE *stream, MPIDI_VC_t *vc)
 {
     int i;
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_finalize.c b/src/mpid/ch3/channels/nemesis/src/ch3_finalize.c
index eb410bd..641d951 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_finalize.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_finalize.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -18,10 +18,10 @@ int MPIDI_CH3_Finalize(void)
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_FINALIZE);
 
     mpi_errno = MPIDI_CH3I_Progress_finalize();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     mpi_errno = MPID_nem_finalize();
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_FINALIZE);
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_init.c b/src/mpid/ch3/channels/nemesis/src/ch3_init.c
index 99f7bc6..4a0540e 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_init.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_init.c
@@ -22,7 +22,7 @@ static int nemesis_initialized = 0;
 #undef FUNCNAME
 #define FUNCNAME split_type
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int split_type(MPID_Comm * comm_ptr, int stype, int key,
                       MPID_Info *info_ptr, MPID_Comm ** newcomm_ptr)
 {
@@ -32,14 +32,14 @@ static int split_type(MPID_Comm * comm_ptr, int stype, int key,
 
     if (MPIDI_CH3I_Shm_supported()) {
         mpi_errno = MPID_Get_node_id(comm_ptr, comm_ptr->rank, &id);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else
         id = comm_ptr->rank;
 
     nid = (stype == MPI_COMM_TYPE_SHARED) ? id : MPI_UNDEFINED;
     mpi_errno = MPIR_Comm_split_impl(comm_ptr, nid, key, newcomm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     return mpi_errno;
@@ -73,7 +73,7 @@ static MPID_CommOps comm_fns = {
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Init(int has_parent, MPIDI_PG_t *pg_p, int pg_rank)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -86,7 +86,7 @@ int MPIDI_CH3_Init(int has_parent, MPIDI_PG_t *pg_p, int pg_rank)
     MPID_Comm_fns = &comm_fns;
 
     mpi_errno = MPID_nem_init (pg_rank, pg_p, has_parent);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
     nemesis_initialized = 1;
 
@@ -97,12 +97,12 @@ int MPIDI_CH3_Init(int has_parent, MPIDI_PG_t *pg_p, int pg_rank)
      * Initialize Progress Engine
      */
     mpi_errno = MPIDI_CH3I_Progress_init();
-    if (mpi_errno) MPIU_ERR_SETFATALANDJUMP (mpi_errno, MPI_ERR_OTHER, "**init_progress");
+    if (mpi_errno) MPIR_ERR_SETFATALANDJUMP (mpi_errno, MPI_ERR_OTHER, "**init_progress");
 
     for (i = 0; i < pg_p->size; i++)
     {
 	mpi_errno = MPIDI_CH3_VC_Init(&pg_p->vct[i]);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -129,7 +129,7 @@ int MPIDI_CH3_PortFnsInit( MPIDI_PortFns *portFns )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Get_business_card
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Get_business_card(int myRank, char *value, int length)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -138,7 +138,7 @@ int MPIDI_CH3_Get_business_card(int myRank, char *value, int length)
     MPIDI_FUNC_ENTER(MPIDI_STATE_MPIDI_CH3_GET_BUSINESS_CARD);
 
     mpi_errno = MPID_nem_get_business_card(myRank, value, length);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     MPIDI_FUNC_EXIT(MPIDI_STATE_MPIDI_CH3_GET_BUSINESS_CARD);
@@ -151,7 +151,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_VC_Init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_VC_Init( MPIDI_VC_t *vc )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -186,7 +186,7 @@ int MPIDI_CH3_VC_Init( MPIDI_VC_t *vc )
     vc->ch.recv_active = NULL;
 
     mpi_errno = MPID_nem_vc_init (vc);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
  fn_exit:
  fn_fail:
@@ -197,7 +197,7 @@ int MPIDI_CH3_VC_Init( MPIDI_VC_t *vc )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_VC_Destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_VC_Destroy(MPIDI_VC_t *vc )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -223,7 +223,7 @@ fn_exit:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Connect_to_root
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Connect_to_root (const char *port_name, MPIDI_VC_t **new_vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -244,14 +244,14 @@ int MPIDI_CH3_Connect_to_root (const char *port_name, MPIDI_VC_t **new_vc)
     MPIDI_VC_Init (vc, NULL, 0);
 
     /* init channel portion of vc */
-    MPIU_ERR_CHKINTERNAL(!nemesis_initialized, mpi_errno, "Nemesis not initialized");
+    MPIR_ERR_CHKINTERNAL(!nemesis_initialized, mpi_errno, "Nemesis not initialized");
     vc->ch.recv_active = NULL;
     MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
 
     *new_vc = vc; /* we now have a valid, disconnected, temp VC */
 
     mpi_errno = MPID_nem_connect_to_root (port_name, vc);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
     MPIU_CHKPMEM_COMMIT();
  fn_exit:
@@ -315,7 +315,7 @@ static struct {initcomp_cb_t *top;} initcomp_cb_stack = {0};
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_register_initcomp_cb
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_register_initcomp_cb(int (* callback)(void))
 {
     int mpi_errno = MPI_SUCCESS;
@@ -341,7 +341,7 @@ int MPID_nem_register_initcomp_cb(int (* callback)(void))
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_InitCompleted
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_InitCompleted(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -354,7 +354,7 @@ int MPIDI_CH3_InitCompleted(void)
     while (ep)
     {
         mpi_errno = ep->callback();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         ep_tmp = ep;
         ep = ep->next;
         MPIU_Free(ep_tmp);
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_isend.c b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
index 4a1dee3..e1d1b40 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
@@ -14,7 +14,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_iSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_sz_t hdr_sz)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -26,7 +26,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
 
     if (vc->state == MPIDI_VC_STATE_MORIBUND) {
         sreq->status.MPI_ERROR = MPI_SUCCESS;
-        MPIU_ERR_SET1(sreq->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+        MPIR_ERR_SET1(sreq->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
         MPID_Request_complete(sreq);
         goto fn_fail;
     }
@@ -34,7 +34,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
     if (vc->ch.iSendContig)
     {
         mpi_errno = vc->ch.iSendContig(vc, sreq, hdr, hdr_sz, NULL, 0);
-        if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
         goto fn_exit;
     }
 
@@ -46,7 +46,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
     hdr_sz = sizeof(MPIDI_CH3_Pkt_t);
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)hdr);
 
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
     in_cs = TRUE;
 
     if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
@@ -54,7 +54,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
         MPIU_Assert(hdr_sz <= INT_MAX);
 	MPIU_DBG_MSG_D (CH3_CHANNEL, VERBOSE, "iSend %d", (int) hdr_sz);
 	mpi_errno = MPID_nem_mpich_send_header (hdr, (int)hdr_sz, vc, &again);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	if (again)
 	{
 	    goto enqueue_it;
@@ -69,14 +69,14 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
                 MPIU_Assert (MPIDI_Request_get_type (sreq) != MPIDI_REQUEST_TYPE_GET_RESP);
                 mpi_errno = MPID_Request_complete(sreq);
                 if (mpi_errno != MPI_SUCCESS) {
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 }
             }
             else
             {
                 int complete = 0;
                 mpi_errno = reqFn (vc, sreq, &complete);
-                if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP (mpi_errno);
             }
 	}
     }
@@ -88,7 +88,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
 
  fn_exit:
     if (in_cs) {
-        MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     }
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_ISEND);
@@ -114,7 +114,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
            check to see if we can send any now */
         MPIDI_CH3I_Sendq_enqueue(&MPIDI_CH3I_shm_sendq, sreq);
         mpi_errno = MPIDI_CH3I_Shm_send_progress();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
     goto fn_exit;
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
index 0ccacf4..35ade04 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
@@ -16,7 +16,7 @@ extern void *MPIDI_CH3_packet_buffer;
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_iSendv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_iov)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -30,8 +30,8 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
 
     if (vc->state == MPIDI_VC_STATE_MORIBUND) {
         sreq->status.MPI_ERROR = MPI_SUCCESS;
-        MPIU_ERR_SET1(sreq->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
-        MPIU_ERR_SET1(mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+        MPIR_ERR_SET1(sreq->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+        MPIR_ERR_SET1(mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
         MPID_Request_complete(sreq);
         goto fn_fail;
     }
@@ -63,7 +63,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
     iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)iov[0].MPL_IOV_BUF);
 
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
     in_cs = TRUE;
 
     if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
@@ -75,11 +75,11 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
 	mpi_errno = MPID_nem_mpich_sendv_header (&remaining_iov, &remaining_n_iov,
 	                                         sreq->dev.ext_hdr_ptr, sreq->dev.ext_hdr_sz,
 	                                         vc, &again);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	while (!again && remaining_n_iov > 0)
 	{
 	    mpi_errno = MPID_nem_mpich_sendv (&remaining_iov, &remaining_n_iov, vc, &again);
-            if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	}
 
 	if (again)
@@ -128,7 +128,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
                 MPIU_Assert (MPIDI_Request_get_type (sreq) != MPIDI_REQUEST_TYPE_GET_RESP);
                 mpi_errno = MPID_Request_complete (sreq);
                 if (mpi_errno != MPI_SUCCESS) {
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 }
                 MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, ".... complete");
             }
@@ -137,7 +137,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
                 int complete = 0;
 
                 mpi_errno = reqFn (vc, sreq, &complete);
-                if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
                 if (!complete)
                 {
@@ -180,12 +180,12 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
            check to see if we can send any now */
         MPIDI_CH3I_Sendq_enqueue(&MPIDI_CH3I_shm_sendq, sreq);
         mpi_errno = MPIDI_CH3I_Shm_send_progress();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
     if (in_cs) {
-        MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     }
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_ISENDV);
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
index f5d0ebb..406e170 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
@@ -23,7 +23,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_iStartMsg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_Request **sreq_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -33,7 +33,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_ISTARTMSG);
 
-    MPIU_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+    MPIR_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
 
     if (vc->ch.iStartContigMsg)
     {
@@ -49,7 +49,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
     hdr_sz = sizeof(MPIDI_CH3_Pkt_t);
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)hdr);
 
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
     in_cs = 1;
 
     if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
@@ -58,7 +58,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
         MPIU_Assert(hdr_sz <= INT_MAX);
 	MPIU_DBG_MSG_D (CH3_CHANNEL, VERBOSE, "iStartMsg %d", (int) hdr_sz);
 	mpi_errno = MPID_nem_mpich_send_header (hdr, (int)hdr_sz, vc, &again);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	if (again)
 	{
 	    goto enqueue_it;
@@ -75,7 +75,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
 
  fn_exit:
     if (in_cs) {
-        MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     }
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_ISTARTMSG);
     return mpi_errno;
@@ -112,7 +112,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
             /* FIXME we are sometimes called from within the progress engine, we
              * shouldn't be calling the progress engine again */
             mpi_errno = MPIDI_CH3I_Shm_send_progress();
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     
 	*sreq_ptr = sreq;
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
index 22d2666..12b9469 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
@@ -29,7 +29,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_iStartMsgv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request **sreq_ptr)
 {
     MPID_Request * sreq = *sreq_ptr = NULL;
@@ -41,7 +41,7 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_ISTARTMSGV);
 
-    MPIU_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+    MPIR_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
 
     if (vc->ch.iStartContigMsg)
     {
@@ -71,7 +71,7 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
     iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)iov[0].MPL_IOV_BUF);
 
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
     in_cs = TRUE;
 
     if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
@@ -91,7 +91,7 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
             });
 	mpi_errno = MPID_nem_mpich_sendv_header (&remaining_iov, &remaining_n_iov,
 	                                         NULL, 0, vc, &again);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	while (!again && (remaining_n_iov > 0))
 	{
             MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, {
@@ -103,7 +103,7 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
                 });
 
 	    mpi_errno = MPID_nem_mpich_sendv (&remaining_iov, &remaining_n_iov, vc, &again);
-            if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	}
         MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, {
                 int total = 0;
@@ -176,7 +176,7 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
                check to see if we can send any now */
             MPIDI_CH3I_Sendq_enqueue(&MPIDI_CH3I_shm_sendq, sreq);
             mpi_errno = MPIDI_CH3I_Shm_send_progress();
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -184,7 +184,7 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
 
  fn_exit:
     if (in_cs) {
-        MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     }
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_ISTARTMSGV);
     return mpi_errno;
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
index ccf4f59..9b1e6c7 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
@@ -109,7 +109,7 @@ static void sigusr1_handler(int sig)
 #undef FUNCNAME
 #define FUNCNAME check_terminating_vcs
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int check_terminating_vcs(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -122,7 +122,7 @@ static int check_terminating_vcs(void)
         TERMQ_DEQUEUE(&ep);
         MPID_Request_release(ep->req);
         mpi_errno = shm_connection_terminated(ep->vc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPIU_Free(ep);
     }
     
@@ -140,7 +140,7 @@ static int check_terminating_vcs(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Shm_send_progress
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Shm_send_progress(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -167,7 +167,7 @@ int MPIDI_CH3I_Shm_send_progress(void)
             do
             {
                 mpi_errno = MPID_nem_mpich_sendv(&iov, &n_iov, sreq->ch.vc, &again);
-                if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP (mpi_errno);
             }
             while (!again && n_iov > 0);
 
@@ -207,14 +207,14 @@ int MPIDI_CH3I_Shm_send_progress(void)
 
             mpi_errno = MPID_nem_mpich_sendv_header(&iov, &n_iov, sreq->dev.ext_hdr_ptr,
                                                     sreq->dev.ext_hdr_sz, sreq->ch.vc, &again);
-            if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP (mpi_errno);
             if (!again)
             {
                 MPIDI_CH3I_shm_active_send = sreq;
                 while (!again && n_iov > 0)
                 {
                     mpi_errno = MPID_nem_mpich_sendv(&iov, &n_iov, sreq->ch.vc, &again);
-                    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
                 }
             }
 
@@ -254,13 +254,13 @@ int MPIDI_CH3I_Shm_send_progress(void)
     {
         /* MT FIXME-N1 race under per-object, harmless to disable here but
          * its a symptom of a bigger problem... */
-#if !(defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT))
+#if !(defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT))
         MPIU_Assert(MPIDI_Request_get_type(sreq) != MPIDI_REQUEST_TYPE_GET_RESP);
 #endif
 
         mpi_errno = MPID_Request_complete(sreq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         /* MT - clear the current active send before dequeuing/destroying the current request */
@@ -268,13 +268,13 @@ int MPIDI_CH3I_Shm_send_progress(void)
         MPIDI_CH3I_Sendq_dequeue(&MPIDI_CH3I_shm_sendq, &sreq);
         MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
         mpi_errno = check_terminating_vcs();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else
     {
         int complete = 0;
         mpi_errno = sreq->dev.OnDataAvail(sreq->ch.vc, sreq, &complete);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (complete)
         {
@@ -282,7 +282,7 @@ int MPIDI_CH3I_Shm_send_progress(void)
             MPIDI_CH3I_Sendq_dequeue(&MPIDI_CH3I_shm_sendq, &sreq);
             MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
             mpi_errno = check_terminating_vcs();
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
         
@@ -296,7 +296,7 @@ int MPIDI_CH3I_Shm_send_progress(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_register_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -304,7 +304,7 @@ int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
         if (progress_hooks[i].func_ptr == NULL) {
@@ -323,7 +323,7 @@ int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
     (*id) = i;
 
   fn_exit:
-    MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
     return mpi_errno;
 
@@ -334,14 +334,14 @@ int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_deregister_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_deregister_hook(int id)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS && progress_hooks[id].func_ptr != NULL);
 
@@ -349,7 +349,7 @@ int MPIDI_CH3I_Progress_deregister_hook(int id)
     progress_hooks[id].active = FALSE;
 
   fn_exit:
-    MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
     return mpi_errno;
 
@@ -361,14 +361,14 @@ int MPIDI_CH3I_Progress_deregister_hook(int id)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_activate_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_activate_hook(int id)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS &&
                 progress_hooks[id].active == FALSE && progress_hooks[id].func_ptr != NULL);
@@ -378,7 +378,7 @@ int MPIDI_CH3I_Progress_activate_hook(int id)
     MPIU_Assert(total_progress_hook_cnt <= MAX_PROGRESS_HOOKS);
 
   fn_exit:
-    MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
     return mpi_errno;
 
@@ -390,14 +390,14 @@ int MPIDI_CH3I_Progress_activate_hook(int id)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_deactivate_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_deactivate_hook(int id)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS &&
                 progress_hooks[id].active == TRUE && progress_hooks[id].func_ptr != NULL);
@@ -407,7 +407,7 @@ int MPIDI_CH3I_Progress_deactivate_hook(int id)
     MPIU_Assert(total_progress_hook_cnt >= 0);
 
   fn_exit:
-    MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
     return mpi_errno;
 
@@ -421,7 +421,7 @@ int MPIDI_CH3I_Progress_deactivate_hook(int id)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -430,7 +430,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS);
 
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     /* sanity: if this doesn't hold, we can't track our local view of completion safely */
     if (is_blocking) {
@@ -440,7 +440,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
     if (sigusr1_count > my_sigusr1_count) {
         my_sigusr1_count = sigusr1_count;
         mpi_errno = MPIDI_CH3U_Check_for_failed_procs();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
 #ifdef ENABLE_CHECKPOINTING
@@ -448,12 +448,12 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
         if (MPIDI_nem_ckpt_start_checkpoint) {
             MPIDI_nem_ckpt_start_checkpoint = FALSE;
             mpi_errno = MPIDI_nem_ckpt_start();
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         if (MPIDI_nem_ckpt_finish_checkpoint) {
             MPIDI_nem_ckpt_finish_checkpoint = FALSE;
             mpi_errno = MPIDI_nem_ckpt_finish();
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 #endif
@@ -461,7 +461,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
 /* For threaded mode, if another thread is in the progress engine, we
  * don't enter the progress engine */
 #ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN;
+    MPID_THREAD_CHECK_BEGIN;
     {
         while (MPIDI_CH3I_progress_blocked == TRUE)
         {
@@ -489,7 +489,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
             }
         }
     }
-    MPIU_THREAD_CHECK_END;
+    MPID_THREAD_CHECK_END;
 #endif
 
     do
@@ -517,7 +517,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
             {
                 mpi_errno = MPID_nem_mpich_test_recv(&cell, &in_fbox, is_blocking);
             }
-            if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
             if (cell)
             {
@@ -547,7 +547,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
                     MPIU_Assert(pkt->type >= 0 && pkt->type < MPIDI_CH3_PKT_END_ALL);
 
                     mpi_errno = pktArray[pkt->type](vc, pkt, &buflen, &rreq);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                     if (!rreq)
                     {
@@ -561,7 +561,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
                     payload_len -= buflen;
 
                     mpi_errno = MPID_nem_handle_pkt(vc, cell_buf, payload_len);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     MPID_nem_mpich_release_fbox(cell);
 
                     /* the whole message should have been handled */
@@ -576,7 +576,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
                 MPIDI_PG_Get_vc_set_active(MPIDI_Process.my_pg, MPID_NEM_CELL_SOURCE(cell), &vc);
 
                 mpi_errno = MPID_nem_handle_pkt(vc, cell_buf, payload_len);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 MPID_nem_mpich_release_cell(cell, vc);
 
                 break; /* break out of recv progress block */
@@ -589,14 +589,14 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
 	/* make progress sending */
         if (MPIDI_CH3I_shm_active_send || MPIDI_CH3I_Sendq_head(MPIDI_CH3I_shm_sendq)) {
             mpi_errno = MPIDI_CH3I_Shm_send_progress();
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         
         /* make progress on LMTs */
         if (MPID_nem_local_lmt_pending)
         {
             mpi_errno = MPID_nem_local_lmt_progress();
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         called_progress_hook_cnt = 0;
@@ -604,7 +604,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
             if (progress_hooks[i].active == TRUE) {
                 MPIU_Assert(progress_hooks[i].func_ptr != NULL);
                 mpi_errno = progress_hooks[i].func_ptr(&made_progress);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 if (made_progress)
                     MPIDI_CH3_Progress_signal_completion();
 
@@ -628,11 +628,11 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
         }
 
 #ifdef MPICH_IS_THREADED
-        MPIU_THREAD_CHECK_BEGIN;
+        MPID_THREAD_CHECK_BEGIN;
         {
             if (is_blocking) {
                 MPIDI_CH3I_progress_blocked = TRUE;
-                MPIU_THREAD_CS_YIELD(ALLFUNC,);
+                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
                 /* MPIDCOMM yield is needed because at least the send
                  * functions acquire MPIDCOMM to put things into the send
                  * queues.  Failure to yield could result in a deadlock.
@@ -643,12 +643,12 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
                  * sections besides the MPIDCOMM CS at this point.
                  * Violating this will probably lead to lock-ordering
                  * deadlocks. */
-                MPIU_THREAD_CS_YIELD(MPIDCOMM,);
+                MPID_THREAD_CS_YIELD(POBJ, MPIR_ThreadInfo.global_mutex);
                 MPIDI_CH3I_progress_blocked = FALSE;
                 MPIDI_CH3I_progress_wakeup_signalled = FALSE;
             }
         }
-        MPIU_THREAD_CHECK_END;
+        MPID_THREAD_CHECK_END;
 #else
         MPIU_Busy_wait();
 #endif
@@ -657,18 +657,18 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
 
     
 #ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN;
+    MPID_THREAD_CHECK_BEGIN;
     {
         if (is_blocking)
         {
             MPIDI_CH3I_Progress_continue(0/*unused*/);
         }
     }
-    MPIU_THREAD_CHECK_END;
+    MPID_THREAD_CHECK_END;
 #endif
 
  fn_exit:
-    MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS);
     return mpi_errno;
  fn_fail:
@@ -681,17 +681,17 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_delay
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3I_Progress_delay(unsigned int completion_count)
 {
-    int mpi_errno = MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS, err;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_DELAY);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_DELAY);
     /* FIXME should be appropriately abstracted somehow */
-#   if defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
     {
-        MPID_Thread_cond_wait(&MPIDI_CH3I_progress_completion_cond, &MPIR_ThreadInfo.global_mutex/*MPIDCOMM*/);
+        MPID_Thread_cond_wait(&MPIDI_CH3I_progress_completion_cond, &MPIR_ThreadInfo.global_mutex/*MPIDCOMM*/, &err);
     }
 #   endif
 
@@ -704,18 +704,18 @@ static int MPIDI_CH3I_Progress_delay(unsigned int completion_count)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_continue
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3I_Progress_continue(unsigned int completion_count/*unused*/)
 {
-    int mpi_errno = MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS,err;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_CONTINUE);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_CONTINUE);
     /* FIXME should be appropriately abstracted somehow */
-#   if defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
     {
         /* we currently hold the MPIDCOMM CS */
-	MPID_Thread_cond_broadcast(&MPIDI_CH3I_progress_completion_cond);
+        MPID_Thread_cond_broadcast(&MPIDI_CH3I_progress_completion_cond, &err);
     }
 #   endif
 
@@ -728,7 +728,7 @@ static int MPIDI_CH3I_Progress_continue(unsigned int completion_count/*unused*/)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_wakeup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDI_CH3I_Progress_wakeup(void)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_WAKEUP);
@@ -744,7 +744,7 @@ void MPIDI_CH3I_Progress_wakeup(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_handle_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -771,7 +771,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                 MPIU_Assert(pkt->type >= 0 && pkt->type < MPIDI_CH3_PKT_END_ALL);
 
                 mpi_errno = pktArray[pkt->type](vc, pkt, &len, &rreq);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 buflen -= len;
                 buf    += len;
                 MPIU_DBG_STMT(CH3_CHANNEL, VERBOSE, if (!rreq) MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "...completed immediately"));
@@ -820,7 +820,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
 
             pktlen = sizeof(MPIDI_CH3_Pkt_t);
             mpi_errno = pktArray[pkt->type](vc, pkt, &pktlen, &rreq);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPIU_Assert(pktlen == sizeof(MPIDI_CH3_Pkt_t));
 
             vc_ch->pending_pkt_len = 0;
@@ -896,12 +896,12 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                 if (!reqFn)
                 {
                     /* MT FIXME-N1 */
-#if !(defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT))
+#if !(defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT))
                     MPIU_Assert(MPIDI_Request_get_type(rreq) != MPIDI_REQUEST_TYPE_GET_RESP);
 #endif
                     mpi_errno = MPID_Request_complete(rreq);
                     if (mpi_errno != MPI_SUCCESS) {
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                     }
 
                     complete = TRUE;
@@ -909,7 +909,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                 else
                 {
                     mpi_errno = reqFn(vc, rreq, &complete);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
 
                 if (!complete)
@@ -951,7 +951,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_init(void)
 {
     int i;
@@ -960,16 +960,16 @@ int MPIDI_CH3I_Progress_init(void)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_INIT);
 
-    MPIU_THREAD_CHECK_BEGIN
+    MPID_THREAD_CHECK_BEGIN
     /* FIXME should be appropriately abstracted somehow */
-#   if defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
     {
         int err;
 	MPID_Thread_cond_create(&MPIDI_CH3I_progress_completion_cond, &err);
         MPIU_Assert(err == 0);
     }
 #   endif
-    MPIU_THREAD_CHECK_END
+    MPID_THREAD_CHECK_END
 
     MPIDI_CH3I_shm_sendq.head = NULL;
     MPIDI_CH3I_shm_sendq.tail = NULL;
@@ -977,19 +977,19 @@ int MPIDI_CH3I_Progress_init(void)
     
     /* Initialize the code to handle incoming packets */
     if (PKTARRAY_SIZE <= MPIDI_CH3_PKT_END_ALL) {
-        MPIU_ERR_SETFATALANDJUMP(mpi_errno, MPI_ERR_INTERN, "**ch3|pktarraytoosmall");
+        MPIR_ERR_SETFATALANDJUMP(mpi_errno, MPI_ERR_INTERN, "**ch3|pktarraytoosmall");
     }
     /* pkt handlers from CH3 */
     mpi_errno = MPIDI_CH3_PktHandler_Init(pktArray, PKTARRAY_SIZE);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* pkt handlers for LMT */
     mpi_errno = MPID_nem_lmt_pkthandler_init(pktArray, PKTARRAY_SIZE);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
 #ifdef ENABLE_CHECKPOINTING
     mpi_errno = MPIDI_nem_ckpt_pkthandler_init(pktArray, PKTARRAY_SIZE);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 #endif
 
     /* other pkt handlers */
@@ -998,7 +998,7 @@ int MPIDI_CH3I_Progress_init(void)
 #ifdef HAVE_SIGNAL
     /* install signal handler for process failure notifications from hydra */
     prev_sighandler = signal(SIGUSR1, sigusr1_handler);
-    MPIU_ERR_CHKANDJUMP1(prev_sighandler == SIG_ERR, mpi_errno, MPI_ERR_OTHER, "**signal", "**signal %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(prev_sighandler == SIG_ERR, mpi_errno, MPI_ERR_OTHER, "**signal", "**signal %s", MPIU_Strerror(errno));
     if (prev_sighandler == SIG_IGN || prev_sighandler == SIG_DFL)
         prev_sighandler = NULL;
 #endif
@@ -1019,7 +1019,7 @@ int MPIDI_CH3I_Progress_init(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1044,7 +1044,7 @@ int MPIDI_CH3I_Progress_finalize(void)
 #undef FUNCNAME
 #define FUNCNAME shm_connection_terminated
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int shm_connection_terminated(MPIDI_VC_t * vc)
 {
     /* This function is called after all sends have completed */
@@ -1055,16 +1055,16 @@ static int shm_connection_terminated(MPIDI_VC_t * vc)
 
     if (vc->ch.lmt_vc_terminated) {
         mpi_errno = vc->ch.lmt_vc_terminated(vc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
     mpi_errno = MPIU_SHMW_Hnd_finalize(&(vc->ch.lmt_copy_buf_handle));
-    if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
     mpi_errno = MPIU_SHMW_Hnd_finalize(&(vc->ch.lmt_recv_copy_buf_handle));
-    if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
     
     mpi_errno = MPIDI_CH3U_Handle_connection(vc, MPIDI_VC_EVENT_TERMINATED);
-    if(mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if(mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_DBG_MSG_D(CH3_DISCONNECT, TYPICAL, "Terminated VC %d", vc->pg_rank);
  fn_exit:
@@ -1078,7 +1078,7 @@ static int shm_connection_terminated(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Connection_terminate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1103,10 +1103,10 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
                connection immediately. */
             MPIU_DBG_MSG(CH3_DISCONNECT, TYPICAL, "VC terminated due to fault");
             mpi_errno = MPIDI_CH3I_Complete_sendq_with_error(vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             mpi_errno = shm_connection_terminated(vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         } else {
             /* VC is terminated as a result of the close protocol.
                Wait for sends to complete, then terminate. */
@@ -1116,7 +1116,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
                    the connection. */
                 MPIU_DBG_MSG(CH3_DISCONNECT, TYPICAL, "Shm send queue empty, terminating immediately");
                 mpi_errno = shm_connection_terminated(vc);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             } else {
                 /* There may be sends from this VC on the send queue.
                    Since there is one send queue, we don't want to
@@ -1139,7 +1139,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
     } else {
         MPIU_DBG_MSG(CH3_DISCONNECT, TYPICAL, "VC is remote");
         mpi_errno = MPID_nem_netmod_func->vc_terminate(vc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
  fn_exit:
@@ -1155,7 +1155,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Complete_sendq_with_error
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Complete_sendq_with_error(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1177,12 +1177,12 @@ int MPIDI_CH3I_Complete_sendq_with_error(MPIDI_VC_t * vc)
                 MPIDI_CH3I_shm_sendq.tail = prev;
 
             req->status.MPI_ERROR = MPI_SUCCESS;
-            MPIU_ERR_SET1(req->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+            MPIR_ERR_SET1(req->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
             
             MPID_Request_release(req); /* ref count was incremented when added to queue */
             mpi_errno = MPID_Request_complete(req);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
             req = next;
         } else {
@@ -1203,7 +1203,7 @@ int MPIDI_CH3I_Complete_sendq_with_error(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME pkt_NETMOD_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int pkt_NETMOD_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t *buflen, MPID_Request **rreqp)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1226,7 +1226,7 @@ fn_exit:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Register_anysource_notification
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Register_anysource_notification(void (*enqueue_fn)(MPID_Request *rreq), int (*dequeue_fn)(MPID_Request *rreq))
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1251,7 +1251,7 @@ int MPIDI_CH3I_Register_anysource_notification(void (*enqueue_fn)(MPID_Request *
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Anysource_posted
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void anysource_posted(MPID_Request *rreq)
 {
     qn_ent_t *ent = qn_head;
@@ -1270,7 +1270,7 @@ static void anysource_posted(MPID_Request *rreq)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Anysource_matched
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int anysource_matched(MPID_Request *rreq)
 {
     int matched = FALSE;
@@ -1300,15 +1300,15 @@ static int anysource_matched(MPID_Request *rreq)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Posted_recv_enqueued
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDI_CH3I_Posted_recv_enqueued(MPID_Request *rreq)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_POSTED_RECV_ENQUEUED);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_POSTED_RECV_ENQUEUED);
 
-    /* MT FIXME acquiring MPIDCOMM here violates lock ordering rules (see
-     * mpiimplthread.h comments), easily causes deadlock */
+    /* MT FIXME acquiring MPIDCOMM here violates lock ordering rules,
+     * easily causes deadlock */
 
     if ((rreq)->dev.match.parts.rank == MPI_ANY_SOURCE)
         /* call anysource handler */
@@ -1322,13 +1322,13 @@ void MPIDI_CH3I_Posted_recv_enqueued(MPID_Request *rreq)
 	MPIDI_Comm_get_vc((rreq)->comm, (rreq)->dev.match.parts.rank, &vc);
 
 #ifdef ENABLE_COMM_OVERRIDES
-        /* MT FIXME causes deadlock b/c of the MSGQUEUE/CH3COMM ordering (acquired
+        /* MT FIXME causes deadlock b/c of the POBJ ordering (acquired
          * in reverse in some pkt handlers?) */
-        MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         /* call vc-specific handler */
 	if (vc->comm_ops && vc->comm_ops->recv_posted)
             vc->comm_ops->recv_posted(vc, rreq);
-        MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 #endif
 
         /* MT FIXME we unfortunately must disable this optimization for now in
@@ -1337,7 +1337,7 @@ void MPIDI_CH3I_Posted_recv_enqueued(MPID_Request *rreq)
          * ways to do this that don't require a hook on every request post, but
          * instead do some sort of caching or something analogous to branch
          * prediction. */
-#if !(defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT))
+#if !(defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT))
         /* enqueue fastbox */
 
         /* don't enqueue a fastbox for yourself */
@@ -1366,7 +1366,7 @@ void MPIDI_CH3I_Posted_recv_enqueued(MPID_Request *rreq)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Posted_recv_dequeued
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Posted_recv_dequeued(MPID_Request *rreq)
 {
     int local_rank = -1;
@@ -1383,7 +1383,7 @@ int MPIDI_CH3I_Posted_recv_dequeued(MPID_Request *rreq)
     /* MT FIXME we unfortunately must disable this optimization for now in
      * per_object mode. There are possibly other ways to synchronize the
      * fboxes that won't cause lock-ordering deadlocks */
-#if !(defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT))
+#if !(defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT))
     else
     {
         if (rreq->dev.match.parts.rank == rreq->comm->rank)
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_rma_shm.c b/src/mpid/ch3/channels/nemesis/src/ch3_rma_shm.c
index 31bbf6a..8d03bd2 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_rma_shm.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_rma_shm.c
@@ -11,7 +11,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Win_shared_query
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_SHM_Win_shared_query(MPID_Win * win_ptr, int target_rank, MPI_Aint * size,
                                    int *disp_unit, void *baseptr)
 {
@@ -24,7 +24,7 @@ int MPIDI_CH3_SHM_Win_shared_query(MPID_Win * win_ptr, int target_rank, MPI_Aint
     if (win_ptr->comm_ptr->node_comm == NULL) {
         mpi_errno = MPIDI_CH3U_Win_shared_query(win_ptr, target_rank, size, disp_unit, baseptr);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
         goto fn_exit;
     }
@@ -74,7 +74,7 @@ int MPIDI_CH3_SHM_Win_shared_query(MPID_Win * win_ptr, int target_rank, MPI_Aint
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_SHM_Win_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_SHM_Win_free(MPID_Win ** win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -101,7 +101,7 @@ int MPIDI_CH3_SHM_Win_free(MPID_Win ** win_ptr)
                                      (char **) &(*win_ptr)->shm_base_addr,
                                      (*win_ptr)->shm_segment_len);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             MPIU_SHMW_Hnd_finalize(&(*win_ptr)->shm_segment_handle);
         }
@@ -131,7 +131,7 @@ int MPIDI_CH3_SHM_Win_free(MPID_Win ** win_ptr)
             MPIU_SHMW_Seg_detach((*win_ptr)->shm_mutex_segment_handle,
                                  (char **) &(*win_ptr)->shm_mutex, sizeof(MPIDI_CH3I_SHM_MUTEX));
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIU_SHMW_Hnd_finalize(&(*win_ptr)->shm_mutex_segment_handle);
     }
@@ -142,7 +142,7 @@ int MPIDI_CH3_SHM_Win_free(MPID_Win ** win_ptr)
                                          (char **) &(*win_ptr)->info_shm_base_addr,
                                          (*win_ptr)->info_shm_segment_len);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIU_SHMW_Hnd_finalize(&(*win_ptr)->info_shm_segment_handle);
 
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 53af651..38700ed 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c
@@ -32,7 +32,7 @@ static int MPIDI_CH3I_Win_gather_info(void *base, MPI_Aint size, int disp_unit,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Win_fns_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Win_fns_init(MPIDI_CH3U_Win_fns_t * win_fns)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -55,7 +55,7 @@ int MPIDI_CH3_Win_fns_init(MPIDI_CH3U_Win_fns_t * win_fns)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Win_hooks_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Win_hooks_init(MPIDI_CH3U_Win_hooks_t * win_hooks)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -77,7 +77,7 @@ int MPIDI_CH3_Win_hooks_init(MPIDI_CH3U_Win_hooks_t * win_hooks)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Win_pkt_orderings_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Win_pkt_orderings_init(MPIDI_CH3U_Win_pkt_ordering_t * win_pkt_orderings)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -91,7 +91,7 @@ int MPIDI_CH3_Win_pkt_orderings_init(MPIDI_CH3U_Win_pkt_ordering_t * win_pkt_ord
     if (MPID_nem_netmod_func && MPID_nem_netmod_func->get_ordering) {
         mpi_errno = MPID_nem_netmod_func->get_ordering(&netmod_ordering);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     if (netmod_ordering > 0) {
@@ -112,7 +112,7 @@ int MPIDI_CH3_Win_pkt_orderings_init(MPIDI_CH3U_Win_pkt_ordering_t * win_pkt_ord
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Win_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3I_Win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
                                MPID_Info * info, MPID_Comm * comm_ptr, MPID_Win ** win_ptr)
 {
@@ -143,7 +143,7 @@ static int MPIDI_CH3I_Win_init(MPI_Aint size, int disp_unit, int create_flavor,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_SHM_Wins_match
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3I_SHM_Wins_match(MPID_Win ** win_ptr, MPID_Win ** matched_win,
                                      MPI_Aint ** base_shm_offs_ptr)
 {
@@ -184,7 +184,7 @@ static int MPIDI_CH3I_SHM_Wins_match(MPID_Win ** win_ptr, MPID_Win ** matched_wi
 
     mpi_errno = MPIR_Comm_group_impl(node_comm_ptr, &node_group_ptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     while (elem != NULL) {
         MPID_Win *shm_win = elem->win;
@@ -205,17 +205,17 @@ static int MPIDI_CH3I_SHM_Wins_match(MPID_Win ** win_ptr, MPID_Win ** matched_wi
 
         mpi_errno = MPIR_Comm_group_impl(shm_win->comm_ptr, &shm_node_group_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Group_translate_ranks_impl(node_group_ptr, node_size,
                                                     node_ranks, shm_node_group_ptr,
                                                     node_ranks_in_shm_node);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Group_free_impl(shm_node_group_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         shm_node_group_ptr = NULL;
 
         group_diff = 0;
@@ -240,8 +240,8 @@ static int MPIDI_CH3I_SHM_Wins_match(MPID_Win ** win_ptr, MPID_Win ** matched_wi
         mpi_errno = MPIR_Allgather_impl(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
                                         base_shm_offs, 1, MPI_AINT, node_comm_ptr, &errflag);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+            MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
         base_diff = 0;
         for (i = 0; i < comm_size; ++i) {
@@ -285,7 +285,7 @@ static int MPIDI_CH3I_SHM_Wins_match(MPID_Win ** win_ptr, MPID_Win ** matched_wi
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_detect_shm
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3I_Win_detect_shm(MPID_Win ** win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -313,7 +313,7 @@ static int MPIDI_CH3I_Win_detect_shm(MPID_Win ** win_ptr)
      * shared window on every local process should be the same. */
     mpi_errno = MPIDI_CH3I_SHM_Wins_match(win_ptr, &shm_win_ptr, &base_shm_offs);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     if (shm_win_ptr == NULL)
         goto fn_exit;
 
@@ -346,7 +346,7 @@ static int MPIDI_CH3I_Win_detect_shm(MPID_Win ** win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_gather_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3I_Win_gather_info(void *base, MPI_Aint size, int disp_unit, MPID_Info * info,
                                       MPID_Comm * comm_ptr, MPID_Win ** win_ptr)
 {
@@ -378,7 +378,7 @@ static int MPIDI_CH3I_Win_gather_info(void *base, MPI_Aint size, int disp_unit,
 
     mpi_errno = MPIU_SHMW_Hnd_init(&(*win_ptr)->info_shm_segment_handle);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if (node_rank == 0) {
         char *serialized_hnd_ptr = NULL;
@@ -388,32 +388,32 @@ static int MPIDI_CH3I_Win_gather_info(void *base, MPI_Aint size, int disp_unit,
                                                     (*win_ptr)->info_shm_segment_len,
                                                     (char **) &(*win_ptr)->info_shm_base_addr, 0);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         /* serialize handle and broadcast it to the other processes in win */
         mpi_errno =
             MPIU_SHMW_Hnd_get_serialized_by_ref((*win_ptr)->info_shm_segment_handle,
                                                 &serialized_hnd_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno =
             MPIR_Bcast_impl(serialized_hnd_ptr, MPIU_SHMW_GHND_SZ, MPI_CHAR, 0, node_comm_ptr,
                             &errflag);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+            MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
         /* wait for other processes to attach to win */
         mpi_errno = MPIR_Barrier_impl(node_comm_ptr, &errflag);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+            MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
         /* unlink shared memory region so it gets deleted when all processes exit */
         mpi_errno = MPIU_SHMW_Seg_remove((*win_ptr)->info_shm_segment_handle);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     else {
         char serialized_hnd[MPIU_SHMW_GHND_SZ] = { 0 };
@@ -423,13 +423,13 @@ static int MPIDI_CH3I_Win_gather_info(void *base, MPI_Aint size, int disp_unit,
             MPIR_Bcast_impl(serialized_hnd, MPIU_SHMW_GHND_SZ, MPI_CHAR, 0, node_comm_ptr,
                             &errflag);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+            MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
         mpi_errno = MPIU_SHMW_Hnd_deserialize((*win_ptr)->info_shm_segment_handle, serialized_hnd,
                                               strlen(serialized_hnd));
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         /* attach to shared memory region created by rank 0 */
         mpi_errno =
@@ -437,12 +437,12 @@ static int MPIDI_CH3I_Win_gather_info(void *base, MPI_Aint size, int disp_unit,
                                  (*win_ptr)->info_shm_segment_len,
                                  (char **) &(*win_ptr)->info_shm_base_addr, 0);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Barrier_impl(node_comm_ptr, &errflag);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+            MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
     }
 
     (*win_ptr)->basic_info_table = (MPIDI_Win_basic_info_t *) ((*win_ptr)->info_shm_base_addr);
@@ -458,7 +458,7 @@ static int MPIDI_CH3I_Win_gather_info(void *base, MPI_Aint size, int disp_unit,
     mpi_errno = MPIR_Allgather_impl(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, tmp_buf, 4, MPI_AINT,
                                     (*win_ptr)->comm_ptr, &errflag);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if (node_rank == 0) {
         /* only node_rank == 0 writes results to basic_info_table on shared memory region. */
@@ -474,7 +474,7 @@ static int MPIDI_CH3I_Win_gather_info(void *base, MPI_Aint size, int disp_unit,
     /* Make sure that all local processes see the results written by node_rank == 0 */
     mpi_errno = MPIR_Barrier_impl(node_comm_ptr, &errflag);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
@@ -489,7 +489,7 @@ static int MPIDI_CH3I_Win_gather_info(void *base, MPI_Aint size, int disp_unit,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_allocate_shm
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info * info,
                                        MPID_Comm * comm_ptr, void *base_ptr, MPID_Win ** win_ptr)
 {
@@ -545,8 +545,8 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
                                     node_comm_ptr, &errflag);
     MPIR_T_PVAR_TIMER_END(RMA, rma_wincreate_allgather);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        MPIR_ERR_POP(mpi_errno);
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
     (*win_ptr)->shm_segment_len = 0;
 
@@ -565,7 +565,7 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
     else {
         mpi_errno = MPIU_SHMW_Hnd_init(&(*win_ptr)->shm_segment_handle);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (node_rank == 0) {
             char *serialized_hnd_ptr = NULL;
@@ -576,32 +576,32 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
                                                 (*win_ptr)->shm_segment_len,
                                                 (char **) &(*win_ptr)->shm_base_addr, 0);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             /* serialize handle and broadcast it to the other processes in win */
             mpi_errno =
                 MPIU_SHMW_Hnd_get_serialized_by_ref((*win_ptr)->shm_segment_handle,
                                                     &serialized_hnd_ptr);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             mpi_errno =
                 MPIR_Bcast_impl(serialized_hnd_ptr, MPIU_SHMW_GHND_SZ, MPI_CHAR, 0, node_comm_ptr,
                                 &errflag);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+                MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
             /* wait for other processes to attach to win */
             mpi_errno = MPIR_Barrier_impl(node_comm_ptr, &errflag);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+                MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
             /* unlink shared memory region so it gets deleted when all processes exit */
             mpi_errno = MPIU_SHMW_Seg_remove((*win_ptr)->shm_segment_handle);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
         }
         else {
@@ -612,32 +612,32 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
                 MPIR_Bcast_impl(serialized_hnd, MPIU_SHMW_GHND_SZ, MPI_CHAR, 0, node_comm_ptr,
                                 &errflag);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+                MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
             mpi_errno =
                 MPIU_SHMW_Hnd_deserialize((*win_ptr)->shm_segment_handle, serialized_hnd,
                                           strlen(serialized_hnd));
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             /* attach to shared memory region created by rank 0 */
             mpi_errno =
                 MPIU_SHMW_Seg_attach((*win_ptr)->shm_segment_handle, (*win_ptr)->shm_segment_len,
                                      (char **) &(*win_ptr)->shm_base_addr, 0);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             mpi_errno = MPIR_Barrier_impl(node_comm_ptr, &errflag);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+                MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
         }
 
         /* Allocated the interprocess mutex segment. */
         mpi_errno = MPIU_SHMW_Hnd_init(&(*win_ptr)->shm_mutex_segment_handle);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (node_rank == 0) {
             char *serialized_hnd_ptr = NULL;
@@ -648,7 +648,7 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
                                                 sizeof(MPIDI_CH3I_SHM_MUTEX),
                                                 (char **) &(*win_ptr)->shm_mutex, 0);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             MPIDI_CH3I_SHM_MUTEX_INIT(*win_ptr);
 
@@ -657,25 +657,25 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
                 MPIU_SHMW_Hnd_get_serialized_by_ref((*win_ptr)->shm_mutex_segment_handle,
                                                     &serialized_hnd_ptr);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             mpi_errno =
                 MPIR_Bcast_impl(serialized_hnd_ptr, MPIU_SHMW_GHND_SZ, MPI_CHAR, 0, node_comm_ptr,
                                 &errflag);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+                MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
             /* wait for other processes to attach to win */
             mpi_errno = MPIR_Barrier_impl(node_comm_ptr, &errflag);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+                MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
             /* unlink shared memory region so it gets deleted when all processes exit */
             mpi_errno = MPIU_SHMW_Seg_remove((*win_ptr)->shm_mutex_segment_handle);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
         else {
             char serialized_hnd[MPIU_SHMW_GHND_SZ] = { 0 };
@@ -685,14 +685,14 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
                 MPIR_Bcast_impl(serialized_hnd, MPIU_SHMW_GHND_SZ, MPI_CHAR, 0, node_comm_ptr,
                                 &errflag);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+                MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
             mpi_errno =
                 MPIU_SHMW_Hnd_deserialize((*win_ptr)->shm_mutex_segment_handle, serialized_hnd,
                                           strlen(serialized_hnd));
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             /* attach to shared memory region created by rank 0 */
             mpi_errno =
@@ -700,12 +700,12 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
                                      sizeof(MPIDI_CH3I_SHM_MUTEX), (char **) &(*win_ptr)->shm_mutex,
                                      0);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             mpi_errno = MPIR_Barrier_impl(node_comm_ptr, &errflag);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+                MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
         }
 
         /* compute the base addresses of each process within the shared memory segment */
@@ -747,7 +747,7 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
     /* gather window information among processes via shared memory region. */
     mpi_errno = MPIDI_CH3I_Win_gather_info((*base_pp), size, disp_unit, info, comm_ptr, win_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Cache SHM windows */
     MPIDI_CH3I_SHM_Wins_append(&shm_wins_list, (*win_ptr));
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c b/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c
index b8cbdde..b95844a 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c
@@ -19,7 +19,7 @@ UT_array *coll_fns_array = NULL;
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_comm_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_comm_create(MPID_Comm *comm, void *param)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -76,7 +76,7 @@ int MPIDI_CH3I_comm_create(MPID_Comm *comm, void *param)
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_COMM_CREATE);
     return mpi_errno;
  fn_oom: /* out-of-memory handler for utarray operations */
-    MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "utarray");
+    MPIR_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "utarray");
  fn_fail:
     MPIU_CHKPMEM_REAP();
     goto fn_exit;
@@ -85,7 +85,7 @@ int MPIDI_CH3I_comm_create(MPID_Comm *comm, void *param)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_comm_destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_comm_destroy(MPID_Comm *comm, void *param)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -123,7 +123,7 @@ int MPIDI_CH3I_comm_destroy(MPID_Comm *comm, void *param)
 #undef FUNCNAME
 #define FUNCNAME alloc_barrier_vars
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int alloc_barrier_vars (MPID_Comm *comm, MPID_nem_barrier_vars_t **vars)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -160,7 +160,7 @@ static int alloc_barrier_vars (MPID_Comm *comm, MPID_nem_barrier_vars_t **vars)
 #undef FUNCNAME
 #define FUNCNAME barrier
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int barrier(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -180,7 +180,7 @@ static int barrier(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 
     if (comm_ptr->dev.ch.barrier_vars == NULL) {
         mpi_errno = alloc_barrier_vars (comm_ptr, &comm_ptr->dev.ch.barrier_vars);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
         if (comm_ptr->dev.ch.barrier_vars == NULL) {
             /* no barrier_vars left -- revert to default barrier. */
@@ -192,10 +192,10 @@ static int barrier(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
             */
             if (comm_ptr->coll_fns->prev_coll_fns->Barrier != NULL) {
                 mpi_errno = comm_ptr->coll_fns->prev_coll_fns->Barrier(comm_ptr, errflag);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             } else {
                 mpi_errno = MPIR_Barrier_intra(comm_ptr, errflag);
-                if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP (mpi_errno);
             }
             goto fn_exit;
         }
@@ -230,7 +230,7 @@ static int barrier(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_barrier_vars_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_barrier_vars_init (MPID_nem_barrier_vars_t *barrier_region)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -255,7 +255,7 @@ int MPID_nem_barrier_vars_init (MPID_nem_barrier_vars_t *barrier_region)
 #undef FUNCNAME
 #define FUNCNAME nem_coll_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int nem_coll_finalize(void *param ATTRIBUTE((unused)))
 {
     int mpi_errno = MPI_SUCCESS;
@@ -276,7 +276,7 @@ static int nem_coll_finalize(void *param ATTRIBUTE((unused)))
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_coll_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_coll_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -291,7 +291,7 @@ int MPID_nem_coll_init(void)
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_COLL_INIT);
     return mpi_errno;
  fn_oom: /* out-of-memory handler for utarray operations */
-    MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "utarray");
+    MPIR_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "utarray");
  fn_fail:
     goto fn_exit;
 }
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c b/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
index 0729e00..e5b35d7 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
@@ -14,7 +14,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_SendNoncontig
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* MPIDI_CH3I_SendNoncontig - Sends a message by packing
    directly into cells.  The caller must initialize sreq->dev.segment
    as well as segment_first and segment_size. */
@@ -29,7 +29,7 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
 
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)header);
 
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     if (!MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq)) /* MT */
     {
@@ -45,7 +45,7 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
 
         MPIDI_CH3I_Sendq_enqueue(&MPIDI_CH3I_shm_sendq, sreq);
         mpi_errno = MPIDI_CH3I_Shm_send_progress();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
@@ -81,7 +81,7 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
         MPIU_Assert(MPIDI_Request_get_type(sreq) != MPIDI_REQUEST_TYPE_GET_RESP);
         mpi_errno = MPID_Request_complete(sreq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
         MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, ".... complete %d bytes", (int) (sreq->dev.segment_size));
     }
@@ -89,14 +89,14 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
     {
         int complete = 0;
         mpi_errno = sreq->dev.OnDataAvail(vc, sreq, &complete);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPIU_Assert(complete); /* all data has been sent, we should always complete */
 
         MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, ".... complete %d bytes", (int) (sreq->dev.segment_size));
     }
 
  fn_exit:
-    MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SENDNONCONTIG);
     return mpi_errno;
  fn_fail:
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_alloc.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_alloc.c
index 778298c..ae85cb1 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_alloc.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_alloc.c
@@ -69,7 +69,7 @@ static asym_check_region* asym_check_region_p = NULL;
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Seg_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Seg_alloc(size_t len, void **ptr_p)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -122,7 +122,7 @@ int MPIDI_CH3I_Seg_alloc(size_t len, void **ptr_p)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Seg_commit
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Seg_commit(MPID_nem_seg_ptr_t memory, int num_local, int local_rank)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -153,10 +153,10 @@ int MPIDI_CH3I_Seg_commit(MPID_nem_seg_ptr_t memory, int num_local, int local_ra
 
     /* allocate an area to check if the segment was allocated symmetrically */
     mpi_errno = MPIDI_CH3I_Seg_alloc(sizeof(asym_check_region), (void **)&asym_check_region_p);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIU_SHMW_Hnd_init(&(memory->hnd));
-    if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno != MPI_SUCCESS) MPIR_ERR_POP (mpi_errno);
 
     /* Shared memory barrier variables are in the front of the shared
        memory region.  We do this here explicitly, rather than use the
@@ -204,33 +204,33 @@ int MPIDI_CH3I_Seg_commit(MPID_nem_seg_ptr_t memory, int num_local, int local_ra
 #ifdef OPA_USE_LOCK_BASED_PRIMITIVES
         ipc_lock = (OPA_emulation_ipl_t *)((char *)memory->base_addr + ipc_lock_offset);
         ret = OPA_Interprocess_lock_init(ipc_lock, TRUE/*isLeader*/);
-        MPIU_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
+        MPIR_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
 #endif
 
         mpi_errno = MPID_nem_barrier_init((MPID_nem_barrier_t *)memory->base_addr, TRUE);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
 
         if (local_rank == 0) {
             mpi_errno = MPIU_SHMW_Seg_create_and_attach(memory->hnd, memory->segment_len, &(memory->base_addr), 0);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             /* post name of shared file */
             MPIU_Assert (MPID_nem_mem_region.local_procs[0] == MPID_nem_mem_region.rank);
 
             mpi_errno = MPIU_SHMW_Hnd_get_serialized_by_ref(memory->hnd, &serialized_hnd);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             /* must come before barrier_init since we use OPA in that function */
 #ifdef OPA_USE_LOCK_BASED_PRIMITIVES
             ipc_lock = (OPA_emulation_ipl_t *)((char *)memory->base_addr + ipc_lock_offset);
             ret = OPA_Interprocess_lock_init(ipc_lock, local_rank == 0);
-            MPIU_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
+            MPIR_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
 #endif
 
             mpi_errno = MPID_nem_barrier_init((MPID_nem_barrier_t *)memory->base_addr, TRUE);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             /* The opa and nem barrier initializations must come before we (the
              * leader) put the sharedFilename attribute.  Since this is a
@@ -238,7 +238,7 @@ int MPIDI_CH3I_Seg_commit(MPID_nem_seg_ptr_t memory, int num_local, int local_ra
              * ensures that these initializations have occurred before any peer
              * attempts to use the resources. */
             mpi_errno = PMI2_Info_PutNodeAttr("sharedFilename", serialized_hnd);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         } else {
             int found = FALSE;
 
@@ -247,20 +247,20 @@ int MPIDI_CH3I_Seg_commit(MPID_nem_seg_ptr_t memory, int num_local, int local_ra
 
             /* get name of shared file */
             mpi_errno = PMI2_Info_GetNodeAttr("sharedFilename", val, PMI2_MAX_VALLEN, &found, TRUE);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKINTERNAL(!found, mpi_errno, "nodeattr not found");
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+            MPIR_ERR_CHKINTERNAL(!found, mpi_errno, "nodeattr not found");
 
             mpi_errno = MPIU_SHMW_Hnd_deserialize(memory->hnd, val, strlen(val));
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             mpi_errno = MPIU_SHMW_Seg_attach(memory->hnd, memory->segment_len, (char **)&memory->base_addr, 0);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             /* must come before barrier_init since we use OPA in that function */
 #ifdef OPA_USE_LOCK_BASED_PRIMITIVES
             ipc_lock = (OPA_emulation_ipl_t *)((char *)memory->base_addr + ipc_lock_offset);
             ret = OPA_Interprocess_lock_init(ipc_lock, local_rank == 0);
-            MPIU_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
+            MPIR_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
 
             /* Right now we rely on the assumption that OPA_Interprocess_lock_init only
              * needs to be called by the leader and the current process before use by the
@@ -271,15 +271,15 @@ int MPIDI_CH3I_Seg_commit(MPID_nem_seg_ptr_t memory, int num_local, int local_ra
 #endif
 
             mpi_errno = MPID_nem_barrier_init((MPID_nem_barrier_t *)memory->base_addr, FALSE);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         mpi_errno = MPID_nem_barrier();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (local_rank == 0) {
             mpi_errno = MPIU_SHMW_Seg_remove(memory->hnd);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
         current_addr = memory->base_addr;
         memory->symmetrical = 0 ;
@@ -298,94 +298,94 @@ int MPIDI_CH3I_Seg_commit(MPID_nem_seg_ptr_t memory, int num_local, int local_ra
 
         /* we still need to call barrier */
 	pmi_errno = PMI_Barrier();
-        MPIU_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_barrier", "**pmi_barrier %d", pmi_errno);
+        MPIR_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_barrier", "**pmi_barrier %d", pmi_errno);
 
         /* must come before barrier_init since we use OPA in that function */
 #ifdef OPA_USE_LOCK_BASED_PRIMITIVES
         ipc_lock = (OPA_emulation_ipl_t *)((char *)memory->base_addr + ipc_lock_offset);
         ret = OPA_Interprocess_lock_init(ipc_lock, TRUE/*isLeader*/);
-        MPIU_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
+        MPIR_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
 #endif
         mpi_errno = MPID_nem_barrier_init((MPID_nem_barrier_t *)memory->base_addr, TRUE);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else{
         /* Allocate space for pmi key and val */
         pmi_errno = PMI_KVS_Get_key_length_max(&key_max_sz);
-        MPIU_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
+        MPIR_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
         MPIU_CHKLMEM_MALLOC(key, char *, key_max_sz, mpi_errno, "key");
 
         pmi_errno = PMI_KVS_Get_value_length_max(&val_max_sz);
-        MPIU_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
+        MPIR_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
         MPIU_CHKLMEM_MALLOC(val, char *, val_max_sz, mpi_errno, "val");
 
         mpi_errno = MPIDI_PG_GetConnKVSname (&kvs_name);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
         if (local_rank == 0){
             mpi_errno = MPIU_SHMW_Seg_create_and_attach(memory->hnd, memory->segment_len, &(memory->base_addr), 0);
-            if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP (mpi_errno);
+            if (mpi_errno != MPI_SUCCESS) MPIR_ERR_POP (mpi_errno);
 
             /* post name of shared file */
             MPIU_Assert (MPID_nem_mem_region.local_procs[0] == MPID_nem_mem_region.rank);
             MPL_snprintf (key, key_max_sz, "sharedFilename[%i]", MPID_nem_mem_region.rank);
 
             mpi_errno = MPIU_SHMW_Hnd_get_serialized_by_ref(memory->hnd, &serialized_hnd);
-            if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP (mpi_errno);
+            if (mpi_errno != MPI_SUCCESS) MPIR_ERR_POP (mpi_errno);
 
             pmi_errno = PMI_KVS_Put (kvs_name, key, serialized_hnd);
-            MPIU_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_put", "**pmi_kvs_put %d", pmi_errno);
+            MPIR_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_put", "**pmi_kvs_put %d", pmi_errno);
 
             pmi_errno = PMI_KVS_Commit (kvs_name);
-            MPIU_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_commit", "**pmi_kvs_commit %d", pmi_errno);
+            MPIR_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_commit", "**pmi_kvs_commit %d", pmi_errno);
 
             /* must come before barrier_init since we use OPA in that function */
 #ifdef OPA_USE_LOCK_BASED_PRIMITIVES
             ipc_lock = (OPA_emulation_ipl_t *)((char *)memory->base_addr + ipc_lock_offset);
             ret = OPA_Interprocess_lock_init(ipc_lock, local_rank == 0);
-            MPIU_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
+            MPIR_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
 #endif
 
             mpi_errno = MPID_nem_barrier_init((MPID_nem_barrier_t *)memory->base_addr, TRUE);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             pmi_errno = PMI_Barrier();
-            MPIU_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_barrier", "**pmi_barrier %d", pmi_errno);
+            MPIR_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_barrier", "**pmi_barrier %d", pmi_errno);
         }
         else
         {
             pmi_errno = PMI_Barrier();
-            MPIU_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_barrier", "**pmi_barrier %d", pmi_errno);
+            MPIR_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_barrier", "**pmi_barrier %d", pmi_errno);
 
             /* get name of shared file */
             MPL_snprintf (key, key_max_sz, "sharedFilename[%i]", MPID_nem_mem_region.local_procs[0]);
             pmi_errno = PMI_KVS_Get (kvs_name, key, val, val_max_sz);
-            MPIU_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get", "**pmi_kvs_get %d", pmi_errno);
+            MPIR_ERR_CHKANDJUMP1 (pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get", "**pmi_kvs_get %d", pmi_errno);
 
             mpi_errno = MPIU_SHMW_Hnd_deserialize(memory->hnd, val, strlen(val));
-            if(mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
+            if(mpi_errno != MPI_SUCCESS) MPIR_ERR_POP(mpi_errno);
 
             mpi_errno = MPIU_SHMW_Seg_attach(memory->hnd, memory->segment_len, (char **)&memory->base_addr, 0);
-            if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
             /* must come before barrier_init since we use OPA in that function */
 #ifdef OPA_USE_LOCK_BASED_PRIMITIVES
             ipc_lock = (OPA_emulation_ipl_t *)((char *)memory->base_addr + ipc_lock_offset);
             ret = OPA_Interprocess_lock_init(ipc_lock, local_rank == 0);
-            MPIU_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
+            MPIR_ERR_CHKANDJUMP1(ret != 0, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", ret);
 #endif
 
             mpi_errno = MPID_nem_barrier_init((MPID_nem_barrier_t *)memory->base_addr, FALSE);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         mpi_errno = MPID_nem_barrier();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
         if (local_rank == 0)
         {
             mpi_errno = MPIU_SHMW_Seg_remove(memory->hnd);
-            if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP (mpi_errno);
+            if (mpi_errno != MPI_SUCCESS) MPIR_ERR_POP (mpi_errno);
         }
         current_addr = memory->base_addr;
         memory->symmetrical = 0 ;
@@ -426,7 +426,7 @@ int MPIDI_CH3I_Seg_commit(MPID_nem_seg_ptr_t memory, int num_local, int local_ra
     while (!ALLOCQ_EMPTY());
 
     mpi_errno = check_alloc(num_local, local_rank);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     MPIU_CHKPMEM_COMMIT();
  fn_exit:
@@ -446,7 +446,7 @@ int MPIDI_CH3I_Seg_commit(MPID_nem_seg_ptr_t memory, int num_local, int local_ra
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Seg_destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Seg_destroy(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -460,7 +460,7 @@ int MPIDI_CH3I_Seg_destroy(void)
     {
         mpi_errno = MPIU_SHMW_Seg_detach(MPID_nem_mem_region.memory.hnd, 
                         &(MPID_nem_mem_region.memory.base_addr), MPID_nem_mem_region.memory.segment_len);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     }
 
  fn_exit:
@@ -477,7 +477,7 @@ int MPIDI_CH3I_Seg_destroy(void)
 #undef FUNCNAME
 #define FUNCNAME check_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int check_alloc(int num_local, int local_rank)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -491,7 +491,7 @@ static int check_alloc(int num_local, int local_rank)
     }
 
     mpi_errno = MPID_nem_barrier();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (asym_check_region_p->base_ptr != MPID_nem_mem_region.memory.base_addr)
         OPA_store_int(&asym_check_region_p->is_asym, 1);
@@ -499,14 +499,14 @@ static int check_alloc(int num_local, int local_rank)
     OPA_read_write_barrier();
 
     mpi_errno = MPID_nem_barrier();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (OPA_load_int(&asym_check_region_p->is_asym))
     {
 	MPID_nem_mem_region.memory.symmetrical = 0;
 	MPID_nem_asymm_base_addr = MPID_nem_mem_region.memory.base_addr;
 #ifdef MPID_NEM_SYMMETRIC_QUEUES
-        MPIU_ERR_INTERNALANDJUMP(mpi_errno, "queues are not symmetrically allocated as expected");
+        MPIR_ERR_INTERNALANDJUMP(mpi_errno, "queues are not symmetrically allocated as expected");
 #endif
     }
     else
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_barrier.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_barrier.c
index f2f170d..5b2e09b 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_barrier.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_barrier.c
@@ -13,7 +13,7 @@ static int barrier_init = 0;
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_barrier_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_barrier_init(MPID_nem_barrier_t *barrier_region, int init_values)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_BARRIER_INIT);
@@ -37,7 +37,7 @@ int MPID_nem_barrier_init(MPID_nem_barrier_t *barrier_region, int init_values)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_barrier
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* FIXME: this is not a scalable algorithm because everyone is polling on the same cacheline */
 int MPID_nem_barrier(void)
 {
@@ -49,7 +49,7 @@ int MPID_nem_barrier(void)
     if (MPID_nem_mem_region.num_local == 1)
         goto fn_exit;
 
-    MPIU_ERR_CHKINTERNAL(!barrier_init, mpi_errno, "barrier not initialized");
+    MPIR_ERR_CHKINTERNAL(!barrier_init, mpi_errno, "barrier not initialized");
 
     if (OPA_fetch_and_incr_int(&MPID_nem_mem_region.barrier->val) == MPID_nem_mem_region.num_local - 1)
     {
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_ckpt.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_ckpt.c
index 4cbab6c..94332d1 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_ckpt.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_ckpt.c
@@ -23,7 +23,7 @@ cvars:
 === END_MPI_T_CVAR_INFO_BLOCK ===
 */
 
-MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
+MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 #ifdef ENABLE_CHECKPOINTING
 
@@ -152,7 +152,7 @@ static int ckpt_cb(void *arg)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_nem_ckpt_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_nem_ckpt_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -167,18 +167,18 @@ int MPIDI_nem_ckpt_init(void)
         goto fn_exit;
     
     client_id = cr_init();
-    MPIU_ERR_CHKANDJUMP(client_id < 0 && errno == ENOSYS, mpi_errno, MPI_ERR_OTHER, "**blcr_mod");
+    MPIR_ERR_CHKANDJUMP(client_id < 0 && errno == ENOSYS, mpi_errno, MPI_ERR_OTHER, "**blcr_mod");
 
     cb_id = cr_register_callback(ckpt_cb, NULL, CR_THREAD_CONTEXT);
-    MPIU_ERR_CHKANDJUMP1(cb_id == -1, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(cb_id == -1, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", MPIU_Strerror(errno));
     
     checkpointing = FALSE;
     current_wave = 0;
 
     ret = sem_init(&ckpt_sem, 0, 0);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_init", "**sem_init %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_init", "**sem_init %s", MPIU_Strerror(errno));
     ret = sem_init(&cont_sem, 0, 0);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_init", "**sem_init %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_init", "**sem_init %s", MPIU_Strerror(errno));
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_NEM_CKPT_INIT);
@@ -190,7 +190,7 @@ int MPIDI_nem_ckpt_init(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_nem_ckpt_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_nem_ckpt_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -200,9 +200,9 @@ int MPIDI_nem_ckpt_finalize(void)
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_NEM_CKPT_FINALIZE);
 
     ret = sem_destroy(&ckpt_sem);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_destroy", "**sem_destroy %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_destroy", "**sem_destroy %s", MPIU_Strerror(errno));
     ret = sem_destroy(&cont_sem);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_destroy", "**sem_destroy %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_destroy", "**sem_destroy %s", MPIU_Strerror(errno));
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_NEM_CKPT_FINALIZE);
@@ -214,7 +214,7 @@ int MPIDI_nem_ckpt_finalize(void)
 #undef FUNCNAME
 #define FUNCNAME reinit_pmi
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int reinit_pmi(void)
 {
     int ret;
@@ -272,7 +272,7 @@ static int reinit_pmi(void)
 #undef FUNCNAME
 #define FUNCNAME restore_env
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int restore_env(pid_t parent_pid, int rank)
 {
     FILE *f;
@@ -316,7 +316,7 @@ typedef struct sock_ident {
 #undef FUNCNAME
 #define FUNCNAME open_io_socket
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int open_io_socket(socktype_t socktype, int rank, int dupfd)
 {
     int fd;
@@ -379,7 +379,7 @@ fn_exit:
 #undef FUNCNAME
 #define FUNCNAME restore_stdinouterr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int restore_stdinouterr(int rank)
 {
     int ret;
@@ -404,7 +404,7 @@ static int restore_stdinouterr(int rank)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_nem_ckpt_start
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_nem_ckpt_start(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -441,16 +441,16 @@ int MPIDI_nem_ckpt_start(void)
         ckpt_pkt->wave = current_wave;
         
         mpi_errno = MPIDI_CH3_iStartMsg(vc, ckpt_pkt, sizeof(ckpt_pkt), &req);
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ckptpkt");
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ckptpkt");
         if (req != NULL)
         {
-            MPIU_ERR_CHKANDJUMP(req->status.MPI_ERROR, mpi_errno, MPI_ERR_OTHER, "**ckptpkt");
+            MPIR_ERR_CHKANDJUMP(req->status.MPI_ERROR, mpi_errno, MPI_ERR_OTHER, "**ckptpkt");
             MPID_Request_release(req);
         }
 
         if (!vc_ch->is_local) {
             mpi_errno = vc_ch->ckpt_pause_send_vc(vc);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
     
@@ -466,7 +466,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_nem_ckpt_finish
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_nem_ckpt_finish(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -481,20 +481,20 @@ int MPIDI_nem_ckpt_finish(void)
        channels, just make sure no one is sending or receiving during
        the checkpoint */
     mpi_errno = MPID_nem_barrier();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     do {
         ret = sem_post(&ckpt_sem);
     } while (ret == -1 && errno == EINTR);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_post", "**sem_post %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_post", "**sem_post %s", MPIU_Strerror(errno));
 
     do {
         ret = sem_wait(&cont_sem);
     } while (ret == -1 && errno == EINTR);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_wait", "**sem_wait %s", MPIU_Strerror(errno));
+    MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**sem_wait", "**sem_wait %s", MPIU_Strerror(errno));
 
     mpi_errno = MPID_nem_barrier();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (ckpt_result == CKPT_CONTINUE) {
         for (i = 0; i < MPIDI_Process.my_pg->size; ++i) {
@@ -508,7 +508,7 @@ int MPIDI_nem_ckpt_finish(void)
             vc_ch = &vc->ch;
             if (!vc_ch->is_local) {
                 mpi_errno = vc_ch->ckpt_continue_vc(vc);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -527,7 +527,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME pkt_ckpt_marker_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int pkt_ckpt_marker_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t *buflen, MPID_Request **req)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -538,7 +538,7 @@ static int pkt_ckpt_marker_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_m
 
     if (!checkpointing) {
         mpi_errno = MPIDI_nem_ckpt_start();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     MPIU_Assert(current_wave == ckpt_pkt->wave);
@@ -570,7 +570,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ckpt_pkthandler_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_nem_ckpt_pkthandler_init(MPIDI_CH3_PktHandler_Fcn *pktArray[], int arraySize)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -580,7 +580,7 @@ int MPIDI_nem_ckpt_pkthandler_init(MPIDI_CH3_PktHandler_Fcn *pktArray[], int arr
 
     /* Check that the array is large enough */
     if (arraySize <= MPIDI_CH3_PKT_END_ALL) {
-	MPIU_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_INTERN, "**ch3|pktarraytoosmall");
+	MPIR_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_INTERN, "**ch3|pktarraytoosmall");
     }
 
     pktArray[MPIDI_NEM_PKT_CKPT_MARKER] = pkt_ckpt_marker_handler;
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c
index d27417e..735a47a 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c
@@ -11,7 +11,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_dbg_dump_cell
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPID_nem_dbg_dump_cell (volatile struct MPID_nem_cell *cell)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_DBG_DUMP_CELL);
@@ -56,7 +56,7 @@ void MPID_nem_dbg_print_vc_sendq(FILE *stream, MPIDI_VC_t *vc);
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_dbg_print_all_sendq
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPID_nem_dbg_print_vc_sendq(FILE *stream, MPIDI_VC_t *vc)
 {
     MPID_Request * sreq;
@@ -104,7 +104,7 @@ void MPID_nem_dbg_print_all_sendq(FILE *stream);
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_dbg_print_all_sendq
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPID_nem_dbg_print_all_sendq(FILE *stream)
 {
     int i;
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_finalize.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_finalize.c
index d81833d..24575ff 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_finalize.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_finalize.c
@@ -15,7 +15,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -47,11 +47,11 @@ int MPID_nem_finalize(void)
 #endif /* MEM_REGION_IN_HEAP */
 
     mpi_errno = MPID_nem_netmod_func->finalize();
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
     /* free the shared memory segment */
     mpi_errno = MPIDI_CH3I_Seg_destroy();
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
 #ifdef PAPI_MONITOR
     my_papi_close();
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
index 29ba22c..2a00df4 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
@@ -82,7 +82,7 @@ unsigned long long *MPID_nem_fbox_fall_back_to_queue_count = NULL;
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_init_stats
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPID_nem_init_stats(int n_local_ranks)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -114,7 +114,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_init(int pg_rank, MPIDI_PG_t *pg_p, int has_parent ATTRIBUTE((unused)))
 {
@@ -159,16 +159,16 @@ MPID_nem_init(int pg_rank, MPIDI_PG_t *pg_p, int has_parent ATTRIBUTE((unused)))
 
     /* Initialize the business card */
     mpi_errno = MPIDI_CH3I_BCInit( &bc_val, &val_max_remaining );
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     publish_bc_orig = bc_val;
 
     ret = gethostname (MPID_nem_hostname, MAX_HOSTNAME_LEN);
-    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**sock_gethost", "**sock_gethost %s %d", MPIU_Strerror (errno), errno);
+    MPIR_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**sock_gethost", "**sock_gethost %s %d", MPIU_Strerror (errno), errno);
 
     MPID_nem_hostname[MAX_HOSTNAME_LEN-1] = '\0';
 
     mpi_errno = get_local_procs(pg_p, pg_rank, &num_local, &local_procs, &local_rank);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 #ifdef MEM_REGION_IN_HEAP
     MPIU_CHKPMEM_MALLOC (MPID_nem_mem_region_ptr, MPID_nem_mem_region_t *, sizeof(MPID_nem_mem_region_t), mpi_errno, "mem_region");
@@ -219,7 +219,7 @@ MPID_nem_init(int pg_rank, MPIDI_PG_t *pg_p, int has_parent ATTRIBUTE((unused)))
 	char *base_addr;
 
         mpi_errno = MPIU_SHMW_Hnd_init(&handle);
-        if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
         mpi_errno = MPIU_SHMW_Seg_create_and_attach(handle, size, &base_addr, 0);
         /* --BEGIN ERROR HANDLING-- */
@@ -227,7 +227,7 @@ MPID_nem_init(int pg_rank, MPIDI_PG_t *pg_p, int has_parent ATTRIBUTE((unused)))
         {
             MPIU_SHMW_Seg_remove(handle);
             MPIU_SHMW_Hnd_finalize(&handle);
-            MPIU_ERR_POP (mpi_errno);
+            MPIR_ERR_POP (mpi_errno);
         }
         /* --END ERROR HANDLING-- */
 
@@ -236,7 +236,7 @@ MPID_nem_init(int pg_rank, MPIDI_PG_t *pg_p, int has_parent ATTRIBUTE((unused)))
         if (mpi_errno)
         {
             MPIU_SHMW_Hnd_finalize(&handle);
-            MPIU_ERR_POP (mpi_errno);
+            MPIR_ERR_POP (mpi_errno);
         }
         /* --END ERROR HANDLING-- */
 
@@ -248,36 +248,36 @@ MPID_nem_init(int pg_rank, MPIDI_PG_t *pg_p, int has_parent ATTRIBUTE((unused)))
     /* Request fastboxes region */
     mpi_errno = MPIDI_CH3I_Seg_alloc(MAX((num_local*((num_local-1)*sizeof(MPID_nem_fastbox_t))), MPID_NEM_ASYMM_NULL_VAL),
                                      (void **)&fastboxes_p);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     /* Request data cells region */
     mpi_errno = MPIDI_CH3I_Seg_alloc(num_local * MPID_NEM_NUM_CELLS * sizeof(MPID_nem_cell_t), (void **)&cells_p);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Request free q region */
     mpi_errno = MPIDI_CH3I_Seg_alloc(num_local * sizeof(MPID_nem_queue_t), (void **)&free_queues_p);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Request recv q region */
     mpi_errno = MPIDI_CH3I_Seg_alloc(num_local * sizeof(MPID_nem_queue_t), (void **)&recv_queues_p);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Request shared collectives barrier vars region */
     mpi_errno = MPIDI_CH3I_Seg_alloc(MPID_NEM_NUM_BARRIER_VARS * sizeof(MPID_nem_barrier_vars_t),
                                      (void **)&MPID_nem_mem_region.barrier_vars);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Actually allocate the segment and assign regions to the pointers */
     mpi_errno = MPIDI_CH3I_Seg_commit(&MPID_nem_mem_region.memory, num_local, local_rank);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
     /* init shared collectives barrier region */
     mpi_errno = MPID_nem_barrier_vars_init(MPID_nem_mem_region.barrier_vars);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
     /* local procs barrier */
     mpi_errno = MPID_nem_barrier();
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
     /* find our cell region */
     MPID_nem_mem_region.Elements = cells_p[local_rank];
@@ -302,28 +302,28 @@ MPID_nem_init(int pg_rank, MPIDI_PG_t *pg_p, int has_parent ATTRIBUTE((unused)))
     }
 
     mpi_errno = MPID_nem_coll_init();
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     
     /* This must be done before initializing the netmod so that the nemesis
        communicator creation hooks get registered (and therefore called) before
        the netmod hooks, giving the netmod an opportunity to override the
        nemesis collective function table. */
     mpi_errno = MPIDI_CH3U_Comm_register_create_hook(MPIDI_CH3I_comm_create, NULL);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* network init */
     if (MPID_nem_num_netmods)
     {
         mpi_errno = MPID_nem_choose_netmod();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	mpi_errno = MPID_nem_netmod_func->init(pg_p, pg_rank, &bc_val, &val_max_remaining);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* Register detroy hooks after netmod init so the netmod hooks get called
        before nemesis hooks. */
     mpi_errno = MPIDI_CH3U_Comm_register_destroy_hook(MPIDI_CH3I_comm_destroy, NULL);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     /* set default route for external processes through network */
     for (idx = 0 ; idx < MPID_nem_mem_region.ext_procs ; idx++)
@@ -352,7 +352,7 @@ MPID_nem_init(int pg_rank, MPIDI_PG_t *pg_p, int has_parent ATTRIBUTE((unused)))
     
     /* local barrier */
     mpi_errno = MPID_nem_barrier();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     
     /* Allocate table of pointers to fastboxes */
@@ -398,19 +398,19 @@ MPID_nem_init(int pg_rank, MPIDI_PG_t *pg_p, int has_parent ATTRIBUTE((unused)))
 
     /* publish business card */
     mpi_errno = MPIDI_PG_SetConnInfo(pg_rank, (const char *)publish_bc_orig);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Free(publish_bc_orig);
 
 
     mpi_errno = MPID_nem_barrier();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_nem_mpich_init();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     mpi_errno = MPID_nem_barrier();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 #ifdef ENABLE_CHECKPOINTING
     mpi_errno = MPIDI_nem_ckpt_init();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 #endif
 
 #ifdef PAPI_MONITOR
@@ -434,7 +434,7 @@ MPID_nem_init(int pg_rank, MPIDI_PG_t *pg_p, int has_parent ATTRIBUTE((unused)))
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_vc_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_vc_init (MPIDI_VC_t *vc)
 {
@@ -478,7 +478,7 @@ MPID_nem_vc_init (MPIDI_VC_t *vc)
     /* MT we acquire the LMT CS here, b/c there is at least a theoretical race
      * on some fields, such as lmt_copy_buf.  In practice it's not an issue, but
      * this will keep DRD happy. */
-    MPIU_THREAD_CS_ENTER(LMT,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     /* override rendezvous functions */
     vc->rndvSend_fn = MPID_nem_lmt_RndvSend;
@@ -537,9 +537,9 @@ MPID_nem_vc_init (MPIDI_VC_t *vc)
 
         vc_ch->lmt_copy_buf        = NULL;
         mpi_errno = MPIU_SHMW_Hnd_init(&(vc_ch->lmt_copy_buf_handle));
-        if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
         mpi_errno = MPIU_SHMW_Hnd_init(&(vc_ch->lmt_recv_copy_buf_handle));
-        if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
         vc_ch->lmt_queue.head      = NULL;
         vc_ch->lmt_queue.tail      = NULL;
         vc_ch->lmt_active_lmt      = NULL;
@@ -589,7 +589,7 @@ MPID_nem_vc_init (MPIDI_VC_t *vc)
                              ));
         
         mpi_errno = MPID_nem_netmod_func->vc_init(vc);
-	if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+	if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 /* FIXME: DARIUS -- enable this assert once these functions are implemented */
 /*         /\* iStartContigMsg iSendContig and sendNoncontig_fn must */
@@ -599,7 +599,7 @@ MPID_nem_vc_init (MPIDI_VC_t *vc)
 
     }
 
-    MPIU_THREAD_CS_EXIT(LMT,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
 
     /* FIXME: ch3 assumes there is a field called sendq_head in the ch
        portion of the vc.  This is unused in nemesis and should be set
@@ -618,7 +618,7 @@ MPID_nem_vc_init (MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_vc_destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_vc_destroy(MPIDI_VC_t *vc)
 {
@@ -631,7 +631,7 @@ MPID_nem_vc_destroy(MPIDI_VC_t *vc)
     MPIU_Free(vc_ch->pending_pkt);
 
     mpi_errno = MPID_nem_netmod_func->vc_destroy(vc);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_VC_DESTROY);
@@ -665,7 +665,7 @@ int MPID_nem_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc)
 #undef FUNCNAME
 #define FUNCNAME get_local_procs
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int get_local_procs(MPIDI_PG_t *pg, int our_pg_rank, int *num_local_p,
                            int **local_procs_p, int *local_rank_p)
 {
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 cc25615..ce6da0c 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
@@ -52,7 +52,7 @@ static int pkt_COOKIE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_pkthandler_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_pkthandler_init(MPIDI_CH3_PktHandler_Fcn *pktArray[], int arraySize)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -62,7 +62,7 @@ int MPID_nem_lmt_pkthandler_init(MPIDI_CH3_PktHandler_Fcn *pktArray[], int array
 
     /* Check that the array is large enough */
     if (arraySize <= MPIDI_CH3_PKT_END_ALL) {
-	MPIU_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_INTERN, "**ch3|pktarraytoosmall");
+	MPIR_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_INTERN, "**ch3|pktarraytoosmall");
     }
 
     pktArray[MPIDI_NEM_PKT_LMT_RTS] = pkt_RTS_handler;
@@ -81,7 +81,7 @@ int MPID_nem_lmt_pkthandler_init(MPIDI_CH3_PktHandler_Fcn *pktArray[], int array
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_RndvSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_RndvSend(MPID_Request **sreq_p, const void * buf, MPI_Aint count,
                           MPI_Datatype datatype, int dt_contig ATTRIBUTE((unused)),
                           MPIDI_msg_sz_t data_sz, MPI_Aint dt_true_lb ATTRIBUTE((unused)),
@@ -101,7 +101,7 @@ int MPID_nem_lmt_RndvSend(MPID_Request **sreq_p, const void * buf, MPI_Aint coun
     if (vc->ch.lmt_initiate_lmt == NULL)
     {
         mpi_errno = MPIDI_CH3_RndvSend(sreq_p, buf, count, datatype, dt_contig, data_sz, dt_true_lb, rank, tag, comm, context_offset);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
@@ -122,14 +122,14 @@ int MPID_nem_lmt_RndvSend(MPID_Request **sreq_p, const void * buf, MPI_Aint coun
     MPIDI_Request_set_seqnum(sreq, seqnum);
     sreq->ch.vc = vc;
 
-    MPIU_THREAD_CS_ENTER(LMT,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
     mpi_errno = vc->ch.lmt_initiate_lmt(vc, &upkt.p, sreq);
     if (MPIR_CVAR_ENABLE_FT) {
         if (MPI_SUCCESS == mpi_errno)
             MPID_nem_lmt_rtsq_enqueue(&vc->ch.lmt_rts_queue, sreq);
     }
-    MPIU_THREAD_CS_EXIT(LMT,);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LMT_RNDVSEND);
@@ -145,7 +145,7 @@ int MPID_nem_lmt_RndvSend(MPID_Request **sreq_p, const void * buf, MPI_Aint coun
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_RndvRecv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_RndvRecv(MPIDI_VC_t *vc, MPID_Request *rreq)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -158,14 +158,14 @@ int MPID_nem_lmt_RndvRecv(MPIDI_VC_t *vc, MPID_Request *rreq)
     if (vc->ch.lmt_initiate_lmt == NULL)
     {
         mpi_errno = MPIDI_CH3_RecvRndv(vc, rreq);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
     MPIU_DBG_MSG(CH3_OTHER,VERBOSE, "lmt RTS in the request");
 
     mpi_errno = do_cts(vc, rreq, &complete);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIU_Assert(complete);
 
@@ -179,7 +179,7 @@ int MPID_nem_lmt_RndvRecv(MPIDI_VC_t *vc, MPID_Request *rreq)
 #undef FUNCNAME
 #define FUNCNAME pkt_RTS_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t *buflen, MPID_Request **rreqp)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -193,14 +193,14 @@ 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);
 
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.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,
                                         rts_pkt->data_sz));
 
     rreq = MPIDI_CH3U_Recvq_FDP_or_AEU(&rts_pkt->match, &found);
-    MPIU_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
+    MPIR_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
 
     /* If the completion counter is 0, that means that the communicator to
      * which this message is being sent has been revoked and we shouldn't
@@ -274,7 +274,7 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
             int complete;
             MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"posted request found");
             mpi_errno = do_cts(vc, rreq, &complete);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPIU_Assert(complete);
         }
         else
@@ -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:
-    MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_PKT_RTS_HANDLER);
     return mpi_errno;
  fn_fail:
@@ -300,7 +300,7 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
 #undef FUNCNAME
 #define FUNCNAME pkt_CTS_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int pkt_CTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t *buflen, MPID_Request **rreqp)
 {
     MPID_nem_pkt_lmt_cts_t * const cts_pkt = (MPID_nem_pkt_lmt_cts_t *)pkt;
@@ -321,12 +321,12 @@ static int pkt_CTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
 
     MPID_Request_get_ptr(cts_pkt->sender_req_id, sreq);
 
-    MPIU_THREAD_CS_ENTER(LMT,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
     if (MPIR_CVAR_ENABLE_FT) {
         /* Remove the request from the VC RTS queue. */
         MPID_nem_lmt_rtsq_search_remove(&vc->ch.lmt_rts_queue, cts_pkt->sender_req_id, &rts_sreq);
     }
-    MPIU_THREAD_CS_EXIT(LMT,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
 
     sreq->ch.lmt_req_id = cts_pkt->receiver_req_id;
     sreq->ch.lmt_data_sz = cts_pkt->data_sz;
@@ -348,10 +348,10 @@ static int pkt_CTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
             /* if whole cookie has been received, start the send */
             sreq->ch.lmt_tmp_cookie.MPL_IOV_BUF = data_buf;
             sreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = cts_pkt->cookie_len;
-            MPIU_THREAD_CS_ENTER(LMT,);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
             mpi_errno = vc->ch.lmt_start_send(vc, sreq, sreq->ch.lmt_tmp_cookie);
-            MPIU_THREAD_CS_EXIT(LMT,);
-            if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+            if (mpi_errno) MPIR_ERR_POP (mpi_errno);
             sreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = 0;
             *buflen = sizeof(MPIDI_CH3_Pkt_t) + cts_pkt->cookie_len;
             *rreqp = NULL;
@@ -378,10 +378,10 @@ static int pkt_CTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
     else
     {
         MPL_IOV cookie = {0,0};
-        MPIU_THREAD_CS_ENTER(LMT,);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
         mpi_errno = vc->ch.lmt_start_send(vc, sreq, cookie);
-        MPIU_THREAD_CS_EXIT(LMT,);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
         *rreqp = NULL;
     }
@@ -398,7 +398,7 @@ static int pkt_CTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
 #undef FUNCNAME
 #define FUNCNAME pkt_DONE_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int pkt_DONE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t *buflen, MPID_Request **rreqp)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -411,30 +411,30 @@ static int pkt_DONE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
     MPID_Request_get_ptr(done_pkt->req_id, req);
 
-    MPIU_THREAD_CS_ENTER(LMT,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     switch (MPIDI_Request_get_type(req))
     {
     case MPIDI_REQUEST_TYPE_RECV:
         mpi_errno = vc->ch.lmt_done_recv(vc, req);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         break;
     case MPIDI_REQUEST_TYPE_SEND:
     case MPIDI_REQUEST_TYPE_RSEND:
     case MPIDI_REQUEST_TYPE_SSEND:
     case MPIDI_REQUEST_TYPE_BSEND:
         mpi_errno = vc->ch.lmt_done_send(vc, req);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         break;
     default:
-        MPIU_ERR_INTERNALANDJUMP(mpi_errno, "unexpected request type");
+        MPIR_ERR_INTERNALANDJUMP(mpi_errno, "unexpected request type");
         break;
     }
 
     *rreqp = NULL;
 
  fn_exit:
-    MPIU_THREAD_CS_EXIT(LMT,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_PKT_DONE_HANDLER);
     return mpi_errno;
  fn_fail:
@@ -444,7 +444,7 @@ static int pkt_DONE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
 #undef FUNCNAME
 #define FUNCNAME pkt_COOKIE_handler
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int pkt_COOKIE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t *buflen, MPID_Request **rreqp)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -480,10 +480,10 @@ static int pkt_COOKIE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz
 
             cookie.MPL_IOV_BUF = data_buf;
             cookie.MPL_IOV_LEN = cookie_pkt->cookie_len;
-            MPIU_THREAD_CS_ENTER(LMT,);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
             mpi_errno = vc->ch.lmt_handle_cookie(vc, req, cookie);
-            MPIU_THREAD_CS_EXIT(LMT,);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             *rreqp = NULL;
             *buflen = sizeof(MPIDI_CH3_Pkt_t) + cookie_pkt->cookie_len;
@@ -510,10 +510,10 @@ static int pkt_COOKIE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz
     {
         MPL_IOV cookie = {0,0};
 
-        MPIU_THREAD_CS_ENTER(LMT,);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
         mpi_errno = vc->ch.lmt_handle_cookie(vc, req, cookie);
-        MPIU_THREAD_CS_EXIT(LMT,);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
         *rreqp = NULL;
     }
@@ -531,7 +531,7 @@ static int pkt_COOKIE_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz
 #undef FUNCNAME
 #define FUNCNAME do_cts
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int do_cts(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -550,16 +550,16 @@ static int do_cts(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
     MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
     if (rreq->ch.lmt_data_sz > data_sz)
     {
-        MPIU_ERR_SET2(rreq->status.MPI_ERROR, MPI_ERR_TRUNCATE, "**truncate", "**truncate %d %d", rreq->ch.lmt_data_sz, data_sz);
+        MPIR_ERR_SET2(rreq->status.MPI_ERROR, MPI_ERR_TRUNCATE, "**truncate", "**truncate %d %d", rreq->ch.lmt_data_sz, data_sz);
         rreq->ch.lmt_data_sz = data_sz;
     }
 
     s_cookie = rreq->ch.lmt_tmp_cookie;
 
-    MPIU_THREAD_CS_ENTER(LMT,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
     mpi_errno = vc->ch.lmt_start_recv(vc, rreq, s_cookie);
-    MPIU_THREAD_CS_EXIT(LMT,);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* free cookie buffer allocated in RTS handler */
     if (rreq->ch.lmt_tmp_cookie.MPL_IOV_LEN)
@@ -580,7 +580,7 @@ static int do_cts(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 #undef FUNCNAME
 #define FUNCNAME do_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int do_send(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -592,10 +592,10 @@ static int do_send(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 
     r_cookie = sreq->ch.lmt_tmp_cookie;
 
-    MPIU_THREAD_CS_ENTER(LMT,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
     mpi_errno = vc->ch.lmt_start_send(vc, sreq, r_cookie);
-    MPIU_THREAD_CS_EXIT(LMT,);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* free cookie buffer allocated in CTS handler */
     MPIU_Free(sreq->ch.lmt_tmp_cookie.MPL_IOV_BUF);
@@ -613,7 +613,7 @@ static int do_send(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 #undef FUNCNAME
 #define FUNCNAME do_cookie
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int do_cookie(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -625,10 +625,10 @@ static int do_cookie(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 
     cookie = req->ch.lmt_tmp_cookie;
 
-    MPIU_THREAD_CS_ENTER(LMT,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
     mpi_errno = vc->ch.lmt_handle_cookie(vc, req, cookie);
-    MPIU_THREAD_CS_EXIT(LMT,);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
     /* free cookie buffer allocated in COOKIE handler */
     MPIU_Free(req->ch.lmt_tmp_cookie.MPL_IOV_BUF);
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_dma.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_dma.c
index 3cfd400..217f78c 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_dma.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_dma.c
@@ -24,7 +24,7 @@ cvars:
 === END_MPI_T_CVAR_INFO_BLOCK ===
 */
 
-MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
+MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 #if defined(HAVE_KNEM_IO_H)
 
@@ -77,7 +77,7 @@ static void free_status_index(int index)
 #undef FUNCNAME
 #define FUNCNAME open_knem_dev
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int open_knem_dev(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -86,19 +86,19 @@ static int open_knem_dev(void)
     struct knem_cmd_info info;
 
     knem_fd = open(KNEM_DEVICE_FILENAME, O_RDWR);
-    MPIU_ERR_CHKANDJUMP2(knem_fd < 0, mpi_errno, MPI_ERR_OTHER, "**shm_open",
+    MPIR_ERR_CHKANDJUMP2(knem_fd < 0, mpi_errno, MPI_ERR_OTHER, "**shm_open",
                          "**shm_open %s %d", KNEM_DEVICE_FILENAME, errno);
     err = ioctl(knem_fd, KNEM_CMD_GET_INFO, &info);
-    MPIU_ERR_CHKANDJUMP2(err < 0, mpi_errno, MPI_ERR_OTHER, "**ioctl",
+    MPIR_ERR_CHKANDJUMP2(err < 0, mpi_errno, MPI_ERR_OTHER, "**ioctl",
                          "**ioctl %d %s", errno, MPIU_Strerror(errno));
-    MPIU_ERR_CHKANDJUMP2(info.abi != KNEM_ABI_VERSION, mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP2(info.abi != KNEM_ABI_VERSION, mpi_errno, MPI_ERR_OTHER,
                          "**abi_version_mismatch", "**abi_version_mismatch %D %D",
                          (unsigned long)KNEM_ABI_VERSION, (unsigned long)info.abi);
 
     knem_has_dma = (info.features & KNEM_FEATURE_DMA);
 
     knem_status = mmap(NULL, KNEM_STATUS_NR, PROT_READ|PROT_WRITE, MAP_SHARED, knem_fd, KNEM_STATUS_ARRAY_FILE_OFFSET);
-    MPIU_ERR_CHKANDJUMP1(knem_status == MAP_FAILED, mpi_errno, MPI_ERR_OTHER, "**mmap",
+    MPIR_ERR_CHKANDJUMP1(knem_status == MAP_FAILED, mpi_errno, MPI_ERR_OTHER, "**mmap",
                          "**mmap %d", errno);
     for (i = 0; i < KNEM_STATUS_NR; ++i) {
         index_stack[i] = i;
@@ -112,7 +112,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME do_dma_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int do_dma_send(MPIDI_VC_t *vc,  MPID_Request *sreq, int send_iov_n,
                        MPL_IOV send_iov[], knem_cookie_t *s_cookiep)
 {
@@ -146,7 +146,7 @@ static int do_dma_send(MPIDI_VC_t *vc,  MPID_Request *sreq, int send_iov_n,
     cr.protection = PROT_READ;
     err = ioctl(knem_fd, KNEM_CMD_CREATE_REGION, &cr);
 #endif
-    MPIU_ERR_CHKANDJUMP2(err < 0, mpi_errno, MPI_ERR_OTHER, "**ioctl",
+    MPIR_ERR_CHKANDJUMP2(err < 0, mpi_errno, MPI_ERR_OTHER, "**ioctl",
                          "**ioctl %d %s", errno, MPIU_Strerror(errno));
 #if KNEM_ABI_VERSION < MPICH_NEW_KNEM_ABI_VERSION
     *s_cookiep = sendcmd.send_cookie;
@@ -163,7 +163,7 @@ fn_exit:
 #undef FUNCNAME
 #define FUNCNAME do_dma_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int do_dma_recv(int iov_n, MPL_IOV iov[], knem_cookie_t s_cookie, int nodma, volatile knem_status_t **status_p_p, knem_status_t *current_status_p)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -202,7 +202,7 @@ static int do_dma_recv(int iov_n, MPL_IOV iov[], knem_cookie_t s_cookie, int nod
     icopy.flags = nodma ? 0 : KNEM_FLAG_DMA | KNEM_FLAG_ASYNCDMACOMPLETE;
     err = ioctl(knem_fd, KNEM_CMD_INLINE_COPY, &icopy);
 #endif
-    MPIU_ERR_CHKANDJUMP2(err < 0, mpi_errno, MPI_ERR_OTHER, "**ioctl",
+    MPIR_ERR_CHKANDJUMP2(err < 0, mpi_errno, MPI_ERR_OTHER, "**ioctl",
                          "**ioctl %d %s", errno, MPIU_Strerror(errno));
 
 #if KNEM_ABI_VERSION < MPICH_NEW_KNEM_ABI_VERSION
@@ -227,7 +227,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME send_sreq_data
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int send_sreq_data(MPIDI_VC_t *vc, MPID_Request *sreq, knem_cookie_t *s_cookiep)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -239,7 +239,7 @@ static int send_sreq_data(MPIDI_VC_t *vc, MPID_Request *sreq, knem_cookie_t *s_c
     /* MT: this code assumes only one thread can be at this point at a time */
     if (knem_fd < 0) {
         mpi_errno = open_knem_dev();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* find out contig/noncontig, size, and lb for the datatype */
@@ -262,7 +262,7 @@ static int send_sreq_data(MPIDI_VC_t *vc, MPID_Request *sreq, knem_cookie_t *s_c
                many-part message that we couldn't fit in one single flight of
                iovs. */
             sreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno,
+            MPIR_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno,
                                  MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPID_Segment_alloc");
             MPID_Segment_init(sreq->dev.user_buf, sreq->dev.user_count,
@@ -276,12 +276,12 @@ static int send_sreq_data(MPIDI_VC_t *vc, MPID_Request *sreq, knem_cookie_t *s_c
                larger than MPL_IOV_LIMIT. */
             mpi_errno = MPIDI_CH3U_Request_load_send_iov(sreq, &sreq->dev.iov[0],
                                                          &sreq->dev.iov_count);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
     mpi_errno = do_dma_send(vc, sreq, sreq->dev.iov_count, sreq->dev.iov, s_cookiep);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
@@ -292,7 +292,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME check_req_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int check_req_complete(MPIDI_VC_t *vc, MPID_Request *req, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -301,13 +301,13 @@ static inline int check_req_complete(MPIDI_VC_t *vc, MPID_Request *req, int *com
     if (reqFn) {
         *complete = 0;
         mpi_errno = reqFn(vc, req, complete);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         *complete = 1;
         mpi_errno = MPID_Request_complete(req);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -319,7 +319,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_dma_initiate_lmt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_dma_initiate_lmt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPID_Request *sreq)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -332,7 +332,7 @@ int MPID_nem_lmt_dma_initiate_lmt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPID_Req
     MPIU_CHKPMEM_MALLOC(sreq->ch.s_cookie, knem_cookie_t *, sizeof(knem_cookie_t), mpi_errno, "s_cookie");
 
     mpi_errno = send_sreq_data(vc, sreq, sreq->ch.s_cookie);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPID_nem_lmt_send_RTS(vc, rts_pkt, sreq->ch.s_cookie, sizeof(knem_cookie_t));
 
 fn_exit:
@@ -350,7 +350,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_dma_start_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_dma_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV s_cookie)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -369,7 +369,7 @@ int MPID_nem_lmt_dma_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV s_co
     /* MT: this code assumes only one thread can be at this point at a time */
     if (knem_fd < 0) {
         mpi_errno = open_knem_dev();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* find out contig/noncontig, size, and lb for the datatype */
@@ -391,7 +391,7 @@ int MPID_nem_lmt_dma_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV s_co
                iovs. */
             MPIU_Assert(rreq->dev.segment_ptr == NULL);
             rreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno,
+            MPIR_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno,
                                  MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPID_Segment_alloc");
             MPID_Segment_init(rreq->dev.user_buf, rreq->dev.user_count,
@@ -401,7 +401,7 @@ int MPID_nem_lmt_dma_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV s_co
 
             /* see load_send_iov FIXME above */
             mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -410,7 +410,7 @@ int MPID_nem_lmt_dma_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV s_co
     mpi_errno = do_dma_recv(rreq->dev.iov_count, rreq->dev.iov,
                             *((knem_cookie_t *)s_cookie.MPL_IOV_BUF), nodma,
                             &status, &current_status);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* TODO refactor this block and MPID_nem_lmt_dma_progress (and anywhere
      * else) to share a common function.  This advancement/completion code is
@@ -419,11 +419,11 @@ int MPID_nem_lmt_dma_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV s_co
         /* complete the request if all data has been sent, remove it from the list */
         int complete = 0;
 
-        MPIU_ERR_CHKANDJUMP1(current_status == KNEM_STATUS_FAILED, mpi_errno, MPI_ERR_OTHER,
+        MPIR_ERR_CHKANDJUMP1(current_status == KNEM_STATUS_FAILED, mpi_errno, MPI_ERR_OTHER,
                              "**recv_status", "**recv_status %d", current_status);
 
         mpi_errno = check_req_complete(vc, rreq, &complete);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         free_status_index(status - knem_status);
 
@@ -461,7 +461,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_dma_done_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_dma_done_send(MPIDI_VC_t *vc, MPID_Request *sreq)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -483,7 +483,7 @@ int MPID_nem_lmt_dma_done_send(MPIDI_VC_t *vc, MPID_Request *sreq)
     if (!reqFn) {
         mpi_errno = MPID_Request_complete(sreq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
         MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
         goto fn_exit;
@@ -491,7 +491,7 @@ int MPID_nem_lmt_dma_done_send(MPIDI_VC_t *vc, MPID_Request *sreq)
 
     complete = 0;
     mpi_errno = reqFn(vc, sreq, &complete);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         
     if (complete) {
         /* request was completed by the OnDataAvail fn */
@@ -514,7 +514,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_dma_handle_cookie
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_dma_handle_cookie(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV cookie)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -531,21 +531,21 @@ int MPID_nem_lmt_dma_handle_cookie(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV co
 
         /* This function will invoke the OnDataAvail function to load more data. */
         mpi_errno = check_req_complete(vc, req, &complete);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         /* If we were complete we should have received a DONE message instead
            of a COOKIE message. */
         MPIU_Assert(!complete);
 
         mpi_errno = do_dma_send(vc, req, req->dev.iov_count, &req->dev.iov[0], &s_cookie);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPID_nem_lmt_send_COOKIE(vc, req, &s_cookie, sizeof(knem_cookie_t));
     }
     else {
         /* req is a receive request and we need to continue receiving using the
            lid provided in the cookie iov. */
         mpi_errno = MPID_nem_lmt_dma_start_recv(vc, req, cookie);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_fail:
@@ -556,7 +556,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_dma_progress
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_dma_progress(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -577,7 +577,7 @@ int MPID_nem_lmt_dma_progress(void)
                     /* complete the request if all data has been sent, remove it from the list */
                     int complete = 0;
                     mpi_errno = check_req_complete(cur->vc, cur->req, &complete);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
                     free_status_index(cur->status_p - knem_status);
 
@@ -615,11 +615,11 @@ int MPID_nem_lmt_dma_progress(void)
             case KNEM_STATUS_FAILED:
                 /* set the error status for the request, complete it then dequeue the entry */
                 cur->req->status.MPI_ERROR = MPI_SUCCESS;
-                MPIU_ERR_SET1(cur->req->status.MPI_ERROR, MPI_ERR_OTHER, "**recv_status", "**recv_status %d", *cur->status_p);
+                MPIR_ERR_SET1(cur->req->status.MPI_ERROR, MPI_ERR_OTHER, "**recv_status", "**recv_status %d", *cur->status_p);
 
                 mpi_errno = MPID_Request_complete(cur->req);
                 if (mpi_errno != MPI_SUCCESS) {
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 }
 
                 if (cur == outstanding_head) {
@@ -643,7 +643,7 @@ int MPID_nem_lmt_dma_progress(void)
                 /* nothing to do here */
                 break;
             default:
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**invalid_knem_status",
+                MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**invalid_knem_status",
                                      "**invalid_knem_status %d", *cur->status_p);
                 break;
         }
@@ -662,7 +662,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_dma_vc_terminated
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_dma_vc_terminated(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -688,7 +688,7 @@ int MPID_nem_lmt_dma_vc_terminated(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_dma_start_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_dma_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_cookie)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -704,7 +704,7 @@ int MPID_nem_lmt_dma_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_coo
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_dma_done_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_dma_done_recv(MPIDI_VC_t *vc, MPID_Request *rreq)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LMT_DMA_DONE_RECV);
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c
index b28e4a6..0c799ef 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c
@@ -5,6 +5,7 @@
  */
 
 #include "mpid_nem_impl.h"
+#include "mpid_nem_inline.h"
 #include "mpid_nem_datatypes.h"
 
 #include "mpiu_os_wrappers.h"
@@ -118,7 +119,7 @@ static int MPID_nem_delete_shm_region(MPID_nem_copy_buf_t **buf, MPIU_SHMW_Hnd_t
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_shm_initiate_lmt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_shm_initiate_lmt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPID_Request *req)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -159,7 +160,7 @@ int MPID_nem_lmt_shm_initiate_lmt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPID_Req
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_shm_start_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_shm_start_recv(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV s_cookie)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -177,7 +178,7 @@ int MPID_nem_lmt_shm_start_recv(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV s_coo
     {
         int i;
         mpi_errno = MPID_nem_allocate_shm_region(&vc_ch->lmt_copy_buf, vc_ch->lmt_copy_buf_handle);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         vc_ch->lmt_copy_buf->sender_present.val   = 0;
         vc_ch->lmt_copy_buf->receiver_present.val = 0;
@@ -192,7 +193,7 @@ int MPID_nem_lmt_shm_start_recv(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV s_coo
 
     /* send CTS with handle for copy buffer */
     mpi_errno = MPIU_SHMW_Hnd_get_serialized_by_ref((vc_ch->lmt_copy_buf_handle), &ser_lmt_copy_buf_handle);
-    if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
     
     MPID_nem_lmt_send_CTS(vc, req, ser_lmt_copy_buf_handle, (int)strlen(ser_lmt_copy_buf_handle) + 1);
 
@@ -205,7 +206,7 @@ int MPID_nem_lmt_shm_start_recv(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV s_coo
 
     /* make progress on that vc */
     mpi_errno = lmt_shm_progress_vc(vc, &done);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* MT: not thread safe, another thread may have enqueued another
        lmt after we did, and added this vc to the progress list.  In
@@ -239,7 +240,7 @@ int MPID_nem_lmt_shm_start_recv(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV s_coo
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_shm_start_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_shm_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_cookie)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -254,32 +255,32 @@ int MPID_nem_lmt_shm_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_coo
 
     if (vc_ch->lmt_copy_buf == NULL){
         mpi_errno = MPIU_SHMW_Hnd_deserialize(vc_ch->lmt_copy_buf_handle, r_cookie.MPL_IOV_BUF, strlen(r_cookie.MPL_IOV_BUF));
-        if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
         mpi_errno = MPID_nem_attach_shm_region(&vc_ch->lmt_copy_buf, vc_ch->lmt_copy_buf_handle);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "attached to remote copy_buf");
     }
     else{
         char *ser_lmt_copy_buf_handle=NULL;
         mpi_errno = MPIU_SHMW_Hnd_get_serialized_by_ref(vc_ch->lmt_copy_buf_handle, &ser_lmt_copy_buf_handle);
-        if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
         if (strncmp(ser_lmt_copy_buf_handle, r_cookie.MPL_IOV_BUF, r_cookie.MPL_IOV_LEN) < 0){
             /* Each side allocated its own buffer, lexicographically lower valued buffer handle is deleted */
             mpi_errno = MPID_nem_delete_shm_region(&(vc_ch->lmt_copy_buf), &(vc_ch->lmt_copy_buf_handle));
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             vc_ch->lmt_copy_buf = NULL;
 
             /* The shared memory handle is not valid any more -- so get a new shm handle */
             mpi_errno = MPIU_SHMW_Hnd_init(&vc_ch->lmt_copy_buf_handle);
-            if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+            if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
             mpi_errno = MPIU_SHMW_Hnd_deserialize(vc_ch->lmt_copy_buf_handle, r_cookie.MPL_IOV_BUF, strlen(r_cookie.MPL_IOV_BUF));
-            if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+            if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
             mpi_errno = MPID_nem_attach_shm_region(&vc_ch->lmt_copy_buf, vc_ch->lmt_copy_buf_handle);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             LMT_SHM_Q_ENQUEUE_AT_HEAD(&vc_ch->lmt_queue, vc_ch->lmt_active_lmt); /* MT: not thread safe */
             vc_ch->lmt_active_lmt = NULL;
@@ -297,7 +298,7 @@ int MPID_nem_lmt_shm_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_coo
 
     /* make progress on that vc */
     mpi_errno = lmt_shm_progress_vc(vc, &done);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* MT: not thread safe, another thread may have enqueued another
        lmt after we did, and added this vc to the progress list.  In
@@ -330,7 +331,7 @@ int MPID_nem_lmt_shm_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_coo
 #undef FUNCNAME
 #define FUNCNAME get_next_req
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int get_next_req(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -414,7 +415,7 @@ static int get_next_req(MPIDI_VC_t *vc)
            This can happen if both sides allocated copy buffers, and
            we decided to use the remote side's buffer. */
         req->dev.segment_ptr = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP1((req->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+        MPIR_ERR_CHKANDJUMP1((req->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
         MPID_Segment_init(req->dev.user_buf, req->dev.user_count, req->dev.datatype, req->dev.segment_ptr, 0);
         req->dev.segment_first = 0;
     }
@@ -438,7 +439,7 @@ static int get_next_req(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME lmt_shm_send_progress
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -506,7 +507,7 @@ static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
     *done = TRUE;
     mpi_errno = MPID_Request_complete(req);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
     MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "completed req local_req=%d", req->handle);
 
@@ -530,7 +531,7 @@ static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
 #undef FUNCNAME
 #define FUNCNAME lmt_shm_recv_progress
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -650,7 +651,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
     *done = TRUE;
     mpi_errno = MPID_Request_complete(req);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -664,7 +665,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_shm_handle_cookie
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_shm_handle_cookie(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV cookie)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LMT_SHM_HANDLE_COOKIE);
@@ -678,7 +679,7 @@ int MPID_nem_lmt_shm_handle_cookie(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV co
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_shm_done_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_shm_done_send(MPIDI_VC_t *vc, MPID_Request *req)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LMT_SHM_DONE_SEND);
@@ -692,7 +693,7 @@ int MPID_nem_lmt_shm_done_send(MPIDI_VC_t *vc, MPID_Request *req)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_shm_done_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_shm_done_recv(MPIDI_VC_t *vc, MPID_Request *req)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LMT_SHM_DONE_RECV);
@@ -706,7 +707,7 @@ int MPID_nem_lmt_shm_done_recv(MPIDI_VC_t *vc, MPID_Request *req)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_shm_progress_vc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int lmt_shm_progress_vc(MPIDI_VC_t *vc, int *done)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -722,7 +723,7 @@ static inline int lmt_shm_progress_vc(MPIDI_VC_t *vc, int *done)
     if (vc_ch->lmt_active_lmt == NULL)
     {
         mpi_errno = get_next_req(vc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (vc_ch->lmt_active_lmt == NULL)
         {
@@ -737,7 +738,7 @@ static inline int lmt_shm_progress_vc(MPIDI_VC_t *vc, int *done)
 
     we = vc_ch->lmt_active_lmt;
     mpi_errno = we->progress(vc, we->req, &done_req);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (done_req)
     {
@@ -758,7 +759,7 @@ static inline int lmt_shm_progress_vc(MPIDI_VC_t *vc, int *done)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_shm_progress
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_shm_progress(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -774,7 +775,7 @@ int MPID_nem_lmt_shm_progress(void)
         int done = FALSE;
 
         mpi_errno = lmt_shm_progress_vc(pe->vc, &done);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (done)
         {
@@ -806,7 +807,7 @@ int MPID_nem_lmt_shm_progress(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_shm_vc_terminated
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_shm_vc_terminated(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -819,18 +820,18 @@ int MPID_nem_lmt_shm_vc_terminated(MPIDI_VC_t *vc)
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LMT_SHM_VC_TERMINATED);
 
     if (vc->state != MPIDI_VC_STATE_CLOSED) {
-        MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+        MPIR_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
     }
 
     /* If there is anything in the RTS queue, it needs to be cleared out. */
     if (MPIR_CVAR_ENABLE_FT) {
-        MPIU_THREAD_CS_ENTER(LMT,);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
         while (!MPID_nem_lmt_rtsq_empty(vc_ch->lmt_rts_queue)) {
             MPID_nem_lmt_rtsq_dequeue(&vc_ch->lmt_rts_queue, &req);
             req->status.MPI_ERROR = req_errno;
             MPID_Request_complete(req);
         }
-        MPIU_THREAD_CS_EXIT(LMT,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     }
 
     /* We empty the vc queue, but don't remove the vc from the global
@@ -867,7 +868,7 @@ int MPID_nem_lmt_shm_vc_terminated(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_allocate_shm_region
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPID_nem_allocate_shm_region(MPID_nem_copy_buf_t **buf_p, MPIU_SHMW_Hnd_t handle)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -882,7 +883,7 @@ static int MPID_nem_allocate_shm_region(MPID_nem_copy_buf_t **buf_p, MPIU_SHMW_H
     }
 
     mpi_errno = MPIU_SHMW_Seg_create_and_attach(handle, sizeof(MPID_nem_copy_buf_t), (char **)buf_p, 0);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_ALLOCATE_SHM_REGION);
@@ -894,7 +895,7 @@ static int MPID_nem_allocate_shm_region(MPID_nem_copy_buf_t **buf_p, MPIU_SHMW_H
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_attach_shm_region
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPID_nem_attach_shm_region(MPID_nem_copy_buf_t **buf_p, MPIU_SHMW_Hnd_t handle)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -909,10 +910,10 @@ static int MPID_nem_attach_shm_region(MPID_nem_copy_buf_t **buf_p, MPIU_SHMW_Hnd
     }
 
     mpi_errno = MPIU_SHMW_Seg_attach(handle, sizeof(MPID_nem_copy_buf_t), (char **)buf_p, 0);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIU_SHMW_Seg_remove(handle);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_ATTACH_SHM_REGION);
@@ -924,7 +925,7 @@ static int MPID_nem_attach_shm_region(MPID_nem_copy_buf_t **buf_p, MPIU_SHMW_Hnd
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_detach_shm_region
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPID_nem_detach_shm_region(MPID_nem_copy_buf_t **buf_p, MPIU_SHMW_Hnd_t handle)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -933,7 +934,7 @@ static int MPID_nem_detach_shm_region(MPID_nem_copy_buf_t **buf_p, MPIU_SHMW_Hnd
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_DETACH_SHM_REGION);
 
     mpi_errno = MPIU_SHMW_Seg_detach(handle, (char **)buf_p, sizeof(MPID_nem_copy_buf_t));
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_DETACH_SHM_REGION);
@@ -945,7 +946,7 @@ static int MPID_nem_detach_shm_region(MPID_nem_copy_buf_t **buf_p, MPIU_SHMW_Hnd
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_delete_shm_region
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPID_nem_delete_shm_region(MPID_nem_copy_buf_t **buf_p, MPIU_SHMW_Hnd_t *handle_p)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -954,13 +955,13 @@ static int MPID_nem_delete_shm_region(MPID_nem_copy_buf_t **buf_p, MPIU_SHMW_Hnd
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_DELETE_SHM_REGION);
 
     mpi_errno = MPIU_SHMW_Seg_remove(*handle_p);
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
     mpi_errno = MPID_nem_detach_shm_region(buf_p, *handle_p); 
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
     mpi_errno = MPIU_SHMW_Hnd_finalize(handle_p);
-    if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_DELETE_SHM_REGION);
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_vmsplice.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_vmsplice.c
index 33b1add..8a582f2 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_vmsplice.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_vmsplice.c
@@ -6,7 +6,7 @@
 #include "mpid_nem_impl.h"
 #include "mpid_nem_datatypes.h"
 
-MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
+MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 #if defined(HAVE_VMSPLICE)
 
@@ -71,13 +71,13 @@ static inline int check_req_complete(MPIDI_VC_t *vc, MPID_Request *req, int *com
         req->dev.iov_offset = 0;
 
         mpi_errno = reqFn(vc, req, complete);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
         *complete = 1;
         mpi_errno = MPID_Request_complete(req);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -114,7 +114,7 @@ static int populate_iov_from_req(MPID_Request *req)
 
         /* XXX DJG FIXME where is this segment freed? */
         req->dev.segment_ptr = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP1((req->dev.segment_ptr == NULL), mpi_errno,
+        MPIR_ERR_CHKANDJUMP1((req->dev.segment_ptr == NULL), mpi_errno,
                              MPI_ERR_OTHER, "**nomem",
                              "**nomem %s", "MPID_Segment_alloc");
         MPID_Segment_init(req->dev.user_buf, req->dev.user_count,
@@ -128,7 +128,7 @@ static int populate_iov_from_req(MPID_Request *req)
            larger than MPL_IOV_LIMIT. */
         mpi_errno = MPIDI_CH3U_Request_load_send_iov(req, &req->dev.iov[0],
                                                      &req->dev.iov_count);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
 fn_fail:
@@ -149,7 +149,7 @@ static int do_vmsplice(MPID_Request *sreq, int pipe_fd, MPL_IOV iov[],
 
     if (err < 0) {
         if (errno == EAGAIN) goto fn_exit;
-        MPIU_ERR_CHKANDJUMP2(errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**vmsplice",
+        MPIR_ERR_CHKANDJUMP2(errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**vmsplice",
                              "**vmsplice %d %s", errno, MPIU_Strerror(errno));
     }
 
@@ -157,11 +157,11 @@ static int do_vmsplice(MPID_Request *sreq, int pipe_fd, MPL_IOV iov[],
     if (*complete) {
         /* look for additional data to send and reload IOV if there is more */
         mpi_errno = check_req_complete(sreq->ch.vc, sreq, complete);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (*complete) {
             err = close(pipe_fd);
-            MPIU_ERR_CHKANDJUMP(err < 0, mpi_errno, MPI_ERR_OTHER, "**close");
+            MPIR_ERR_CHKANDJUMP(err < 0, mpi_errno, MPI_ERR_OTHER, "**close");
             MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
         }
     }
@@ -174,7 +174,7 @@ fn_exit:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_vmsplice_initiate_lmt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_vmsplice_initiate_lmt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPID_Request *sreq)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -192,7 +192,7 @@ int MPID_nem_lmt_vmsplice_initiate_lmt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPI
         MPIDI_CH3I_VC *vc_ch = &vc->ch;
 
         pipe_name = tempnam(NULL, "lmt_");
-        MPIU_ERR_CHKANDJUMP2(!pipe_name, mpi_errno, MPI_ERR_OTHER, "**tempnam",
+        MPIR_ERR_CHKANDJUMP2(!pipe_name, mpi_errno, MPI_ERR_OTHER, "**tempnam",
                              "**tempnam %d %s", errno, MPIU_Strerror(errno));
 
         vc_ch->lmt_copy_buf_handle = MPIU_Strdup(pipe_name);
@@ -201,7 +201,7 @@ int MPID_nem_lmt_vmsplice_initiate_lmt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPI
         free(pipe_name);
 
         err = mkfifo(vc_ch->lmt_copy_buf_handle, 0660);
-        MPIU_ERR_CHKANDJUMP2(err < 0, mpi_errno, MPI_ERR_OTHER, "**mkfifo",
+        MPIR_ERR_CHKANDJUMP2(err < 0, mpi_errno, MPI_ERR_OTHER, "**mkfifo",
                              "**mkfifo %d %s", errno, MPIU_Strerror(errno));
     }
 
@@ -223,12 +223,12 @@ static int do_readv(MPID_Request *rreq, int pipe_fd, MPL_IOV iov[],
     ssize_t nread;
 
     nread = readv(pipe_fd, &rreq->dev.iov[rreq->dev.iov_offset], rreq->dev.iov_count);
-    MPIU_ERR_CHKANDJUMP2(nread < 0 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read",
+    MPIR_ERR_CHKANDJUMP2(nread < 0 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read",
                          "**readv %d %s", errno, MPIU_Strerror(errno));
 
     if (nread < 0) {
         if (errno == EAGAIN) goto fn_exit;
-        MPIU_ERR_CHKANDJUMP2(errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**vmsplice",
+        MPIR_ERR_CHKANDJUMP2(errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**vmsplice",
                              "**vmsplice %d %s", errno, MPIU_Strerror(errno));
     }
 
@@ -236,11 +236,11 @@ static int do_readv(MPID_Request *rreq, int pipe_fd, MPL_IOV iov[],
     if (*complete) {
         /* look for additional data to send and reload IOV if there is more */
         mpi_errno = check_req_complete(rreq->ch.vc, rreq, complete);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (*complete) {
             nread = close(pipe_fd);
-            MPIU_ERR_CHKANDJUMP(nread < 0, mpi_errno, MPI_ERR_OTHER, "**close");
+            MPIR_ERR_CHKANDJUMP(nread < 0, mpi_errno, MPI_ERR_OTHER, "**close");
             MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
         }
     }
@@ -254,7 +254,7 @@ fn_exit:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_vmsplice_start_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_vmsplice_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV s_cookie)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -275,13 +275,13 @@ int MPID_nem_lmt_vmsplice_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV
     /* XXX DJG FIXME in a real version we would want to cache the fd on the vc
        so that we don't have two open's on the critical path every time. */
     pipe_fd = open(vc_ch->lmt_recv_copy_buf_handle, O_NONBLOCK|O_RDONLY);
-    MPIU_ERR_CHKANDJUMP1(pipe_fd < 0, mpi_errno, MPI_ERR_OTHER, "**open",
+    MPIR_ERR_CHKANDJUMP1(pipe_fd < 0, mpi_errno, MPI_ERR_OTHER, "**open",
                          "**open %s", MPIU_Strerror(errno));
 
     MPID_nem_lmt_send_CTS(vc, rreq, NULL, 0);
 
     mpi_errno = populate_iov_from_req(rreq);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = do_readv(rreq, pipe_fd, rreq->dev.iov, &rreq->dev.iov_offset,
                          &rreq->dev.iov_count, &complete);
@@ -325,17 +325,17 @@ int MPID_nem_lmt_vmsplice_progress(void)
                                      &cur->req->dev.iov_offset,
                                      &cur->req->dev.iov_count, &complete);
                 /* FIXME: set the error status of the req and complete it, rather than POP */
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 break;
             case MPIDI_REQUEST_TYPE_SEND:
                 mpi_errno = do_vmsplice(cur->req, cur->pipe_fd, cur->req->dev.iov,
                                         &cur->req->dev.iov_offset,
                                         &cur->req->dev.iov_count, &complete);
                 /* FIXME: set the error status of the req and complete it, rather than POP */
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 break;
             default:
-                MPIU_ERR_INTERNALANDJUMP(mpi_errno, "unexpected request type");
+                MPIR_ERR_INTERNALANDJUMP(mpi_errno, "unexpected request type");
                 break;
         }
 
@@ -376,7 +376,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_vmsplice_start_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_vmsplice_start_send(MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV r_cookie)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -393,18 +393,18 @@ int MPID_nem_lmt_vmsplice_start_send(MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV
        will error out with ENXIO.  This will be indicated by the receipt of a
        CTS message. */
     pipe_fd = open(vc_ch->lmt_copy_buf_handle, O_NONBLOCK|O_WRONLY);
-    MPIU_ERR_CHKANDJUMP1(pipe_fd < 0, mpi_errno, MPI_ERR_OTHER, "**open",
+    MPIR_ERR_CHKANDJUMP1(pipe_fd < 0, mpi_errno, MPI_ERR_OTHER, "**open",
                          "**open %s", MPIU_Strerror(errno));
 
     mpi_errno = populate_iov_from_req(sreq);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* send the first flight */
     sreq->ch.vc = vc; /* XXX DJG is this already assigned? */
     complete = 0;
     mpi_errno = do_vmsplice(sreq, pipe_fd, sreq->dev.iov,
                             &sreq->dev.iov_offset, &sreq->dev.iov_count, &complete);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (!complete) {
         /* push for later progress */
@@ -425,7 +425,7 @@ fn_exit:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_MPID_nem_lmt_vmsplice_vc_terminated
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_MPID_nem_lmt_vmsplice_vc_terminated(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -454,7 +454,7 @@ int MPIDI_CH3_MPID_nem_lmt_vmsplice_vc_terminated(MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_vmsplice_done_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_vmsplice_done_recv(MPIDI_VC_t *vc, MPID_Request *rreq)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LMT_VMSPLICE_DONE_RECV);
@@ -470,7 +470,7 @@ int MPID_nem_lmt_vmsplice_done_recv(MPIDI_VC_t *vc, MPID_Request *rreq)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_vmsplice_done_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_vmsplice_done_send(MPIDI_VC_t *vc, MPID_Request *sreq)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -488,7 +488,7 @@ int MPID_nem_lmt_vmsplice_done_send(MPIDI_VC_t *vc, MPID_Request *sreq)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_lmt_vmsplice_handle_cookie
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_lmt_vmsplice_handle_cookie(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV cookie)
 {
     int mpi_errno = MPI_SUCCESS;
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich.c
index 085c518..cea3ef7 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich.c
@@ -26,7 +26,7 @@ unsigned short *MPID_nem_recv_seqno = 0;
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_init(void)
 {
@@ -78,7 +78,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_send_iov
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_send_iov(MPIDI_VC_t *vc, MPID_Request **sreq_ptr, MPL_IOV *iov, int n_iov)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -132,7 +132,7 @@ int MPID_nem_send_iov(MPIDI_VC_t *vc, MPID_Request **sreq_ptr, MPL_IOV *iov, int
     }
 
     mpi_errno = vc->ch.iSendContig(vc, sreq, iov[0].MPL_IOV_BUF, iov[0].MPL_IOV_LEN, sreq->dev.tmpbuf, data_sz);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     *sreq_ptr = sreq;
 
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich_rma.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich_rma.c
index 8fb96c1..876575e 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich_rma.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich_rma.c
@@ -14,7 +14,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_alloc_win
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_alloc_win (void **buf, int len, MPID_nem_mpich_win_t **win)
 {
@@ -27,7 +27,7 @@ MPID_nem_mpich_alloc_win (void **buf, int len, MPID_nem_mpich_win_t **win)
     MPIU_CHKPMEM_MALLOC (*win, MPID_nem_mpich_win_t *, sizeof (MPID_nem_mpich_win_t), mpi_errno, "rma win object");
 
     mpi_errno = MPID_nem_allocate_shared_memory ((char **)buf, len, &(*win)->handle);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
     (*win)->proc = MPID_nem_mem_region.rank;
     (*win)->home_address = *buf;
@@ -46,7 +46,7 @@ MPID_nem_mpich_alloc_win (void **buf, int len, MPID_nem_mpich_win_t **win)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_free_win
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_free_win (MPID_nem_mpich_win_t *win)
 {
@@ -58,10 +58,10 @@ MPID_nem_mpich_free_win (MPID_nem_mpich_win_t *win)
     MPIU_Assert (win->proc == MPID_nem_mem_region.rank);
 
     mpi_errno = MPID_nem_remove_shared_memory (win->handle);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
     mpi_errno = MPID_nem_detach_shared_memory (win->home_address, win->len);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
     MPIU_Free (win->handle);
     MPIU_Free (win);
@@ -76,7 +76,7 @@ MPID_nem_mpich_free_win (MPID_nem_mpich_win_t *win)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_attach_win
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_attach_win (void **buf, MPID_nem_mpich_win_t *remote_win)
 {
@@ -93,7 +93,7 @@ MPID_nem_mpich_attach_win (void **buf, MPID_nem_mpich_win_t *remote_win)
     else
     {
         mpi_errno = MPID_nem_attach_shared_memory ((char **)buf, remote_win->len, remote_win->handle);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     }
 
     remote_win->local_address = *buf;
@@ -108,7 +108,7 @@ MPID_nem_mpich_attach_win (void **buf, MPID_nem_mpich_win_t *remote_win)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_detach_win
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_detach_win (MPID_nem_mpich_win_t *remote_win)
 {
@@ -121,7 +121,7 @@ MPID_nem_mpich_detach_win (MPID_nem_mpich_win_t *remote_win)
     {
         /* we didn't actually attach if the "remote window" is local */
         mpi_errno = MPID_nem_detach_shared_memory (remote_win->local_address, remote_win->len);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     }
 
  fn_exit:
@@ -134,7 +134,7 @@ MPID_nem_mpich_detach_win (MPID_nem_mpich_win_t *remote_win)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_win_put
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_win_put (void *s_buf, void *d_buf, int len, MPID_nem_mpich_win_t *remote_win)
 {
@@ -147,7 +147,7 @@ MPID_nem_mpich_win_put (void *s_buf, void *d_buf, int len, MPID_nem_mpich_win_t
     _d_buf += (char *)remote_win->local_address - (char *)remote_win->home_address;
 
     if (_d_buf < (char *)remote_win->local_address || _d_buf + len > (char *)remote_win->local_address + remote_win->len)
-        MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winput_oob");
+        MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winput_oob");
 
     MPIU_Memcpy (_d_buf, s_buf, len);
 
@@ -161,7 +161,7 @@ MPID_nem_mpich_win_put (void *s_buf, void *d_buf, int len, MPID_nem_mpich_win_t
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_win_putv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_win_putv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov, int *d_niov, MPID_nem_mpich_win_t *remote_win)
 {
@@ -176,7 +176,7 @@ MPID_nem_mpich_win_putv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov
 
     if ((char *)(*d_iov)->iov_base + diff < (char *)remote_win->local_address ||
 	(char *)(*d_iov)->iov_base + diff + (*d_iov)->iov_len > (char *)remote_win->local_address + remote_win->len)
-        MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winput_oob");
+        MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winput_oob");
 
     while (*s_niov && *d_niov)
     {
@@ -192,7 +192,7 @@ MPID_nem_mpich_win_putv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov
 	    --(*d_niov);
 	    if ((char *)(*d_iov)->iov_base + diff < (char *)remote_win->local_address ||
 		(char *)(*d_iov)->iov_base + diff + (*d_iov)->iov_len > (char *)remote_win->local_address + remote_win->len)
-                MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winput_oob");
+                MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winput_oob");
 	}
 	else if ((*s_iov)->iov_len > (*d_iov)->iov_len)
 	{
@@ -217,7 +217,7 @@ MPID_nem_mpich_win_putv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov
 	    --(*d_niov);
 	    if ((char *)(*d_iov)->iov_base + diff < (char *)remote_win->local_address ||
 		(char *)(*d_iov)->iov_base + diff + (*d_iov)->iov_len > (char *)remote_win->local_address + remote_win->len)
-                MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winput_oob");
+                MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winput_oob");
 	}
     }
 
@@ -231,7 +231,7 @@ MPID_nem_mpich_win_putv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_win_get
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_win_get (void *s_buf, void *d_buf, int len, MPID_nem_mpich_win_t *remote_win)
 {
@@ -244,7 +244,7 @@ MPID_nem_mpich_win_get (void *s_buf, void *d_buf, int len, MPID_nem_mpich_win_t
     _s_buf += (char *)remote_win->local_address - (char *)remote_win->home_address;
 
     if (_s_buf < (char *)remote_win->local_address || _s_buf + len > (char *)remote_win->local_address + remote_win->len)
-        MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winget_oob");
+        MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winget_oob");
 
     MPIU_Memcpy (d_buf, _s_buf, len);
 
@@ -258,7 +258,7 @@ MPID_nem_mpich_win_get (void *s_buf, void *d_buf, int len, MPID_nem_mpich_win_t
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_win_getv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_win_getv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov, int *d_niov, MPID_nem_mpich_win_t *remote_win)
 {
@@ -273,7 +273,7 @@ MPID_nem_mpich_win_getv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov
 
     if ((char *)(*s_iov)->iov_base + diff < (char *)remote_win->local_address ||
 	(char *)(*s_iov)->iov_base + diff + (*s_iov)->iov_len > (char *)remote_win->local_address + remote_win->len)
-        MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winget_oob");
+        MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winget_oob");
 
     while (*s_niov && *d_niov)
     {
@@ -289,7 +289,7 @@ MPID_nem_mpich_win_getv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov
 	    --(*s_niov);
 	    if ((char *)(*s_iov)->iov_base + diff < (char *)remote_win->local_address ||
 		(char *)(*s_iov)->iov_base + diff + (*s_iov)->iov_len > (char *)remote_win->local_address + remote_win->len)
-	        MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winget_oob");
+	        MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winget_oob");
 	}
 	else if ((*d_iov)->iov_len > (*s_iov)->iov_len)
 	{
@@ -314,7 +314,7 @@ MPID_nem_mpich_win_getv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov
 	    --(*s_niov);
 	    if ((char *)(*s_iov)->iov_base + diff < (char *)remote_win->local_address ||
 		(char *)(*s_iov)->iov_base + diff + (*s_iov)->iov_len > (char *)remote_win->local_address + remote_win->len)
-                MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winget_oob");
+                MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**winget_oob");
 	}
     }
 
@@ -334,7 +334,7 @@ MPID_nem_mpich_win_getv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_serialize_win
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_serialize_win (void *buf, int buf_len, MPID_nem_mpich_win_t *win, int *len)
 {
@@ -349,20 +349,20 @@ MPID_nem_mpich_serialize_win (void *buf, int buf_len, MPID_nem_mpich_win_t *win,
 
     handle_len = strlen (win->handle);
     str_errno = MPIU_Str_add_int_arg (&b, &bl, WIN_HANLEN_KEY, handle_len);
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
     str_errno = MPIU_Str_add_string_arg(&b, &bl, WIN_HANDLE_KEY, win->handle);
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
     str_errno = MPIU_Str_add_int_arg (&b, &bl, WIN_PROC_KEY, win->proc);
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
     str_errno = MPIU_Str_add_binary_arg (&b, &bl, WIN_HOME_ADDR_KEY, win->home_address, sizeof (win->home_address));
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
     str_errno = MPIU_Str_add_int_arg (&b, &bl, WIN_LEN_KEY, win->len);
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
 
     *len = buf_len - bl;
 
@@ -376,7 +376,7 @@ MPID_nem_mpich_serialize_win (void *buf, int buf_len, MPID_nem_mpich_win_t *win,
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_serialize_win
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_deserialize_win (void *buf, int buf_len, MPID_nem_mpich_win_t **win)
 {
@@ -393,22 +393,22 @@ MPID_nem_mpich_deserialize_win (void *buf, int buf_len, MPID_nem_mpich_win_t **w
     MPIU_CHKPMEM_MALLOC (*win, MPID_nem_mpich_win_t *, sizeof (MPID_nem_mpich_win_t), mpi_errno, "win object");
 
     str_errno = MPIU_Str_get_int_arg (b, WIN_HANLEN_KEY, &handle_len);
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**windeserialize");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**windeserialize");
     MPIU_CHKPMEM_MALLOC ((*win)->handle, char *, handle_len, mpi_errno, "window handle");
 
     str_errno = MPIU_Str_get_string_arg(b, WIN_HANDLE_KEY, (*win)->handle, handle_len);
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**windeserialize");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**windeserialize");
     str_errno = MPIU_Str_get_int_arg (b, WIN_PROC_KEY, &(*win)->proc);
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**windeserialize");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**windeserialize");
     str_errno = MPIU_Str_get_binary_arg (b, WIN_HOME_ADDR_KEY, (char *)&(*win)->home_address, sizeof ((*win)->home_address), &ol);
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL || ol != sizeof ((*win)->home_address), mpi_errno, MPI_ERR_OTHER, "**windeserialize");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL || ol != sizeof ((*win)->home_address), mpi_errno, MPI_ERR_OTHER, "**windeserialize");
     str_errno = MPIU_Str_get_int_arg (b, WIN_LEN_KEY, &(*win)->len);
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
-    MPIU_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**windeserialize");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPIU_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**windeserialize");
 
     (*win)->local_address = 0;
 
@@ -424,7 +424,7 @@ MPID_nem_mpich_deserialize_win (void *buf, int buf_len, MPID_nem_mpich_win_t **w
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_register_memory
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_register_memory (void *buf, int len)
 {
@@ -445,7 +445,7 @@ MPID_nem_mpich_register_memory (void *buf, int len)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_deregister_memory
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_deregister_memory (void *buf, int len)
 {
@@ -466,7 +466,7 @@ MPID_nem_mpich_deregister_memory (void *buf, int len)
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_put
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_put (void *s_buf, void *d_buf, int len, int proc, int *completion_ctr)
 {
@@ -477,7 +477,7 @@ MPID_nem_mpich_put (void *s_buf, void *d_buf, int len, int proc, int *completion
 
     if (MPID_NEM_IS_LOCAL (proc))
     {
-        MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
+        MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
     }
     else
     {
@@ -489,7 +489,7 @@ MPID_nem_mpich_put (void *s_buf, void *d_buf, int len, int proc, int *completion
 	    return MPID_nem_gm_module_put (d_buf, s_buf, len, proc, completion_ctr);
 	    break;
 	default:
-            MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
+            MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
 	    break;
 	}
       */
@@ -504,7 +504,7 @@ MPID_nem_mpich_put (void *s_buf, void *d_buf, int len, int proc, int *completion
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_putv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_putv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov, int *d_niov, int proc,
 		   int *completion_ctr)
@@ -517,7 +517,7 @@ MPID_nem_mpich_putv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov, in
 
     if (MPID_NEM_IS_LOCAL (proc))
     {
-        MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
+        MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
     }
     else
     {
@@ -566,7 +566,7 @@ MPID_nem_mpich_putv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov, in
 	    }
 	    break;
 	default:
-	    MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
+	    MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
 	    break;
 	}
       */
@@ -581,7 +581,7 @@ MPID_nem_mpich_putv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov, in
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_get
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_get (void *s_buf, void *d_buf, int len, int proc, int *completion_ctr)
 {
@@ -592,7 +592,7 @@ MPID_nem_mpich_get (void *s_buf, void *d_buf, int len, int proc, int *completion
 
     if (MPID_NEM_IS_LOCAL (proc))
     {
-        MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
+        MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
     }
     else
     {
@@ -604,7 +604,7 @@ MPID_nem_mpich_get (void *s_buf, void *d_buf, int len, int proc, int *completion
 	    return MPID_nem_gm_module_get (d_buf, s_buf, len, proc, completion_ctr);
 	    break;
 	default:
-	    MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
+	    MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
 	    break;
 	}
       */
@@ -619,7 +619,7 @@ MPID_nem_mpich_get (void *s_buf, void *d_buf, int len, int proc, int *completion
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mpich_getv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int
 MPID_nem_mpich_getv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov, int *d_niov, int proc,
 		   int *completion_ctr)
@@ -632,7 +632,7 @@ MPID_nem_mpich_getv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov, in
 
     if (MPID_NEM_IS_LOCAL (proc))
     {
-        MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
+        MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
     }
     else
     {
@@ -681,7 +681,7 @@ MPID_nem_mpich_getv (struct iovec **s_iov, int *s_niov, struct iovec **d_iov, in
 	    }
 	    break;
 	default:
-	    MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
+	    MPIR_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**notimpl");
 	    break;
 	}
       */
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_network.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_network.c
index 4dd5d50..636ffa1 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_network.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_network.c
@@ -36,7 +36,7 @@ MPID_nem_net_module_vc_dbg_print_sendq_t  MPID_nem_net_module_vc_dbg_print_sendq
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_choose_netmod
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_choose_netmod(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -70,7 +70,7 @@ int MPID_nem_choose_netmod(void)
         }
     }
 
-    MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**invalid_netmod", "**invalid_netmod %s", MPIR_CVAR_NEMESIS_NETMOD);
+    MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**invalid_netmod", "**invalid_netmod %s", MPIR_CVAR_NEMESIS_NETMOD);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_CHOOSE_NETMOD);
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_network_poll.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_network_poll.c
index d2a8945..a24aae6 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_network_poll.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_network_poll.c
@@ -10,7 +10,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_network_poll
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_nem_network_poll(int in_blocking_progress)
 {
     return MPID_nem_netmod_func->poll(in_blocking_progress);
diff --git a/src/mpid/ch3/channels/sock/include/mpidi_ch3_post.h b/src/mpid/ch3/channels/sock/include/mpidi_ch3_post.h
index db7301b..952023e 100644
--- a/src/mpid/ch3/channels/sock/include/mpidi_ch3_post.h
+++ b/src/mpid/ch3/channels/sock/include/mpidi_ch3_post.h
@@ -23,10 +23,10 @@
  */
 #define MPIDI_CH3_Progress_start(progress_state_)			\
 {									\
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);\
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);\
     (progress_state_)->ch.completion_count = MPIDI_CH3I_progress_completion_count;\
 }
-#define MPIDI_CH3_Progress_end(progress_state_) MPIU_THREAD_CS_EXIT(MPIDCOMM,)
+#define MPIDI_CH3_Progress_end(progress_state_) MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex)
 #define MPIDI_CH3_Progress_poke() (MPIDI_CH3_Progress_test())
 
 int MPIDI_CH3I_Progress(int blocking, MPID_Progress_state *state);
diff --git a/src/mpid/ch3/channels/sock/include/mpidi_ch3_pre.h b/src/mpid/ch3/channels/sock/include/mpidi_ch3_pre.h
index 61908db..8e444d8 100644
--- a/src/mpid/ch3/channels/sock/include/mpidi_ch3_pre.h
+++ b/src/mpid/ch3/channels/sock/include/mpidi_ch3_pre.h
@@ -78,7 +78,7 @@ MPIDI_CH3I_Progress_state;
    and must be available to the routines in src/mpi */
 extern volatile unsigned int MPIDI_CH3I_progress_completion_count;
 
-/* MPICH_IS_THREADED isn't defined yet (handled by mpiimplthread.h) */
+/* MPICH_IS_THREADED isn't defined yet */
 #if (MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE)
 #define MPIDI_CH3I_PROGRESS_WAKEUP                                                                \
     do {                                                                                          \
diff --git a/src/mpid/ch3/channels/sock/src/ch3_finalize.c b/src/mpid/ch3/channels/sock/src/ch3_finalize.c
index 1f1beee..0beac57 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_finalize.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_finalize.c
@@ -10,7 +10,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Finalize( void )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -19,7 +19,7 @@ int MPIDI_CH3_Finalize( void )
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_CH3_FINALIZE);
 
     mpi_errno = MPIDI_CH3I_Progress_finalize();
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 
  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_CH3_FINALIZE);
diff --git a/src/mpid/ch3/channels/sock/src/ch3_init.c b/src/mpid/ch3/channels/sock/src/ch3_init.c
index f7367a9..e6e90b6 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_init.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_init.c
@@ -20,7 +20,7 @@ char MPIDI_CH3_ABIVersion[] = "1.1";
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Init(int has_parent, MPIDI_PG_t * pg_p, int pg_rank )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -32,11 +32,11 @@ int MPIDI_CH3_Init(int has_parent, MPIDI_PG_t * pg_p, int pg_rank )
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_CH3_INIT);
 
     mpi_errno = MPIDI_CH3I_Progress_init();
-    if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno != MPI_SUCCESS) MPIR_ERR_POP(mpi_errno);
 
     /* Initialize the business card */
     mpi_errno = MPIDI_CH3I_BCInit( &bc_val, &val_max_remaining );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     publish_bc_orig = bc_val;
 
     /* initialize aspects specific to sockets  */
@@ -51,7 +51,7 @@ int MPIDI_CH3_Init(int has_parent, MPIDI_PG_t * pg_p, int pg_rank )
      (note that publish_bc_orig is the head of bc_val ) */
     MPIDI_CH3I_BCFree( publish_bc_orig );
 
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_CH3_INIT);
diff --git a/src/mpid/ch3/channels/sock/src/ch3_isend.c b/src/mpid/ch3/channels/sock/src/ch3_isend.c
index 169fc63..2178358 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_isend.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_isend.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME update_request
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void update_request(MPID_Request * sreq, void * hdr, 
 			   MPIDI_msg_sz_t hdr_sz, MPIU_Size_t nb)
 {
@@ -27,7 +27,7 @@ static void update_request(MPID_Request * sreq, void * hdr,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_iSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr, 
 		    MPIDI_msg_sz_t hdr_sz)
 {
@@ -76,13 +76,13 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 			MPIU_Assert(MPIDI_Request_get_type(sreq)!=MPIDI_REQUEST_TYPE_GET_RESP);
                         mpi_errno = MPID_Request_complete(sreq);
                         if (mpi_errno != MPI_SUCCESS) {
-                            MPIU_ERR_POP(mpi_errno);
+                            MPIR_ERR_POP(mpi_errno);
                         }
 		    }
 		    else {
 			int complete;
 			mpi_errno = reqFn( vc, sreq, &complete );
-			if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+			if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 			if (!complete) {
 			    MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
 			    MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
@@ -175,7 +175,7 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 	mpi_errno = MPIDI_CH3I_VC_post_connect(vc);
 	if (mpi_errno) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     }
     else if (vcch->state != MPIDI_CH3I_VC_STATE_FAILED)
diff --git a/src/mpid/ch3/channels/sock/src/ch3_isendv.c b/src/mpid/ch3/channels/sock/src/ch3_isendv.c
index e7d0add..e8bfd5f 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_isendv.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_isendv.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME update_request
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void update_request(MPID_Request * sreq, MPL_IOV * iov, int iov_count,
 			   int iov_offset, MPIU_Size_t nb)
 {
@@ -39,7 +39,7 @@ static void update_request(MPID_Request * sreq, MPL_IOV * iov, int iov_count,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_iSendv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq, 
 		     MPL_IOV * iov, int n_iov)
 {
@@ -141,13 +141,13 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 			MPIU_Assert(MPIDI_Request_get_type(sreq)!=MPIDI_REQUEST_TYPE_GET_RESP);
                         mpi_errno = MPID_Request_complete(sreq);
                         if (mpi_errno != MPI_SUCCESS) {
-                            MPIU_ERR_POP(mpi_errno);
+                            MPIR_ERR_POP(mpi_errno);
                         }
 		    }
 		    else {
 			int complete;
 			mpi_errno = reqFn( vc, sreq, &complete );
-			if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+			if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 			if (!complete) {
 			    MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
 			    MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
@@ -218,7 +218,7 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 	mpi_errno = MPIDI_CH3I_VC_post_connect(vc);
 	if (mpi_errno) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     }
     else if (vcch->state != MPIDI_CH3I_VC_STATE_FAILED)
diff --git a/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c b/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
index 29723a6..37b98f5 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME create_request
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static MPID_Request * create_request(void * hdr, MPIDI_msg_sz_t hdr_sz, 
 				     MPIU_Size_t nb)
 {
@@ -48,7 +48,7 @@ static MPID_Request * create_request(void * hdr, MPIDI_msg_sz_t hdr_sz,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_iStartMsg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz, 
 			MPID_Request ** sreq_ptr)
 {
@@ -101,7 +101,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
                     "partial write of " MPIDI_MSG_SZ_FMT " bytes, request enqueued at head", nb);
 		    sreq = create_request(hdr, hdr_sz, nb);
 		    if (!sreq) {
-			MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+			MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 		    }
 
 		    MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
@@ -128,7 +128,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 			       "ERROR - MPIDU_Sock_write failed, rc=%d", rc);
 		sreq = MPID_Request_create();
 		if (!sreq) {
-		    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+		    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 		}
 		sreq->kind = MPID_REQUEST_SEND;
 		MPID_cc_set(&(sreq->cc), 0);
@@ -147,7 +147,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 			 "send in progress, request enqueued");
 	    sreq = create_request(hdr, hdr_sz, 0);
 	    if (!sreq) {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	    }
 	    MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 	}
@@ -160,7 +160,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	/* queue the data so it can be sent after the connection is formed */
 	sreq = create_request(hdr, hdr_sz, 0);
 	if (!sreq) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
     }
@@ -172,7 +172,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	/* queue the data so it can be sent after the connection is formed */
 	sreq = create_request(hdr, hdr_sz, 0);
 	if (!sreq) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 
@@ -185,7 +185,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	MPIU_DBG_VCUSE(vc,"forming connection, request enqueued");
 	sreq = create_request(hdr, hdr_sz, 0);
 	if (!sreq) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
     }
@@ -196,7 +196,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	MPIU_DBG_VCUSE(vc,"ERROR - connection failed");
 	sreq = MPID_Request_create();
 	if (!sreq) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
 	sreq->kind = MPID_REQUEST_SEND;
 	MPID_cc_set(&sreq->cc, 0);
diff --git a/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c b/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
index 79cb681..4540a3f 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME create_request
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static MPID_Request * create_request(MPL_IOV * iov, int iov_count, 
 				     int iov_offset, MPIU_Size_t nb)
 {
@@ -72,7 +72,7 @@ static MPID_Request * create_request(MPL_IOV * iov, int iov_count,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_iStartMsgv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov, 
 			 MPID_Request ** sreq_ptr)
 {
@@ -128,7 +128,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 			     "partial write, request enqueued at head");
 			sreq = create_request(iov, n_iov, offset, nb);
 			if (sreq == NULL) {
-			    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+			    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 			}
 			MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
 			MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
@@ -160,7 +160,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 			       "ERROR - MPIDU_Sock_writev failed, rc=%d", rc);
 		sreq = MPID_Request_create();
 		if (sreq == NULL) {
-		    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+		    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 		}
 		sreq->kind = MPID_REQUEST_SEND;
         MPID_cc_set(&(sreq->cc), 0);
@@ -179,7 +179,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 			 "send in progress, request enqueued");
 	    sreq = create_request(iov, n_iov, 0, 0);
 	    if (sreq == NULL) {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	    }
 	    MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 	}
@@ -192,7 +192,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 	/* queue the data so it can be sent after the connection is formed */
 	sreq = create_request(iov, n_iov, 0, 0);
 	if (sreq == NULL) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
     }
@@ -204,7 +204,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 	/* queue the data so it can be sent after the connection is formed */
 	sreq = create_request(iov, n_iov, 0, 0);
 	if (sreq == NULL) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 	
@@ -217,7 +217,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 	MPIU_DBG_VCUSE(vc,"forming connection, request enqueued");
 	sreq = create_request(iov, n_iov, 0, 0);
 	if (sreq == NULL) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
     }
@@ -228,7 +228,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 	MPIU_DBG_VCUSE(vc,"ERROR - connection failed");
 	sreq = MPID_Request_create();
 	if (sreq == NULL) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
 	sreq->kind = MPID_REQUEST_SEND;
     MPID_cc_set(&(sreq->cc), 0);
diff --git a/src/mpid/ch3/channels/sock/src/ch3_progress.c b/src/mpid/ch3/channels/sock/src/ch3_progress.c
index 46d1108..0baaf32 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_progress.c
@@ -59,7 +59,7 @@ static int total_progress_hook_cnt = 0; /* Keep track of how many progress hooks
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3i_Progress_test
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3i_Progress_test(void)
 {
     MPIDU_Sock_event_t event;
@@ -103,7 +103,7 @@ static int MPIDI_CH3i_Progress_test(void)
         if (progress_hooks[i].active == TRUE) {
             MPIU_Assert(progress_hooks[i].func_ptr != NULL);
             mpi_errno = progress_hooks[i].func_ptr(&made_progress);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
             called_progress_hook_cnt++;
             if (called_progress_hook_cnt == total_progress_hook_cnt)
@@ -117,7 +117,7 @@ static int MPIDI_CH3i_Progress_test(void)
     {
 	mpi_errno = MPIDI_CH3I_Progress_handle_sock_event(&event);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
 				"**ch3|sock|handle_sock_event");
 	}
     }
@@ -127,7 +127,7 @@ static int MPIDI_CH3i_Progress_test(void)
 	goto fn_exit;
     }
     else {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**progress_sock_wait");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**progress_sock_wait");
     }
 
   fn_exit:
@@ -142,7 +142,7 @@ static int MPIDI_CH3i_Progress_test(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3i_Progress_wait
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3i_Progress_wait(MPID_Progress_state * progress_state)
 {
     MPIDU_Sock_event_t event;
@@ -172,7 +172,7 @@ static int MPIDI_CH3i_Progress_wait(MPID_Progress_state * progress_state)
 #   endif
 	
 #   ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN
+    MPID_THREAD_CHECK_BEGIN
     {
 	if (MPIDI_CH3I_progress_blocked == TRUE) 
 	{
@@ -192,7 +192,7 @@ static int MPIDI_CH3i_Progress_wait(MPID_Progress_state * progress_state)
 	    goto fn_exit;
 	}
     }
-    MPIU_THREAD_CHECK_END
+    MPID_THREAD_CHECK_END
 #   endif
     
     do
@@ -206,7 +206,7 @@ static int MPIDI_CH3i_Progress_wait(MPID_Progress_state * progress_state)
             if (progress_hooks[i].active == TRUE) {
                 MPIU_Assert(progress_hooks[i].func_ptr != NULL);
                 mpi_errno = progress_hooks[i].func_ptr(&made_progress);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 if (made_progress) {
                     MPIDI_CH3_Progress_signal_completion();
                     break; /* break the for loop */
@@ -244,14 +244,14 @@ static int MPIDI_CH3i_Progress_wait(MPID_Progress_state * progress_state)
 	if (mpi_errno != MPI_SUCCESS)
 	{
 	    MPIU_Assert(MPIR_ERR_GET_CLASS(mpi_errno) != MPIDU_SOCK_ERR_TIMEOUT);
-	    MPIU_ERR_SET(mpi_errno,MPI_ERR_OTHER,"**progress_sock_wait");
+	    MPIR_ERR_SET(mpi_errno,MPI_ERR_OTHER,"**progress_sock_wait");
 	    goto fn_fail;
 	}
 	/* --END ERROR HANDLING-- */
 
 	mpi_errno = MPIDI_CH3I_Progress_handle_sock_event(&event);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
 				"**ch3|sock|handle_sock_event");
 	}
     }
@@ -292,7 +292,7 @@ static int MPIDI_CH3i_Progress_wait(MPID_Progress_state * progress_state)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Connection_terminate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -303,7 +303,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
     MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL,"Closing sock (Post_close)");
     mpi_errno = MPIDU_Sock_post_close(vcch->sock);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -317,7 +317,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_init(void)
 {
     int i;
@@ -326,35 +326,35 @@ int MPIDI_CH3I_Progress_init(void)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_INIT);
 
-    MPIU_THREAD_CHECK_BEGIN
+    MPID_THREAD_CHECK_BEGIN
     /* FIXME should be appropriately abstracted somehow */
-#   if defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
     {
         int err;
 	MPID_Thread_cond_create(&MPIDI_CH3I_progress_completion_cond, &err);
         MPIU_Assert(err == 0);
     }
 #   endif
-    MPIU_THREAD_CHECK_END
+    MPID_THREAD_CHECK_END
 	
     mpi_errno = MPIDU_Sock_init();
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
     
     /* create sock set */
     mpi_errno = MPIDU_Sock_create_set(&MPIDI_CH3I_sock_set);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
     
     /* establish non-blocking listener */
     mpi_errno = MPIDU_CH3I_SetupListener( MPIDI_CH3I_sock_set );
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 
     /* Initialize the code to handle incoming packets */
     mpi_errno = MPIDI_CH3_PktHandler_Init( pktArray, MPIDI_CH3_PKT_END_CH3+1 );
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 
     /* Initialize progress hook slots */
     for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
@@ -374,7 +374,7 @@ int MPIDI_CH3I_Progress_init(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_finalize(void)
 {
     int mpi_errno;
@@ -386,7 +386,7 @@ int MPIDI_CH3I_Progress_finalize(void)
 
     /* Shut down the listener */
     mpi_errno = MPIDU_CH3I_ShutdownListener();
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
     
 
     /* Close open connections */
@@ -394,7 +394,7 @@ int MPIDI_CH3I_Progress_finalize(void)
     while (conn != NULL) {
         conn->state = CONN_STATE_CLOSING;
         mpi_errno = MPIDI_CH3_Sockconn_handle_close_event(conn);
-	if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
         MPIDU_Sock_close_open_sockets(MPIDI_CH3I_sock_set,(void**) &conn);
     }
 
@@ -410,16 +410,16 @@ int MPIDI_CH3I_Progress_finalize(void)
     MPIDU_Sock_destroy_set(MPIDI_CH3I_sock_set);
     MPIDU_Sock_finalize();
 
-    MPIU_THREAD_CHECK_BEGIN
+    MPID_THREAD_CHECK_BEGIN
     /* FIXME should be appropriately abstracted somehow */
-#   if defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
     {
         int err;
 	MPID_Thread_cond_destroy(&MPIDI_CH3I_progress_completion_cond, &err);
         MPIU_Assert(err == 0);
     }
 #   endif
-    MPIU_THREAD_CHECK_END
+    MPID_THREAD_CHECK_END
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_FINALIZE);
@@ -434,7 +434,7 @@ int MPIDI_CH3I_Progress_finalize(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_wakeup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDI_CH3I_Progress_wakeup(void)
 {
     MPIU_DBG_MSG(CH3_OTHER,TYPICAL,"progress_wakeup called");
@@ -445,7 +445,7 @@ void MPIDI_CH3I_Progress_wakeup(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Get_business_card
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Get_business_card(int myRank, char *value, int length)
 {
     return MPIDI_CH3U_Get_business_card_sock(myRank, &value, &length);
@@ -455,7 +455,7 @@ int MPIDI_CH3_Get_business_card(int myRank, char *value, int length)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_handle_sock_event
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -489,7 +489,7 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 		   protocol */
 		if (MPIR_ERR_GET_CLASS(event->error) != MPIDU_SOCK_ERR_CONN_CLOSED) {
 		    mpi_errno = event->error;
-		    MPIU_ERR_POP(mpi_errno);
+		    MPIR_ERR_POP(mpi_errno);
 		}		    
 		break;
 	    }
@@ -505,7 +505,7 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 		    mpi_errno = pktArray[conn->pkt.type]( conn->vc, &conn->pkt,
 							  &buflen, &rreq );
 		    if (mpi_errno != MPI_SUCCESS) {
-			MPIU_ERR_POP(mpi_errno);
+			MPIR_ERR_POP(mpi_errno);
 		    }
                     MPIU_Assert(buflen == sizeof (MPIDI_CH3_Pkt_t));
 
@@ -517,14 +517,14 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 			       already set to NULL */
 			    mpi_errno = connection_post_recv_pkt(conn);
 			    if (mpi_errno != MPI_SUCCESS) {
-				MPIU_ERR_POP(mpi_errno);
+				MPIR_ERR_POP(mpi_errno);
 			    }
 			}
 		    }
 		    else
 		    {
 			mpi_errno = ReadMoreData( conn, rreq );
-			if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+			if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 		    }
 		}
 		else /* incoming data */
@@ -537,13 +537,13 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 			MPIU_Assert(MPIDI_Request_get_type(rreq)!=MPIDI_REQUEST_TYPE_GET_RESP);
                         mpi_errno = MPID_Request_complete(rreq);
                         if (mpi_errno != MPI_SUCCESS) {
-                            MPIU_ERR_POP(mpi_errno);
+                            MPIR_ERR_POP(mpi_errno);
                         }
 			complete = TRUE;
 		    }
 		    else {
 			mpi_errno = reqFn( conn->vc, rreq, &complete );
-			if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+			if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		    }
 			
 		    if (complete)
@@ -551,26 +551,26 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 			conn->recv_active = NULL;
 			mpi_errno = connection_post_recv_pkt(conn);
 			if (mpi_errno != MPI_SUCCESS) {
-			    MPIU_ERR_POP(mpi_errno);
+			    MPIR_ERR_POP(mpi_errno);
 			}
 		    }
 		    else /* more data to be read */
 		    {
 			mpi_errno = ReadMoreData( conn, rreq );
-			if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+			if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 		    }
 		}
 	    }
 	    else if (conn->state == CONN_STATE_OPEN_LRECV_DATA)
 	    {
 		mpi_errno = MPIDI_CH3_Sockconn_handle_connopen_event( conn );
-		if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
+		if (mpi_errno) { MPIR_ERR_POP( mpi_errno ); }
 	    }
 	    else /* Handling some internal connection establishment or 
 		    tear down packet */
 	    { 
 		mpi_errno = MPIDI_CH3_Sockconn_handle_conn_event( conn );
-		if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+		if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 	    }
 	    break;
 	}
@@ -584,7 +584,7 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 	    /* --BEGIN ERROR HANDLING-- */
 	    if (event->error != MPI_SUCCESS) {
 		mpi_errno = event->error;
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
 	    /* --END ERROR HANDLING-- */
 		
@@ -599,21 +599,21 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 		    MPIU_Assert(MPIDI_Request_get_type(sreq)!=MPIDI_REQUEST_TYPE_GET_RESP);
                     mpi_errno = MPID_Request_complete(sreq);
                     if (mpi_errno != MPI_SUCCESS) {
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                     }
 
 		    complete = TRUE;
 		}
 		else {
 		    mpi_errno = reqFn( conn->vc, sreq, &complete );
-		    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+		    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		}
 		    
 		if (complete)
 		{
 		    mpi_errno = connection_pop_sendq_req(conn);
 		    if (mpi_errno != MPI_SUCCESS) {
-			MPIU_ERR_POP(mpi_errno);
+			MPIR_ERR_POP(mpi_errno);
 		    }
 		}
 		else /* more data to send */
@@ -647,19 +647,19 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 				MPIU_Assert(MPIDI_Request_get_type(sreq)!=MPIDI_REQUEST_TYPE_GET_RESP);
                                 mpi_errno = MPID_Request_complete(sreq);
                                 if (mpi_errno != MPI_SUCCESS) {
-                                    MPIU_ERR_POP(mpi_errno);
+                                    MPIR_ERR_POP(mpi_errno);
                                 }
 				complete = TRUE;
 			    }
 			    else {
 				mpi_errno = reqFn( conn->vc, sreq, &complete );
-				if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+				if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 			    }
 			    if (complete)
 			    {
 				mpi_errno = connection_pop_sendq_req(conn);
 				if (mpi_errno != MPI_SUCCESS) {
-				    MPIU_ERR_POP(mpi_errno);
+				    MPIR_ERR_POP(mpi_errno);
 				}
 				break;
 			    }
@@ -689,7 +689,7 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 	    {
 		/* the connection is not active yet */
 		mpi_errno = MPIDI_CH3_Sockconn_handle_connwrite( conn );
-		if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
+		if (mpi_errno) { MPIR_ERR_POP( mpi_errno ); }
 	    }
 	    break;
 	}
@@ -698,7 +698,7 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 	case MPIDU_SOCK_OP_ACCEPT:
 	{
 	    mpi_errno = MPIDI_CH3_Sockconn_handle_accept_event();
-	    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 	    break;
 	}
 	    
@@ -707,7 +707,7 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 	    mpi_errno = MPIDI_CH3_Sockconn_handle_connect_event( 
 				(MPIDI_CH3I_Connection_t *) event->user_ptr,
 				event->error );
-	    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 	    break;
 	}
 	    
@@ -715,7 +715,7 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 	{
 	    mpi_errno = MPIDI_CH3_Sockconn_handle_close_event( 
 			      (MPIDI_CH3I_Connection_t *) event->user_ptr );
-	    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 	    break;
 	}
 
@@ -744,18 +744,18 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_delay
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3I_Progress_delay(unsigned int completion_count)
 {
-    int mpi_errno = MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS, err;
     
     /* FIXME should be appropriately abstracted somehow */
-#   if defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
     {
 	while (completion_count == MPIDI_CH3I_progress_completion_count)
 	{
 	    MPID_Thread_cond_wait(&MPIDI_CH3I_progress_completion_cond, 
-				  &MPIR_ThreadInfo.global_mutex);
+				  &MPIR_ThreadInfo.global_mutex, &err);
 	}
     }
 #   endif
@@ -768,19 +768,19 @@ static int MPIDI_CH3I_Progress_delay(unsigned int completion_count)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_continue
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3I_Progress_continue(unsigned int completion_count)
 {
-    int mpi_errno = MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS,err;
 
-    MPIU_THREAD_CHECK_BEGIN
+    MPID_THREAD_CHECK_BEGIN
     /* FIXME should be appropriately abstracted somehow */
-#   if defined(MPICH_IS_THREADED) && (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
     {
-	MPID_Thread_cond_broadcast(&MPIDI_CH3I_progress_completion_cond);
+        MPID_Thread_cond_broadcast(&MPIDI_CH3I_progress_completion_cond,&err);
     }
 #   endif
-    MPIU_THREAD_CHECK_END
+    MPID_THREAD_CHECK_END
 
     return mpi_errno;
 }
@@ -794,7 +794,7 @@ static int MPIDI_CH3I_Progress_continue(unsigned int completion_count)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_VC_post_connect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_VC_post_connect(MPIDI_VC_t * vc)
 {
     return MPIDI_CH3I_VC_post_sockconnect( vc );
@@ -805,7 +805,7 @@ int MPIDI_CH3I_VC_post_connect(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME connection_pop_sendq_req
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int connection_pop_sendq_req(MPIDI_CH3I_Connection_t * conn)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -824,7 +824,7 @@ static inline int connection_pop_sendq_req(MPIDI_CH3I_Connection_t * conn)
 	MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"conn=%p: Posting message from connection send queue", conn );
 	mpi_errno = MPIDU_Sock_post_writev(conn->sock, conn->send_active->dev.iov, conn->send_active->dev.iov_count, NULL);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     }
     
@@ -838,7 +838,7 @@ static inline int connection_pop_sendq_req(MPIDI_CH3I_Connection_t * conn)
 #undef FUNCNAME
 #define FUNCNAME connection_post_recv_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int connection_post_recv_pkt(MPIDI_CH3I_Connection_t * conn)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -848,7 +848,7 @@ static inline int connection_post_recv_pkt(MPIDI_CH3I_Connection_t * conn)
 
     mpi_errno = MPIDU_Sock_post_read(conn->sock, &conn->pkt, sizeof(conn->pkt), sizeof(conn->pkt), NULL);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SET(mpi_errno,MPI_ERR_OTHER, "**fail");
+	MPIR_ERR_SET(mpi_errno,MPI_ERR_OTHER, "**fail");
     }
     
     MPIDI_FUNC_EXIT(MPID_STATE_CONNECTION_POST_RECV_PKT);
@@ -859,7 +859,7 @@ static inline int connection_post_recv_pkt(MPIDI_CH3I_Connection_t * conn)
 #undef FUNCNAME
 #define FUNCNAME adjust_iov
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int adjust_iov(MPL_IOV ** iovp, int * countp, MPIU_Size_t nb)
 {
     MPL_IOV * const iov = *iovp;
@@ -924,20 +924,20 @@ static int ReadMoreData( MPIDI_CH3I_Connection_t * conn, MPID_Request *rreq )
 		MPIU_Assert(MPIDI_Request_get_type(rreq)!=MPIDI_REQUEST_TYPE_GET_RESP);
                 mpi_errno = MPID_Request_complete(rreq);
                 if (mpi_errno != MPI_SUCCESS) {
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 }
 		complete = TRUE;
 	    }
 	    else {
 		mpi_errno = reqFn( conn->vc, rreq, &complete );
-		if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+		if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    }
 	    
 	    if (complete) {
 		conn->recv_active = NULL; /* -- already set to NULL */
 		mpi_errno = connection_post_recv_pkt(conn);
 		if (mpi_errno != MPI_SUCCESS) {
-		    MPIU_ERR_POP(mpi_errno);
+		    MPIR_ERR_POP(mpi_errno);
 		}
 		
 		break;
@@ -981,7 +981,7 @@ int MPIDI_CH3I_Progress( int blocking, MPID_Progress_state *state )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_register_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -989,7 +989,7 @@ int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
         if (progress_hooks[i].func_ptr == NULL) {
@@ -1008,7 +1008,7 @@ int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
     (*id) = i;
 
   fn_exit:
-    MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
     return mpi_errno;
 
@@ -1019,14 +1019,14 @@ int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*), int *id)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_deregister_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_deregister_hook(int id)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS && progress_hooks[id].func_ptr != NULL);
 
@@ -1034,7 +1034,7 @@ int MPIDI_CH3I_Progress_deregister_hook(int id)
     progress_hooks[id].active = FALSE;
 
   fn_exit:
-    MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
     return mpi_errno;
 
@@ -1045,14 +1045,14 @@ int MPIDI_CH3I_Progress_deregister_hook(int id)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_activate_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_activate_hook(int id)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS &&
                 progress_hooks[id].active == FALSE && progress_hooks[id].func_ptr != NULL);
@@ -1062,7 +1062,7 @@ int MPIDI_CH3I_Progress_activate_hook(int id)
     MPIU_Assert(total_progress_hook_cnt <= MAX_PROGRESS_HOOKS);
 
   fn_exit:
-    MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_ACTIVATE_HOOK);
     return mpi_errno;
 
@@ -1074,14 +1074,14 @@ int MPIDI_CH3I_Progress_activate_hook(int id)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Progress_deactivate_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Progress_deactivate_hook(int id)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
-    MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
 
     MPIU_Assert(id >= 0 && id < MAX_PROGRESS_HOOKS &&
                 progress_hooks[id].active == TRUE && progress_hooks[id].func_ptr != NULL);
@@ -1091,7 +1091,7 @@ int MPIDI_CH3I_Progress_deactivate_hook(int id)
     MPIU_Assert(total_progress_hook_cnt >= 0);
 
   fn_exit:
-    MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_DEACTIVATE_HOOK);
     return mpi_errno;
 
diff --git a/src/mpid/ch3/channels/sock/src/ch3_win_fns.c b/src/mpid/ch3/channels/sock/src/ch3_win_fns.c
index 3e1c466..0317f42 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_win_fns.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_win_fns.c
@@ -11,7 +11,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Win_fns_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Win_fns_init(MPIDI_CH3U_Win_fns_t *win_fns)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -29,7 +29,7 @@ int MPIDI_CH3_Win_fns_init(MPIDI_CH3U_Win_fns_t *win_fns)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Win_hooks_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Win_hooks_init(MPIDI_CH3U_Win_hooks_t *win_hooks)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -47,7 +47,7 @@ int MPIDI_CH3_Win_hooks_init(MPIDI_CH3U_Win_hooks_t *win_hooks)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Win_pkt_orderings_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Win_pkt_orderings_init(MPIDI_CH3U_Win_pkt_ordering_t * win_pkt_orderings)
 {
     int mpi_errno = MPI_SUCCESS;
diff --git a/src/mpid/ch3/channels/sock/src/ch3i_errno.c b/src/mpid/ch3/channels/sock/src/ch3i_errno.c
index 80d5b97..8b94c29 100644
--- a/src/mpid/ch3/channels/sock/src/ch3i_errno.c
+++ b/src/mpid/ch3/channels/sock/src/ch3i_errno.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_sock_errno_to_mpi_errno
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_sock_errno_to_mpi_errno(char * fcname, int sock_errno)
 {
     int mpi_errno;
diff --git a/src/mpid/ch3/include/mpid_rma_issue.h b/src/mpid/ch3/include/mpid_rma_issue.h
index 5862ae0..5fa65dd 100644
--- a/src/mpid/ch3/include/mpid_rma_issue.h
+++ b/src/mpid/ch3/include/mpid_rma_issue.h
@@ -19,7 +19,7 @@
 #undef FUNCNAME
 #define FUNCNAME immed_copy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int immed_copy(void *src, void *dest, size_t len)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -62,7 +62,7 @@ static inline int immed_copy(void *src, void *dest, size_t len)
 #undef FUNCNAME
 #define FUNCNAME fill_in_derived_dtp_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void fill_in_derived_dtp_info(MPIDI_RMA_dtype_info * dtype_info, void *dataloop,
                                             MPID_Datatype * dtp)
 {
@@ -98,7 +98,7 @@ static inline void fill_in_derived_dtp_info(MPIDI_RMA_dtype_info * dtype_info, v
 #undef FUNCNAME
 #define FUNCNAME init_accum_ext_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int init_accum_ext_pkt(MPIDI_CH3_Pkt_flags_t flags,
                               MPID_Datatype * target_dtp, MPIDI_msg_sz_t stream_offset,
                               void **ext_hdr_ptr, MPI_Aint * ext_hdr_sz)
@@ -120,7 +120,7 @@ static int init_accum_ext_pkt(MPIDI_CH3_Pkt_flags_t flags,
 
         _ext_hdr_ptr = (MPIDI_CH3_Ext_pkt_accum_stream_derived_t *) MPIU_Malloc(_total_sz);
         if (_ext_hdr_ptr == NULL) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_stream_derived_t");
         }
 
@@ -138,7 +138,7 @@ static int init_accum_ext_pkt(MPIDI_CH3_Pkt_flags_t flags,
 
         _ext_hdr_ptr = (MPIDI_CH3_Ext_pkt_accum_stream_t *) MPIU_Malloc(_total_sz);
         if (_ext_hdr_ptr == NULL) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_stream_t");
         }
 
@@ -155,7 +155,7 @@ static int init_accum_ext_pkt(MPIDI_CH3_Pkt_flags_t flags,
 
         _ext_hdr_ptr = (MPIDI_CH3_Ext_pkt_accum_derived_t *) MPIU_Malloc(_total_sz);
         if (_ext_hdr_ptr == NULL) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_derived_t");
         }
 
@@ -181,7 +181,7 @@ static int init_accum_ext_pkt(MPIDI_CH3_Pkt_flags_t flags,
 #undef FUNCNAME
 #define FUNCNAME init_get_accum_ext_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int init_get_accum_ext_pkt(MPIDI_CH3_Pkt_flags_t flags,
                                   MPID_Datatype * target_dtp, MPIDI_msg_sz_t stream_offset,
                                   void **ext_hdr_ptr, MPI_Aint * ext_hdr_sz)
@@ -214,7 +214,7 @@ static int init_get_accum_ext_pkt(MPIDI_CH3_Pkt_flags_t flags,
 #undef FUNCNAME
 #define FUNCNAME issue_from_origin_buffer
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int issue_from_origin_buffer(MPIDI_RMA_Op_t * rma_op, MPIDI_VC_t * vc,
                                     void *ext_hdr_ptr, MPI_Aint ext_hdr_sz,
                                     MPIDI_msg_sz_t stream_offset, MPIDI_msg_sz_t stream_size,
@@ -288,10 +288,10 @@ static int issue_from_origin_buffer(MPIDI_RMA_Op_t * rma_op, MPIDI_VC_t * vc,
             iovcnt++;
         }
 
-        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = MPIDI_CH3_iStartMsgv(vc, iov, iovcnt, &req);
-        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
         if (origin_dtp != NULL) {
             if (req == NULL) {
@@ -312,7 +312,7 @@ static int issue_from_origin_buffer(MPIDI_RMA_Op_t * rma_op, MPIDI_VC_t * vc,
 
     /* create a new request */
     req = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP(req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+    MPIR_ERR_CHKANDJUMP(req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
 
     MPIU_Object_set_ref(req, 2);
     req->kind = MPID_REQUEST_SEND;
@@ -339,15 +339,15 @@ static int issue_from_origin_buffer(MPIDI_RMA_Op_t * rma_op, MPIDI_VC_t * vc,
             iovcnt++;
         }
 
-        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = MPIDI_CH3_iSendv(vc, req, iov, iovcnt);
-        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
     else {
         /* origin data is non-contiguous */
         req->dev.segment_ptr = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP1(req->dev.segment_ptr == NULL, mpi_errno,
+        MPIR_ERR_CHKANDJUMP1(req->dev.segment_ptr == NULL, mpi_errno,
                              MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
 
         MPID_Segment_init(rma_op->origin_addr, rma_op->origin_count,
@@ -358,10 +358,10 @@ static int issue_from_origin_buffer(MPIDI_RMA_Op_t * rma_op, MPIDI_VC_t * vc,
         req->dev.OnFinal = 0;
         req->dev.OnDataAvail = 0;
 
-        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = vc->sendNoncontig_fn(vc, req, iov[0].MPL_IOV_BUF, iov[0].MPL_IOV_LEN);
-        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
   fn_exit:
@@ -390,7 +390,7 @@ static int issue_from_origin_buffer(MPIDI_RMA_Op_t * rma_op, MPIDI_VC_t * vc,
 #undef FUNCNAME
 #define FUNCNAME issue_put_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int issue_put_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
                         MPIDI_RMA_Target_t * target_ptr, MPIDI_CH3_Pkt_flags_t flags)
 {
@@ -413,10 +413,10 @@ static int issue_put_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
 
     if (rma_op->pkt.type == MPIDI_CH3_PKT_PUT_IMMED) {
         /* All origin data is in packet header, issue the header. */
-        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = MPIDI_CH3_iStartMsg(vc, put_pkt, sizeof(*put_pkt), &curr_req);
-        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
     else {
         MPI_Aint origin_type_size;
@@ -434,7 +434,7 @@ static int issue_put_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
             ext_hdr_sz = sizeof(MPIDI_CH3_Ext_pkt_put_derived_t) + target_dtp_ptr->dataloop_size;
             ext_hdr_ptr = MPIU_Malloc(ext_hdr_sz);
             if (!ext_hdr_ptr) {
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
+                MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                      "**nomem %s", "MPIDI_CH3_Ext_pkt_put_derived_t");
             }
 
@@ -446,7 +446,7 @@ static int issue_put_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
         mpi_errno = issue_from_origin_buffer(rma_op, vc, ext_hdr_ptr, ext_hdr_sz,
                                              0, rma_op->origin_count * origin_type_size, &curr_req);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     if (curr_req != NULL) {
@@ -472,7 +472,7 @@ static int issue_put_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
 #undef FUNCNAME
 #define FUNCNAME issue_acc_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int issue_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
                         MPIDI_RMA_Target_t * target_ptr, MPIDI_CH3_Pkt_flags_t flags)
 {
@@ -501,10 +501,10 @@ static int issue_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
         accum_pkt->flags |= flags;
 
         /* All origin data is in packet header, issue the header. */
-        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = MPIDI_CH3_iStartMsg(vc, accum_pkt, sizeof(*accum_pkt), &curr_req);
-        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
         if (curr_req != NULL) {
             MPIU_Assert(rma_op->reqs_size == 0 && rma_op->single_req == NULL);
@@ -580,7 +580,7 @@ static int issue_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
         mpi_errno = issue_from_origin_buffer(rma_op, vc, ext_hdr_ptr, ext_hdr_sz,
                                              stream_offset, stream_size, &curr_req);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (curr_req != NULL) {
             if (rma_op->reqs_size == 0) {
@@ -639,7 +639,7 @@ static int issue_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
 #undef FUNCNAME
 #define FUNCNAME issue_get_acc_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
                             MPIDI_RMA_Target_t * target_ptr, MPIDI_CH3_Pkt_flags_t flags)
 {
@@ -673,7 +673,7 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
          * datatype in it, and pass the request's handle in the GACC packet. When the
          * response comes from the target, it will contain the request handle. */
         resp_req = MPID_Request_create();
-        MPIU_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+        MPIR_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
 
         MPIU_Object_set_ref(resp_req, 2);
 
@@ -687,10 +687,10 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
         get_accum_pkt->request_handle = resp_req->handle;
 
         /* All origin data is in packet header, issue the header. */
-        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = MPIDI_CH3_iStartMsg(vc, get_accum_pkt, sizeof(*get_accum_pkt), &curr_req);
-        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
         if (curr_req != NULL) {
             MPID_Request_release(curr_req);
@@ -768,7 +768,7 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
          * datatype in it, and pass the request's handle in the GACC packet. When the
          * response comes from the target, it will contain the request handle. */
         resp_req = MPID_Request_create();
-        MPIU_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+        MPIR_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
 
         MPIU_Object_set_ref(resp_req, 2);
 
@@ -807,7 +807,7 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
         mpi_errno = issue_from_origin_buffer(rma_op, vc, ext_hdr_ptr, ext_hdr_sz,
                                              stream_offset, stream_size, &curr_req);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (curr_req != NULL) {
             MPID_Request_release(curr_req);
@@ -870,7 +870,7 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
 #undef FUNCNAME
 #define FUNCNAME issue_get_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
                         MPIDI_RMA_Target_t * target_ptr, MPIDI_CH3_Pkt_flags_t flags)
 {
@@ -897,7 +897,7 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
      * handle. */
     curr_req = MPID_Request_create();
     if (curr_req == NULL) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     }
 
     MPIU_Object_set_ref(curr_req, 2);
@@ -924,9 +924,9 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
     MPIDI_CH3_PKT_RMA_GET_TARGET_DATATYPE(rma_op->pkt, target_datatype, mpi_errno);
     if (MPIR_DATATYPE_IS_PREDEFINED(target_datatype)) {
         /* basic datatype on target. simply send the get_pkt. */
-        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = MPIDI_CH3_iStartMsg(vc, get_pkt, sizeof(*get_pkt), &req);
-        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
     }
     else {
         /* derived datatype on target. */
@@ -939,7 +939,7 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
         ext_hdr_sz = sizeof(MPIDI_CH3_Ext_pkt_get_derived_t) + dtp->dataloop_size;
         ext_hdr_ptr = MPIU_Malloc(ext_hdr_sz);
         if (!ext_hdr_ptr) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_get_derived_t");
         }
 
@@ -954,9 +954,9 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
         iov[1].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) ext_hdr_ptr;
         iov[1].MPL_IOV_LEN = ext_hdr_sz;
 
-        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = MPIDI_CH3_iStartMsgv(vc, iov, 2, &req);
-        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 
         /* release the target datatype */
         MPID_Datatype_release(dtp);
@@ -972,7 +972,7 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
     }
 
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
     /* release the request returned by iStartMsg or iStartMsgv */
@@ -997,7 +997,7 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
 #undef FUNCNAME
 #define FUNCNAME issue_cas_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int issue_cas_op(MPIDI_RMA_Op_t * rma_op,
                         MPID_Win * win_ptr, MPIDI_RMA_Target_t * target_ptr,
                         MPIDI_CH3_Pkt_flags_t flags)
@@ -1018,7 +1018,7 @@ static int issue_cas_op(MPIDI_RMA_Op_t * rma_op,
      * datatype in it, and pass the request's handle RMW packet. When the
      * response comes from the target, it will contain the request handle. */
     curr_req = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP(curr_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+    MPIR_ERR_CHKANDJUMP(curr_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
 
     /* Set refs on the request to 2: one for the response message, and one for
      * the partial completion handler */
@@ -1034,10 +1034,10 @@ static int issue_cas_op(MPIDI_RMA_Op_t * rma_op,
     cas_pkt->flags |= flags;
 
     MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc);
-    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, cas_pkt, sizeof(*cas_pkt), &rmw_req);
-    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-    MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+    MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
     if (rmw_req != NULL) {
         MPID_Request_release(rmw_req);
@@ -1060,7 +1060,7 @@ static int issue_cas_op(MPIDI_RMA_Op_t * rma_op,
 #undef FUNCNAME
 #define FUNCNAME issue_fop_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int issue_fop_op(MPIDI_RMA_Op_t * rma_op,
                         MPID_Win * win_ptr, MPIDI_RMA_Target_t * target_ptr,
                         MPIDI_CH3_Pkt_flags_t flags)
@@ -1081,7 +1081,7 @@ static int issue_fop_op(MPIDI_RMA_Op_t * rma_op,
      * datatype in it, and pass the request's handle in the GACC packet. When the
      * response comes from the target, it will contain the request handle. */
     resp_req = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+    MPIR_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
 
     MPIU_Object_set_ref(resp_req, 2);
 
@@ -1098,10 +1098,10 @@ static int issue_fop_op(MPIDI_RMA_Op_t * rma_op,
 
     if (rma_op->pkt.type == MPIDI_CH3_PKT_FOP_IMMED) {
         /* All origin data is in packet header, issue the header. */
-        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = MPIDI_CH3_iStartMsg(vc, fop_pkt, sizeof(*fop_pkt), &curr_req);
-        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
     else {
         MPI_Aint origin_dtp_size;
@@ -1109,7 +1109,7 @@ static int issue_fop_op(MPIDI_RMA_Op_t * rma_op,
         mpi_errno = issue_from_origin_buffer(rma_op, vc, NULL, 0,       /*ext_hdr_ptr, ext_hdr_sz */
                                              0, 1 * origin_dtp_size, &curr_req);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     if (curr_req != NULL) {
@@ -1135,7 +1135,7 @@ static int issue_fop_op(MPIDI_RMA_Op_t * rma_op,
 #undef FUNCNAME
 #define FUNCNAME issue_rma_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int issue_rma_op(MPIDI_RMA_Op_t * op_ptr, MPID_Win * win_ptr,
                                MPIDI_RMA_Target_t * target_ptr, MPIDI_CH3_Pkt_flags_t flags)
 {
@@ -1168,11 +1168,11 @@ static inline int issue_rma_op(MPIDI_RMA_Op_t * op_ptr, MPID_Win * win_ptr,
         mpi_errno = issue_fop_op(op_ptr, win_ptr, target_ptr, flags);
         break;
     default:
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**winInvalidOp");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**winInvalidOp");
     }
 
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_ISSUE_RMA_OP);
diff --git a/src/mpid/ch3/include/mpid_rma_lockqueue.h b/src/mpid/ch3/include/mpid_rma_lockqueue.h
index 6811494..057b2b9 100644
--- a/src/mpid/ch3/include/mpid_rma_lockqueue.h
+++ b/src/mpid/ch3/include/mpid_rma_lockqueue.h
@@ -18,7 +18,7 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_winlock_getlocallock);
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_target_lock_entry_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline MPIDI_RMA_Target_lock_entry_t *MPIDI_CH3I_Win_target_lock_entry_alloc(MPID_Win *
                                                                                     win_ptr,
                                                                                     MPIDI_CH3_Pkt_t
@@ -48,7 +48,7 @@ static inline MPIDI_RMA_Target_lock_entry_t *MPIDI_CH3I_Win_target_lock_entry_al
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_target_lock_entry_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Win_target_lock_entry_free(MPID_Win * win_ptr,
                                                         MPIDI_RMA_Target_lock_entry_t *
                                                         target_lock_entry)
diff --git a/src/mpid/ch3/include/mpid_rma_oplist.h b/src/mpid/ch3/include/mpid_rma_oplist.h
index f233116..73267b4 100644
--- a/src/mpid/ch3/include/mpid_rma_oplist.h
+++ b/src/mpid/ch3/include/mpid_rma_oplist.h
@@ -112,7 +112,7 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_set_active
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Win_set_active(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -139,7 +139,7 @@ static inline int MPIDI_CH3I_Win_set_active(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_set_inactive
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Win_set_inactive(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -167,7 +167,7 @@ static inline int MPIDI_CH3I_Win_set_inactive(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_op_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline MPIDI_RMA_Op_t *MPIDI_CH3I_Win_op_alloc(MPID_Win * win_ptr)
 {
     MPIDI_RMA_Op_t *e;
@@ -204,7 +204,7 @@ static inline MPIDI_RMA_Op_t *MPIDI_CH3I_Win_op_alloc(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_op_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Win_op_free(MPID_Win * win_ptr, MPIDI_RMA_Op_t * e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -231,7 +231,7 @@ static inline int MPIDI_CH3I_Win_op_free(MPID_Win * win_ptr, MPIDI_RMA_Op_t * e)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_target_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline MPIDI_RMA_Target_t *MPIDI_CH3I_Win_target_alloc(MPID_Win * win_ptr)
 {
     MPIDI_RMA_Target_t *e;
@@ -274,7 +274,7 @@ static inline MPIDI_RMA_Target_t *MPIDI_CH3I_Win_target_alloc(MPID_Win * win_ptr
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_target_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Win_target_free(MPID_Win * win_ptr, MPIDI_RMA_Target_t * e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -300,7 +300,7 @@ static inline int MPIDI_CH3I_Win_target_free(MPID_Win * win_ptr, MPIDI_RMA_Targe
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_create_target
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Win_create_target(MPID_Win * win_ptr, int target_rank,
                                                MPIDI_RMA_Target_t ** e)
 {
@@ -313,7 +313,7 @@ static inline int MPIDI_CH3I_Win_create_target(MPID_Win * win_ptr, int target_ra
     if (t == NULL) {
         mpi_errno = MPIDI_CH3I_RMA_Cleanup_target_aggressive(win_ptr, &t);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     t->target_rank = target_rank;
@@ -336,7 +336,7 @@ static inline int MPIDI_CH3I_Win_create_target(MPID_Win * win_ptr, int target_ra
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_find_target
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Win_find_target(MPID_Win * win_ptr, int target_rank,
                                              MPIDI_RMA_Target_t ** e)
 {
@@ -366,7 +366,7 @@ static inline int MPIDI_CH3I_Win_find_target(MPID_Win * win_ptr, int target_rank
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_enqueue_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Win_enqueue_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t * op)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -374,11 +374,11 @@ static inline int MPIDI_CH3I_Win_enqueue_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t *
 
     mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, op->target_rank, &target);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     if (target == NULL) {
         mpi_errno = MPIDI_CH3I_Win_create_target(win_ptr, op->target_rank, &target);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (win_ptr->states.access_state == MPIDI_RMA_PER_TARGET ||
             win_ptr->states.access_state == MPIDI_RMA_LOCK_ALL_GRANTED) {
@@ -448,7 +448,7 @@ static inline int MPIDI_CH3I_Win_enqueue_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t *
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_target_dequeue_and_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Win_target_dequeue_and_free(MPID_Win * win_ptr, MPIDI_RMA_Target_t * e)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -461,7 +461,7 @@ static inline int MPIDI_CH3I_Win_target_dequeue_and_free(MPID_Win * win_ptr, MPI
 
     mpi_errno = MPIDI_CH3I_Win_target_free(win_ptr, e);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     return mpi_errno;
@@ -472,7 +472,7 @@ static inline int MPIDI_CH3I_Win_target_dequeue_and_free(MPID_Win * win_ptr, MPI
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_RMA_Cleanup_targets_win
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_RMA_Cleanup_targets_win(MPID_Win * win_ptr)
 {
     MPIDI_RMA_Target_t *target = NULL, *next_target = NULL;
@@ -483,7 +483,7 @@ static inline int MPIDI_CH3I_RMA_Cleanup_targets_win(MPID_Win * win_ptr)
             next_target = target->next;
             mpi_errno = MPIDI_CH3I_Win_target_dequeue_and_free(win_ptr, target);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             target = next_target;
         }
     }
@@ -497,7 +497,7 @@ static inline int MPIDI_CH3I_RMA_Cleanup_targets_win(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Win_get_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Win_get_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t ** e)
 {
     MPIDI_RMA_Op_t *new_ptr = NULL;
@@ -512,7 +512,7 @@ static inline int MPIDI_CH3I_Win_get_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t ** e)
 
         mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_aggressive(win_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     (*e) = new_ptr;
@@ -532,7 +532,7 @@ static inline int MPIDI_CH3I_Win_get_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t ** e)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_RMA_Ops_free_elem
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline void MPIDI_CH3I_RMA_Ops_free_elem(MPID_Win * win_ptr, MPIDI_RMA_Ops_list_t * list,
                                                 MPIDI_RMA_Op_t * curr_ptr)
 {
diff --git a/src/mpid/ch3/include/mpid_rma_shm.h b/src/mpid/ch3/include/mpid_rma_shm.h
index 66dd4b3..1e82d3e 100644
--- a/src/mpid/ch3/include/mpid_rma_shm.h
+++ b/src/mpid/ch3/include/mpid_rma_shm.h
@@ -236,7 +236,7 @@ static inline int shm_copy(const void *src, int scount, MPI_Datatype stype,
 
     mpi_errno = MPIR_Localcopy(src, scount, stype, dest, dcount, dtype);
     if (mpi_errno) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -250,7 +250,7 @@ static inline int shm_copy(const void *src, int scount, MPI_Datatype stype,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Shm_put_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Shm_put_op(const void *origin_addr, int origin_count, MPI_Datatype
                                         origin_datatype, int target_rank, MPI_Aint target_disp,
                                         int target_count, MPI_Datatype target_datatype,
@@ -277,7 +277,7 @@ static inline int MPIDI_CH3I_Shm_put_op(const void *origin_addr, int origin_coun
     mpi_errno = shm_copy(origin_addr, origin_count, origin_datatype,
                          (char *) base + disp_unit * target_disp, target_count, target_datatype);
     if (mpi_errno) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -293,7 +293,7 @@ static inline int MPIDI_CH3I_Shm_put_op(const void *origin_addr, int origin_coun
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Shm_acc_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_count, MPI_Datatype
                                         origin_datatype, int target_rank, MPI_Aint target_disp,
                                         int target_count, MPI_Datatype target_datatype, MPI_Op op,
@@ -337,7 +337,7 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
         }
 
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         goto fn_exit;
     }
@@ -377,7 +377,7 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
         packed_buf = MPIU_Malloc(stream_size);
 
         seg = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+        MPIR_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
                              "MPID_Segment");
         MPID_Segment_init(origin_addr, origin_count, origin_datatype, seg, 0);
         MPID_Segment_pack(seg, first, &last, packed_buf);
@@ -390,7 +390,7 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
             mpi_errno = MPIR_Localcopy(tmpbuf, stream_count, basic_type,
                                        packed_buf, stream_size, MPI_BYTE);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             MPIU_Free(packed_buf);
             packed_buf = tmpbuf;
         }
@@ -409,7 +409,7 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
         }
 
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIU_Free(packed_buf);
     }
@@ -427,7 +427,7 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Shm_get_acc_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_count, MPI_Datatype
                                             origin_datatype, void *result_addr, int result_count,
                                             MPI_Datatype result_datatype, int target_rank, MPI_Aint
@@ -471,7 +471,7 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
     mpi_errno = shm_copy((char *) base + disp_unit * target_disp, target_count, target_datatype,
                          result_addr, result_count, result_datatype);
     if (mpi_errno) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     if (is_empty_origin == TRUE || MPIR_DATATYPE_IS_PREDEFINED(origin_datatype)) {
@@ -484,7 +484,7 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
         }
 
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         goto fn_exit;
     }
@@ -524,7 +524,7 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
         packed_buf = MPIU_Malloc(stream_size);
 
         seg = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+        MPIR_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
                              "MPID_Segment");
         MPID_Segment_init(origin_addr, origin_count, origin_datatype, seg, 0);
         MPID_Segment_pack(seg, first, &last, packed_buf);
@@ -537,7 +537,7 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
             mpi_errno = MPIR_Localcopy(tmpbuf, stream_count, basic_type,
                                        packed_buf, stream_size, MPI_BYTE);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             MPIU_Free(packed_buf);
             packed_buf = tmpbuf;
         }
@@ -548,7 +548,7 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
                                      target_count, target_datatype, stream_offset, op);
 
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIU_Free(packed_buf);
     }
@@ -574,7 +574,7 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Shm_get_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Shm_get_op(void *origin_addr, int origin_count,
                                         MPI_Datatype origin_datatype, int target_rank,
                                         MPI_Aint target_disp, int target_count,
@@ -601,7 +601,7 @@ static inline int MPIDI_CH3I_Shm_get_op(void *origin_addr, int origin_count,
     mpi_errno = shm_copy((char *) base + disp_unit * target_disp, target_count, target_datatype,
                          origin_addr, origin_count, origin_datatype);
     if (mpi_errno) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -617,7 +617,7 @@ static inline int MPIDI_CH3I_Shm_get_op(void *origin_addr, int origin_count,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Shm_cas_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Shm_cas_op(const void *origin_addr, const void *compare_addr,
                                         void *result_addr, MPI_Datatype datatype, int target_rank,
                                         MPI_Aint target_disp, MPID_Win * win_ptr)
@@ -675,7 +675,7 @@ static inline int MPIDI_CH3I_Shm_cas_op(const void *origin_addr, const void *com
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Shm_fop_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Shm_fop_op(const void *origin_addr, void *result_addr,
                                         MPI_Datatype datatype, int target_rank,
                                         MPI_Aint target_disp, MPI_Op op, MPID_Win * win_ptr)
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index e456b9c..10a14b8 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 (!MPIU_THREADPRIV_FIELD(request_handles)) {                 \
             MPID_Request *prev, *cur;                                  \
             /* batch allocate a linked list of requests */             \
-            MPIU_THREAD_CS_ENTER(HANDLEALLOC,);                        \
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.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;                                            \
             }                                                          \
-            MPIU_THREAD_CS_EXIT(HANDLEALLOC,);                         \
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.handle_mutex);                         \
             MPIU_THREADPRIV_FIELD(request_handles) = cur;              \
             MPIU_THREADPRIV_FIELD(request_handle_count) += MPID_REQUEST_TLS_MAX;    \
         }                                                              \
@@ -1022,8 +1022,8 @@ extern char *MPIDI_DBG_parent_str;
 #endif
 
 /* This is used to quote a name in a definition (see FUNCNAME/FCNAME below) */
-#define MPIU_QUOTE(A) MPIU_QUOTE2(A)
-#define MPIU_QUOTE2(A) #A
+#define MPL_QUOTE(A) MPL_QUOTE2(A)
+#define MPL_QUOTE2(A) #A
 
 #ifdef MPICH_DBG_OUTPUT
     void MPIDI_DBG_Print_packet(MPIDI_CH3_Pkt_t *pkt);
@@ -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 {                                                                         \
-        MPIU_THREAD_CS_ENTER(COMPLETION,);                                       \
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.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);                      \
-        MPIU_THREAD_CS_EXIT(COMPLETION,);                                        \
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.completion_mutex);                                        \
     } while (0)
 #endif
 
@@ -1877,47 +1877,19 @@ int MPIDI_CH3_Req_handler_rma_op_complete(MPID_Request *);
 
 /* Thread Support */
 #ifdef MPICH_IS_THREADED
-#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL
+#if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL
 /* There is a single, global lock, held for the duration of an MPI call */
-#define MPIU_THREAD_CS_ENTER_CH3COMM(context_)
-#define MPIU_THREAD_CS_EXIT_CH3COMM(context_)
-
 #define MPIU_THREAD_CS_ENTER_LMT(_context)
 #define MPIU_THREAD_CS_EXIT_LMT(_context)
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
-
-#define MPIU_THREAD_CS_ENTER_POBJ_MUTEX(mutex_p_)                                                           \
-    do {                                                                                                    \
-        MPIU_DBG_MSG_P(THREAD,VERBOSE,"attempting to ENTER per-object CS, mutex=%s", MPIU_QUOTE(mutex_p_)); \
-        /* FIXME do we need nest checking here? the existing macros won't work unmodified...*/              \
-        MPID_Thread_mutex_lock(mutex_p_);                                                                   \
-    } while (0)
-#define MPIU_THREAD_CS_EXIT_POBJ_MUTEX(mutex_p_)                                                            \
-    do {                                                                                                    \
-        MPIU_DBG_MSG_P(THREAD,VERBOSE,"attempting to EXIT per-object CS, mutex=%s", MPIU_QUOTE(mutex_p_));  \
-        /* FIXME do we need nest checking here? the existing macros won't work unmodified...*/              \
-        MPID_Thread_mutex_unlock(mutex_p_);                                                                 \
-    } while (0)
-
-/* There is a per object lock */
-#define MPIU_THREAD_CS_ENTER_CH3COMM(context_)                      \
-    do {                                                            \
-        if (MPIU_ISTHREADED)                                        \
-            MPIU_THREAD_CS_ENTER_POBJ_MUTEX(&context_->pobj_mutex); \
-    } while (0)
-#define MPIU_THREAD_CS_EXIT_CH3COMM(context_)                       \
-    do {                                                            \
-        if (MPIU_ISTHREADED)                                        \
-            MPIU_THREAD_CS_EXIT_POBJ_MUTEX(&context_->pobj_mutex);  \
-    } while (0)
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT
 
 /* MT FIXME making LMT into MPIDCOMM for now because of overwhelming deadlock
  * issues */
-#define MPIU_THREAD_CS_ENTER_LMT(context_) MPIU_THREAD_CS_ENTER_MPIDCOMM(context_)
-#define MPIU_THREAD_CS_EXIT_LMT(context_)  MPIU_THREAD_CS_EXIT_MPIDCOMM(context_)
+#define MPIU_THREAD_CS_ENTER_LMT(context_) MPID_THREAD_CS_ENTER_MPIDCOMM(context_)
+#define MPIU_THREAD_CS_EXIT_LMT(context_)  MPID_THREAD_CS_EXIT_MPIDCOMM(context_)
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_SINGLE
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_SINGLE
 /* No thread support, make all operations a no-op */
 /* FIXME incomplete? or already handled by the upper level? */
 /* FIXME does it make sense to have (MPICH_IS_THREADED && _GRANULARITY==_SINGLE) ? */
diff --git a/src/mpid/ch3/include/mpidpkt.h b/src/mpid/ch3/include/mpidpkt.h
index b3f1c38..82a0921 100644
--- a/src/mpid/ch3/include/mpidpkt.h
+++ b/src/mpid/ch3/include/mpidpkt.h
@@ -228,7 +228,7 @@ MPIDI_CH3_PKT_DEFS
             datatype_ = (pkt_).fop.datatype;                            \
             break;                                                      \
         default:                                                        \
-            MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
+            MPIR_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
         }                                                               \
     }
 
@@ -259,7 +259,7 @@ MPIDI_CH3_PKT_DEFS
             count_ = 1;                                                 \
             break;                                                      \
         default:                                                        \
-            MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
+            MPIR_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
         }                                                               \
     }
 
@@ -300,7 +300,7 @@ MPIDI_CH3_PKT_DEFS
             immed_data_ = &((pkt_).cas_resp.info.data);                 \
             break;                                                      \
         default:                                                        \
-            MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
+            MPIR_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
         }                                                               \
     }
 
@@ -363,7 +363,7 @@ MPIDI_CH3_PKT_DEFS
             flags_ = (pkt_).lock_op_ack.flags;                          \
             break;                                                      \
         default:                                                        \
-            MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
+            MPIR_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
         }                                                               \
     }
 
@@ -386,7 +386,7 @@ MPIDI_CH3_PKT_DEFS
             op_ = (pkt_).fop.op;                                        \
             break;                                                      \
         default:                                                        \
-            MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
+            MPIR_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
         }                                                               \
     }
 
@@ -449,7 +449,7 @@ MPIDI_CH3_PKT_DEFS
             (pkt_).lock_op_ack.flags = MPIDI_CH3_PKT_FLAG_NONE;         \
             break;                                                      \
         default:                                                        \
-            MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
+            MPIR_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
         }                                                               \
     }
 
@@ -489,7 +489,7 @@ MPIDI_CH3_PKT_DEFS
             win_hdl_ = (pkt_).ack.source_win_handle;                    \
             break;                                                      \
         default:                                                        \
-            MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
+            MPIR_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
         }                                                               \
     }
 
@@ -535,7 +535,7 @@ MPIDI_CH3_PKT_DEFS
             win_hdl_ = (pkt_).decr_at_cnt.target_win_handle;            \
             break;                                                      \
         default:                                                        \
-            MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
+            MPIR_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
         }                                                               \
     }
 
@@ -558,7 +558,7 @@ MPIDI_CH3_PKT_DEFS
             (pkt_).get_accum.info.dataloop_size = (dataloop_size_);     \
             break;                                                      \
         default:                                                        \
-            MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
+            MPIR_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
         }                                                               \
     }
 
@@ -605,7 +605,7 @@ MPIDI_CH3_PKT_DEFS
             request_hdl_ = (pkt_).lock_op_ack.request_handle;           \
             break;                                                      \
         default:                                                        \
-            MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
+            MPIR_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
         }                                                               \
     }
 
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 7c01021..393a98e 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -26,6 +26,11 @@ typedef MPIU_Pint MPIDI_msg_sz_t;
 /* FIXME: Include here? */
 #include "opa_primitives.h"
 
+/* We simply use the fallback thread functionality and do not define
+ * our own */
+#include "mpid_thread_fallback.h"
+#include "mpid_timers_fallback.h"
+
 union MPIDI_CH3_Pkt;
 struct MPIDI_VC;
 struct MPID_Request;
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 630ea70..1bdd393 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -16,7 +16,7 @@
 #undef FUNCNAME
 #define FUNCNAME send_lock_msg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int send_lock_msg(int dest, int lock_type, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -41,10 +41,10 @@ static inline int send_lock_msg(int dest, int lock_type, MPID_Win * win_ptr)
         lock_pkt->flags |= MPIDI_CH3_PKT_FLAG_RMA_LOCK_EXCLUSIVE;
     }
 
-    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, lock_pkt, sizeof(*lock_pkt), &req);
-    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-    MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+    MPIR_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
 
     /* release the request returned by iStartMsg */
     if (req != NULL) {
@@ -63,7 +63,7 @@ static inline int send_lock_msg(int dest, int lock_type, MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME send_unlock_msg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int send_unlock_msg(int dest, MPID_Win * win_ptr, MPIDI_CH3_Pkt_flags_t flags)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -84,10 +84,10 @@ static inline int send_unlock_msg(int dest, MPID_Win * win_ptr, MPIDI_CH3_Pkt_fl
     unlock_pkt->source_win_handle = win_ptr->handle;
     unlock_pkt->flags = flags;
 
-    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, unlock_pkt, sizeof(*unlock_pkt), &req);
-    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-    MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+    MPIR_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
 
     /* Release the request returned by iStartMsg */
     if (req != NULL) {
@@ -107,7 +107,7 @@ static inline int send_unlock_msg(int dest, MPID_Win * win_ptr, MPIDI_CH3_Pkt_fl
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Send_lock_ack_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Send_lock_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_ptr,
                                                MPIDI_CH3_Pkt_flags_t flags,
                                                MPI_Win source_win_handle,
@@ -134,11 +134,11 @@ static inline int MPIDI_CH3I_Send_lock_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_p
                      (MPIU_DBG_FDEST, "sending lock ack pkt on vc=%p, source_win_handle=%#08x",
                       vc, lock_ack_pkt->source_win_handle));
 
-    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, lock_ack_pkt, sizeof(*lock_ack_pkt), &req);
-    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
     if (mpi_errno) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
     if (req != NULL) {
@@ -154,7 +154,7 @@ static inline int MPIDI_CH3I_Send_lock_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_p
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Send_lock_op_ack_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Send_lock_op_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_ptr,
                                                   MPIDI_CH3_Pkt_flags_t flags,
                                                   MPI_Win source_win_handle,
@@ -181,11 +181,11 @@ static inline int MPIDI_CH3I_Send_lock_op_ack_pkt(MPIDI_VC_t * vc, MPID_Win * wi
                      (MPIU_DBG_FDEST, "sending lock op ack pkt on vc=%p, source_win_handle=%#08x",
                       vc, lock_op_ack_pkt->source_win_handle));
 
-    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, lock_op_ack_pkt, sizeof(*lock_op_ack_pkt), &req);
-    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
     if (mpi_errno) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
     if (req != NULL) {
@@ -201,7 +201,7 @@ static inline int MPIDI_CH3I_Send_lock_op_ack_pkt(MPIDI_VC_t * vc, MPID_Win * wi
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Send_ack_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Send_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_ptr,
                                           MPI_Win source_win_handle)
 {
@@ -218,11 +218,11 @@ static inline int MPIDI_CH3I_Send_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_ptr,
     ack_pkt->target_rank = win_ptr->comm_ptr->rank;
 
     /* Because this is in a packet handler, it is already within a critical section */
-    /* MPIU_THREAD_CS_ENTER(CH3COMM,vc); */
+    /* MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex); */
     mpi_errno = MPIDI_CH3_iStartMsg(vc, ack_pkt, sizeof(*ack_pkt), &req);
-    /* MPIU_THREAD_CS_EXIT(CH3COMM,vc); */
+    /* MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex); */
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
     if (req != NULL) {
@@ -238,7 +238,7 @@ static inline int MPIDI_CH3I_Send_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_ptr,
 #undef FUNCNAME
 #define FUNCNAME send_decr_at_cnt_msg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int send_decr_at_cnt_msg(int dst, MPID_Win * win_ptr, MPIDI_CH3_Pkt_flags_t flags)
 {
     MPIDI_CH3_Pkt_t upkt;
@@ -256,11 +256,11 @@ static inline int send_decr_at_cnt_msg(int dst, MPID_Win * win_ptr, MPIDI_CH3_Pk
 
     MPIDI_Comm_get_vc_set_active(win_ptr->comm_ptr, dst, &vc);
 
-    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, decr_at_cnt_pkt, sizeof(*decr_at_cnt_pkt), &request);
-    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
     if (request != NULL) {
@@ -280,7 +280,7 @@ static inline int send_decr_at_cnt_msg(int dst, MPID_Win * win_ptr, MPIDI_CH3_Pk
 #undef FUNCNAME
 #define FUNCNAME send_flush_msg
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int send_flush_msg(int dest, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -297,10 +297,10 @@ static inline int send_flush_msg(int dest, MPID_Win * win_ptr)
     flush_pkt->target_win_handle = win_ptr->basic_info_table[dest].win_handle;
     flush_pkt->source_win_handle = win_ptr->handle;
 
-    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, flush_pkt, sizeof(*flush_pkt), &req);
-    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-    MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+    MPIR_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
 
     /* Release the request returned by iStartMsg */
     if (req != NULL) {
@@ -489,7 +489,7 @@ static inline int enqueue_lock_origin(MPID_Win * win_ptr, MPIDI_VC_t * vc,
 
         mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         /* return bytes of data processed in this pkt handler */
         (*buflen) = sizeof(MPIDI_CH3_Pkt_t) + data_len;
@@ -497,7 +497,7 @@ static inline int enqueue_lock_origin(MPID_Win * win_ptr, MPIDI_VC_t * vc,
         if (complete) {
             mpi_errno = MPIDI_CH3_ReqHandler_PiggybackLockOpRecvComplete(vc, req, &complete);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             if (complete) {
                 goto issue_ack;
             }
@@ -519,7 +519,7 @@ static inline int enqueue_lock_origin(MPID_Win * win_ptr, MPIDI_VC_t * vc,
         mpi_errno =
             MPIDI_CH3I_Send_lock_ack_pkt(vc, win_ptr, flag, source_win_handle, request_handle);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     else {
         if (lock_discarded)
@@ -541,7 +541,7 @@ static inline int enqueue_lock_origin(MPID_Win * win_ptr, MPIDI_VC_t * vc,
         mpi_errno =
             MPIDI_CH3I_Send_lock_op_ack_pkt(vc, win_ptr, flag, source_win_handle, request_handle);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -574,7 +574,7 @@ static inline int handle_lock_ack(MPID_Win * win_ptr, int target_rank, MPIDI_CH3
                 /* re-send lock request message. */
                 mpi_errno = send_lock_msg(target_rank, MPI_LOCK_SHARED, win_ptr);
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
             goto fn_exit;
         }
@@ -589,7 +589,7 @@ static inline int handle_lock_ack(MPID_Win * win_ptr, int target_rank, MPIDI_CH3
                 if (win_ptr->num_targets_with_pending_net_ops) {
                     mpi_errno = MPIDI_CH3I_Win_set_active(win_ptr);
                     if (mpi_errno != MPI_SUCCESS) {
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                     }
                 }
             }
@@ -598,14 +598,14 @@ static inline int handle_lock_ack(MPID_Win * win_ptr, int target_rank, MPIDI_CH3
             /* re-send lock request message. */
             mpi_errno = send_lock_msg(target_rank, MPI_LOCK_SHARED, win_ptr);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
         goto fn_exit;
     }
 
     mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, target_rank, &t);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(t != NULL);
 
     if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
@@ -621,7 +621,7 @@ static inline int handle_lock_ack(MPID_Win * win_ptr, int target_rank, MPIDI_CH3
             mpi_errno =
                 MPIDI_CH3I_RMA_Make_progress_target(win_ptr, t->target_rank, &made_progress);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -639,7 +639,7 @@ static inline int handle_lock_ack(MPID_Win * win_ptr, int target_rank, MPIDI_CH3
 #undef FUNCNAME
 #define FUNCNAME check_and_set_req_completion
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int check_and_set_req_completion(MPID_Win * win_ptr, MPIDI_RMA_Target_t * target,
                                                MPIDI_RMA_Op_t * rma_op, int *op_completed)
 {
@@ -685,7 +685,7 @@ static inline int check_and_set_req_completion(MPID_Win * win_ptr, MPIDI_RMA_Tar
         if (rma_op->ureq != NULL) {
             mpi_errno = MPID_Request_complete(rma_op->ureq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
         }
         (*op_completed) = TRUE;
@@ -724,7 +724,7 @@ static inline int handle_lock_ack_with_op(MPID_Win * win_ptr,
 
     mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, target_rank, &target);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(target != NULL);
 
     /* Here the next_op_to_issue pointer should still point to the OP piggybacked
@@ -796,7 +796,7 @@ static inline int handle_lock_ack_with_op(MPID_Win * win_ptr,
 #undef FUNCNAME
 #define FUNCNAME acquire_local_lock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int acquire_local_lock(MPID_Win * win_ptr, int lock_type)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -809,7 +809,7 @@ static inline int acquire_local_lock(MPID_Win * win_ptr, int lock_type)
         mpi_errno = handle_lock_ack(win_ptr, win_ptr->comm_ptr->rank,
                                     MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     else {
         /* Queue the lock information. */
@@ -834,7 +834,7 @@ static inline int acquire_local_lock(MPID_Win * win_ptr, int lock_type)
             mpi_errno = handle_lock_ack(win_ptr, win_ptr->comm_ptr->rank,
                                         MPIDI_CH3_PKT_FLAG_RMA_LOCK_DISCARDED);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
         MPL_DL_APPEND((*head_ptr), new_ptr);
@@ -858,7 +858,7 @@ static inline int acquire_local_lock(MPID_Win * win_ptr, int lock_type)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_RMA_Handle_ack
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_RMA_Handle_ack(MPID_Win * win_ptr, int target_rank)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -866,7 +866,7 @@ static inline int MPIDI_CH3I_RMA_Handle_ack(MPID_Win * win_ptr, int target_rank)
 
     mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, target_rank, &t);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     t->sync.outstanding_acks--;
     MPIU_Assert(t->sync.outstanding_acks >= 0);
@@ -881,7 +881,7 @@ static inline int MPIDI_CH3I_RMA_Handle_ack(MPID_Win * win_ptr, int target_rank)
 #undef FUNCNAME
 #define FUNCNAME do_accumulate_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int do_accumulate_op(void *source_buf, int source_count, MPI_Datatype source_dtp,
                                    void *target_buf, int target_count, MPI_Datatype target_dtp,
                                    MPI_Aint stream_offset, MPI_Op acc_op)
@@ -1056,7 +1056,7 @@ static inline int check_piggyback_lock(MPID_Win * win_ptr, MPIDI_VC_t * vc,
             /* cannot acquire the lock, queue up this operation. */
             mpi_errno = enqueue_lock_origin(win_ptr, vc, pkt, buflen, reqp);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             (*acquire_lock_fail) = 1;
         }
     }
@@ -1085,7 +1085,7 @@ static inline int finish_op_on_target(MPID_Win * win_ptr, MPIDI_VC_t * vc,
                                                         pkt_flags,
                                                         source_win_handle, MPI_REQUEST_NULL);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             MPIDI_CH3_Progress_signal_completion();
         }
         if (flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) {
@@ -1095,7 +1095,7 @@ static inline int finish_op_on_target(MPID_Win * win_ptr, MPIDI_VC_t * vc,
                  * we only send LOCK ACK back, do not send FLUSH ACK. */
                 mpi_errno = MPIDI_CH3I_Send_ack_pkt(vc, win_ptr, source_win_handle);
                 if (mpi_errno)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
             MPIDI_CH3_Progress_signal_completion();
         }
@@ -1113,11 +1113,11 @@ static inline int finish_op_on_target(MPID_Win * win_ptr, MPIDI_VC_t * vc,
                  * we only send LOCK ACK back, do not send FLUSH (UNLOCK) ACK. */
                 mpi_errno = MPIDI_CH3I_Send_ack_pkt(vc, win_ptr, source_win_handle);
                 if (mpi_errno)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
             mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             MPIDI_CH3_Progress_signal_completion();
         }
     }
@@ -1127,7 +1127,7 @@ static inline int finish_op_on_target(MPID_Win * win_ptr, MPIDI_VC_t * vc,
         if (flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
             mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             MPIDI_CH3_Progress_signal_completion();
         }
 
@@ -1165,16 +1165,16 @@ static inline int fill_ranks_in_win_grp(MPID_Win * win_ptr, MPID_Group * group_p
 
     mpi_errno = MPIR_Comm_group_impl(win_ptr->comm_ptr, &win_grp_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIR_Group_translate_ranks_impl(group_ptr, group_ptr->size,
                                                 ranks_in_grp, win_grp_ptr, ranks_in_win_grp);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIR_Group_free_impl(win_grp_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIU_CHKLMEM_FREEALL();
@@ -1195,7 +1195,7 @@ static inline int wait_progress_engine(void)
     /* --BEGIN ERROR HANDLING-- */
     if (mpi_errno != MPI_SUCCESS) {
         MPID_Progress_end(&progress_state);
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**winnoprogress");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**winnoprogress");
     }
     /* --END ERROR HANDLING-- */
     MPID_Progress_end(&progress_state);
@@ -1214,7 +1214,7 @@ static inline int poke_progress_engine(void)
     MPID_Progress_start(&progress_state);
     mpi_errno = MPID_Progress_poke();
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     MPID_Progress_end(&progress_state);
 
   fn_exit:
diff --git a/src/mpid/ch3/src/ch3u_buffer.c b/src/mpid/ch3/src/ch3u_buffer.c
index e852ace..9302c0f 100644
--- a/src/mpid/ch3/src/ch3u_buffer.c
+++ b/src/mpid/ch3/src/ch3u_buffer.c
@@ -31,7 +31,7 @@ Used indirectly by mpid_irecv, mpid_recv (through MPIDI_CH3_RecvFromSelf) and
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Buffer_copy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDI_CH3U_Buffer_copy(
     const void * const sbuf, MPI_Aint scount, MPI_Datatype sdt, int * smpi_errno,
     void * const rbuf, MPI_Aint rcount, MPI_Datatype rdt, MPIDI_msg_sz_t * rsz,
@@ -243,7 +243,7 @@ int MPIDI_CH3_RecvFromSelf( MPID_Request *rreq, void *buf, MPI_Aint count,
 	MPIR_STATUS_SET_COUNT(rreq->status, data_sz);
 	mpi_errno = MPID_Request_complete(sreq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
     else
@@ -257,7 +257,7 @@ int MPIDI_CH3_RecvFromSelf( MPID_Request *rreq, void *buf, MPI_Aint count,
        reset ref_count and cc */
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
diff --git a/src/mpid/ch3/src/ch3u_comm.c b/src/mpid/ch3/src/ch3u_comm.c
index b355ce2..7458f9a 100644
--- a/src/mpid/ch3/src/ch3u_comm.c
+++ b/src/mpid/ch3/src/ch3u_comm.c
@@ -53,7 +53,7 @@ static hook_elt *destroy_hooks_tail = NULL;
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Comm_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Comm_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -68,7 +68,7 @@ int MPIDI_CH3I_Comm_init(void)
 
     /* register hooks for keeping track of communicators */
     mpi_errno = MPIDI_CH3U_Comm_register_create_hook(comm_created, NULL);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 #if defined HAVE_LIBHCOLL
     if (MPIR_CVAR_CH3_ENABLE_HCOLL) {
@@ -81,7 +81,7 @@ int MPIDI_CH3I_Comm_init(void)
              * Test to make sure it's available before choosing to
              * enable or disable it. */
             r = MPL_putenv("HCOLL_ENABLE_MCAST_ALL=0");
-            MPIU_ERR_CHKANDJUMP(r, mpi_errno, MPI_ERR_OTHER, "**putenv");
+            MPIR_ERR_CHKANDJUMP(r, mpi_errno, MPI_ERR_OTHER, "**putenv");
         }
 
 #if defined MPID_CH3I_CH_HCOLL_BCOL
@@ -93,19 +93,19 @@ int MPIDI_CH3I_Comm_init(void)
             MPL_snprintf(envstr, size, "HCOLL_BCOL=%s", MPID_CH3I_CH_HCOLL_BCOL);
 
             r = MPL_putenv(envstr);
-            MPIU_ERR_CHKANDJUMP(r, mpi_errno, MPI_ERR_OTHER, "**putenv");
+            MPIR_ERR_CHKANDJUMP(r, mpi_errno, MPI_ERR_OTHER, "**putenv");
         }
 #endif
 
         mpi_errno = MPIDI_CH3U_Comm_register_create_hook(hcoll_comm_create, NULL);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         mpi_errno = MPIDI_CH3U_Comm_register_destroy_hook(hcoll_comm_destroy, NULL);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 #endif
 
     mpi_errno = MPIDI_CH3U_Comm_register_destroy_hook(comm_destroyed, NULL);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3U_COMM_INIT);
@@ -181,7 +181,7 @@ static inline int map_size(MPIR_Comm_map_t map)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Comm_create_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Comm_create_hook(MPID_Comm *comm)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -302,7 +302,7 @@ int MPIDI_CH3I_Comm_create_hook(MPID_Comm *comm)
 
     MPL_LL_FOREACH(create_hooks_head, elt) {
         mpi_errno = elt->hook_fn(comm, elt->param);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);;
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);;
     }
 
  fn_exit:
@@ -315,7 +315,7 @@ int MPIDI_CH3I_Comm_create_hook(MPID_Comm *comm)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Comm_destroy_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Comm_destroy_hook(MPID_Comm *comm)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -326,15 +326,15 @@ int MPIDI_CH3I_Comm_destroy_hook(MPID_Comm *comm)
 
     MPL_LL_FOREACH(destroy_hooks_head, elt) {
         mpi_errno = elt->hook_fn(comm, elt->param);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     mpi_errno = MPIDI_VCRT_Release(comm->dev.vcrt, comm->dev.is_disconnected);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (comm->comm_kind == MPID_INTERCOMM) {
         mpi_errno = MPIDI_VCRT_Release(comm->dev.local_vcrt, comm->dev.is_disconnected);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -348,7 +348,7 @@ int MPIDI_CH3I_Comm_destroy_hook(MPID_Comm *comm)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Comm_register_create_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Comm_register_create_hook(int (*hook_fn)(struct MPID_Comm *, void *), void *param)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -377,7 +377,7 @@ int MPIDI_CH3U_Comm_register_create_hook(int (*hook_fn)(struct MPID_Comm *, void
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Comm_register_destroy_hook
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Comm_register_destroy_hook(int (*hook_fn)(struct MPID_Comm *, void *), void *param)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -405,7 +405,7 @@ int MPIDI_CH3U_Comm_register_destroy_hook(int (*hook_fn)(struct MPID_Comm *, voi
 #undef FUNCNAME
 #define FUNCNAME register_hook_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int register_hook_finalize(void *param)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -435,7 +435,7 @@ static int register_hook_finalize(void *param)
 #undef FUNCNAME
 #define FUNCNAME comm_created
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int comm_created(MPID_Comm *comm, void *param)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -463,7 +463,7 @@ int comm_created(MPID_Comm *comm, void *param)
 #undef FUNCNAME
 #define FUNCNAME comm_destroyed
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int comm_destroyed(MPID_Comm *comm, void *param)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -487,7 +487,7 @@ int comm_destroyed(MPID_Comm *comm, void *param)
 #undef FUNCNAME
 #define FUNCNAME nonempty_intersection
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int nonempty_intersection(MPID_Comm *comm, MPID_Group *group, int *flag)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -532,7 +532,7 @@ static int nonempty_intersection(MPID_Comm *comm, MPID_Group *group, int *flag)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Comm_handle_failed_procs
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Comm_handle_failed_procs(MPID_Group *new_failed_procs)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -551,7 +551,7 @@ int MPIDI_CH3I_Comm_handle_failed_procs(MPID_Group *new_failed_procs)
             continue;
 
         mpi_errno = nonempty_intersection(comm, new_failed_procs, &flag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (flag) {
             MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE,
diff --git a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
index 658cd4d..c56ec4c 100644
--- a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
+++ b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
@@ -33,7 +33,7 @@
 #undef FUNCNAME
 #define FUNCNAME mpi_to_pmi_keyvals
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int  mpi_to_pmi_keyvals( MPID_Info *info_ptr, PMI_keyval_t **kv_ptr, 
 				int *nkeys_ptr )
 {
@@ -50,21 +50,21 @@ static int  mpi_to_pmi_keyvals( MPID_Info *info_ptr, PMI_keyval_t **kv_ptr,
 	goto fn_exit;
     }
     kv = (PMI_keyval_t *)MPIU_Malloc( nkeys * sizeof(PMI_keyval_t) );
-    if (!kv) { MPIU_ERR_POP(mpi_errno); }
+    if (!kv) { MPIR_ERR_POP(mpi_errno); }
 
     for (i=0; i<nkeys; i++) {
 	mpi_errno = MPIR_Info_get_nthkey_impl( info_ptr, i, key );
-	if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 	MPIR_Info_get_valuelen_impl( info_ptr, key, &vallen, &flag );
-        MPIU_ERR_CHKANDJUMP1(!flag, mpi_errno, MPI_ERR_OTHER,"**infonokey", "**infonokey %s", key);
+        MPIR_ERR_CHKANDJUMP1(!flag, mpi_errno, MPI_ERR_OTHER,"**infonokey", "**infonokey %s", key);
 
 	kv[i].key = MPIU_Strdup(key);
 	kv[i].val = MPIU_Malloc( vallen + 1 );
 	if (!kv[i].key || !kv[i].val) { 
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem" );
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem" );
 	}
 	MPIR_Info_get_impl( info_ptr, key, vallen+1, kv[i].val, &flag );
-        MPIU_ERR_CHKANDJUMP1(!flag, mpi_errno, MPI_ERR_OTHER,"**infonokey", "**infonokey %s", key);
+        MPIR_ERR_CHKANDJUMP1(!flag, mpi_errno, MPI_ERR_OTHER,"**infonokey", "**infonokey %s", key);
 	MPIU_DBG_PRINTF(("key: <%s>, value: <%s>\n", kv[i].key, kv[i].val));
     }
 
@@ -101,7 +101,7 @@ static void free_pmi_keyvals(PMI_keyval_t **kv, int size, int *counts)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Comm_spawn_multiple
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_Comm_spawn_multiple(int count, char **commands,
                                   char ***argvs, const int *maxprocs,
                                   MPID_Info **info_ptrs, int root,
@@ -126,7 +126,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
 	}
 	pmi_errcodes = (int*)MPIU_Malloc(sizeof(int) * total_num_processes);
 	if (pmi_errcodes == NULL) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
 
 	/* initialize them to 0 */
@@ -137,7 +137,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
 	/* FIXME: info may be needed for port name */
         mpi_errno = MPID_Open_port(NULL, port_name);
 	/* --BEGIN ERROR HANDLING-- */
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	/* --END ERROR HANDLING-- */
 
 	/* Spawn the processes */
@@ -173,9 +173,9 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
                 */
             }
             /* XXX DJG don't need this, PMI API is thread-safe? */
-            /*MPIU_THREAD_CS_ENTER(PMI,);*/
+            /*MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.pmi_mutex);*/
             /* release the global CS for spawn PMI calls */
-            MPIU_THREAD_CS_EXIT(ALLFUNC,);
+            MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
             pmi_errno = PMI2_Job_Spawn(count, (const char **)commands,
                                        argcs, (const char ***)argvs,
                                        maxprocs,
@@ -184,11 +184,11 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
                                        NULL, 0,
                                        /*jobId, jobIdSize,*/ /* XXX DJG job stuff? */
                                        pmi_errcodes);
-            MPIU_THREAD_CS_ENTER(ALLFUNC,);
-            /*MPIU_THREAD_CS_EXIT(PMI,);*/
+            MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+            /*MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.pmi_mutex);*/
             MPIU_Free(argcs);
             if (pmi_errno != PMI2_SUCCESS) {
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER,
+                MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER,
                      "**pmi_spawn_multiple", "**pmi_spawn_multiple %d", pmi_errno);
             }
         }
@@ -203,7 +203,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
         info_keyval_vectors = 
             (PMI_keyval_t**) MPIU_Malloc(count * sizeof(PMI_keyval_t*));
         if (!info_keyval_sizes || !info_keyval_vectors) { 
-            MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+            MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
         }
 
         if (!info_ptrs) {
@@ -217,7 +217,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
                 mpi_errno = mpi_to_pmi_keyvals( info_ptrs[i], 
                                                 &info_keyval_vectors[i],
                                                 &info_keyval_sizes[i] );
-                if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
             }
         }
 
@@ -225,7 +225,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
         preput_keyval_vector.val = port_name;
 
 
-        MPIU_THREAD_CS_ENTER(PMI,);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.pmi_mutex);
         pmi_errno = PMI_Spawn_multiple(count, (const char **)
                                        commands, 
                                        (const char ***) argvs,
@@ -234,9 +234,9 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
                                        info_keyval_vectors, 1, 
                                        &preput_keyval_vector,
                                        pmi_errcodes);
-	MPIU_THREAD_CS_EXIT(PMI,);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.pmi_mutex);
         if (pmi_errno != PMI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER,
+	    MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER,
 		 "**pmi_spawn_multiple", "**pmi_spawn_multiple %d", pmi_errno);
         }
 #endif
@@ -258,23 +258,23 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
     if (errcodes != MPI_ERRCODES_IGNORE) {
         MPIR_Errflag_t errflag = MPIR_ERR_NONE;
         mpi_errno = MPIR_Bcast_impl(&should_accept, 1, MPI_INT, root, comm_ptr, &errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Bcast_impl(&total_num_processes, 1, MPI_INT, root, comm_ptr, &errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         
         mpi_errno = MPIR_Bcast_impl(errcodes, total_num_processes, MPI_INT, root, comm_ptr, &errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
     }
 
     if (should_accept) {
         mpi_errno = MPID_Comm_accept(port_name, NULL, root, comm_ptr, intercomm); 
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**pmi_spawn_multiple");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**pmi_spawn_multiple");
     }
 
     if (comm_ptr->rank == root) {
@@ -283,7 +283,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
 	/* --BEGIN ERROR HANDLING-- */
 	if (mpi_errno != MPI_SUCCESS)
 	{
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
 	/* --END ERROR HANDLING-- */
     }
@@ -324,7 +324,7 @@ static char *parent_port_name = 0;    /* Name of parent port if this
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_GetParentPort
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_GetParentPort(char ** parent_port)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -339,16 +339,16 @@ int MPIDI_CH3_GetParentPort(char ** parent_port)
 #ifdef USE_PMI2_API
         {
             int vallen = 0;
-            MPIU_THREAD_CS_ENTER(PMI,);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.pmi_mutex);
             pmi_errno = PMI2_KVS_Get(kvsname, PMI2_ID_NULL, PARENT_PORT_KVSKEY, val, sizeof(val), &vallen);
-            MPIU_THREAD_CS_EXIT(PMI,);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.pmi_mutex);
             if (pmi_errno)
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**pmi_kvsget", "**pmi_kvsget %s", PARENT_PORT_KVSKEY);
+                MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**pmi_kvsget", "**pmi_kvsget %s", PARENT_PORT_KVSKEY);
         }
 #else
-	MPIU_THREAD_CS_ENTER(PMI,);
+	MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.pmi_mutex);
 	pmi_errno = PMI_KVS_Get( kvsname, PARENT_PORT_KVSKEY, val, sizeof(val));
-	MPIU_THREAD_CS_EXIT(PMI,);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.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;
@@ -356,7 +356,7 @@ int MPIDI_CH3_GetParentPort(char ** parent_port)
 #endif
 	parent_port_name = MPIU_Strdup(val);
 	if (parent_port_name == NULL) {
-	    MPIU_ERR_POP(mpi_errno); /* FIXME DARIUS */
+	    MPIR_ERR_POP(mpi_errno); /* FIXME DARIUS */
 	}
     }
 
diff --git a/src/mpid/ch3/src/ch3u_eager.c b/src/mpid/ch3/src/ch3u_eager.c
index 4f37aa0..63073a2 100644
--- a/src/mpid/ch3/src/ch3u_eager.c
+++ b/src/mpid/ch3/src/ch3u_eager.c
@@ -16,7 +16,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_SendNoncontig_iov
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* MPIDI_CH3_SendNoncontig_iov - Sends a message by loading an
    IOV and calling iSendv.  The caller must initialize
    sreq->dev.segment as well as segment_first and segment_size. */
@@ -48,14 +48,14 @@ int MPIDI_CH3_SendNoncontig_iov( MPIDI_VC_t *vc, MPID_Request *sreq,
 	iov_n += 1;
 	
 	/* Note this routine is invoked withing a CH3 critical section */
-	/* MPIU_THREAD_CS_ENTER(CH3COMM,vc); */
+	/* MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex); */
 	mpi_errno = MPIDI_CH3_iSendv(vc, sreq, iov, iov_n);
-	/* MPIU_THREAD_CS_EXIT(CH3COMM,vc); */
+	/* MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex); */
 	/* --BEGIN ERROR HANDLING-- */
 	if (mpi_errno != MPI_SUCCESS)
 	{
             MPID_Request_release(sreq);
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
 	}
 	/* --END ERROR HANDLING-- */
 
@@ -66,7 +66,7 @@ int MPIDI_CH3_SendNoncontig_iov( MPIDI_VC_t *vc, MPID_Request *sreq,
     {
 	/* --BEGIN ERROR HANDLING-- */
         MPID_Request_release(sreq);
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadsendiov");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadsendiov");
 	/* --END ERROR HANDLING-- */
     }
 
@@ -83,7 +83,7 @@ int MPIDI_CH3_SendNoncontig_iov( MPIDI_VC_t *vc, MPID_Request *sreq,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_EagerNoncontigSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* MPIDI_CH3_EagerNoncontigSend - Eagerly send noncontiguous data */
 int MPIDI_CH3_EagerNoncontigSend( MPID_Request **sreq_p, 
 				  MPIDI_CH3_Pkt_type_t reqtype, 
@@ -122,17 +122,17 @@ int MPIDI_CH3_EagerNoncontigSend( MPID_Request **sreq_p,
                     "Eager");
 	    
     sreq->dev.segment_ptr = MPID_Segment_alloc( );
-    MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+    MPIR_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
 
     MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
     sreq->dev.segment_first = 0;
     sreq->dev.segment_size = data_sz;
 	    
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = vc->sendNoncontig_fn(vc, sreq, eager_pkt, 
                                      sizeof(MPIDI_CH3_Pkt_eager_send_t));
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
  fn_exit:
     return mpi_errno;
@@ -150,7 +150,7 @@ int MPIDI_CH3_EagerNoncontigSend( MPID_Request **sreq_p,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_EagerContigSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_EagerContigSend( MPID_Request **sreq_p, 
 			       MPIDI_CH3_Pkt_type_t reqtype, 
 			       const void * buf, MPIDI_msg_sz_t data_sz, int rank, 
@@ -185,11 +185,11 @@ int MPIDI_CH3_EagerContigSend( MPID_Request **sreq_p,
     MPIDI_Pkt_set_seqnum(eager_pkt, seqnum);
     
     MPIU_DBG_MSGPKT(vc,tag,eager_pkt->match.parts.context_id,rank,data_sz,"EagerContig");
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsgv(vc, iov, 2, sreq_p);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|eagermsg");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|eagermsg");
     }
 
     sreq = *sreq_p;
@@ -216,7 +216,7 @@ int MPIDI_CH3_EagerContigSend( MPID_Request **sreq_p,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_EagerContigShortSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_EagerContigShortSend( MPID_Request **sreq_p, 
 				    MPIDI_CH3_Pkt_type_t reqtype, 
 				    const void * buf, MPIDI_msg_sz_t data_sz, int rank, 
@@ -260,11 +260,11 @@ int MPIDI_CH3_EagerContigShortSend( MPID_Request **sreq_p,
 
     MPIU_DBG_MSGPKT(vc,tag,eagershort_pkt->match.parts.context_id,rank,data_sz,
 		    "EagerShort");
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, eagershort_pkt, sizeof(*eagershort_pkt), sreq_p);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|eagermsg");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|eagermsg");
     }
     sreq = *sreq_p;
     if (sreq != NULL) {
@@ -272,8 +272,8 @@ int MPIDI_CH3_EagerContigShortSend( MPID_Request **sreq_p,
 	  fflush(stdout); */
         /* MT FIXME setting fields in the request after it has been given to the
          * progress engine is racy.  The start call above is protected by
-         * CH3COMM:vc CS, but the progress engine is protected by MPIDCOMM.  So
-         * we can't just extend CH3COMM below this point... what's the fix? */
+         * vc CS, but the progress engine is protected by MPIDCOMM.  So
+         * we can't just extend the CS type below this point... what's the fix? */
 	MPIDI_Request_set_seqnum(sreq, seqnum);
 	MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_SEND);
     }
@@ -287,7 +287,7 @@ int MPIDI_CH3_EagerContigShortSend( MPID_Request **sreq_p,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_EagerShortSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, 
 					 MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
 {
@@ -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;
 
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
 
     /* printf( "Receiving short eager!\n" ); fflush(stdout); */
     MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
@@ -310,7 +310,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 		    eagershort_pkt->match.parts.rank,eagershort_pkt->data_sz,
 		    "ReceivedEagerShort");
     rreq = MPIDI_CH3U_Recvq_FDP_or_AEU(&eagershort_pkt->match, &found);
-    MPIU_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
+    MPIR_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
 
     /* If the completion counter is 0, that means that the communicator to
      * which this message is being sent has been revoked and we shouldn't
@@ -404,7 +404,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 		/* FIXME: The MPICH tests do not exercise this branch */
 		/* printf( "Surprise!\n" ); fflush(stdout);*/
 		rreq->dev.segment_ptr = MPID_Segment_alloc( );
-                MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+                MPIR_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
 
 		MPID_Segment_init(rreq->dev.user_buf, rreq->dev.user_count, 
 				  rreq->dev.datatype, rreq->dev.segment_ptr, 0);
@@ -420,7 +420,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 		       need to distinguish between these two types. */
 		    MPIR_STATUS_SET_COUNT(rreq->status, last);
 		    if (rreq->dev.recv_data_sz <= userbuf_sz) {
-			MPIU_ERR_SETSIMPLE(rreq->status.MPI_ERROR,MPI_ERR_TYPE,
+			MPIR_ERR_SETSIMPLE(rreq->status.MPI_ERROR,MPI_ERR_TYPE,
 					   "**dtypemismatch");
 		    }
 		    /* --END ERROR HANDLING-- */
@@ -452,7 +452,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         MPIR_T_PVAR_LEVEL_INC(RECVQ, unexpected_recvq_buffer_size, recv_data_sz);
 	    rreq->dev.tmpbuf = MPIU_Malloc(recv_data_sz);
 	    if (!rreq->dev.tmpbuf) {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	    }
 	    rreq->dev.tmpbuf_sz = recv_data_sz;
  	    /* Copy the payload. We could optimize this if recv_data_sz & 0x3 == 0 
@@ -487,7 +487,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	}
 
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**ch3|postrecv",
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**ch3|postrecv",
 		     "**ch3|postrecv %s", "MPIDI_CH3_PKT_EAGERSHORT_SEND");
 	}
     }
@@ -501,14 +501,14 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
      * MPIDI_CH3_Progress_signal_completion(). */
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
  fn_fail:
     /* 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. */
-    MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
     return mpi_errno;
 }
 
@@ -524,7 +524,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_EagerContigIsend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_EagerContigIsend( MPID_Request **sreq_p, 
 				MPIDI_CH3_Pkt_type_t reqtype, 
 				const void * buf, MPIDI_msg_sz_t data_sz, int rank, 
@@ -562,15 +562,15 @@ int MPIDI_CH3_EagerContigIsend( MPID_Request **sreq_p,
     MPIDI_Request_set_seqnum(sreq, seqnum);
     
     MPIU_DBG_MSGPKT(vc,tag,eager_pkt->match.parts.context_id,rank,data_sz,"EagerIsend");
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iSendv(vc, sreq, iov, 2);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
     /* --BEGIN ERROR HANDLING-- */
     if (mpi_errno != MPI_SUCCESS)
     {
         MPID_Request_release(sreq);
 	*sreq_p = NULL;
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
     }
     /* --END ERROR HANDLING-- */
     
@@ -603,7 +603,7 @@ int MPIDI_CH3_EagerContigIsend( MPID_Request **sreq_p,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_EagerSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, 
 				    MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
 {
@@ -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;
 
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.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",
@@ -627,7 +627,7 @@ int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 		    "ReceivedEager");
 	    
     rreq = MPIDI_CH3U_Recvq_FDP_or_AEU(&eager_pkt->match, &found);
-    MPIU_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
+    MPIR_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
 
     /* If the completion counter is 0, that means that the communicator to
      * which this message is being sent has been revoked and we shouldn't
@@ -648,7 +648,7 @@ int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
         mpi_errno = MPID_Request_complete(rreq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 	*rreqp = NULL;
     }
@@ -663,7 +663,7 @@ int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	}
 
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**ch3|postrecv",
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**ch3|postrecv",
 			     "**ch3|postrecv %s", "MPIDI_CH3_PKT_EAGER_SEND");
 	}
 
@@ -674,7 +674,7 @@ int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         {
             mpi_errno = MPID_Request_complete(rreq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
             *rreqp = NULL;
         }
@@ -685,7 +685,7 @@ int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     }
 
  fn_fail:
-    MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
     return mpi_errno;
 }
 
@@ -693,7 +693,7 @@ int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_ReadySend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 				    MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
 {
@@ -717,7 +717,7 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 		    "ReceivedReady");
 	    
     rreq = MPIDI_CH3U_Recvq_FDP_or_AEU(&ready_pkt->match, &found);
-    MPIU_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
+    MPIR_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
 
     /* If the completion counter is 0, that means that the communicator to
      * which this message is being sent has been revoked and we shouldn't
@@ -739,7 +739,7 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
             *buflen = sizeof(MPIDI_CH3_Pkt_t) + data_len;;
             mpi_errno = MPID_Request_complete(rreq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
 	    *rreqp = NULL;
 	}
@@ -747,7 +747,7 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	    mpi_errno = MPIDI_CH3U_Receive_data_found(rreq, data_buf, &data_len,
                                                       &complete);
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, 
+		MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, 
 				     "**ch3|postrecv",
 				     "**ch3|postrecv %s", 
 				     "MPIDI_CH3_PKT_READY_SEND");
@@ -760,7 +760,7 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
             {
                 mpi_errno = MPID_Request_complete(rreq);
                 if (mpi_errno != MPI_SUCCESS) {
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 }
                 *rreqp = NULL;
             }
@@ -796,7 +796,7 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	    rreq->dev.segment_size = 0;
 	    mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
+		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
 				    "**ch3|loadrecviov");
 	    }
 	}
@@ -805,7 +805,7 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	    /* mark data transfer as complete and decrement CC */
             mpi_errno = MPID_Request_complete(rreq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
 	    *rreqp = NULL;
 	}
diff --git a/src/mpid/ch3/src/ch3u_eagersync.c b/src/mpid/ch3/src/ch3u_eagersync.c
index 3a1b9d9..3e57955 100644
--- a/src/mpid/ch3/src/ch3u_eagersync.c
+++ b/src/mpid/ch3/src/ch3u_eagersync.c
@@ -16,7 +16,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_EagerSyncNoncontigSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* MPIDI_CH3_EagerSyncNoncontigSend - Eagerly send noncontiguous data in
    synchronous mode.
 
@@ -73,9 +73,9 @@ int MPIDI_CH3_EagerSyncNoncontigSend( MPID_Request **sreq_p,
 	iov[1].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) ((char *)buf + dt_true_lb);
 	iov[1].MPL_IOV_LEN = data_sz;	
 	
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+	MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
 	mpi_errno = MPIDI_CH3_iSendv(vc, sreq, iov, 2);
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+	MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 	/* --BEGIN ERROR HANDLING-- */
 	if (mpi_errno != MPI_SUCCESS)
 	{
@@ -83,7 +83,7 @@ int MPIDI_CH3_EagerSyncNoncontigSend( MPID_Request **sreq_p,
          * NULL, otherwise we lose the handle on the request */
             MPID_Request_release(sreq);
 	    *sreq_p = NULL;
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
 	}
 	/* --END ERROR HANDLING-- */
     }
@@ -94,16 +94,16 @@ int MPIDI_CH3_EagerSyncNoncontigSend( MPID_Request **sreq_p,
 		       data_sz);
 	
 	sreq->dev.segment_ptr = MPID_Segment_alloc( );
-        MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+        MPIR_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
 
 	MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
 	sreq->dev.segment_first = 0;
 	sreq->dev.segment_size = data_sz;
 	
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+	MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = vc->sendNoncontig_fn(vc, sreq, es_pkt, sizeof(MPIDI_CH3_Pkt_eager_sync_send_t));
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+	MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -146,15 +146,15 @@ int MPIDI_CH3_EagerSyncZero(MPID_Request **sreq_p, int rank, int tag,
     MPIDI_Request_set_seqnum(sreq, seqnum);
     
     MPIU_DBG_MSGPKT(vc,tag,es_pkt->match.parts.context_id,rank,(MPIDI_msg_sz_t)0,"EagerSync0");
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iSend(vc, sreq, es_pkt, sizeof(*es_pkt));
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
     /* --BEGIN ERROR HANDLING-- */
     if (mpi_errno != MPI_SUCCESS)
     {
 	MPID_Request_release(sreq);
 	*sreq_p = NULL;
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
     }
     /* --END ERROR HANDLING-- */
 
@@ -177,11 +177,11 @@ int MPIDI_CH3_EagerSyncAck( MPIDI_VC_t *vc, MPID_Request *rreq )
     MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending eager sync ack");
     MPIDI_Pkt_init(esa_pkt, MPIDI_CH3_PKT_EAGER_SYNC_ACK);
     esa_pkt->sender_req_id = rreq->dev.sender_req_id;
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, esa_pkt, sizeof(*esa_pkt), &esa_req);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
     if (esa_req != NULL)
     {
@@ -211,7 +211,7 @@ int MPIDI_CH3_EagerSyncAck( MPIDI_VC_t *vc, MPID_Request *rreq )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_EagerSyncSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 					MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
 {
@@ -233,7 +233,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 		    "ReceivedEagerSync");
 	    
     rreq = MPIDI_CH3U_Recvq_FDP_or_AEU(&es_pkt->match, &found);
-    MPIU_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
+    MPIR_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
 
     /* If the completion counter is 0, that means that the communicator to
      * which this message is being sent has been revoked and we shouldn't
@@ -259,7 +259,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
             *buflen = sizeof(MPIDI_CH3_Pkt_t);
             mpi_errno = MPID_Request_complete(rreq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
 	    *rreqp = NULL;
 	}
@@ -267,7 +267,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	    mpi_errno = MPIDI_CH3U_Receive_data_found( rreq, data_buf,
                                                        &data_len, &complete );
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**ch3|postrecv",
+		MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**ch3|postrecv",
 		    "**ch3|postrecv %s", "MPIDI_CH3_PKT_EAGER_SYNC_SEND");
 	    }
 
@@ -277,7 +277,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
             {
                 mpi_errno = MPID_Request_complete(rreq);
                 if (mpi_errno != MPI_SUCCESS) {
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 }
                 *rreqp = NULL;
             }
@@ -291,11 +291,11 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	MPIDI_Pkt_init(esa_pkt, MPIDI_CH3_PKT_EAGER_SYNC_ACK);
 	esa_pkt->sender_req_id = rreq->dev.sender_req_id;
 	/* Because this is a packet handler, it is already within a CH3 CS */
-	/* MPIU_THREAD_CS_ENTER(CH3COMM,vc); */
+	/* MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex); */
 	mpi_errno = MPIDI_CH3_iStartMsg(vc, esa_pkt, sizeof(*esa_pkt), &esa_req);
-	/* MPIU_THREAD_CS_EXIT(CH3COMM,vc); */
+	/* MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex); */
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
 				"**ch3|syncack");
 	}
 	if (esa_req != NULL) {
@@ -308,7 +308,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
             *buflen = sizeof(MPIDI_CH3_Pkt_t);
             mpi_errno = MPID_Request_complete(rreq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
 	    *rreqp = NULL;
 	}
@@ -316,7 +316,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	    mpi_errno = MPIDI_CH3U_Receive_data_unexpected( rreq, data_buf,
                                                             &data_len, &complete );
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**ch3|postrecv",
+		MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**ch3|postrecv",
 		    "**ch3|postrecv %s", "MPIDI_CH3_PKT_EAGER_SYNC_SEND");
 	    }
 
@@ -326,7 +326,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
             {
                 mpi_errno = MPID_Request_complete(rreq);
                 if (mpi_errno != MPI_SUCCESS) {
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 }
                 *rreqp = NULL;
             }
@@ -344,7 +344,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_EagerSyncAck
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_EagerSyncAck( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 				       MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
 {
@@ -362,7 +362,7 @@ int MPIDI_CH3_PktHandler_EagerSyncAck( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* FIXME: This sometimes segfaults */
     mpi_errno = MPID_Request_complete(sreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
     
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
diff --git a/src/mpid/ch3/src/ch3u_handle_connection.c b/src/mpid/ch3/src/ch3u_handle_connection.c
index c47c965..fa0b569 100644
--- a/src/mpid/ch3/src/ch3u_handle_connection.c
+++ b/src/mpid/ch3/src/ch3u_handle_connection.c
@@ -25,7 +25,7 @@ char *MPIDI_failed_procs_string = NULL;
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Handle_connection
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
   MPIDI_CH3U_Handle_connection - handle connection event
 
@@ -72,7 +72,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
 		    {
 			MPIDI_CH3_Progress_signal_completion();
                         mpi_errno = MPIDI_CH3_Channel_close();
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		    }
 
 		    break;
@@ -139,7 +139,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
 		    if (MPIDI_Outstanding_close_ops == 0) {
 			MPIDI_CH3_Progress_signal_completion();
                         mpi_errno = MPIDI_CH3_Channel_close();
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		    }
                     
                     break;
@@ -200,7 +200,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_VC_SendClose
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
   MPIDI_CH3U_VC_SendClose - Initiate a close on a virtual connection
   
@@ -222,7 +222,7 @@ int MPIDI_CH3U_VC_SendClose( MPIDI_VC_t *vc, int rank )
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_VC_SENDCLOSE);
 
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
 
     MPIU_Assert( vc->state == MPIDI_VC_STATE_ACTIVE ||
 		 vc->state == MPIDI_VC_STATE_REMOTE_CLOSE );
@@ -230,7 +230,7 @@ int MPIDI_CH3U_VC_SendClose( MPIDI_VC_t *vc, int rank )
     MPIDI_Pkt_init(close_pkt, MPIDI_CH3_PKT_CLOSE);
     close_pkt->ack = (vc->state == MPIDI_VC_STATE_ACTIVE) ? FALSE : TRUE;
     
-    /* MT: this is not thread safe, the CH3COMM CS is scoped to the vc and
+    /* MT: this is not thread safe, the POBJ CS is scoped to the vc and
      * doesn't protect this global correctly */
     MPIDI_Outstanding_close_ops += 1;
     MPIU_DBG_MSG_FMT(CH3_DISCONNECT,TYPICAL,(MPIU_DBG_FDEST,
@@ -253,7 +253,7 @@ int MPIDI_CH3U_VC_SendClose( MPIDI_VC_t *vc, int rank )
     }
 		
     mpi_errno = MPIDI_CH3_iStartMsg(vc, close_pkt, sizeof(*close_pkt), &sreq);
-    MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|send_close_ack");
+    MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|send_close_ack");
     
     if (sreq != NULL) {
 	/* There is still another reference being held by the channel.  It
@@ -262,7 +262,7 @@ int MPIDI_CH3U_VC_SendClose( MPIDI_VC_t *vc, int rank )
     }
 
  fn_exit:
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3U_VC_SENDCLOSE);
     return mpi_errno;
@@ -275,7 +275,7 @@ int MPIDI_CH3U_VC_SendClose( MPIDI_VC_t *vc, int rank )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_Close
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, 
 				MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
 {
@@ -294,7 +294,7 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	MPIU_DBG_MSG_D(CH3_DISCONNECT,TYPICAL,"sending close(TRUE) to %d",
 		       vc->pg_rank);
 	mpi_errno = MPIDI_CH3_iStartMsg(vc, resp_pkt, sizeof(*resp_pkt), &resp_sreq);
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|send_close_ack");
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|send_close_ack");
 	
 	if (resp_sreq != NULL)
 	{
@@ -363,7 +363,7 @@ int MPIDI_CH3_PktPrint_Close( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_VC_WaitForClose
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
   MPIDI_CH3U_VC_WaitForClose - Wait for all virtual connections to close
   @*/
@@ -383,7 +383,7 @@ int MPIDI_CH3U_VC_WaitForClose( void )
 	mpi_errno = MPID_Progress_wait(&progress_state);
 	/* --BEGIN ERROR HANDLING-- */
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SET(mpi_errno,MPI_ERR_OTHER,"**ch3|close_progress");
+	    MPIR_ERR_SET(mpi_errno,MPI_ERR_OTHER,"**ch3|close_progress");
 	    break;
 	}
 	/* --END ERROR HANDLING-- */
@@ -397,7 +397,7 @@ int MPIDI_CH3U_VC_WaitForClose( void )
 #undef FUNCNAME
 #define FUNCNAME terminate_failed_VCs
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int terminate_failed_VCs(MPID_Group *new_failed_group)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -412,7 +412,7 @@ static int terminate_failed_VCs(MPID_Group *new_failed_group)
         /* FIXME: This won't work for dynamic procs */
         MPIDI_PG_Get_vc(MPIDI_Process.my_pg, new_failed_group->lrank_to_lpid[i].lpid, &vc);
         mpi_errno = MPIDI_CH3_Connection_terminate(vc);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
  fn_exit:
@@ -426,7 +426,7 @@ static int terminate_failed_VCs(MPID_Group *new_failed_group)
 #define parse_rank(r_p) do {                                                                    \
         while (isspace(*c)) /* skip spaces */                                                   \
             ++c;                                                                                \
-        MPIU_ERR_CHKINTERNAL(!isdigit(*c), mpi_errno, "error parsing failed process list");     \
+        MPIR_ERR_CHKINTERNAL(!isdigit(*c), mpi_errno, "error parsing failed process list");     \
         *(r_p) = (int)strtol(c, &c, 0);                                                         \
         while (isspace(*c)) /* skip spaces */                                                   \
             ++c;                                                                                \
@@ -442,7 +442,7 @@ static int terminate_failed_VCs(MPID_Group *new_failed_group)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Get_failed_group
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Get_failed_group(int last_rank, MPID_Group **failed_group)
 {
     char *c;
@@ -479,7 +479,7 @@ int MPIDI_CH3U_Get_failed_group(int last_rank, MPID_Group **failed_group)
         MPIU_DBG_MSG_D(CH3_OTHER, VERBOSE, "Found failed rank: %d", rank);
         utarray_push_back(failed_procs, &rank);
         MPIDI_last_known_failed = rank;
-        MPIU_ERR_CHKINTERNAL(*c != ',' && *c != '\0', mpi_errno, "error parsing failed process list");
+        MPIR_ERR_CHKINTERNAL(*c != ',' && *c != '\0', mpi_errno, "error parsing failed process list");
         if (*c == '\0' || last_rank == rank)
             break;
         ++c; /* skip ',' */
@@ -488,13 +488,13 @@ int MPIDI_CH3U_Get_failed_group(int last_rank, MPID_Group **failed_group)
     /* Create group of failed processes for comm_world.  Failed groups for other
        communicators can be created from this one using group_intersection. */
     mpi_errno = MPIR_Comm_group_impl(MPIR_Process.comm_world, &world_group);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIR_Group_incl_impl(world_group, i, ut_int_array(failed_procs), failed_group);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIR_Group_release(world_group);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_GET_FAILED_GROUP);
@@ -502,7 +502,7 @@ fn_exit:
         utarray_free(failed_procs);
     return mpi_errno;
 fn_oom:
-    MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "utarray");
+    MPIR_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "utarray");
 fn_fail:
     goto fn_exit;
 }
@@ -510,7 +510,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Check_for_failed_procs
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Check_for_failed_procs(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -527,18 +527,18 @@ int MPIDI_CH3U_Check_for_failed_procs(void)
        with the rank, then we need to create the failed group from
        something bigger than comm_world. */
     mpi_errno = MPIDI_PG_GetConnKVSname(&kvsname);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 #ifdef USE_PMI2_API
     {
         int vallen = 0;
         pmi_errno = PMI2_KVS_Get(kvsname, PMI2_ID_NULL, "PMI_dead_processes", MPIDI_failed_procs_string, PMI2_MAX_VALLEN, &vallen);
-        MPIU_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get");
+        MPIR_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get");
     }
 #else
     pmi_errno = PMI_KVS_Get_value_length_max(&len);
-    MPIU_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get_value_length_max");
+    MPIR_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get_value_length_max");
     pmi_errno = PMI_KVS_Get(kvsname, "PMI_dead_processes", MPIDI_failed_procs_string, len);
-    MPIU_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get");
+    MPIR_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get");
 #endif
 
     if (*MPIDI_failed_procs_string == '\0') {
@@ -557,23 +557,23 @@ int MPIDI_CH3U_Check_for_failed_procs(void)
 
     /* get group of newly failed processes */
     mpi_errno = MPIR_Group_difference_impl(MPIDI_Failed_procs_group, prev_failed_group, &new_failed_group);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (new_failed_group != MPID_Group_empty) {
         mpi_errno = MPIDI_CH3I_Comm_handle_failed_procs(new_failed_group);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = terminate_failed_VCs(new_failed_group);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIR_Group_release(new_failed_group);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* free prev group */
     if (prev_failed_group != MPID_Group_empty) {
         mpi_errno = MPIR_Group_release(prev_failed_group);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -581,7 +581,7 @@ int MPIDI_CH3U_Check_for_failed_procs(void)
     return mpi_errno;
 
  fn_oom: /* out-of-memory handler for utarray operations */
-    MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "utarray");
+    MPIR_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "utarray");
  fn_fail:
     goto fn_exit;
 }
@@ -591,7 +591,7 @@ int MPIDI_CH3U_Dump_vc_states(void);
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Dump_vc_states
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Dump_vc_states(void)
 {
     int mpi_errno = MPI_SUCCESS;
diff --git a/src/mpid/ch3/src/ch3u_handle_op_req.c b/src/mpid/ch3/src/ch3u_handle_op_req.c
index 6e6283f..906d10f 100644
--- a/src/mpid/ch3/src/ch3u_handle_op_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_op_req.c
@@ -11,7 +11,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Req_handler_rma_op_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Req_handler_rma_op_complete(MPID_Request * sreq)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -36,7 +36,7 @@ int MPIDI_CH3_Req_handler_rma_op_complete(MPID_Request * sreq)
         MPID_Request_get_ptr(sreq->dev.request_handle, ureq);
         mpi_errno = MPID_Request_complete(ureq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
index 45b3ea1..c069632 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
@@ -51,7 +51,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Handle_ordered_recv_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Handle_ordered_recv_pkt(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt, 
 				       MPIDI_msg_sz_t *buflen, MPID_Request ** rreqp)
 {
@@ -101,7 +101,7 @@ int MPIDI_CH3U_Handle_ordered_recv_pkt(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Receive_data_found
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t *buflen, int *complete)
 {
     int dt_contig;
@@ -174,7 +174,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
 	   the entire message */
         
 	rreq->dev.segment_ptr = MPID_Segment_alloc( );
-        MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+        MPIR_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
 
  	MPID_Segment_init(rreq->dev.user_buf, rreq->dev.user_count, 
 			  rreq->dev.datatype, rreq->dev.segment_ptr, 0);
@@ -197,7 +197,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
                 /* If the data can't be unpacked, the we have a
                    mismatch between the datatype and the amount of
                    data received.  Throw away received data. */
-                MPIU_ERR_SET(rreq->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
+                MPIR_ERR_SET(rreq->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
                 MPIR_STATUS_SET_COUNT(rreq->status, rreq->dev.segment_first);
                 *buflen = data_sz;
                 *complete = TRUE;
@@ -216,7 +216,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
 
             mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_OTHER,
+                MPIR_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_OTHER,
                                          "**ch3|loadrecviov");
             }
             *buflen = 0;
@@ -234,7 +234,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Receive_data_unexpected
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Receive_data_unexpected(MPID_Request * rreq, char *buf, MPIDI_msg_sz_t *buflen, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -250,7 +250,7 @@ int MPIDI_CH3U_Receive_data_unexpected(MPID_Request * rreq, char *buf, MPIDI_msg
     
     rreq->dev.tmpbuf = MPIU_Malloc(rreq->dev.recv_data_sz);
     if (!rreq->dev.tmpbuf) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
 			     rreq->dev.recv_data_sz);
     }
     rreq->dev.tmpbuf_sz = rreq->dev.recv_data_sz;
@@ -292,7 +292,7 @@ int MPIDI_CH3U_Receive_data_unexpected(MPID_Request * rreq, char *buf, MPIDI_msg
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Post_data_receive_found
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
 {
     int mpi_errno = MPI_SUCCESS;	
@@ -347,14 +347,14 @@ int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
 	   the entire message */
 	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"IOV loaded for non-contiguous read");
 	rreq->dev.segment_ptr = MPID_Segment_alloc( );
-        MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+        MPIR_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
 	MPID_Segment_init(rreq->dev.user_buf, rreq->dev.user_count, 
 			  rreq->dev.datatype, rreq->dev.segment_ptr, 0);
 	rreq->dev.segment_first = 0;
 	rreq->dev.segment_size = data_sz;
 	mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_OTHER,
+	    MPIR_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_OTHER,
 				     "**ch3|loadrecviov");
 	}
     }
@@ -369,7 +369,7 @@ int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Post_data_receive_unexpected
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Post_data_receive_unexpected(MPID_Request * rreq)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -385,7 +385,7 @@ int MPIDI_CH3U_Post_data_receive_unexpected(MPID_Request * rreq)
     
     rreq->dev.tmpbuf = MPIU_Malloc(rreq->dev.recv_data_sz);
     if (!rreq->dev.tmpbuf) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
 			     rreq->dev.recv_data_sz);
     }
     rreq->dev.tmpbuf_sz = rreq->dev.recv_data_sz;
@@ -412,7 +412,7 @@ int MPIDI_CH3U_Post_data_receive_unexpected(MPID_Request * rreq)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Try_acquire_win_lock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Try_acquire_win_lock(MPID_Win *win_ptr, int requested_lock)
 {
     int existing_lock;
@@ -494,7 +494,7 @@ int MPIDI_CH3_PktHandler_FlowCntlUpdate( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_EndCH3
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_EndCH3( MPIDI_VC_t *vc ATTRIBUTE((unused)), 
 				 MPIDI_CH3_Pkt_t *pkt ATTRIBUTE((unused)),
 				 MPIDI_msg_sz_t *buflen ATTRIBUTE((unused)), 
@@ -522,7 +522,7 @@ int MPIDI_CH3_PktHandler_EndCH3( MPIDI_VC_t *vc ATTRIBUTE((unused)),
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_Init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_Init( MPIDI_CH3_PktHandler_Fcn *pktArray[], 
 			       int arraySize  )
 {
@@ -533,7 +533,7 @@ int MPIDI_CH3_PktHandler_Init( MPIDI_CH3_PktHandler_Fcn *pktArray[],
 
     /* Check that the array is large enough */
     if (arraySize < MPIDI_CH3_PKT_END_CH3) {
-	MPIU_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_INTERN,
+	MPIR_ERR_SETFATALANDJUMP(mpi_errno,MPI_ERR_INTERN,
 				 "**ch3|pktarraytoosmall");
     }
     pktArray[MPIDI_CH3_PKT_EAGER_SEND] = 
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_req.c b/src/mpid/ch3/src/ch3u_handle_recv_req.c
index f985300..89b83ef 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_req.c
@@ -13,7 +13,7 @@ static int create_derived_datatype(MPID_Request * req, MPIDI_RMA_dtype_info * dt
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Handle_recv_req
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Handle_recv_req(MPIDI_VC_t * vc, MPID_Request * rreq, int *complete)
 {
     static int in_routine ATTRIBUTE((unused)) = FALSE;
@@ -31,7 +31,7 @@ int MPIDI_CH3U_Handle_recv_req(MPIDI_VC_t * vc, MPID_Request * rreq, int *comple
         MPIU_Assert(MPIDI_Request_get_type(rreq) == MPIDI_REQUEST_TYPE_RECV);
         mpi_errno = MPID_Request_complete(rreq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
         *complete = TRUE;
     }
@@ -75,7 +75,7 @@ int MPIDI_CH3_ReqHandler_RecvComplete(MPIDI_VC_t * vc ATTRIBUTE((unused)),
     /* mark data transfer as complete and decrement CC */
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     *complete = TRUE;
@@ -89,7 +89,7 @@ int MPIDI_CH3_ReqHandler_RecvComplete(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_PutRecvComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_PutRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -123,7 +123,7 @@ int MPIDI_CH3_ReqHandler_PutRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
     /* mark data transfer as complete and decrement CC */
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     /* NOTE: finish_op_on_target() must be called after we complete this request,
@@ -133,7 +133,7 @@ int MPIDI_CH3_ReqHandler_PutRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
     mpi_errno = finish_op_on_target(win_ptr, vc, FALSE /* has no response data */ ,
                                     flags, source_win_handle);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     *complete = TRUE;
 
@@ -151,7 +151,7 @@ int MPIDI_CH3_ReqHandler_PutRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_AccumRecvComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_AccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -213,7 +213,7 @@ int MPIDI_CH3_ReqHandler_AccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq,
     if (win_ptr->shm_allocated == TRUE)
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
     if (mpi_errno) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     /* free the temporary buffer */
@@ -222,7 +222,7 @@ int MPIDI_CH3_ReqHandler_AccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq,
     /* mark data transfer as complete and decrement CC */
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     /* NOTE: finish_op_on_target() must be called after we complete this request,
@@ -232,7 +232,7 @@ int MPIDI_CH3_ReqHandler_AccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq,
     mpi_errno = finish_op_on_target(win_ptr, vc, FALSE /* has no response data */ ,
                                     flags, source_win_handle);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     *complete = TRUE;
 
@@ -250,7 +250,7 @@ int MPIDI_CH3_ReqHandler_AccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_GaccumRecvComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_GaccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -319,7 +319,7 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq
     MPID_Datatype_get_true_lb(rreq->dev.datatype, &dt_true_lb);
 
     resp_req = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+    MPIR_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     MPIU_Object_set_ref(resp_req, 1);
     MPIDI_Request_set_type(resp_req, MPIDI_REQUEST_TYPE_GET_ACCUM_RESP);
 
@@ -347,7 +347,7 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq
             if (win_ptr->shm_allocated == TRUE)
                 MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
         }
-        MPIU_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+        MPIR_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
                              "MPID_Segment");
         MPID_Segment_init(rreq->dev.real_user_buf, rreq->dev.user_count, rreq->dev.datatype, seg,
                           0);
@@ -365,7 +365,7 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     resp_req->dev.OnFinal = MPIDI_CH3_ReqHandler_GaccumSendComplete;
     resp_req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GaccumSendComplete;
@@ -382,11 +382,11 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq
     iov[1].MPL_IOV_LEN = stream_data_len;
     iovcnt = 2;
 
-    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iSendv(vc, resp_req, iov, iovcnt);
-    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 
-    MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+    MPIR_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
     /* Mark get portion as handled */
     rreq->dev.resp_request_handle = MPI_REQUEST_NULL;
@@ -403,7 +403,7 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq
     /* mark data transfer as complete and decrement CC */
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     *complete = TRUE;
@@ -423,7 +423,7 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_FOPRecvComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_FOPRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -456,7 +456,7 @@ int MPIDI_CH3_ReqHandler_FOPRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
 
     /* Create response request */
     resp_req = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+    MPIR_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     MPIDI_Request_set_type(resp_req, MPIDI_REQUEST_TYPE_FOP_RESP);
     MPIU_Object_set_ref(resp_req, 1);
     resp_req->dev.OnFinal = MPIDI_CH3_ReqHandler_FOPSendComplete;
@@ -487,7 +487,7 @@ int MPIDI_CH3_ReqHandler_FOPRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
             if (win_ptr->shm_allocated == TRUE)
                 MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
         }
-        MPIU_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+        MPIR_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
                              "MPID_Segment");
         MPID_Segment_init(rreq->dev.real_user_buf, 1, rreq->dev.datatype, seg, 0);
         MPID_Segment_pack(seg, 0, &last, resp_req->dev.user_buf);
@@ -502,7 +502,7 @@ int MPIDI_CH3_ReqHandler_FOPRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Send back data */
     MPIDI_Pkt_init(fop_resp_pkt, MPIDI_CH3_PKT_FOP_RESP);
@@ -522,11 +522,11 @@ int MPIDI_CH3_ReqHandler_FOPRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
     iov[1].MPL_IOV_LEN = type_size;
     iovcnt = 2;
 
-    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iSendv(vc, resp_req, iov, iovcnt);
-    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 
-    MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+    MPIR_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
     if (is_empty_origin == FALSE) {
         /* free the temporary buffer.
@@ -538,7 +538,7 @@ int MPIDI_CH3_ReqHandler_FOPRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
     /* mark data transfer as complete and decrement CC */
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     *complete = TRUE;
@@ -558,7 +558,7 @@ int MPIDI_CH3_ReqHandler_FOPRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_PutDerivedDTRecvComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_PutDerivedDTRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((unused)),
                                                   MPID_Request * rreq, int *complete)
 {
@@ -582,7 +582,7 @@ int MPIDI_CH3_ReqHandler_PutDerivedDTRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((unu
     rreq->dev.datatype_ptr = new_dtp;
 
     rreq->dev.segment_ptr = MPID_Segment_alloc();
-    MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
+    MPIR_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
                          "**nomem %s", "MPID_Segment_alloc");
 
     MPID_Segment_init(rreq->dev.user_buf,
@@ -592,7 +592,7 @@ int MPIDI_CH3_ReqHandler_PutDerivedDTRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((unu
 
     mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
     }
     if (!rreq->dev.OnDataAvail)
         rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_PutRecvComplete;
@@ -606,7 +606,7 @@ int MPIDI_CH3_ReqHandler_PutDerivedDTRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((unu
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_AccumMetadataRecvComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_AccumMetadataRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((unused)),
                                                    MPID_Request * rreq, int *complete)
 {
@@ -695,7 +695,7 @@ int MPIDI_CH3_ReqHandler_AccumMetadataRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((un
     rreq->dev.recv_data_sz = MPIR_MIN(rest_len, stream_elem_count * basic_type_size);
 
     rreq->dev.segment_ptr = MPID_Segment_alloc();
-    MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
+    MPIR_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
                          "**nomem %s", "MPID_Segment_alloc");
 
     MPID_Segment_init(rreq->dev.user_buf,
@@ -706,7 +706,7 @@ int MPIDI_CH3_ReqHandler_AccumMetadataRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((un
 
     mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
     }
     if (!rreq->dev.OnDataAvail)
         rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_AccumRecvComplete;
@@ -721,7 +721,7 @@ int MPIDI_CH3_ReqHandler_AccumMetadataRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((un
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_GaccumMetadataRecvComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_GaccumMetadataRecvComplete(MPIDI_VC_t * vc,
                                                     MPID_Request * rreq, int *complete)
 {
@@ -796,7 +796,7 @@ int MPIDI_CH3_ReqHandler_GaccumMetadataRecvComplete(MPIDI_VC_t * vc,
         /* There is no origin data coming, directly call final req handler. */
         mpi_errno = MPIDI_CH3_ReqHandler_GaccumRecvComplete(vc, rreq, complete);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     else {
         MPID_Datatype_get_size_macro(basic_dtp, basic_type_size);
@@ -825,7 +825,7 @@ int MPIDI_CH3_ReqHandler_GaccumMetadataRecvComplete(MPIDI_VC_t * vc,
         rreq->dev.recv_data_sz = MPIR_MIN(rest_len, stream_elem_count * basic_type_size);
 
         rreq->dev.segment_ptr = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
+        MPIR_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
                              "**nomem %s", "MPID_Segment_alloc");
 
         MPID_Segment_init(rreq->dev.user_buf,
@@ -836,7 +836,7 @@ int MPIDI_CH3_ReqHandler_GaccumMetadataRecvComplete(MPIDI_VC_t * vc,
 
         mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
         }
         if (!rreq->dev.OnDataAvail)
             rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GaccumRecvComplete;
@@ -854,7 +854,7 @@ int MPIDI_CH3_ReqHandler_GaccumMetadataRecvComplete(MPIDI_VC_t * vc,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete(MPIDI_VC_t * vc,
                                                   MPID_Request * rreq, int *complete)
 {
@@ -880,7 +880,7 @@ int MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete(MPIDI_VC_t * vc,
 
     /* create request for sending data */
     sreq = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP(sreq == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+    MPIR_ERR_CHKANDJUMP(sreq == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
 
     sreq->kind = MPID_REQUEST_SEND;
     MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_GET_RESP);
@@ -905,7 +905,7 @@ int MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete(MPIDI_VC_t * vc,
         get_resp_pkt->flags |= MPIDI_CH3_PKT_FLAG_RMA_ACK;
 
     sreq->dev.segment_ptr = MPID_Segment_alloc();
-    MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
+    MPIR_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
                          "**nomem %s", "MPID_Segment_alloc");
 
     MPID_Segment_init(sreq->dev.user_buf,
@@ -914,14 +914,14 @@ int MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete(MPIDI_VC_t * vc,
     sreq->dev.segment_size = new_dtp->size * sreq->dev.user_count;
 
     /* Because this is in a packet handler, it is already within a critical section */
-    /* MPIU_THREAD_CS_ENTER(CH3COMM,vc); */
+    /* MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex); */
     mpi_errno = vc->sendNoncontig_fn(vc, sreq, get_resp_pkt, sizeof(*get_resp_pkt));
-    /* MPIU_THREAD_CS_EXIT(CH3COMM,vc); */
+    /* MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex); */
     /* --BEGIN ERROR HANDLING-- */
     if (mpi_errno != MPI_SUCCESS) {
         MPID_Request_release(sreq);
         sreq = NULL;
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
     /* --END ERROR HANDLING-- */
 
@@ -929,7 +929,7 @@ int MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete(MPIDI_VC_t * vc,
      * request */
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     *complete = TRUE;
@@ -945,7 +945,7 @@ int MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete(MPIDI_VC_t * vc,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_UnpackUEBufComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_UnpackUEBufComplete(MPIDI_VC_t * vc ATTRIBUTE((unused)),
                                              MPID_Request * rreq, int *complete)
 {
@@ -971,7 +971,7 @@ int MPIDI_CH3_ReqHandler_UnpackUEBufComplete(MPIDI_VC_t * vc ATTRIBUTE((unused))
     /* mark data transfer as complete and decrement CC */
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     *complete = TRUE;
@@ -986,7 +986,7 @@ int MPIDI_CH3_ReqHandler_UnpackUEBufComplete(MPIDI_VC_t * vc ATTRIBUTE((unused))
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_UnpackSRBufComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_UnpackSRBufComplete(MPIDI_VC_t * vc, MPID_Request * rreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1012,7 +1012,7 @@ int MPIDI_CH3_ReqHandler_UnpackSRBufComplete(MPIDI_VC_t * vc, MPID_Request * rre
         /* mark data transfer as complete and decrement CC */
         mpi_errno = MPID_Request_complete(rreq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         *complete = TRUE;
@@ -1028,7 +1028,7 @@ int MPIDI_CH3_ReqHandler_UnpackSRBufComplete(MPIDI_VC_t * vc, MPID_Request * rre
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_UnpackSRBufReloadIOV
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_UnpackSRBufReloadIOV(MPIDI_VC_t * vc ATTRIBUTE((unused)),
                                               MPID_Request * rreq, int *complete)
 {
@@ -1040,7 +1040,7 @@ int MPIDI_CH3_ReqHandler_UnpackSRBufReloadIOV(MPIDI_VC_t * vc ATTRIBUTE((unused)
     MPIDI_CH3U_Request_unpack_srbuf(rreq);
     mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SETFATALANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
+        MPIR_ERR_SETFATALANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
     }
     *complete = FALSE;
   fn_fail:
@@ -1051,7 +1051,7 @@ int MPIDI_CH3_ReqHandler_UnpackSRBufReloadIOV(MPIDI_VC_t * vc ATTRIBUTE((unused)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_ReloadIOV
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_ReloadIOV(MPIDI_VC_t * vc ATTRIBUTE((unused)),
                                    MPID_Request * rreq, int *complete)
 {
@@ -1062,7 +1062,7 @@ int MPIDI_CH3_ReqHandler_ReloadIOV(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 
     mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SETFATALANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
+        MPIR_ERR_SETFATALANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
     }
     *complete = FALSE;
   fn_fail:
@@ -1076,7 +1076,7 @@ int MPIDI_CH3_ReqHandler_ReloadIOV(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 #undef FUNCNAME
 #define FUNCNAME create_derived_datatype
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int create_derived_datatype(MPID_Request * req, MPIDI_RMA_dtype_info * dtype_info,
                                    MPID_Datatype ** dtp)
 {
@@ -1090,7 +1090,7 @@ static int create_derived_datatype(MPID_Request * req, MPIDI_RMA_dtype_info * dt
     /* allocate new datatype object and handle */
     new_dtp = (MPID_Datatype *) MPIU_Handle_obj_alloc(&MPID_Datatype_mem);
     if (!new_dtp) {
-        MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+        MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
                              "MPID_Datatype_mem");
     }
 
@@ -1154,7 +1154,7 @@ static inline int perform_put_in_lock_queue(MPID_Win * win_ptr,
         mpi_errno = MPIR_Localcopy(put_pkt->info.data, put_pkt->count, put_pkt->datatype,
                                    put_pkt->addr, put_pkt->count, put_pkt->datatype);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     else {
         MPIU_Assert(put_pkt->type == MPIDI_CH3_PKT_PUT);
@@ -1162,7 +1162,7 @@ static inline int perform_put_in_lock_queue(MPID_Win * win_ptr,
         mpi_errno = MPIR_Localcopy(target_lock_entry->data, put_pkt->count, put_pkt->datatype,
                                    put_pkt->addr, put_pkt->count, put_pkt->datatype);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     /* do final action */
@@ -1170,7 +1170,7 @@ static inline int perform_put_in_lock_queue(MPID_Win * win_ptr,
         finish_op_on_target(win_ptr, target_lock_entry->vc, FALSE /* has no response data */ ,
                             put_pkt->flags, put_pkt->source_win_handle);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     return mpi_errno;
@@ -1200,7 +1200,7 @@ static inline int perform_get_in_lock_queue(MPID_Win * win_ptr,
 
     sreq = MPID_Request_create();
     if (sreq == NULL) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     }
     MPIU_Object_set_ref(sreq, 1);
 
@@ -1242,7 +1242,7 @@ static inline int perform_get_in_lock_queue(MPID_Win * win_ptr,
         void *src = (void *) (get_pkt->addr), *dest = (void *) (get_resp_pkt->info.data);
         mpi_errno = immed_copy(src, dest, len);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         /* All origin data is in packet header, issue the header. */
         iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) get_resp_pkt;
@@ -1252,7 +1252,7 @@ static inline int perform_get_in_lock_queue(MPID_Win * win_ptr,
         mpi_errno = MPIDI_CH3_iSendv(target_lock_entry->vc, sreq, iov, iovcnt);
         if (mpi_errno != MPI_SUCCESS) {
             MPID_Request_release(sreq);
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
         }
     }
     else if (is_contig) {
@@ -1265,7 +1265,7 @@ static inline int perform_get_in_lock_queue(MPID_Win * win_ptr,
         mpi_errno = MPIDI_CH3_iSendv(target_lock_entry->vc, sreq, iov, iovcnt);
         if (mpi_errno != MPI_SUCCESS) {
             MPID_Request_release(sreq);
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
         }
     }
     else {
@@ -1273,7 +1273,7 @@ static inline int perform_get_in_lock_queue(MPID_Win * win_ptr,
         iov[0].MPL_IOV_LEN = sizeof(*get_resp_pkt);
 
         sreq->dev.segment_ptr = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP1(sreq->dev.segment_ptr == NULL, mpi_errno,
+        MPIR_ERR_CHKANDJUMP1(sreq->dev.segment_ptr == NULL, mpi_errno,
                              MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
 
         MPID_Segment_init(get_pkt->addr, get_pkt->count,
@@ -1284,7 +1284,7 @@ static inline int perform_get_in_lock_queue(MPID_Win * win_ptr,
         mpi_errno = target_lock_entry->vc->sendNoncontig_fn(target_lock_entry->vc, sreq,
                                                             iov[0].MPL_IOV_BUF,
                                                             iov[0].MPL_IOV_LEN);
-        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
   fn_exit:
@@ -1338,13 +1338,13 @@ static inline int perform_acc_in_lock_queue(MPID_Win * win_ptr,
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     mpi_errno =
         finish_op_on_target(win_ptr, target_lock_entry->vc, FALSE /* has no response data */ ,
                             acc_pkt->flags, acc_pkt->source_win_handle);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     return mpi_errno;
@@ -1377,7 +1377,7 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
 
     sreq = MPID_Request_create();
     if (sreq == NULL) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     }
     MPIU_Object_set_ref(sreq, 1);
 
@@ -1421,7 +1421,7 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
         if (mpi_errno != MPI_SUCCESS) {
             if (win_ptr->shm_allocated == TRUE)
                 MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         /* Perform ACCUMULATE OP */
@@ -1436,7 +1436,7 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
             MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         /* here we increment the Active Target counter to guarantee the GET-like
          * operation are completed when counter reaches zero. */
@@ -1450,7 +1450,7 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
         mpi_errno = MPIDI_CH3_iSendv(target_lock_entry->vc, sreq, iov, iovcnt);
         if (mpi_errno != MPI_SUCCESS) {
             MPID_Request_release(sreq);
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
         }
 
         goto fn_exit;
@@ -1490,7 +1490,7 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
             if (win_ptr->shm_allocated == TRUE)
                 MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
         }
-        MPIU_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+        MPIR_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
                              "MPID_Segment");
         MPID_Segment_init(get_accum_pkt->addr, get_accum_pkt->count, get_accum_pkt->datatype, seg,
                           0);
@@ -1509,7 +1509,7 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* here we increment the Active Target counter to guarantee the GET-like
      * operation are completed when counter reaches zero. */
@@ -1535,7 +1535,7 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
     mpi_errno = MPIDI_CH3_iSendv(target_lock_entry->vc, sreq, iov, iovcnt);
     if (mpi_errno != MPI_SUCCESS) {
         MPID_Request_release(sreq);
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
   fn_exit:
@@ -1591,7 +1591,7 @@ static inline int perform_fop_in_lock_queue(MPID_Win * win_ptr,
     if (fop_pkt->type == MPIDI_CH3_PKT_FOP) {
         resp_req = MPID_Request_create();
         if (resp_req == NULL) {
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
         }
         MPIU_Object_set_ref(resp_req, 1);
 
@@ -1622,7 +1622,7 @@ static inline int perform_fop_in_lock_queue(MPID_Win * win_ptr,
         if (mpi_errno != MPI_SUCCESS) {
             if (win_ptr->shm_allocated == TRUE)
                 MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
     else if (is_contig) {
@@ -1636,7 +1636,7 @@ static inline int perform_fop_in_lock_queue(MPID_Win * win_ptr,
             if (win_ptr->shm_allocated == TRUE)
                 MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
         }
-        MPIU_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+        MPIR_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
                              "MPID_Segment");
         MPID_Segment_init(fop_pkt->addr, 1, fop_pkt->datatype, seg, 0);
         MPID_Segment_pack(seg, 0, &last, resp_req->dev.user_buf);
@@ -1657,16 +1657,16 @@ static inline int perform_fop_in_lock_queue(MPID_Win * win_ptr,
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if (fop_pkt->type == MPIDI_CH3_PKT_FOP_IMMED) {
         /* send back the original data */
-        MPIU_THREAD_CS_ENTER(CH3COMM, target_lock_entry->vc);
+        MPID_THREAD_CS_ENTER(POBJ, target_lock_entry->vc->pobj_mutex);
         mpi_errno =
             MPIDI_CH3_iStartMsg(target_lock_entry->vc, fop_resp_pkt, sizeof(*fop_resp_pkt),
                                 &resp_req);
-        MPIU_THREAD_CS_EXIT(CH3COMM, target_lock_entry->vc);
-        MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPID_THREAD_CS_EXIT(POBJ, target_lock_entry->vc->pobj_mutex);
+        MPIR_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
         if (resp_req != NULL) {
             if (!MPID_Request_is_complete(resp_req)) {
@@ -1698,7 +1698,7 @@ static inline int perform_fop_in_lock_queue(MPID_Win * win_ptr,
         mpi_errno = MPIDI_CH3_iSendv(target_lock_entry->vc, resp_req, iov, iovcnt);
         if (mpi_errno != MPI_SUCCESS) {
             MPID_Request_release(resp_req);
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
         }
         goto fn_exit;
     }
@@ -1707,7 +1707,7 @@ static inline int perform_fop_in_lock_queue(MPID_Win * win_ptr,
     mpi_errno = finish_op_on_target(win_ptr, target_lock_entry->vc, TRUE /* has response data */ ,
                                     fop_pkt->flags, MPI_WIN_NULL);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     return mpi_errno;
@@ -1761,12 +1761,12 @@ static inline int perform_cas_in_lock_queue(MPID_Win * win_ptr,
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
     /* Send the response packet */
-    MPIU_THREAD_CS_ENTER(CH3COMM, target_lock_entry->vc);
+    MPID_THREAD_CS_ENTER(POBJ, target_lock_entry->vc->pobj_mutex);
     mpi_errno =
         MPIDI_CH3_iStartMsg(target_lock_entry->vc, cas_resp_pkt, sizeof(*cas_resp_pkt), &send_req);
-    MPIU_THREAD_CS_EXIT(CH3COMM, target_lock_entry->vc);
+    MPID_THREAD_CS_EXIT(POBJ, target_lock_entry->vc->pobj_mutex);
 
-    MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+    MPIR_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
     if (send_req != NULL) {
         if (!MPID_Request_is_complete(send_req)) {
@@ -1791,7 +1791,7 @@ static inline int perform_cas_in_lock_queue(MPID_Win * win_ptr,
     mpi_errno = finish_op_on_target(win_ptr, target_lock_entry->vc, TRUE /* has response data */ ,
                                     cas_pkt->flags, MPI_WIN_NULL);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     return mpi_errno;
@@ -1818,7 +1818,7 @@ static inline int perform_op_in_lock_queue(MPID_Win * win_ptr,
             mpi_errno = handle_lock_ack(win_ptr, win_ptr->comm_ptr->rank,
                                         MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
         else {
             mpi_errno = MPIDI_CH3I_Send_lock_ack_pkt(target_lock_entry->vc, win_ptr,
@@ -1826,7 +1826,7 @@ static inline int perform_op_in_lock_queue(MPID_Win * win_ptr,
                                                      lock_pkt->source_win_handle,
                                                      lock_pkt->request_handle);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     }
     else {
@@ -1836,38 +1836,38 @@ static inline int perform_op_in_lock_queue(MPID_Win * win_ptr,
         case (MPIDI_CH3_PKT_PUT_IMMED):
             mpi_errno = perform_put_in_lock_queue(win_ptr, target_lock_entry);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             break;
         case (MPIDI_CH3_PKT_GET):
             mpi_errno = perform_get_in_lock_queue(win_ptr, target_lock_entry);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             break;
         case (MPIDI_CH3_PKT_ACCUMULATE):
         case (MPIDI_CH3_PKT_ACCUMULATE_IMMED):
             mpi_errno = perform_acc_in_lock_queue(win_ptr, target_lock_entry);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             break;
         case (MPIDI_CH3_PKT_GET_ACCUM):
         case (MPIDI_CH3_PKT_GET_ACCUM_IMMED):
             mpi_errno = perform_get_acc_in_lock_queue(win_ptr, target_lock_entry);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             break;
         case (MPIDI_CH3_PKT_FOP):
         case (MPIDI_CH3_PKT_FOP_IMMED):
             mpi_errno = perform_fop_in_lock_queue(win_ptr, target_lock_entry);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             break;
         case (MPIDI_CH3_PKT_CAS_IMMED):
             mpi_errno = perform_cas_in_lock_queue(win_ptr, target_lock_entry);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             break;
         default:
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER,
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER,
                                  "**invalidpkt", "**invalidpkt %d", target_lock_entry->pkt.type);
         }
     }
@@ -1887,7 +1887,7 @@ static int entered_count = 0;
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Release_lock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Release_lock(MPID_Win * win_ptr)
 {
     MPIDI_RMA_Target_lock_entry_t *target_lock_entry, *target_lock_entry_next;
@@ -1955,13 +1955,13 @@ int MPIDI_CH3I_Release_lock(MPID_Win * win_ptr)
                         /* perform this OP */
                         mpi_errno = perform_op_in_lock_queue(win_ptr, target_lock_entry);
                         if (mpi_errno != MPI_SUCCESS)
-                            MPIU_ERR_POP(mpi_errno);
+                            MPIR_ERR_POP(mpi_errno);
 
                         /* free this entry */
                         mpi_errno =
                             MPIDI_CH3I_Win_target_lock_entry_free(win_ptr, target_lock_entry);
                         if (mpi_errno != MPI_SUCCESS)
-                            MPIU_ERR_POP(mpi_errno);
+                            MPIR_ERR_POP(mpi_errno);
 
                         /* if the granted lock is exclusive,
                          * no need to continue */
@@ -1988,7 +1988,7 @@ int MPIDI_CH3I_Release_lock(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_PiggybackLockOpRecvComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_PiggybackLockOpRecvComplete(MPIDI_VC_t * vc,
                                                      MPID_Request * rreq, int *complete)
 {
@@ -2056,12 +2056,12 @@ int MPIDI_CH3_ReqHandler_PiggybackLockOpRecvComplete(MPIDI_VC_t * vc,
             /* perform this OP */
             mpi_errno = perform_op_in_lock_queue(win_ptr, target_lock_queue_entry);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             /* free this entry */
             mpi_errno = MPIDI_CH3I_Win_target_lock_entry_free(win_ptr, target_lock_queue_entry);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
         /* If try acquiring lock failed, just leave the lock queue entry in the queue with
          * all_data_recved marked as 1, release_lock() function will traverse the queue
@@ -2072,7 +2072,7 @@ int MPIDI_CH3_ReqHandler_PiggybackLockOpRecvComplete(MPIDI_VC_t * vc,
      * request */
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     *complete = TRUE;
diff --git a/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c b/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
index d169ae1..559e75b 100644
--- a/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
+++ b/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_Revoke
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_Revoke(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
                                 MPIDI_msg_sz_t *buflen, MPID_Request **rreqp)
 {
@@ -22,12 +22,12 @@ int MPIDI_CH3_PktHandler_Revoke(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* Search through all of the communicators to find the right context_id */
     MPIDI_CH3I_Comm_find(revoke_pkt->revoked_comm, &comm_ptr);
     if (comm_ptr == NULL)
-        MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+        MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                 "**ch3|postrecv %s", "MPIDI_CH3_PKT_REVOKE");
 
     mpi_errno = MPID_Comm_revoke(comm_ptr, 1);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+        MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                 "**ch3|postrecv %s", "MPIDI_CH3_PKT_REVOKE");
 
     /* There is no request associated with a revoke packet */
diff --git a/src/mpid/ch3/src/ch3u_handle_send_req.c b/src/mpid/ch3/src/ch3u_handle_send_req.c
index 201f900..10c9f9f 100644
--- a/src/mpid/ch3/src/ch3u_handle_send_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_send_req.c
@@ -10,7 +10,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Handle_send_req
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Handle_send_req(MPIDI_VC_t * vc, MPID_Request * sreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -31,7 +31,7 @@ int MPIDI_CH3U_Handle_send_req(MPIDI_VC_t * vc, MPID_Request * sreq, int *comple
         mpi_errno = reqFn(vc, sreq, complete);
     }
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -83,7 +83,7 @@ int MPIDI_CH3_ReqHandler_GetSendComplete(MPIDI_VC_t * vc ATTRIBUTE((unused)),
     /* mark data transfer as complete and decrement CC */
     mpi_errno = MPID_Request_complete(sreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     /* NOTE: finish_op_on_target() must be called after we complete this request,
@@ -93,7 +93,7 @@ int MPIDI_CH3_ReqHandler_GetSendComplete(MPIDI_VC_t * vc ATTRIBUTE((unused)),
     mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */ ,
                                     flags, MPI_WIN_NULL);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     *complete = TRUE;
 
@@ -106,7 +106,7 @@ int MPIDI_CH3_ReqHandler_GetSendComplete(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_GaccumSendComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_GaccumSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -149,7 +149,7 @@ int MPIDI_CH3_ReqHandler_GaccumSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq
 
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     /* NOTE: finish_op_on_target() must be called after we complete this request,
@@ -159,7 +159,7 @@ int MPIDI_CH3_ReqHandler_GaccumSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq
     mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */ ,
                                     flags, MPI_WIN_NULL);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     *complete = TRUE;
 
@@ -175,7 +175,7 @@ int MPIDI_CH3_ReqHandler_GaccumSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_CASSendComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_CASSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -218,7 +218,7 @@ int MPIDI_CH3_ReqHandler_CASSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
 
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     /* NOTE: finish_op_on_target() must be called after we complete this request,
@@ -228,7 +228,7 @@ int MPIDI_CH3_ReqHandler_CASSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
     mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */ ,
                                     flags, MPI_WIN_NULL);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     *complete = TRUE;
 
@@ -243,7 +243,7 @@ int MPIDI_CH3_ReqHandler_CASSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ReqHandler_FOPSendComplete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_ReqHandler_FOPSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq, int *complete)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -286,7 +286,7 @@ int MPIDI_CH3_ReqHandler_FOPSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
 
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     /* NOTE: finish_op_on_target() must be called after we complete this request,
@@ -296,7 +296,7 @@ int MPIDI_CH3_ReqHandler_FOPSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
     mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */ ,
                                     flags, MPI_WIN_NULL);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     *complete = TRUE;
 
@@ -320,7 +320,7 @@ int MPIDI_CH3_ReqHandler_SendReloadIOV(MPIDI_VC_t * vc ATTRIBUTE((unused)), MPID
     sreq->dev.iov_count = MPL_IOV_LIMIT;
     mpi_errno = MPIDI_CH3U_Request_load_send_iov(sreq, sreq->dev.iov, &sreq->dev.iov_count);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SETFATALANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadsendiov");
+        MPIR_ERR_SETFATALANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadsendiov");
     }
 
     *complete = FALSE;
diff --git a/src/mpid/ch3/src/ch3u_port.c b/src/mpid/ch3/src/ch3u_port.c
index 3850c62..1be77da 100644
--- a/src/mpid/ch3/src/ch3u_port.c
+++ b/src/mpid/ch3/src/ch3u_port.c
@@ -112,7 +112,7 @@ static int MPIDI_CH3I_Initialize_tmp_comm(MPID_Comm **comm_pptr,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Create_inter_root_communicator_connect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_Create_inter_root_communicator_connect(const char *port_name, 
 							MPID_Comm **comm_pptr, 
 							MPIDI_VC_t **vc_pptr)
@@ -131,18 +131,18 @@ static int MPIDI_Create_inter_root_communicator_connect(const char *port_name,
 
     mpi_errno = MPIDI_CH3_Connect_to_root(port_name, &connect_vc);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     /* extract the tag from the port_name */
     mpi_errno = MPIDI_GetTagFromPort( port_name, &port_name_tag);
     if (mpi_errno != MPIU_STR_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     mpi_errno = MPIDI_CH3I_Initialize_tmp_comm(&tmp_comm, connect_vc, 1, port_name_tag);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     *comm_pptr = tmp_comm;
@@ -161,7 +161,7 @@ static int MPIDI_Create_inter_root_communicator_connect(const char *port_name,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Create_inter_root_communicator_accept
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_Create_inter_root_communicator_accept(const char *port_name, 
 						MPID_Comm **comm_pptr, 
 						MPIDI_VC_t **vc_pptr)
@@ -178,7 +178,7 @@ static int MPIDI_Create_inter_root_communicator_accept(const char *port_name,
     /* extract the tag from the port_name */
     mpi_errno = MPIDI_GetTagFromPort( port_name, &port_name_tag);
     if (mpi_errno != MPIU_STR_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     /* FIXME: Describe the algorithm used here, and what routine 
@@ -202,7 +202,7 @@ static int MPIDI_Create_inter_root_communicator_accept(const char *port_name,
 	if (mpi_errno)
 	{
 	    MPID_Progress_end(&progress_state);
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
 	/* --END ERROR HANDLING-- */
     }
@@ -210,7 +210,7 @@ static int MPIDI_Create_inter_root_communicator_accept(const char *port_name,
 
     mpi_errno = MPIDI_CH3I_Initialize_tmp_comm(&tmp_comm, new_vc, 0, port_name_tag);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     *comm_pptr = tmp_comm;
@@ -233,7 +233,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME  MPIDI_CH3I_Initialize_tmp_comm
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3I_Initialize_tmp_comm(MPID_Comm **comm_pptr, 
 					  MPIDI_VC_t *vc_ptr, int is_low_group, int context_id_offset)
 {
@@ -248,7 +248,7 @@ static int MPIDI_CH3I_Initialize_tmp_comm(MPID_Comm **comm_pptr,
     /* WDG-old code allocated a context id that was then discarded */
     mpi_errno = MPIR_Comm_create(&tmp_comm);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
     /* fill in all the fields of tmp_comm. */
 
@@ -292,7 +292,7 @@ static int MPIDI_CH3I_Initialize_tmp_comm(MPID_Comm **comm_pptr,
     /* Set up VC reference table */
     mpi_errno = MPIDI_VCRT_Create(tmp_comm->remote_size, &tmp_comm->dev.vcrt);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**init_vcrt");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**init_vcrt");
     }
 
     /* FIXME: Why do we do a dup here? */
@@ -302,7 +302,7 @@ static int MPIDI_CH3I_Initialize_tmp_comm(MPID_Comm **comm_pptr,
        MPI_Comm_commit, we still need to call the creation hook
        because the destruction hook will be called in comm_release */
     mpi_errno = MPID_Dev_comm_create_hook(tmp_comm);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     *comm_pptr = tmp_comm;
 
@@ -329,7 +329,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Comm_connect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root, 
 		       MPID_Comm *comm_ptr, MPID_Comm **newcomm)
 {
@@ -352,7 +352,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 
     /* Get the context ID here because we need to send it to the remote side */
     mpi_errno = MPIR_Get_contextid_sparse( comm_ptr, &recvcontext_id, FALSE );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     rank = comm_ptr->rank;
     local_comm_size = comm_ptr->local_size;
@@ -364,7 +364,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 	mpi_errno = MPIDI_Create_inter_root_communicator_connect(
 	    port_name, &tmp_comm, &new_vc);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP_LABEL(mpi_errno, no_port);
+	    MPIR_ERR_POP_LABEL(mpi_errno, no_port);
 	}
 
 	/* Make an array to translate local ranks to process group index 
@@ -379,7 +379,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 	   group id, size and all its KVS values */
 	mpi_errno = ExtractLocalPGInfo( comm_ptr, local_translation, 
 					&pg_list, &n_local_pgs );
-        MPIU_ERR_CHKINTERNAL(mpi_errno, mpi_errno, "Can't extract local PG info.");
+        MPIR_ERR_CHKINTERNAL(mpi_errno, mpi_errno, "Can't extract local PG info.");
 
 	/* Send the remote root: n_local_pgs, local_comm_size,
            Recv from the remote root: n_remote_pgs, remote_comm_size,
@@ -399,18 +399,18 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
         if (mpi_errno != MPI_SUCCESS) {
             /* this is a no_port error because we may fail to connect
                on the send if the port name is invalid */
-	    MPIU_ERR_POP_LABEL(mpi_errno, no_port);
+	    MPIR_ERR_POP_LABEL(mpi_errno, no_port);
 	}
     }
 
     /* broadcast the received info to local processes */
     MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"broadcasting the received 3 ints");
     mpi_errno = MPIR_Bcast_intra(recv_ints, 3, MPI_INT, root, comm_ptr, &errflag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
     /* check if root was unable to connect to the port */
-    MPIU_ERR_CHKANDJUMP1(recv_ints[0] == -1, mpi_errno, MPI_ERR_PORT, "**portexist", "**portexist %s", port_name);
+    MPIR_ERR_CHKANDJUMP1(recv_ints[0] == -1, mpi_errno, MPI_ERR_PORT, "**portexist", "**portexist %s", port_name);
     
     n_remote_pgs     = recv_ints[0];
     remote_comm_size = recv_ints[1];
@@ -441,7 +441,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 				  MPI_INT, 0, recvtag++, tmp_comm,
 				  MPI_STATUS_IGNORE, &errflag);
 	if (mpi_errno) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
 
 #ifdef MPICH_DBG_OUTPUT
@@ -463,8 +463,8 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Broadcasting remote translation");
     mpi_errno = MPIR_Bcast_intra(remote_translation, remote_comm_size * 2, MPI_INT,
                                  root, comm_ptr, &errflag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
 #ifdef MPICH_DBG_OUTPUT
     MPIU_DBG_PRINTF(("[%d]connect:Received remote_translation after broadcast:\n", rank));
@@ -476,7 +476,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 #endif
 
     mpi_errno = MPIR_Comm_create(newcomm);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     (*newcomm)->context_id     = context_id;
     (*newcomm)->recvcontext_id = recvcontext_id;
@@ -485,7 +485,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     mpi_errno = SetupNewIntercomm( comm_ptr, remote_comm_size, 
 				   remote_translation, remote_pg, *newcomm );
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     /* synchronize with remote root */
@@ -497,7 +497,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
                                      0, recvtag++, tmp_comm,
                                      MPI_STATUS_IGNORE, &errflag);
         if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
         }
 
         /* All communication with remote root done. Release the communicator. */
@@ -507,7 +507,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     /*printf("connect:barrier\n");fflush(stdout);*/
     mpi_errno = MPIR_Barrier_intra(comm_ptr, &errflag);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     /* Free new_vc. It was explicitly allocated in MPIDI_CH3_Connect_to_root.*/
@@ -525,13 +525,13 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
         int mpi_errno2 = MPI_SUCCESS;
         if (new_vc) {
 	    mpi_errno2 = MPIDI_CH3_VC_Destroy(new_vc);
-            if (mpi_errno2) MPIU_ERR_SET(mpi_errno2, MPI_ERR_OTHER, "**fail");
+            if (mpi_errno2) MPIR_ERR_SET(mpi_errno2, MPI_ERR_OTHER, "**fail");
         }
 
         if (recvcontext_id != MPIU_INVALID_CONTEXT_ID)
             MPIR_Free_contextid(recvcontext_id);
         
-        if (mpi_errno2) MPIU_ERR_ADD(mpi_errno, mpi_errno2);
+        if (mpi_errno2) MPIR_ERR_ADD(mpi_errno, mpi_errno2);
 
         goto fn_exit;
     }
@@ -544,15 +544,15 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
         recv_ints[0] = -1;
         recv_ints[1] = -1;
         recv_ints[2] = -1;
-        MPIU_ERR_SET1(mpi_errno, MPI_ERR_PORT, "**portexist", "**portexist %s", port_name);
+        MPIR_ERR_SET1(mpi_errno, MPI_ERR_PORT, "**portexist", "**portexist %s", port_name);
 
         /* notify other processes to return an error */
         MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"broadcasting 3 ints: error case");
         mpi_errno2 = MPIR_Bcast_intra(recv_ints, 3, MPI_INT, root, comm_ptr, &errflag);
-        if (mpi_errno2) MPIU_ERR_ADD(mpi_errno, mpi_errno2);
+        if (mpi_errno2) MPIR_ERR_ADD(mpi_errno, mpi_errno2);
         if (errflag) {
-            MPIU_ERR_SET(mpi_errno2, MPI_ERR_OTHER, "**coll_fail");
-            MPIU_ERR_ADD(mpi_errno, mpi_errno2);
+            MPIR_ERR_SET(mpi_errno2, MPI_ERR_OTHER, "**coll_fail");
+            MPIR_ERR_ADD(mpi_errno, mpi_errno2);
         }
         goto fn_fail;
     }
@@ -573,7 +573,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 #undef FUNCNAME
 #define FUNCNAME ExtractLocalPGInfo
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int ExtractLocalPGInfo( MPID_Comm *comm_p, 
 			       pg_translation local_translation[], 
 			       pg_node **pg_list_p,
@@ -609,7 +609,7 @@ static int ExtractLocalPGInfo( MPID_Comm *comm_p,
     mpi_errno = MPIDI_PG_To_string(comm_p->dev.vcrt->vcr_table[0]->pg, &pg_list->str,
 				   &pg_list->lenStr );
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
     MPIU_DBG_STMT(CH3_CONNECT,VERBOSE,MPIDI_PrintConnStr(__FILE__,__LINE__,"PG as string is", pg_list->str ));
     local_translation[0].pg_index = 0;
@@ -636,7 +636,7 @@ static int ExtractLocalPGInfo( MPID_Comm *comm_p,
 	       advance how many nodes we may allocate */
 	    pg_iter = (pg_node*)MPIU_Malloc(sizeof(pg_node));
 	    if (!pg_iter) {
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
 	    pg_iter->pg_id = MPIU_Strdup(comm_p->dev.vcrt->vcr_table[i]->pg->id);
 	    pg_iter->index = cur_index++;
@@ -644,7 +644,7 @@ static int ExtractLocalPGInfo( MPID_Comm *comm_p,
 	    mpi_errno = MPIDI_PG_To_string(comm_p->dev.vcrt->vcr_table[i]->pg, &pg_iter->str,
 					   &pg_iter->lenStr );
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
 	    local_translation[i].pg_index = pg_iter->index;
 	    local_translation[i].pg_rank = comm_p->dev.vcrt->vcr_table[i]->pg_rank;
@@ -680,7 +680,7 @@ static int ExtractLocalPGInfo( MPID_Comm *comm_p,
 #undef FUNCNAME
 #define FUNCNAME ReceivePGAndDistribute
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr, 
 				   int root, int *recvtag_p, 
 				   int n_remote_pgs, MPIDI_PG_t *remote_pg[] )
@@ -703,44 +703,44 @@ static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr,
 				  tmp_comm, MPI_STATUS_IGNORE, &errflag);
 	    *recvtag_p = recvtag;
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
 	    pg_str = (char*)MPIU_Malloc(j);
 	    if (pg_str == NULL) {
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
 	    mpi_errno = MPIC_Recv(pg_str, j, MPI_CHAR, 0, recvtag++,
 				  tmp_comm, MPI_STATUS_IGNORE, &errflag);
 	    *recvtag_p = recvtag;
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
 	}
 
 	/* Broadcast the size and data to the local communicator */
 	/*printf("accept:broadcasting 1 int\n");fflush(stdout);*/
 	mpi_errno = MPIR_Bcast_intra(&j, 1, MPI_INT, root, comm_ptr, &errflag);
-	if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+	if (mpi_errno != MPI_SUCCESS) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
 	if (rank != root) {
 	    /* The root has already allocated this string */
 	    pg_str = (char*)MPIU_Malloc(j);
 	    if (pg_str == NULL) {
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
 	}
 	/*printf("accept:broadcasting string of length %d\n", j);fflush(stdout);*/
 	mpi_errno = MPIR_Bcast_intra(pg_str, j, MPI_CHAR, root, comm_ptr, &errflag);
-	if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+	if (mpi_errno != MPI_SUCCESS) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 	/* Then reconstruct the received process group.  This step
 	   also initializes the created process group */
 
 	MPIU_DBG_STMT(CH3_CONNECT,VERBOSE,MPIDI_PrintConnStr(__FILE__,__LINE__,"Creating pg from string", pg_str ));
 	mpi_errno = MPIDI_PG_Create_from_string(pg_str, &remote_pg[i], &flag);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
 	
 	MPIU_Free(pg_str);
@@ -759,7 +759,7 @@ static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr,
 #undef FUNCNAME
 #define FUNCNAME MPID_PG_BCast
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
 {
     int n_local_pgs=0, mpi_errno = MPI_SUCCESS;
@@ -784,8 +784,8 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
 
     /* Now, broadcast the number of local pgs */
     mpi_errno = MPIR_Bcast_impl( &n_local_pgs, 1, MPI_INT, root, comm_p, &errflag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
     pg_list = pg_head;
     for (i=0; i<n_local_pgs; i++) {
@@ -805,8 +805,8 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
 	    pg_list = pg_list->next;
 	}
 	mpi_errno = MPIR_Bcast_impl( &len, 1, MPI_INT, root, comm_p, &errflag);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 	if (rank != root) {
 	    pg_str = (char *)MPIU_Malloc(len);
             if (!pg_str) {
@@ -818,9 +818,9 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
         if (mpi_errno) {
             if (rank != root)
                 MPIU_Free( pg_str );
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
 	if (rank != root) {
 	    /* flag is true if the pg was created, false if it
@@ -863,7 +863,7 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
 #undef FUNCNAME
 #define FUNCNAME SendPGtoPeerAndFree
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int SendPGtoPeerAndFree( MPID_Comm *tmp_comm, int *sendtag_p, 
 				pg_node *pg_list )
 {
@@ -882,7 +882,7 @@ static int SendPGtoPeerAndFree( MPID_Comm *tmp_comm, int *sendtag_p,
 	mpi_errno = MPIC_Send(&i, 1, MPI_INT, 0, sendtag++, tmp_comm, &errflag);
 	*sendtag_p = sendtag;
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
 	
 	/* printf("connect:sending string length %d\n", i);fflush(stdout); */
@@ -890,7 +890,7 @@ static int SendPGtoPeerAndFree( MPID_Comm *tmp_comm, int *sendtag_p,
 			      tmp_comm, &errflag);
 	*sendtag_p = sendtag;
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
 	
 	pg_list = pg_list->next;
@@ -925,7 +925,7 @@ static int SendPGtoPeerAndFree( MPID_Comm *tmp_comm, int *sendtag_p,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Comm_accept
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root, 
 		      MPID_Comm *comm_ptr, MPID_Comm **newcomm)
 {
@@ -949,10 +949,10 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
        context id to the other side. */
     mpi_errno = MPIR_Comm_create(newcomm);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
     mpi_errno = MPIR_Get_contextid_sparse( comm_ptr, &(*newcomm)->recvcontext_id, FALSE );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     /* FIXME why is this commented out? */
     /*    (*newcomm)->context_id = (*newcomm)->recvcontext_id; */
     
@@ -966,7 +966,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
 	mpi_errno = MPIDI_Create_inter_root_communicator_accept(port_name, 
 						&tmp_comm, &new_vc);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
 
 	/* Make an array to translate local ranks to process group index and 
@@ -995,15 +995,15 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
                                      0, recvtag++, tmp_comm,
                                      MPI_STATUS_IGNORE, &errflag);
         if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     }
 
     /* broadcast the received info to local processes */
     /*printf("accept:broadcasting 2 ints - %d and %d\n", recv_ints[0], recv_ints[1]);fflush(stdout);*/
     mpi_errno = MPIR_Bcast_intra(recv_ints, 3, MPI_INT, root, comm_ptr, &errflag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
 
     n_remote_pgs     = recv_ints[0];
@@ -1047,15 +1047,15 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     {
 	mpi_errno = ReceivePGAndDistribute( tmp_comm, comm_ptr, root, &recvtag,
 					    n_remote_pgs, remote_pg );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* Broadcast out the remote rank translation array */
     MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Broadcast remote_translation");
     mpi_errno = MPIR_Bcast_intra(remote_translation, remote_comm_size * 2, MPI_INT, 
                                  root, comm_ptr, &errflag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 #ifdef MPICH_DBG_OUTPUT
     MPIU_DBG_PRINTF(("[%d]accept:Received remote_translation after broadcast:\n", rank));
     for (i=0; i<remote_comm_size; i++)
@@ -1074,7 +1074,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     mpi_errno = SetupNewIntercomm( comm_ptr, remote_comm_size, 
 				   remote_translation, remote_pg, intercomm );
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     /* synchronize with remote root */
@@ -1086,7 +1086,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
                                      0, recvtag++, tmp_comm,
                                      MPI_STATUS_IGNORE, &errflag);
         if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
         }
 
         /* All communication with remote root done. Release the communicator. */
@@ -1096,7 +1096,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Barrier");
     mpi_errno = MPIR_Barrier_intra(comm_ptr, &errflag);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     /* Free new_vc once the connection is completed. It was explicitly 
@@ -1142,7 +1142,7 @@ Input/Output Parameters:
 #undef FUNCNAME
 #define FUNCNAME SetupNewIntercomm
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int SetupNewIntercomm( MPID_Comm *comm_ptr, int remote_comm_size, 
 			      pg_translation remote_translation[],
 			      MPIDI_PG_t **remote_pg, 
@@ -1171,7 +1171,7 @@ static int SetupNewIntercomm( MPID_Comm *comm_ptr, int remote_comm_size,
     /* Set up VC reference table */
     mpi_errno = MPIDI_VCRT_Create(intercomm->remote_size, &intercomm->dev.vcrt);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**init_vcrt");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**init_vcrt");
     }
     for (i=0; i < intercomm->remote_size; i++) {
 	MPIDI_PG_Dup_vcr(remote_pg[remote_translation[i].pg_index], 
@@ -1179,12 +1179,12 @@ static int SetupNewIntercomm( MPID_Comm *comm_ptr, int remote_comm_size,
     }
 
     mpi_errno = MPIR_Comm_commit(intercomm);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Barrier");
     mpi_errno = MPIR_Barrier_intra(comm_ptr, &errflag);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -1199,7 +1199,7 @@ static int SetupNewIntercomm( MPID_Comm *comm_ptr, int remote_comm_size,
 #undef FUNCNAME
 #define FUNCNAME FreeNewVC
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int FreeNewVC( MPIDI_VC_t *new_vc )
 {
     MPID_Progress_state progress_state;
@@ -1215,7 +1215,7 @@ static int FreeNewVC( MPIDI_VC_t *new_vc )
 	    if (mpi_errno != MPI_SUCCESS)
                 {
                     MPID_Progress_end(&progress_state);
-		    MPIU_ERR_POP(mpi_errno);
+		    MPIR_ERR_POP(mpi_errno);
                 }
 	    /* --END ERROR HANDLING-- */
 	}
@@ -1261,7 +1261,7 @@ static int AcceptQueueSize    = 0;
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Acceptq_enqueue
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Acceptq_enqueue(MPIDI_VC_t * vc, int port_name_tag )
 {
     int mpi_errno=MPI_SUCCESS;
@@ -1305,7 +1305,7 @@ int MPIDI_CH3I_Acceptq_enqueue(MPIDI_VC_t * vc, int port_name_tag )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Acceptq_dequeue
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Acceptq_dequeue(MPIDI_VC_t ** vc, int port_name_tag)
 {
     int mpi_errno=MPI_SUCCESS;
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index 3b15262..4d98758 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -105,7 +105,7 @@ MPIR_T_PVAR_ULONG2_LEVEL_DECL(RECVQ, unexpected_recvq_buffer_size);
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Recvq_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Recvq_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -210,7 +210,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Recvq_FU
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Recvq_FU(int source, int tag, int context_id, MPI_Status *s)
 {
     MPID_Request * rreq;
@@ -220,8 +220,6 @@ int MPIDI_CH3U_Recvq_FU(int source, int tag, int context_id, MPI_Status *s)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_RECVQ_FU);
 
-    MPIU_THREAD_CS_ASSERT_HELD(MSGQUEUE);
-
     rreq = recvq_unexpected_head;
 
     match.parts.context_id = context_id;
@@ -291,7 +289,7 @@ int MPIDI_CH3U_Recvq_FU(int source, int tag, int context_id, MPI_Status *s)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Recvq_FDU
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 MPID_Request * MPIDI_CH3U_Recvq_FDU(MPI_Request sreq_id, 
 				    MPIDI_Message_match * match)
 {
@@ -305,8 +303,6 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU(MPI_Request sreq_id,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_RECVQ_FDU);
 
-    MPIU_THREAD_CS_ASSERT_HELD(MSGQUEUE);
-
     matching_prev_rreq = NULL;
     matching_cur_rreq = NULL;
     prev_rreq = NULL;
@@ -376,7 +372,7 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU(MPI_Request sreq_id,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Recvq_FDU_matchonly
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 MPID_Request * MPIDI_CH3U_Recvq_FDU_matchonly(int source, int tag, int context_id, MPID_Comm *comm, int *foundp)
 {
     int found = FALSE;
@@ -387,8 +383,6 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU_matchonly(int source, int tag, int context_i
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_RECVQ_FDU_MATCHONLY);
 
-    MPIU_THREAD_CS_ASSERT_HELD(MSGQUEUE);
-
     /* Store how much time is spent traversing the queue */
     MPIR_T_PVAR_TIMER_START(RECVQ, time_matching_unexpectedq);
 
@@ -495,7 +489,7 @@ lock_exit:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Recvq_FDU_or_AEP
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag, 
                                            int context_id, MPID_Comm *comm, void *user_buf,
                                            MPI_Aint user_count, MPI_Datatype datatype, int * foundp)
@@ -509,8 +503,6 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_RECVQ_FDU_OR_AEP);
 
-    MPIU_THREAD_CS_ASSERT_HELD(MSGQUEUE);
-
     /* Store how much time is spent traversing the queue */
     MPIR_T_PVAR_TIMER_START(RECVQ, time_matching_unexpectedq);
 
@@ -634,7 +626,7 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag,
             MPIDI_VC_t *vc;
             MPIDI_Comm_get_vc(comm, source, &vc);
             if (vc->state == MPIDI_VC_STATE_MORIBUND) {
-                MPIU_ERR_SET1(mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+                MPIR_ERR_SET1(mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
                 rreq->status.MPI_ERROR = mpi_errno;
                 MPID_Request_complete(rreq);
                 goto lock_exit;
@@ -676,7 +668,7 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Recvq_DP
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Recvq_DP(MPID_Request * rreq)
 {
     int found;
@@ -691,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? */
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
     MPIR_T_PVAR_TIMER_START(RECVQ, time_failed_matching_postedq);
     cur_rreq = recvq_posted_head;
     while (cur_rreq != NULL) {
@@ -721,7 +713,7 @@ int MPIDI_CH3U_Recvq_DP(MPID_Request * rreq)
     if (!found)
         MPIR_T_PVAR_TIMER_END(RECVQ, time_failed_matching_postedq);
 
-    MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3U_RECVQ_DP);
     return found;
@@ -749,7 +741,7 @@ int MPIDI_CH3U_Recvq_DP(MPID_Request * rreq)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Recvq_FDP_or_AEU
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 MPID_Request * MPIDI_CH3U_Recvq_FDP_or_AEU(MPIDI_Message_match * match, 
 					   int * foundp)
 {
@@ -762,8 +754,6 @@ MPID_Request * MPIDI_CH3U_Recvq_FDP_or_AEU(MPIDI_Message_match * match,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_RECVQ_FDP_OR_AEU);
 
-    MPIU_THREAD_CS_ASSERT_HELD(MSGQUEUE);
-
     /* Unset the error bit if it is set on the incoming packet so we don't
      * have to mask it every time. It will get reset at the end of the loop or
      * before the request is added to the unexpected queue if was set here. */
@@ -882,7 +872,7 @@ static inline int req_uses_vc(const MPID_Request* req, const MPIDI_VC_t *vc)
 #undef FUNCNAME
 #define FUNCNAME dequeue_and_set_error
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* This dequeues req from the posted recv queue, set req's error code to comm_fail, and updates the req pointer.
    Note that this creates a new error code if one hasn't already been created (i.e., if *error is MPI_SUCCESS). */
 static inline void dequeue_and_set_error(MPID_Request **req,  MPID_Request *prev_req, MPID_Request **head, MPID_Request **tail, int *error, int rank)
@@ -933,9 +923,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
 
     MPIDI_FUNC_ENTER(MPIDI_CH3U_CLEAN_RECVQ);
 
-    MPIU_THREAD_CS_ASSERT_HELD(MSGQUEUE);
-
-    MPIU_ERR_SETSIMPLE(error, MPIX_ERR_REVOKED, "**revoked");
+    MPIR_ERR_SETSIMPLE(error, MPIX_ERR_REVOKED, "**revoked");
 
     rreq = recvq_unexpected_head;
     mask.parts.context_id = ~0;
@@ -1134,7 +1122,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Complete_posted_with_error
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Complete_posted_with_error(MPIDI_VC_t *vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1144,9 +1132,9 @@ int MPIDI_CH3U_Complete_posted_with_error(MPIDI_VC_t *vc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDU_COMPLETE_POSTED_WITH_ERROR);
 
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
 
-    MPIU_ERR_SETSIMPLE(error, MPIX_ERR_PROC_FAILED, "**proc_failed");
+    MPIR_ERR_SETSIMPLE(error, MPIX_ERR_PROC_FAILED, "**proc_failed");
 
     /* check each req in the posted queue and complete-with-error any requests
        using this VC. */
@@ -1162,7 +1150,7 @@ int MPIDI_CH3U_Complete_posted_with_error(MPIDI_VC_t *vc)
     }
     
  fn_exit:
-    MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_COMPLETE_POSTED_WITH_ERROR);
     return mpi_errno;
@@ -1206,7 +1194,7 @@ void MPIDI_CH3U_Dbg_print_recvq(FILE *stream);
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Dbg_print_recvq
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDI_CH3U_Dbg_print_recvq(FILE *stream)
 {
     MPID_Request * rreq;
@@ -1260,14 +1248,12 @@ void MPIDI_CH3U_Dbg_print_recvq(FILE *stream)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Recvq_count_unexp
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Recvq_count_unexp(void)
 {
     int count = 0;
     MPID_Request *req = recvq_unexpected_head;
 
-    MPIU_THREAD_CS_ASSERT_HELD(MSGQUEUE);
-
     while (req)
     {
         ++count;
diff --git a/src/mpid/ch3/src/ch3u_request.c b/src/mpid/ch3/src/ch3u_request.c
index 67a04d3..6a6605a 100644
--- a/src/mpid/ch3/src/ch3u_request.c
+++ b/src/mpid/ch3/src/ch3u_request.c
@@ -34,7 +34,7 @@ MPIU_Object_alloc_t MPID_Request_mem = {
 #undef FUNCNAME
 #define FUNCNAME MPID_Request_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 MPID_Request * MPID_Request_create(void)
 {
     MPID_Request * req;
@@ -136,7 +136,7 @@ MPID_Request * MPID_Request_create(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Request_load_send_iov
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq, 
 				     MPL_IOV * const iov, int * const iov_n)
 {
@@ -248,7 +248,7 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Request_load_recv_iov
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 {
     MPI_Aint last;
@@ -457,7 +457,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Request_unpack_srbuf
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Request_unpack_srbuf(MPID_Request * rreq)
 {
     MPI_Aint last;
@@ -534,7 +534,7 @@ int MPIDI_CH3U_Request_unpack_srbuf(MPID_Request * rreq)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Request_unpack_uebuf
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Request_unpack_uebuf(MPID_Request * rreq)
 {
     int dt_contig;
@@ -627,7 +627,7 @@ int MPID_Request_complete(MPID_Request *req)
         if (req->request_completed_cb != NULL) {
             mpi_errno = req->request_completed_cb(req);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
         }
 
diff --git a/src/mpid/ch3/src/ch3u_rma_ops.c b/src/mpid/ch3/src/ch3u_rma_ops.c
index 95f153f..76de395 100644
--- a/src/mpid/ch3/src/ch3u_rma_ops.c
+++ b/src/mpid/ch3/src/ch3u_rma_ops.c
@@ -37,7 +37,7 @@ cvars:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Put
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype
                    origin_datatype, int target_rank, MPI_Aint target_disp,
                    int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
@@ -54,7 +54,7 @@ int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PUT);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     if (target_rank == MPI_PROC_NULL) {
@@ -90,13 +90,13 @@ int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype
         mpi_errno = MPIDI_CH3I_Shm_put_op(origin_addr, origin_count, origin_datatype, target_rank,
                                           target_disp, target_count, target_datatype, win_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (ureq) {
             /* Complete user request and release the ch3 ref */
             mpi_errno = MPID_Request_complete(ureq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -109,7 +109,7 @@ int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype
         /* queue it up */
         mpi_errno = MPIDI_CH3I_Win_get_op(win_ptr, &op_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
 
@@ -178,25 +178,25 @@ int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype
             void *src = (void *) origin_addr, *dest = (void *) (put_pkt->info.data);
             mpi_errno = immed_copy(src, dest, data_sz);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
 
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
 
         mpi_errno = MPIDI_CH3I_Win_enqueue_op(win_ptr, op_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, target_rank, &made_progress);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
             MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
             while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
                 mpi_errno = wait_progress_engine();
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -214,7 +214,7 @@ int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Get
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
                    origin_datatype, int target_rank, MPI_Aint target_disp,
                    int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
@@ -231,7 +231,7 @@ int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_GET);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     if (target_rank == MPI_PROC_NULL) {
@@ -268,13 +268,13 @@ int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
         mpi_errno = MPIDI_CH3I_Shm_get_op(origin_addr, origin_count, origin_datatype, target_rank,
                                           target_disp, target_count, target_datatype, win_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (ureq) {
             /* Complete user request and release the ch3 ref */
             mpi_errno = MPID_Request_complete(ureq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -288,7 +288,7 @@ int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
         /* queue it up */
         mpi_errno = MPIDI_CH3I_Win_get_op(win_ptr, &op_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
 
@@ -354,18 +354,18 @@ int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
 
         mpi_errno = MPIDI_CH3I_Win_enqueue_op(win_ptr, op_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, target_rank, &made_progress);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
             MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
             while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
                 mpi_errno = wait_progress_engine();
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -384,7 +384,7 @@ int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Accumulate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
                           origin_datatype, int target_rank, MPI_Aint target_disp,
                           int target_count, MPI_Datatype target_datatype, MPI_Op op,
@@ -401,7 +401,7 @@ int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatyp
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_ACCUMULATE);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     if (target_rank == MPI_PROC_NULL) {
@@ -438,13 +438,13 @@ int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatyp
                                           target_rank, target_disp, target_count, target_datatype,
                                           op, win_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (ureq) {
             /* Complete user request and release the ch3 ref */
             mpi_errno = MPID_Request_complete(ureq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -461,7 +461,7 @@ int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatyp
         /* queue it up */
         mpi_errno = MPIDI_CH3I_Win_get_op(win_ptr, &op_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
 
@@ -558,25 +558,25 @@ int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatyp
             void *src = (void *) origin_addr, *dest = (void *) (accum_pkt->info.data);
             mpi_errno = immed_copy(src, dest, data_sz);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
 
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
 
         mpi_errno = MPIDI_CH3I_Win_enqueue_op(win_ptr, op_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, target_rank, &made_progress);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
             MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
             while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
                 mpi_errno = wait_progress_engine();
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -595,7 +595,7 @@ int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatyp
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Get_accumulate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
                               MPI_Datatype origin_datatype, void *result_addr, int result_count,
                               MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
@@ -614,7 +614,7 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_GET_ACCUMULATE);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     if (target_rank == MPI_PROC_NULL) {
@@ -653,13 +653,13 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
                                               target_rank, target_disp, target_count,
                                               target_datatype, op, win_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (ureq) {
             /* Complete user request and release the ch3 ref */
             mpi_errno = MPID_Request_complete(ureq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -682,7 +682,7 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
         /* Append the operation to the window's RMA ops queue */
         mpi_errno = MPIDI_CH3I_Win_get_op(win_ptr, &op_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         /* TODO: Can we use the MPIDI_RMA_ACC_CONTIG optimization? */
 
@@ -810,25 +810,25 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
             void *src = (void *) origin_addr, *dest = (void *) (get_accum_pkt->info.data);
             mpi_errno = immed_copy(src, dest, orig_data_sz);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
 
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
 
         mpi_errno = MPIDI_CH3I_Win_enqueue_op(win_ptr, op_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, target_rank, &made_progress);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
             MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
             while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
                 mpi_errno = wait_progress_engine();
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -847,7 +847,7 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
 #undef FUNCNAME
 #define FUNCNAME MPID_Put
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Put(const void *origin_addr, int origin_count, MPI_Datatype
              origin_datatype, int target_rank, MPI_Aint target_disp,
              int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr)
@@ -874,7 +874,7 @@ int MPID_Put(const void *origin_addr, int origin_count, MPI_Datatype
 #undef FUNCNAME
 #define FUNCNAME MPID_Get
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Get(void *origin_addr, int origin_count, MPI_Datatype
              origin_datatype, int target_rank, MPI_Aint target_disp,
              int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr)
@@ -901,7 +901,7 @@ int MPID_Get(void *origin_addr, int origin_count, MPI_Datatype
 #undef FUNCNAME
 #define FUNCNAME MPID_Accumulate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
                     origin_datatype, int target_rank, MPI_Aint target_disp,
                     int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win * win_ptr)
@@ -928,7 +928,7 @@ int MPID_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
 #undef FUNCNAME
 #define FUNCNAME MPID_Get_accumulate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Get_accumulate(const void *origin_addr, int origin_count,
                         MPI_Datatype origin_datatype, void *result_addr, int result_count,
                         MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
@@ -959,7 +959,7 @@ int MPID_Get_accumulate(const void *origin_addr, int origin_count,
 #undef FUNCNAME
 #define FUNCNAME MPID_Compare_and_swap
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
                           void *result_addr, MPI_Datatype datatype, int target_rank,
                           MPI_Aint target_disp, MPID_Win * win_ptr)
@@ -973,7 +973,7 @@ int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_COMPARE_AND_SWAP);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     if (target_rank == MPI_PROC_NULL) {
@@ -1008,7 +1008,7 @@ int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
         mpi_errno = MPIDI_CH3I_Shm_cas_op(origin_addr, compare_addr, result_addr,
                                           datatype, target_rank, target_disp, win_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     else {
         MPIDI_RMA_Op_t *op_ptr = NULL;
@@ -1019,7 +1019,7 @@ int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
         /* Append this operation to the RMA ops queue */
         mpi_errno = MPIDI_CH3I_Win_get_op(win_ptr, &op_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
 
@@ -1053,29 +1053,29 @@ int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
         src = (void *) origin_addr, dest = (void *) (&(cas_pkt->origin_data));
         mpi_errno = immed_copy(src, dest, type_size);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         src = (void *) compare_addr, dest = (void *) (&(cas_pkt->compare_data));
         mpi_errno = immed_copy(src, dest, type_size);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
 
         mpi_errno = MPIDI_CH3I_Win_enqueue_op(win_ptr, op_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, target_rank, &made_progress);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
             MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
             while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
                 mpi_errno = wait_progress_engine();
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -1093,7 +1093,7 @@ int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
 #undef FUNCNAME
 #define FUNCNAME MPID_Fetch_and_op
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Fetch_and_op(const void *origin_addr, void *result_addr,
                       MPI_Datatype datatype, int target_rank,
                       MPI_Aint target_disp, MPI_Op op, MPID_Win * win_ptr)
@@ -1107,7 +1107,7 @@ int MPID_Fetch_and_op(const void *origin_addr, void *result_addr,
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_FETCH_AND_OP);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     if (target_rank == MPI_PROC_NULL) {
@@ -1141,7 +1141,7 @@ int MPID_Fetch_and_op(const void *origin_addr, void *result_addr,
         mpi_errno = MPIDI_CH3I_Shm_fop_op(origin_addr, result_addr, datatype,
                                           target_rank, target_disp, op, win_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     else {
         MPIDI_RMA_Op_t *op_ptr = NULL;
@@ -1153,7 +1153,7 @@ int MPID_Fetch_and_op(const void *origin_addr, void *result_addr,
         /* Append this operation to the RMA ops queue */
         mpi_errno = MPIDI_CH3I_Win_get_op(win_ptr, &op_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
 
@@ -1199,25 +1199,25 @@ int MPID_Fetch_and_op(const void *origin_addr, void *result_addr,
             void *src = (void *) origin_addr, *dest = (void *) (fop_pkt->info.data);
             mpi_errno = immed_copy(src, dest, type_size);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
 
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
 
         mpi_errno = MPIDI_CH3I_Win_enqueue_op(win_ptr, op_ptr);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, target_rank, &made_progress);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
             MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
             while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
                 mpi_errno = wait_progress_engine();
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
         }
     }
diff --git a/src/mpid/ch3/src/ch3u_rma_pkthandler.c b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
index 615f3ff..395ddae 100644
--- a/src/mpid/ch3/src/ch3u_rma_pkthandler.c
+++ b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
@@ -181,7 +181,7 @@ void MPIDI_CH3_RMA_Init_pkthandler_pvars(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ExtPktHandler_Accumulate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3_ExtPktHandler_Accumulate(MPIDI_CH3_Pkt_flags_t flags,
                                               int is_derived_dt, void **ext_hdr_ptr,
                                               MPI_Aint * ext_hdr_sz)
@@ -195,7 +195,7 @@ static int MPIDI_CH3_ExtPktHandler_Accumulate(MPIDI_CH3_Pkt_flags_t flags,
         (*ext_hdr_sz) = sizeof(MPIDI_CH3_Ext_pkt_accum_stream_derived_t);
         (*ext_hdr_ptr) = MPIU_Malloc(sizeof(MPIDI_CH3_Ext_pkt_accum_stream_derived_t));
         if ((*ext_hdr_ptr) == NULL) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_stream_derived_t");
         }
     }
@@ -203,7 +203,7 @@ static int MPIDI_CH3_ExtPktHandler_Accumulate(MPIDI_CH3_Pkt_flags_t flags,
         (*ext_hdr_sz) = sizeof(MPIDI_CH3_Ext_pkt_accum_stream_t);
         (*ext_hdr_ptr) = MPIU_Malloc(sizeof(MPIDI_CH3_Ext_pkt_accum_stream_t));
         if ((*ext_hdr_ptr) == NULL) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_stream_t");
         }
     }
@@ -211,7 +211,7 @@ static int MPIDI_CH3_ExtPktHandler_Accumulate(MPIDI_CH3_Pkt_flags_t flags,
         (*ext_hdr_sz) = sizeof(MPIDI_CH3_Ext_pkt_accum_derived_t);
         (*ext_hdr_ptr) = MPIU_Malloc(sizeof(MPIDI_CH3_Ext_pkt_accum_derived_t));
         if ((*ext_hdr_ptr) == NULL) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_derived_t");
         }
     }
@@ -230,7 +230,7 @@ static int MPIDI_CH3_ExtPktHandler_Accumulate(MPIDI_CH3_Pkt_flags_t flags,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_ExtPktHandler_GetAccumulate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_CH3_ExtPktHandler_GetAccumulate(MPIDI_CH3_Pkt_flags_t flags,
                                                  int is_derived_dt, void **ext_hdr_ptr,
                                                  MPI_Aint * ext_hdr_sz)
@@ -256,7 +256,7 @@ static int MPIDI_CH3_ExtPktHandler_GetAccumulate(MPIDI_CH3_Pkt_flags_t flags,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_Put
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                              MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -281,7 +281,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     mpi_errno = check_piggyback_lock(win_ptr, vc, pkt, buflen, &acquire_lock_fail, &req);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if (acquire_lock_fail) {
         (*rreqp) = req;
@@ -303,7 +303,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         mpi_errno = finish_op_on_target(win_ptr, vc, FALSE /* has no response data */ ,
                                         put_pkt->flags, put_pkt->source_win_handle);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
         *rreqp = NULL;
@@ -337,7 +337,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
             MPIU_Assert(req->dev.recv_data_sz > 0);
 
             mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
-            MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+            MPIR_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                                  "**ch3|postrecv %s", "MPIDI_CH3_PKT_PUT");
 
             /* return the number of bytes processed in this function */
@@ -346,7 +346,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
             if (complete) {
                 mpi_errno = MPIDI_CH3_ReqHandler_PutRecvComplete(vc, req, &complete);
                 if (mpi_errno)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 if (complete) {
                     *rreqp = NULL;
                     goto fn_exit;
@@ -363,7 +363,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
             req->dev.ext_hdr_sz = sizeof(MPIDI_CH3_Ext_pkt_put_derived_t);
             req->dev.ext_hdr_ptr = MPIU_Malloc(req->dev.ext_hdr_sz);
             if (!req->dev.ext_hdr_ptr) {
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+                MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
                                      "MPIDI_CH3_Ext_pkt_put_derived_t");
             }
 
@@ -371,7 +371,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
              * It will be freed when free datatype. */
             req->dev.dataloop = MPIU_Malloc(put_pkt->info.dataloop_size);
             if (!req->dev.dataloop) {
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
+                MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
                                      put_pkt->info.dataloop_size);
             }
 
@@ -389,7 +389,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
                 /* All dtype data has been received, call req handler */
                 mpi_errno = MPIDI_CH3_ReqHandler_PutDerivedDTRecvComplete(vc, req, &complete);
-                MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+                MPIR_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                                      "**ch3|postrecv %s", "MPIDI_CH3_PKT_PUT");
                 if (complete) {
                     *rreqp = NULL;
@@ -413,7 +413,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         *rreqp = req;
 
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+            MPIR_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                           "**ch3|postrecv %s", "MPIDI_CH3_PKT_PUT");
         }
     }
@@ -430,7 +430,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_Get
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                              MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -457,7 +457,7 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     mpi_errno = check_piggyback_lock(win_ptr, vc, pkt, buflen, &acquire_lock_fail, &req);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if (acquire_lock_fail) {
         (*rreqp) = req;
@@ -519,19 +519,19 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
             void *src = (void *) (get_pkt->addr), *dest = (void *) (get_resp_pkt->info.data);
             mpi_errno = immed_copy(src, dest, len);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) get_resp_pkt;
             iov[0].MPL_IOV_LEN = sizeof(*get_resp_pkt);
             iovcnt = 1;
 
-            MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+            MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
             mpi_errno = MPIDI_CH3_iSendv(vc, req, iov, iovcnt);
-            MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+            MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
             /* --BEGIN ERROR HANDLING-- */
             if (mpi_errno != MPI_SUCCESS) {
                 MPID_Request_release(req);
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
             }
             /* --END ERROR HANDLING-- */
         }
@@ -542,13 +542,13 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
             iov[1].MPL_IOV_LEN = get_pkt->count * type_size;
             iovcnt = 2;
 
-            MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+            MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
             mpi_errno = MPIDI_CH3_iSendv(vc, req, iov, iovcnt);
-            MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+            MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
             /* --BEGIN ERROR HANDLING-- */
             if (mpi_errno != MPI_SUCCESS) {
                 MPID_Request_release(req);
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
             }
             /* --END ERROR HANDLING-- */
         }
@@ -557,7 +557,7 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
             iov[0].MPL_IOV_LEN = sizeof(*get_resp_pkt);
 
             req->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1(req->dev.segment_ptr == NULL, mpi_errno,
+            MPIR_ERR_CHKANDJUMP1(req->dev.segment_ptr == NULL, mpi_errno,
                                  MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
 
             MPID_Segment_init(get_pkt->addr, get_pkt->count,
@@ -565,10 +565,10 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
             req->dev.segment_first = 0;
             req->dev.segment_size = get_pkt->count * type_size;
 
-            MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+            MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
             mpi_errno = vc->sendNoncontig_fn(vc, req, iov[0].MPL_IOV_BUF, iov[0].MPL_IOV_LEN);
-            MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-            MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+            MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+            MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
         }
 
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
@@ -590,7 +590,7 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         req->dev.ext_hdr_sz = sizeof(MPIDI_CH3_Ext_pkt_get_derived_t);
         req->dev.ext_hdr_ptr = MPIU_Malloc(req->dev.ext_hdr_sz);
         if (!req->dev.ext_hdr_ptr) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
                                  "MPIDI_CH3_Ext_pkt_get_derived_t");
         }
 
@@ -598,7 +598,7 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
          * It will be freed when free datatype. */
         req->dev.dataloop = MPIU_Malloc(get_pkt->info.dataloop_size);
         if (!req->dev.dataloop) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
                                  get_pkt->info.dataloop_size);
         }
 
@@ -615,7 +615,7 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
             /* All dtype data has been received, call req handler */
             mpi_errno = MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete(vc, req, &complete);
-            MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+            MPIR_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                                  "**ch3|postrecv %s", "MPIDI_CH3_PKT_GET");
             if (complete)
                 *rreqp = NULL;
@@ -643,7 +643,7 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_Accumulate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                                     MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -671,7 +671,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     mpi_errno = check_piggyback_lock(win_ptr, vc, pkt, buflen, &acquire_lock_fail, &req);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if (acquire_lock_fail) {
         (*rreqp) = req;
@@ -690,14 +690,14 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         if (win_ptr->shm_allocated == TRUE)
             MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
         if (mpi_errno) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         /* trigger final action */
         mpi_errno = finish_op_on_target(win_ptr, vc, FALSE /* has no response data */ ,
                                         accum_pkt->flags, accum_pkt->source_win_handle);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
         *rreqp = NULL;
@@ -729,7 +729,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                                                         (accum_pkt->datatype)),
                                                        &req->dev.ext_hdr_ptr, &req->dev.ext_hdr_sz);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (MPIR_DATATYPE_IS_PREDEFINED(accum_pkt->datatype)) {
             MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_ACCUM_RECV);
@@ -775,7 +775,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                 MPIU_Assert(req->dev.recv_data_sz > 0);
 
                 mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
-                MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+                MPIR_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                                      "**ch3|postrecv %s", "MPIDI_CH3_PKT_ACCUMULATE");
 
                 /* return the number of bytes processed in this function */
@@ -784,7 +784,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                 if (complete) {
                     mpi_errno = MPIDI_CH3_ReqHandler_AccumRecvComplete(vc, req, &complete);
                     if (mpi_errno)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                     if (complete) {
                         *rreqp = NULL;
                         goto fn_exit;
@@ -801,7 +801,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
              * It will be freed when free datatype. */
             req->dev.dataloop = MPIU_Malloc(accum_pkt->info.dataloop_size);
             if (!req->dev.dataloop) {
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
+                MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
                                      accum_pkt->info.dataloop_size);
             }
 
@@ -816,7 +816,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
                 /* All extended data has been received, call req handler */
                 mpi_errno = MPIDI_CH3_ReqHandler_AccumMetadataRecvComplete(vc, req, &complete);
-                MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+                MPIR_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                                      "**ch3|postrecv %s", "MPIDI_CH3_ACCUMULATE");
                 if (complete) {
                     *rreqp = NULL;
@@ -839,7 +839,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
     }
 
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+        MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                              "**ch3|postrecv %s", "MPIDI_CH3_PKT_ACCUMULATE");
     }
 
@@ -855,7 +855,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_GetAccumulate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                                        MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -882,7 +882,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     mpi_errno = check_piggyback_lock(win_ptr, vc, pkt, buflen, &acquire_lock_fail, &req);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if (acquire_lock_fail) {
         (*rreqp) = req;
@@ -944,7 +944,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         if (mpi_errno != MPI_SUCCESS) {
             if (win_ptr->shm_allocated == TRUE)
                 MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         /* perform accumulate operation. */
@@ -957,19 +957,19 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
             MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) get_accum_resp_pkt;
         iov[0].MPL_IOV_LEN = sizeof(*get_accum_resp_pkt);
         iovcnt = 1;
 
-        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = MPIDI_CH3_iSendv(vc, resp_req, iov, iovcnt);
-        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
         /* --BEGIN ERROR HANDLING-- */
         if (mpi_errno != MPI_SUCCESS) {
             MPID_Request_release(resp_req);
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
         }
         /* --END ERROR HANDLING-- */
     }
@@ -1001,7 +1001,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                                                           &req->dev.ext_hdr_ptr,
                                                           &req->dev.ext_hdr_sz);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (MPIR_DATATYPE_IS_PREDEFINED(get_accum_pkt->datatype)) {
             MPI_Aint type_size;
@@ -1061,7 +1061,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                     MPIU_Assert(req->dev.recv_data_sz > 0);
 
                     mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
-                    MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+                    MPIR_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                                          "**ch3|postrecv %s", "MPIDI_CH3_PKT_ACCUMULATE");
 
                     /* return the number of bytes processed in this function */
@@ -1071,7 +1071,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                 if (complete) {
                     mpi_errno = MPIDI_CH3_ReqHandler_GaccumRecvComplete(vc, req, &complete);
                     if (mpi_errno)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                     if (complete) {
                         *rreqp = NULL;
                         goto fn_exit;
@@ -1088,7 +1088,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
              * It will be freed when free datatype. */
             req->dev.dataloop = MPIU_Malloc(get_accum_pkt->info.dataloop_size);
             if (!req->dev.dataloop) {
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
+                MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
                                      get_accum_pkt->info.dataloop_size);
             }
 
@@ -1103,7 +1103,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
                 /* All dtype data has been received, call req handler */
                 mpi_errno = MPIDI_CH3_ReqHandler_GaccumMetadataRecvComplete(vc, req, &complete);
-                MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+                MPIR_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                                      "**ch3|postrecv %s", "MPIDI_CH3_ACCUMULATE");
                 if (complete) {
                     *rreqp = NULL;
@@ -1125,7 +1125,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         }
 
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+            MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                                  "**ch3|postrecv %s", "MPIDI_CH3_PKT_ACCUMULATE");
         }
     }
@@ -1143,7 +1143,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_CAS
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                              MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -1169,7 +1169,7 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     mpi_errno = check_piggyback_lock(win_ptr, vc, pkt, buflen, &acquire_lock_fail, &rreq);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(rreq == NULL);  /* CAS should not have request because all data
                                  * can fit in packet header */
 
@@ -1212,11 +1212,11 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
     /* Send the response packet */
-    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, cas_resp_pkt, sizeof(*cas_resp_pkt), &req);
-    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 
-    MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+    MPIR_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
     if (req != NULL) {
         if (!MPID_Request_is_complete(req)) {
@@ -1240,7 +1240,7 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
     mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */ ,
                                     cas_pkt->flags, MPI_WIN_NULL);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_cas);
@@ -1255,7 +1255,7 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_CASResp
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_CASResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
                                  MPIDI_CH3_Pkt_t * pkt,
                                  MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
@@ -1281,16 +1281,16 @@ int MPIDI_CH3_PktHandler_CASResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
     if (cas_resp_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
         mpi_errno = handle_lock_ack_with_op(win_ptr, target_rank, cas_resp_pkt->flags);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = handle_lock_ack(win_ptr, target_rank, cas_resp_pkt->flags);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     if (cas_resp_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_ACK) {
         mpi_errno = MPIDI_CH3I_RMA_Handle_ack(win_ptr, target_rank);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     MPID_Datatype_get_size_macro(req->dev.datatype, len);
@@ -1299,7 +1299,7 @@ int MPIDI_CH3_PktHandler_CASResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 
     mpi_errno = MPID_Request_complete(req);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
@@ -1317,7 +1317,7 @@ int MPIDI_CH3_PktHandler_CASResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_FOP
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                              MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -1342,7 +1342,7 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     mpi_errno = check_piggyback_lock(win_ptr, vc, pkt, buflen, &acquire_lock_fail, &rreq);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if (acquire_lock_fail) {
         (*rreqp) = rreq;
@@ -1378,7 +1378,7 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         if (mpi_errno != MPI_SUCCESS) {
             if (win_ptr->shm_allocated == TRUE)
                 MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         /* Apply the op */
@@ -1389,13 +1389,13 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
             MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         /* send back the original data */
-        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
         mpi_errno = MPIDI_CH3_iStartMsg(vc, fop_resp_pkt, sizeof(*fop_resp_pkt), &resp_req);
-        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-        MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+        MPIR_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
         if (resp_req != NULL) {
             if (!MPID_Request_is_complete(resp_req)) {
@@ -1420,7 +1420,7 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */ ,
                                         fop_pkt->flags, MPI_WIN_NULL);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     else {
         MPIU_Assert(pkt->type == MPIDI_CH3_PKT_FOP);
@@ -1466,14 +1466,14 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
             req->dev.user_buf = MPIU_Malloc(extent);
             if (!req->dev.user_buf) {
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d", extent);
+                MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d", extent);
             }
 
             req->dev.recv_data_sz = type_size;
             MPIU_Assert(req->dev.recv_data_sz > 0);
 
             mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
-            MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+            MPIR_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                                  "**ch3|postrecv %s", "MPIDI_CH3_PKT_ACCUMULATE");
 
             /* return the number of bytes processed in this function */
@@ -1483,7 +1483,7 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         if (complete) {
             mpi_errno = MPIDI_CH3_ReqHandler_FOPRecvComplete(vc, req, &complete);
             if (mpi_errno)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             if (complete) {
                 *rreqp = NULL;
                 goto fn_exit;
@@ -1505,7 +1505,7 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_FOPResp
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_FOPResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
                                  MPIDI_CH3_Pkt_t * pkt,
                                  MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
@@ -1534,16 +1534,16 @@ int MPIDI_CH3_PktHandler_FOPResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
     if (fop_resp_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
         mpi_errno = handle_lock_ack_with_op(win_ptr, target_rank, fop_resp_pkt->flags);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = handle_lock_ack(win_ptr, target_rank, fop_resp_pkt->flags);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     if (fop_resp_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_ACK) {
         mpi_errno = MPIDI_CH3I_RMA_Handle_ack(win_ptr, target_rank);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
@@ -1566,7 +1566,7 @@ int MPIDI_CH3_PktHandler_FOPResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
         MPIU_Assert(fop_resp_pkt->type == MPIDI_CH3_PKT_FOP_RESP);
 
         mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
-        MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+        MPIR_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                              "**ch3|postrecv %s", "MPIDI_CH3_PKT_FOP_RESP");
 
         /* return the number of bytes processed in this function */
@@ -1576,7 +1576,7 @@ int MPIDI_CH3_PktHandler_FOPResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
     if (complete) {
         mpi_errno = MPID_Request_complete(req);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
         *rreqp = NULL;
     }
@@ -1595,7 +1595,7 @@ int MPIDI_CH3_PktHandler_FOPResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_Get_AccumResp
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_Get_AccumResp(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                                        MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -1623,15 +1623,15 @@ int MPIDI_CH3_PktHandler_Get_AccumResp(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
     if (get_accum_resp_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
         mpi_errno = handle_lock_ack_with_op(win_ptr, target_rank, get_accum_resp_pkt->flags);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         mpi_errno = handle_lock_ack(win_ptr, target_rank, get_accum_resp_pkt->flags);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     if (get_accum_resp_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_ACK) {
         mpi_errno = MPIDI_CH3I_RMA_Handle_ack(win_ptr, target_rank);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
@@ -1688,7 +1688,7 @@ int MPIDI_CH3_PktHandler_Get_AccumResp(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         if (MPIR_DATATYPE_IS_PREDEFINED(req->dev.datatype)) {
             req->dev.user_buf = (void *) ((char *) req->dev.user_buf + real_stream_offset);
             mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
-            MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+            MPIR_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                                  "**ch3|postrecv %s", "MPIDI_CH3_PKT_GET_ACCUM_RESP");
 
             /* return the number of bytes processed in this function */
@@ -1705,7 +1705,7 @@ int MPIDI_CH3_PktHandler_Get_AccumResp(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
             mpi_errno = MPIDI_CH3U_Request_load_recv_iov(req);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadrecviov");
             }
             if (req->dev.OnDataAvail == NULL) {
                 req->dev.OnDataAvail = req->dev.OnFinal;
@@ -1715,7 +1715,7 @@ int MPIDI_CH3_PktHandler_Get_AccumResp(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
     if (complete) {
         mpi_errno = MPID_Request_complete(req);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         *rreqp = NULL;
@@ -1733,7 +1733,7 @@ int MPIDI_CH3_PktHandler_Get_AccumResp(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_Lock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_Lock(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                               MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -1766,14 +1766,14 @@ int MPIDI_CH3_PktHandler_Lock(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                                                  lock_pkt->source_win_handle,
                                                  lock_pkt->request_handle);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     else {
         MPID_Request *req = NULL;
         mpi_errno = enqueue_lock_origin(win_ptr, vc, pkt, buflen, &req);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         MPIU_Assert(req == NULL);
     }
 
@@ -1788,7 +1788,7 @@ int MPIDI_CH3_PktHandler_Lock(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_GetResp
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_GetResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
                                  MPIDI_CH3_Pkt_t * pkt,
                                  MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
@@ -1817,16 +1817,16 @@ int MPIDI_CH3_PktHandler_GetResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
     if (get_resp_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
         mpi_errno = handle_lock_ack_with_op(win_ptr, target_rank, get_resp_pkt->flags);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         mpi_errno = handle_lock_ack(win_ptr, target_rank, get_resp_pkt->flags);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     if (get_resp_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_ACK) {
         mpi_errno = MPIDI_CH3I_RMA_Handle_ack(win_ptr, target_rank);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
@@ -1848,7 +1848,7 @@ int MPIDI_CH3_PktHandler_GetResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
         MPIU_Assert(get_resp_pkt->type == MPIDI_CH3_PKT_GET_RESP);
 
         mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
-        MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+        MPIR_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                              "**ch3|postrecv %s", "MPIDI_CH3_PKT_GET_RESP");
 
         /* return the number of bytes processed in this function */
@@ -1858,7 +1858,7 @@ int MPIDI_CH3_PktHandler_GetResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
     if (complete) {
         mpi_errno = MPID_Request_complete(req);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         *rreqp = NULL;
@@ -1875,7 +1875,7 @@ int MPIDI_CH3_PktHandler_GetResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_LockAck
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_LockAck(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                                  MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -1907,7 +1907,7 @@ int MPIDI_CH3_PktHandler_LockAck(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     mpi_errno = handle_lock_ack(win_ptr, target_rank, lock_ack_pkt->flags);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     *rreqp = NULL;
     MPIDI_CH3_Progress_signal_completion();
@@ -1923,7 +1923,7 @@ int MPIDI_CH3_PktHandler_LockAck(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_LockOpAck
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_LockOpAck(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                                    MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -1952,17 +1952,17 @@ int MPIDI_CH3_PktHandler_LockOpAck(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     mpi_errno = handle_lock_ack_with_op(win_ptr, target_rank, lock_op_ack_pkt->flags);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = handle_lock_ack(win_ptr, target_rank, lock_op_ack_pkt->flags);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if (flags & MPIDI_CH3_PKT_FLAG_RMA_ACK) {
         MPIU_Assert(flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED);
         mpi_errno = MPIDI_CH3I_RMA_Handle_ack(win_ptr, target_rank);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     *rreqp = NULL;
@@ -1978,7 +1978,7 @@ int MPIDI_CH3_PktHandler_LockOpAck(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_Ack
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_Ack(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                              MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -2001,7 +2001,7 @@ int MPIDI_CH3_PktHandler_Ack(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
     /* decrement ack_counter on target */
     mpi_errno = MPIDI_CH3I_RMA_Handle_ack(win_ptr, target_rank);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     *rreqp = NULL;
     MPIDI_CH3_Progress_signal_completion();
@@ -2018,7 +2018,7 @@ int MPIDI_CH3_PktHandler_Ack(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_DecrAtCnt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_DecrAtCnt(MPIDI_VC_t * vc ATTRIBUTE((unused)),
                                    MPIDI_CH3_Pkt_t * pkt,
                                    MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
@@ -2043,7 +2043,7 @@ int MPIDI_CH3_PktHandler_DecrAtCnt(MPIDI_VC_t * vc ATTRIBUTE((unused)),
     if (decr_at_cnt_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) {
         mpi_errno = MPIDI_CH3I_Send_ack_pkt(vc, win_ptr, decr_at_cnt_pkt->source_win_handle);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     MPIDI_CH3_Progress_signal_completion();
@@ -2060,7 +2060,7 @@ int MPIDI_CH3_PktHandler_DecrAtCnt(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_Unlock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_Unlock(MPIDI_VC_t * vc ATTRIBUTE((unused)),
                                 MPIDI_CH3_Pkt_t * pkt,
                                 MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
@@ -2080,12 +2080,12 @@ int MPIDI_CH3_PktHandler_Unlock(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 
     MPID_Win_get_ptr(unlock_pkt->target_win_handle, win_ptr);
     mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
-    MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
+    MPIR_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
 
     if (!(unlock_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK_NO_ACK)) {
         mpi_errno = MPIDI_CH3I_Send_ack_pkt(vc, win_ptr, unlock_pkt->source_win_handle);
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     MPIDI_CH3_Progress_signal_completion();
@@ -2104,7 +2104,7 @@ int MPIDI_CH3_PktHandler_Unlock(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_Flush
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_Flush(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                                MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
@@ -2125,7 +2125,7 @@ int MPIDI_CH3_PktHandler_Flush(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     mpi_errno = MPIDI_CH3I_Send_ack_pkt(vc, win_ptr, flush_pkt->source_win_handle);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_flush);
diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c
index 4361ccd..e5b20ed 100644
--- a/src/mpid/ch3/src/ch3u_rma_progress.c
+++ b/src/mpid/ch3/src/ch3u_rma_progress.c
@@ -64,7 +64,7 @@ static inline int issue_ops_win(MPID_Win * win_ptr, int *made_progress);
 #undef FUNCNAME
 #define FUNCNAME check_and_switch_target_state
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Target_t * target,
                                                 int *is_able_to_issue, int *made_progress)
 {
@@ -110,12 +110,12 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
                 if (target->target_rank == rank) {
                     mpi_errno = acquire_local_lock(win_ptr, target->lock_type);
                     if (mpi_errno != MPI_SUCCESS)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                 }
                 else {
                     mpi_errno = send_lock_msg(target->target_rank, target->lock_type, win_ptr);
                     if (mpi_errno != MPI_SUCCESS)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                 }
 
                 (*made_progress) = 1;
@@ -158,7 +158,7 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
 
                 mpi_errno = send_decr_at_cnt_msg(target->target_rank, win_ptr, flags);
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
 
                 /* We are done with ending synchronization, unset target's sync_flag. */
                 target->sync.sync_flag = MPIDI_RMA_SYNC_NONE;
@@ -176,7 +176,7 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
 
                         mpi_errno = send_flush_msg(target->target_rank, win_ptr);
                         if (mpi_errno != MPI_SUCCESS)
-                            MPIU_ERR_POP(mpi_errno);
+                            MPIR_ERR_POP(mpi_errno);
                     }
                 }
 
@@ -191,7 +191,7 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
                 if (target->target_rank == rank) {
                     mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
                     if (mpi_errno != MPI_SUCCESS)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                 }
                 else {
                     MPIDI_CH3_Pkt_flags_t flag = MPIDI_CH3_PKT_FLAG_NONE;
@@ -204,7 +204,7 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
                     }
                     mpi_errno = send_unlock_msg(target->target_rank, win_ptr, flag);
                     if (mpi_errno != MPI_SUCCESS)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                 }
 
                 /* We are done with ending synchronization, unset target's sync_flag. */
@@ -235,7 +235,7 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
 #undef FUNCNAME
 #define FUNCNAME issue_ops_target
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * target,
                                    int *made_progress)
 {
@@ -321,7 +321,7 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
 
         mpi_errno = issue_rma_op(curr_op, win_ptr, target, flags);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         (*made_progress) = 1;
 
@@ -348,14 +348,14 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
 
         mpi_errno = check_and_set_req_completion(win_ptr, target, curr_op, &op_completed);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         if (op_completed == FALSE) {
             if (MPIDI_CH3I_RMA_Active_req_cnt > MPIR_CVAR_CH3_RMA_POKE_PROGRESS_REQ_THRESHOLD) {
                 mpi_errno = poke_progress_engine();
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
         }
 
@@ -376,7 +376,7 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
 #undef FUNCNAME
 #define FUNCNAME issue_ops_win
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int issue_ops_win(MPID_Win * win_ptr, int *made_progress)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -402,7 +402,7 @@ static inline int issue_ops_win(MPID_Win * win_ptr, int *made_progress)
             mpi_errno = check_and_switch_target_state(win_ptr, target, &is_able_to_issue,
                                                       &temp_progress);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             if (temp_progress)
                 (*made_progress) = 1;
             if (!is_able_to_issue) {
@@ -412,7 +412,7 @@ static inline int issue_ops_win(MPID_Win * win_ptr, int *made_progress)
             /* issue operations to this target */
             mpi_errno = issue_ops_target(win_ptr, target, &temp_progress);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             if (temp_progress)
                 (*made_progress) = 1;
         }
@@ -428,7 +428,7 @@ static inline int issue_ops_win(MPID_Win * win_ptr, int *made_progress)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_RMA_Cleanup_ops_aggressive
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_RMA_Cleanup_ops_aggressive(MPID_Win * win_ptr)
 {
     int i, local_completed = 0, remote_completed ATTRIBUTE((unused)) = 0;
@@ -458,7 +458,7 @@ int MPIDI_CH3I_RMA_Cleanup_ops_aggressive(MPID_Win * win_ptr)
     mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, curr_target->target_rank,
                                                     &made_progress);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Wait for local completion. */
     do {
@@ -467,7 +467,7 @@ int MPIDI_CH3I_RMA_Cleanup_ops_aggressive(MPID_Win * win_ptr)
         if (!local_completed) {
             mpi_errno = wait_progress_engine();
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     } while (!local_completed);
 
@@ -481,7 +481,7 @@ int MPIDI_CH3I_RMA_Cleanup_ops_aggressive(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_RMA_Cleanup_target_aggressive
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_RMA_Cleanup_target_aggressive(MPID_Win * win_ptr, MPIDI_RMA_Target_t ** target)
 {
     int i, local_completed ATTRIBUTE((unused)) = 0, remote_completed = 0;
@@ -502,12 +502,12 @@ int MPIDI_CH3I_RMA_Cleanup_target_aggressive(MPID_Win * win_ptr, MPIDI_RMA_Targe
             if (orig_vc->node_id != target_vc->node_id) {
                 mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, i, &curr_target);
                 if (mpi_errno)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 if (curr_target == NULL) {
                     win_ptr->outstanding_locks++;
                     mpi_errno = send_lock_msg(i, MPI_LOCK_SHARED, win_ptr);
                     if (mpi_errno != MPI_SUCCESS)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -530,7 +530,7 @@ int MPIDI_CH3I_RMA_Cleanup_target_aggressive(MPID_Win * win_ptr, MPIDI_RMA_Targe
         mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, curr_target->target_rank,
                                                         &made_progress);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         /* Wait for remote completion. */
         do {
@@ -539,14 +539,14 @@ int MPIDI_CH3I_RMA_Cleanup_target_aggressive(MPID_Win * win_ptr, MPIDI_RMA_Targe
             if (!remote_completed) {
                 mpi_errno = wait_progress_engine();
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
         } while (!remote_completed);
 
         /* Cleanup the target. */
         mpi_errno = MPIDI_CH3I_Win_target_dequeue_and_free(win_ptr, curr_target);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         /* check if we got a target */
         (*target) = MPIDI_CH3I_Win_target_alloc(win_ptr);
@@ -563,7 +563,7 @@ int MPIDI_CH3I_RMA_Cleanup_target_aggressive(MPID_Win * win_ptr, MPIDI_RMA_Targe
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_RMA_Make_progress_target
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_RMA_Make_progress_target(MPID_Win * win_ptr, int target_rank, int *made_progress)
 {
     int temp_progress = 0;
@@ -584,32 +584,32 @@ int MPIDI_CH3I_RMA_Make_progress_target(MPID_Win * win_ptr, int target_rank, int
     if (!WIN_READY(win_ptr)) {
         mpi_errno = poke_progress_engine();
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
     /* find target element */
     mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, target_rank, &target);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* check and try to switch target state */
     mpi_errno = check_and_switch_target_state(win_ptr, target, &is_able_to_issue, &temp_progress);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     if (temp_progress)
         (*made_progress) = 1;
     if (!is_able_to_issue) {
         mpi_errno = poke_progress_engine();
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
     /* issue operations to this target */
     mpi_errno = issue_ops_target(win_ptr, target, &temp_progress);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     if (temp_progress)
         (*made_progress) = 1;
 
@@ -623,7 +623,7 @@ int MPIDI_CH3I_RMA_Make_progress_target(MPID_Win * win_ptr, int target_rank, int
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_RMA_Make_progress_win
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_RMA_Make_progress_win(MPID_Win * win_ptr, int *made_progress)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -643,13 +643,13 @@ int MPIDI_CH3I_RMA_Make_progress_win(MPID_Win * win_ptr, int *made_progress)
     if (!WIN_READY(win_ptr)) {
         mpi_errno = poke_progress_engine();
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
     mpi_errno = issue_ops_win(win_ptr, &temp_progress);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     if (temp_progress)
         (*made_progress) = 1;
 
@@ -663,7 +663,7 @@ int MPIDI_CH3I_RMA_Make_progress_win(MPID_Win * win_ptr, int *made_progress)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_RMA_Make_progress_global
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_RMA_Make_progress_global(int *made_progress)
 {
     MPID_Win *win_ptr;
@@ -686,7 +686,7 @@ int MPIDI_CH3I_RMA_Make_progress_global(int *made_progress)
 
         mpi_errno = issue_ops_win(win_ptr, &temp_progress);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         if (temp_progress)
             (*made_progress) = 1;
     }
diff --git a/src/mpid/ch3/src/ch3u_rma_reqops.c b/src/mpid/ch3/src/ch3u_rma_reqops.c
index 606533f..08b57ff 100644
--- a/src/mpid/ch3/src/ch3u_rma_reqops.c
+++ b/src/mpid/ch3/src/ch3u_rma_reqops.c
@@ -11,7 +11,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Rput
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Rput(const void *origin_addr, int origin_count,
               MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
               int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
@@ -28,7 +28,7 @@ int MPID_Rput(const void *origin_addr, int origin_count,
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_RPUT);
 
     /* request-based RMA operations are only valid within a passive epoch */
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_GRANTED,
@@ -38,7 +38,7 @@ int MPID_Rput(const void *origin_addr, int origin_count,
 
     /* Create user request, initially cc=1, ref=1 */
     ureq = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP(ureq == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+    MPIR_ERR_CHKANDJUMP(ureq == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     ureq->kind = MPID_WIN_REQUEST;
 
     /* This request is referenced by user and ch3 by default. */
@@ -51,13 +51,13 @@ int MPID_Rput(const void *origin_addr, int origin_count,
                                    target_disp, target_count, target_datatype, win_ptr, ureq);
 
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
     else {
         mpi_errno = MPID_Request_complete(ureq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -74,7 +74,7 @@ int MPID_Rput(const void *origin_addr, int origin_count,
 #undef FUNCNAME
 #define FUNCNAME MPID_Rget
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Rget(void *origin_addr, int origin_count,
               MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
               int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
@@ -91,7 +91,7 @@ int MPID_Rget(void *origin_addr, int origin_count,
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_RGET);
 
     /* request-based RMA operations are only valid within a passive epoch */
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_GRANTED,
@@ -101,7 +101,7 @@ int MPID_Rget(void *origin_addr, int origin_count,
 
     /* Create user request, initially cc=1, ref=1 */
     ureq = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP(ureq == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+    MPIR_ERR_CHKANDJUMP(ureq == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     ureq->kind = MPID_WIN_REQUEST;
 
     /* This request is referenced by user and ch3 by default. */
@@ -114,13 +114,13 @@ int MPID_Rget(void *origin_addr, int origin_count,
                                    target_disp, target_count, target_datatype, win_ptr, ureq);
 
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
     else {
         mpi_errno = MPID_Request_complete(ureq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -137,7 +137,7 @@ int MPID_Rget(void *origin_addr, int origin_count,
 #undef FUNCNAME
 #define FUNCNAME MPID_Raccumulate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Raccumulate(const void *origin_addr, int origin_count,
                      MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
                      int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win * win_ptr,
@@ -154,7 +154,7 @@ int MPID_Raccumulate(const void *origin_addr, int origin_count,
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_RACCUMULATE);
 
     /* request-based RMA operations are only valid within a passive epoch */
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_GRANTED,
@@ -162,7 +162,7 @@ int MPID_Raccumulate(const void *origin_addr, int origin_count,
 
     /* Create user request, initially cc=1, ref=1 */
     ureq = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP(ureq == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+    MPIR_ERR_CHKANDJUMP(ureq == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     ureq->kind = MPID_WIN_REQUEST;
 
     /* This request is referenced by user and ch3 by default. */
@@ -177,13 +177,13 @@ int MPID_Raccumulate(const void *origin_addr, int origin_count,
                                           target_disp, target_count,
                                           target_datatype, op, win_ptr, ureq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
     else {
         mpi_errno = MPID_Request_complete(ureq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -200,7 +200,7 @@ int MPID_Raccumulate(const void *origin_addr, int origin_count,
 #undef FUNCNAME
 #define FUNCNAME MPID_Rget_accumulate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Rget_accumulate(const void *origin_addr, int origin_count,
                          MPI_Datatype origin_datatype, void *result_addr, int result_count,
                          MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
@@ -218,7 +218,7 @@ int MPID_Rget_accumulate(const void *origin_addr, int origin_count,
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_RGET_ACCUMULATE);
 
     /* request-based RMA operations are only valid within a passive epoch */
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_GRANTED,
@@ -226,7 +226,7 @@ int MPID_Rget_accumulate(const void *origin_addr, int origin_count,
 
     /* Create user request, initially cc=1, ref=1 */
     ureq = MPID_Request_create();
-    MPIU_ERR_CHKANDJUMP(ureq == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+    MPIR_ERR_CHKANDJUMP(ureq == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     ureq->kind = MPID_WIN_REQUEST;
 
     /* This request is referenced by user and ch3 by default. */
@@ -244,13 +244,13 @@ int MPID_Rget_accumulate(const void *origin_addr, int origin_count,
                                               target_rank, target_disp,
                                               target_count, target_datatype, op, win_ptr, ureq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
     else {
         mpi_errno = MPID_Request_complete(ureq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c
index 4c28fee..24a8bce 100644
--- a/src/mpid/ch3/src/ch3u_rma_sync.c
+++ b/src/mpid/ch3/src/ch3u_rma_sync.c
@@ -328,7 +328,7 @@ void MPIDI_CH3_RMA_Init_sync_pvars(void)
 #undef FUNCNAME
 #define FUNCNAME flush_local_all
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int flush_local_all(MPID_Win * win_ptr)
 {
     int i, made_progress = 0;
@@ -354,7 +354,7 @@ static inline int flush_local_all(MPID_Win * win_ptr)
     /* issue out all operations. */
     mpi_errno = MPIDI_CH3I_RMA_Make_progress_win(win_ptr, &made_progress);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* wait for remote completion for those targets that disable flush_local,
      * and wait for local completion for other targets */
@@ -364,7 +364,7 @@ static inline int flush_local_all(MPID_Win * win_ptr)
         if (!local_completed) {
             mpi_errno = wait_progress_engine();
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     } while (!local_completed);
 
@@ -380,7 +380,7 @@ static inline int flush_local_all(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME flush_all
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int flush_all(MPID_Win * win_ptr)
 {
     int i, made_progress = 0;
@@ -406,7 +406,7 @@ static inline int flush_all(MPID_Win * win_ptr)
     /* Issue out all operations. */
     mpi_errno = MPIDI_CH3I_RMA_Make_progress_win(win_ptr, &made_progress);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Wait for remote completion. */
     do {
@@ -414,7 +414,7 @@ static inline int flush_all(MPID_Win * win_ptr)
         if (!remote_completed) {
             mpi_errno = wait_progress_engine();
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     } while (!remote_completed);
 
@@ -431,7 +431,7 @@ static inline int flush_all(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME fence_barrier_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int fence_barrier_complete(MPID_Request * sreq)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -454,7 +454,7 @@ static int fence_barrier_complete(MPID_Request * sreq)
             if (win_ptr->num_targets_with_pending_net_ops) {
                 mpi_errno = MPIDI_CH3I_Win_set_active(win_ptr);
                 if (mpi_errno != MPI_SUCCESS) {
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -477,7 +477,7 @@ static int fence_barrier_complete(MPID_Request * sreq)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_fence
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_fence(int assert, MPID_Win * win_ptr)
 {
     int i;
@@ -492,7 +492,7 @@ int MPID_Win_fence(int assert, MPID_Win * win_ptr)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_FENCE);
 
-    MPIU_ERR_CHKANDJUMP((win_ptr->states.access_state != MPIDI_RMA_NONE &&
+    MPIR_ERR_CHKANDJUMP((win_ptr->states.access_state != MPIDI_RMA_NONE &&
                          win_ptr->states.access_state != MPIDI_RMA_FENCE_ISSUED &&
                          win_ptr->states.access_state != MPIDI_RMA_FENCE_GRANTED) ||
                         win_ptr->states.exposure_state != MPIDI_RMA_NONE,
@@ -520,13 +520,13 @@ int MPID_Win_fence(int assert, MPID_Win * win_ptr)
 
                 mpi_errno = MPIR_Barrier_impl(node_comm_ptr, &errflag);
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
-                MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+                    MPIR_ERR_POP(mpi_errno);
+                MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
             }
 
             mpi_errno = MPIR_Ibarrier_impl(win_ptr->comm_ptr, &fence_sync_req);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             if (fence_sync_req == MPI_REQUEST_NULL) {
                 /* ibarrier completed immediately. */
@@ -576,9 +576,9 @@ int MPID_Win_fence(int assert, MPID_Win * win_ptr)
         mpi_errno = MPIR_Reduce_scatter_block_impl(MPI_IN_PLACE, rma_target_marks, 1,
                                                    MPI_INT, MPI_SUM, win_ptr->comm_ptr, &errflag);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
         win_ptr->at_completion_counter -= comm_size;
         win_ptr->at_completion_counter += rma_target_marks[0];
@@ -600,24 +600,24 @@ int MPID_Win_fence(int assert, MPID_Win * win_ptr)
 
         mpi_errno = flush_local_all(win_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     else {
         mpi_errno = flush_all(win_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     /* Cleanup all targets on window. */
     mpi_errno = MPIDI_CH3I_RMA_Cleanup_targets_win(win_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if (scalable_fence_enabled) {
         mpi_errno = MPIR_Barrier_impl(win_ptr->comm_ptr, &errflag);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+            MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
         /* Set window access state properly. */
         if (assert & MPI_MODE_NOSUCCEED) {
@@ -632,7 +632,7 @@ int MPID_Win_fence(int assert, MPID_Win * win_ptr)
         while (win_ptr->at_completion_counter) {
             mpi_errno = wait_progress_engine();
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
 
         if (assert & MPI_MODE_NOSUCCEED) {
@@ -644,7 +644,7 @@ int MPID_Win_fence(int assert, MPID_Win * win_ptr)
             /* Prepare for the next possible epoch */
             mpi_errno = MPIR_Ibarrier_impl(win_ptr->comm_ptr, &fence_sync_req);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             if (fence_sync_req == MPI_REQUEST_NULL) {
                 /* ibarrier completed immediately. */
@@ -673,8 +673,8 @@ int MPID_Win_fence(int assert, MPID_Win * win_ptr)
                 MPID_Comm *node_comm_ptr = win_ptr->comm_ptr->node_comm;
                 mpi_errno = MPIR_Barrier_impl(node_comm_ptr, &errflag);
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
-                MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+                    MPIR_ERR_POP(mpi_errno);
+                MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
             }
         }
     }
@@ -699,7 +699,7 @@ int MPID_Win_fence(int assert, MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_post
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_post(MPID_Group * post_grp_ptr, int assert, MPID_Win * win_ptr)
 {
     int *post_ranks_in_win_grp;
@@ -713,7 +713,7 @@ int MPID_Win_post(MPID_Group * post_grp_ptr, int assert, MPID_Win * win_ptr)
      * with an exposure epoch of FENCE (which is not allowed), since FENCE may be
      * ended up with not unsetting the window state. We can only detect if this
      * exposure epoch is overlapped with another exposure epoch of PSCW. */
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.exposure_state != MPIDI_RMA_NONE,
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.exposure_state != MPIDI_RMA_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     /* Ensure ordering of load/store operations. */
@@ -743,7 +743,7 @@ int MPID_Win_post(MPID_Group * post_grp_ptr, int assert, MPID_Win * win_ptr)
                             post_grp_size * sizeof(int), mpi_errno, "post_ranks_in_win_grp");
         mpi_errno = fill_ranks_in_win_grp(win_ptr, post_grp_ptr, post_ranks_in_win_grp);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         MPIU_CHKLMEM_MALLOC(req, MPI_Request *, post_grp_size * sizeof(MPI_Request),
                             mpi_errno, "req");
@@ -759,7 +759,7 @@ int MPID_Win_post(MPID_Group * post_grp_ptr, int assert, MPID_Win * win_ptr)
                 mpi_errno = MPID_Isend(&i, 0, MPI_INT, dst, SYNC_POST_TAG, win_comm_ptr,
                                        MPID_CONTEXT_INTRA_PT2PT, &req_ptr);
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 req[i] = req_ptr->handle;
             }
             else {
@@ -769,14 +769,14 @@ int MPID_Win_post(MPID_Group * post_grp_ptr, int assert, MPID_Win * win_ptr)
 
         mpi_errno = MPIR_Waitall_impl(post_grp_size, req, status);
         if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         /* --BEGIN ERROR HANDLING-- */
         if (mpi_errno == MPI_ERR_IN_STATUS) {
             for (i = 0; i < post_grp_size; i++) {
                 if (status[i].MPI_ERROR != MPI_SUCCESS) {
                     mpi_errno = status[i].MPI_ERROR;
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -796,7 +796,7 @@ int MPID_Win_post(MPID_Group * post_grp_ptr, int assert, MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME start_req_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int start_req_complete(MPID_Request * req)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -829,7 +829,7 @@ static int start_req_complete(MPID_Request * req)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_start
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_start(MPID_Group * group_ptr, int assert, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -844,7 +844,7 @@ int MPID_Win_start(MPID_Group * group_ptr, int assert, MPID_Win * win_ptr)
      * ended up with not unsetting the window state. We can only detect if this
      * access epoch is overlapped with another access epoch of PSCW or Passive
      * Target. */
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_NONE &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_NONE &&
                         win_ptr->states.access_state != MPIDI_RMA_FENCE_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_FENCE_GRANTED,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
@@ -857,7 +857,7 @@ int MPID_Win_start(MPID_Group * group_ptr, int assert, MPID_Win * win_ptr)
 
     mpi_errno = fill_ranks_in_win_grp(win_ptr, group_ptr, win_ptr->start_ranks_in_win_grp);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if ((assert & MPI_MODE_NOCHECK) == 0) {
         int i, intra_cnt;
@@ -891,7 +891,7 @@ int MPID_Win_start(MPID_Group * group_ptr, int assert, MPID_Win * win_ptr)
                 mpi_errno = MPID_Irecv(NULL, 0, MPI_INT, src, SYNC_POST_TAG,
                                        comm_ptr, MPID_CONTEXT_INTRA_PT2PT, &req_ptr);
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
 
                 if (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id) {
                     intra_start_req[intra_cnt++] = req_ptr->handle;
@@ -912,13 +912,13 @@ int MPID_Win_start(MPID_Group * group_ptr, int assert, MPID_Win * win_ptr)
         if (intra_cnt) {
             mpi_errno = MPIR_Waitall_impl(intra_cnt, intra_start_req, intra_start_status);
             if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             /* --BEGIN ERROR HANDLING-- */
             if (mpi_errno == MPI_ERR_IN_STATUS) {
                 for (i = 0; i < intra_cnt; i++) {
                     if (intra_start_status[i].MPI_ERROR != MPI_SUCCESS) {
                         mpi_errno = intra_start_status[i].MPI_ERROR;
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                     }
                 }
             }
@@ -952,7 +952,7 @@ int MPID_Win_start(MPID_Group * group_ptr, int assert, MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_complete(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -963,7 +963,7 @@ int MPID_Win_complete(MPID_Win * win_ptr)
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_COMPLETE);
 
     /* Access epochs on the same window must be disjoint. */
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PSCW_ISSUED &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PSCW_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_PSCW_GRANTED,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
@@ -976,7 +976,7 @@ int MPID_Win_complete(MPID_Win * win_ptr)
         while (win_ptr->states.access_state != MPIDI_RMA_PSCW_GRANTED) {
             mpi_errno = wait_progress_engine();
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -999,18 +999,18 @@ int MPID_Win_complete(MPID_Win * win_ptr)
             /* FIXME: do we need to wait for remote completion? */
             mpi_errno = send_decr_at_cnt_msg(dst, win_ptr, MPIDI_CH3_PKT_FLAG_NONE);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     }
 
     mpi_errno = flush_local_all(win_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Cleanup all targets on this window. */
     mpi_errno = MPIDI_CH3I_RMA_Cleanup_targets_win(win_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Set window access state properly. */
     win_ptr->states.access_state = MPIDI_RMA_NONE;
@@ -1033,7 +1033,7 @@ int MPID_Win_complete(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_wait
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_wait(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1041,14 +1041,14 @@ int MPID_Win_wait(MPID_Win * win_ptr)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_WAIT);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.exposure_state != MPIDI_RMA_PSCW_EXPO,
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.exposure_state != MPIDI_RMA_PSCW_EXPO,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     /* wait for all operations from other processes to finish */
     while (win_ptr->at_completion_counter) {
         mpi_errno = wait_progress_engine();
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     /* Set window exposure state properly. */
@@ -1072,7 +1072,7 @@ int MPID_Win_wait(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_test
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_test(MPID_Win * win_ptr, int *flag)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1080,12 +1080,12 @@ int MPID_Win_test(MPID_Win * win_ptr, int *flag)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_TEST);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.exposure_state != MPIDI_RMA_PSCW_EXPO,
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.exposure_state != MPIDI_RMA_PSCW_EXPO,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     mpi_errno = MPID_Progress_test();
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     *flag = (win_ptr->at_completion_counter) ? 0 : 1;
@@ -1118,7 +1118,7 @@ int MPID_Win_test(MPID_Win * win_ptr, int *flag)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_lock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_lock(int lock_type, int dest, int assert, MPID_Win * win_ptr)
 {
     int made_progress = 0;
@@ -1137,13 +1137,13 @@ int MPID_Win_lock(int lock_type, int dest, int assert, MPID_Win * win_ptr)
      * access epoch is overlapped with another access epoch of PSCW or Passive
      * Target. */
     if (win_ptr->lock_epoch_count == 0) {
-        MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_NONE &&
+        MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_NONE &&
                             win_ptr->states.access_state != MPIDI_RMA_FENCE_ISSUED &&
                             win_ptr->states.access_state != MPIDI_RMA_FENCE_GRANTED,
                             mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
     }
     else {
-        MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET,
+        MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET,
                             mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
     }
 
@@ -1151,8 +1151,8 @@ int MPID_Win_lock(int lock_type, int dest, int assert, MPID_Win * win_ptr)
         /* check if we lock the same target window more than once. */
         mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, dest, &target);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP(target != NULL, mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
+            MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKANDJUMP(target != NULL, mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
     }
 
     /* Error handling is finished. */
@@ -1176,7 +1176,7 @@ int MPID_Win_lock(int lock_type, int dest, int assert, MPID_Win * win_ptr)
     /* Create a new target. */
     mpi_errno = MPIDI_CH3I_Win_create_target(win_ptr, dest, &target);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Store lock_state (CALLED/ISSUED/GRANTED), lock_type (SHARED/EXCLUSIVE),
      * lock_mode (MODE_NOCHECK). */
@@ -1193,12 +1193,12 @@ int MPID_Win_lock(int lock_type, int dest, int assert, MPID_Win * win_ptr)
         if (dest == rank || shm_target) {
             mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, dest, &made_progress);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 
             while (target->access_state != MPIDI_RMA_LOCK_GRANTED) {
                 mpi_errno = wait_progress_engine();
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
         }
         else if (!MPIR_CVAR_CH3_RMA_DELAY_ISSUING_FOR_PIGGYBACKING) {
@@ -1206,7 +1206,7 @@ int MPID_Win_lock(int lock_type, int dest, int assert, MPID_Win * win_ptr)
              * since we do not want to piggyback LOCK with future OP */
             mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, dest, &made_progress);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -1228,7 +1228,7 @@ int MPID_Win_lock(int lock_type, int dest, int assert, MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_unlock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_unlock(int dest, MPID_Win * win_ptr)
 {
     int made_progress = 0;
@@ -1240,7 +1240,7 @@ int MPID_Win_unlock(int dest, MPID_Win * win_ptr)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_UNLOCK);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET,
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     /* Ensure ordering of load/store operations. */
@@ -1254,11 +1254,11 @@ int MPID_Win_unlock(int dest, MPID_Win * win_ptr)
     /* Find or recreate target. */
     mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, dest, &target);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     if (target == NULL) {
         mpi_errno = MPIDI_CH3I_Win_create_target(win_ptr, dest, &target);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         target->access_state = MPIDI_RMA_LOCK_GRANTED;
     }
 
@@ -1274,7 +1274,7 @@ int MPID_Win_unlock(int dest, MPID_Win * win_ptr)
     /* Issue out all operations. */
     mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, dest, &made_progress);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Wait for remote completion. */
     do {
@@ -1283,7 +1283,7 @@ int MPID_Win_unlock(int dest, MPID_Win * win_ptr)
         if (!remote_completed) {
             mpi_errno = wait_progress_engine();
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     } while (!remote_completed);
 
@@ -1298,7 +1298,7 @@ int MPID_Win_unlock(int dest, MPID_Win * win_ptr)
          * the progress engine once to avoid such issue.  */
         mpi_errno = poke_progress_engine();
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     win_ptr->lock_epoch_count--;
@@ -1311,7 +1311,7 @@ int MPID_Win_unlock(int dest, MPID_Win * win_ptr)
         /* Cleanup the target. */
         mpi_errno = MPIDI_CH3I_Win_target_dequeue_and_free(win_ptr, target);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -1327,7 +1327,7 @@ int MPID_Win_unlock(int dest, MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_flush
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_flush(int dest, MPID_Win * win_ptr)
 {
     int made_progress = 0;
@@ -1339,7 +1339,7 @@ int MPID_Win_flush(int dest, MPID_Win * win_ptr)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_FLUSH);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_GRANTED,
@@ -1355,7 +1355,7 @@ int MPID_Win_flush(int dest, MPID_Win * win_ptr)
 
     mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, dest, &target);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     if (target == NULL)
         goto finish_flush;
 
@@ -1378,7 +1378,7 @@ int MPID_Win_flush(int dest, MPID_Win * win_ptr)
     /* Issue out all operations. */
     mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, dest, &made_progress);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Wait for remote completion. */
     do {
@@ -1387,7 +1387,7 @@ int MPID_Win_flush(int dest, MPID_Win * win_ptr)
         if (!remote_completed) {
             mpi_errno = wait_progress_engine();
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     } while (!remote_completed);
 
@@ -1402,7 +1402,7 @@ int MPID_Win_flush(int dest, MPID_Win * win_ptr)
          * the progress engine once to avoid such issue.  */
         mpi_errno = poke_progress_engine();
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -1418,7 +1418,7 @@ int MPID_Win_flush(int dest, MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_flush_local
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_flush_local(int dest, MPID_Win * win_ptr)
 {
     int made_progress = 0;
@@ -1430,7 +1430,7 @@ int MPID_Win_flush_local(int dest, MPID_Win * win_ptr)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_FLUSH_LOCAL);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_GRANTED,
@@ -1446,7 +1446,7 @@ int MPID_Win_flush_local(int dest, MPID_Win * win_ptr)
 
     mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, dest, &target);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     if (target == NULL)
         goto fn_exit;
 
@@ -1468,7 +1468,7 @@ int MPID_Win_flush_local(int dest, MPID_Win * win_ptr)
     /* Issue out all operations. */
     mpi_errno = MPIDI_CH3I_RMA_Make_progress_target(win_ptr, dest, &made_progress);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Wait for local completion. */
     do {
@@ -1477,7 +1477,7 @@ int MPID_Win_flush_local(int dest, MPID_Win * win_ptr)
         if (!local_completed) {
             mpi_errno = wait_progress_engine();
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     } while (!local_completed);
 
@@ -1494,7 +1494,7 @@ int MPID_Win_flush_local(int dest, MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_lock_all
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_lock_all(int assert, MPID_Win * win_ptr)
 {
     int i, rank = win_ptr->comm_ptr->rank;
@@ -1508,7 +1508,7 @@ int MPID_Win_lock_all(int assert, MPID_Win * win_ptr)
      * ended up with not unsetting the window state. We can only detect if this
      * access epoch is overlapped with another access epoch of PSCW or Passive
      * Target. */
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_NONE &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_NONE &&
                         win_ptr->states.access_state != MPIDI_RMA_FENCE_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_FENCE_GRANTED,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
@@ -1529,7 +1529,7 @@ int MPID_Win_lock_all(int assert, MPID_Win * win_ptr)
         win_ptr->outstanding_locks++;
         mpi_errno = acquire_local_lock(win_ptr, MPI_LOCK_SHARED);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (win_ptr->shm_allocated == TRUE) {
             MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
@@ -1542,7 +1542,7 @@ int MPID_Win_lock_all(int assert, MPID_Win * win_ptr)
                     win_ptr->outstanding_locks++;
                     mpi_errno = send_lock_msg(i, MPI_LOCK_SHARED, win_ptr);
                     if (mpi_errno != MPI_SUCCESS)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -1551,7 +1551,7 @@ int MPID_Win_lock_all(int assert, MPID_Win * win_ptr)
         while (win_ptr->outstanding_locks > 0) {
             mpi_errno = wait_progress_engine();
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -1573,7 +1573,7 @@ int MPID_Win_lock_all(int assert, MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_unlock_all
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_unlock_all(MPID_Win * win_ptr)
 {
     int i, made_progress = 0;
@@ -1586,7 +1586,7 @@ int MPID_Win_unlock_all(MPID_Win * win_ptr)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_UNLOCK_ALL);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_GRANTED,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
@@ -1600,7 +1600,7 @@ int MPID_Win_unlock_all(MPID_Win * win_ptr)
     if (!(win_ptr->lock_all_assert & MPI_MODE_NOCHECK)) {
         mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
 
         if (win_ptr->shm_allocated == TRUE) {
             MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
@@ -1612,7 +1612,7 @@ int MPID_Win_unlock_all(MPID_Win * win_ptr)
                 if (orig_vc->node_id == target_vc->node_id) {
                     mpi_errno = send_unlock_msg(i, win_ptr, MPIDI_CH3_PKT_FLAG_RMA_UNLOCK_NO_ACK);
                     if (mpi_errno != MPI_SUCCESS)
-                        MPIU_ERR_POP(mpi_errno);
+                        MPIR_ERR_POP(mpi_errno);
                 }
             }
         }
@@ -1661,7 +1661,7 @@ int MPID_Win_unlock_all(MPID_Win * win_ptr)
 
                 mpi_errno = send_unlock_msg(i, win_ptr, MPIDI_CH3_PKT_FLAG_RMA_UNLOCK_NO_ACK);
                 if (mpi_errno != MPI_SUCCESS)
-                    MPIU_ERR_POP(mpi_errno);
+                    MPIR_ERR_POP(mpi_errno);
             }
         }
     }
@@ -1669,7 +1669,7 @@ int MPID_Win_unlock_all(MPID_Win * win_ptr)
     /* Issue out all operations. */
     mpi_errno = MPIDI_CH3I_RMA_Make_progress_win(win_ptr, &made_progress);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Wait for remote completion. */
     do {
@@ -1677,14 +1677,14 @@ int MPID_Win_unlock_all(MPID_Win * win_ptr)
         if (!remote_completed) {
             mpi_errno = wait_progress_engine();
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
         }
     } while (!remote_completed);
 
     /* Cleanup all targets on this window. */
     mpi_errno = MPIDI_CH3I_RMA_Cleanup_targets_win(win_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Set window access state properly. */
     win_ptr->states.access_state = MPIDI_RMA_NONE;
@@ -1705,7 +1705,7 @@ int MPID_Win_unlock_all(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_flush_all
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_flush_all(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1713,7 +1713,7 @@ int MPID_Win_flush_all(MPID_Win * win_ptr)
 
     MPIDI_RMA_FUNC_ENTER(MPIDI_STATE_MPID_WIN_FLUSH_ALL);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_GRANTED,
@@ -1726,7 +1726,7 @@ int MPID_Win_flush_all(MPID_Win * win_ptr)
 
     mpi_errno = flush_all(win_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPIDI_STATE_MPID_WIN_FLUSH_ALL);
@@ -1741,7 +1741,7 @@ int MPID_Win_flush_all(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_flush_local_all
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_flush_local_all(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1749,7 +1749,7 @@ int MPID_Win_flush_local_all(MPID_Win * win_ptr)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_FLUSH_LOCAL_ALL);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_GRANTED,
@@ -1762,7 +1762,7 @@ int MPID_Win_flush_local_all(MPID_Win * win_ptr)
 
     mpi_errno = flush_local_all(win_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPID_WIN_FLUSH_LOCAL_ALL);
@@ -1777,7 +1777,7 @@ int MPID_Win_flush_local_all(MPID_Win * win_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_sync
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_sync(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1785,7 +1785,7 @@ int MPID_Win_sync(MPID_Win * win_ptr)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_SYNC);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
+    MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED &&
                         win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_GRANTED,
diff --git a/src/mpid/ch3/src/ch3u_rndv.c b/src/mpid/ch3/src/ch3u_rndv.c
index 8f6b05e..829dc3b 100644
--- a/src/mpid/ch3/src/ch3u_rndv.c
+++ b/src/mpid/ch3/src/ch3u_rndv.c
@@ -14,7 +14,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_RndvSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* MPIDI_CH3_RndvSend - Send a request to perform a rendezvous send */
 int MPIDI_CH3_RndvSend( MPID_Request **sreq_p, const void * buf, MPI_Aint count,
 			MPI_Datatype datatype, int dt_contig, MPIDI_msg_sz_t data_sz, 
@@ -50,15 +50,15 @@ int MPIDI_CH3_RndvSend( MPID_Request **sreq_p, const void * buf, MPI_Aint count,
 
     MPIU_DBG_MSGPKT(vc,tag,rts_pkt->match.parts.context_id,rank,data_sz,"Rndv");
 
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, rts_pkt, sizeof(*rts_pkt), &rts_sreq);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
     /* --BEGIN ERROR HANDLING-- */
     if (mpi_errno != MPI_SUCCESS)
     {
         MPID_Request_release(sreq);
 	*sreq_p = NULL;
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rtspkt");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rtspkt");
     }
     /* --END ERROR HANDLING-- */
     if (rts_sreq != NULL)
@@ -69,7 +69,7 @@ int MPIDI_CH3_RndvSend( MPID_Request **sreq_p, const void * buf, MPI_Aint count,
 	    *sreq_p = NULL;
             mpi_errno = rts_sreq->status.MPI_ERROR;
             MPID_Request_release(rts_sreq);
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rtspkt");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rtspkt");
 	}
 	MPID_Request_release(rts_sreq);
     }
@@ -106,7 +106,7 @@ int MPIDI_CH3_RndvSend( MPID_Request **sreq_p, const void * buf, MPI_Aint count,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_RndvReqToSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 					MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
 {
@@ -124,9 +124,9 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 		    rts_pkt->match.parts.rank,rts_pkt->data_sz,
 		    "ReceivedRndv");
 
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
     rreq = MPIDI_CH3U_Recvq_FDP_or_AEU(&rts_pkt->match, &found);
-    MPIU_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
+    MPIR_ERR_CHKANDJUMP1(!rreq, mpi_errno,MPI_ERR_OTHER, "**nomemreq", "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
 
     /* If the completion counter is 0, that means that the communicator to
      * which this message is being sent has been revoked and we shouldn't
@@ -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);
 
-    MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
 
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
     
@@ -157,11 +157,11 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	MPIDI_Pkt_init(cts_pkt, MPIDI_CH3_PKT_RNDV_CLR_TO_SEND);
 	cts_pkt->sender_req_id = rts_pkt->sender_req_id;
 	cts_pkt->receiver_req_id = rreq->handle;
-        MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
 	mpi_errno = MPIDI_CH3_iStartMsg(vc, cts_pkt, sizeof(*cts_pkt), &cts_req);
-        MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
 				"**ch3|ctspkt");
 	}
 	if (cts_req != NULL) {
@@ -194,7 +194,7 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_RndvClrToSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_RndvClrToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 					MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
 {
@@ -251,24 +251,24 @@ int MPIDI_CH3_PktHandler_RndvClrToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	iov[1].MPL_IOV_BUF = (MPL_IOV_BUF_CAST)((char *)sreq->dev.user_buf + dt_true_lb);
 	iov[1].MPL_IOV_LEN = data_sz;
 
-        MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+        MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
 	mpi_errno = MPIDI_CH3_iSendv(vc, sreq, iov, 2);
-        MPIU_THREAD_CS_EXIT(CH3COMM,vc);
-	MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|senddata");
+        MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+	MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|senddata");
     }
     else
     {
 	sreq->dev.segment_ptr = MPID_Segment_alloc( );
-        MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+        MPIR_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
 	MPID_Segment_init(sreq->dev.user_buf, sreq->dev.user_count, 
 			  sreq->dev.datatype, sreq->dev.segment_ptr, 0);
 	sreq->dev.segment_first = 0;
 	sreq->dev.segment_size = data_sz;
 
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+	MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
 	mpi_errno = vc->sendNoncontig_fn(vc, sreq, rs_pkt, sizeof(*rs_pkt));
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
-	MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|senddata");
+	MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
+	MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|senddata");
     }    
     *rreqp = NULL;
 
@@ -279,7 +279,7 @@ int MPIDI_CH3_PktHandler_RndvClrToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_RndvSend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_PktHandler_RndvSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, 
 				   MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
 {
@@ -302,7 +302,7 @@ int MPIDI_CH3_PktHandler_RndvSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
         mpi_errno = MPID_Request_complete(req);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 	*rreqp = NULL;
     }
@@ -310,7 +310,7 @@ int MPIDI_CH3_PktHandler_RndvSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len,
                                                   &complete);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**ch3|postrecv",
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**ch3|postrecv",
 			     "**ch3|postrecv %s", "MPIDI_CH3_PKT_RNDV_SEND");
 	}
 
@@ -320,7 +320,7 @@ int MPIDI_CH3_PktHandler_RndvSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         {
             mpi_errno = MPID_Request_complete(req);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
             *rreqp = NULL;
         }
@@ -341,7 +341,7 @@ int MPIDI_CH3_PktHandler_RndvSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_RecvRndv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_RecvRndv( MPIDI_VC_t * vc, MPID_Request *rreq )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -358,11 +358,11 @@ int MPIDI_CH3_RecvRndv( MPIDI_VC_t * vc, MPID_Request *rreq )
     MPIDI_Pkt_init(cts_pkt, MPIDI_CH3_PKT_RNDV_CLR_TO_SEND);
     cts_pkt->sender_req_id = rreq->dev.sender_req_id;
     cts_pkt->receiver_req_id = rreq->handle;
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, cts_pkt, sizeof(*cts_pkt), &cts_req);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**ch3|ctspkt");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**ch3|ctspkt");
     }
     if (cts_req != NULL)
     {
diff --git a/src/mpid/ch3/src/ch3u_win_fns.c b/src/mpid/ch3/src/ch3u_win_fns.c
index f2a5840..a1eb3a9 100644
--- a/src/mpid/ch3/src/ch3u_win_fns.c
+++ b/src/mpid/ch3/src/ch3u_win_fns.c
@@ -13,7 +13,7 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_wincreate_allgather);
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Win_fns_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_Win_fns_init(MPIDI_CH3U_Win_fns_t * win_fns)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -37,7 +37,7 @@ int MPIDI_Win_fns_init(MPIDI_CH3U_Win_fns_t * win_fns)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Win_gather_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Win_gather_info(void *base, MPI_Aint size, int disp_unit,
                                MPID_Info * info, MPID_Comm * comm_ptr, MPID_Win ** win_ptr)
 {
@@ -77,9 +77,9 @@ int MPIDI_CH3U_Win_gather_info(void *base, MPI_Aint size, int disp_unit,
                                     tmp_buf, 4, MPI_AINT, (*win_ptr)->comm_ptr, &errflag);
     MPIR_T_PVAR_TIMER_END(RMA, rma_wincreate_allgather);
     if (mpi_errno) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
     k = 0;
     for (i = 0; i < comm_size; i++) {
@@ -104,7 +104,7 @@ int MPIDI_CH3U_Win_gather_info(void *base, MPI_Aint size, int disp_unit,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Win_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Win_create(void *base, MPI_Aint size, int disp_unit, MPID_Info * info,
                           MPID_Comm * comm_ptr, MPID_Win ** win_ptr)
 {
@@ -115,14 +115,14 @@ int MPIDI_CH3U_Win_create(void *base, MPI_Aint size, int disp_unit, MPID_Info *
 
     mpi_errno = MPIDI_CH3U_Win_fns.gather_info(base, size, disp_unit, info, comm_ptr, win_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if ((*win_ptr)->info_args.alloc_shm == TRUE && MPIDI_CH3U_Win_fns.detect_shm != NULL) {
         /* Detect if shared buffers are specified for the processes in the
          * current node. If so, enable shm RMA.*/
         mpi_errno = MPIDI_CH3U_Win_fns.detect_shm(win_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
@@ -139,7 +139,7 @@ int MPIDI_CH3U_Win_create(void *base, MPI_Aint size, int disp_unit, MPID_Info *
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Win_create_dynamic
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Win_create_dynamic(MPID_Info * info, MPID_Comm * comm_ptr, MPID_Win ** win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -149,7 +149,7 @@ int MPIDI_CH3U_Win_create_dynamic(MPID_Info * info, MPID_Comm * comm_ptr, MPID_W
 
     mpi_errno = MPIDI_CH3U_Win_fns.gather_info(MPI_BOTTOM, 0, 1, info, comm_ptr, win_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3U_WIN_CREATE_DYNAMIC);
@@ -163,7 +163,7 @@ int MPIDI_CH3U_Win_create_dynamic(MPID_Info * info, MPID_Comm * comm_ptr, MPID_W
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_attach
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_attach(MPID_Win * win, void *base, MPI_Aint size)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -186,7 +186,7 @@ int MPID_Win_attach(MPID_Win * win, void *base, MPI_Aint size)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_detach
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_detach(MPID_Win * win, const void *base)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -209,7 +209,7 @@ int MPID_Win_detach(MPID_Win * win, const void *base)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Win_allocate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Win_allocate(MPI_Aint size, int disp_unit, MPID_Info * info,
                             MPID_Comm * comm_ptr, void *baseptr, MPID_Win ** win_ptr)
 {
@@ -223,14 +223,14 @@ int MPIDI_CH3U_Win_allocate(MPI_Aint size, int disp_unit, MPID_Info * info,
             mpi_errno =
                 MPIDI_CH3U_Win_fns.allocate_shm(size, disp_unit, info, comm_ptr, baseptr, win_ptr);
             if (mpi_errno != MPI_SUCCESS)
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             goto fn_exit;
         }
     }
 
     mpi_errno = MPIDI_CH3U_Win_allocate_no_shm(size, disp_unit, info, comm_ptr, baseptr, win_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3U_WIN_ALLOCATE);
@@ -243,7 +243,7 @@ int MPIDI_CH3U_Win_allocate(MPI_Aint size, int disp_unit, MPID_Info * info,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Win_allocate_no_shm
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Win_allocate_no_shm(MPI_Aint size, int disp_unit, MPID_Info * info,
                                    MPID_Comm * comm_ptr, void *baseptr, MPID_Win ** win_ptr)
 {
@@ -261,14 +261,14 @@ int MPIDI_CH3U_Win_allocate_no_shm(MPI_Aint size, int disp_unit, MPID_Info * inf
         *base_pp = NULL;
     }
     else {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_SIZE, "**rmasize");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_SIZE, "**rmasize");
     }
 
     (*win_ptr)->base = *base_pp;
 
     mpi_errno = MPIDI_CH3U_Win_fns.gather_info(*base_pp, size, disp_unit, info, comm_ptr, win_ptr);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -285,7 +285,7 @@ int MPIDI_CH3U_Win_allocate_no_shm(MPI_Aint size, int disp_unit, MPID_Info * inf
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Win_shared_query
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Win_shared_query(MPID_Win * win_ptr, int target_rank, MPI_Aint * size,
                                 int *disp_unit, void *baseptr)
 {
@@ -311,7 +311,7 @@ int MPIDI_CH3U_Win_shared_query(MPID_Win * win_ptr, int target_rank, MPI_Aint *
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_set_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_set_info(MPID_Win * win, MPID_Info * info)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -390,7 +390,7 @@ int MPID_Win_set_info(MPID_Win * win, MPID_Info * info)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_get_info
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_get_info(MPID_Win * win, MPID_Info ** info_used)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -401,7 +401,7 @@ int MPID_Win_get_info(MPID_Win * win, MPID_Info ** info_used)
     /* Allocate an empty info object */
     mpi_errno = MPIU_Info_alloc(info_used);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     /* Populate the predefined info keys */
@@ -411,7 +411,7 @@ int MPID_Win_get_info(MPID_Win * win, MPID_Info ** info_used)
         mpi_errno = MPIR_Info_set_impl(*info_used, "no_locks", "false");
 
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     {
@@ -429,7 +429,7 @@ int MPID_Win_get_info(MPID_Win * win, MPID_Info ** info_used)
 
         MPIR_Info_set_impl(*info_used, "accumulate_ordering", buf);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 #undef BUFSIZE
     }
@@ -440,7 +440,7 @@ int MPID_Win_get_info(MPID_Win * win, MPID_Info ** info_used)
         mpi_errno = MPIR_Info_set_impl(*info_used, "accumulate_ops", "same_op_no_op");
 
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     if (win->info_args.alloc_shm == TRUE)
@@ -449,7 +449,7 @@ int MPID_Win_get_info(MPID_Win * win, MPID_Info ** info_used)
         mpi_errno = MPIR_Info_set_impl(*info_used, "alloc_shm", "false");
 
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     if (win->create_flavor == MPI_WIN_FLAVOR_SHARED) {
@@ -459,7 +459,7 @@ int MPID_Win_get_info(MPID_Win * win, MPID_Info ** info_used)
             mpi_errno = MPIR_Info_set_impl(*info_used, "alloc_shared_noncontig", "false");
 
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
     else if (win->create_flavor == MPI_WIN_FLAVOR_ALLOCATE) {
@@ -469,7 +469,7 @@ int MPID_Win_get_info(MPID_Win * win, MPID_Info ** info_used)
             mpi_errno = MPIR_Info_set_impl(*info_used, "same_size", "false");
 
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
diff --git a/src/mpid/ch3/src/mpid_abort.c b/src/mpid/ch3/src/mpid_abort.c
index edf416a..e598fcc 100644
--- a/src/mpid/ch3/src/mpid_abort.c
+++ b/src/mpid/ch3/src/mpid_abort.c
@@ -29,7 +29,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Abort
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Abort(MPID_Comm * comm, int mpi_errno, int exit_code, 
 	       const char *error_msg)
 {
diff --git a/src/mpid/ch3/src/mpid_aint.c b/src/mpid/ch3/src/mpid_aint.c
index e331f57..b3bc8f1 100644
--- a/src/mpid/ch3/src/mpid_aint.c
+++ b/src/mpid/ch3/src/mpid_aint.c
@@ -19,7 +19,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Aint_add
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 MPI_Aint MPID_Aint_add(MPI_Aint base, MPI_Aint disp)
 {
     MPI_Aint result;
@@ -46,7 +46,7 @@ MPI_Aint MPID_Aint_add(MPI_Aint base, MPI_Aint disp)
 #undef FUNCNAME
 #define FUNCNAME MPID_Aint_diff
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 MPI_Aint MPID_Aint_diff(MPI_Aint addr1, MPI_Aint addr2)
 {
     MPI_Aint result;
diff --git a/src/mpid/ch3/src/mpid_cancel_recv.c b/src/mpid/ch3/src/mpid_cancel_recv.c
index e46d4cb..4bba002 100644
--- a/src/mpid/ch3/src/mpid_cancel_recv.c
+++ b/src/mpid/ch3/src/mpid_cancel_recv.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Cancel_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Cancel_recv(MPID_Request * rreq)
 {
     int netmod_cancelled = TRUE;
@@ -42,7 +42,7 @@ int MPID_Cancel_recv(MPID_Request * rreq)
         MPIR_STATUS_SET_COUNT(rreq->status, 0);
         mpi_errno = MPID_Request_complete(rreq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
     else
diff --git a/src/mpid/ch3/src/mpid_cancel_send.c b/src/mpid/ch3/src/mpid_cancel_send.c
index 1609c21..7510dfe 100644
--- a/src/mpid/ch3/src/mpid_cancel_send.c
+++ b/src/mpid/ch3/src/mpid_cancel_send.c
@@ -13,7 +13,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Cancel_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Cancel_send(MPID_Request * sreq)
 {
     MPIDI_VC_t * vc;
@@ -56,9 +56,9 @@ int MPID_Cancel_send(MPID_Request * sreq)
 	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
 		     "attempting to cancel message sent to self");
 	
-	MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+	MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
 	rreq = MPIDI_CH3U_Recvq_FDU(sreq->handle, &sreq->dev.match);
-	MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
 	if (rreq)
 	{
 	    MPIU_Assert(rreq->partner_request == sreq);
@@ -78,7 +78,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
 	    MPIR_STATUS_SET_CANCEL_BIT(sreq->status, TRUE);
             mpi_errno = MPID_Request_complete(sreq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
 	}
 	else
@@ -196,11 +196,11 @@ int MPID_Cancel_send(MPID_Request * sreq)
 	csr_pkt->match.parts.context_id = sreq->dev.match.parts.context_id;
 	csr_pkt->sender_req_id = sreq->handle;
 	
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+	MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
 	mpi_errno = MPIDI_CH3_iStartMsg(vc, csr_pkt, sizeof(*csr_pkt), &csr_sreq);
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+	MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|cancelreq");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|cancelreq");
 	}
 	if (csr_sreq != NULL)
 	{
@@ -271,11 +271,11 @@ int MPIDI_CH3_PktHandler_CancelSendReq( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     resp_pkt->sender_req_id = req_pkt->sender_req_id;
     resp_pkt->ack = ack;
     /* FIXME: This is called within the packet handler */
-    /* MPIU_THREAD_CS_ENTER(CH3COMM,vc); */
+    /* MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex); */
     mpi_errno = MPIDI_CH3_iStartMsg(vc, resp_pkt, sizeof(*resp_pkt), &resp_sreq);
-    /* MPIU_THREAD_CS_EXIT(CH3COMM,vc); */
+    /* MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex); */
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
 			    "**ch3|cancelresp");
     }
     if (resp_sreq != NULL)
@@ -329,7 +329,7 @@ int MPIDI_CH3_PktHandler_CancelSendResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
     
     mpi_errno = MPID_Request_complete(sreq);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     *rreqp = NULL;
diff --git a/src/mpid/ch3/src/mpid_comm_disconnect.c b/src/mpid/ch3/src/mpid_comm_disconnect.c
index d7a0d87..f2fc65f 100644
--- a/src/mpid/ch3/src/mpid_comm_disconnect.c
+++ b/src/mpid/ch3/src/mpid_comm_disconnect.c
@@ -21,7 +21,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Comm_disconnect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Comm_disconnect(MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -31,7 +31,7 @@ int MPID_Comm_disconnect(MPID_Comm *comm_ptr)
 
     /* Check to make sure the communicator hasn't already been revoked */
     if (comm_ptr->revoked) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
     /* it's more than a comm_release, but ok for now */
@@ -39,11 +39,11 @@ int MPID_Comm_disconnect(MPID_Comm *comm_ptr)
     /* MPIU_PG_Printall( stdout ); */
     comm_ptr->dev.is_disconnected = 1;
     mpi_errno = MPIR_Comm_release(comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     /* If any of the VCs were released by this Comm_release, wait
      for those close operations to complete */
     mpi_errno = MPIDI_CH3U_VC_WaitForClose();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     /* MPIU_PG_Printall( stdout ); */
 
 
diff --git a/src/mpid/ch3/src/mpid_comm_failure_ack.c b/src/mpid/ch3/src/mpid_comm_failure_ack.c
index e1938e1..947056c 100644
--- a/src/mpid/ch3/src/mpid_comm_failure_ack.c
+++ b/src/mpid/ch3/src/mpid_comm_failure_ack.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Comm_failure_ack
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Comm_failure_ack(MPID_Comm *comm_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -41,7 +41,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Comm_failure_get_acked
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Comm_failure_get_acked(MPID_Comm *comm_ptr, MPID_Group **group_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -76,7 +76,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Comm_AS_enabled
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Comm_AS_enabled(MPID_Comm *comm_ptr) {
     return comm_ptr->dev.anysource_enabled;
 }
@@ -85,7 +85,7 @@ int MPID_Comm_AS_enabled(MPID_Comm *comm_ptr) {
 #undef FUNCNAME
 #define FUNCNAME MPID_Request_is_anysource
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Request_is_anysource(MPID_Request *request_ptr) {
     int ret = 0;
 
diff --git a/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c b/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
index c7ef355..9b04c48 100644
--- a/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
+++ b/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
@@ -85,7 +85,7 @@ static MPID_Group *bitarray_to_group(MPID_Comm *comm_ptr, int *bitarray)
 #undef FUNCNAME
 #define FUNCNAME MPID_Comm_get_all_failed_procs
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_group, int tag)
 {
     int mpi_errno = MPI_SUCCESS, ret_errno;
@@ -105,7 +105,7 @@ int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_grou
     MPIDI_CH3U_Check_for_failed_procs();
 
     mpi_errno = MPIDI_CH3U_Get_failed_group(-2, &local_fail);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Generate a bitarray based on the list of failed procs */
     group_to_bitarray(local_fail, comm_ptr, &bitarray, &bitarray_size);
diff --git a/src/mpid/ch3/src/mpid_comm_revoke.c b/src/mpid/ch3/src/mpid_comm_revoke.c
index 0e8fc86..de1f613 100644
--- a/src/mpid/ch3/src/mpid_comm_revoke.c
+++ b/src/mpid/ch3/src/mpid_comm_revoke.c
@@ -18,7 +18,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Comm_revoke
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Comm_revoke(MPID_Comm *comm_ptr, int is_remote)
 {
     MPIDI_VC_t *vc;
@@ -62,9 +62,9 @@ int MPID_Comm_revoke(MPID_Comm *comm_ptr, int is_remote)
             iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) revoke_pkt;
             iov[0].MPL_IOV_LEN = sizeof(*revoke_pkt);
 
-            MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+            MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
             mpi_errno = MPIDI_CH3_iStartMsgv(vc, iov, 1, &request);
-            MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+            MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
             if (mpi_errno) comm_ptr->dev.waiting_for_revoke--;
             if (NULL != request)
                 /* We don't need to keep a reference to this request. The
@@ -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 */
-        MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
         MPIDI_CH3U_Clean_recvq(comm_ptr);
-        MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.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_comm_spawn_multiple.c b/src/mpid/ch3/src/mpid_comm_spawn_multiple.c
index b1e4795..36d6f14 100644
--- a/src/mpid/ch3/src/mpid_comm_spawn_multiple.c
+++ b/src/mpid/ch3/src/mpid_comm_spawn_multiple.c
@@ -31,7 +31,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Comm_spawn_multiple
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Comm_spawn_multiple(int count, char *array_of_commands[],
 			     char ** array_of_argv[], const int array_of_maxprocs[],
 			     MPID_Info * array_of_info_ptrs[], int root, 
@@ -45,7 +45,7 @@ int MPID_Comm_spawn_multiple(int count, char *array_of_commands[],
 
     /* Check to make sure the communicator hasn't already been revoked */
     if (comm_ptr->revoked) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
     /* We allow an empty implementation of this function to 
@@ -58,7 +58,7 @@ int MPID_Comm_spawn_multiple(int count, char *array_of_commands[],
 					  root, comm_ptr, intercomm, 
 					  array_of_errcodes);
 #   else
-    MPIU_ERR_SET1(mpi_errno,MPI_ERR_OTHER, "**notimpl",
+    MPIR_ERR_SET1(mpi_errno,MPI_ERR_OTHER, "**notimpl",
 		  "**notimpl %s", FCNAME);
 #   endif
     
diff --git a/src/mpid/ch3/src/mpid_finalize.c b/src/mpid/ch3/src/mpid_finalize.c
index e41c27d..c6a9ae2 100644
--- a/src/mpid/ch3/src/mpid_finalize.c
+++ b/src/mpid/ch3/src/mpid_finalize.c
@@ -14,7 +14,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -99,36 +99,36 @@ int MPID_Finalize(void)
     /* FIXME: The close actions should use the same code as the other
        connection close code */
     mpi_errno = MPIDI_PG_Close_VCs();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     /*
      * Wait for all VCs to finish the close protocol
      */
     mpi_errno = MPIDI_CH3U_VC_WaitForClose();
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 #endif
 
     /* Note that the CH3I_Progress_finalize call has been removed; the
        CH3_Finalize routine should call it */
     mpi_errno = MPIDI_CH3_Finalize();
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 
 #ifdef MPID_NEEDS_ICOMM_WORLD
     mpi_errno = MPIR_Comm_release_always(MPIR_Process.icomm_world);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 #endif
 
     mpi_errno = MPIR_Comm_release_always(MPIR_Process.comm_self);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIR_Comm_release_always(MPIR_Process.comm_world);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Tell the process group code that we're done with the process groups.
        This will notify PMI (with PMI_Finalize) if necessary.  It
        also frees all PG structures, including the PG for COMM_WORLD, whose 
        pointer is also saved in MPIDI_Process.my_pg */
     mpi_errno = MPIDI_PG_Finalize();
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 
 #ifndef MPIDI_CH3_HAS_NO_DYNAMIC_PROCESS
     MPIDI_CH3_FreeParentPort();
diff --git a/src/mpid/ch3/src/mpid_get_universe_size.c b/src/mpid/ch3/src/mpid_get_universe_size.c
index 4b4c6dd..3d3af19 100644
--- a/src/mpid/ch3/src/mpid_get_universe_size.c
+++ b/src/mpid/ch3/src/mpid_get_universe_size.c
@@ -22,7 +22,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Get_universe_size
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Get_universe_size(int  * universe_size)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -32,13 +32,13 @@ int MPID_Get_universe_size(int  * universe_size)
     char *endptr;
     
     mpi_errno = PMI2_Info_GetJobAttr("universeSize", val, sizeof(val), &found);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (!found)
 	*universe_size = MPIR_UNIVERSE_SIZE_NOT_AVAILABLE;
     else {
         *universe_size = strtol(val, &endptr, 0);
-        MPIU_ERR_CHKINTERNAL(endptr - val != strlen(val), mpi_errno, "can't parse universe size");
+        MPIR_ERR_CHKINTERNAL(endptr - val != strlen(val), mpi_errno, "can't parse universe size");
     }
 
 #else
@@ -46,7 +46,7 @@ int MPID_Get_universe_size(int  * universe_size)
 
     pmi_errno = PMI_Get_universe_size(universe_size);
     if (pmi_errno != PMI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, 
+	MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, 
 			     "**pmi_get_universe_size",
 			     "**pmi_get_universe_size %d", pmi_errno);
     }
diff --git a/src/mpid/ch3/src/mpid_getpname.c b/src/mpid/ch3/src/mpid_getpname.c
index e8dcc70..db069c5 100644
--- a/src/mpid/ch3/src/mpid_getpname.c
+++ b/src/mpid/ch3/src/mpid_getpname.c
@@ -21,7 +21,7 @@ static inline void setupProcessorName( void );
 #undef FUNCNAME
 #define FUNCNAME MPID_Get_processor_name
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Get_processor_name(char * name, int namelen, int * resultlen)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -30,7 +30,7 @@ int MPID_Get_processor_name(char * name, int namelen, int * resultlen)
 	setupProcessorName( );
 	setProcessorName = 1;
     }
-    MPIU_ERR_CHKANDJUMP(processorNameLen <= 0, mpi_errno, MPI_ERR_OTHER, "**procnamefailed");
+    MPIR_ERR_CHKANDJUMP(processorNameLen <= 0, mpi_errno, MPI_ERR_OTHER, "**procnamefailed");
 
     /* MPIU_Strncpy only copies until (and including) the null,
        unlike strncpy, it does not blank pad.  This is a good thing
diff --git a/src/mpid/ch3/src/mpid_improbe.c b/src/mpid/ch3/src/mpid_improbe.c
index 4f2dfd7..9cdb8dc 100644
--- a/src/mpid/ch3/src/mpid_improbe.c
+++ b/src/mpid/ch3/src/mpid_improbe.c
@@ -13,7 +13,7 @@ int (*MPIDI_Anysource_improbe_fn)(int tag, MPID_Comm * comm, int context_offset,
 #undef FUNCNAME
 #define FUNCNAME MPID_Improbe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Improbe(int source, int tag, MPID_Comm *comm, int context_offset,
                  int *flag, MPID_Request **message, MPI_Status *status)
 {
@@ -32,7 +32,7 @@ int MPID_Improbe(int source, int tag, MPID_Comm *comm, int context_offset,
 
     /* Check to make sure the communicator hasn't already been revoked */
     if (comm->revoked) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
 #ifdef ENABLE_COMM_OVERRIDES
@@ -42,25 +42,25 @@ int MPID_Improbe(int source, int tag, MPID_Comm *comm, int context_offset,
                If still not found, call progress, and check again. */
 
             /* check shm*/
-            MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
             *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-            MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
             if (!*flag) {
                 /* not found, check network */
                 mpi_errno = MPIDI_Anysource_improbe_fn(tag, comm, context_offset, flag, message, status);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 if (!*flag) {
                     /* still not found, make some progress*/
                     mpi_errno = MPIDI_CH3_Progress_poke();
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     /* check shm again */
-                    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+                    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
                     *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-                    MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+                    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
                     if (!*flag) {
                         /* check network again */
                         mpi_errno = MPIDI_Anysource_improbe_fn(tag, comm, context_offset, flag, message, status);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
             }
@@ -72,7 +72,7 @@ int MPID_Improbe(int source, int tag, MPID_Comm *comm, int context_offset,
             MPIDI_Comm_get_vc_set_active(comm, source, &vc);
             if (vc->comm_ops && vc->comm_ops->improbe) {
                 mpi_errno = vc->comm_ops->improbe(vc, source, tag, comm, context_offset, flag, message, status);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 goto fn_exit;
             }
             /* fall-through to shm case */
@@ -80,9 +80,9 @@ int MPID_Improbe(int source, int tag, MPID_Comm *comm, int context_offset,
     }
 #endif
 
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
     *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-    MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
 
     if (!*flag) {
         /* Always try to advance progress before returning failure
@@ -92,10 +92,10 @@ int MPID_Improbe(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();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
         *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
-        MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
     }
 
     if (*flag && *message) {
diff --git a/src/mpid/ch3/src/mpid_imrecv.c b/src/mpid/ch3/src/mpid_imrecv.c
index 7097fe1..cb0b00e 100644
--- a/src/mpid/ch3/src/mpid_imrecv.c
+++ b/src/mpid/ch3/src/mpid_imrecv.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Imrecv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Imrecv(void *buf, int count, MPI_Datatype datatype,
                 MPID_Request *message, MPID_Request **rreqp)
 {
@@ -56,7 +56,7 @@ int MPID_Imrecv(void *buf, int count, MPI_Datatype datatype,
         {
             MPIDI_Comm_get_vc_set_active(comm, rreq->dev.match.parts.rank, &vc);
             mpi_errno = MPIDI_CH3_EagerSyncAck(vc, rreq);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         /* the request was found in the unexpected queue, so it has a
@@ -100,7 +100,7 @@ int MPID_Imrecv(void *buf, int count, MPI_Datatype datatype,
         MPIDI_Comm_get_vc_set_active(comm, rreq->dev.match.parts.rank, &vc);
 
         mpi_errno = vc->rndvRecv_fn(vc, rreq);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN)
         {
             MPID_Datatype_get_ptr(datatype, rreq->dev.datatype_ptr);
@@ -110,7 +110,7 @@ int MPID_Imrecv(void *buf, int count, MPI_Datatype datatype,
     else if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_SELF_MSG)
     {
         mpi_errno = MPIDI_CH3_RecvFromSelf(rreq, buf, count, datatype);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else
     {
@@ -120,7 +120,7 @@ int MPID_Imrecv(void *buf, int count, MPI_Datatype datatype,
 #endif
         MPID_Request_release(rreq);
         rreq = NULL;
-        MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_INTERN, "**ch3|badmsgtype",
+        MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_INTERN, "**ch3|badmsgtype",
                              "**ch3|badmsgtype %d", msg_type);
         /* --END ERROR HANDLING-- */
     }
diff --git a/src/mpid/ch3/src/mpid_init.c b/src/mpid/ch3/src/mpid_init.c
index 1b8ffff..c0367d8 100644
--- a/src/mpid/ch3/src/mpid_init.c
+++ b/src/mpid/ch3/src/mpid_init.c
@@ -47,13 +47,13 @@ MPIDI_CH3U_Win_pkt_ordering_t MPIDI_CH3U_Win_pkt_orderings = { 0 };
 #undef FUNCNAME
 #define FUNCNAME finalize_failed_procs_group
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int finalize_failed_procs_group(void *param)
 {
     int mpi_errno = MPI_SUCCESS;
     if (MPIDI_Failed_procs_group != MPID_Group_empty) {
         mpi_errno = MPIR_Group_free_impl(MPIDI_Failed_procs_group);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     
  fn_fail:
@@ -63,7 +63,7 @@ static int finalize_failed_procs_group(void *param)
 #undef FUNCNAME
 #define FUNCNAME set_eager_threshold
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int set_eager_threshold(MPID_Comm *comm_ptr, MPID_Info *info, void *state)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -74,7 +74,7 @@ static int set_eager_threshold(MPID_Comm *comm_ptr, MPID_Info *info, void *state
 
     comm_ptr->dev.eager_max_msg_sz = strtol(info->value, &endptr, 0);
 
-    MPIU_ERR_CHKANDJUMP1(*endptr, mpi_errno, MPI_ERR_ARG,
+    MPIR_ERR_CHKANDJUMP1(*endptr, mpi_errno, MPI_ERR_ARG,
                          "**infohintparse", "**infohintparse %s",
                          info->key);
 
@@ -89,7 +89,7 @@ static int set_eager_threshold(MPID_Comm *comm_ptr, MPID_Info *info, void *state
 #undef FUNCNAME
 #define FUNCNAME MPID_Init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Init(int *argc, char ***argv, int requested, int *provided, 
 	      int *has_args, int *has_env)
 {
@@ -107,7 +107,7 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
 
     /* initialization routine for ch3u_comm.c */
     mpi_errno = MPIDI_CH3I_Comm_init();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
     /* init group of failed processes, and set finalize callback */
     MPIDI_Failed_procs_group = MPID_Group_empty;
@@ -149,7 +149,7 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
     mpi_errno = init_pg( argc, argv,
 			has_args, has_env, &has_parent, &pg_rank, &pg );
     if (mpi_errno) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**ch3|ch3_init");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**ch3|ch3_init");
     }
     
     /* FIXME: Why are pg_size and pg_rank handled differently? */
@@ -167,11 +167,11 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
     /* Ideally this wouldn't be needed.  Once we have PMIv2 support for node
        information we should probably eliminate this function. */
     mpi_errno = MPIDI_Populate_vc_node_ids(pg, pg_rank);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Initialize FTB after PMI init */
     mpi_errno = MPIDU_Ftb_init();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Initialize Window functions table with defaults, then call the channel's
        init function. */
@@ -187,12 +187,12 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
      */
     mpi_errno = MPIDI_CH3_Init(has_parent, pg, pg_rank);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**ch3|ch3_init");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**ch3|ch3_init");
     }
 
     /* setup receive queue statistics */
     mpi_errno = MPIDI_CH3U_Recvq_init();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Ask channel to expose Window packet ordering. */
     MPIDI_CH3_Win_pkt_orderings_init(&MPIDI_CH3U_Win_pkt_orderings);
@@ -209,7 +209,7 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
     mpi_errno = MPIDI_VCRT_Create(comm->remote_size, &comm->dev.vcrt);
     if (mpi_errno != MPI_SUCCESS)
     {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**dev|vcrt_create", 
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**dev|vcrt_create", 
 			     "**dev|vcrt_create %s", "MPI_COMM_WORLD");
     }
 
@@ -221,7 +221,7 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
     }
 
     mpi_errno = MPIR_Comm_commit(comm);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /*
      * Initialize the MPI_COMM_SELF object
@@ -234,14 +234,14 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
     mpi_errno = MPIDI_VCRT_Create(comm->remote_size, &comm->dev.vcrt);
     if (mpi_errno != MPI_SUCCESS)
     {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**dev|vcrt_create", 
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**dev|vcrt_create", 
 			     "**dev|vcrt_create %s", "MPI_COMM_SELF");
     }
     
     MPIDI_VCR_Dup(&pg->vct[pg_rank], &comm->dev.vcrt->vcr_table[0]);
 
     mpi_errno = MPIR_Comm_commit(comm);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Currently, mpidpre.h always defines MPID_NEEDS_ICOMM_WORLD. */
 #ifdef MPID_NEEDS_ICOMM_WORLD
@@ -258,7 +258,7 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
     comm->dev.vcrt = MPIR_Process.comm_world->dev.vcrt;
     
     mpi_errno = MPIR_Comm_commit(comm);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 #endif
     
     /*
@@ -291,7 +291,7 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
 	   for the purposes of initialization. */
 	mpi_errno = MPIDI_CH3_GetParentPort(&parent_port);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, 
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, 
 				"**ch3|get_parent_port");
 	}
 	MPIU_DBG_MSG_S(CH3_CONNECT,VERBOSE,"Parent port is %s", parent_port);
@@ -299,7 +299,7 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
 	mpi_errno = MPID_Comm_connect(parent_port, NULL, 0, 
 				      MPIR_Process.comm_world, &comm);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,
 				 "**ch3|conn_parent", 
 				 "**ch3|conn_parent %s", parent_port);
 	}
@@ -327,10 +327,10 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
     mpi_errno = MPIR_Comm_register_hint("eager_rendezvous_threshold",
                                         set_eager_threshold,
                                         NULL);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = MPIDI_RMA_init();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_INIT);
@@ -400,29 +400,29 @@ static int init_pg( int *argc, char ***argv,
 
 #ifdef USE_PMI2_API
         mpi_errno = PMI2_Init(has_parent, &pg_size, &pg_rank, &appnum);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 #else
 	pmi_errno = PMI_Init(has_parent);
 	if (pmi_errno != PMI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_init",
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_init",
 			     "**pmi_init %d", pmi_errno);
 	}
 
 	pmi_errno = PMI_Get_rank(&pg_rank);
 	if (pmi_errno != PMI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_get_rank",
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_get_rank",
 			     "**pmi_get_rank %d", pmi_errno);
 	}
 
 	pmi_errno = PMI_Get_size(&pg_size);
 	if (pmi_errno != 0) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_get_size",
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_get_size",
 			     "**pmi_get_size %d", pmi_errno);
 	}
 	
 	pmi_errno = PMI_Get_appnum(&appnum);
 	if (pmi_errno != PMI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_get_appnum",
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_get_appnum",
 				 "**pmi_get_appnum %d", pmi_errno);
 	}
 #endif
@@ -437,12 +437,12 @@ static int init_pg( int *argc, char ***argv,
         /* This memory will be freed by the PG_Destroy if there is an error */
 	pg_id = MPIU_Malloc(MAX_JOBID_LEN);
 	if (pg_id == NULL) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
 				 MAX_JOBID_LEN);
 	}
 
         mpi_errno = PMI2_Job_GetId(pg_id, MAX_JOBID_LEN);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         
 
 #else
@@ -452,7 +452,7 @@ static int init_pg( int *argc, char ***argv,
 	 */
 	pmi_errno = PMI_KVS_Get_name_length_max(&pg_id_sz);
 	if (pmi_errno != PMI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,
 				 "**pmi_get_id_length_max", 
 				 "**pmi_get_id_length_max %d", pmi_errno);
 	}
@@ -460,7 +460,7 @@ static int init_pg( int *argc, char ***argv,
 	/* This memory will be freed by the PG_Destroy if there is an error */
 	pg_id = MPIU_Malloc(pg_id_sz + 1);
 	if (pg_id == NULL) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
 				 pg_id_sz+1);
 	}
 
@@ -469,7 +469,7 @@ static int init_pg( int *argc, char ***argv,
 	   Process manager */
 	pmi_errno = PMI_KVS_Get_my_name(pg_id, pg_id_sz);
 	if (pmi_errno != PMI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_get_id",
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_get_id",
 				 "**pmi_get_id %d", pmi_errno);
 	}
 #endif
@@ -478,7 +478,7 @@ static int init_pg( int *argc, char ***argv,
 	/* Create a default pg id */
 	pg_id = MPIU_Malloc(2);
 	if (pg_id == NULL) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**nomem");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**nomem");
 	}
 	MPIU_Strncpy( pg_id, "0", 2 );
     }
@@ -489,7 +489,7 @@ static int init_pg( int *argc, char ***argv,
     mpi_errno = MPIDI_PG_Init(argc, argv, 
 			     pg_compare_ids, pg_destroy);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**dev|pg_init");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**dev|pg_init");
     }
 
     /*
@@ -497,7 +497,7 @@ static int init_pg( int *argc, char ***argv,
      */
     mpi_errno = MPIDI_PG_Create(pg_size, pg_id, &pg);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**dev|pg_create");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**dev|pg_create");
     }
 
     /* FIXME: We can allow the channels to tell the PG how to get
@@ -505,7 +505,7 @@ static int init_pg( int *argc, char ***argv,
     if (usePMI) {
 	/* Tell the process group how to get connection information */
         mpi_errno = MPIDI_PG_InitConnKVS( pg );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
 
     /* FIXME: Who is this for and where does it belong? */
@@ -551,7 +551,7 @@ int MPIDI_CH3I_BCInit( char **bc_val_p, int *val_max_sz_p )
     pmi_errno = PMI_KVS_Get_value_length_max(val_max_sz_p);
     if (pmi_errno != PMI_SUCCESS)
     {
-        MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,
+        MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,
                              "**pmi_kvs_get_value_length_max",
                              "**pmi_kvs_get_value_length_max %d", pmi_errno);
     }
@@ -559,7 +559,7 @@ int MPIDI_CH3I_BCInit( char **bc_val_p, int *val_max_sz_p )
     /* This memroy is returned by this routine */
     *bc_val_p = MPIU_Malloc(*val_max_sz_p);
     if (*bc_val_p == NULL) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**nomem","**nomem %d",
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**nomem","**nomem %d",
 			     *val_max_sz_p);
     }
     
diff --git a/src/mpid/ch3/src/mpid_iprobe.c b/src/mpid/ch3/src/mpid_iprobe.c
index 41f3f97..176db5c 100644
--- a/src/mpid/ch3/src/mpid_iprobe.c
+++ b/src/mpid/ch3/src/mpid_iprobe.c
@@ -12,7 +12,7 @@ int (*MPIDI_Anysource_iprobe_fn)(int tag, MPID_Comm * comm, int context_offset,
 #undef FUNCNAME
 #define FUNCNAME MPID_Iprobe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset, 
 		int *flag, MPI_Status *status)
 {
@@ -36,7 +36,7 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
     if (comm->revoked &&
             MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask) &&
             MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask)) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
 #ifdef ENABLE_COMM_OVERRIDES
@@ -46,25 +46,25 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
                If still not found, call progress, and check again. */
 
             /* check shm*/
-            MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+            MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
             found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-            MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+            MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
             if (!found) {
                 /* not found, check network */
                 mpi_errno = MPIDI_Anysource_iprobe_fn(tag, comm, context_offset, &found, status);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 if (!found) {
                     /* still not found, make some progress*/
                     mpi_errno = MPIDI_CH3_Progress_poke();
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     /* check shm again */
-                    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+                    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
                     found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-                    MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+                    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
                     if (!found) {
                         /* check network again */
                         mpi_errno = MPIDI_Anysource_iprobe_fn(tag, comm, context_offset, &found, status);
-                        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     }
                 }
             }
@@ -76,7 +76,7 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
             MPIDI_Comm_get_vc_set_active(comm, source, &vc);
             if (vc->comm_ops && vc->comm_ops->iprobe) {
                 mpi_errno = vc->comm_ops->iprobe(vc, source, tag, comm, context_offset, &found, status);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 *flag = found;
                 goto fn_exit;
             }
@@ -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). */
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
     found = MPIDI_CH3U_Recvq_FU( source, tag, context, status );
-    MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.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();
-	MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+	MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
 	found = MPIDI_CH3U_Recvq_FU( source, tag, context, status );
-	MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
     }
 	
     *flag = found;
diff --git a/src/mpid/ch3/src/mpid_irecv.c b/src/mpid/ch3/src/mpid_irecv.c
index 3c30933..fdf766d 100644
--- a/src/mpid/ch3/src/mpid_irecv.c
+++ b/src/mpid/ch3/src/mpid_irecv.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Irecv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag,
 	       MPID_Comm * comm, int context_offset,
                MPID_Request ** request)
@@ -36,17 +36,17 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
             MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask) &&
             MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask)) {
         MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Comm has been revoked. Returning from MPID_IRECV.");
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
     rreq = MPIDI_CH3U_Recvq_FDU_or_AEP(rank, tag, 
 				       comm->recvcontext_id + context_offset,
                                        comm, buf, count, datatype, &found);
     if (rreq == NULL)
     {
-	MPIU_THREAD_CS_EXIT(MSGQUEUE,);
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomemreq");
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomemreq");
     }
 
     if (found)
@@ -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 */
-	MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
 
 	if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_EAGER_MSG)
 	{
@@ -73,7 +73,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 	    {
 		MPIDI_Comm_get_vc_set_active(comm, rreq->dev.match.parts.rank, &vc);
 		mpi_errno = MPIDI_CH3_EagerSyncAck( vc, rreq );
-		if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+		if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    }
 
             /* the request was found in the unexpected queue, so it has a
@@ -117,7 +117,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 	    MPIDI_Comm_get_vc_set_active(comm, rreq->dev.match.parts.rank, &vc);
 	
 	    mpi_errno = vc->rndvRecv_fn( vc, rreq );
-	    if (mpi_errno) MPIU_ERR_POP( mpi_errno );
+	    if (mpi_errno) MPIR_ERR_POP( mpi_errno );
 	    if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN)
 	    {
 		MPID_Datatype_get_ptr(datatype, rreq->dev.datatype_ptr);
@@ -127,7 +127,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 	else if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_SELF_MSG)
 	{
 	    mpi_errno = MPIDI_CH3_RecvFromSelf( rreq, buf, count, datatype );
-	    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+	    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	}
 	else
 	{
@@ -137,7 +137,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 #endif
             MPID_Request_release(rreq);
 	    rreq = NULL;
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_INTERN, "**ch3|badmsgtype",
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_INTERN, "**ch3|badmsgtype",
                                  "**ch3|badmsgtype %d", msg_type);
 	    /* --END ERROR HANDLING-- */
 	}
@@ -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) */
-	MPIU_THREAD_CS_EXIT(MSGQUEUE,rreq);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
     }
 
   fn_exit:
diff --git a/src/mpid/ch3/src/mpid_irsend.c b/src/mpid/ch3/src/mpid_irsend.c
index 2d7ba63..1dfce62 100644
--- a/src/mpid/ch3/src/mpid_irsend.c
+++ b/src/mpid/ch3/src/mpid_irsend.c
@@ -14,7 +14,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Irsend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
 		MPID_Request ** request)
 {
@@ -42,7 +42,7 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
     if (comm->revoked &&
             MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask) &&
             MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask)) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
     
     if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
@@ -94,15 +94,15 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
 	MPIDI_Pkt_set_seqnum(ready_pkt, seqnum);
 	MPIDI_Request_set_seqnum(sreq, seqnum);
 	
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+	MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
 	mpi_errno = MPIDI_CH3_iSend(vc, sreq, ready_pkt, sizeof(*ready_pkt));
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+	MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 	/* --BEGIN ERROR HANDLING-- */
 	if (mpi_errno != MPI_SUCCESS)
 	{
             MPID_Request_release(sreq);
 	    sreq = NULL;
-            MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
+            MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
 	    goto fn_exit;
 	}
 	/* --END ERROR HANDLING-- */
diff --git a/src/mpid/ch3/src/mpid_isend.c b/src/mpid/ch3/src/mpid_isend.c
index 3ff8cac..345e5cc 100644
--- a/src/mpid/ch3/src/mpid_isend.c
+++ b/src/mpid/ch3/src/mpid_isend.c
@@ -26,7 +26,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Isend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
 	       int tag, MPID_Comm * comm, int context_offset,
                MPID_Request ** request)
@@ -55,7 +55,7 @@ int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
             MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask) &&
             MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask)) {
         MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Communicator revoked. MPID_ISEND returning");
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
     
     if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
@@ -111,15 +111,15 @@ int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
 	MPIDI_Pkt_set_seqnum(eager_pkt, seqnum);
 	MPIDI_Request_set_seqnum(sreq, seqnum);
 	
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+	MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
 	mpi_errno = MPIDI_CH3_iSend(vc, sreq, eager_pkt, sizeof(*eager_pkt));
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+	MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 	/* --BEGIN ERROR HANDLING-- */
 	if (mpi_errno != MPI_SUCCESS)
 	{
             MPID_Request_release(sreq);
 	    sreq = NULL;
-            MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
+            MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
 	    goto fn_exit;
 	}
 	/* --END ERROR HANDLING-- */
diff --git a/src/mpid/ch3/src/mpid_issend.c b/src/mpid/ch3/src/mpid_issend.c
index a275c6f..7454af5 100644
--- a/src/mpid/ch3/src/mpid_issend.c
+++ b/src/mpid/ch3/src/mpid_issend.c
@@ -14,7 +14,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Issend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Issend(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
 		MPID_Request ** request)
 {
@@ -41,7 +41,7 @@ int MPID_Issend(const void * buf, int count, MPI_Datatype datatype, int rank, in
     if (comm->revoked &&
             MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask) &&
             MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask)) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
     
     if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
diff --git a/src/mpid/ch3/src/mpid_mprobe.c b/src/mpid/ch3/src/mpid_mprobe.c
index 550a832..2d7ac25 100644
--- a/src/mpid/ch3/src/mpid_mprobe.c
+++ b/src/mpid/ch3/src/mpid_mprobe.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Mprobe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Mprobe(int source, int tag, MPID_Comm *comm, int context_offset,
                 MPID_Request **message, MPI_Status *status)
 {
@@ -30,7 +30,7 @@ int MPID_Mprobe(int source, int tag, MPID_Comm *comm, int context_offset,
 
     /* Check to make sure the communicator hasn't already been revoked */
     if (comm->revoked) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
 #ifdef ENABLE_COMM_OVERRIDES
@@ -40,20 +40,20 @@ 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 {
-                MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+                MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
                 *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm,&found);
-                MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+                MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
                 if (found) goto fn_exit;
 
                 mpi_errno = MPIDI_Anysource_improbe_fn(tag, comm, context_offset, &found, message, status);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 if (found) goto fn_exit;
 
-                MPIU_THREAD_CS_YIELD(ALLFUNC,);
+                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
                 /* FIXME could this be replaced with a progress_wait? */
                 mpi_errno = MPIDI_CH3_Progress_test();
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             } while (1);
         }
         else {
@@ -66,14 +66,14 @@ int MPID_Mprobe(int source, int tag, MPID_Comm *comm, int context_offset,
                 do {
                     mpi_errno = vc->comm_ops->improbe(vc, source, tag, comm, context_offset, &found,
                                                       message, status);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     if (found) goto fn_exit;
 
-                    MPIU_THREAD_CS_YIELD(ALLFUNC,);
+                    MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
 
                     /* FIXME could this be replaced with a progress_wait? */
                     mpi_errno = MPIDI_CH3_Progress_test();
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 } while (1);
             }
             /* fall-through to shm case */
@@ -93,9 +93,9 @@ int MPID_Mprobe(int source, int tag, MPID_Comm *comm, int context_offset,
     MPIDI_CH3_Progress_start(&progress_state);
     do
     {
-        MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
         *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, &found);
-        MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
         if (found)
             break;
 
@@ -103,7 +103,7 @@ int MPID_Mprobe(int source, int tag, MPID_Comm *comm, int context_offset,
     }
     while(mpi_errno == MPI_SUCCESS);
     MPIDI_CH3_Progress_end(&progress_state);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (*message) {
         (*message)->kind = MPID_REQUEST_MPROBE;
diff --git a/src/mpid/ch3/src/mpid_mrecv.c b/src/mpid/ch3/src/mpid_mrecv.c
index ff5fba8..2aedeac 100644
--- a/src/mpid/ch3/src/mpid_mrecv.c
+++ b/src/mpid/ch3/src/mpid_mrecv.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Imrecv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Mrecv(void *buf, int count, MPI_Datatype datatype,
                MPID_Request *message, MPI_Status *status)
 {
@@ -29,7 +29,7 @@ int MPID_Mrecv(void *buf, int count, MPI_Datatype datatype,
      * creating a request unnecessarily for messages that are already present
      * and eligible for immediate completion. */
     mpi_errno = MPID_Imrecv(buf, count, datatype, message, &rreq);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (!MPID_Request_is_complete(rreq)) {
         MPID_Progress_state progress_state;
@@ -41,14 +41,14 @@ int MPID_Mrecv(void *buf, int count, MPI_Datatype datatype,
             if (mpi_errno) {
                 /* --BEGIN ERROR HANDLING-- */
                 MPID_Progress_end(&progress_state);
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
                 /* --END ERROR HANDLING-- */
             }
         }
         MPID_Progress_end(&progress_state);
     }
     mpi_errno = MPIR_Request_complete(&req_handle, rreq, status, &active_flag);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 fn_exit:
     return mpi_errno;
diff --git a/src/mpid/ch3/src/mpid_port.c b/src/mpid/ch3/src/mpid_port.c
index 2c676e2..ecac7f2 100644
--- a/src/mpid/ch3/src/mpid_port.c
+++ b/src/mpid/ch3/src/mpid_port.c
@@ -40,7 +40,7 @@ static MPIDI_PortFns portFns = { 0, 0, 0, 0 };
 #undef FUNCNAME
 #define FUNCNAME MPID_Open_port
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Open_port(MPID_Info *info_ptr, char *port_name)
 {
     int mpi_errno=MPI_SUCCESS;
@@ -63,11 +63,11 @@ int MPID_Open_port(MPID_Info *info_ptr, char *port_name)
     if (portFns.OpenPort) {
 	mpi_errno = portFns.OpenPort( info_ptr, port_name );
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     }
     else {
-	MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl" );
+	MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl" );
     }
 
  fn_fail:
@@ -91,7 +91,7 @@ Input Parameters:
 #undef FUNCNAME
 #define FUNCNAME MPID_Close_port
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Close_port(const char *port_name)
 {
     int mpi_errno=MPI_SUCCESS;
@@ -112,11 +112,11 @@ int MPID_Close_port(const char *port_name)
     if (portFns.ClosePort) {
 	mpi_errno = portFns.ClosePort( port_name );
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     }
     else {
-	MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl" );
+	MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl" );
     }
 
  fn_fail:	
@@ -127,7 +127,7 @@ int MPID_Close_port(const char *port_name)
 #undef FUNCNAME
 #define FUNCNAME MPID_Comm_accept
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Comm_accept(const char * port_name, MPID_Info * info, int root,
 		     MPID_Comm * comm, MPID_Comm ** newcomm_ptr)
 {
@@ -150,11 +150,11 @@ int MPID_Comm_accept(const char * port_name, MPID_Info * info, int root,
 	mpi_errno = portFns.CommAccept( port_name, info, root, comm, 
 					newcomm_ptr );
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     }
     else {
-	MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl" );
+	MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl" );
     }
 
  fn_fail:
@@ -165,7 +165,7 @@ int MPID_Comm_accept(const char * port_name, MPID_Info * info, int root,
 #undef FUNCNAME
 #define FUNCNAME MPID_Comm_connect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Comm_connect(const char * port_name, MPID_Info * info, int root, 
 		      MPID_Comm * comm, MPID_Comm ** newcomm_ptr)
 {
@@ -188,11 +188,11 @@ int MPID_Comm_connect(const char * port_name, MPID_Info * info, int root,
 	mpi_errno = portFns.CommConnect( port_name, info, root, comm, 
 					 newcomm_ptr );
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     }
     else {
-	MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl" );
+	MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl" );
     }
 
  fn_fail:
@@ -280,7 +280,7 @@ static void free_port_name_tag(int tag)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Open_port
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_Open_port(MPID_Info *info_ptr, char *port_name)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -294,12 +294,12 @@ static int MPIDI_Open_port(MPID_Info *info_ptr, char *port_name)
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_OPEN_PORT);
 
     mpi_errno = get_port_name_tag(&port_name_tag);
-    MPIU_ERR_CHKANDJUMP(mpi_errno,mpi_errno,MPI_ERR_OTHER,"**argstr_port_name_tag");
+    MPIR_ERR_CHKANDJUMP(mpi_errno,mpi_errno,MPI_ERR_OTHER,"**argstr_port_name_tag");
 
     len = MPI_MAX_PORT_NAME;
     str_errno = MPIU_Str_add_int_arg(&port_name, &len,
                                      MPIDI_CH3I_PORT_NAME_TAG_KEY, port_name_tag);
-    MPIU_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**argstr_port_name_tag");
+    MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**argstr_port_name_tag");
 
     /* This works because Get_business_card uses the same MPIU_Str_xxx 
        functions as above to add the business card to the input string */
@@ -325,7 +325,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Close_port
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDI_Close_port(const char *port_name)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -335,7 +335,7 @@ static int MPIDI_Close_port(const char *port_name)
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CLOSE_PORT);
 
     mpi_errno = MPIDI_GetTagFromPort(port_name, &port_name_tag);
-    MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER,"**argstr_port_name_tag");
+    MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER,"**argstr_port_name_tag");
 
     free_port_name_tag(port_name_tag);
 
@@ -357,7 +357,7 @@ int MPIDI_GetTagFromPort( const char *port_name, int *port_name_tag )
 
     str_errno = MPIU_Str_get_int_arg(port_name, MPIDI_CH3I_PORT_NAME_TAG_KEY,
                                      port_name_tag);
-    MPIU_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**argstr_no_port_name_tag");
+    MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**argstr_no_port_name_tag");
 
  fn_exit:
     return mpi_errno;
diff --git a/src/mpid/ch3/src/mpid_probe.c b/src/mpid/ch3/src/mpid_probe.c
index 71bf6dd..853e4da 100644
--- a/src/mpid/ch3/src/mpid_probe.c
+++ b/src/mpid/ch3/src/mpid_probe.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Probe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset, 
 	       MPI_Status * status)
 {
@@ -30,7 +30,7 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
     if (comm->revoked &&
             MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask) &&
             MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask)) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
 #ifdef ENABLE_COMM_OVERRIDES
@@ -42,19 +42,19 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
             do {
                 int found;
                 
-                MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+                MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
                 found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-                MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+                MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
                 if (found) goto fn_exit;
 
                 mpi_errno = MPIDI_Anysource_iprobe_fn(tag, comm, context_offset, &found, status);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 if (found) goto fn_exit;
 
-                MPIU_THREAD_CS_YIELD(ALLFUNC,);
+                MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
                 
                 mpi_errno = MPIDI_CH3_Progress_test();
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             } while (1);
         } else {
             /* it's not anysource, see if this is for the netmod */
@@ -68,13 +68,13 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
                     
                     mpi_errno = vc->comm_ops->iprobe(vc, source, tag, comm, context_offset, &found,
                                                      status);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                     if (found) goto fn_exit;
                     
-                    MPIU_THREAD_CS_YIELD(ALLFUNC,);
+                    MPID_THREAD_CS_YIELD(GLOBAL, MPIR_ThreadInfo.global_mutex);
                     
                     mpi_errno = MPIDI_CH3_Progress_test();
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 } while (1);
             }
             /* fall-through to shm case */
@@ -86,9 +86,9 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
     {
         int found;
 
-        MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+        MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
         found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
-        MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.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 cd19a3a..97b3db1 100644
--- a/src/mpid/ch3/src/mpid_recv.c
+++ b/src/mpid/ch3/src/mpid_recv.c
@@ -9,7 +9,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag,
 	      MPID_Comm * comm, int context_offset,
 	      MPI_Status * status, MPID_Request ** request)
@@ -43,16 +43,16 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
     if (comm->revoked &&
             MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask) &&
             MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask)) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
     rreq = MPIDI_CH3U_Recvq_FDU_or_AEP(rank, tag, 
 				       comm->recvcontext_id + context_offset,
                                        comm, buf, count, datatype, &found);
     if (rreq == NULL) {
-	MPIU_THREAD_CS_EXIT(MSGQUEUE,);
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomemreq");
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomemreq");
     }
 
     if (found)
@@ -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 */
-	MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+	MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
 	if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_EAGER_MSG)
 	{
 	    int recv_pending;
@@ -75,9 +75,9 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 	    if (MPIDI_Request_get_sync_send_flag(rreq))
 	    {
 		MPIDI_Comm_get_vc_set_active(comm, rreq->dev.match.parts.rank, &vc);
-        MPIU_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", rreq->dev.match.parts.rank);
+        MPIR_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", rreq->dev.match.parts.rank);
 		mpi_errno = MPIDI_CH3_EagerSyncAck( vc, rreq );
-		if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+		if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    }
 	    
             /* the request was found in the unexpected queue, so it has a
@@ -127,9 +127,9 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 	else if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_RNDV_MSG)
 	{
 	    MPIDI_Comm_get_vc_set_active(comm, rreq->dev.match.parts.rank, &vc);
-        MPIU_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", rreq->dev.match.parts.rank);
+        MPIR_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", rreq->dev.match.parts.rank);
 	    mpi_errno = vc->rndvRecv_fn( vc, rreq );
-	    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+	    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN)
 	    {
 		MPID_Datatype_get_ptr(datatype, rreq->dev.datatype_ptr);
@@ -139,7 +139,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 	else if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_SELF_MSG)
 	{
 	    mpi_errno = MPIDI_CH3_RecvFromSelf( rreq, buf, count, datatype );
-	    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+	    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    if (status != MPI_STATUS_IGNORE)
 	    {
 		*status = rreq->status;
@@ -153,7 +153,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 #endif
             MPID_Request_release(rreq);
 	    rreq = NULL;
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_INTERN, "**ch3|badmsgtype",
+	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_INTERN, "**ch3|badmsgtype",
                                  "**ch3|badmsgtype %d", msg_type);
 	    /* --END ERROR HANDLING-- */
 	}
@@ -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) */
-	MPIU_THREAD_CS_EXIT(MSGQUEUE,rreq);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
     }
 
   fn_exit:
diff --git a/src/mpid/ch3/src/mpid_rma.c b/src/mpid/ch3/src/mpid_rma.c
index e12b81f..65842c5 100644
--- a/src/mpid/ch3/src/mpid_rma.c
+++ b/src/mpid/ch3/src/mpid_rma.c
@@ -38,8 +38,7 @@ cvars:
 === END_MPI_T_CVAR_INFO_BLOCK ===
 */
 
-
-MPIU_THREADSAFE_INIT_DECL(initRMAoptions);
+static volatile int initRMAoptions = 1;
 
 MPID_Win *MPIDI_RMA_Win_active_list_head = NULL, *MPIDI_RMA_Win_inactive_list_head = NULL;
 
@@ -58,7 +57,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_create(void *base, MPI_Aint size, int disp_unit, MPID_Info * info,
                     MPID_Comm * comm_ptr, MPID_Win ** win_ptr)
 {
@@ -70,19 +69,19 @@ int MPID_Win_create(void *base, MPI_Aint size, int disp_unit, MPID_Info * info,
 
     /* Check to make sure the communicator hasn't already been revoked */
     if (comm_ptr->revoked) {
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPIX_ERR_REVOKED, "**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPIX_ERR_REVOKED, "**revoked");
     }
 
     mpi_errno =
         win_init(size, disp_unit, MPI_WIN_FLAVOR_CREATE, MPI_WIN_UNIFIED, info, comm_ptr, win_ptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     (*win_ptr)->base = base;
 
     mpi_errno = MPIDI_CH3U_Win_fns.create(base, size, disp_unit, info, comm_ptr, win_ptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_WIN_CREATE);
@@ -93,7 +92,7 @@ int MPID_Win_create(void *base, MPI_Aint size, int disp_unit, MPID_Info * info,
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_allocate
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_allocate(MPI_Aint size, int disp_unit, MPID_Info * info,
                       MPID_Comm * comm_ptr, void *baseptr, MPID_Win ** win_ptr)
 {
@@ -106,12 +105,12 @@ int MPID_Win_allocate(MPI_Aint size, int disp_unit, MPID_Info * info,
         win_init(size, disp_unit, MPI_WIN_FLAVOR_ALLOCATE, MPI_WIN_UNIFIED, info, comm_ptr,
                  win_ptr);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
     mpi_errno = MPIDI_CH3U_Win_fns.allocate(size, disp_unit, info, comm_ptr, baseptr, win_ptr);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
   fn_fail:
@@ -123,7 +122,7 @@ int MPID_Win_allocate(MPI_Aint size, int disp_unit, MPID_Info * info,
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_create_dynamic
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_create_dynamic(MPID_Info * info, MPID_Comm * comm_ptr, MPID_Win ** win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -137,13 +136,13 @@ int MPID_Win_create_dynamic(MPID_Info * info, MPID_Comm * comm_ptr, MPID_Win **
                          MPI_WIN_FLAVOR_DYNAMIC, MPI_WIN_UNIFIED, info, comm_ptr, win_ptr);
 
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     (*win_ptr)->base = MPI_BOTTOM;
 
     mpi_errno = MPIDI_CH3U_Win_fns.create_dynamic(info, comm_ptr, win_ptr);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
   fn_fail:
@@ -156,7 +155,7 @@ int MPID_Win_create_dynamic(MPID_Info * info, MPID_Comm * comm_ptr, MPID_Win **
 #undef FUNCNAME
 #define FUNCNAME MPID_Alloc_mem
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void *MPID_Alloc_mem(size_t size, MPID_Info * info_ptr)
 {
     void *ap = NULL;
@@ -174,7 +173,7 @@ void *MPID_Alloc_mem(size_t size, MPID_Info * info_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Free_mem
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Free_mem(void *ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -193,7 +192,7 @@ int MPID_Free_mem(void *ptr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_allocate_shared
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_allocate_shared(MPI_Aint size, int disp_unit, MPID_Info * info, MPID_Comm * comm_ptr,
                              void *base_ptr, MPID_Win ** win_ptr)
 {
@@ -206,12 +205,12 @@ int MPID_Win_allocate_shared(MPI_Aint size, int disp_unit, MPID_Info * info, MPI
     mpi_errno =
         win_init(size, disp_unit, MPI_WIN_FLAVOR_SHARED, MPI_WIN_UNIFIED, info, comm_ptr, win_ptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     mpi_errno =
         MPIDI_CH3U_Win_fns.allocate_shared(size, disp_unit, info, comm_ptr, base_ptr, win_ptr);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
   fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_WIN_ALLOCATE_SHARED);
@@ -221,7 +220,7 @@ int MPID_Win_allocate_shared(MPI_Aint size, int disp_unit, MPID_Info * info, MPI
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_shared_query
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_shared_query(MPID_Win * win, int rank, MPI_Aint * size, int *disp_unit, void *baseptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -232,7 +231,7 @@ int MPID_Win_shared_query(MPID_Win * win, int rank, MPI_Aint * size, int *disp_u
 
     mpi_errno = MPIDI_CH3U_Win_fns.shared_query(win, rank, size, disp_unit, baseptr);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
@@ -245,7 +244,7 @@ int MPID_Win_shared_query(MPID_Win * win, int rank, MPI_Aint * size, int *disp_u
 #undef FUNCNAME
 #define FUNCNAME win_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model, MPID_Info * info,
                     MPID_Comm * comm_ptr, MPID_Win ** win_ptr)
 {
@@ -258,23 +257,23 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
 
     MPIDI_FUNC_ENTER(MPID_STATE_WIN_INIT);
 
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex);
     if (initRMAoptions) {
-        MPIU_THREADSAFE_INIT_BLOCK_BEGIN(initRMAoptions);
 
         MPIDI_CH3_RMA_Init_sync_pvars();
         MPIDI_CH3_RMA_Init_pkthandler_pvars();
 
-        MPIU_THREADSAFE_INIT_CLEAR(initRMAoptions);
-        MPIU_THREADSAFE_INIT_BLOCK_END(initRMAoptions);
+        initRMAoptions = 0;
     }
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
 
     *win_ptr = (MPID_Win *) MPIU_Handle_obj_alloc(&MPID_Win_mem);
-    MPIU_ERR_CHKANDJUMP1(!(*win_ptr), mpi_errno, MPI_ERR_OTHER, "**nomem",
+    MPIR_ERR_CHKANDJUMP1(!(*win_ptr), mpi_errno, MPI_ERR_OTHER, "**nomem",
                          "**nomem %s", "MPID_Win_mem");
 
     mpi_errno = MPIR_Comm_dup_impl(comm_ptr, &win_comm_ptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     MPIU_Object_set_ref(*win_ptr, 1);
 
@@ -320,7 +319,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
     /* Set info_args on window based on info provided by user */
     mpi_errno = MPID_Win_set_info((*win_ptr), info);
     if (mpi_errno != MPI_SUCCESS)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     MPIU_CHKPMEM_MALLOC((*win_ptr)->op_pool_start, MPIDI_RMA_Op_t *,
                         sizeof(MPIDI_RMA_Op_t) * MPIR_CVAR_CH3_RMA_OP_WIN_POOL_SIZE, mpi_errno,
@@ -365,7 +364,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
         mpi_errno = MPID_Progress_register_hook(MPIDI_CH3I_RMA_Make_progress_global,
                                                 &MPIDI_CH3I_RMA_Progress_hook_id);
         if (mpi_errno) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
@@ -376,7 +375,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
             MPIDI_CH3U_Win_hooks.win_init(size, disp_unit, create_flavor, model, info, comm_ptr,
                                           win_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
   fn_exit:
diff --git a/src/mpid/ch3/src/mpid_rsend.c b/src/mpid/ch3/src/mpid_rsend.c
index 01de9d2..3619214 100644
--- a/src/mpid/ch3/src/mpid_rsend.c
+++ b/src/mpid/ch3/src/mpid_rsend.c
@@ -18,7 +18,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Rsend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
 	       MPID_Request ** request)
 {
@@ -44,7 +44,7 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
     if (comm->revoked &&
             MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask) &&
             MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask)) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
     
     if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
@@ -87,9 +87,9 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
 	MPIDI_VC_FAI_send_seqnum(vc, seqnum);
 	MPIDI_Pkt_set_seqnum(ready_pkt, seqnum);
 	
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+	MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
 	mpi_errno = MPIDI_CH3_iStartMsg(vc, ready_pkt, sizeof(*ready_pkt), &sreq);
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+	MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 	/* --BEGIN ERROR HANDLING-- */
 	if (mpi_errno != MPI_SUCCESS)
 	{
diff --git a/src/mpid/ch3/src/mpid_send.c b/src/mpid/ch3/src/mpid_send.c
index de2682c..7b6c2a8 100644
--- a/src/mpid/ch3/src/mpid_send.c
+++ b/src/mpid/ch3/src/mpid_send.c
@@ -14,7 +14,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
 	      int tag, MPID_Comm * comm, int context_offset,
 	      MPID_Request ** request)
@@ -42,7 +42,7 @@ int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
     if (comm->revoked &&
             MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask) &&
             MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask)) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
     if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
@@ -57,12 +57,12 @@ int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
 #       ifndef MPICH_IS_THREADED
 	{
 	    if (sreq != NULL && MPID_cc_get(sreq->cc) != 0) {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
+		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
 				    "**dev|selfsenddeadlock");
 	    }
 	}
 #	endif
-	if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+	if (mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 	goto fn_exit;
     }
 
@@ -72,7 +72,7 @@ int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
     }
 
     MPIDI_Comm_get_vc_set_active(comm, rank, &vc);
-    MPIU_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", rank);
+    MPIR_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", rank);
 
 #ifdef ENABLE_COMM_OVERRIDES
     if (vc->comm_ops && vc->comm_ops->send)
@@ -102,13 +102,13 @@ int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
 	MPIDI_VC_FAI_send_seqnum(vc, seqnum);
 	MPIDI_Pkt_set_seqnum(eager_pkt, seqnum);
 	
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+	MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
 	mpi_errno = MPIDI_CH3_iStartMsg(vc, eager_pkt, sizeof(*eager_pkt), &sreq);
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+	MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
 	/* --BEGIN ERROR HANDLING-- */
 	if (mpi_errno != MPI_SUCCESS)
 	{
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|eagermsg");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|eagermsg");
 	}
 	/* --END ERROR HANDLING-- */
 	if (sreq != NULL)
diff --git a/src/mpid/ch3/src/mpid_ssend.c b/src/mpid/ch3/src/mpid_ssend.c
index 53b8d16..cf3ba5f 100644
--- a/src/mpid/ch3/src/mpid_ssend.c
+++ b/src/mpid/ch3/src/mpid_ssend.c
@@ -14,7 +14,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Ssend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Ssend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
 	       MPID_Request ** request)
 {
@@ -41,7 +41,7 @@ int MPID_Ssend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
     if (comm->revoked &&
             MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask) &&
             MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BITS(tag & ~MPIR_Process.tagged_coll_mask)) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
     if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
diff --git a/src/mpid/ch3/src/mpid_startall.c b/src/mpid/ch3/src/mpid_startall.c
index e6b2efc..cbd1ca4 100644
--- a/src/mpid/ch3/src/mpid_startall.c
+++ b/src/mpid/ch3/src/mpid_startall.c
@@ -51,7 +51,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPID_Startall
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Startall(int count, MPID_Request * requests[])
 {
     int i;
@@ -161,7 +161,7 @@ int MPID_Startall(int count, MPID_Request * requests[])
 #undef FUNCNAME
 #define FUNCNAME MPID_Send_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Send_init(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
 		   MPID_Request ** request)
 {
@@ -191,7 +191,7 @@ int MPID_Send_init(const void * buf, int count, MPI_Datatype datatype, int rank,
 #undef FUNCNAME
 #define FUNCNAME MPID_Ssend_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Ssend_init(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
 		    MPID_Request ** request)
 {
@@ -221,7 +221,7 @@ int MPID_Ssend_init(const void * buf, int count, MPI_Datatype datatype, int rank
 #undef FUNCNAME
 #define FUNCNAME MPID_Rsend_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Rsend_init(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
 		    MPID_Request ** request)
 {
@@ -251,7 +251,7 @@ int MPID_Rsend_init(const void * buf, int count, MPI_Datatype datatype, int rank
 #undef FUNCNAME
 #define FUNCNAME MPID_Bsend_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Bsend_init(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
 		    MPID_Request ** request)
 {
@@ -289,7 +289,7 @@ int MPID_Bsend_init(const void * buf, int count, MPI_Datatype datatype, int rank
 #undef FUNCNAME
 #define FUNCNAME MPID_Recv_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Recv_init(void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
 		   MPID_Request ** request)
 {
diff --git a/src/mpid/ch3/src/mpid_vc.c b/src/mpid/ch3/src/mpid_vc.c
index 3f889c3..9df8ecf 100644
--- a/src/mpid/ch3/src/mpid_vc.c
+++ b/src/mpid/ch3/src/mpid_vc.c
@@ -89,7 +89,7 @@ cvars:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_VCRT_Create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_VCRT_Create(int size, struct MPIDI_VCRT **vcrt_ptr)
 {
     MPIDI_VCRT_t * vcrt;
@@ -128,7 +128,7 @@ int MPIDI_VCRT_Create(int size, struct MPIDI_VCRT **vcrt_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_VCRT_Add_ref
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_VCRT_Add_ref(struct MPIDI_VCRT *vcrt)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_VCRT_ADD_REF);
@@ -151,7 +151,7 @@ int MPIDI_VCRT_Add_ref(struct MPIDI_VCRT *vcrt)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_VCRT_Release
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt, int isDisconnect )
 {
     int in_use;
@@ -267,7 +267,7 @@ int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt, int isDisconnect )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_VCR_Dup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_VCR_Dup(MPIDI_VCR orig_vcr, MPIDI_VCR * new_vcr)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_VCR_DUP);
@@ -299,7 +299,7 @@ int MPIDI_VCR_Dup(MPIDI_VCR orig_vcr, MPIDI_VCR * new_vcr)
 #undef FUNCNAME
 #define FUNCNAME MPID_Comm_get_lpid
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Comm_get_lpid(MPID_Comm *comm_ptr, int idx, int * lpid_ptr, MPIU_BOOL is_remote)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPID_VCR_GET_LPID);
@@ -326,7 +326,7 @@ int MPID_Comm_get_lpid(MPID_Comm *comm_ptr, int idx, int * lpid_ptr, MPIU_BOOL i
 #undef FUNCNAME
 #define FUNCNAME MPID_GPID_GetAllInComm
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size, 
 			    MPID_Gpid local_gpids[], int *singlePG )
 {
@@ -368,7 +368,7 @@ int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
 #undef FUNCNAME
 #define FUNCNAME MPID_GPID_Get
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_GPID_Get( MPID_Comm *comm_ptr, int rank, MPID_Gpid *in_gpid )
 {
     int      pgid;
@@ -393,7 +393,7 @@ int MPID_GPID_Get( MPID_Comm *comm_ptr, int rank, MPID_Gpid *in_gpid )
 #undef FUNCNAME
 #define FUNCNAME MPID_GPID_ToLpidArray
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_GPID_ToLpidArray( int size, MPID_Gpid in_gpid[], int lpid[] )
 {
     int i, mpi_errno = MPI_SUCCESS;
@@ -416,7 +416,7 @@ int MPID_GPID_ToLpidArray( int size, MPID_Gpid in_gpid[], int lpid[] )
 		   regular error code system */
 		/* printf("No matching pg foung for id = %d\n", pgid ); */
 		lpid[i] = -1;
-		MPIU_ERR_SET2(mpi_errno,MPI_ERR_INTERN, "**unknowngpid",
+		MPIR_ERR_SET2(mpi_errno,MPI_ERR_INTERN, "**unknowngpid",
 			      "**unknowngpid %d %d", gpid[0], gpid[1] );
 		return mpi_errno;
 		/* --END ERROR HANDLING-- */
@@ -433,7 +433,7 @@ int MPID_GPID_ToLpidArray( int size, MPID_Gpid in_gpid[], int lpid[] )
 		else {
 		    /* --BEGIN ERROR HANDLING-- */
 		    lpid[i] = -1;
-		    MPIU_ERR_SET2(mpi_errno,MPI_ERR_INTERN, "**unknowngpid",
+		    MPIR_ERR_SET2(mpi_errno,MPI_ERR_INTERN, "**unknowngpid",
 				  "**unknowngpid %d %d", gpid[0], gpid[1] );
 		    return mpi_errno;
 		    /* --END ERROR HANDLING-- */
@@ -461,7 +461,7 @@ int MPID_GPID_ToLpidArray( int size, MPID_Gpid in_gpid[], int lpid[] )
 #undef FUNCNAME
 #define FUNCNAME MPID_Create_intercomm_from_lpids
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Create_intercomm_from_lpids( MPID_Comm *newcomm_ptr,
 			    int size, const int lpids[] )
 {
@@ -497,7 +497,7 @@ int MPID_Create_intercomm_from_lpids( MPID_Comm *newcomm_ptr,
 	    MPIDI_PG_Get_next( &iter, &pg );
 	    do {
 		MPIDI_PG_Get_next( &iter, &pg );
-                MPIU_ERR_CHKINTERNAL(!pg, mpi_errno, "no pg");
+                MPIR_ERR_CHKINTERNAL(!pg, mpi_errno, "no pg");
 		/* FIXME: a quick check on the min/max values of the lpid
 		   for this process group could help speed this search */
 		for (j=0; j<pg->size; j++) {
@@ -544,7 +544,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_PG_ForwardPGInfo
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_PG_ForwardPGInfo( MPID_Comm *peer_ptr, MPID_Comm *comm_ptr, 
 			   int nPGids, const MPID_Gpid in_gpids[],
 			   int root )
@@ -584,8 +584,8 @@ int MPID_PG_ForwardPGInfo( MPID_Comm *peer_ptr, MPID_Comm *comm_ptr,
 
     /* See if everyone is happy */
     mpi_errno = MPIR_Allreduce_impl( MPI_IN_PLACE, &allfound, 1, MPI_INT, MPI_LAND, comm_ptr, &errflag );
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-    MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+    MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
     
     if (allfound) return MPI_SUCCESS;
 
@@ -639,13 +639,13 @@ int MPIDI_VC_Init( MPIDI_VC_t *vc, MPIDI_PG_t *pg, int rank )
 #endif
     /* FIXME: We need a better abstraction for initializing the thread state 
        for an object */
-#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
+#if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT
     {
         int err;
         MPID_Thread_mutex_create(&vc->pobj_mutex,&err);
         MPIU_Assert(err == 0);
     }
-#endif /* MPIU_THREAD_GRANULARITY */
+#endif /* MPICH_THREAD_GRANULARITY */
     MPIDI_CH3_VC_Init(vc);
     MPIDI_DBG_PrintVCState(vc);
 
@@ -662,7 +662,7 @@ char MPIU_hostname[MAX_HOSTNAME_LEN] = "_UNKNOWN_"; /* '_' is an illegal char fo
 #undef FUNCNAME
 #define FUNCNAME MPID_Get_node_id
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Get_node_id(MPID_Comm *comm, int rank, MPID_Node_id_t *id_p)
 {
     *id_p = comm->dev.vcrt->vcr_table[rank]->node_id;
@@ -672,7 +672,7 @@ int MPID_Get_node_id(MPID_Comm *comm, int rank, MPID_Node_id_t *id_p)
 #undef FUNCNAME
 #define FUNCNAME MPID_Get_max_node_id
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* Providing a comm argument permits optimization, but this function is always
    allowed to return the max for the universe. */
 int MPID_Get_max_node_id(MPID_Comm *comm, MPID_Node_id_t *max_id_p)
@@ -697,17 +697,17 @@ static int publish_node_id(MPIDI_PG_t *pg, int our_pg_rank)
 
     /* set MPIU_hostname */
     ret = gethostname(MPIU_hostname, MAX_HOSTNAME_LEN);
-    MPIU_ERR_CHKANDJUMP2(ret == -1, mpi_errno, MPI_ERR_OTHER, "**sock_gethost", "**sock_gethost %s %d", MPIU_Strerror(errno), errno);
+    MPIR_ERR_CHKANDJUMP2(ret == -1, mpi_errno, MPI_ERR_OTHER, "**sock_gethost", "**sock_gethost %s %d", MPIU_Strerror(errno), errno);
     MPIU_hostname[MAX_HOSTNAME_LEN-1] = '\0';
 
     /* Allocate space for pmi key */
     pmi_errno = PMI_KVS_Get_key_length_max(&key_max_sz);
-    MPIU_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
+    MPIR_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
 
     MPIU_CHKLMEM_MALLOC(key, char *, key_max_sz, mpi_errno, "key");
 
     mpi_errno = MPIDI_PG_GetConnKVSname(&kvs_name);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Put my hostname id */
     if (pg->size > 1)
@@ -716,13 +716,13 @@ static int publish_node_id(MPIDI_PG_t *pg, int our_pg_rank)
         MPL_snprintf(key, key_max_sz, "hostname[%d]", our_pg_rank);
 
         pmi_errno = PMI_KVS_Put(kvs_name, key, MPIU_hostname);
-        MPIU_ERR_CHKANDJUMP1(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_put", "**pmi_kvs_put %d", pmi_errno);
+        MPIR_ERR_CHKANDJUMP1(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_put", "**pmi_kvs_put %d", pmi_errno);
 
         pmi_errno = PMI_KVS_Commit(kvs_name);
-        MPIU_ERR_CHKANDJUMP1(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_commit", "**pmi_kvs_commit %d", pmi_errno);
+        MPIR_ERR_CHKANDJUMP1(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_commit", "**pmi_kvs_commit %d", pmi_errno);
 
         pmi_errno = PMI_Barrier();
-        MPIU_ERR_CHKANDJUMP1(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_barrier", "**pmi_barrier %d", pmi_errno);
+        MPIR_ERR_CHKANDJUMP1(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_barrier", "**pmi_barrier %d", pmi_errno);
     }
     
 fn_exit:
@@ -734,7 +734,7 @@ fn_fail:
 #endif
 
 
-#define parse_error() MPIU_ERR_INTERNALANDJUMP(mpi_errno, "parse error")
+#define parse_error() MPIR_ERR_INTERNALANDJUMP(mpi_errno, "parse error")
 /* advance _c until we find a non whitespace character */
 #define skip_space(_c) while (isspace(*(_c))) ++(_c)
 /* return true iff _c points to a character valid as an indentifier, i.e., [-_a-zA-Z0-9] */
@@ -764,7 +764,7 @@ typedef struct map_block
 #undef FUNCNAME
 #define FUNCNAME parse_mapping
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int parse_mapping(char *map_str, mapping_type_t *type, map_block_t **map, int *nblocks)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -940,7 +940,7 @@ static int compare_ints(const void *orig_x, const void *orig_y)
 #undef FUNCNAME
 #define FUNCNAME populate_ids_from_mapping
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int populate_ids_from_mapping(char *mapping, int *num_nodes, MPIDI_PG_t *pg, int *did_map)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -957,10 +957,10 @@ static int populate_ids_from_mapping(char *mapping, int *num_nodes, MPIDI_PG_t *
     *did_map = 1; /* reset upon failure */
 
     mpi_errno = parse_mapping(mapping, &mt, &mb, &nblocks);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (NULL_MAPPING == mt) goto fn_fail;
-    MPIU_ERR_CHKINTERNAL(mt != VECTOR_MAPPING, mpi_errno, "unsupported mapping type");
+    MPIR_ERR_CHKINTERNAL(mt != VECTOR_MAPPING, mpi_errno, "unsupported mapping type");
 
     /* allocate nodes to ranks */
     found_wrap = 0;
@@ -1065,7 +1065,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Populate_vc_node_ids
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_Populate_vc_node_ids(MPIDI_PG_t *pg, int our_pg_rank)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1131,12 +1131,12 @@ int MPIDI_Populate_vc_node_ids(MPIDI_PG_t *pg, int our_pg_rank)
         int num_nodes = 0;
 
         mpi_errno = PMI2_Info_GetJobAttr("PMI_process_mapping", process_mapping, sizeof(process_mapping), &found);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKINTERNAL(!found, mpi_errno, "PMI_process_mapping attribute not found");
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKINTERNAL(!found, mpi_errno, "PMI_process_mapping attribute not found");
         /* this code currently assumes pg is comm_world */
         mpi_errno = populate_ids_from_mapping(process_mapping, &num_nodes, pg, &did_map);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKINTERNAL(!did_map, mpi_errno, "unable to populate node ids from PMI_process_mapping");
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        MPIR_ERR_CHKINTERNAL(!did_map, mpi_errno, "unable to populate node ids from PMI_process_mapping");
         g_num_nodes = num_nodes;
     }
 #else /* USE_PMI2_API */
@@ -1148,15 +1148,15 @@ int MPIDI_Populate_vc_node_ids(MPIDI_PG_t *pg, int our_pg_rank)
 
     /* Allocate space for pmi key and value */
     pmi_errno = PMI_KVS_Get_key_length_max(&key_max_sz);
-    MPIU_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
+    MPIR_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
     MPIU_CHKLMEM_MALLOC(key, char *, key_max_sz, mpi_errno, "key");
 
     pmi_errno = PMI_KVS_Get_value_length_max(&val_max_sz);
-    MPIU_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
+    MPIR_ERR_CHKANDJUMP1(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %d", pmi_errno);
     MPIU_CHKLMEM_MALLOC(value, char *, val_max_sz, mpi_errno, "value");
 
     mpi_errno = MPIDI_PG_GetConnKVSname(&kvs_name);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* See if process manager supports PMI_process_mapping keyval */
 
@@ -1167,7 +1167,7 @@ int MPIDI_Populate_vc_node_ids(MPIDI_PG_t *pg, int our_pg_rank)
             int num_nodes = 0;
             /* this code currently assumes pg is comm_world */
             mpi_errno = populate_ids_from_mapping(value, &num_nodes, pg, &did_map);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             g_num_nodes = num_nodes;
             if (did_map) {
                 goto odd_even_cliques;
@@ -1183,7 +1183,7 @@ int MPIDI_Populate_vc_node_ids(MPIDI_PG_t *pg, int our_pg_rank)
     }
 
     mpi_errno = publish_node_id(pg, our_pg_rank);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* Allocate temporary structures.  These would need to be persistent if
        we somehow were able to support dynamic processes via this method. */
@@ -1213,7 +1213,7 @@ int MPIDI_Populate_vc_node_ids(MPIDI_PG_t *pg, int our_pg_rank)
             MPL_snprintf(key, key_max_sz, "hostname[%d]", i);
 
             pmi_errno = PMI_KVS_Get(kvs_name, key, node_names[g_num_nodes], key_max_sz);
-            MPIU_ERR_CHKANDJUMP1(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get", "**pmi_kvs_get %d", pmi_errno);
+            MPIR_ERR_CHKANDJUMP1(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get", "**pmi_kvs_get %d", pmi_errno);
         }
 
         /* Find the node_id for this process, or create a new one */
diff --git a/src/mpid/ch3/src/mpidi_isend_self.c b/src/mpid/ch3/src/mpidi_isend_self.c
index 93e7aa4..847abfe 100644
--- a/src/mpid/ch3/src/mpidi_isend_self.c
+++ b/src/mpid/ch3/src/mpidi_isend_self.c
@@ -15,7 +15,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Isend_self
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
 		     int type, MPID_Request ** request)
 {
@@ -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;
 
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.msgq_mutex);
 
     rreq = MPIDI_CH3U_Recvq_FDP_or_AEU(&match, &found);
     /* --BEGIN ERROR HANDLING-- */
@@ -52,7 +52,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
         MPID_Request_release(sreq);
         MPID_Request_release(sreq);
 	sreq = NULL;
-        MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem", 
+        MPIR_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem", 
 		      "**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
 	goto fn_exit;
     }
@@ -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 */
-        MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.msgq_mutex);
 
 	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
 		     "found posted receive request; copying data");
@@ -95,12 +95,12 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
 	MPIR_STATUS_SET_COUNT(rreq->status, data_sz);
         mpi_errno = MPID_Request_complete(rreq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
 
         mpi_errno = MPID_Request_complete(sreq);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
     else
@@ -139,7 +139,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
 	    /* sreq has never been seen by the user or outside this thread, so it is safe to reset ref_count and cc */
             mpi_errno = MPID_Request_complete(sreq);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
 	    /* --END ERROR HANDLING-- */
 	}
@@ -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 */
-        MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+        MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.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 e58cc15..3e769f7 100644
--- a/src/mpid/ch3/src/mpidi_pg.c
+++ b/src/mpid/ch3/src/mpidi_pg.c
@@ -33,7 +33,7 @@ static MPIDI_PG_t *pg_world = NULL;
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_Init(int *argc_p, char ***argv_p, 
 		  MPIDI_PG_Compare_ids_fn_t compare_ids_fn, 
 		  MPIDI_PG_Destroy_fn_t destroy_fn)
@@ -73,7 +73,7 @@ int MPIDI_PG_Init(int *argc_p, char ***argv_p,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@ 
    MPIDI_PG_Finalize - Finalize the process groups, including freeing all
    process group structures
@@ -96,12 +96,12 @@ int MPIDI_PG_Finalize(void)
     if (pg_world->connData) {
 #ifdef USE_PMI2_API
         mpi_errno = PMI2_Finalize();
-        if (mpi_errno) MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**ch3|pmi_finalize");
+        if (mpi_errno) MPIR_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**ch3|pmi_finalize");
 #else
 	int rc;
 	rc = PMI_Finalize();
 	if (rc) {
-	    MPIU_ERR_SET1(mpi_errno,MPI_ERR_OTHER, 
+	    MPIR_ERR_SET1(mpi_errno,MPI_ERR_OTHER, 
 			  "**ch3|pmi_finalize", 
 			  "**ch3|pmi_finalize %d", rc);
 	}
@@ -173,7 +173,7 @@ int MPIDI_PG_Finalize(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_Create(int vct_sz, void * pg_id, MPIDI_PG_t ** pg_ptr)
 {
     MPIDI_PG_t * pg = NULL, *pgnext;
@@ -262,7 +262,7 @@ int MPIDI_PG_Create(int vct_sz, void * pg_id, MPIDI_PG_t ** pg_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
 {
     MPIDI_PG_t * pg_prev;
@@ -319,7 +319,7 @@ int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
 		   and can thus free unused (or idle) VCs, it should be allowed
 		   to do so.  [wdg 2008-08-31] */
                 mpi_errno = MPIDI_CH3_VC_Destroy(&(pg->vct[i]));
-                if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
             }
 
 	    MPIDI_PG_Destroy_fn(pg);
@@ -343,7 +343,7 @@ int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
     }
 
     /* PG not found if we got here */
-    MPIU_ERR_SET1(mpi_errno,MPI_ERR_OTHER,
+    MPIR_ERR_SET1(mpi_errno,MPI_ERR_OTHER,
 		  "**dev|pg_not_found", "**dev|pg_not_found %p", pg);
 
   fn_exit:
@@ -356,7 +356,7 @@ int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Find
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_Find(void * id, MPIDI_PG_t ** pg_ptr)
 {
     MPIDI_PG_t * pg;
@@ -388,7 +388,7 @@ int MPIDI_PG_Find(void * id, MPIDI_PG_t ** pg_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Id_compare
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_Id_compare(void * id1, void *id2)
 {
     return MPIDI_PG_Compare_ids_fn(id1, id2);
@@ -398,7 +398,7 @@ int MPIDI_PG_Id_compare(void * id1, void *id2)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Get_next
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_Get_next(MPIDI_PG_iterator *iter, MPIDI_PG_t ** pg_ptr)
 {
     *pg_ptr = (*iter);
@@ -412,7 +412,7 @@ int MPIDI_PG_Get_next(MPIDI_PG_iterator *iter, MPIDI_PG_t ** pg_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Has_next
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_Has_next(MPIDI_PG_iterator *iter)
 {
     return (*iter != NULL);
@@ -421,7 +421,7 @@ int MPIDI_PG_Has_next(MPIDI_PG_iterator *iter)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Get_iterator
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_Get_iterator(MPIDI_PG_iterator *iter)
 {
     *iter = MPIDI_PG_list;
@@ -440,7 +440,7 @@ int MPIDI_PG_Get_iterator(MPIDI_PG_iterator *iter)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_To_string
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_To_string(MPIDI_PG_t *pg_ptr, char **str_ptr, int *lenStr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -453,7 +453,7 @@ int MPIDI_PG_To_string(MPIDI_PG_t *pg_ptr, char **str_ptr, int *lenStr)
 	(*pg_ptr->connInfoToString)( str_ptr, lenStr, pg_ptr );
     }
     else {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,"**noConnInfoToString");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,"**noConnInfoToString");
     }
 
     /*printf( "PgToString: Pg string is %s\n", *str_ptr ); fflush(stdout);*/
@@ -475,7 +475,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Create_from_string
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_Create_from_string(const char * str, MPIDI_PG_t ** pg_pptr, 
 				int *flag)
 {
@@ -493,7 +493,7 @@ int MPIDI_PG_Create_from_string(const char * str, MPIDI_PG_t ** pg_pptr,
        it to the find routine */
     /* printf( "Looking for pg with id %s\n", str );fflush(stdout); */
     mpi_errno = MPIDI_PG_Find((void *)str, &existing_pg);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (existing_pg != NULL) {
 	/* return the existing PG */
@@ -511,7 +511,7 @@ int MPIDI_PG_Create_from_string(const char * str, MPIDI_PG_t ** pg_pptr,
 
     mpi_errno = MPIDI_PG_Create(vct_sz, (void *)str, pg_pptr);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
     
     pg_ptr = *pg_pptr;
@@ -584,7 +584,7 @@ void MPIDI_PG_IdToNum( MPIDI_PG_t *pg, int *id )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_SetConnInfo
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_SetConnInfo( int rank, const char *connString )
 {
 #ifdef USE_PMI2_API
@@ -596,13 +596,13 @@ int MPIDI_PG_SetConnInfo( int rank, const char *connString )
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_PG_SetConnInfo);
 
     len = MPL_snprintf(key, sizeof(key), "P%d-businesscard", rank);
-    MPIU_ERR_CHKANDJUMP1(len < 0 || len > sizeof(key), mpi_errno, MPI_ERR_OTHER, "**snprintf", "**snprintf %d", len);
+    MPIR_ERR_CHKANDJUMP1(len < 0 || len > sizeof(key), mpi_errno, MPI_ERR_OTHER, "**snprintf", "**snprintf %d", len);
 
     mpi_errno = PMI2_KVS_Put(key, connString);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     mpi_errno = PMI2_KVS_Fence();
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_PG_SetConnInfo);
@@ -622,23 +622,23 @@ int MPIDI_PG_SetConnInfo( int rank, const char *connString )
     
     len = MPL_snprintf(key, sizeof(key), "P%d-businesscard", rank);
     if (len < 0 || len > sizeof(key)) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**snprintf",
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**snprintf",
 			     "**snprintf %d", len);
     }
     pmi_errno = PMI_KVS_Put(pg_world->connData, key, connString );
     if (pmi_errno != PMI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_kvs_put",
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_kvs_put",
 			     "**pmi_kvs_put %d", pmi_errno);
     }
     pmi_errno = PMI_KVS_Commit(pg_world->connData);
     if (pmi_errno != PMI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_kvs_commit",
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_kvs_commit",
 			     "**pmi_kvs_commit %d", pmi_errno);
     }
     
     pmi_errno = PMI_Barrier();
     if (pmi_errno != PMI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_barrier",
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**pmi_barrier",
 			     "**pmi_barrier %d", pmi_errno);
     }
  fn_exit:
@@ -674,7 +674,7 @@ int MPIDI_PG_SetConnInfo( int rank, const char *connString )
 #undef FUNCNAME
 #define FUNCNAME getConnInfoKVS
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int getConnInfoKVS( int rank, char *buf, int bufsize, MPIDI_PG_t *pg )
 {
 #ifdef USE_PMI2_API
@@ -684,14 +684,14 @@ static int getConnInfoKVS( int rank, char *buf, int bufsize, MPIDI_PG_t *pg )
 
     rc = MPL_snprintf(key, MPIDI_MAX_KVS_KEY_LEN, "P%d-businesscard", rank );
     if (rc < 0 || rc > MPIDI_MAX_KVS_KEY_LEN) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
     }
 
     mpi_errno = PMI2_KVS_Get(pg->connData, PMI2_ID_NULL, key, buf, bufsize, &vallen);
     if (mpi_errno) {
 	MPIDI_PG_CheckForSingleton();
 	mpi_errno = PMI2_KVS_Get(pg->connData, PMI2_ID_NULL, key, buf, bufsize, &vallen);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
  fn_exit:
     return mpi_errno;
@@ -703,18 +703,18 @@ static int getConnInfoKVS( int rank, char *buf, int bufsize, MPIDI_PG_t *pg )
 
     rc = MPL_snprintf(key, MPIDI_MAX_KVS_KEY_LEN, "P%d-businesscard", rank );
     if (rc < 0 || rc > MPIDI_MAX_KVS_KEY_LEN) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
     }
 
-    MPIU_THREAD_CS_ENTER(PMI,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.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 );
     }
-    MPIU_THREAD_CS_EXIT(PMI,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.pmi_mutex);
     if (pmi_errno) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**pmi_kvs_get");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**pmi_kvs_get");
     }
 
  fn_exit:
@@ -785,7 +785,7 @@ static int connToStringKVS( char **buf_p, int *slen, MPIDI_PG_t *pg )
             curSlen += (pg->size - i) * (vallen + 1 );
 	    nstring = MPIU_Realloc( string, curSlen );
 	    if (!nstring) {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	    }
 	    string = nstring;
 	}
@@ -823,7 +823,7 @@ static int connFreeKVS( MPIDI_PG_t *pg )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_InitConnKVS
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_InitConnKVS( MPIDI_PG_t *pg )
 {
 #ifdef USE_PMI2_API
@@ -831,30 +831,30 @@ int MPIDI_PG_InitConnKVS( MPIDI_PG_t *pg )
     
     pg->connData = (char *)MPIU_Malloc(MAX_JOBID_LEN);
     if (pg->connData == NULL) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**nomem");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**nomem");
     }
     
     mpi_errno = PMI2_Job_GetId(pg->connData, MAX_JOBID_LEN);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 #else
     int pmi_errno, kvs_name_sz;
     int mpi_errno = MPI_SUCCESS;
 
     pmi_errno = PMI_KVS_Get_name_length_max( &kvs_name_sz );
     if (pmi_errno != PMI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, 
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, 
 			     "**pmi_kvs_get_name_length_max", 
 			     "**pmi_kvs_get_name_length_max %d", pmi_errno);
     }
     
     pg->connData = (char *)MPIU_Malloc(kvs_name_sz + 1);
     if (pg->connData == NULL) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**nomem");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**nomem");
     }
     
     pmi_errno = PMI_KVS_Get_my_name(pg->connData, kvs_name_sz);
     if (pmi_errno != PMI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, 
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, 
 			     "**pmi_kvs_get_my_name", 
 			     "**pmi_kvs_get_my_name %d", pmi_errno);
     }
@@ -912,7 +912,7 @@ static int getConnInfo( int rank, char *buf, int bufsize, MPIDI_PG_t *pg )
 #undef FUNCNAME
 #define FUNCNAME connToString
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int connToString( char **buf_p, int *slen, MPIDI_PG_t *pg )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -960,7 +960,7 @@ static int connToString( char **buf_p, int *slen, MPIDI_PG_t *pg )
     if (len > connInfo->toStringLen) {
 	*buf_p = 0;
 	*slen  = 0;
-        MPIU_ERR_INTERNALANDJUMP(mpi_errno, "len > connInfo->toStringLen");
+        MPIR_ERR_INTERNALANDJUMP(mpi_errno, "len > connInfo->toStringLen");
     }
 
     *buf_p = str;
@@ -1089,7 +1089,7 @@ int MPIDI_PG_InitConnString( MPIDI_PG_t *pg )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_GetConnString
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_PG_GetConnString( MPIDI_PG_t *pg, int rank, char *val, int vallen )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1108,7 +1108,7 @@ int MPIDI_PG_GetConnString( MPIDI_PG_t *pg, int rank, char *val, int vallen )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Dup_vcr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
   MPIDI_PG_Dup_vcr - Duplicate a virtual connection from a process group
 
@@ -1152,7 +1152,7 @@ int MPIDI_PG_Dup_vcr( MPIDI_PG_t *pg, int rank, MPIDI_VC_t **vc_p )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_PG_Close_VCs
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /*@
   MPIDI_PG_Close_VCs - Close all virtual connections on all process groups.
   
@@ -1196,7 +1196,7 @@ int MPIDI_PG_Close_VCs( void )
 	    if (vc->state == MPIDI_VC_STATE_ACTIVE ||
 		vc->state == MPIDI_VC_STATE_REMOTE_CLOSE) {
 		mpi_errno = MPIDI_CH3U_VC_SendClose( vc, i );
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    } else if (vc->state == MPIDI_VC_STATE_INACTIVE ||
                        vc->state == MPIDI_VC_STATE_MORIBUND) {
                 /* XXX DJG FIXME-MT should we be checking this? */
diff --git a/src/mpid/ch3/src/mpidi_rma.c b/src/mpid/ch3/src/mpidi_rma.c
index 43f4948..941eb6e 100644
--- a/src/mpid/ch3/src/mpidi_rma.c
+++ b/src/mpid/ch3/src/mpidi_rma.c
@@ -85,7 +85,7 @@ MPIDI_RMA_Target_t *global_rma_target_pool_head = NULL, *global_rma_target_pool_
 #undef FUNCNAME
 #define FUNCNAME MPIDI_RMA_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_RMA_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -125,7 +125,7 @@ int MPIDI_RMA_init(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_RMA_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDI_RMA_finalize(void)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_RMA_FINALIZE);
@@ -142,7 +142,7 @@ void MPIDI_RMA_finalize(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_Win_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Win_free(MPID_Win ** win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -153,7 +153,7 @@ int MPID_Win_free(MPID_Win ** win_ptr)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_FREE);
 
-    MPIU_ERR_CHKANDJUMP(((*win_ptr)->states.access_state != MPIDI_RMA_NONE &&
+    MPIR_ERR_CHKANDJUMP(((*win_ptr)->states.access_state != MPIDI_RMA_NONE &&
                          (*win_ptr)->states.access_state != MPIDI_RMA_FENCE_ISSUED &&
                          (*win_ptr)->states.access_state != MPIDI_RMA_FENCE_GRANTED) ||
                         ((*win_ptr)->states.exposure_state != MPIDI_RMA_NONE),
@@ -175,18 +175,18 @@ int MPID_Win_free(MPID_Win ** win_ptr)
            (*win_ptr)->current_target_lock_data_bytes != 0 || (*win_ptr)->sync_request_cnt != 0) {
         mpi_errno = wait_progress_engine();
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     mpi_errno = MPIR_Barrier_impl((*win_ptr)->comm_ptr, &errflag);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     /* Free window resources in lower layer. */
     if (MPIDI_CH3U_Win_hooks.win_free != NULL) {
         mpi_errno = MPIDI_CH3U_Win_hooks.win_free(win_ptr);
         if (mpi_errno != MPI_SUCCESS)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
 
     /* dequeue window from the global list */
@@ -197,14 +197,14 @@ int MPID_Win_free(MPID_Win ** win_ptr)
         /* this is the last window, de-register RMA progress hook */
         mpi_errno = MPID_Progress_deregister_hook(MPIDI_CH3I_RMA_Progress_hook_id);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
         }
     }
 
     comm_ptr = (*win_ptr)->comm_ptr;
     mpi_errno = MPIR_Comm_free_impl(comm_ptr);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if ((*win_ptr)->basic_info_table != NULL)
         MPIU_Free((*win_ptr)->basic_info_table);
diff --git a/src/mpid/ch3/util/ftb/ftb.c b/src/mpid/ch3/util/ftb/ftb.c
index ecf4e16..e7b4ed8 100644
--- a/src/mpid/ch3/util/ftb/ftb.c
+++ b/src/mpid/ch3/util/ftb/ftb.c
@@ -31,7 +31,7 @@ static FTB_event_info_t event_info[] = {
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Ftb_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Ftb_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -48,17 +48,17 @@ int MPIDU_Ftb_init(void)
     
 #ifdef USE_PMI2_API
     ret = PMI2_Job_GetId(ci.client_jobid, sizeof(ci.client_jobid));
-    MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**pmi_jobgetid");
+    MPIR_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**pmi_jobgetid");
 #else
     ret = PMI_KVS_Get_my_name(ci.client_jobid, sizeof(ci.client_jobid));
-    MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**pmi_get_id");
+    MPIR_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**pmi_get_id");
 #endif
     
     ret = FTB_Connect(&ci, &client_handle);
-    MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ftb_connect");
+    MPIR_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ftb_connect");
 
     ret = FTB_Declare_publishable_events(client_handle, NULL, event_info, sizeof(event_info) / sizeof(event_info[0]));
-    MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ftb_declare_publishable_events");
+    MPIR_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ftb_declare_publishable_events");
 
 fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_FTB_INIT);
@@ -75,7 +75,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Ftb_publish
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDU_Ftb_publish(const char *event_name, const char *event_payload)
 {
     FTB_event_properties_t event_prop;
@@ -97,7 +97,7 @@ void MPIDU_Ftb_publish(const char *event_name, const char *event_payload)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Ftb_publish_vc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDU_Ftb_publish_vc(const char *event_name, struct MPIDI_VC *vc)
 {
     char payload[FTB_MAX_PAYLOAD_DATA] = "";
@@ -112,7 +112,7 @@ void MPIDU_Ftb_publish_vc(const char *event_name, struct MPIDI_VC *vc)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Ftb_publish_me
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDU_Ftb_publish_me(const char *event_name)
 {
     char payload[FTB_MAX_PAYLOAD_DATA] = "";
@@ -129,7 +129,7 @@ void MPIDU_Ftb_publish_me(const char *event_name)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Ftb_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDU_Ftb_finalize(void)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPIDU_FTB_FINALIZE);
diff --git a/src/mpid/ch3/util/sock/ch3u_connect_sock.c b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
index 89835b3..fd51607 100644
--- a/src/mpid/ch3/util/sock/ch3u_connect_sock.c
+++ b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
@@ -93,7 +93,7 @@ extern MPIDU_Sock_set_t MPIDI_CH3I_sock_set;
 #undef FUNCNAME
 #define FUNCNAME MPIDU_CH3I_SetupListener
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_CH3I_SetupListener( MPIDU_Sock_set_t sock_set )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -127,7 +127,7 @@ int MPIDU_CH3I_SetupListener( MPIDU_Sock_set_t sock_set )
 #undef FUNCNAME
 #define FUNCNAME MPIDU_CH3I_ShutdownListener
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_CH3I_ShutdownListener( void )
 {
     int mpi_errno;
@@ -158,7 +158,7 @@ int MPIDU_CH3I_ShutdownListener( void )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Connection_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Connection_alloc(MPIDI_CH3I_Connection_t ** connp)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -180,7 +180,7 @@ int MPIDI_CH3I_Connection_alloc(MPIDI_CH3I_Connection_t ** connp)
     id_sz = MPID_MAX_JOBID_LEN;
 #else
     pmi_errno = PMI_KVS_Get_name_length_max(&id_sz);
-    MPIU_ERR_CHKANDJUMP1(pmi_errno, mpi_errno,MPI_ERR_OTHER, 
+    MPIR_ERR_CHKANDJUMP1(pmi_errno, mpi_errno,MPI_ERR_OTHER, 
 			     "**pmi_get_id_length_max",
 			     "**pmi_get_id_length_max %d", pmi_errno);
 #endif
@@ -204,7 +204,7 @@ int MPIDI_CH3I_Connection_alloc(MPIDI_CH3I_Connection_t ** connp)
 #undef FUNCNAME
 #define FUNCNAME  MPIDI_CH3I_Connect_to_root_sock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Connect_to_root_sock(const char * port_name, 
 				    MPIDI_VC_t ** new_vc)
 {
@@ -240,18 +240,18 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
 						 sizeof(host_description),
 						 &port, &ifaddr, &hasIfaddr );
     if (mpi_errno) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
     mpi_errno = MPIDI_GetTagFromPort(port_name, &port_name_tag);
     if (mpi_errno != MPIU_STR_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_port_name_tag");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_port_name_tag");
     }
 
     MPIU_DBG_MSG_D(CH3_CONNECT,VERBOSE,"port tag %d",port_name_tag);
 
     mpi_errno = MPIDI_CH3I_Connection_alloc(&conn);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     /* conn->pg_id is not used for this conection */
@@ -301,7 +301,7 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
         }
         else
         {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     	vcch = &vc->ch;
         vcch->state = MPIDI_CH3I_VC_STATE_FAILED;
@@ -331,7 +331,7 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_get_conninfo_from_bc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_get_conninfo_from_bc( const char *bc, 
 				     char *host_description, int maxlen,
 				     int *port, MPIDU_Sock_ifaddr_t *ifaddr, 
@@ -351,11 +351,11 @@ int MPIDU_Sock_get_conninfo_from_bc( const char *bc,
     if (str_errno != MPIU_STR_SUCCESS) {
 	/* --BEGIN ERROR HANDLING */
 	if (str_errno == MPIU_STR_FAIL) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**argstr_missinghost");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**argstr_missinghost");
 	}
 	else {
 	    /* MPIU_STR_TRUNCATED or MPIU_STR_NONEM */
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_hostd");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_hostd");
 	}
 	/* --END ERROR HANDLING-- */
     }
@@ -363,11 +363,11 @@ int MPIDU_Sock_get_conninfo_from_bc( const char *bc,
     if (str_errno != MPIU_STR_SUCCESS) {
 	/* --BEGIN ERROR HANDLING */
 	if (str_errno == MPIU_STR_FAIL) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_missingport");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_missingport");
 	}
 	else {
 	    /* MPIU_STR_TRUNCATED or MPIU_STR_NONEM */
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_port");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_port");
 	}
 	/* --END ERROR HANDLING-- */
     }
@@ -390,11 +390,11 @@ int MPIDU_Sock_get_conninfo_from_bc( const char *bc,
 	
 	int rc = inet_pton( AF_INET, (const char *)ifname, ifaddr->ifaddr );
 	if (rc == 0) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ifnameinvalid");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ifnameinvalid");
 	}
 	else if (rc < 0) {
 	    /* af_inet not supported */
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**afinetinvalid");
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**afinetinvalid");
 	}
 	else {
 	    /* Success */
@@ -427,7 +427,7 @@ int MPIDU_Sock_get_conninfo_from_bc( const char *bc,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Get_business_card_sock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Get_business_card_sock(int myRank, 
 				      char **bc_val_p, int *val_max_sz_p)
 {
@@ -445,15 +445,15 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
     str_errno = MPIU_Str_add_int_arg(bc_val_p, val_max_sz_p,
                                      MPIDI_CH3I_PORT_KEY, MPIDI_CH3I_listener_port);
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
     
     str_errno = MPIU_Str_add_string_arg(bc_val_p, val_max_sz_p,
                                         MPIDI_CH3I_HOST_DESCRIPTION_KEY, ifnamestr );
     if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
 
     /* Look up the interface address cooresponding to this host description */
@@ -487,8 +487,8 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 						 MPIDI_CH3I_IFNAME_KEY,
 						 ifname );
             if (str_errno) {
-                MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+                MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
             }
 	}
     }
@@ -508,8 +508,8 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 						 MPIDI_CH3I_IFNAME_KEY,
 						 ifname );
             if (str_errno) {
-                MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+                MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
             }
 	}
     }
@@ -539,7 +539,7 @@ static void connection_destroy(MPIDI_CH3I_Connection_t * conn);
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Sockconn_handle_accept_event
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Sockconn_handle_accept_event( void )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -550,12 +550,12 @@ int MPIDI_CH3_Sockconn_handle_accept_event( void )
     
     mpi_errno = MPIDI_CH3I_Connection_alloc(&conn);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
     mpi_errno = MPIDU_Sock_accept(MPIDI_CH3I_listener_conn->sock, 
 				  MPIDI_CH3I_sock_set, conn, &conn->sock);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**ch3|sock|accept");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**ch3|sock|accept");
     }
     
     conn->vc = NULL;
@@ -566,7 +566,7 @@ int MPIDI_CH3_Sockconn_handle_accept_event( void )
     
     mpi_errno = connection_post_recv_pkt(conn);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
  fn_exit:
@@ -580,7 +580,7 @@ int MPIDI_CH3_Sockconn_handle_accept_event( void )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Sockconn_handle_connect_event
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Sockconn_handle_connect_event( MPIDI_CH3I_Connection_t *conn, 
 					     int event_error )
 {
@@ -594,7 +594,7 @@ int MPIDI_CH3_Sockconn_handle_connect_event( MPIDI_CH3I_Connection_t *conn,
 	/* If the connection fails, conn->vc etc is probably invalid,
 	   so we can only report that the connection failed */
 	mpi_errno = event_error;
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|sock|connfailed" );
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|sock|connfailed" );
     }
     /* --END ERROR HANDLING-- */
 
@@ -610,7 +610,7 @@ int MPIDI_CH3_Sockconn_handle_connect_event( MPIDI_CH3I_Connection_t *conn,
 	openpkt->pg_rank = MPIR_Process.comm_world->rank;
 	
 	mpi_errno = connection_post_send_pkt_and_pgid(conn);
-	if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
     }
     else {
 	/* CONN_STATE_CONNECT_ACCEPT */
@@ -631,7 +631,7 @@ int MPIDI_CH3_Sockconn_handle_connect_event( MPIDI_CH3I_Connection_t *conn,
 	
 	mpi_errno = connection_post_send_pkt(conn);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
 				"**ch3|sock|scconnaccept");
 	}
     }
@@ -646,7 +646,7 @@ int MPIDI_CH3_Sockconn_handle_connect_event( MPIDI_CH3I_Connection_t *conn,
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Sockconn_handle_close_event
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Sockconn_handle_close_event( MPIDI_CH3I_Connection_t * conn )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -682,7 +682,7 @@ int MPIDI_CH3_Sockconn_handle_close_event( MPIDI_CH3I_Connection_t * conn )
 
                     /* Handle_connection takes care of updating the state on the VC */
                     mpi_errno = MPIDI_CH3U_Handle_connection(conn->vc, MPIDI_VC_EVENT_TERMINATED);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
 
@@ -696,7 +696,7 @@ int MPIDI_CH3_Sockconn_handle_close_event( MPIDI_CH3I_Connection_t * conn )
             conn->state = CONN_STATE_CLOSING;
             mpi_errno = MPIDU_Sock_post_close(conn->sock);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
 	    }
             goto fn_exit;
         }
@@ -723,7 +723,7 @@ int MPIDI_CH3_Sockconn_handle_close_event( MPIDI_CH3I_Connection_t * conn )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Sockconn_handle_conn_event
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -745,7 +745,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 					 openpkt->pg_id_len, 
 					 openpkt->pg_id_len, NULL);   
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     }
     else if (conn->pkt.type == MPIDI_CH3I_PKT_SC_CONN_ACCEPT) {
@@ -785,7 +785,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 	conn->state = CONN_STATE_OPEN_LSEND;
 	mpi_errno = connection_post_send_pkt(conn);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
+	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
 				"**ch3|sock|scconnaccept");
 	}
 	
@@ -809,11 +809,11 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 	    
 	    mpi_errno = connection_post_recv_pkt(conn);
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
 	    mpi_errno = connection_post_sendq_req(conn);
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
+		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
 				    "**ch3|sock|scopenresp");
 	    }
 	}
@@ -850,7 +850,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 	    MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL,"CLosing sock (Post_close)");
 	    mpi_errno = MPIDU_Sock_post_close(conn->sock);
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
 	}
     }
@@ -875,7 +875,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Sockconn_handle_connopen_event
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -894,7 +894,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
     /* Look up pg based on conn->pg_id */
     mpi_errno = MPIDI_PG_Find(conn->pg_id, &pg);
     if (pg == NULL) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,
+	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,
 			     "**pglookup", 
 			     "**pglookup %s", conn->pg_id);
     }
@@ -911,7 +911,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
         conn->state = CONN_STATE_OPEN_LSEND;
         mpi_errno = connection_post_send_pkt(conn);
         if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
+            MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
 			    "**ch3|sock|open_lrecv_data");
         }
         goto fn_exit;
@@ -994,7 +994,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
     conn->state = CONN_STATE_OPEN_LSEND;
     mpi_errno = connection_post_send_pkt(conn);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
 			    "**ch3|sock|open_lrecv_data");
     }
 
@@ -1009,7 +1009,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Sockconn_handle_connwrite
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3_Sockconn_handle_connwrite( MPIDI_CH3I_Connection_t * conn )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1026,7 +1026,7 @@ int MPIDI_CH3_Sockconn_handle_connwrite( MPIDI_CH3I_Connection_t * conn )
         }
 	mpi_errno = connection_post_recv_pkt(conn);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     }
     else if (conn->state == CONN_STATE_OPEN_LSEND) {
@@ -1042,12 +1042,12 @@ int MPIDI_CH3_Sockconn_handle_connwrite( MPIDI_CH3I_Connection_t * conn )
 	    vcch->state = MPIDI_CH3I_VC_STATE_CONNECTED;
 	    mpi_errno = connection_post_recv_pkt(conn);
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_POP(mpi_errno);
+		MPIR_ERR_POP(mpi_errno);
 	    }
 	    
 	    mpi_errno = connection_post_sendq_req(conn);
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
+		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
 				    "**ch3|sock|openlsend");
 	    }
 	}
@@ -1066,7 +1066,7 @@ int MPIDI_CH3_Sockconn_handle_connwrite( MPIDI_CH3I_Connection_t * conn )
 	    MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL,"Closing sock2 (Post_close)");
 	    mpi_errno = MPIDU_Sock_post_close(conn->sock);
 	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
+		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
 				    "**sock_post_close");
 	    }
 	}
@@ -1084,7 +1084,7 @@ int MPIDI_CH3_Sockconn_handle_connwrite( MPIDI_CH3I_Connection_t * conn )
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_VC_post_sockconnect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_VC_post_sockconnect(MPIDI_VC_t * vc)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1131,7 +1131,7 @@ int MPIDI_CH3I_VC_post_sockconnect(MPIDI_VC_t * vc)
     }
     mpi_errno = MPIDI_PG_GetConnString( vc->pg, vc->pg_rank, val, sizeof(val));
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     mpi_errno = MPIDI_CH3I_Sock_connect( vc, val, sizeof(val) );
@@ -1154,7 +1154,7 @@ int MPIDI_CH3I_VC_post_sockconnect(MPIDI_VC_t * vc)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_Sock_connect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3I_Sock_connect( MPIDI_VC_t *vc, const char val[], int vallen )
 {
     char host_description[MAX_HOST_DESCRIPTION_LEN];
@@ -1192,7 +1192,7 @@ int MPIDI_CH3I_Sock_connect( MPIDI_VC_t *vc, const char val[], int vallen )
 						 sizeof(host_description),
 						 &port, &ifaddr, &hasIfaddr );
     if (mpi_errno) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
     mpi_errno = MPIDI_CH3I_Connection_alloc(&conn);
@@ -1238,7 +1238,7 @@ int MPIDI_CH3I_Sock_connect( MPIDI_VC_t *vc, const char val[], int vallen )
 	/* --END ERROR HANDLING-- */
     }
     else {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**ch3|sock|connalloc");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**ch3|sock|connalloc");
     }
 
  fn_exit:
@@ -1261,7 +1261,7 @@ int MPIDI_CH3I_Sock_connect( MPIDI_VC_t *vc, const char val[], int vallen )
 #undef FUNCNAME
 #define FUNCNAME connection_post_recv_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int connection_post_recv_pkt(MPIDI_CH3I_Connection_t * conn)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1272,7 +1272,7 @@ static int connection_post_recv_pkt(MPIDI_CH3I_Connection_t * conn)
     mpi_errno = MPIDU_Sock_post_read(conn->sock, &conn->pkt, sizeof(conn->pkt),
 				     sizeof(conn->pkt), NULL);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
 
  fn_fail:    
@@ -1284,7 +1284,7 @@ static int connection_post_recv_pkt(MPIDI_CH3I_Connection_t * conn)
 #undef FUNCNAME
 #define FUNCNAME connection_post_send_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int connection_post_send_pkt(MPIDI_CH3I_Connection_t * conn)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1296,7 +1296,7 @@ static int connection_post_send_pkt(MPIDI_CH3I_Connection_t * conn)
     mpi_errno = MPIDU_Sock_post_write(conn->sock, &conn->pkt, sizeof(conn->pkt),
 				      sizeof(conn->pkt), NULL);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
     
  fn_fail:
@@ -1307,7 +1307,7 @@ static int connection_post_send_pkt(MPIDI_CH3I_Connection_t * conn)
 #undef FUNCNAME
 #define FUNCNAME connection_post_send_pkt_and_pgid
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int connection_post_send_pkt_and_pgid(MPIDI_CH3I_Connection_t * conn)
 {
     int mpi_errno;
@@ -1324,7 +1324,7 @@ static int connection_post_send_pkt_and_pgid(MPIDI_CH3I_Connection_t * conn)
     MPIU_DBG_PKT(conn,&conn->pkt,"connect-pgid");
     mpi_errno = MPIDU_Sock_post_writev(conn->sock, conn->iov, 2, NULL);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+	MPIR_ERR_POP(mpi_errno);
     }
     
  fn_fail:
@@ -1336,7 +1336,7 @@ static int connection_post_send_pkt_and_pgid(MPIDI_CH3I_Connection_t * conn)
 #undef FUNCNAME
 #define FUNCNAME connection_post_sendq_req
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int connection_post_sendq_req(MPIDI_CH3I_Connection_t * conn)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1355,7 +1355,7 @@ static int connection_post_sendq_req(MPIDI_CH3I_Connection_t * conn)
 					   conn->send_active->dev.iov_count, 
 					   NULL);
 	if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_POP(mpi_errno);
+	    MPIR_ERR_POP(mpi_errno);
 	}
     }
     
@@ -1372,7 +1372,7 @@ static int connection_post_sendq_req(MPIDI_CH3I_Connection_t * conn)
 #undef FUNCNAME
 #define FUNCNAME connection_destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void connection_destroy(MPIDI_CH3I_Connection_t * conn)
 {
     MPIDI_STATE_DECL(MPID_STATE_CONNECTION_DESTROY);
diff --git a/src/mpid/ch3/util/sock/ch3u_getinterfaces.c b/src/mpid/ch3/util/sock/ch3u_getinterfaces.c
index 4e849d7..0e5cda5 100644
--- a/src/mpid/ch3/util/sock/ch3u_getinterfaces.c
+++ b/src/mpid/ch3/util/sock/ch3u_getinterfaces.c
@@ -62,7 +62,7 @@ static int MPIDI_CH3U_GetIPInterface( MPIDU_Sock_ifaddr_t *, int * );
 #undef FUNCNAME
 #define FUNCNAME MPIDU_CH3U_GetSockInterfaceAddr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_CH3U_GetSockInterfaceAddr( int myRank, char *ifname, int maxIfname,
 				     MPIDU_Sock_ifaddr_t *ifaddr )
 {
@@ -108,7 +108,7 @@ int MPIDU_CH3U_GetSockInterfaceAddr( int myRank, char *ifname, int maxIfname,
 
 	/* If we have nothing, then use the host name */
 	mpi_errno = MPID_Get_processor_name(ifname, maxIfname, &len );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	ifname_string = ifname;
 
 	/* If we didn't find a specific name, then try to get an IP address
@@ -116,7 +116,7 @@ int MPIDU_CH3U_GetSockInterfaceAddr( int myRank, char *ifname, int maxIfname,
 	   this platform.  Otherwise, we'll drop into the next step that uses 
 	   the ifname */
 	mpi_errno = MPIDI_CH3U_GetIPInterface( ifaddr, &ifaddrFound );
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     else {
 	/* Copy this name into the output name */
diff --git a/src/mpid/ch3/util/sock/ch3u_init_sock.c b/src/mpid/ch3/util/sock/ch3u_init_sock.c
index a77f4dd..f0bbbc1 100644
--- a/src/mpid/ch3/util/sock/ch3u_init_sock.c
+++ b/src/mpid/ch3/util/sock/ch3u_init_sock.c
@@ -32,7 +32,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Init_sock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Init_sock(int has_parent, MPIDI_PG_t *pg_p, int pg_rank,
 			 char **bc_val_p, int *val_max_sz_p)
 {
@@ -72,7 +72,7 @@ int MPIDI_CH3U_Init_sock(int has_parent, MPIDI_PG_t *pg_p, int pg_rank,
     mpi_errno = MPIDI_CH3U_Get_business_card_sock(pg_rank, 
 						  bc_val_p, val_max_sz_p);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**init_buscard");
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**init_buscard");
     }
 
  fn_exit:
diff --git a/src/mpid/ch3/util/unordered/unordered.c b/src/mpid/ch3/util/unordered/unordered.c
index 845a4e0..d85070c 100644
--- a/src/mpid/ch3/util/unordered/unordered.c
+++ b/src/mpid/ch3/util/unordered/unordered.c
@@ -24,7 +24,7 @@ int MPIDI_CH3U_Handle_unordered_recv_pkt(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Handle_unordered_recv_pkt
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_CH3U_Handle_unordered_recv_pkt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t * pkt,
 					 MPID_Request ** rreqp)
 {
diff --git a/src/mpid/common/Makefile.mk b/src/mpid/common/Makefile.mk
index e33e7ae..d041162 100644
--- a/src/mpid/common/Makefile.mk
+++ b/src/mpid/common/Makefile.mk
@@ -11,3 +11,4 @@ include $(top_srcdir)/src/mpid/common/sched/Makefile.mk
 include $(top_srcdir)/src/mpid/common/sock/Makefile.mk
 include $(top_srcdir)/src/mpid/common/thread/Makefile.mk
 include $(top_srcdir)/src/mpid/common/hcoll/Makefile.mk
+include $(top_srcdir)/src/mpid/common/timers/Makefile.mk
diff --git a/src/mpid/common/datatype/dataloop/darray_support.c b/src/mpid/common/datatype/dataloop/darray_support.c
index 692183f..d422bec 100644
--- a/src/mpid/common/datatype/dataloop/darray_support.c
+++ b/src/mpid/common/datatype/dataloop/darray_support.c
@@ -22,7 +22,7 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc
 #undef FUNCNAME
 #define FUNCNAME PREPEND_PREFIX(Type_convert_darray)
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int PREPEND_PREFIX(Type_convert_darray)(int size,
 					int rank,
 					int ndims,
@@ -66,7 +66,7 @@ int PREPEND_PREFIX(Type_convert_darray)(int size,
                                              order, orig_extent,
                                              type_old, &type_new,
                                              st_offsets+i);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		break;
 	    case MPI_DISTRIBUTE_CYCLIC:
 		mpi_errno = MPIOI_Type_cyclic(array_of_gsizes, i, ndims,
@@ -74,7 +74,7 @@ int PREPEND_PREFIX(Type_convert_darray)(int size,
                                               array_of_dargs[i], order,
                                               orig_extent, type_old,
                                               &type_new, st_offsets+i);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		break;
 	    case MPI_DISTRIBUTE_NONE:
 		/* treat it as a block distribution on 1 process */
@@ -83,7 +83,7 @@ int PREPEND_PREFIX(Type_convert_darray)(int size,
                                              orig_extent,
                                              type_old, &type_new,
                                              st_offsets+i);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		break;
 	    }
 	    if (i) MPIR_Type_free_impl(&type_old);
@@ -109,7 +109,7 @@ int PREPEND_PREFIX(Type_convert_darray)(int size,
                                              coords[i], array_of_dargs[i], order,
                                              orig_extent, type_old, &type_new,
                                              st_offsets+i);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		break;
 	    case MPI_DISTRIBUTE_CYCLIC:
 		mpi_errno = MPIOI_Type_cyclic(array_of_gsizes, i, ndims,
@@ -117,14 +117,14 @@ int PREPEND_PREFIX(Type_convert_darray)(int size,
                                               array_of_dargs[i], order,
                                               orig_extent, type_old, &type_new,
                                               st_offsets+i);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		break;
 	    case MPI_DISTRIBUTE_NONE:
 		/* treat it as a block distribution on 1 process */
 		mpi_errno = MPIOI_Type_block(array_of_gsizes, i, ndims, array_of_psizes[i],
                                              coords[i], MPI_DISTRIBUTE_DFLT_DARG, order, orig_extent,
                                              type_old, &type_new, st_offsets+i);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		break;
 	    }
 	    if (i != ndims-1) MPIR_Type_free_impl(&type_old);
@@ -152,7 +152,7 @@ int PREPEND_PREFIX(Type_convert_darray)(int size,
     types[2] = MPI_UB;
     
     mpi_errno = MPIR_Type_struct_impl(3, blklens, disps, types, newtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIR_Type_free_impl(&type_new);
 
@@ -172,7 +172,7 @@ int PREPEND_PREFIX(Type_convert_darray)(int size,
 #undef FUNCNAME
 #define FUNCNAME MPIOI_Type_block
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIOI_Type_block(int *array_of_gsizes, int dim, int ndims, int nprocs,
                             int rank, int darg, int order, MPI_Aint orig_extent,
                             MPI_Datatype type_old, MPI_Datatype *type_new,
@@ -191,8 +191,8 @@ static int MPIOI_Type_block(int *array_of_gsizes, int dim, int ndims, int nprocs
     else {
 	blksize = darg;
 
-        MPIU_ERR_CHKINTERNAL(blksize <= 0, mpi_errno, "blksize must be > 0");
-        MPIU_ERR_CHKINTERNAL(blksize * nprocs < global_size, mpi_errno, "blksize * nprocs must be >= global size");
+        MPIR_ERR_CHKINTERNAL(blksize <= 0, mpi_errno, "blksize must be > 0");
+        MPIR_ERR_CHKINTERNAL(blksize * nprocs < global_size, mpi_errno, "blksize * nprocs must be >= global size");
     }
 
     j = global_size - blksize*rank;
@@ -203,21 +203,21 @@ static int MPIOI_Type_block(int *array_of_gsizes, int dim, int ndims, int nprocs
     if (order == MPI_ORDER_FORTRAN) {
 	if (dim == 0) {
 	    mpi_errno = MPIR_Type_contiguous_impl(mysize, type_old, type_new);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         } else {
 	    for (i=0; i<dim; i++) stride *= (MPI_Aint)(array_of_gsizes[i]);
 	    mpi_errno = MPIR_Type_hvector_impl(mysize, 1, stride, type_old, type_new);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	}
     }
     else {
 	if (dim == ndims-1) {
 	    mpi_errno = MPIR_Type_contiguous_impl(mysize, type_old, type_new);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         } else {
 	    for (i=ndims-1; i>dim; i--) stride *= (MPI_Aint)(array_of_gsizes[i]);
 	    mpi_errno = MPIR_Type_hvector_impl(mysize, 1, stride, type_old, type_new);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	}
     }
 
@@ -250,7 +250,7 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc
     if (darg == MPI_DISTRIBUTE_DFLT_DARG) blksize = 1;
     else blksize = darg;
 
-    MPIU_ERR_CHKINTERNAL(blksize <= 0, mpi_errno, "blksize must be > 0");
+    MPIR_ERR_CHKINTERNAL(blksize <= 0, mpi_errno, "blksize must be > 0");
 
     st_index = rank*blksize;
     end_index = array_of_gsizes[dim] - 1;
@@ -271,7 +271,7 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc
     else for (i=ndims-1; i>dim; i--) stride *= (MPI_Aint)(array_of_gsizes[i]);
 
     mpi_errno = MPIR_Type_hvector_impl(count, blksize, stride, type_old, type_new);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (rem) {
 	/* if the last block is of size less than blksize, include
@@ -285,7 +285,7 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc
 	blklens[1] = rem;
 
 	mpi_errno = MPIR_Type_struct_impl(2, blklens, disps, types, &type_tmp);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 	MPIR_Type_free_impl(type_new);
 	*type_new = type_tmp;
@@ -304,7 +304,7 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc
         blklens[0] = blklens[1] = blklens[2] = 1;
 
         mpi_errno = MPIR_Type_struct_impl(3, blklens, disps, types, &type_tmp);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         
         MPIR_Type_free_impl(type_new);
         *type_new = type_tmp;
diff --git a/src/mpid/common/datatype/dataloop/subarray_support.c b/src/mpid/common/datatype/dataloop/subarray_support.c
index 385181e..1bdb80a 100644
--- a/src/mpid/common/datatype/dataloop/subarray_support.c
+++ b/src/mpid/common/datatype/dataloop/subarray_support.c
@@ -11,7 +11,7 @@
 #undef FUNCNAME
 #define FUNCNAME PREPEND_PREFIX(Type_convert_subarray)
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int PREPEND_PREFIX(Type_convert_subarray)(int ndims,
 					  int *array_of_sizes,
 					  int *array_of_subsizes,
@@ -31,19 +31,19 @@ int PREPEND_PREFIX(Type_convert_subarray)(int ndims,
 	/* dimension 0 changes fastest */
 	if (ndims == 1) {
 	    mpi_errno = MPIR_Type_contiguous_impl(array_of_subsizes[0], oldtype, &tmp1);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	}
 	else {
 	    mpi_errno = MPIR_Type_vector_impl(array_of_subsizes[1],
                                               array_of_subsizes[0],
                                               array_of_sizes[0], oldtype, &tmp1);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 	    size = (MPI_Aint)(array_of_sizes[0]) * extent;
 	    for (i=2; i<ndims; i++) {
 		size *= (MPI_Aint)(array_of_sizes[i-1]);
 		mpi_errno = MPIR_Type_hvector_impl(array_of_subsizes[i], 1, size, tmp1, &tmp2);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		MPIR_Type_free_impl(&tmp1);
 		tmp1 = tmp2;
 	    }
@@ -63,19 +63,19 @@ int PREPEND_PREFIX(Type_convert_subarray)(int ndims,
 	/* dimension ndims-1 changes fastest */
 	if (ndims == 1) {
 	    mpi_errno = MPIR_Type_contiguous_impl(array_of_subsizes[0], oldtype, &tmp1);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	}
 	else {
 	    mpi_errno = MPIR_Type_vector_impl(array_of_subsizes[ndims-2],
                                               array_of_subsizes[ndims-1],
                                               array_of_sizes[ndims-1], oldtype, &tmp1);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 	    size = (MPI_Aint)(array_of_sizes[ndims-1]) * extent;
 	    for (i=ndims-3; i>=0; i--) {
 		size *= (MPI_Aint)(array_of_sizes[i+1]);
 		mpi_errno = MPIR_Type_hvector_impl(array_of_subsizes[i], 1, size, tmp1, &tmp2);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		MPIR_Type_free_impl(&tmp1);
 		tmp1 = tmp2;
 	    }
@@ -102,7 +102,7 @@ int PREPEND_PREFIX(Type_convert_subarray)(int ndims,
     types[2] = MPI_UB;
     
     mpi_errno = MPIR_Type_struct_impl(3, blklens, disps, types, newtype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     MPIR_Type_free_impl(&tmp1);
 
diff --git a/src/mpid/common/datatype/mpid_ext32_segment.c b/src/mpid/common/datatype/mpid_ext32_segment.c
index d1fe2fa..120aaef 100644
--- a/src/mpid/common/datatype/mpid_ext32_segment.c
+++ b/src/mpid/common/datatype/mpid_ext32_segment.c
@@ -171,7 +171,7 @@ static int external32_float_convert(char *dest_buf,
 #undef FUNCNAME
 #define FUNCNAME MPID_Segment_contig_pack_external32_to_buf
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPID_Segment_contig_pack_external32_to_buf(DLOOP_Offset *blocks_p,
                                                       DLOOP_Type el_type,
                                                       DLOOP_Offset rel_off,
@@ -234,7 +234,7 @@ static int MPID_Segment_contig_pack_external32_to_buf(DLOOP_Offset *blocks_p,
 #undef FUNCNAME
 #define FUNCNAME MPID_Segment_contig_unpack_external32_to_buf
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPID_Segment_contig_unpack_external32_to_buf(DLOOP_Offset *blocks_p,
                                                         DLOOP_Type el_type,
                                                         DLOOP_Offset rel_off,
@@ -297,7 +297,7 @@ static int MPID_Segment_contig_unpack_external32_to_buf(DLOOP_Offset *blocks_p,
 #undef FUNCNAME
 #define FUNCNAME MPID_Segment_pack_external32
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPID_Segment_pack_external32(struct DLOOP_Segment *segp,
 				  DLOOP_Offset first,
 				  DLOOP_Offset *lastp, 
@@ -326,7 +326,7 @@ void MPID_Segment_pack_external32(struct DLOOP_Segment *segp,
 #undef FUNCNAME
 #define FUNCNAME MPID_Segment_unpack_external32
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPID_Segment_unpack_external32(struct DLOOP_Segment *segp,
 				    DLOOP_Offset first,
 				    DLOOP_Offset *lastp,
diff --git a/src/mpid/common/datatype/mpid_segment.c b/src/mpid/common/datatype/mpid_segment.c
index 9283186..ef36cd9 100644
--- a/src/mpid/common/datatype/mpid_segment.c
+++ b/src/mpid/common/datatype/mpid_segment.c
@@ -88,7 +88,7 @@ static int MPID_Segment_vector_flatten(DLOOP_Offset *blocks_p,
 #undef FUNCNAME
 #define FUNCNAME MPID_Segment_pack_vector
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* MPID_Segment_pack_vector
 *
 * Parameters:
@@ -141,7 +141,7 @@ return;
 #undef FUNCNAME
 #define FUNCNAME MPID_Segment_unpack_vector
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPID_Segment_unpack_vector(struct DLOOP_Segment *segp,
 			    DLOOP_Offset first,
 			    DLOOP_Offset *lastp,
@@ -158,7 +158,7 @@ return;
 #undef FUNCNAME
 #define FUNCNAME MPID_Segment_flatten
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* MPID_Segment_flatten
 *
 * offp    - pointer to array to fill in with offsets
@@ -214,7 +214,7 @@ return;
 #undef FUNCNAME
 #define FUNCNAME MPID_Segment_contig_pack_to_iov
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* MPID_Segment_contig_pack_to_iov
 */
 static int MPID_Segment_contig_pack_to_iov(DLOOP_Offset *blocks_p,
@@ -277,7 +277,7 @@ static int MPID_Segment_contig_pack_to_iov(DLOOP_Offset *blocks_p,
 #undef FUNCNAME
 #define FUNCNAME MPID_Segment_vector_pack_to_iov
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* MPID_Segment_vector_pack_to_iov
  *
  * Input Parameters:
@@ -399,7 +399,7 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
 #undef FUNCNAME
 #define FUNCNAME MPID_Segment_contig_flatten
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* MPID_Segment_contig_flatten
  */
 static int MPID_Segment_contig_flatten(DLOOP_Offset *blocks_p,
@@ -456,7 +456,7 @@ static int MPID_Segment_contig_flatten(DLOOP_Offset *blocks_p,
 #undef FUNCNAME
 #define FUNCNAME MPID_Segment_vector_flatten
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* MPID_Segment_vector_flatten
  *
  * Notes:
diff --git a/src/mpid/common/datatype/mpid_type_dup.c b/src/mpid/common/datatype/mpid_type_dup.c
index fddabea..d4a8b3c 100644
--- a/src/mpid/common/datatype/mpid_type_dup.c
+++ b/src/mpid/common/datatype/mpid_type_dup.c
@@ -35,7 +35,7 @@ int MPID_Type_dup(MPI_Datatype oldtype,
     if (HANDLE_GET_KIND(oldtype) == HANDLE_KIND_BUILTIN) {
 	/* create a new type and commit it. */
 	mpi_errno = MPID_Type_contiguous(1, oldtype, newtype);
-	if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+	if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
     }
     else {
       	/* allocate new datatype object and handle */
diff --git a/src/mpid/common/hcoll/hcoll_init.c b/src/mpid/common/hcoll/hcoll_init.c
index 5a8184c..c04704a 100644
--- a/src/mpid/common/hcoll/hcoll_init.c
+++ b/src/mpid/common/hcoll/hcoll_init.c
@@ -19,7 +19,7 @@ int world_comm_destroying = 0;
 #undef FUNCNAME
 #define FUNCNAME hcoll_destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 int hcoll_destroy(void *param ATTRIBUTE((unused)))
 {
@@ -54,7 +54,7 @@ static int hcoll_comm_attr_del_fn(MPI_Comm comm, int keyval, void *attr_val, voi
 #undef FUNCNAME
 #define FUNCNAME hcoll_initialize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int hcoll_initialize(void)
 {
     int mpi_errno;
@@ -78,16 +78,16 @@ int hcoll_initialize(void)
      */
     hcoll_set_runtime_tag_offset(INT_MAX / 2, MPI_TAG_UB);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     mpi_errno = hcoll_init();
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     if (!hcoll_initialized) {
         hcoll_initialized = 1;
         mpi_errno = MPID_Progress_register_hook(hcoll_do_progress,
                                                 &hcoll_progress_hook_id);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         MPID_Progress_activate_hook(hcoll_progress_hook_id);
     }
@@ -97,7 +97,7 @@ int hcoll_initialize(void)
         MPIR_Comm_create_keyval_impl(MPI_NULL_COPY_FN, hcoll_comm_attr_del_fn,
                                      &hcoll_comm_attr_keyval, NULL);
     if (mpi_errno)
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
 
     CHECK_ENABLE_ENV_VARS(BARRIER, barrier);
     CHECK_ENABLE_ENV_VARS(BCAST, bcast);
@@ -123,7 +123,7 @@ int hcoll_initialize(void)
 #undef FUNCNAME
 #define FUNCNAME hcoll_comm_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int hcoll_comm_create(MPID_Comm * comm_ptr, void *param)
 {
     int mpi_errno;
@@ -133,7 +133,7 @@ int hcoll_comm_create(MPID_Comm * comm_ptr, void *param)
     if (0 == hcoll_initialized) {
         mpi_errno = hcoll_initialize();
         if (mpi_errno)
-            MPIU_ERR_POP(mpi_errno);
+            MPIR_ERR_POP(mpi_errno);
     }
     if (0 == hcoll_enable) {
         goto fn_exit;
@@ -163,7 +163,7 @@ int hcoll_comm_create(MPID_Comm * comm_ptr, void *param)
                               (rte_grp_handle_t) comm_ptr, &context_destroyed);
         MPIU_Assert(context_destroyed);
         comm_ptr->hcoll_priv.is_hcoll_init = 0;
-        MPIU_ERR_POP(mpi_errno);
+        MPIR_ERR_POP(mpi_errno);
     }
     comm_ptr->hcoll_priv.hcoll_origin_coll_fns = comm_ptr->coll_fns;
     comm_ptr->coll_fns = (MPID_Collops *) MPIU_Malloc(sizeof(MPID_Collops));
@@ -191,7 +191,7 @@ int hcoll_comm_create(MPID_Comm * comm_ptr, void *param)
 #undef FUNCNAME
 #define FUNCNAME hcoll_comm_destroy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int hcoll_comm_destroy(MPID_Comm * comm_ptr, void *param)
 {
     int mpi_errno;
diff --git a/src/mpid/common/hcoll/hcoll_ops.c b/src/mpid/common/hcoll/hcoll_ops.c
index 304d722..db1dbd9 100644
--- a/src/mpid/common/hcoll/hcoll_ops.c
+++ b/src/mpid/common/hcoll/hcoll_ops.c
@@ -4,7 +4,7 @@
 #undef FUNCNAME
 #define FUNCNAME hcoll_Barrier
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int hcoll_Barrier(MPID_Comm * comm_ptr, MPIR_Errflag_t *err)
 {
     int rc;
@@ -27,7 +27,7 @@ int hcoll_Barrier(MPID_Comm * comm_ptr, MPIR_Errflag_t *err)
 #undef FUNCNAME
 #define FUNCNAME hcoll_Bcast
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int hcoll_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
                 MPID_Comm * comm_ptr, MPIR_Errflag_t *err)
 {
@@ -71,7 +71,7 @@ int hcoll_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
 #undef FUNCNAME
 #define FUNCNAME hcoll_Allreduce
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int hcoll_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
                     MPI_Op op, MPID_Comm * comm_ptr, MPIR_Errflag_t *err)
 {
@@ -122,7 +122,7 @@ int hcoll_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
 #undef FUNCNAME
 #define FUNCNAME hcoll_Allgather
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int hcoll_Allgather(const void *sbuf, int scount, MPI_Datatype sdtype,
                     void *rbuf, int rcount, MPI_Datatype rdtype, MPID_Comm * comm_ptr, MPIR_Errflag_t *err)
 {
@@ -174,7 +174,7 @@ int hcoll_Allgather(const void *sbuf, int scount, MPI_Datatype sdtype,
 #undef FUNCNAME
 #define FUNCNAME hcoll_Ibarrier_req
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int hcoll_Ibarrier_req(MPID_Comm * comm_ptr, MPID_Request ** request)
 {
     int rc;
@@ -202,7 +202,7 @@ int hcoll_Ibarrier_req(MPID_Comm * comm_ptr, MPID_Request ** request)
 #undef FUNCNAME
 #define FUNCNAME hcoll_Ibcast_req
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
                      MPID_Comm * comm_ptr, MPID_Request ** request)
 {
@@ -250,7 +250,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
 #undef FUNCNAME
 #define FUNCNAME hcoll_Iallgather_req
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
                          int recvcount, MPI_Datatype recvtype, MPID_Comm * comm_ptr,
                          MPID_Request ** request)
@@ -308,7 +308,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
 #undef FUNCNAME
 #define FUNCNAME hcoll_Iallreduce_req
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
                          MPI_Op op, MPID_Comm * comm_ptr, MPID_Request ** request)
 {
diff --git a/src/mpid/common/hcoll/hcoll_rte.c b/src/mpid/common/hcoll/hcoll_rte.c
index 2a2f174..ea543fe 100644
--- a/src/mpid/common/hcoll/hcoll_rte.c
+++ b/src/mpid/common/hcoll/hcoll_rte.c
@@ -42,7 +42,7 @@ static int world_rank(rte_grp_handle_t grp_h, rte_ec_handle_t ec);
 #undef FUNCNAME
 #define FUNCNAME progress
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void progress(void)
 {
     int ret;
@@ -62,7 +62,7 @@ static void progress(void)
 #undef FUNCNAME
 #define FUNCNAME init_module_fns
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void init_module_fns(void)
 {
     hcoll_rte_functions.send_fn = send_nb;
@@ -87,7 +87,7 @@ static void init_module_fns(void)
 #undef FUNCNAME
 #define FUNCNAME hcoll_rte_fns_setup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void hcoll_rte_fns_setup(void)
 {
     init_module_fns();
@@ -111,7 +111,7 @@ static inline int count_total_dte_repeat_entries(struct dte_data_representation_
 #undef FUNCNAME
 #define FUNCNAME recv_nb
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int recv_nb(struct dte_data_representation_t data,
                    uint32_t count,
                    void *buffer,
@@ -128,13 +128,13 @@ static int recv_nb(struct dte_data_representation_t data,
     context_offset = MPID_CONTEXT_INTRA_COLL;
     comm = (MPID_Comm *) grp_h;
     if (!ec_h.handle) {
-        MPIU_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_OTHER, "**hcoll_wrong_arg",
+        MPIR_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_OTHER, "**hcoll_wrong_arg",
                              "**hcoll_wrong_arg %p %d", ec_h.handle, ec_h.rank);
     }
 
     if (HCOL_DTE_IS_INLINE(data)) {
         if (!buffer && !HCOL_DTE_IS_ZERO(data)) {
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**null_buff_ptr");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**null_buff_ptr");
         }
         size = (size_t) data.rep.in_line_rep.data_handle.in_line.packed_size * count / 8;
         dtype = MPI_CHAR;
@@ -178,7 +178,7 @@ static int recv_nb(struct dte_data_representation_t data,
 #undef FUNCNAME
 #define FUNCNAME send_nb
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int send_nb(dte_data_representation_t data,
                    uint32_t count,
                    void *buffer,
@@ -195,13 +195,13 @@ static int send_nb(dte_data_representation_t data,
     context_offset = MPID_CONTEXT_INTRA_COLL;
     comm = (MPID_Comm *) grp_h;
     if (!ec_h.handle) {
-        MPIU_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_OTHER, "**hcoll_wrong_arg",
+        MPIR_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_OTHER, "**hcoll_wrong_arg",
                              "**hcoll_wrong_arg %p %d", ec_h.handle, ec_h.rank);
     }
 
     if (HCOL_DTE_IS_INLINE(data)) {
         if (!buffer && !HCOL_DTE_IS_ZERO(data)) {
-            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**null_buff_ptr");
+            MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**null_buff_ptr");
         }
         size = (size_t) data.rep.in_line_rep.data_handle.in_line.packed_size * count / 8;
         dtype = MPI_CHAR;
@@ -245,7 +245,7 @@ static int send_nb(dte_data_representation_t data,
 #undef FUNCNAME
 #define FUNCNAME test
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int test(rte_request_handle_t * request, int *completed)
 {
     MPID_Request *req;
@@ -267,7 +267,7 @@ static int test(rte_request_handle_t * request, int *completed)
 #undef FUNCNAME
 #define FUNCNAME ec_handle_compare
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int ec_handle_compare(rte_ec_handle_t handle_1,
                              rte_grp_handle_t
                              group_handle_1,
@@ -279,7 +279,7 @@ static int ec_handle_compare(rte_ec_handle_t handle_1,
 #undef FUNCNAME
 #define FUNCNAME get_ec_handles
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int get_ec_handles(int num_ec,
                           int *ec_indexes, rte_grp_handle_t grp_h, rte_ec_handle_t * ec_handles)
 {
@@ -296,7 +296,7 @@ static int get_ec_handles(int num_ec,
 #undef FUNCNAME
 #define FUNCNAME get_my_ec
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int get_my_ec(rte_grp_handle_t grp_h, rte_ec_handle_t * ec_handle)
 {
     MPID_Comm *comm;
@@ -311,7 +311,7 @@ static int get_my_ec(rte_grp_handle_t grp_h, rte_ec_handle_t * ec_handle)
 #undef FUNCNAME
 #define FUNCNAME group_size
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int group_size(rte_grp_handle_t grp_h)
 {
     return MPIR_Comm_size((MPID_Comm *) grp_h);
@@ -320,7 +320,7 @@ static int group_size(rte_grp_handle_t grp_h)
 #undef FUNCNAME
 #define FUNCNAME my_rank
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int my_rank(rte_grp_handle_t grp_h)
 {
     return MPIR_Comm_rank((MPID_Comm *) grp_h);
@@ -329,7 +329,7 @@ static int my_rank(rte_grp_handle_t grp_h)
 #undef FUNCNAME
 #define FUNCNAME ec_on_local_node
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int ec_on_local_node(rte_ec_handle_t ec, rte_grp_handle_t group)
 {
     MPID_Comm *comm;
@@ -346,7 +346,7 @@ static int ec_on_local_node(rte_ec_handle_t ec, rte_grp_handle_t group)
 #undef FUNCNAME
 #define FUNCNAME get_world_group_handle
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static rte_grp_handle_t get_world_group_handle(void)
 {
     return (rte_grp_handle_t) (MPIR_Process.comm_world);
@@ -355,7 +355,7 @@ static rte_grp_handle_t get_world_group_handle(void)
 #undef FUNCNAME
 #define FUNCNAME jobid
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static uint32_t jobid(void)
 {
     /* not used currently */
@@ -365,7 +365,7 @@ static uint32_t jobid(void)
 #undef FUNCNAME
 #define FUNCNAME group_id
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int group_id(rte_grp_handle_t group)
 {
     MPID_Comm *comm;
@@ -376,7 +376,7 @@ static int group_id(rte_grp_handle_t group)
 #undef FUNCNAME
 #define FUNCNAME get_coll_handle
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void *get_coll_handle(void)
 {
     MPID_Request *req;
@@ -388,7 +388,7 @@ static void *get_coll_handle(void)
 #undef FUNCNAME
 #define FUNCNAME coll_handle_test
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int coll_handle_test(void *handle)
 {
     int completed;
@@ -401,7 +401,7 @@ static int coll_handle_test(void *handle)
 #undef FUNCNAME
 #define FUNCNAME coll_handle_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void coll_handle_free(void *handle)
 {
     MPID_Request *req;
@@ -414,7 +414,7 @@ static void coll_handle_free(void *handle)
 #undef FUNCNAME
 #define FUNCNAME coll_handle_complete
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void coll_handle_complete(void *handle)
 {
     MPID_Request *req;
@@ -427,7 +427,7 @@ static void coll_handle_complete(void *handle)
 #undef FUNCNAME
 #define FUNCNAME world_rank
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int world_rank(rte_grp_handle_t grp_h, rte_ec_handle_t ec)
 {
     return (MPIR_Process.comm_world->rank);
diff --git a/src/mpid/common/sched/mpid_sched.c b/src/mpid/common/sched/mpid_sched.c
index b95adcb..e3d7a76 100644
--- a/src/mpid/common/sched/mpid_sched.c
+++ b/src/mpid/common/sched/mpid_sched.c
@@ -61,7 +61,7 @@ static int nbc_progress_hook_id = 0;
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sched_are_pending
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sched_are_pending(void)
 {
     return (all_schedules.head != NULL);
@@ -70,7 +70,7 @@ int MPIDU_Sched_are_pending(void)
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_next_tag
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Sched_next_tag(MPID_Comm *comm_ptr, int *tag)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -101,7 +101,7 @@ int MPID_Sched_next_tag(MPID_Comm *comm_ptr, int *tag)
     if (start != MPI_UNDEFINED) {
         MPL_DL_FOREACH(all_schedules.head, elt) {
             if (elt->tag >= start && elt->tag < end) {
-                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**toomanynbc");
+                MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**toomanynbc");
             }
         }
     }
@@ -120,7 +120,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sched_start_entry
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* initiates the schedule entry "e" in the NBC described by "s", where
  * "e" is at "idx" in "s".  This means posting nonblocking sends/recvs,
  * performing reductions, calling callbacks, etc. */
@@ -193,7 +193,7 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
             MPIU_DBG_MSG_D(COMM, VERBOSE, "starting REDUCE entry %d\n", (int) idx);
             mpi_errno = MPIR_Reduce_local_impl(e->u.reduce.inbuf, e->u.reduce.inoutbuf, e->u.reduce.count,
                                                e->u.reduce.datatype, e->u.reduce.op);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             if (HANDLE_GET_KIND(e->u.reduce.op) != HANDLE_KIND_BUILTIN) {
                 MPID_Op *op_ptr = NULL;
                 MPID_Op_get_ptr(e->u.reduce.op, op_ptr);
@@ -206,7 +206,7 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
             MPIU_DBG_MSG_D(COMM, VERBOSE, "starting COPY entry %d\n", (int) idx);
             mpi_errno = MPIR_Localcopy(e->u.copy.inbuf, e->u.copy.incount, e->u.copy.intype,
                                        e->u.copy.outbuf, e->u.copy.outcount, e->u.copy.outtype);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             dtype_release_if_not_builtin(e->u.copy.intype);
             dtype_release_if_not_builtin(e->u.copy.outtype);
             e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
@@ -276,7 +276,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sched_continue
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Sched_continue(struct MPIDU_Sched *s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -289,7 +289,7 @@ static int MPIDU_Sched_continue(struct MPIDU_Sched *s)
             mpi_errno = MPIDU_Sched_start_entry(s, i, e);
             /* Sched entries list can be reallocated inside callback */
             e = &s->entries[i];
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
 
         /* _start_entry may have completed the operation, but won't update s->idx */
@@ -314,7 +314,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* creates a new opaque schedule object and returns a handle to it in (*sp) */
 int MPID_Sched_create(MPID_Sched_t *sp)
 {
@@ -353,7 +353,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_clone
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* clones orig and returns a handle to the new schedule in (*cloned) */
 int MPID_Sched_clone(MPID_Sched_t orig, MPID_Sched_t *cloned)
 {
@@ -367,7 +367,7 @@ int MPID_Sched_clone(MPID_Sched_t orig, MPID_Sched_t *cloned)
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_start
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* sets (*sp) to MPID_SCHED_NULL and gives you back a request pointer in (*req).
  * The caller is giving up ownership of the opaque schedule object. */
 int MPID_Sched_start(MPID_Sched_t *sp, MPID_Comm *comm, int tag, MPID_Request **req)
@@ -389,7 +389,7 @@ int MPID_Sched_start(MPID_Sched_t *sp, MPID_Comm *comm, int tag, MPID_Request **
 
     /* now create and populate the request */
     r = MPID_Request_create();
-    if (!r) MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+    if (!r) MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
     r->kind = MPID_COLL_REQUEST;
     /* FIXME is this right when comm/datatype GC is used? */
     MPIR_Comm_add_ref(comm);
@@ -407,14 +407,14 @@ int MPID_Sched_start(MPID_Sched_t *sp, MPID_Comm *comm, int tag, MPID_Request **
      * engine about this req+sched, otherwise we have more MT issues to worry
      * about.  Skipping this step will increase latency. */
     mpi_errno = MPIDU_Sched_continue(s);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     /* finally, enqueue in the list of all pending schedules so that the
      * progress engine can make progress on it */
     if (all_schedules.head == NULL) {
         mpi_errno = MPID_Progress_register_hook(MPIDU_Sched_progress,
                                                 &nbc_progress_hook_id);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         MPID_Progress_activate_hook(nbc_progress_hook_id);
     }
@@ -440,7 +440,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sched_add_entry
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* idx and e are permitted to be NULL */
 static int MPIDU_Sched_add_entry(struct MPIDU_Sched *s, int *idx, struct MPIDU_Sched_entry **e)
 {
@@ -454,7 +454,7 @@ static int MPIDU_Sched_add_entry(struct MPIDU_Sched *s, int *idx, struct MPIDU_S
     if (s->num_entries == s->size) {
         /* need to grow the entries array */
         s->entries = MPIU_Realloc(s->entries, 2*s->size*sizeof(struct MPIDU_Sched_entry));
-        if (s->entries == NULL) MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
+        if (s->entries == NULL) MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
         s->size *= 2;
     }
 
@@ -474,7 +474,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_send
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* do these ops need an entry handle returned? */
 int MPID_Sched_send(const void *buf, int count, MPI_Datatype datatype, int dest, MPID_Comm *comm, MPID_Sched_t s)
 {
@@ -482,7 +482,7 @@ int MPID_Sched_send(const void *buf, int count, MPI_Datatype datatype, int dest,
     struct MPIDU_Sched_entry *e = NULL;
 
     mpi_errno = MPIDU_Sched_add_entry(s, NULL, &e);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     e->type = MPIDU_SCHED_ENTRY_SEND;
     e->status = MPIDU_SCHED_ENTRY_STATUS_NOT_STARTED;
@@ -513,14 +513,14 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_ssend
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Sched_ssend(const void *buf, int count, MPI_Datatype datatype, int dest, MPID_Comm *comm, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
     struct MPIDU_Sched_entry *e = NULL;
 
     mpi_errno = MPIDU_Sched_add_entry(s, NULL, &e);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     e->type = MPIDU_SCHED_ENTRY_SEND;
     e->status = MPIDU_SCHED_ENTRY_STATUS_NOT_STARTED;
@@ -551,14 +551,14 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_send_defer
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Sched_send_defer(const void *buf, const int *count, MPI_Datatype datatype, int dest, MPID_Comm *comm, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
     struct MPIDU_Sched_entry *e = NULL;
 
     mpi_errno = MPIDU_Sched_add_entry(s, NULL, &e);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     e->type = MPIDU_SCHED_ENTRY_SEND;
     e->status = MPIDU_SCHED_ENTRY_STATUS_NOT_STARTED;
@@ -588,14 +588,14 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_recv_status
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Sched_recv_status(void *buf, int count, MPI_Datatype datatype, int src, MPID_Comm *comm, MPI_Status *status, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
     struct MPIDU_Sched_entry *e = NULL;
 
     mpi_errno = MPIDU_Sched_add_entry(s, NULL, &e);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     e->type = MPIDU_SCHED_ENTRY_RECV;
     e->status = MPIDU_SCHED_ENTRY_STATUS_NOT_STARTED;
@@ -621,14 +621,14 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_recv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Sched_recv(void *buf, int count, MPI_Datatype datatype, int src, MPID_Comm *comm, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
     struct MPIDU_Sched_entry *e = NULL;
 
     mpi_errno = MPIDU_Sched_add_entry(s, NULL, &e);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     e->type = MPIDU_SCHED_ENTRY_RECV;
     e->status = MPIDU_SCHED_ENTRY_STATUS_NOT_STARTED;
@@ -654,7 +654,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_reduce
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_Sched_reduce(const void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Sched_t s)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -662,7 +662,7 @@ int MPID_Sched_reduce(const void *inbuf, void *inoutbuf, int count, MPI_Datatype
     struct MPIDU_Sched_reduce *reduce = NULL;
 
     mpi_errno = MPIDU_Sched_add_entry(s, NULL, &e);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     e->type = MPIDU_SCHED_ENTRY_REDUCE;
     e->status = MPIDU_SCHED_ENTRY_STATUS_NOT_STARTED;
@@ -691,7 +691,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_copy
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* Schedules a copy of "incount" copies of "intype" from "inbuf" to "outbuf" as
  * specified by "outcount" and "outtype".  It is erroneous to attempt to copy
  * more data than will fit into the (outbuf,outcount,outtype)-triple.  This
@@ -707,7 +707,7 @@ int MPID_Sched_copy(const void *inbuf,  int incount,  MPI_Datatype intype,
     struct MPIDU_Sched_copy *copy = NULL;
 
     mpi_errno = MPIDU_Sched_add_entry(s, NULL, &e);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     e->type = MPIDU_SCHED_ENTRY_COPY;
     e->status = MPIDU_SCHED_ENTRY_STATUS_NOT_STARTED;
@@ -746,7 +746,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_barrier
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* require that all previously added ops are complete before subsequent ops
  * may begin to execute */
 int MPID_Sched_barrier(MPID_Sched_t s)
@@ -768,7 +768,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_cb
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* buffer management, fancy reductions, etc */
 int MPID_Sched_cb(MPID_Sched_cb_t *cb_p, void *cb_state, MPID_Sched_t s)
 {
@@ -777,7 +777,7 @@ int MPID_Sched_cb(MPID_Sched_cb_t *cb_p, void *cb_state, MPID_Sched_t s)
     struct MPIDU_Sched_cb *cb = NULL;
 
     mpi_errno = MPIDU_Sched_add_entry(s, NULL, &e);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     e->type = MPIDU_SCHED_ENTRY_CB;
     e->status = MPIDU_SCHED_ENTRY_STATUS_NOT_STARTED;
@@ -798,7 +798,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_Sched_cb2
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* buffer management, fancy reductions, etc */
 int MPID_Sched_cb2(MPID_Sched_cb2_t *cb_p, void *cb_state, void *cb_state2, MPID_Sched_t s)
 {
@@ -807,7 +807,7 @@ int MPID_Sched_cb2(MPID_Sched_cb2_t *cb_p, void *cb_state, void *cb_state2, MPID
     struct MPIDU_Sched_cb *cb = NULL;
 
     mpi_errno = MPIDU_Sched_add_entry(s, NULL, &e);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     e->type = MPIDU_SCHED_ENTRY_CB;
     e->status = MPIDU_SCHED_ENTRY_STATUS_NOT_STARTED;
@@ -830,7 +830,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sched_progress_state
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made_progress)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -888,7 +888,7 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
                 if (e->is_barrier) {
                     /* post/perform the next round of operations */
                     mpi_errno = MPIDU_Sched_continue(s);
-                    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                    if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 }
             }
             else if (e->is_barrier && e->status < MPIDU_SCHED_ENTRY_STATUS_COMPLETE) {
@@ -906,10 +906,10 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
             /* TODO refactor into a sched_complete routine? */
             switch (s->req->errflag) {
                 case MPIR_ERR_PROC_FAILED:
-                    MPIU_ERR_SET(s->req->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm");
+                    MPIR_ERR_SET(s->req->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm");
                     break;
                 case MPIR_ERR_OTHER:
-                    MPIU_ERR_SET(s->req->status.MPI_ERROR, MPI_ERR_OTHER, "**comm");
+                    MPIR_ERR_SET(s->req->status.MPI_ERROR, MPI_ERR_OTHER, "**comm");
                     break;
                 case MPIR_ERR_NONE:
                 default:
@@ -918,7 +918,7 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
 
             mpi_errno = MPID_Request_complete(s->req);
             if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
+                MPIR_ERR_POP(mpi_errno);
             }
 
             s->req = NULL;
@@ -940,7 +940,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sched_progress
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sched_progress(int *made_progress)
 {
     int mpi_errno;
@@ -979,7 +979,7 @@ static const char *entry_to_str(enum MPIDU_Sched_entry_type type)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sched_dump_fh
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDU_Sched_dump_fh(struct MPIDU_Sched *s, FILE *fh)
 {
     int i;
@@ -1010,7 +1010,7 @@ void MPIDU_Sched_dump_fh(struct MPIDU_Sched *s, FILE *fh)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sched_dump
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDU_Sched_dump(struct MPIDU_Sched *s)
 {
     MPIDU_Sched_dump_fh(s, stderr);
diff --git a/src/mpid/common/sock/iocp/sock.c b/src/mpid/common/sock/iocp/sock.c
index b4b0e4d..a9be96f 100644
--- a/src/mpid/common/sock/iocp/sock.c
+++ b/src/mpid/common/sock/iocp/sock.c
@@ -7,8 +7,8 @@
 #include "mpiimpl.h"
 #include "mpidu_sock.h"
 
-#define MPIU_QUOTE(A) MPIU_QUOTE2(A)
-#define MPIU_QUOTE2(A) #A
+#define MPL_QUOTE(A) MPL_QUOTE2(A)
+#define MPL_QUOTE2(A) #A
 
 #define SOCKI_TCP_BUFFER_SIZE       32*1024
 #define SOCKI_DESCRIPTION_LENGTH    256
@@ -123,7 +123,7 @@ static char *get_error_string(int error_code)
 #undef FUNCNAME
 #define FUNCNAME easy_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int easy_create_ranged(SOCKET *sock, int port, unsigned long addr)
 {
     int mpi_errno=MPI_SUCCESS;
@@ -142,7 +142,7 @@ static int easy_create_ranged(SOCKET *sock, int port, unsigned long addr)
 	return mpi_errno;
     }
     
-    MPIU_ERR_CHKANDJUMP(MPIR_CVAR_CH3_PORT_RANGE.low < 0 || MPIR_CVAR_CH3_PORT_RANGE.low > MPIR_CVAR_CH3_PORT_RANGE.high, mpi_errno, MPI_ERR_OTHER, "**badportrange");
+    MPIR_ERR_CHKANDJUMP(MPIR_CVAR_CH3_PORT_RANGE.low < 0 || MPIR_CVAR_CH3_PORT_RANGE.low > MPIR_CVAR_CH3_PORT_RANGE.high, mpi_errno, MPI_ERR_OTHER, "**badportrange");
     if (port == 0 && MPIR_CVAR_CH3_PORT_RANGE.low != 0 && MPIR_CVAR_CH3_PORT_RANGE.high != 0)
     {
 	use_range = 1;
@@ -232,7 +232,7 @@ static int easy_create_ranged(SOCKET *sock, int port, unsigned long addr)
 #undef FUNCNAME
 #define FUNCNAME easy_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int easy_create(SOCKET *sock, int port, unsigned long addr)
 {
     int mpi_errno;
@@ -369,7 +369,7 @@ static inline void init_state_struct(sock_state_t *p)
 #undef FUNCNAME
 #define FUNCNAME post_next_accept
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int post_next_accept(sock_state_t * context)
 {
     int mpi_errno;
@@ -408,7 +408,7 @@ static inline int post_next_accept(sock_state_t * context)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_init()
 {
     int mpi_errno;
@@ -489,7 +489,7 @@ int MPIDU_Sock_init()
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_finalize()
 {
     int mpi_errno;
@@ -666,7 +666,7 @@ static int socki_get_host_list(char *hostname, socki_host_name_t **listp)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_hostname_to_host_description
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_hostname_to_host_description(char *hostname, char *host_description, int len)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -694,7 +694,7 @@ int MPIDU_Sock_hostname_to_host_description(char *hostname, char *host_descripti
     {
         MPIU_DBG_PRINTF(("adding host: %s\n", iter->host));
         str_errno = MPIU_Str_add_string(&host_description, &len, iter->host);
-        MPIU_ERR_CHKANDJUMP(str_errno, mpi_errno, MPIDU_SOCK_ERR_NOMEM, "**desc_len");
+        MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPIDU_SOCK_ERR_NOMEM, "**desc_len");
 
         iter = iter->next;
     }
@@ -711,7 +711,7 @@ int MPIDU_Sock_hostname_to_host_description(char *hostname, char *host_descripti
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_get_host_description
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_get_host_description(int myRank, 
 				    char * host_description, int len)
 {
@@ -763,7 +763,7 @@ int MPIDU_Sock_get_host_description(int myRank,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_create_set
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_create_set(MPIDU_Sock_set_t * set)
 {
     int mpi_errno;
@@ -793,7 +793,7 @@ int MPIDU_Sock_create_set(MPIDU_Sock_set_t * set)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_destroy_set
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_destroy_set(MPIDU_Sock_set_t set)
 {
     int mpi_errno;
@@ -826,7 +826,7 @@ int MPIDU_Sock_destroy_set(MPIDU_Sock_set_t set)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_native_to_sock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_native_to_sock(MPIDU_Sock_set_t set, MPIDU_SOCK_NATIVE_FD fd, void *user_ptr, MPIDU_Sock_t *sock_ptr)
 {
     int mpi_errno;
@@ -884,7 +884,7 @@ int MPIDU_Sock_native_to_sock(MPIDU_Sock_set_t set, MPIDU_SOCK_NATIVE_FD fd, voi
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_listen
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_listen(MPIDU_Sock_set_t set, void * user_ptr, int * port, MPIDU_Sock_t * sock)
 {
     int mpi_errno;
@@ -965,7 +965,7 @@ int MPIDU_Sock_listen(MPIDU_Sock_set_t set, void * user_ptr, int * port, MPIDU_S
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_accept
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_accept(MPIDU_Sock_t listener_sock, MPIDU_Sock_set_t set, void * user_ptr, MPIDU_Sock_t * sock)
 {
     int mpi_errno;
@@ -1122,7 +1122,7 @@ static unsigned int GetMask(char *pszMask)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_connect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_connect(MPIDU_Sock_set_t set, void * user_ptr, char * host_description, int port, MPIDU_Sock_t * sock)
 {
     int mpi_errno;
@@ -1331,7 +1331,7 @@ int MPIDU_Sock_post_connect(MPIDU_Sock_set_t set, void * user_ptr, char * host_d
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_set_user_ptr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_set_user_ptr(MPIDU_Sock_t sock, void * user_ptr)
 {
     int mpi_errno;
@@ -1358,7 +1358,7 @@ int MPIDU_Sock_set_user_ptr(MPIDU_Sock_t sock, void * user_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_close
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_close(MPIDU_Sock_t sock)
 {
     int mpi_errno;
@@ -1524,7 +1524,7 @@ int MPIDU_Sock_post_close(MPIDU_Sock_t sock)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_read
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_read(MPIDU_Sock_t sock, void * buf, MPIU_Size_t minbr, MPIU_Size_t maxbr,
                          MPIDU_Sock_progress_update_func_t fn)
 {
@@ -1543,7 +1543,7 @@ int MPIDU_Sock_post_read(MPIDU_Sock_t sock, void * buf, MPIU_Size_t minbr, MPIU_
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_readv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_readv(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIDU_Sock_progress_update_func_t fn)
 {
     int iter;
@@ -1650,7 +1650,7 @@ int MPIDU_Sock_post_readv(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIDU_Soc
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_write
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_write(MPIDU_Sock_t sock, void * buf, MPIU_Size_t min, MPIU_Size_t max, MPIDU_Sock_progress_update_func_t fn)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1668,7 +1668,7 @@ int MPIDU_Sock_post_write(MPIDU_Sock_t sock, void * buf, MPIU_Size_t min, MPIU_S
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_writev
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIDU_Sock_progress_update_func_t fn)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1762,7 +1762,7 @@ int MPIDU_Sock_post_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIDU_So
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_wait
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 {
     /*double t1, t2;*/
@@ -1780,13 +1780,14 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
     for (;;) 
     {
 #if defined(MPICH_IS_THREADED)
-#       if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#       if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
 	{
+            int err;
 	    /* Release the lock so that other threads may make progress while this thread waits for something to do */
 	    MPIU_DBG_MSG(THREAD,TYPICAL,"Exit global critical section");
-	    MPIU_THREAD_CHECK_BEGIN 
-	    MPID_Thread_mutex_unlock(&MPIR_ThreadInfo.global_mutex);
-	    MPIU_THREAD_CHECK_END
+	    MPIU_THREAD_CHECK_BEGIN;
+	    MPID_Thread_mutex_unlock(&MPIR_ThreadInfo.global_mutex, &err);
+	    MPIU_THREAD_CHECK_END;
 	}
 #       else
 #           error selected multi-threaded implementation is not supported
@@ -1804,13 +1805,14 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	    /*printf("[%d] GetQueuedCompletionStatus took %.3f seconds for sock: %d\n", getpid(), t2-t1, sock->sock);*/
 	    MPIDI_FUNC_EXIT(MPID_STATE_GETQUEUEDCOMPLETIONSTATUS);
 #if defined(MPICH_IS_THREADED)
-#           if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#           if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
 	    {
+                int err;
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
 		MPIU_DBG_MSG(THREAD,TYPICAL,"Enter global critical section");
-		MPIU_THREAD_CHECK_BEGIN 
-		MPID_Thread_mutex_lock(&MPIR_ThreadInfo.global_mutex);
-		MPIU_THREAD_CHECK_END
+		MPIU_THREAD_CHECK_BEGIN;
+		MPID_Thread_mutex_lock(&MPIR_ThreadInfo.global_mutex, &err);
+		MPIU_THREAD_CHECK_END;
 	    }
 #           else
 #               error selected multi-threaded implementation is not supported
@@ -2396,13 +2398,14 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	else
 	{
 #if defined(MPICH_IS_THREADED)
-#           if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#           if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
 	    {
+                int err;
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
 		MPIU_DBG_MSG(THREAD,TYPICAL,"Enter global critical section");
-		MPIU_THREAD_CHECK_BEGIN 
-		MPID_Thread_mutex_lock(&MPIR_ThreadInfo.global_mutex);
-		MPIU_THREAD_CHECK_END
+		MPIU_THREAD_CHECK_BEGIN;
+		MPID_Thread_mutex_lock(&MPIR_ThreadInfo.global_mutex, &err);
+		MPIU_THREAD_CHECK_END;
 	    }
 #           else
 #               error selected multi-threaded implementation is not supported
@@ -2637,7 +2640,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_wakeup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_wakeup(MPIDU_Sock_set_t set)
 {
     /* post a completion event to wake up sock_wait */
@@ -2648,7 +2651,7 @@ int MPIDU_Sock_wakeup(MPIDU_Sock_set_t set)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_read
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_read(MPIDU_Sock_t sock, void * buf, MPIU_Size_t len, MPIU_Size_t * num_read)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -2666,7 +2669,7 @@ int MPIDU_Sock_read(MPIDU_Sock_t sock, void * buf, MPIU_Size_t len, MPIU_Size_t
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_readv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_readv(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t * num_read)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -2735,7 +2738,7 @@ int MPIDU_Sock_readv(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t *
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_write
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_write(MPIDU_Sock_t sock, void * buf, MPIU_Size_t len, MPIU_Size_t * num_written)
 {
     int mpi_errno;
@@ -2753,7 +2756,7 @@ int MPIDU_Sock_write(MPIDU_Sock_t sock, void * buf, MPIU_Size_t len, MPIU_Size_t
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_writev
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t * num_written)
 {
     int mpi_errno;
@@ -2810,7 +2813,7 @@ int MPIDU_Sock_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t *
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_get_sock_id
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_get_sock_id(MPIDU_Sock_t sock)
 {
     int ret_val;
@@ -2833,7 +2836,7 @@ int MPIDU_Sock_get_sock_id(MPIDU_Sock_t sock)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_get_sock_set_id
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_get_sock_set_id(MPIDU_Sock_set_t set)
 {
     int ret_val;
@@ -2848,7 +2851,7 @@ int MPIDU_Sock_get_sock_set_id(MPIDU_Sock_set_t set)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_get_error_class_string
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_get_error_class_string(int error, char *error_string, int length)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPIDU_SOCK_GET_ERROR_CLASS_STRING);
diff --git a/src/mpid/common/sock/poll/sock_immed.i b/src/mpid/common/sock/poll/sock_immed.i
index 6e2245e..2a17dd5 100644
--- a/src/mpid/common/sock/poll/sock_immed.i
+++ b/src/mpid/common/sock/poll/sock_immed.i
@@ -17,7 +17,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_accept
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_accept(struct MPIDU_Sock * listener, 
 		      struct MPIDU_Sock_set * sock_set, void * user_ptr,
 		      struct MPIDU_Sock ** sockp)
@@ -162,7 +162,7 @@ int MPIDU_Sock_accept(struct MPIDU_Sock * listener,
        made at that time? */
 #if 1
     mpi_errno = MPIDU_Sock_SetSockBufferSize( fd, 1 );
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
 #else
     if (MPIDU_Socki_socket_bufsz > 0)
     {
@@ -257,7 +257,7 @@ int MPIDU_Sock_accept(struct MPIDU_Sock * listener,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_read
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_read(MPIDU_Sock_t sock, void * buf, MPIU_Size_t len, 
 		    MPIU_Size_t * num_read)
 {
@@ -376,7 +376,7 @@ int MPIDU_Sock_read(MPIDU_Sock_t sock, void * buf, MPIU_Size_t len,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_readv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_readv(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, 
 		     MPIU_Size_t * num_read)
 {
@@ -490,7 +490,7 @@ int MPIDU_Sock_readv(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_write
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_write(MPIDU_Sock_t sock, void * buf, MPIU_Size_t len, 
 		     MPIU_Size_t * num_written)
 {
@@ -576,7 +576,7 @@ int MPIDU_Sock_write(MPIDU_Sock_t sock, void * buf, MPIU_Size_t len,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_writev
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t * num_written)
 {
     struct pollfd * pollfd;
@@ -661,7 +661,7 @@ int MPIDU_Sock_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t *
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_wakeup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_wakeup(struct MPIDU_Sock_set * sock_set)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -678,7 +678,7 @@ int MPIDU_Sock_wakeup(struct MPIDU_Sock_set * sock_set)
        be implemented as an abstraction (e.g., wakeup_progress_threads?)
        rather than this specific code.  */
 #ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN
+    MPIU_THREAD_CHECK_BEGIN;
     {
 	struct pollinfo * pollinfo;
 	
@@ -687,7 +687,7 @@ int MPIDU_Sock_wakeup(struct MPIDU_Sock_set * sock_set)
 				  mpi_errno, mpi_errno, fn_exit);
 	MPIDU_Socki_wakeup(sock_set);
     }
-    MPIU_THREAD_CHECK_END
+    MPIU_THREAD_CHECK_END;
 #   endif
 
 #ifdef MPICH_IS_THREADED
diff --git a/src/mpid/common/sock/poll/sock_init.i b/src/mpid/common/sock/poll/sock_init.i
index c8d255b..26c0868 100644
--- a/src/mpid/common/sock/poll/sock_init.i
+++ b/src/mpid/common/sock/poll/sock_init.i
@@ -10,7 +10,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_init(void)
 {
     MPIDI_STATE_DECL(MPID_STATE_MPIDU_SOCK_INIT);
@@ -27,7 +27,7 @@ int MPIDU_Sock_init(void)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
diff --git a/src/mpid/common/sock/poll/sock_misc.i b/src/mpid/common/sock/poll/sock_misc.i
index e6c6bd8..b6f3d9d 100644
--- a/src/mpid/common/sock/poll/sock_misc.i
+++ b/src/mpid/common/sock/poll/sock_misc.i
@@ -13,7 +13,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_get_host_description
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_get_host_description(int myRank, 
 				    char * host_description, int len)
 {
@@ -95,7 +95,7 @@ int MPIDU_Sock_get_host_description(int myRank,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_native_to_sock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_native_to_sock(struct MPIDU_Sock_set * sock_set, MPIDU_SOCK_NATIVE_FD fd, void *user_ptr,
 			      struct MPIDU_Sock ** sockp)
 {
@@ -176,7 +176,7 @@ int MPIDU_Sock_native_to_sock(struct MPIDU_Sock_set * sock_set, MPIDU_SOCK_NATIV
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_set_user_ptr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_set_user_ptr(struct MPIDU_Sock * sock, void * user_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -210,7 +210,7 @@ int MPIDU_Sock_set_user_ptr(struct MPIDU_Sock * sock, void * user_ptr)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_get_sock_id
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_get_sock_id(struct MPIDU_Sock * sock)
 {
     int id;
@@ -241,7 +241,7 @@ int MPIDU_Sock_get_sock_id(struct MPIDU_Sock * sock)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_get_sock_set_id
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_get_sock_set_id(struct MPIDU_Sock_set * sock_set)
 {
     int id;
@@ -274,7 +274,7 @@ int MPIDU_Sock_get_sock_set_id(struct MPIDU_Sock_set * sock_set)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_get_error_class_string
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* --BEGIN ERROR HANDLING-- */
 int MPIDU_Sock_get_error_class_string(int error, char *error_string, size_t length)
 {
diff --git a/src/mpid/common/sock/poll/sock_post.i b/src/mpid/common/sock/poll/sock_post.i
index b248197..c787d97 100644
--- a/src/mpid/common/sock/poll/sock_post.i
+++ b/src/mpid/common/sock/poll/sock_post.i
@@ -10,7 +10,7 @@
 #undef FUNCNAME 
 #define FUNCNAME MPIDU_Sock_post_connect_ifaddr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* 
  This routine connects to a particular address (in byte form; for ipv4, 
  the address is four bytes, typically the value of h_addr_list[0] in 
@@ -58,20 +58,20 @@ int MPIDU_Sock_post_connect_ifaddr( struct MPIDU_Sock_set * sock_set,
 	   clue for system error messages (e.g., %dSE; in the recommended
 	   revision for error reporting (that is, value (errno) is an int, 
 	   but should be interpreted as an System Error string) */
-	MPIU_ERR_SETANDJUMP2(mpi_errno,MPIDU_SOCK_ERR_FAIL,
+	MPIR_ERR_SETANDJUMP2(mpi_errno,MPIDU_SOCK_ERR_FAIL,
 			     "**sock|poll|socket", 
 		    "**sock|poll|socket %d %s", errno, MPIU_Strerror(errno));
     }
 
     flags = fcntl(fd, F_GETFL, 0);
     if (flags == -1) {
-	MPIU_ERR_SETANDJUMP2(mpi_errno,MPIDU_SOCK_ERR_FAIL,
+	MPIR_ERR_SETANDJUMP2(mpi_errno,MPIDU_SOCK_ERR_FAIL,
 			     "**sock|poll|nonblock", 
                     "**sock|poll|nonblock %d %s", errno, MPIU_Strerror(errno));
     }
     rc = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
     if (rc == -1) {
-	MPIU_ERR_SETANDJUMP2( mpi_errno, MPIDU_SOCK_ERR_FAIL,
+	MPIR_ERR_SETANDJUMP2( mpi_errno, MPIDU_SOCK_ERR_FAIL,
 			      "**sock|poll|nonblock", 
 			      "**sock|poll|nonblock %d %s",
 			      errno, MPIU_Strerror(errno));
@@ -80,7 +80,7 @@ int MPIDU_Sock_post_connect_ifaddr( struct MPIDU_Sock_set * sock_set,
     nodelay = 1;
     rc = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay));
     if (rc != 0) {
-	MPIU_ERR_SETANDJUMP2(mpi_errno,MPIDU_SOCK_ERR_FAIL,
+	MPIR_ERR_SETANDJUMP2(mpi_errno,MPIDU_SOCK_ERR_FAIL,
 			     "**sock|poll|nodelay", 
 			     "**sock|poll|nodelay %d %s", 
 			     errno, MPIU_Strerror(errno));
@@ -97,7 +97,7 @@ int MPIDU_Sock_post_connect_ifaddr( struct MPIDU_Sock_set * sock_set,
      */
     mpi_errno = MPIDU_Socki_sock_alloc(sock_set, &sock);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPIDU_SOCK_ERR_NOMEM,
+	MPIR_ERR_SETANDJUMP(mpi_errno,MPIDU_SOCK_ERR_NOMEM,
 			    "**sock|sockalloc");
     }
 
@@ -120,7 +120,7 @@ int MPIDU_Sock_post_connect_ifaddr( struct MPIDU_Sock_set * sock_set,
      * Set and verify the socket buffer size
      */
     mpi_errno = MPIDU_Sock_SetSockBufferSize( fd, 1 );
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) { MPIR_ERR_POP(mpi_errno); }
     
     /*
      * Attempt to establish the connection
@@ -203,7 +203,7 @@ int MPIDU_Sock_post_connect_ifaddr( struct MPIDU_Sock_set * sock_set,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_connect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_connect(struct MPIDU_Sock_set * sock_set, void * user_ptr, 
 			    char * host_description, int port,
 			    struct MPIDU_Sock ** sockp)
@@ -246,7 +246,7 @@ int MPIDU_Sock_post_connect(struct MPIDU_Sock_set * sock_set, void * user_ptr,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_listen
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 #ifndef USHRT_MAX
 #define USHRT_MAX 65535   /* 2^16-1 */
 #endif
@@ -333,7 +333,7 @@ int MPIDU_Sock_listen(struct MPIDU_Sock_set * sock_set, void * user_ptr,
 	int portnum;
 	/* see if we actually want to find values within a range */
 
-        MPIU_ERR_CHKANDJUMP(MPIR_CVAR_CH3_PORT_RANGE.low < 0 || MPIR_CVAR_CH3_PORT_RANGE.low > MPIR_CVAR_CH3_PORT_RANGE.high, mpi_errno, MPI_ERR_OTHER, "**badportrange");
+        MPIR_ERR_CHKANDJUMP(MPIR_CVAR_CH3_PORT_RANGE.low < 0 || MPIR_CVAR_CH3_PORT_RANGE.low > MPIR_CVAR_CH3_PORT_RANGE.high, mpi_errno, MPI_ERR_OTHER, "**badportrange");
 
         /* default MPICH_PORT_RANGE is {0,0} so bind will use any available port */
         for (portnum = MPIR_CVAR_CH3_PORT_RANGE.low; portnum <= MPIR_CVAR_CH3_PORT_RANGE.high; ++portnum) {
@@ -373,7 +373,7 @@ int MPIDU_Sock_listen(struct MPIDU_Sock_set * sock_set, void * user_ptr,
      * Set and verify the socket buffer size
      */
     mpi_errno = MPIDU_Sock_SetSockBufferSize( fd, 1 );
-    if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
+    if (mpi_errno) { MPIR_ERR_POP( mpi_errno ); }
     
     /*
      * Start listening for incoming connections...
@@ -452,7 +452,7 @@ int MPIDU_Sock_listen(struct MPIDU_Sock_set * sock_set, void * user_ptr,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_read
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_read(struct MPIDU_Sock * sock, void * buf, MPIU_Size_t minlen, MPIU_Size_t maxlen,
 			 MPIDU_Sock_progress_update_func_t fn)
 {
@@ -502,7 +502,7 @@ int MPIDU_Sock_post_read(struct MPIDU_Sock * sock, void * buf, MPIU_Size_t minle
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_readv
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_readv(struct MPIDU_Sock * sock, MPL_IOV * iov, int iov_n, MPIDU_Sock_progress_update_func_t fn)
 {
     struct pollfd * pollfd;
@@ -551,7 +551,7 @@ int MPIDU_Sock_post_readv(struct MPIDU_Sock * sock, MPL_IOV * iov, int iov_n, MP
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_write
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_write(struct MPIDU_Sock * sock, void * buf, MPIU_Size_t minlen, MPIU_Size_t maxlen,
 			  MPIDU_Sock_progress_update_func_t fn)
 {
@@ -601,7 +601,7 @@ int MPIDU_Sock_post_write(struct MPIDU_Sock * sock, void * buf, MPIU_Size_t minl
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_writev
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_writev(struct MPIDU_Sock * sock, MPL_IOV * iov, int iov_n, MPIDU_Sock_progress_update_func_t fn)
 {
     struct pollfd * pollfd;
@@ -650,7 +650,7 @@ int MPIDU_Sock_post_writev(struct MPIDU_Sock * sock, MPL_IOV * iov, int iov_n, M
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_post_close
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_post_close(struct MPIDU_Sock * sock)
 {
     struct pollfd * pollfd;
diff --git a/src/mpid/common/sock/poll/sock_set.i b/src/mpid/common/sock/poll/sock_set.i
index 8948e1d..72e80f6 100644
--- a/src/mpid/common/sock/poll/sock_set.i
+++ b/src/mpid/common/sock/poll/sock_set.i
@@ -8,7 +8,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_create_set
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_create_set(struct MPIDU_Sock_set ** sock_setp)
 {
     struct MPIDU_Sock_set * sock_set = NULL;
@@ -55,7 +55,7 @@ int MPIDU_Sock_create_set(struct MPIDU_Sock_set ** sock_setp)
 #   endif
 
 #   ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN
+    MPIU_THREAD_CHECK_BEGIN;
     {
 	struct MPIDU_Sock * sock = NULL;
 	struct pollfd * pollfd;
@@ -134,7 +134,7 @@ int MPIDU_Sock_create_set(struct MPIDU_Sock_set ** sock_setp)
 
 	MPIDU_SOCKI_POLLFD_OP_SET(pollfd, pollinfo, POLLIN);
     }
-    MPIU_THREAD_CHECK_END
+    MPIU_THREAD_CHECK_END;
 #   endif
 
     *sock_setp = sock_set;
@@ -148,7 +148,7 @@ int MPIDU_Sock_create_set(struct MPIDU_Sock_set ** sock_setp)
     if (sock_set != NULL)
     {
 #       ifdef MPICH_IS_THREADED
-	MPIU_THREAD_CHECK_BEGIN
+	MPIU_THREAD_CHECK_BEGIN;
 	{
 	    if (sock_set->intr_fds[0] != -1)
 	    {
@@ -160,7 +160,7 @@ int MPIDU_Sock_create_set(struct MPIDU_Sock_set ** sock_setp)
 		close(sock_set->intr_fds[1]);
 	    }
 	}
-	MPIU_THREAD_CHECK_END
+	MPIU_THREAD_CHECK_END;
 #	endif
 	
 	MPIU_Free(sock_set);
@@ -173,7 +173,7 @@ int MPIDU_Sock_create_set(struct MPIDU_Sock_set ** sock_setp)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_close_open_sockets
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_close_open_sockets(struct MPIDU_Sock_set * sock_set, void** user_ptr ){
 
     int i;
@@ -206,7 +206,7 @@ int MPIDU_Sock_close_open_sockets(struct MPIDU_Sock_set * sock_set, void** user_
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_destroy_set
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_destroy_set(struct MPIDU_Sock_set * sock_set)
 {
     int elem;
@@ -231,7 +231,7 @@ int MPIDU_Sock_destroy_set(struct MPIDU_Sock_set * sock_set)
      * Close pipe for interrupting a blocking poll()
      */
 #   ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN
+    MPIU_THREAD_CHECK_BEGIN;
     {
 	close(sock_set->intr_fds[1]);
 	close(sock_set->intr_fds[0]);
@@ -244,7 +244,7 @@ int MPIDU_Sock_destroy_set(struct MPIDU_Sock_set * sock_set)
 	sock_set->intr_fds[1] = -1;
 	sock_set->intr_sock = NULL;
     }
-    MPIU_THREAD_CHECK_END
+    MPIU_THREAD_CHECK_END;
 #   endif
 
     /*
diff --git a/src/mpid/common/sock/poll/sock_wait.i b/src/mpid/common/sock/poll/sock_wait.i
index 1e1759c..6913cbe 100644
--- a/src/mpid/common/sock/poll/sock_wait.i
+++ b/src/mpid/common/sock/poll/sock_wait.i
@@ -7,7 +7,7 @@
 
 /* Make sure that we can properly ensure atomic access to the poll routine */
 #ifdef MPICH_IS_THREADED
-#if !(MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#if !(MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
 #error selected multi-threaded implementation is not supported
 #endif
 #endif
@@ -42,7 +42,7 @@ static int MPIDU_Socki_handle_connect(struct pollfd * const pollfd,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Sock_wait
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDU_Sock_wait(struct MPIDU_Sock_set * sock_set, int millisecond_timeout,
 		    struct MPIDU_Sock_event * eventp)
 {
@@ -138,6 +138,7 @@ int MPIDU_Sock_wait(struct MPIDU_Sock_set * sock_set, int millisecond_timeout,
 		if (n_fds == 0 && millisecond_timeout != 0)
 		{
 		    int pollfds_active_elems = sock_set->poll_array_elems;
+                    int err;
 		
 		    /* The abstraction here is a shared (blocking) resource that
 		       the threads must coordinate.  That means not holding 
@@ -155,9 +156,9 @@ int MPIDU_Sock_wait(struct MPIDU_Sock_set * sock_set, int millisecond_timeout,
 		       progress while this thread waits for something to 
 		       do */
 		    MPIU_DBG_MSG(THREAD,TYPICAL,"Exit global critical section (sock_wait)");
-		    /* 		    MPIU_THREAD_CS_EXIT(MPIDCOMM,);
-				    MPIU_THREAD_CS_EXIT(ALLFUNC,); */
-		    MPID_Thread_mutex_unlock(&MPIR_ThreadInfo.global_mutex);
+		    /* 		    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.global_mutex);
+				    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex); */
+		    MPID_Thread_mutex_unlock(&MPIR_ThreadInfo.global_mutex, &err);
 			    
 		    MPIDI_FUNC_ENTER(MPID_STATE_POLL);
 		    n_fds = poll(sock_set->pollfds_active, 
@@ -167,9 +168,9 @@ int MPIDU_Sock_wait(struct MPIDU_Sock_set * sock_set, int millisecond_timeout,
 		    /* Reaquire the lock before processing any of the 
 		       information returned from poll */
 		    MPIU_DBG_MSG(THREAD,TYPICAL,"Enter global critical section (sock_wait)");
-		    /* 		    MPIU_THREAD_CS_ENTER(ALLFUNC,);
-				    MPIU_THREAD_CS_ENTER(MPIDCOMM,); */
-		    MPID_Thread_mutex_lock(&MPIR_ThreadInfo.global_mutex);
+		    /* 		    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
+				    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.global_mutex); */
+		    MPID_Thread_mutex_lock(&MPIR_ThreadInfo.global_mutex, &err);
 
 		    /*
 		     * Update pollfds array if changes were posted while we 
@@ -395,7 +396,7 @@ int MPIDU_Sock_wait(struct MPIDU_Sock_set * sock_set, int millisecond_timeout,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_handle_pollhup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Socki_handle_pollhup(struct pollfd * const pollfd, struct pollinfo * const pollinfo)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -471,7 +472,7 @@ static int MPIDU_Socki_handle_pollhup(struct pollfd * const pollfd, struct polli
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_handle_pollerr
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Socki_handle_pollerr(struct pollfd * const pollfd, struct pollinfo * const pollinfo)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -567,7 +568,7 @@ static int MPIDU_Socki_handle_pollerr(struct pollfd * const pollfd, struct polli
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_handle_read
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Socki_handle_read(struct pollfd * const pollfd, struct pollinfo * const pollinfo)
 {
     ssize_t nb;
@@ -686,7 +687,7 @@ static int MPIDU_Socki_handle_read(struct pollfd * const pollfd, struct pollinfo
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_handle_write
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Socki_handle_write(struct pollfd * const pollfd, struct pollinfo * const pollinfo)
 {
     ssize_t nb;
@@ -779,7 +780,7 @@ static int MPIDU_Socki_handle_write(struct pollfd * const pollfd, struct pollinf
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_handle_connect
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Socki_handle_connect(struct pollfd * const pollfd, struct pollinfo * const pollinfo)
 {
     struct sockaddr_in addr;
diff --git a/src/mpid/common/sock/poll/socki_util.i b/src/mpid/common/sock/poll/socki_util.i
index 5ad18c0..20daf56 100644
--- a/src/mpid/common/sock/poll/socki_util.i
+++ b/src/mpid/common/sock/poll/socki_util.i
@@ -358,10 +358,10 @@ static struct MPIDU_Socki_eventq_table *MPIDU_Socki_eventq_table_head=NULL;
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_wakeup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Socki_wakeup(struct MPIDU_Sock_set * sock_set)
 {
-    MPIU_THREAD_CHECK_BEGIN
+    MPIU_THREAD_CHECK_BEGIN;
     if (sock_set->wakeup_posted == FALSE)
     {
 	for(;;)
@@ -380,7 +380,7 @@ static int MPIDU_Socki_wakeup(struct MPIDU_Sock_set * sock_set)
 	
 	sock_set->wakeup_posted = TRUE;
     }
-    MPIU_THREAD_CHECK_END
+    MPIU_THREAD_CHECK_END;
     return MPIDU_SOCK_SUCCESS;
 }
 /* end MPIDU_Socki_wakeup() */
@@ -388,7 +388,7 @@ static int MPIDU_Socki_wakeup(struct MPIDU_Sock_set * sock_set)
 #undef FUNCNAME
 #define FUNCNAME MPIDI_Sock_update_sock_set
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIDI_Sock_update_sock_set( struct MPIDU_Sock_set *sock_set, 
 				int pollfds_active_elems )
 {
@@ -443,7 +443,7 @@ int MPIDI_Sock_update_sock_set( struct MPIDU_Sock_set *sock_set,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_os_to_mpi_errno
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 /* --BEGIN ERROR HANDLING-- */
 static int MPIDU_Socki_os_to_mpi_errno(struct pollinfo * pollinfo, int os_errno, const char * fcname, int line, int * disconnected)
 {
@@ -533,7 +533,7 @@ static int MPIDU_Socki_os_to_mpi_errno(struct pollinfo * pollinfo, int os_errno,
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_adjust_iov
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Socki_adjust_iov(ssize_t nb, MPL_IOV * const iov, const int count, int * const offsetp)
 {
     int offset = *offsetp;
@@ -563,7 +563,7 @@ static int MPIDU_Socki_adjust_iov(ssize_t nb, MPL_IOV * const iov, const int cou
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_sock_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Socki_sock_alloc(struct MPIDU_Sock_set * sock_set, struct MPIDU_Sock ** sockp)
 {
     struct MPIDU_Sock * sock = NULL;
@@ -722,12 +722,12 @@ static int MPIDU_Socki_sock_alloc(struct MPIDU_Sock_set * sock_set, struct MPIDU
 
 #   ifdef MPICH_IS_THREADED
     {
-    MPIU_THREAD_CHECK_BEGIN
+        MPIU_THREAD_CHECK_BEGIN;
 	if (sock_set->pollfds_active != NULL)
 	{
 	    sock_set->pollfds_updated = TRUE;
 	}
-    MPIU_THREAD_CHECK_END
+        MPIU_THREAD_CHECK_END;
     }
 #   endif
     
@@ -763,7 +763,7 @@ static int MPIDU_Socki_sock_alloc(struct MPIDU_Sock_set * sock_set, struct MPIDU
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_sock_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static void MPIDU_Socki_sock_free(struct MPIDU_Sock * sock)
 {
     struct pollfd * pollfd = MPIDU_Socki_sock_get_pollfd(sock);
@@ -831,7 +831,7 @@ static void MPIDU_Socki_sock_free(struct MPIDU_Sock * sock)
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_event_enqueue
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Socki_event_enqueue(struct pollinfo * pollinfo, MPIDU_Sock_op_t op, MPIU_Size_t num_bytes,
 				     void * user_ptr, int error)
 {
@@ -904,7 +904,7 @@ fn_exit:
 #undef FUNCNAME
 #define FUNCNAME MPIDU_Socki_event_dequeue
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIDU_Socki_event_dequeue(struct MPIDU_Sock_set * sock_set, int * set_elem, struct MPIDU_Sock_event * eventp)
 {
     struct MPIDU_Socki_eventq_elem * eventq_elem;
@@ -999,7 +999,7 @@ int MPIDU_Sock_SetSockBufferSize( int fd, int firm )
 	bufsz_len = sizeof(bufsz);
 	rc = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &bufsz, bufsz_len);
 	if (rc == -1) {
-	    MPIU_ERR_SETANDJUMP3(mpi_errno,MPIDU_SOCK_ERR_FAIL, 
+	    MPIR_ERR_SETANDJUMP3(mpi_errno,MPIDU_SOCK_ERR_FAIL, 
 				 "**sock|poll|setsndbufsz",
 				 "**sock|poll|setsndbufsz %d %d %s", 
 				 bufsz, errno, MPIU_Strerror(errno));
@@ -1008,7 +1008,7 @@ int MPIDU_Sock_SetSockBufferSize( int fd, int firm )
 	bufsz_len = sizeof(bufsz);
 	rc = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bufsz, bufsz_len);
 	if (rc == -1) {
-	    MPIU_ERR_SETANDJUMP3(mpi_errno,MPIDU_SOCK_ERR_FAIL, 
+	    MPIR_ERR_SETANDJUMP3(mpi_errno,MPIDU_SOCK_ERR_FAIL, 
 				 "**sock|poll|setrcvbufsz",
 				 "**sock|poll|setrcvbufsz %d %d %s", 
 				 bufsz, errno, MPIU_Strerror(errno));
diff --git a/src/mpid/common/thread/Makefile.mk b/src/mpid/common/thread/Makefile.mk
index 05238da..5461ddd 100644
--- a/src/mpid/common/thread/Makefile.mk
+++ b/src/mpid/common/thread/Makefile.mk
@@ -6,13 +6,10 @@
 ###
 
 if BUILD_MPID_COMMON_THREAD
-if THREAD_SERIALIZED_OR_MULTIPLE
 
 # so that clients can successfully include mpid_thread.h
 AM_CPPFLAGS += -I$(top_srcdir)/src/mpid/common/thread
 
-noinst_HEADERS += src/mpid/common/thread/mpid_thread.h
+noinst_HEADERS += src/mpid/common/thread/mpid_thread_fallback.h
 
-endif THREAD_SERIALIZED_OR_MULTIPLE
 endif BUILD_MPID_COMMON_THREAD
-
diff --git a/src/mpid/common/thread/mpid_thread.h b/src/mpid/common/thread/mpid_thread.h
deleted file mode 100644
index 49a7853..0000000
--- a/src/mpid/common/thread/mpid_thread.h
+++ /dev/null
@@ -1,307 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#if !defined(MPID_THREAD_H_INCLUDED)
-#define MPID_THREAD_H_INCLUDED
-
-/*
- * Implementation specific type definitions
- *
- * (formerly lived in mpe_types.i)
- */
-
-#include "mpiutil.h"
-
-typedef MPIU_Thread_mutex_t MPID_Thread_mutex_t;
-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;
-
-
-/*
- * Threads
- */
-
-typedef void (* MPID_Thread_func_t)(void * data);
-
-/*@
-  MPID_Thread_create - create a new thread
-
-  Input Parameters:
-+ func - function to run in new thread
-- data - data to be passed to thread function
-
-  Output Parameters:
-+ id - identifier for the new thread
-- err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-
-  Notes:
-  The thread is created in a detach state, meaning that is may not be waited upon.  If another thread needs to wait for this
-  thread to complete, the threads must provide their own synchronization mechanism.
-@*/
-static inline void MPID_Thread_create(MPID_Thread_func_t func, void * data, MPID_Thread_id_t * id, int * err)
-{
-    MPIU_Thread_create(func,data,id,err);
-}
-
-/*@
-  MPID_Thread_exit - exit from the current thread
-@*/
-static inline void MPID_Thread_exit(void)
-{
-    MPIU_Thread_exit();
-}
-/*@
-  MPID_Thread_self - get the identifier of the current thread
-
-  Output Parameter:
-. id - identifier of current thread
-@*/
-static inline void MPID_Thread_self(MPID_Thread_id_t * id)
-{
-    MPIU_Thread_self(id);
-}
-/*@
-  MPID_Thread_same - compare two threads identifiers to see if refer to the same thread
-
-  Input Parameters:
-+ id1 - first identifier
-- id2 - second identifier
-  
-  Output Parameter:
-. same - TRUE if the two threads identifiers refer to the same thread; FALSE otherwise
-@*/
-static inline void MPID_Thread_same(MPID_Thread_id_t * id1, MPID_Thread_id_t * id2, int * same)
-{
-    MPIU_Thread_same(id1,id2,same);
-}
-/*@
-  MPID_Thread_yield - voluntarily relinquish the CPU, giving other threads an opportunity to run
-@*/
-static inline void MPID_Thread_yield(MPID_Thread_mutex_t *t)
-{
-    MPIU_Thread_yield(t);
-}
-
-/*
- *    Mutexes
- */
-
-/*@
-  MPID_Thread_mutex_create - create a new mutex
-  
-  Output Parameters:
-+ mutex - mutex
-- err - error code (non-zero indicates an error has occurred)
-@*/
-static inline void MPID_Thread_mutex_create(MPID_Thread_mutex_t * mutex, int * err)
-{
-    MPIU_Thread_mutex_create(mutex,err);
-}
-/*@
-  MPID_Thread_mutex_destroy - destroy an existing mutex
-  
-  Input Parameter:
-. mutex - mutex
-
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-static inline void MPID_Thread_mutex_destroy(MPID_Thread_mutex_t * mutex, int * err)
-{
-    MPIU_Thread_mutex_destroy(mutex,err);
-}
-/*@
-  MPID_Thread_lock - acquire a mutex
-  
-  Input Parameter:
-. mutex - mutex
-@*/
-static inline void MPID_Thread_mutex_lock(MPID_Thread_mutex_t * mutex)
-{
-    int err;
-    MPIU_Thread_mutex_lock(mutex,&err);
-    MPIU_Assert_fmt_msg(err == MPIU_THREAD_SUCCESS,
-                        ("mutex_lock failed, err=%d (%s)",err,MPIU_Strerror(err)));
-}
-/*@
-  MPID_Thread_unlock - release a mutex
-  
-  Input Parameter:
-. mutex - mutex
-@*/
-static inline void MPID_Thread_mutex_unlock(MPID_Thread_mutex_t * mutex)
-{
-    int err;
-    MPIU_Thread_mutex_unlock(mutex,&err);
-    MPIU_Assert_fmt_msg(err == MPIU_THREAD_SUCCESS,
-                        ("mutex_unlock failed, err=%d (%s)",err,MPIU_Strerror(err)));
-}
-/*@
-  MPID_Thread_mutex_trylock - try to acquire a mutex, but return even if unsuccessful
-  
-  Input Parameter:
-. mutex - mutex
-
-  Output Parameter:
-. flag - flag
-@*/
-static inline void MPID_Thread_mutex_trylock(MPID_Thread_mutex_t * mutex, int * flag)
-{
-    int err;
-    MPIU_Thread_mutex_trylock(mutex,flag,&err);
-    MPIU_Assert_fmt_msg(err == MPIU_THREAD_SUCCESS,
-                        ("mutex_trylock failed, err=%d (%s)",err,MPIU_Strerror(err)));
-}
-
-/*
- * Condition Variables
- */
-
-/*@
-  MPID_Thread_cond_create - create a new condition variable
-  
-  Output Parameters:
-+ cond - condition variable
-- err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-static inline void MPID_Thread_cond_create(MPID_Thread_cond_t * cond, int * err)
-{
-    MPIU_Thread_cond_create(cond,err);
-}
-/*@
-  MPID_Thread_cond_destroy - destroy an existinga condition variable
-  
-  Input Parameter:
-. cond - condition variable
-
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero 
-        for success, non-zero if a failure occurred
-@*/
-static inline void MPID_Thread_cond_destroy(MPID_Thread_cond_t * cond, int * err)
-{
-    MPIU_Thread_cond_destroy(cond,err);
-}
-/*@
-  MPID_Thread_cond_wait - wait (block) on a condition variable
-  
-  Input Parameters:
-+ cond - condition variable
-- mutex - mutex
-
-  Notes:
-  This function may return even though another thread has not requested that a 
-  thread be released.  Therefore, the calling
-  program must wrap the function in a while loop that verifies program state 
-  has changed in a way that warrants letting the
-  thread proceed.
-@*/
-static inline void MPID_Thread_cond_wait(MPID_Thread_cond_t * cond, MPID_Thread_mutex_t * mutex)
-{
-    int err;
-    MPIU_Thread_cond_wait(cond,mutex,&err);
-    MPIU_Assert_fmt_msg(err == MPIU_THREAD_SUCCESS,
-                        ("cond_wait failed, err=%d (%s)",err,MPIU_Strerror(err)));
-}
-/*@
-  MPID_Thread_cond_broadcast - release all threads currently waiting on a condition variable
-  
-  Input Parameter:
-. cond - condition variable
-@*/
-static inline void MPID_Thread_cond_broadcast(MPID_Thread_cond_t * cond)
-{
-    int err;
-    MPIU_Thread_cond_broadcast(cond,&err);
-    MPIU_Assert_fmt_msg(err == MPIU_THREAD_SUCCESS,
-                        ("cond_broadcast failed, err=%d (%s)",err,MPIU_Strerror(err)));
-}
-/*@
-  MPID_Thread_cond_signal - release one thread currently waitng on a condition variable
-  
-  Input Parameter:
-. cond - condition variable
-@*/
-static inline void MPID_Thread_cond_signal(MPID_Thread_cond_t * cond)
-{
-    int err;
-    MPIU_Thread_cond_signal(cond,&err);
-    MPIU_Assert_fmt_msg(err == MPIU_THREAD_SUCCESS,
-                        ("cond_signal failed, err=%d (%s)",err,MPIU_Strerror(err)));
-}
-
-/*
- * Thread Local Storage
- */
-typedef void (*MPID_Thread_tls_exit_func_t)(void * value);
-/*@
-  MPID_Thread_tls_create - create a thread local storage space
-
-  Input Parameter:
-. exit_func - function to be called when the thread exists; may be NULL if a 
-  callback is not desired
-  
-  Output Parameters:
-+ tls - new thread local storage space
-- err - location to store the error code; pointer may be NULL; error is zero 
-        for success, non-zero if a failure occurred
-@*/
-static inline void MPID_Thread_tls_create(MPID_Thread_tls_exit_func_t exit_func, MPID_Thread_tls_t * tls, int * err)
-{
-    MPIU_Thread_tls_create(exit_func,tls,err);
-}
-/*@
-  MPID_Thread_tls_destroy - destroy a thread local storage space
-  
-  Input Parameter:
-. tls - thread local storage space to be destroyed
-
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero 
-        for success, non-zero if a failure occurred
-  
-  Notes:
-  The destroy function associated with the thread local storage will not 
-  called after the space has been destroyed.
-@*/
-static inline void MPID_Thread_tls_destroy(MPID_Thread_tls_t * tls, int * err)
-{
-    MPIU_Thread_tls_destroy(tls,err);
-}
-/*@
-  MPID_Thread_tls_set - associate a value with the current thread in the 
-  thread local storage space
-  
-  Input Parameters:
-+ tls - thread local storage space
-- value - value to associate with current thread
-@*/
-static inline void MPID_Thread_tls_set(MPID_Thread_tls_t * tls, void * value)
-{
-    int err;
-    MPIU_Thread_tls_set(tls,value,&err);
-    MPIU_Assert_fmt_msg(err == MPIU_THREAD_SUCCESS,
-                        ("tls_set failed, err=%d (%s)",err,MPIU_Strerror(err)));
-}
-/*@
-  MPID_Thread_tls_get - obtain the value associated with the current thread 
-  from the thread local storage space
-  
-  Input Parameter:
-. tls - thread local storage space
-
-  Output Parameter:
-. value - value associated with current thread
-@*/
-static inline void MPID_Thread_tls_get(MPID_Thread_tls_t * tls, void ** value)
-{
-    int err;
-    MPIU_Thread_tls_get(tls,value,&err);
-    /* can't strerror here, possible endless recursion in strerror */
-    MPIU_Assert_fmt_msg(err == MPIU_THREAD_SUCCESS,("tls_get failed, err=%d",err));
-}
-#endif /* !defined(MPID_THREAD_H_INCLUDED) */
diff --git a/src/mpid/common/thread/mpid_thread_fallback.h b/src/mpid/common/thread/mpid_thread_fallback.h
new file mode 100644
index 0000000..62fe172
--- /dev/null
+++ b/src/mpid/common/thread/mpid_thread_fallback.h
@@ -0,0 +1,318 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPID_THREAD_H_INCLUDED)
+#define MPID_THREAD_H_INCLUDED
+
+#include "mpiutil.h"
+
+/* some important critical section names:
+ *   GLOBAL - entered/exited at beginning/end of (nearly) every MPI_ function
+ *   INIT - entered before MPID_Init and exited near the end of MPI_Init(_thread)
+ * See the analysis of the MPI routines for thread usage properties.  Those
+ * routines considered "Access Only" do not require GLOBAL.  That analysis
+ * was very general; in MPICH, some routines may have internal shared
+ * state that isn't required by the MPI specification.  Perhaps the
+ * best example of this is the MPI_ERROR_STRING routine, where the
+ * instance-specific error messages make use of shared state, and hence
+ * must be accessed in a thread-safe fashion (e.g., require an GLOBAL
+ * critical section).  With such routines removed, the set of routines
+ * that (probably) do not require GLOBAL include:
+ *
+ * MPI_CART_COORDS, MPI_CART_GET, MPI_CART_MAP, MPI_CART_RANK, MPI_CART_SHIFT,
+ * MPI_CART_SUB, MPI_CARTDIM_GET, MPI_COMM_GET_NAME,
+ * MPI_COMM_RANK, MPI_COMM_REMOTE_SIZE,
+ * MPI_COMM_SET_NAME, MPI_COMM_SIZE, MPI_COMM_TEST_INTER, MPI_ERROR_CLASS,
+ * MPI_FILE_GET_AMODE, MPI_FILE_GET_ATOMICITY, MPI_FILE_GET_BYTE_OFFSET,
+ * MPI_FILE_GET_POSITION, MPI_FILE_GET_POSITION_SHARED, MPI_FILE_GET_SIZE
+ * MPI_FILE_GET_TYPE_EXTENT, MPI_FILE_SET_SIZE,
+g * MPI_FINALIZED, MPI_GET_COUNT, MPI_GET_ELEMENTS, MPI_GRAPH_GET,
+ * MPI_GRAPH_MAP, MPI_GRAPH_NEIGHBORS, MPI_GRAPH_NEIGHBORS_COUNT,
+ * MPI_GRAPHDIMS_GET, MPI_GROUP_COMPARE, MPI_GROUP_RANK,
+ * MPI_GROUP_SIZE, MPI_GROUP_TRANSLATE_RANKS, MPI_INITIALIZED,
+ * MPI_PACK, MPI_PACK_EXTERNAL, MPI_PACK_SIZE, MPI_TEST_CANCELLED,
+ * MPI_TOPO_TEST, MPI_TYPE_EXTENT, MPI_TYPE_GET_ENVELOPE,
+ * MPI_TYPE_GET_EXTENT, MPI_TYPE_GET_NAME, MPI_TYPE_GET_TRUE_EXTENT,
+ * MPI_TYPE_LB, MPI_TYPE_SET_NAME, MPI_TYPE_SIZE, MPI_TYPE_UB, MPI_UNPACK,
+ * MPI_UNPACK_EXTERNAL, MPI_WIN_GET_NAME, MPI_WIN_SET_NAME
+ *
+ * Some of the routines that could be read-only, but internally may
+ * require access or updates to shared data include
+ * MPI_COMM_COMPARE (creation of group sets)
+ * MPI_COMM_SET_ERRHANDLER (reference count on errhandler)
+ * MPI_COMM_CALL_ERRHANDLER (actually ok, but risk high, usage low)
+ * MPI_FILE_CALL_ERRHANDLER (ditto)
+ * MPI_WIN_CALL_ERRHANDLER (ditto)
+ * MPI_ERROR_STRING (access to instance-specific string, which could
+ *                   be overwritten by another thread)
+ * MPI_FILE_SET_VIEW (setting view a big deal)
+ * MPI_TYPE_COMMIT (could update description of type internally,
+ *                  including creating a new representation.  Should
+ *                  be ok, but, like call_errhandler, low usage)
+ *
+ * Note that other issues may force a routine to include the GLOBAL
+ * critical section, such as debugging information that requires shared
+ * state.  Such situations should be avoided where possible.
+ */
+
+typedef MPIU_Thread_mutex_t MPID_Thread_mutex_t;
+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
+
+  Input Parameters:
++ _name - name of the critical section
+- _context - A context (typically an object) of the critical section
+
+M*/
+#define MPID_THREAD_CS_ENTER       MPIU_THREAD_CS_ENTER
+
+/*M MPIU_THREAD_CS_EXIT - Exit a named critical section
+
+  Input Parameters:
++ _name - cname of the critical section
+- _context - A context (typically an object) of the critical section
+
+M*/
+#define MPID_THREAD_CS_EXIT        MPIU_THREAD_CS_EXIT
+
+/*M MPIU_THREAD_CS_YIELD - Temporarily release a critical section and yield
+    to other threads
+
+  Input Parameters:
++ _name - cname of the critical section
+- _context - A context (typically an object) of the critical section
+
+  M*/
+#define MPID_THREAD_CS_YIELD       MPIU_THREAD_CS_YIELD
+
+#define MPID_THREAD_CHECK_BEGIN    MPIU_THREAD_CHECK_BEGIN
+#define MPID_THREAD_CHECK_END      MPIU_THREAD_CHECK_END
+
+/*@
+  MPID_Thread_create - create a new thread
+
+  Input Parameters:
++ func - function to run in new thread
+- data - data to be passed to thread function
+
+  Output Parameters:
++ id - identifier for the new thread
+- err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
+
+  Notes:
+  The thread is created in a detach state, meaning that is may not be waited upon.  If another thread needs to wait for this
+  thread to complete, the threads must provide their own synchronization mechanism.
+@*/
+#define MPID_Thread_create       MPIU_Thread_create
+
+/*@
+  MPID_Thread_exit - exit from the current thread
+@*/
+#define MPID_Thread_exit         MPIU_Thread_exit
+
+/*@
+  MPID_Thread_self - get the identifier of the current thread
+
+  Output Parameter:
+. id - identifier of current thread
+@*/
+#define MPID_Thread_self         MPIU_Thread_self
+
+/*@
+  MPID_Thread_same - compare two threads identifiers to see if refer to the same thread
+
+  Input Parameters:
++ id1 - first identifier
+- id2 - second identifier
+
+  Output Parameter:
+. same - TRUE if the two threads identifiers refer to the same thread; FALSE otherwise
+@*/
+#define MPID_Thread_same       MPIU_Thread_same
+
+/*@
+  MPID_Thread_yield - voluntarily relinquish the CPU, giving other threads an opportunity to run
+@*/
+#define MPID_Thread_same       MPIU_Thread_same
+
+/*
+ *    Mutexes
+ */
+
+/*@
+  MPID_Thread_mutex_create - create a new mutex
+
+  Output Parameters:
++ mutex - mutex
+- err - error code (non-zero indicates an error has occurred)
+@*/
+#define MPID_Thread_mutex_create  MPIU_Thread_mutex_create
+
+/*@
+  MPID_Thread_mutex_destroy - destroy an existing mutex
+
+  Input Parameter:
+. mutex - mutex
+
+  Output Parameter:
+. err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
+@*/
+#define MPID_Thread_mutex_destroy  MPIU_Thread_mutex_destroy
+
+/*@
+  MPID_Thread_lock - acquire a mutex
+
+  Input Parameter:
+. mutex - mutex
+@*/
+#define MPID_Thread_mutex_lock MPIU_Thread_mutex_lock
+
+/*@
+  MPID_Thread_unlock - release a mutex
+
+  Input Parameter:
+. mutex - mutex
+@*/
+#define MPID_Thread_mutex_unlock MPIU_Thread_mutex_unlock
+
+/*@
+  MPID_Thread_mutex_trylock - try to acquire a mutex, but return even if unsuccessful
+
+  Input Parameter:
+. mutex - mutex
+
+  Output Parameter:
+. flag - flag
+@*/
+#define MPID_Thread_mutex_trylock MPIU_Thread_mutex_trylock
+
+/*
+ * Condition Variables
+ */
+
+/*@
+  MPID_Thread_cond_create - create a new condition variable
+
+  Output Parameters:
++ cond - condition variable
+- err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
+@*/
+#define MPID_Thread_cond_create MPIU_Thread_cond_create
+
+/*@
+  MPID_Thread_cond_destroy - destroy an existinga condition variable
+
+  Input Parameter:
+. cond - condition variable
+
+  Output Parameter:
+. err - location to store the error code; pointer may be NULL; error is zero
+        for success, non-zero if a failure occurred
+@*/
+#define MPID_Thread_cond_destroy MPIU_Thread_cond_destroy
+
+/*@
+  MPID_Thread_cond_wait - wait (block) on a condition variable
+
+  Input Parameters:
++ cond - condition variable
+- mutex - mutex
+
+  Notes:
+  This function may return even though another thread has not requested that a
+  thread be released.  Therefore, the calling
+  program must wrap the function in a while loop that verifies program state
+  has changed in a way that warrants letting the
+  thread proceed.
+@*/
+#define MPID_Thread_cond_wait MPIU_Thread_cond_wait
+
+/*@
+  MPID_Thread_cond_broadcast - release all threads currently waiting on a condition variable
+
+  Input Parameter:
+. cond - condition variable
+@*/
+#define MPID_Thread_cond_broadcast MPIU_Thread_cond_broadcast
+
+/*@
+  MPID_Thread_cond_signal - release one thread currently waitng on a condition variable
+
+  Input Parameter:
+. cond - condition variable
+@*/
+#define MPID_Thread_cond_signal MPIU_Thread_cond_signal
+
+/*
+ * Thread Local Storage
+ */
+/*@
+  MPID_Thread_tls_create - create a thread local storage space
+
+  Input Parameter:
+. exit_func - function to be called when the thread exists; may be NULL if a
+  callback is not desired
+
+  Output Parameters:
++ tls - new thread local storage space
+- err - location to store the error code; pointer may be NULL; error is zero
+        for success, non-zero if a failure occurred
+@*/
+#define MPID_Thread_tls_create MPIU_Thread_tls_create
+
+/*@
+  MPID_Thread_tls_destroy - destroy a thread local storage space
+
+  Input Parameter:
+. tls - thread local storage space to be destroyed
+
+  Output Parameter:
+. err - location to store the error code; pointer may be NULL; error is zero
+        for success, non-zero if a failure occurred
+
+  Notes:
+  The destroy function associated with the thread local storage will not
+  called after the space has been destroyed.
+@*/
+#define MPID_Thread_tls_destroy MPIU_Thread_tls_destroy
+
+/*@
+  MPID_Thread_tls_set - associate a value with the current thread in the
+  thread local storage space
+
+  Input Parameters:
++ tls - thread local storage space
+- value - value to associate with current thread
+@*/
+#define MPID_Thread_tls_set MPIU_Thread_tls_set
+
+/*@
+  MPID_Thread_tls_get - obtain the value associated with the current thread
+  from the thread local storage space
+
+  Input Parameter:
+. tls - thread local storage space
+
+  Output Parameter:
+. value - value associated with current thread
+@*/
+#define MPID_Thread_tls_get MPIU_Thread_tls_get
+
+
+#define MPID_cc_t            MPIU_cc_t
+#define MPID_cc_get          MPIU_cc_get
+#define MPID_cc_set          MPIU_cc_set
+#define MPID_cc_is_complete  MPIU_cc_is_complete
+#define MPID_cc_incr         MPIU_cc_incr
+#define MPID_cc_decr         MPIU_cc_decr
+
+
+#endif /* !defined(MPID_THREAD_H_INCLUDED) */
diff --git a/src/mpid/common/thread/subconfigure.m4 b/src/mpid/common/thread/subconfigure.m4
index 0d71ac6..c9f6774 100644
--- a/src/mpid/common/thread/subconfigure.m4
+++ b/src/mpid/common/thread/subconfigure.m4
@@ -6,12 +6,6 @@ AM_CONDITIONAL([BUILD_MPID_COMMON_THREAD],[test "X$build_mpid_common_thread" = "
 ])
 
 AC_DEFUN([PAC_SUBCFG_BODY_]PAC_SUBCFG_AUTO_SUFFIX,[
-# this conditional must come here in the body because other body code and
-# post-PREREQ main code will set its inputs 
-AM_CONDITIONAL([THREAD_SERIALIZED_OR_MULTIPLE],
-               [test "x$MPICH_THREAD_LEVEL" = "xMPI_THREAD_SERIALIZED" -o \
-                     "x$MPICH_THREAD_LEVEL" = "xMPI_THREAD_MULTIPLE"])
-
 AM_COND_IF([BUILD_MPID_COMMON_THREAD],[
     dnl nothing to do for now...
     :
diff --git a/src/mpid/common/timers/Makefile.mk b/src/mpid/common/timers/Makefile.mk
new file mode 100644
index 0000000..1261d3e
--- /dev/null
+++ b/src/mpid/common/timers/Makefile.mk
@@ -0,0 +1,8 @@
+### -*- Mode: Makefile; -*-
+### vim: set ft=automake :
+###
+### (C) 2011 by Argonne National Laboratory.
+###     See COPYRIGHT in top-level directory.
+###
+AM_CPPFLAGS += -I$(top_srcdir)/src/mpid/common/timers
+noinst_HEADERS += src/mpid/common/timers/mpid_timers_fallback.h
diff --git a/src/mpid/common/timers/mpid_timers_fallback.h b/src/mpid/common/timers/mpid_timers_fallback.h
new file mode 100644
index 0000000..cf8f321
--- /dev/null
+++ b/src/mpid/common/timers/mpid_timers_fallback.h
@@ -0,0 +1,18 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPID_TIMERS_FALLBACK_H_INCLUDED)
+#define MPID_TIMERS_FALLBACK_H_INCLUDED
+
+#define MPID_Time_t         MPIU_Time_t
+#define MPID_Wtime          MPIU_Wtime
+#define MPID_Wtime_diff     MPIU_Wtime_diff
+#define MPID_Wtime_acc      MPIU_Wtime_acc
+#define MPID_Wtime_todouble MPIU_Wtime_todouble
+#define MPID_Wtick          MPIU_Wtick
+#define MPID_Wtime_init     MPIU_Wtime_init
+
+#endif /* !defined(MPID_TIMERS_FALLBACK_H_INCLUDED) */
diff --git a/src/mpid/pamid/include/mpidi_macros.h b/src/mpid/pamid/include/mpidi_macros.h
index 5c59753..a6b6426 100644
--- a/src/mpid/pamid/include/mpidi_macros.h
+++ b/src/mpid/pamid/include/mpidi_macros.h
@@ -157,7 +157,7 @@ MPIDI_Context_post(pami_context_t       context,
                    pami_work_function   fn,
                    void               * cookie)
 {
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
   /* It is possible that a work function posted to a context may attempt to
    * initiate a communication operation and, if context post were disabled, that
    * operation would be performed directly on the context BY TAKING A LOCK that
@@ -176,7 +176,7 @@ MPIDI_Context_post(pami_context_t       context,
   pami_result_t rc;
   rc = PAMI_Context_post(context, work, fn, cookie);
   MPID_assert(rc == PAMI_SUCCESS);
-#else /* (MPIU_THREAD_GRANULARITY != MPIU_THREAD_GRANULARITY_PER_OBJECT) */
+#else /* (MPICH_THREAD_GRANULARITY != MPIR_THREAD_GRANULARITY_PER_OBJECT) */
   /*
    * It is not necessary to lock the context before access in the "global"
    * mpich lock mode because all threads, application and async progress,
@@ -186,7 +186,7 @@ MPIDI_Context_post(pami_context_t       context,
 #endif
 }
 
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
 #define MPIDI_Send_post(__func, __req)                          \
 ({                                                              \
   pami_context_t context = MPIDI_Context_local(__req);          \
@@ -207,11 +207,11 @@ MPIDI_Context_post(pami_context_t       context,
       PAMI_Context_unlock(context);                             \
     }                                                           \
 })
-#else /* (MPIU_THREAD_GRANULARITY != MPIU_THREAD_GRANULARITY_PER_OBJECT) */
+#else /* (MPICH_THREAD_GRANULARITY != MPIR_THREAD_GRANULARITY_PER_OBJECT) */
 #define MPIDI_Send_post(__func, __req)                          \
 ({                                                              \
   __func(MPIDI_Context[0], __req);                              \
 })
-#endif /* #if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT) */
+#endif /* #if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT) */
 
 #endif
diff --git a/src/mpid/pamid/include/mpidi_mutex.h b/src/mpid/pamid/include/mpidi_mutex.h
index d757ecb..752d141 100644
--- a/src/mpid/pamid/include/mpidi_mutex.h
+++ b/src/mpid/pamid/include/mpidi_mutex.h
@@ -310,11 +310,11 @@ MPIDI_Mutex_initialize()
   extern int pthread_mutexattr_settype(pthread_mutexattr_t *__attr, int __kind);
 #endif
 #ifndef __PE__
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
    rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
-#else /*(MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)*/
+#else /*(MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)*/
    rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP);
-#endif /*(MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)*/
+#endif /*(MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)*/
 #else /* __PE__ */
 #if !defined(__AIX__)
    rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
diff --git a/src/mpid/pamid/include/mpidi_thread.h b/src/mpid/pamid/include/mpidi_thread.h
index dff875e..82d9968 100644
--- a/src/mpid/pamid/include/mpidi_thread.h
+++ b/src/mpid/pamid/include/mpidi_thread.h
@@ -67,7 +67,7 @@
 #define MPIU_THREAD_CS_SCHED_YIELD(name,_context) MPIU_THREAD_CS_##name##_SCHED_YIELD(_context)
 #define MPIU_THREAD_CS_TRY(name,_context)   MPIU_THREAD_CS_##name##_TRY(_context)
 
-#if MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL
+#if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL
 
 #define MPIDI_CS_ENTER(m) ({ if (MPIR_ThreadInfo.isThreaded) {                                             MPIDI_Mutex_acquire(m); } })
 #define MPIDI_CS_EXIT(m)  ({ if (MPIR_ThreadInfo.isThreaded) { MPIDI_Mutex_sync(); MPIDI_Mutex_release(m);                         } })
@@ -105,7 +105,7 @@
 #define MPIU_THREAD_CS_ASYNC_ENTER(_context)        MPIDI_CS_ENTER(8)
 #define MPIU_THREAD_CS_ASYNC_EXIT(_context)         MPIDI_CS_EXIT (8)
 
-#elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT
 
 #define MPIDI_CS_ENTER(m)                               \
     do {                                                \
@@ -178,7 +178,7 @@
 #define MPIU_THREAD_CS_ASYNC_ENTER(_context)        MPIDI_CS_ENTER(8)
 #define MPIU_THREAD_CS_ASYNC_EXIT(_context)         MPIDI_CS_EXIT (8)
 
-#endif /* MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL */
+#endif /* MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL */
 
 
 #endif /* !MPICH_MPIDTHREAD_H_INCLUDED */
diff --git a/src/mpid/pamid/src/mpid_init.c b/src/mpid/pamid/src/mpid_init.c
index 1d46060..8175859 100644
--- a/src/mpid/pamid/src/mpid_init.c
+++ b/src/mpid/pamid/src/mpid_init.c
@@ -56,7 +56,7 @@ MPIDI_Process_t  MPIDI_Process = {
   .verbose               = 0,
   .statistics            = 0,
 
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
   .avail_contexts        = MPIDI_MAX_CONTEXTS,
   .async_progress = {
     .active              = 0,
@@ -675,7 +675,7 @@ MPIDI_PAMI_context_init(int* threading, int *size)
 #endif
   int  numTasks;
 
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
   /*
    * ASYNC_PROGRESS_MODE_LOCKED requires context post because the async thread
    * will hold the context lock indefinitely; the only option for an application
@@ -694,7 +694,7 @@ MPIDI_PAMI_context_init(int* threading, int *size)
       MPIDI_Process.perobj.context_post.requested == 0)
     MPID_Abort (NULL, 0, 1, "'locking' async progress requires context post");
 
-#else /* MPIU_THREAD_GRANULARITY != MPIU_THREAD_GRANULARITY_PER_OBJECT */
+#else /* MPICH_THREAD_GRANULARITY != MPIR_THREAD_GRANULARITY_PER_OBJECT */
   /*
    * ASYNC_PROGRESS_MODE_LOCKED is not applicable in the "global lock" thread
    * mode. See discussion in src/mpid/pamid/src/mpid_progress.h for more
@@ -709,7 +709,7 @@ MPIDI_PAMI_context_init(int* threading, int *size)
   /* ----------------------------------
    *  Figure out the context situation
    * ---------------------------------- */
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
 
   /* Limit the number of requested contexts by the maximum number of contexts
    * allowed.  The default number of requested contexts depends on the mpich
@@ -744,7 +744,7 @@ MPIDI_PAMI_context_init(int* threading, int *size)
     --MPIDI_Process.avail_contexts;
   MPID_assert_always(MPIDI_Process.avail_contexts);
 
-#else /* (MPIU_THREAD_GRANULARITY != MPIU_THREAD_GRANULARITY_PER_OBJECT) */
+#else /* (MPICH_THREAD_GRANULARITY != MPIR_THREAD_GRANULARITY_PER_OBJECT) */
 
   /* Only a single context is supported in the 'global' mpich lock mode.
    *
@@ -1071,8 +1071,8 @@ MPIDI_PAMI_init(int* rank, int* size, int* threading)
             printf("mpi thread level        : 'MPI_THREAD_SINGLE'\n");
             break;
         }
-      printf("MPIU_THREAD_GRANULARITY : '%s'\n",
-             (MPIU_THREAD_GRANULARITY==MPIU_THREAD_GRANULARITY_PER_OBJECT)?"per object":"global");
+      printf("MPICH_THREAD_GRANULARITY : '%s'\n",
+             (MPICH_THREAD_GRANULARITY==MPIR_THREAD_GRANULARITY_PER_OBJECT)?"per object":"global");
 #ifdef ASSERT_LEVEL
       printf("ASSERT_LEVEL            : %d\n", ASSERT_LEVEL);
 #else
diff --git a/src/mpid/pamid/src/mpid_progress.c b/src/mpid/pamid/src/mpid_progress.c
index 72668bb..c47c642 100644
--- a/src/mpid/pamid/src/mpid_progress.c
+++ b/src/mpid/pamid/src/mpid_progress.c
@@ -166,7 +166,7 @@ MPIDI_Progress_init()
   pamix_progress_function progress_fn = MPIDI_Progress_async_poll;
   uintptr_t i;
 
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
   /* In the "per object" mpich lock mode the only possible progress functions
    * are the "context lock" trigger progress function and the 'NULL' progress
    * function.
@@ -234,7 +234,7 @@ MPIDI_Progress_async_start(pami_context_t context, void *cookie)
    */
   MPIU_THREAD_CS_ENTER(ASYNC,);
 
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
   if (MPIDI_Process.async_progress.active == 0)
     {
       /* Asynchronous progress was completely disabled and now async progress
@@ -267,7 +267,7 @@ MPIDI_Progress_async_end  (pami_context_t context, void *cookie)
 
   MPIDI_Process.async_progress.active -= 1;
 
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
   if (MPIDI_Process.async_progress.active == 0)
     {
       /* Asynchronous progress is now completely disabled on all contexts. */
diff --git a/src/mpid/pamid/src/mpid_progress.h b/src/mpid/pamid/src/mpid_progress.h
index 268cf50..edb454c 100644
--- a/src/mpid/pamid/src/mpid_progress.h
+++ b/src/mpid/pamid/src/mpid_progress.h
@@ -239,7 +239,7 @@ MPID_Progress_wait_inline(unsigned loop_count)
 {
   pami_result_t rc = 0;
 
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
   /*
    * In the "per object" thread mode the "global" lock is defined as a noop and
    * therefore no locks are held at this point.
diff --git a/src/mpid/pamid/src/mpid_request.c b/src/mpid/pamid/src/mpid_request.c
index 4fccb00..f7c1fa9 100644
--- a/src/mpid/pamid/src/mpid_request.c
+++ b/src/mpid/pamid/src/mpid_request.c
@@ -22,7 +22,7 @@
 #include <mpidimpl.h>
 
 #ifndef MPID_REQUEST_PREALLOC
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_GLOBAL)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL)
 #define  MPID_REQUEST_PREALLOC 16
 #elif (MPIU_HANDLE_ALLOCATION_METHOD == MPIU_HANDLE_ALLOCATION_THREAD_LOCAL)
 #define  MPID_REQUEST_PREALLOC 512  //Have direct more reqyests for all threads
diff --git a/src/mpid/pamid/src/mpidi_env.c b/src/mpid/pamid/src/mpidi_env.c
index bb924ac..ba9c2b7 100644
--- a/src/mpid/pamid/src/mpidi_env.c
+++ b/src/mpid/pamid/src/mpidi_env.c
@@ -547,7 +547,7 @@ MPIDI_Env_setup(int rank, int requested)
     unsigned value = (unsigned)-1;
     char* names[] = {"PAMID_THREAD_MULTIPLE", NULL};
     ENV_Unsigned(names, &value, 1, &found_deprecated_env_var, rank);
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
     /* Any mpich work function posted to a context that eventually initiates
      * other communcation transfers will hang on a lock attempt if the
      * 'context post' feature is not enabled. Until this code flow is fixed
@@ -610,7 +610,7 @@ MPIDI_Env_setup(int rank, int requested)
 
     if (value != -1)
     {
-#if (MPIU_THREAD_GRANULARITY != MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY != MPIR_THREAD_GRANULARITY_PER_OBJECT)
       /* The 'global' mpich lock mode only supports a single context.
        * See discussion in mpich/src/mpid/pamid/src/mpid_init.c for more
        * information.
@@ -643,7 +643,7 @@ MPIDI_Env_setup(int rank, int requested)
     ENV_Unsigned(names, &value, 1, &found_deprecated_env_var, rank);
     if (value != -1)
     {
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
       MPIDI_Process.perobj.context_post.requested = (value > 0);
 #else
       found_deprecated_env_var++;
@@ -665,7 +665,7 @@ MPIDI_Env_setup(int rank, int requested)
     {
       if (value != ASYNC_PROGRESS_MODE_DISABLED)
       {
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
         if (value == ASYNC_PROGRESS_MODE_LOCKED &&
             MPIDI_Process.perobj.context_post.requested == 0)
         {
@@ -679,7 +679,7 @@ MPIDI_Env_setup(int rank, int requested)
             fprintf(stderr, "The environment variable \"PAMID_ASYNC_PROGRESS=1\" requires \"PAMID_CONTEXT_POST=1\".\n");
         }
 
-#else /* (MPIU_THREAD_GRANULARITY != MPIU_THREAD_GRANULARITY_PER_OBJECT) */
+#else /* (MPICH_THREAD_GRANULARITY != MPIR_THREAD_GRANULARITY_PER_OBJECT) */
         if (value == ASYNC_PROGRESS_MODE_LOCKED)
         {
           /* The only valid async progress mode when using the 'global' mpich
@@ -1091,7 +1091,7 @@ MPIDI_Env_setup(int rank, int requested)
         MPIDI_Process.mp_interrupts=user_interrupts;
         MPIDI_Process.perobj.context_post.requested = 0;
         MPIDI_Process.async_progress.mode    = ASYNC_PROGRESS_MODE_TRIGGER;
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
         MPIDI_Process.avail_contexts         = MPIDI_MAX_CONTEXTS;
 #else
         MPIDI_Process.avail_contexts         = 1;
diff --git a/src/mpid/pamid/src/pt2pt/mpid_cancel.c b/src/mpid/pamid/src/pt2pt/mpid_cancel.c
index 1ca2f87..5a174df 100644
--- a/src/mpid/pamid/src/pt2pt/mpid_cancel.c
+++ b/src/mpid/pamid/src/pt2pt/mpid_cancel.c
@@ -102,7 +102,7 @@ MPID_Cancel_send(MPID_Request * sreq)
 
   pami_context_t context = MPIDI_Context_local(sreq);
 
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
   if (likely(MPIDI_Process.perobj.context_post.active > 0))
     {
       /* This leaks intentionally.  At this time, the amount of work
@@ -123,7 +123,7 @@ MPID_Cancel_send(MPID_Request * sreq)
        MPIDI_CancelReq_post(context, sreq);
        PAMI_Context_unlock(context);
     }
-#else /* (MPIU_THREAD_GRANULARITY != MPIU_THREAD_GRANULARITY_PER_OBJECT) */
+#else /* (MPICH_THREAD_GRANULARITY != MPIR_THREAD_GRANULARITY_PER_OBJECT) */
   /*
    * It is not necessary to lock the context before access in the "global" mpich
    * lock mode because all application threads must first acquire the global
diff --git a/src/mpid/pamid/src/pt2pt/mpid_isend.h b/src/mpid/pamid/src/pt2pt/mpid_isend.h
index b9e999b..581420a 100644
--- a/src/mpid/pamid/src/pt2pt/mpid_isend.h
+++ b/src/mpid/pamid/src/pt2pt/mpid_isend.h
@@ -30,7 +30,7 @@
 static inline unsigned
 MPIDI_Context_hash(pami_task_t rank, unsigned ctxt, unsigned bias, unsigned ncontexts)
 {
-#if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
+#if (MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT)
   return (( rank + ctxt + bias ) & (ncontexts-1));
 #else
   /* The 'global' mpich lock mode only supports a single context. See
diff --git a/src/mpl/include/mpl.h b/src/mpl/include/mpl.h
index 4fef381..4885750 100644
--- a/src/mpl/include/mpl.h
+++ b/src/mpl/include/mpl.h
@@ -55,9 +55,59 @@
 #define MPL_error_printf printf
 #endif
 
+/* These likely/unlikely macros provide static branch prediction hints to the
+ * compiler, if such hints are available.  Simply wrap the relevant expression in
+ * the macro, like this:
+ *
+ * if (unlikely(ptr == NULL)) {
+ *     // ... some unlikely code path ...
+ * }
+ *
+ * They should be used sparingly, especially in upper-level code.  It's easy to
+ * incorrectly estimate branching likelihood, while the compiler can often do a
+ * decent job if left to its own devices.
+ *
+ * These macros are not namespaced because the namespacing is cumbersome.
+ */
+#ifdef HAVE_BUILTIN_EXPECT
+#  define unlikely(x_) __builtin_expect(!!(x_),0)
+#  define likely(x_)   __builtin_expect(!!(x_),1)
+#else
+#  define unlikely(x_) (x_)
+#  define likely(x_)   (x_)
+#endif
+
+
+/* -------------------------------------------------------------------------- */
+/*
+ * Basic utility macros
+ */
+#define MPL_QUOTE(A) MPL_QUOTE2(A)
+#define MPL_QUOTE2(A) #A
+
+/* This macro is used to silence warnings from the Mac OS X linker when
+ * an object file "has no symbols".  The unused attribute prevents a
+ * warning about the unused dummy variable while the used attribute
+ * prevents the compiler from discarding the symbol altogether.  This
+ * macro should be used at the top of any file that might not define any
+ * other variables or functions (perhaps due to conditional compilation
+ * via the preprocessor).  A semicolon is expected after each invocation
+ * of this macro. */
+#define MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING \
+    static int MPL_UNIQUE_SYMBOL_NAME(dummy) ATTRIBUTE((unused,used)) = 0
+
+/* we jump through a couple of extra macro hoops to append the line
+ * number to the variable name in order to reduce the chance of a name
+ * collision with headers that might be included in the translation
+ * unit */
+#define MPL_UNIQUE_SYMBOL_NAME(prefix_) MPL_UNIQUE_IMPL1_(prefix_##_unique_L,__LINE__)
+#define MPL_UNIQUE_IMPL1_(prefix_,line_) MPL_UNIQUE_IMPL2_(prefix_,line_)
+#define MPL_UNIQUE_IMPL2_(prefix_,line_) MPL_UNIQUE_IMPL3_(prefix_,line_)
+#define MPL_UNIQUE_IMPL3_(prefix_,line_) prefix_##line_
+
+
 /* must come before mpltrmem.h */
 #include "mpl_valgrind.h"
-
 #include "mplstr.h"
 #include "mpltrmem.h"
 #include "mplenv.h"
diff --git a/src/mutex/mutex_create.c b/src/mutex/mutex_create.c
index a93baea..0729af6 100644
--- a/src/mutex/mutex_create.c
+++ b/src/mutex/mutex_create.c
@@ -36,7 +36,7 @@ int MPIX_Mutex_create(int my_count, MPI_Comm comm, MPIX_Mutex * hdl_out) __attri
 #undef FUNCNAME
 #define FUNCNAME MPIX_Mutex_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /** Create a group of MPI mutexes.  Collective on the given communicator.
   *
diff --git a/src/mutex/mutex_free.c b/src/mutex/mutex_free.c
index b3c4877..75a9f0d 100644
--- a/src/mutex/mutex_free.c
+++ b/src/mutex/mutex_free.c
@@ -34,7 +34,7 @@ int MPIX_Mutex_free(MPIX_Mutex * hdl_ptr) __attribute__((weak,alias("PMPIX_Mutex
 #undef FUNCNAME
 #define FUNCNAME MPIX_Mutex_free
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /** Free a group of MPI mutexes.  Collective on communicator used at the
   * time of creation.
diff --git a/src/mutex/mutex_lock.c b/src/mutex/mutex_lock.c
index 4c4846d..a9a5359 100644
--- a/src/mutex/mutex_lock.c
+++ b/src/mutex/mutex_lock.c
@@ -35,7 +35,7 @@ int MPIX_Mutex_lock(MPIX_Mutex hdl, int mutex, int proc) __attribute__((weak,ali
 #undef FUNCNAME
 #define FUNCNAME MPIX_Mutex_lock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /** Lock a mutex.
   *
diff --git a/src/mutex/mutex_unlock.c b/src/mutex/mutex_unlock.c
index 7930f17..6dbc0d2 100644
--- a/src/mutex/mutex_unlock.c
+++ b/src/mutex/mutex_unlock.c
@@ -35,7 +35,7 @@ int MPIX_Mutex_unlock(MPIX_Mutex hdl, int mutex, int proc) __attribute__((weak,a
 #undef FUNCNAME
 #define FUNCNAME MPIX_Mutex_unlock
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 /** Unlock a mutex.
   *
diff --git a/src/nameserv/file/file_nameserv.c b/src/nameserv/file/file_nameserv.c
index 4c83e8e..5cb4233 100644
--- a/src/nameserv/file/file_nameserv.c
+++ b/src/nameserv/file/file_nameserv.c
@@ -213,7 +213,7 @@ int MPID_NS_Lookup( MPID_NS_Handle handle, const MPID_Info *info_ptr,
     if (!fp) {
 	/* --BEGIN ERROR HANDLING-- */
 	port[0] = 0;
-	MPIU_ERR_SET1( mpi_errno, MPI_ERR_NAME, 
+	MPIR_ERR_SET1( mpi_errno, MPI_ERR_NAME, 
 		      "**namepubnotpub", "**namepubnotpub %s", service_name );
 	/* --END ERROR HANDLING-- */
     }
@@ -223,7 +223,7 @@ int MPID_NS_Lookup( MPID_NS_Handle handle, const MPID_Info *info_ptr,
 	if (!fgets( port, MPI_MAX_PORT_NAME, fp )) {
 	    /* --BEGIN ERROR HANDLING-- */
 	    port[0] = 0;
-	    MPIU_ERR_SET1( mpi_errno, MPI_ERR_NAME, 
+	    MPIR_ERR_SET1( mpi_errno, MPI_ERR_NAME, 
 			   "**namepubnotfound", "**namepubnotfound %s", 
 			   service_name );
 	    /* --END ERROR HANDLING-- */
diff --git a/src/nameserv/pmi/pmi_nameserv.c b/src/nameserv/pmi/pmi_nameserv.c
index 152f56c..274bb67 100644
--- a/src/nameserv/pmi/pmi_nameserv.c
+++ b/src/nameserv/pmi/pmi_nameserv.c
@@ -25,7 +25,7 @@ struct MPID_NS_Handle { int dummy; };    /* unused for now */
 #undef FUNCNAME
 #define FUNCNAME MPID_NS_Create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_NS_Create( const MPID_Info *info_ptr, MPID_NS_Handle *handle_ptr )
 {
     static struct MPID_NS_Handle nsHandleWithNoData;
@@ -39,7 +39,7 @@ int MPID_NS_Create( const MPID_Info *info_ptr, MPID_NS_Handle *handle_ptr )
 #undef FUNCNAME
 #define FUNCNAME MPID_NS_Publish
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_NS_Publish( MPID_NS_Handle handle, const MPID_Info *info_ptr, 
                      const char service_name[], const char port[] )
 {
@@ -51,13 +51,13 @@ int MPID_NS_Publish( MPID_NS_Handle handle, const MPID_Info *info_ptr,
 
 #ifdef USE_PMI2_API
     /* release the global CS for PMI calls */
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     rc = PMI2_Nameserv_publish(service_name, info_ptr, port);
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 #else
     rc = PMI_Publish_name( service_name, port );
 #endif
-    MPIU_ERR_CHKANDJUMP1(rc, mpi_errno, MPI_ERR_NAME, "**namepubnotpub", "**namepubnotpub %s", service_name);
+    MPIR_ERR_CHKANDJUMP1(rc, mpi_errno, MPI_ERR_NAME, "**namepubnotpub", "**namepubnotpub %s", service_name);
 
 fn_fail:
     return mpi_errno;
@@ -66,7 +66,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_NS_Lookup
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_NS_Lookup( MPID_NS_Handle handle, const MPID_Info *info_ptr,
                     const char service_name[], char port[] )
 {
@@ -78,13 +78,13 @@ int MPID_NS_Lookup( MPID_NS_Handle handle, const MPID_Info *info_ptr,
 
 #ifdef USE_PMI2_API
     /* release the global CS for PMI calls */
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     rc = PMI2_Nameserv_lookup(service_name, info_ptr, port, MPI_MAX_PORT_NAME);
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 #else
     rc = PMI_Lookup_name( service_name, port );
 #endif
-    MPIU_ERR_CHKANDJUMP1(rc, mpi_errno, MPI_ERR_NAME, "**namepubnotfound", "**namepubnotfound %s", service_name);
+    MPIR_ERR_CHKANDJUMP1(rc, mpi_errno, MPI_ERR_NAME, "**namepubnotfound", "**namepubnotfound %s", service_name);
 
 fn_fail:
     return mpi_errno;
@@ -93,7 +93,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPID_NS_Unpublish
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPID_NS_Unpublish( MPID_NS_Handle handle, const MPID_Info *info_ptr, 
                        const char service_name[] )
 {
@@ -105,13 +105,13 @@ int MPID_NS_Unpublish( MPID_NS_Handle handle, const MPID_Info *info_ptr,
 
 #ifdef USE_PMI2_API
     /* release the global CS for PMI calls */
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
     rc = PMI2_Nameserv_unpublish(service_name, info_ptr);
-    MPIU_THREAD_CS_ENTER(ALLFUNC,);
+    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
 #else
     rc = PMI_Unpublish_name( service_name );
 #endif
-    MPIU_ERR_CHKANDJUMP1(rc, mpi_errno, MPI_ERR_SERVICE, "**namepubnotunpub", "**namepubnotunpub %s", service_name);
+    MPIR_ERR_CHKANDJUMP1(rc, mpi_errno, MPI_ERR_SERVICE, "**namepubnotunpub", "**namepubnotunpub %s", service_name);
 
 fn_fail:
     return mpi_errno;
diff --git a/src/pmi/pmi2/poe/poe2pmi.c b/src/pmi/pmi2/poe/poe2pmi.c
index ceafb95..2e1adf0 100644
--- a/src/pmi/pmi2/poe/poe2pmi.c
+++ b/src/pmi/pmi2/poe/poe2pmi.c
@@ -298,7 +298,7 @@ int _mpi_world_exiting_handler(int world_id)
 /*  struct worldExitReq *req = (struct worldExitReq *)cookie; */
   MPID_Comm *comm = MPIR_Process.comm_world;
 
-  MPIU_THREAD_CS_ENTER(ALLFUNC,);
+  MPID_THREAD_CS_ENTER(GLOBAL, MPIR_ThreadInfo.global_mutex);
   ref_count = MPIDI_get_refcnt_of_world(world_id);
   TRACE_ERR("_mpi_world_exiting_handler: invoked for world %d exiting ref_count=%d my comm_word_size=%d\n", world_id, ref_count, world_size);
   if(ref_count == 0) {
@@ -322,7 +322,7 @@ int _mpi_world_exiting_handler(int world_id)
 
   TRACE_ERR("_mpi_world_exiting_handler: Out of _mpi_reduce_for_dyntask for exiting world %d reduce_state=%d\n",world_id, reduce_state);
 
-  MPIU_THREAD_CS_EXIT(ALLFUNC,);
+  MPID_THREAD_CS_EXIT(GLOBAL, MPIR_ThreadInfo.global_mutex);
   if(comm->rank == 0) {
     MPL_snprintf(world_id_str, sizeof(world_id_str), "%d", world_id);
     PMI2_Abort(0, world_id_str);
diff --git a/src/pmi/pmi2/simple/simple2pmi.c b/src/pmi/pmi2/simple/simple2pmi.c
index 2c52808..7ef3615 100644
--- a/src/pmi/pmi2/simple/simple2pmi.c
+++ b/src/pmi/pmi2/simple/simple2pmi.c
@@ -1214,7 +1214,7 @@ fn_fail:
    We may want to share these routines with the PMI version 2 server */
 int PMIi_ReadCommand( int fd, PMI2_Command *cmd )
 {
-    int pmi2_errno = PMI2_SUCCESS;
+    int pmi2_errno = PMI2_SUCCESS,err;
     char cmd_len_str[PMII_COMMANDLEN_SIZE+1];
     int cmd_len, remaining_len, vallen = 0;
     char *c, *cmd_buf = NULL;
@@ -1234,18 +1234,18 @@ int PMIi_ReadCommand( int fd, PMI2_Command *cmd )
 #ifdef MPICH_IS_THREADED
     MPIU_THREAD_CHECK_BEGIN;
     {
-        MPID_Thread_mutex_lock(&mutex);
+        MPID_Thread_mutex_lock(&mutex, &err);
 
         while (blocked && !cmd->complete)
             MPID_Thread_cond_wait(&cond, &mutex);
 
         if (cmd->complete) {
-            MPID_Thread_mutex_unlock(&mutex);
+            MPID_Thread_mutex_unlock(&mutex, &err);
             goto fn_exit;
         }
 
         blocked = TRUE;
-        MPID_Thread_mutex_unlock(&mutex);
+        MPID_Thread_mutex_unlock(&mutex, &err);
     }
     MPIU_THREAD_CHECK_END;
 #endif
@@ -1366,10 +1366,10 @@ int PMIi_ReadCommand( int fd, PMI2_Command *cmd )
 #ifdef MPICH_IS_THREADED
     MPIU_THREAD_CHECK_BEGIN;
     {
-        MPID_Thread_mutex_lock(&mutex);
+        MPID_Thread_mutex_lock(&mutex, &err);
         blocked = FALSE;
-        MPID_Thread_cond_broadcast(&cond);
-        MPID_Thread_mutex_unlock(&mutex);
+        MPID_Thread_cond_broadcast(&cond,&err);
+        MPID_Thread_mutex_unlock(&mutex, &err);
     }
     MPIU_THREAD_CHECK_END;
 #endif
@@ -1418,7 +1418,7 @@ fn_fail:
 
 int PMIi_WriteSimpleCommand( int fd, PMI2_Command *resp, const char cmd[], PMI2_Keyvalpair *pairs[], int npairs)
 {
-    int pmi2_errno = PMI2_SUCCESS;
+    int pmi2_errno = PMI2_SUCCESS,err;
     char cmdbuf[PMII_MAX_COMMAND_LEN];
     char cmdlenbuf[PMII_COMMANDLEN_SIZE+1];
     char *c = cmdbuf;
@@ -1493,13 +1493,13 @@ int PMIi_WriteSimpleCommand( int fd, PMI2_Command *resp, const char cmd[], PMI2_
  #ifdef MPICH_IS_THREADED
     MPIU_THREAD_CHECK_BEGIN;
     {
-        MPID_Thread_mutex_lock(&mutex);
+        MPID_Thread_mutex_lock(&mutex, &err);
 
         while (blocked)
-            MPID_Thread_cond_wait(&cond, &mutex);
+            MPID_Thread_cond_wait(&cond, &mutex, &err);
 
         blocked = TRUE;
-        MPID_Thread_mutex_unlock(&mutex);
+        MPID_Thread_mutex_unlock(&mutex, &err);
     }
     MPIU_THREAD_CHECK_END;
 #endif
@@ -1520,10 +1520,10 @@ int PMIi_WriteSimpleCommand( int fd, PMI2_Command *resp, const char cmd[], PMI2_
 #ifdef MPICH_IS_THREADED
     MPIU_THREAD_CHECK_BEGIN;
     {
-        MPID_Thread_mutex_lock(&mutex);
+        MPID_Thread_mutex_lock(&mutex, &err);
         blocked = FALSE;
-        MPID_Thread_cond_broadcast(&cond);
-        MPID_Thread_mutex_unlock(&mutex);
+        MPID_Thread_cond_broadcast(&cond,&err);
+        MPID_Thread_mutex_unlock(&mutex, &err);
     }
     MPIU_THREAD_CHECK_END;
 #endif
diff --git a/src/util/Makefile.mk b/src/util/Makefile.mk
index 4f1faf9..d7537b1 100644
--- a/src/util/Makefile.mk
+++ b/src/util/Makefile.mk
@@ -15,6 +15,9 @@ include $(top_srcdir)/src/util/procmap/Makefile.mk
 include $(top_srcdir)/src/util/thread/Makefile.mk
 include $(top_srcdir)/src/util/type/Makefile.mk
 include $(top_srcdir)/src/util/wrappers/Makefile.mk
+include $(top_srcdir)/src/util/assert/Makefile.mk
+include $(top_srcdir)/src/util/timers/Makefile.mk
+include $(top_srcdir)/src/util/pointer/Makefile.mk
 
 # "ex" and "multichannel" are Windows-only directories that we do not build with automake
 #include $(top_srcdir)/src/util/ex/Makefile.mk
diff --git a/src/util/assert/Makefile.mk b/src/util/assert/Makefile.mk
new file mode 100644
index 0000000..1548e21
--- /dev/null
+++ b/src/util/assert/Makefile.mk
@@ -0,0 +1,12 @@
+## -*- Mode: Makefile; -*-
+## vim: set ft=automake :
+##
+## (C) 2011 by Argonne National Laboratory.
+##     See COPYRIGHT in top-level directory.
+##
+
+AM_CPPFLAGS += -I$(top_srcdir)/src/util/assert
+
+noinst_HEADERS += src/util/assert/mpiassert.h
+mpi_core_sources +=
+
diff --git a/src/util/assert/mpiassert.h b/src/util/assert/mpiassert.h
new file mode 100644
index 0000000..63d2747
--- /dev/null
+++ b/src/util/assert/mpiassert.h
@@ -0,0 +1,163 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#if !defined(MPIASSERT_H_INCLUDED)
+#define MPIASSERT_H_INCLUDED
+
+#include "mpiu_type_defs.h"
+
+/* modern versions of clang support lots of C11 features */
+#if defined(__has_extension)
+#  if __has_extension(c_generic_selections)
+#    define HAVE_C11__GENERIC 1
+#  endif
+#  if __has_extension(c_static_assert)
+#    define HAVE_C11__STATIC_ASSERT 1
+#  endif
+#endif
+
+/* GCC 4.6 added support for _Static_assert:
+ * http://gcc.gnu.org/gcc-4.6/changes.html */
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined __cplusplus
+#  define HAVE_C11__STATIC_ASSERT 1
+#endif
+
+/* prototypes for assertion implementation helpers */
+int MPIR_Assert_fail(const char *cond, const char *file_name, int line_num);
+int MPIR_Assert_fail_fmt(const char *cond, const char *file_name, int line_num, const char *fmt, ...);
+
+/*
+ * MPIU_Assert()
+ *
+ * Similar to assert() except that it performs an MPID_Abort() when the 
+ * assertion fails.  Also, for Windows, it doesn't popup a
+ * mesage box on a remote machine.
+ *
+ * MPIU_AssertDecl may be used to include declarations only needed
+ * when MPIU_Assert is non-null (e.g., when assertions are enabled)
+ */
+#if (!defined(NDEBUG) && defined(HAVE_ERROR_CHECKING))
+#   define MPIU_AssertDecl(a_) a_
+#   define MPIU_AssertDeclValue(_a,_b) _a = _b
+#   define MPIU_Assert(a_)                             \
+    do {                                               \
+        if (unlikely(!(a_))) {                         \
+            MPIR_Assert_fail(#a_, __FILE__, __LINE__); \
+        }                                              \
+    } while (0)
+#else
+#   define MPIU_Assert(a_)
+/* Empty decls not allowed in C */
+#   define MPIU_AssertDecl(a_) a_ 
+#   define MPIU_AssertDeclValue(_a,_b) _a ATTRIBUTE((unused)) = _b
+#endif
+
+/*
+ * MPIU_Assertp()
+ *
+ * Similar to MPIU_Assert() except that these assertions persist regardless of 
+ * NDEBUG or HAVE_ERROR_CHECKING.  MPIU_Assertp() may
+ * be used for error checking in prototype code, although it should be 
+ * converted real error checking and reporting once the
+ * prototype becomes part of the official and supported code base.
+ */
+#define MPIU_Assertp(a_)                                             \
+    do {                                                             \
+        if (unlikely(!(a_))) {                                       \
+            MPIR_Assert_fail(#a_, __FILE__, __LINE__);               \
+        }                                                            \
+    } while (0)
+
+/* Define the MPIU_Assert_fmt_msg macro.  This macro takes two arguments.  The
+ * first is the condition to assert.  The second is a parenthesized list of
+ * arguments suitable for passing directly to printf that will yield a relevant
+ * error message.  The macro will first evaluate the condition.  If it evaluates
+ * to false the macro will take four steps:
+ *
+ * 1) It will emit an "Assertion failed..." message in the valgrind output with
+ *    a backtrace, if valgrind client requests are available and the process is
+ *    running under valgrind.  It will also evaluate and print the supplied
+ *    message.
+ * 2) It will emit an "Assertion failed..." message via MPL_internal_error_printf.
+ *    The supplied error message will also be evaluated and printed.
+ * 3) It will similarly emit the assertion failure and caller supplied messages
+ *    to the debug log, if enabled, via MPIU_DBG_MSG_FMT.
+ * 4) It will invoke MPID_Abort, just like the other MPIU_Assert* macros.
+ *
+ * If the compiler doesn't support (...)/__VA_ARGS__ in macros then the user
+ * message will not be evaluated or printed.  If NDEBUG is defined or
+ * HAVE_ERROR_CHECKING is undefined, this macro will expand to nothing, just
+ * like MPIU_Assert.
+ *
+ * Example usage:
+ *
+ * MPIU_Assert_fmg_msg(foo > bar,("foo is larger than bar: foo=%d bar=%d",foo,bar));
+ */
+#if (!defined(NDEBUG) && defined(HAVE_ERROR_CHECKING))
+#  if defined(HAVE_MACRO_VA_ARGS)
+
+/* newlines are added internally by the impl function, callers do not need to include them */
+#    define MPIU_Assert_fmt_msg(cond_,fmt_arg_parens_)                         \
+    do {                                                                       \
+        if (unlikely(!(cond_))) {                                              \
+            MPIR_Assert_fail_fmt(#cond_, __FILE__, __LINE__,                   \
+                                 MPIU_Assert_fmt_msg_expand_ fmt_arg_parens_); \
+        }                                                                      \
+    } while (0)
+/* helper to just expand the parens arg inline */
+#    define MPIU_Assert_fmt_msg_expand_(...) __VA_ARGS__
+
+#  else /* defined(HAVE_MACRO_VA_ARGS) */
+
+#    define MPIU_Assert_fmt_msg(cond_,fmt_arg_parens_)                                                   \
+    do {                                                                                                 \
+        if (unlikely(!(cond_))) {                                                                        \
+            MPIR_Assert_fail_fmt(#cond_, __FILE__, __LINE__,                                             \
+                                 "%s", "macro __VA_ARGS__ not supported, unable to print user message"); \
+        }                                                                                                \
+    } while (0)
+
+#  endif
+#else /* !defined(NDEBUG) && defined(HAVE_ERROR_CHECKING) */
+#    define MPIU_Assert_fmt_msg(cond_,fmt_arg_parens_)
+#endif
+
+#ifdef HAVE_C11__STATIC_ASSERT
+#  define MPIU_Static_assert(cond_,msg_) _Static_assert(cond_,msg_)
+#endif
+/* fallthrough to a run-time assertion */
+#ifndef MPIU_Static_assert
+#  define MPIU_Static_assert(cond_,msg_) MPIU_Assert_fmt_msg((cond_), ("%s", (msg_)))
+#endif
+
+/* evaluates to TRUE if ((a_)*(b_)>(max_)), only detects overflow for positive
+ * a_ and _b. */
+#define MPIU_Prod_overflows_max(a_, b_, max_) \
+    ( (a_) > 0 && (b_) > 0 && ((a_) > ((max_) / (b_))) )
+
+/* asserts that ((a_)*(b_)<=(max_)) holds in a way that is robust against
+ * undefined integer overflow behavior and is suitable for both signed and
+ * unsigned math (only suitable for positive values of (a_) and (b_)) */
+#define MPIU_Assert_prod_pos_overflow_safe(a_, b_, max_)                               \
+    MPIU_Assert_fmt_msg(!MPIU_Prod_overflows_max((a_),(b_),(max_)),                    \
+                        ("overflow detected: (%llx * %llx) > %s", (a_), (b_), #max_)); \
+
+
+
+/* -------------------------------------------------------------------------- */
+/* static type checking macros */
+
+/* implement using C11's "_Generic" functionality (optimal case) */
+#ifdef HAVE_C11__GENERIC
+#  define MPIU_Assert_has_type(expr_,type_) \
+    MPIU_Static_assert(_Generic((expr_), type_: 1, default: 0), \
+                       "expression '" #expr_ "' does not have type '" #type_ "'")
+#endif
+/* fallthrough to do nothing */
+#ifndef MPIU_Assert_has_type
+#  define MPIU_Assert_has_type(expr_,type_) do {} while (0)
+#endif
+
+#endif /* !defined(MPIASSERT_H_INCLUDED) */
diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index b8b3426..46c2dbb 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -386,33 +386,36 @@ static void dbg_init_tls(void)
 static FILE *get_fp(void)
 {
 #ifdef MPICH_IS_THREADED
+    int err;
     /* if we're not initialized, use the static fp, since there should
      * only be one thread in here until then */
-    if (mpiu_dbg_initialized == MPIU_DBG_INITIALIZED && MPIU_ISTHREADED) {
+    MPIU_THREAD_CHECK_BEGIN;
+    if (mpiu_dbg_initialized == MPIU_DBG_INITIALIZED) {
         FILE *fp;
-        MPID_Thread_tls_get(&dbg_tls_key, (void **) &fp);
+        MPID_Thread_tls_get(&dbg_tls_key, (void **) &fp, &err);
         return fp;
     }
-    else
-        return static_dbg_fp;
-#else
-    return static_dbg_fp;
+    MPIU_THREAD_CHECK_END;
 #endif
+
+    return static_dbg_fp;
 }
 
 static void set_fp(FILE *fp)
 {
 #ifdef MPICH_IS_THREADED
+    int err;
     /* if we're not initialized, use the static fp, since there should
      * only be one thread in here until then */
-    if (mpiu_dbg_initialized == MPIU_DBG_INITIALIZED && MPIU_ISTHREADED) {
-        MPID_Thread_tls_set(&dbg_tls_key, (void *)fp);
+    MPIU_THREAD_CHECK_BEGIN;
+    if (mpiu_dbg_initialized == MPIU_DBG_INITIALIZED) {
+        MPID_Thread_tls_set(&dbg_tls_key, (void *)fp, &err);
+        return;
     }
-    else
-        static_dbg_fp = fp;
-#else
-    static_dbg_fp = fp;
+    MPIU_THREAD_CHECK_END;
 #endif
+
+    static_dbg_fp = fp;
 }
 
 
@@ -837,7 +840,7 @@ Environment variables\n\
 #undef FUNCNAME
 #define FUNCNAME MPIU_DBG_Open_temp_file
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIU_DBG_Open_temp_file(FILE **dbg_fp)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -876,7 +879,7 @@ static int MPIU_DBG_Open_temp_file(FILE **dbg_fp)
 #undef FUNCNAME
 #define FUNCNAME MPIU_DBG_Open_temp_file
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIU_DBG_Open_temp_file(FILE **dbg_fp)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -921,7 +924,7 @@ static int MPIU_DBG_Open_temp_file(FILE **dbg_fp)
 #undef FUNCNAME
 #define FUNCNAME MPIU_DBG_Open_temp_file
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIU_DBG_Open_temp_file(FILE **dbg_fp)
 {
     int mpi_errno = MPI_SUCCESS;
diff --git a/src/util/instrm/instr.c b/src/util/instrm/instr.c
index 340cc3a..5e007d0 100644
--- a/src/util/instrm/instr.c
+++ b/src/util/instrm/instr.c
@@ -6,7 +6,7 @@
 
 #include "mpiimpl.h"
 
-MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
+MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 #ifdef USE_MPIU_INSTR
 
diff --git a/src/util/logging/rlog/TraceInput/trace_input.c b/src/util/logging/rlog/TraceInput/trace_input.c
index faff42d..b844e84 100644
--- a/src/util/logging/rlog/TraceInput/trace_input.c
+++ b/src/util/logging/rlog/TraceInput/trace_input.c
@@ -38,33 +38,33 @@ RLOG_BOOL PackQuadChar(char *str, int *length, char *base, int *pos, const int m
     /* Am I supposed to include the terminating NULL character? */
     /* This function does not. */
     if (*pos + (int)strlen(str) > max)
-	return RLOG_FALSE;
+	return FALSE;
     *length = strlen(str);
     memcpy(&base[*pos], str, *length);
     *pos += *length;
-    return RLOG_TRUE;
+    return TRUE;
 }
 
 RLOG_BOOL PackQuadInt(int n1, int n2, int *length, int *base, int *pos, const int max)
 {
     if (*pos + 2 > max)
-	return RLOG_FALSE;
+	return FALSE;
     *length = 2;
     base[*pos] = n1;
     base[*pos+1] = n2;
     *pos += 2;
-    return RLOG_TRUE;
+    return TRUE;
 }
 
 RLOG_BOOL PackQuadDouble(double d1, double d2, int *length, double *base, int *pos, const int max)
 {
     if (*pos + 2 > max)
-	return RLOG_FALSE;
+	return FALSE;
     *length = 2;
     base[*pos] = d1;
     base[*pos+1] = d2;
     *pos += 2;
-    return RLOG_TRUE;
+    return TRUE;
 }
 
 TRACE_EXPORT int TRACE_Open( const char filespec[], TRACE_file *fp )
@@ -277,7 +277,7 @@ TRACE_EXPORT int TRACE_Peek_next_primitive( const TRACE_file fp,
 {
     int i, j, rank = -1, level = -1;
     double dmin;
-    RLOG_BOOL done = RLOG_FALSE;
+    RLOG_BOOL done = FALSE;
 
     *n_tcoords = 2;
     *n_ycoords = 2;
@@ -292,7 +292,7 @@ TRACE_EXPORT int TRACE_Peek_next_primitive( const TRACE_file fp,
 		level = i;
 		rank  = j;
 		dmin = fp->ppEvent[j][i].end_time;
-		done = RLOG_TRUE;
+		done = TRUE;
 	    }
 	}
     }
@@ -345,7 +345,7 @@ TRACE_EXPORT int TRACE_Get_next_primitive( const TRACE_file fp,
 {
     int i, j, rank = 1, level = -1;
     double dmin;
-    RLOG_BOOL done = RLOG_FALSE;
+    RLOG_BOOL done = FALSE;
 
     *n_bytes = 0;
 
diff --git a/src/util/logging/rlog/irlog2rlog.c b/src/util/logging/rlog/irlog2rlog.c
index 6d9e347..9633181 100644
--- a/src/util/logging/rlog/irlog2rlog.c
+++ b/src/util/logging/rlog/irlog2rlog.c
@@ -20,12 +20,6 @@
 #ifndef BOOL
 #define BOOL int
 #endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
 #ifndef min
 #define min(a,b) (((a) < (b)) ? (a) : (b))
 #endif
diff --git a/src/util/logging/rlog/rlog.c b/src/util/logging/rlog/rlog.c
index dac04fc..09b66fd 100644
--- a/src/util/logging/rlog/rlog.c
+++ b/src/util/logging/rlog/rlog.c
@@ -17,7 +17,7 @@
 
 #include "mpi.h"
 /*#define RLOG_timestamp PMPI_Wtime*/
-#include "mpichtimer.h"
+#include "mpiu_timer.h"
 static double RLOG_timestamp(void)
 {
     double d;
@@ -121,12 +121,12 @@ int RLOG_FinishLog(RLOG_Struct* pRLOG)
 
 void RLOG_EnableLogging(RLOG_Struct* pRLOG)
 {
-    pRLOG->bLogging = RLOG_TRUE;
+    pRLOG->bLogging = TRUE;
 }
 
 void RLOG_DisableLogging(RLOG_Struct* pRLOG)
 {
-    pRLOG->bLogging = RLOG_FALSE;
+    pRLOG->bLogging = FALSE;
 }
 
 void RLOG_SaveFirstTimestamp(RLOG_Struct* pRLOG)
@@ -167,7 +167,7 @@ void WriteCurrentDataAndLogEvent(RLOG_Struct *pRLOG, int event, double starttime
 #ifndef RLOG_LogEvent
 void RLOG_LogEvent(RLOG_Struct *pRLOG, int event, double starttime, double endtime, int recursion)
 {
-    if (pRLOG->bLogging == RLOG_FALSE)
+    if (pRLOG->bLogging == FALSE)
 	return;
 
     if (pRLOG->pOutput->pCurHeader + sizeof(RLOG_HEADER) + sizeof(RLOG_EVENT) > pRLOG->pOutput->pEnd)
@@ -191,7 +191,7 @@ void RLOG_LogEvent(RLOG_Struct *pRLOG, int event, double starttime, double endti
 
 void RLOG_LogSend(RLOG_Struct* pRLOG, int dest, int tag, int size)
 {
-    if (pRLOG->bLogging == RLOG_FALSE)
+    if (pRLOG->bLogging == FALSE)
 	return;
 
     if (pRLOG->pOutput->pCurHeader + sizeof(RLOG_HEADER) + sizeof(RLOG_IARROW) > pRLOG->pOutput->pEnd)
@@ -218,7 +218,7 @@ void RLOG_LogSend(RLOG_Struct* pRLOG, int dest, int tag, int size)
 
 void RLOG_LogRecv(RLOG_Struct* pRLOG, int src, int tag, int size)
 {
-    if (pRLOG->bLogging == RLOG_FALSE)
+    if (pRLOG->bLogging == FALSE)
 	return;
 
     if (pRLOG->pOutput->pCurHeader + sizeof(RLOG_HEADER) + sizeof(RLOG_IARROW) > pRLOG->pOutput->pEnd)
@@ -248,7 +248,7 @@ void RLOG_LogCommID(RLOG_Struct* pRLOG, int comm_id)
     RLOG_HEADER *pHeader;
     RLOG_COMM *pComm;
 
-    if (pRLOG->bLogging == RLOG_FALSE)
+    if (pRLOG->bLogging == FALSE)
 	return;
 
     if (pRLOG->pOutput->pCurHeader + sizeof(RLOG_HEADER) + sizeof(RLOG_COMM) > pRLOG->pOutput->pEnd)
@@ -389,7 +389,7 @@ void RLOG_DescribeState(RLOG_Struct* pRLOG, int state, char *name, char *color)
     RLOG_HEADER *pHeader;
     RLOG_STATE *pState;
 
-    if (pRLOG->bLogging == RLOG_FALSE)
+    if (pRLOG->bLogging == FALSE)
 	return;
 
     if (pRLOG->pOutput->pCurHeader + sizeof(RLOG_HEADER) + sizeof(RLOG_STATE) > pRLOG->pOutput->pEnd)
diff --git a/src/util/logging/rlog/rlogutil.c b/src/util/logging/rlog/rlogutil.c
index c57a469..d0131df 100644
--- a/src/util/logging/rlog/rlogutil.c
+++ b/src/util/logging/rlog/rlogutil.c
@@ -252,18 +252,18 @@ static int ModifyArrows(FILE *f, int nNumArrows, int nMin, double *pOffsets, int
 	{
 	    arrow = pArray[i];
 
-	    bModified = RLOG_FALSE;
+	    bModified = FALSE;
 	    index = (arrow.leftright == RLOG_ARROW_RIGHT) ? arrow.src - nMin : arrow.dest - nMin;
 	    if (index >= 0 && index < n && pOffsets[index] != 0)
 	    {
 		arrow.start_time += pOffsets[index];
-		bModified = RLOG_TRUE;
+		bModified = TRUE;
 	    }
 	    index = (arrow.leftright == RLOG_ARROW_RIGHT) ? arrow.dest - nMin : arrow.src - nMin;
 	    if (index >= 0 && index < n && pOffsets[index] != 0)
 	    {
 		arrow.end_time += pOffsets[index];
-		bModified = RLOG_TRUE;
+		bModified = TRUE;
 	    }
 	    if (bModified)
 	    {
@@ -784,10 +784,10 @@ RLOG_BOOL FindMinGlobalEvent(RLOG_IOStruct *pInput, int *rank, int *level, int *
 {
     int i,j;
     double dmin = RLOG_MAX_DOUBLE;
-    RLOG_BOOL found = RLOG_FALSE;
+    RLOG_BOOL found = FALSE;
 
     if (pInput == NULL)
-	return RLOG_FALSE;
+	return FALSE;
 
     for (i=0; i<pInput->nNumRanks; i++)
     {
@@ -801,7 +801,7 @@ RLOG_BOOL FindMinGlobalEvent(RLOG_IOStruct *pInput, int *rank, int *level, int *
 		    *level = j;
 		    *index = pInput->ppCurGlobalEvent[i][j];
 		    dmin = pInput->gppCurEvent[i][j].start_time;
-		    found = RLOG_TRUE;
+		    found = TRUE;
 		}
 	    }
 	}
@@ -814,10 +814,10 @@ RLOG_BOOL FindMaxGlobalEvent(RLOG_IOStruct *pInput, int *rank, int *level, int *
 {
     int i,j;
     double dmax = RLOG_MIN_DOUBLE;
-    RLOG_BOOL found = RLOG_FALSE;
+    RLOG_BOOL found = FALSE;
 
     if (pInput == NULL)
-	return RLOG_FALSE;
+	return FALSE;
 
     for (i=0; i<pInput->nNumRanks; i++)
     {
@@ -831,7 +831,7 @@ RLOG_BOOL FindMaxGlobalEvent(RLOG_IOStruct *pInput, int *rank, int *level, int *
 		    *level = j;
 		    *index = pInput->ppCurGlobalEvent[i][j];
 		    dmax = pInput->gppPrevEvent[i][j].start_time;
-		    found = RLOG_TRUE;
+		    found = TRUE;
 		}
 	    }
 	}
@@ -844,7 +844,7 @@ int RLOG_ResetGlobalIter(RLOG_IOStruct *pInput)
 {
     int i,j, n;
     RLOG_EVENT min_event = {0};
-    RLOG_BOOL bMinSet = RLOG_FALSE;
+    RLOG_BOOL bMinSet = FALSE;
 
     if (pInput == NULL)
 	return -1;
@@ -870,7 +870,7 @@ int RLOG_ResetGlobalIter(RLOG_IOStruct *pInput)
 	    if (!bMinSet)
 	    {
 		min_event = pInput->gppCurEvent[pInput->header.nMinRank+i][0];
-		bMinSet = RLOG_TRUE;
+		bMinSet = TRUE;
 	    }
 	    /* save the rank with the earliest event */
 	    if (min_event.start_time > pInput->gppCurEvent[i][0].start_time)
diff --git a/src/util/mem/argstr.c b/src/util/mem/argstr.c
index 12f5a08..235404b 100644
--- a/src/util/mem/argstr.c
+++ b/src/util/mem/argstr.c
@@ -531,7 +531,7 @@ MPIU_BOOL MPIU_Str_hide_string_arg(char *str, const char *flag)
     /* line up with the first token */
     str = (char*)first_token(str);
     if (str == NULL)
-	return MPIU_TRUE;
+	return TRUE;
 
     do
     {
@@ -542,9 +542,9 @@ MPIU_BOOL MPIU_Str_hide_string_arg(char *str, const char *flag)
 	    {
 		str = (char*)next_token(str);
 		if (str == NULL)
-		    return MPIU_TRUE;
+		    return TRUE;
 		token_hide(str);
-		return MPIU_TRUE;
+		return TRUE;
 	    }
 	}
 	else
@@ -552,7 +552,7 @@ MPIU_BOOL MPIU_Str_hide_string_arg(char *str, const char *flag)
 	    str = (char*)next_token(str);
 	}
     } while (str);
-    return MPIU_FALSE;
+    return FALSE;
 }
 
 /*@ MPIU_Str_get_int_arg - Extract an option from a string
diff --git a/src/util/mem/handlemem.c b/src/util/mem/handlemem.c
index ab5fc74..68f5794 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 'MPIU_THREAD_CS_ENTER/EXIT(HANDLEALLOC,)' enables both 
+  Threading: The 'MPID_THREAD_CS_ENTER/EXIT(POBJ, MPIR_ThreadInfo.handle_mutex)' enables both 
   finer-grain
   locking with a single global mutex and with a mutex specific for handles.
 
@@ -330,20 +330,20 @@ Input Parameters:
 #undef FUNCNAME
 #define FUNCNAME MPIU_Handle_obj_alloc
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void *MPIU_Handle_obj_alloc(MPIU_Object_alloc_t *objmem)
 {
     void *ret;
-    MPIU_THREAD_CS_ENTER(HANDLEALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.handle_mutex);
     ret = MPIU_Handle_obj_alloc_unsafe(objmem);
-    MPIU_THREAD_CS_EXIT(HANDLEALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.handle_mutex);
     return ret;
 }
 
 #undef FUNCNAME
 #define FUNCNAME MPIU_Handle_obj_alloc_unsafe
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 void *MPIU_Handle_obj_alloc_unsafe(MPIU_Object_alloc_t *objmem)
 {
     MPIU_Handle_common *ptr;
@@ -436,9 +436,6 @@ void *MPIU_Handle_obj_alloc_unsafe(MPIU_Object_alloc_t *objmem)
          * annotations instead. */
         MPL_VG_ANNOTATE_NEW_MEMORY(ptr, objmem->size);
 
-        /* must come after NEW_MEMORY annotation above to avoid problems */
-        MPIU_THREAD_MPI_OBJ_INIT(ptr);
-
         MPIU_DBG_MSG_FMT(HANDLE,TYPICAL,(MPIU_DBG_FDEST,
                                          "Allocating object ptr %p (handle val 0x%08x)",
                                          ptr, ptr->handle));
@@ -462,7 +459,7 @@ void MPIU_Handle_obj_free( MPIU_Object_alloc_t *objmem, void *object )
 {
     MPIU_Handle_common *obj = (MPIU_Handle_common *)object;
 
-    MPIU_THREAD_CS_ENTER(HANDLEALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.handle_mutex);
 
     MPIU_DBG_MSG_FMT(HANDLE,TYPICAL,(MPIU_DBG_FDEST,
                                      "Freeing object ptr %p (0x%08x kind=%s) refcount=%d",
@@ -471,8 +468,6 @@ void MPIU_Handle_obj_free( MPIU_Object_alloc_t *objmem, void *object )
                                      MPIU_Handle_get_kind_str(HANDLE_GET_MPI_KIND((obj)->handle)),
                                      MPIU_Object_get_ref(obj)));
 
-    MPIU_THREAD_MPI_OBJ_FINALIZE(obj);
-
 #ifdef USE_MEMORY_TRACING
     {
         /* set the object memory to an invalid value (0xec), except for the handle field */
@@ -507,7 +502,7 @@ void MPIU_Handle_obj_free( MPIU_Object_alloc_t *objmem, void *object )
 
     obj->next	        = objmem->avail;
     objmem->avail	= obj;
-    MPIU_THREAD_CS_EXIT(HANDLEALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.handle_mutex);
 }
 
 /* 
diff --git a/src/util/mem/trmem.c b/src/util/mem/trmem.c
index e02ced8..bd491f8 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)
 {
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     MPL_trdump(fp, minid);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
 }
 
 void *MPIU_trmalloc(size_t a, int lineno, const char fname[])
 {
     void *retval;
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     retval = MPL_trmalloc(a, lineno, fname);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     return retval;
 }
 
 void MPIU_trfree(void *a_ptr, int line, const char fname[])
 {
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     MPL_trfree(a_ptr, line, fname);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
 }
 
 int MPIU_trvalid(const char str[])
 {
     int retval;
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     retval = MPL_trvalid(str);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     return retval;
 }
 
 void MPIU_trspace(size_t *space, size_t *fr)
 {
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     MPL_trspace(space, fr);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
 }
 
 void MPIU_trid(int id)
 {
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     MPL_trid(id);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
 }
 
 void MPIU_trlevel(int level)
 {
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     MPL_trlevel(level);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
 }
 
 void MPIU_trDebugLevel(int level)
 {
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     MPL_trDebugLevel(level);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
 }
 
 void *MPIU_trcalloc(size_t nelem, size_t elsize, int lineno, const char fname[])
 {
     void *retval;
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     retval = MPL_trcalloc(nelem, elsize, lineno, fname);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     return retval;
 }
 
 void *MPIU_trrealloc(void *p, size_t size, int lineno, const char fname[])
 {
     void *retval;
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     retval = MPL_trrealloc(p, size, lineno, fname);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     return retval;
 }
 
 void *MPIU_trstrdup(const char *str, int lineno, const char fname[])
 {
     void *retval;
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     retval = MPL_trstrdup(str, lineno, fname);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     return retval;
 }
 
 void MPIU_TrSetMaxMem(size_t size)
 {
-    MPIU_THREAD_CS_ENTER(MEMALLOC,);
+    MPID_THREAD_CS_ENTER(POBJ, MPIR_ThreadInfo.memalloc_mutex);
     MPL_TrSetMaxMem(size);
-    MPIU_THREAD_CS_EXIT(MEMALLOC,);
+    MPID_THREAD_CS_EXIT(POBJ, MPIR_ThreadInfo.memalloc_mutex);
 }
 
diff --git a/src/util/multichannel/mpi.c b/src/util/multichannel/mpi.c
index a59af89..2ce9eaf 100644
--- a/src/util/multichannel/mpi.c
+++ b/src/util/multichannel/mpi.c
@@ -20,7 +20,7 @@
 #include <winsock2.h>
 #include <windows.h>
 #include "mpichconf.h"
-#include "mpichtimer.h"
+#include "mpiu_timer.h"
 #include "mpimem.h"
 #include <stdio.h>
 #include <stdarg.h>
diff --git a/src/util/pointer/Makefile.mk b/src/util/pointer/Makefile.mk
new file mode 100644
index 0000000..eea239a
--- /dev/null
+++ b/src/util/pointer/Makefile.mk
@@ -0,0 +1,12 @@
+## -*- Mode: Makefile; -*-
+## vim: set ft=automake :
+##
+## (C) 2011 by Argonne National Laboratory.
+##     See COPYRIGHT in top-level directory.
+##
+
+AM_CPPFLAGS += -I$(top_srcdir)/src/util/pointer
+
+noinst_HEADERS += src/util/pointer/mpiu_pointer.h
+
+mpi_core_sources +=
diff --git a/src/util/pointer/mpiu_pointer.h b/src/util/pointer/mpiu_pointer.h
new file mode 100644
index 0000000..df42b0b
--- /dev/null
+++ b/src/util/pointer/mpiu_pointer.h
@@ -0,0 +1,59 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPIU_POINTER_H_INCLUDED)
+#define MPIU_POINTER_H_INCLUDED
+
+#include "mpi.h"
+#include "mpichconf.h"
+#include "mpichconfconst.h"
+#include "mpidbg.h"
+#include "mpiassert.h"
+
+/* Assigns (src_) to (dst_), checking that (src_) fits in (dst_) without
+ * truncation.
+ *
+ * When fiddling with this macro, please keep C's overly complicated integer
+ * promotion/truncation/conversion rules in mind.  A discussion of these issues
+ * can be found in Chapter 5 of "Secure Coding in C and C++" by Robert Seacord.
+ */
+#define MPIU_Assign_trunc(dst_,src_,dst_type_)                                         \
+    do {                                                                               \
+        /* will catch some of the cases if the expr_inttype macros aren't available */ \
+        MPIU_Assert((src_) == (dst_type_)(src_));                                      \
+        dst_ = (dst_type_)(src_);                                                      \
+    } while (0)
+
+/*
+ * Ensure an MPI_Aint value fits into a signed int.
+ * Useful for detecting overflow when MPI_Aint is larger than an int.
+ *
+ * \param[in]  aint  Variable of type MPI_Aint
+ */
+#define MPIU_Ensure_Aint_fits_in_int(aint) \
+  MPIU_Assert((aint) == (MPI_Aint)(int)(aint));
+
+/*
+ * Ensure an MPI_Aint value fits into an unsigned int.
+ * Useful for detecting overflow when MPI_Aint is larger than an
+ * unsigned int.
+ *
+ * \param[in]  aint  Variable of type MPI_Aint
+ */
+#define MPIU_Ensure_Aint_fits_in_uint(aint) \
+  MPIU_Assert((aint) == (MPI_Aint)(unsigned int)(aint));
+
+/*
+ * Ensure an MPI_Aint value fits into a pointer.
+ * Useful for detecting overflow when MPI_Aint is larger than a pointer.
+ *
+ * \param[in]  aint  Variable of type MPI_Aint
+ */
+#define MPIU_Ensure_Aint_fits_in_pointer(aint) \
+  MPIU_Assert((aint) == (MPI_Aint)(MPIU_Upint) MPI_AINT_CAST_TO_VOID_PTR(aint));
+
+
+#endif /* !defined(MPIU_POINTER_H_INCLUDED) */
diff --git a/src/util/procmap/local_proc.c b/src/util/procmap/local_proc.c
index 885eafa..f13b80d 100644
--- a/src/util/procmap/local_proc.c
+++ b/src/util/procmap/local_proc.c
@@ -53,7 +53,7 @@
 #undef FUNCNAME
 #define FUNCNAME MPIU_Find_local_and_external
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 
 #if defined(MPID_USE_NODE_IDS)
 int MPIU_Find_local_and_external(MPID_Comm *comm, int *local_size_p, int *local_rank_p, int **local_ranks_p,
@@ -93,7 +93,7 @@ int MPIU_Find_local_and_external(MPID_Comm *comm, int *local_size_p, int *local_
     MPIU_CHKPMEM_MALLOC (intranode_table, int *, sizeof(int) * comm->remote_size, mpi_errno, "intranode_table");
 
     mpi_errno = MPID_Get_max_node_id(comm, &max_node_id);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     MPIU_Assert(max_node_id >= 0);
     MPIU_CHKLMEM_MALLOC (nodes, int *, sizeof(int) * (max_node_id + 1), mpi_errno, "nodes");
 
@@ -107,7 +107,7 @@ int MPIU_Find_local_and_external(MPID_Comm *comm, int *local_size_p, int *local_
     external_size = 0;
 
     mpi_errno = MPID_Get_node_id(comm, comm->rank, &my_node_id);
-    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+    if (mpi_errno) MPIR_ERR_POP (mpi_errno);
     MPIU_Assert(my_node_id >= 0);
     MPIU_Assert(my_node_id <= max_node_id);
 
@@ -118,11 +118,11 @@ int MPIU_Find_local_and_external(MPID_Comm *comm, int *local_size_p, int *local_
     for (i = 0; i < comm->remote_size; ++i)
     {
         mpi_errno = MPID_Get_node_id(comm, i, &node_id);
-        if (mpi_errno) MPIU_ERR_POP (mpi_errno);
+        if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
         /* The upper level can catch this non-fatal error and should be
            able to recover gracefully. */
-        MPIU_ERR_CHKANDJUMP(node_id < 0, mpi_errno, MPI_ERR_OTHER, "**dynamic_node_ids");
+        MPIR_ERR_CHKANDJUMP(node_id < 0, mpi_errno, MPI_ERR_OTHER, "**dynamic_node_ids");
 
         MPIU_Assert(node_id <= max_node_id);
 
@@ -180,12 +180,12 @@ int MPIU_Find_local_and_external(MPID_Comm *comm, int *local_size_p, int *local_
     *local_size_p = local_size;
     *local_rank_p = local_rank;
     *local_ranks_p =  MPIU_Realloc (local_ranks, sizeof(int) * local_size);
-    MPIU_ERR_CHKANDJUMP (*local_ranks_p == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem2");
+    MPIR_ERR_CHKANDJUMP (*local_ranks_p == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem2");
 
     *external_size_p = external_size;
     *external_rank_p = external_rank;
     *external_ranks_p = MPIU_Realloc (external_ranks, sizeof(int) * external_size);
-    MPIU_ERR_CHKANDJUMP (*external_ranks_p == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem2");
+    MPIR_ERR_CHKANDJUMP (*external_ranks_p == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem2");
 
     /* no need to realloc */
     if (intranode_table_p)
@@ -212,7 +212,7 @@ int MPIU_Find_local_and_external(MPID_Comm *comm, int *local_size_p, int *local_
     
     /* The upper level can catch this non-fatal error and should be
        able to recover gracefully. */
-    MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**notimpl");
+    MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**notimpl");
 fn_fail:
     return mpi_errno;
 }
@@ -228,7 +228,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_Get_internode_rank
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIU_Get_internode_rank(MPID_Comm *comm_ptr, int r)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -249,7 +249,7 @@ int MPIU_Get_internode_rank(MPID_Comm *comm_ptr, int r)
 #undef FUNCNAME
 #define FUNCNAME MPIU_Get_intranode_rank
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIU_Get_intranode_rank(MPID_Comm *comm_ptr, int r)
 {
     int mpi_errno = MPI_SUCCESS;
diff --git a/src/util/thread/Makefile.mk b/src/util/thread/Makefile.mk
index 0d6b0cb..edf143b 100644
--- a/src/util/thread/Makefile.mk
+++ b/src/util/thread/Makefile.mk
@@ -9,6 +9,11 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/util/thread
 
 noinst_HEADERS +=                               \
     src/util/thread/mpiu_thread.h               \
+    src/util/thread/mpiu_thread_single.h        \
+    src/util/thread/mpiu_thread_multiple.h      \
+    src/util/thread/mpiu_thread_global.h        \
+    src/util/thread/mpiu_thread_pobj.h  	\
+    src/util/thread/mpiu_thread_priv.h	      	\
     src/util/thread/mpiu_thread_posix_funcs.h   \
     src/util/thread/mpiu_thread_posix_types.h   \
     src/util/thread/mpiu_thread_solaris_funcs.h \
@@ -17,6 +22,7 @@ noinst_HEADERS +=                               \
     src/util/thread/mpiu_thread_win_types.h
 
 mpi_core_sources += \
+    src/util/thread/mpiu_thread.c \
     src/util/thread/mpiu_thread_win.c \
     src/util/thread/mpiu_thread_solaris.c \
     src/util/thread/mpiu_thread_posix.c
diff --git a/src/util/thread/mpiu_thread.c b/src/util/thread/mpiu_thread.c
new file mode 100644
index 0000000..8626ab4
--- /dev/null
+++ b/src/util/thread/mpiu_thread.c
@@ -0,0 +1,33 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2002 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpiu_thread.h"
+
+#if !defined(MPICH_IS_THREADED)
+
+/* If single threaded, we preallocate this.  Otherwise, we create it */
+MPICH_PerThread_t MPIU_Thread = { 0 };
+
+#elif defined(MPIU_TLS_SPECIFIER)
+
+MPIU_TLS_SPECIFIER MPICH_PerThread_t MPIU_Thread = { 0 };
+
+#else  /* defined(MPICH_IS_THREADED) && !defined(MPIU_TLS_SPECIFIER) */
+
+/* If we may be single threaded, we need a preallocated version to use
+ * if we are single threaded case */
+MPICH_PerThread_t MPIU_ThreadSingle = { 0 };
+
+/* This routine is called when a thread exits; it is passed the value
+ * associated with the key.  In our case, this is simply storage
+ * allocated with MPIU_Calloc */
+void MPIUI_Cleanup_tls( void *a )
+{
+    if (a)
+	MPIU_Free( a );
+}
+
+#endif
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index ac6b065..4a7641f 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -7,15 +7,16 @@
 #if !defined(MPIU_THREAD_H_INCLUDED)
 #define MPIU_THREAD_H_INCLUDED
 
-#include "mpichconf.h" /* defines MPIU_THREAD_PACKAGE_NAME */
+#include "mpi.h"
+#include "mpichconf.h"  /* defines MPIU_THREAD_PACKAGE_NAME */
+#include "mpichconfconst.h"
 #include "mpidbg.h"
-
-#if !defined(TRUE)
-#define TRUE 1
-#endif
-#if !defined(FALSE)
-#define FALSE 0
-#endif
+#include "mpiassert.h"
+/* Time stamps */
+/* Get the timer definitions.  The source file for this include is
+   src/util/timers/mpiu_timer.h.in */
+#include "mpiu_strerror.h"
+#include "mpiu_timer.h"
 
 /* _INVALID exists to avoid accidental macro evaluations to 0 */
 #define MPIU_THREAD_PACKAGE_INVALID 0
@@ -39,7 +40,6 @@ typedef int MPIU_Thread_tls_t;
 #  error "thread package not defined or unknown"
 #endif
 
-
 /*
  * threading function prototypes
  *
@@ -47,251 +47,140 @@ typedef int MPIU_Thread_tls_t;
  * rather than actual or even inline functions.
  */
 
-typedef void (* MPIU_Thread_func_t)(void * data);
-
-/*@
-  MPIU_Thread_create - create a new thread
+typedef void (*MPIU_Thread_func_t) (void *data);
 
-  Input Parameters:
-+ func - function to run in new thread
-- data - data to be passed to thread function
-
-  Output Parameters:
-+ id - identifier for the new thread
-- err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-
-  Notes:
-  The thread is created in a detach state, meaning that is may not be waited upon.  If another thread needs to wait for this
-  thread to complete, the threads must provide their own synchronization mechanism.
-@*/
-void MPIU_Thread_create(MPIU_Thread_func_t func, void * data, MPIU_Thread_id_t * id, int * err);
-
-/*@
-  MPIU_Thread_exit - exit from the current thread
-@*/
+void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t * id, int *err);
 void MPIU_Thread_exit(void);
-
-/*@
-  MPIU_Thread_self - get the identifier of the current thread
-
-  Output Parameter:
-. id - identifier of current thread
-@*/
 void MPIU_Thread_self(MPIU_Thread_id_t * id);
-
-/*@
-  MPIU_Thread_same - compare two threads identifiers to see if refer to the same thread
-
-  Input Parameters:
-+ id1 - first identifier
-- id2 - second identifier
-  
-  Output Parameter:
-. same - TRUE if the two threads identifiers refer to the same thread; FALSE otherwise
-@*/
-void MPIU_Thread_same(MPIU_Thread_id_t * id1, MPIU_Thread_id_t * id2, int * same);
-
-/*@
-  MPIU_Thread_yield - voluntarily relinquish the CPU, giving other threads an opportunity to run
-@*/
+void MPIU_Thread_same(MPIU_Thread_id_t * id1, MPIU_Thread_id_t * id2, int *same);
 void MPIU_Thread_yield(void);
 
+void MPIU_Thread_mutex_create(MPIU_Thread_mutex_t * mutex, int *err);
+void MPIU_Thread_mutex_destroy(MPIU_Thread_mutex_t * mutex, int *err);
+void MPIU_Thread_mutex_lock(MPIU_Thread_mutex_t * mutex, int *err);
+void MPIU_Thread_mutex_unlock(MPIU_Thread_mutex_t * mutex, int *err);
+void MPIU_Thread_mutex_trylock(MPIU_Thread_mutex_t * mutex, int *flag, int *err);
 
-/*
- *    Mutexes
- */
-
-/*@
-  MPIU_Thread_mutex_create - create a new mutex
-  
-  Output Parameters:
-+ mutex - mutex
-- err - error code (non-zero indicates an error has occurred)
-@*/
-void MPIU_Thread_mutex_create(MPIU_Thread_mutex_t * mutex, int * err);
-
-/*@
-  MPIU_Thread_mutex_destroy - destroy an existing mutex
-  
-  Input Parameter:
-. mutex - mutex
-
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-void MPIU_Thread_mutex_destroy(MPIU_Thread_mutex_t * mutex, int * err);
-
-/*@
-  MPIU_Thread_lock - acquire a mutex
-  
-  Input Parameter:
-. mutex - mutex
-
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-void MPIU_Thread_mutex_lock(MPIU_Thread_mutex_t * mutex, int * err);
-
-/*@
-  MPIU_Thread_unlock - release a mutex
-  
-  Input Parameter:
-. mutex - mutex
-
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-void MPIU_Thread_mutex_unlock(MPIU_Thread_mutex_t * mutex, int * err);
-
-/*@
-  MPIU_Thread_mutex_trylock - try to acquire a mutex, but return even if unsuccessful
-  
-  Input Parameter:
-. mutex - mutex
-
-  Output Parameters:
-+ flag - flag
-- err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-void MPIU_Thread_mutex_trylock(MPIU_Thread_mutex_t * mutex, int * flag, int * err);
+void MPIU_Thread_cond_create(MPIU_Thread_cond_t * cond, int *err);
+void MPIU_Thread_cond_destroy(MPIU_Thread_cond_t * cond, int *err);
+void MPIU_Thread_cond_wait(MPIU_Thread_cond_t * cond, MPIU_Thread_mutex_t * mutex, int *err);
+void MPIU_Thread_cond_broadcast(MPIU_Thread_cond_t * cond, int *err);
+void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int *err);
 
 
 /*
- * Condition Variables
+ * Thread Local Storage
  */
+typedef void (*MPIU_Thread_tls_exit_func_t) (void *value);
 
-/*@
-  MPIU_Thread_cond_create - create a new condition variable
-  
-  Output Parameters:
-+ cond - condition variable
-- err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-void MPIU_Thread_cond_create(MPIU_Thread_cond_t * cond, int * err);
-
-/*@
-  MPIU_Thread_cond_destroy - destroy an existinga condition variable
-  
-  Input Parameter:
-. cond - condition variable
+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);
 
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-void MPIU_Thread_cond_destroy(MPIU_Thread_cond_t * cond, int * err);
-
-/*@
-  MPIU_Thread_cond_wait - wait (block) on a condition variable
-  
-  Input Parameters:
-+ cond - condition variable
-- mutex - mutex
-
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-
-  Notes:
-  This function may return even though another thread has not requested that a thread be released.  Therefore, the calling
-  program must wrap the function in a while loop that verifies program state has changed in a way that warrants letting the
-  thread proceed.
-@*/
-void MPIU_Thread_cond_wait(MPIU_Thread_cond_t * cond, MPIU_Thread_mutex_t * mutex, int * err);
-
-/*@
-  MPIU_Thread_cond_broadcast - release all threads currently waiting on a condition variable
-  
-  Input Parameter:
-. cond - condition variable
-
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-void MPIU_Thread_cond_broadcast(MPIU_Thread_cond_t * cond, int * err);
+/* Error values */
+#define MPIU_THREAD_SUCCESS 0
+/* FIXME: Define other error codes.  For now, any non-zero value is an error. */
 
-/*@
-  MPIU_Thread_cond_signal - release one thread currently waitng on a condition variable
-  
-  Input Parameter:
-. cond - condition variable
+/* Implementation specific function definitions (usually in the form of macros) */
+#if defined(MPIU_THREAD_PACKAGE_NAME) && (MPIU_THREAD_PACKAGE_NAME == MPIU_THREAD_PACKAGE_POSIX)
+#  include "mpiu_thread_posix_funcs.h"
+#elif defined(MPIU_THREAD_PACKAGE_NAME) && (MPIU_THREAD_PACKAGE_NAME == MPIU_THREAD_PACKAGE_SOLARIS)
+#  include "mpiu_thread_solaris_funcs.h"
+#elif defined(MPIU_THREAD_PACKAGE_NAME) && (MPIU_THREAD_PACKAGE_NAME == MPIU_THREAD_PACKAGE_WIN)
+#  include "mpiu_thread_win_funcs.h"
+#elif defined(MPIU_THREAD_PACKAGE_NAME) && (MPIU_THREAD_PACKAGE_NAME == MPIU_THREAD_PACKAGE_NONE)
+/* do nothing */
+#else
+#  error "thread package not defined or unknown"
+#endif
 
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int * err);
 
+#if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_INVALID
+#  error Invalid thread granularity option specified (possibly none)
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_LOCK_FREE
+#  error MPIR_THREAD_GRANULARITY_LOCK_FREE not implemented yet
+#endif
 
-/*
- * Thread Local Storage
- */
-typedef void (*MPIU_Thread_tls_exit_func_t)(void * value);
 
+/* I don't have a better place for this at the moment, so it lives here for now. */
+enum MPIU_Thread_cs_name {
+    MPIU_THREAD_CS_NAME_GLOBAL = 0,
+    MPIU_THREAD_CS_NAME_POBJ,
+    MPIU_THREAD_CS_NUM_NAMES
+};
+
+typedef struct MPICH_ThreadInfo_t {
+    int thread_provided;        /* Provided level of thread support */
+    /* This is a special case for is_thread_main, which must be
+     * implemented even if MPICH itself is single threaded.  */
+#if (MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED)
+#  if !defined(MPIU_TLS_SPECIFIER)
+    MPIU_Thread_tls_t thread_storage;   /* Id for perthread data */
+#  endif                        /* !TLS */
+    MPIU_Thread_id_t master_thread;     /* Thread that started MPI */
+#endif
 
-/*@
-  MPIU_Thread_tls_create - create a thread local storage space
+#if defined MPICH_IS_THREADED
+    int isThreaded;             /* Set to true if user requested
+                                 * THREAD_MULTIPLE */
+#endif                          /* MPICH_IS_THREADED */
+
+    /* Define the mutex values used for each kind of implementation */
+#if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL || \
+    MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT
+    MPIU_Thread_mutex_t global_mutex;
+    /* We need the handle mutex to avoid problems with lock nesting */
+    MPIU_Thread_mutex_t handle_mutex;
+#endif
 
-  Input Parameter:
-. exit_func - function to be called when the thread exists; may be NULL is a callback is not desired
-  
-  Output Parameters:
-+ tls - new thread local storage space
-- err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-void MPIU_Thread_tls_create(MPIU_Thread_tls_exit_func_t exit_func, MPIU_Thread_tls_t * tls, int * err);
+#if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT
+    MPIU_Thread_mutex_t msgq_mutex;
+    MPIU_Thread_mutex_t completion_mutex;
+    MPIU_Thread_mutex_t ctx_mutex;
+    MPIU_Thread_mutex_t pmi_mutex;
+#endif
 
-/*@
-  MPIU_Thread_tls_destroy - destroy a thread local storage space
-  
-  Input Parameter:
-. tls - thread local storage space to be destroyed
+#if (MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED)
+    MPIU_Thread_mutex_t memalloc_mutex; /* for MPIU_{Malloc,Free,Calloc} */
+    MPIU_Thread_id_t cs_holder[MPIU_THREAD_CS_NUM_NAMES];
+#endif
+} MPICH_ThreadInfo_t;
+extern MPICH_ThreadInfo_t MPIR_ThreadInfo;
 
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-  
-  Notes:
-  The destroy function associated with the thread local storage will not called after the space has been destroyed.
-@*/
-void MPIU_Thread_tls_destroy(MPIU_Thread_tls_t * tls, int * err);
+/* ------------------------------------------------------------------------- */
+/* thread-local storage macros */
+/* moved here from mpiimpl.h because they logically belong here */
 
-/*@
-  MPIU_Thread_tls_set - associate a value with the current thread in the thread local storage space
-  
-  Input Parameters:
-+ tls - thread local storage space
-- value - value to associate with current thread
+/* arbitrary, just needed to avoid cleaning up heap allocated memory at thread
+ * destruction time */
+#define MPIU_STRERROR_BUF_SIZE (1024)
 
-  Output Parameter:
-. err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-void MPIU_Thread_tls_set(MPIU_Thread_tls_t * tls, void * value, int * err);
+/* FIXME should really be MPIU_NEST_NUM_MUTEXES, but it's defined later */
+#define MPICH_MAX_LOCKS (6)
 
-/*@
-  MPIU_Thread_tls_get - obtain the value associated with the current thread from the thread local storage space
-  
-  Input Parameter:
-. tls - thread local storage space
+/* This structure contains all thread-local variables and will be zeroed at
+ * allocation time.
+ *
+ * Note that any pointers to dynamically allocated memory stored in this
+ * structure must be externally cleaned up.
+ * */
+typedef struct MPICH_PerThread_t {
+    int op_errno;               /* For errors in predefined MPI_Ops */
 
-  Output Parameters:
-+ value - value associated with current thread
-- err - location to store the error code; pointer may be NULL; error is zero for success, non-zero if a failure occurred
-@*/
-void MPIU_Thread_tls_get(MPIU_Thread_tls_t * tls, void ** value, int * err);
+    /* error string storage for MPIU_Strerror */
+    char strerrbuf[MPIU_STRERROR_BUF_SIZE];
 
-/* Error values */
-#define MPIU_THREAD_SUCCESS MPIU_THREAD_ERR_SUCCESS
-#define MPIU_THREAD_ERR_SUCCESS 0
-/* FIXME: Define other error codes.  For now, any non-zero value is an error. */
+#if (MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED)
+    int lock_depth[MPICH_MAX_LOCKS];
+#endif
+} MPICH_PerThread_t;
 
-/* Implementation specific function definitions (usually in the form of macros) */
-#if defined(MPIU_THREAD_PACKAGE_NAME) && (MPIU_THREAD_PACKAGE_NAME == MPIU_THREAD_PACKAGE_POSIX)
-#  include "mpiu_thread_posix_funcs.h"
-#elif defined(MPIU_THREAD_PACKAGE_NAME) && (MPIU_THREAD_PACKAGE_NAME == MPIU_THREAD_PACKAGE_SOLARIS)
-#  include "mpiu_thread_solaris_funcs.h"
-#elif defined(MPIU_THREAD_PACKAGE_NAME) && (MPIU_THREAD_PACKAGE_NAME == MPIU_THREAD_PACKAGE_WIN)
-#  include "mpiu_thread_win_funcs.h"
-#elif defined(MPIU_THREAD_PACKAGE_NAME) && (MPIU_THREAD_PACKAGE_NAME == MPIU_THREAD_PACKAGE_NONE)
-/* do nothing */
+#if defined (MPICH_IS_THREADED)
+#include "mpiu_thread_multiple.h"
 #else
-#  error "thread package not defined or unknown"
+#include "mpiu_thread_single.h"
 #endif
 
 #endif /* !defined(MPIU_THREAD_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_global.h b/src/util/thread/mpiu_thread_global.h
new file mode 100644
index 0000000..d99944f
--- /dev/null
+++ b/src/util/thread/mpiu_thread_global.h
@@ -0,0 +1,81 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPIU_THREAD_GLOBAL_H_INCLUDED)
+#define MPIU_THREAD_GLOBAL_H_INCLUDED
+
+/* There is a single, global lock, held for the duration of an MPI call */
+/* FIXME this shouldn't need to be recursive, but using a recursive mutex here
+ * greatly simplifies thread safety in ROMIO right now.  In the long term we
+ * should make ROMIO internally thread safe and then this can go back to being a
+ * non-recursive mutex. [goodell@ 2010-10-15] */
+#define MPIU_THREAD_CS_ENTER_GLOBAL(_context)                           \
+    do {                                                                \
+        MPIU_THREAD_CHECK_BEGIN;                                        \
+        MPIU_THREAD_CS_ENTER_LOCKNAME_RECURSIVE(GLOBAL,_context);       \
+        MPIU_THREAD_CHECK_END;                                          \
+    } while (0)
+
+#define MPIU_THREAD_CS_EXIT_GLOBAL(_context)                            \
+    do {                                                                \
+        MPIU_THREAD_CHECK_BEGIN;                                        \
+        MPIU_THREAD_CS_EXIT_LOCKNAME_RECURSIVE(GLOBAL,_context);        \
+        MPIU_THREAD_CHECK_END;                                          \
+    } while (0)
+
+#define MPIU_THREAD_CS_YIELD_GLOBAL(_context)                           \
+    do {                                                                \
+        MPIU_THREAD_CHECK_BEGIN;                                        \
+        MPIU_THREAD_CS_YIELD_LOCKNAME_RECURSIVE(GLOBAL,_context);       \
+        MPIU_THREAD_CHECK_END;                                          \
+    } while (0)
+
+
+/* POBJ locks are all NO-OPs */
+#define MPIU_THREAD_CS_ENTER_POBJ(_context)
+#define MPIU_THREAD_CS_EXIT_POBJ(_context)
+#define MPIU_THREAD_CS_YIELD_POBJ(_context)
+
+
+/* define a type for the completion counter */
+/* memory barriers aren't needed in this impl, because all access to completion
+ * counters is done while holding the GLOBAL critical section */
+typedef volatile int MPIU_cc_t;
+#define MPIU_cc_get(cc_) (cc_)
+#define MPIU_cc_set(cc_ptr_, val_) (*(cc_ptr_)) = (val_)
+#define MPIU_cc_is_complete(cc_ptr_) (0 == *(cc_ptr_))
+
+#define MPIU_cc_incr(cc_ptr_, was_incomplete_)  \
+    do {                                        \
+        *(was_incomplete_) = (*(cc_ptr_))++;    \
+    } while (0)
+
+#define MPIU_cc_decr(cc_ptr_, incomplete_)      \
+    do {                                        \
+        *(incomplete_) = --(*(cc_ptr_));        \
+    } while (0)
+
+
+/* "publishes" the obj with handle value (handle_) via the handle pointer
+ * (hnd_lval_).  That is, it is a version of the following statement that fixes
+ * memory consistency issues:
+ *     (hnd_lval_) = (handle_);
+ *
+ * assumes that the following is always true: typeof(*hnd_lval_ptr_)==int
+ */
+/* This could potentially be generalized beyond MPI-handle objects, but we
+ * should only take that step after seeing good evidence of its use.  A general
+ * macro (that is portable to non-gcc compilers) will need type information to
+ * make the appropriate volatile cast. */
+/* Ideally _GLOBAL would use this too, but we don't want to count on OPA
+ * availability in _GLOBAL mode.  Instead the GLOBAL critical section should be
+ * used. */
+#define MPIU_OBJ_PUBLISH_HANDLE(hnd_lval_, handle_)     \
+    do {                                                \
+        (hnd_lval_) = (handle_);                        \
+    } while (0)
+
+#endif /* !defined(MPIU_THREAD_MULTIPLE_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_multiple.h b/src/util/thread/mpiu_thread_multiple.h
new file mode 100644
index 0000000..26cb19c
--- /dev/null
+++ b/src/util/thread/mpiu_thread_multiple.h
@@ -0,0 +1,200 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPIU_THREAD_MULTIPLE_H_INCLUDED)
+#define MPIU_THREAD_MULTIPLE_H_INCLUDED
+
+#include "mpiu_thread_priv.h"
+
+#define MPIU_THREAD_CHECK_BEGIN if (MPIR_ThreadInfo.isThreaded) {
+#define MPIU_THREAD_CHECK_END   }
+
+#define MPIU_THREAD_CS_ENTER(_name,_context) MPIU_THREAD_CS_ENTER_##_name(_context)
+#define MPIU_THREAD_CS_EXIT(_name,_context) MPIU_THREAD_CS_EXIT_##_name(_context)
+#define MPIU_THREAD_CS_YIELD(_name,_context) MPIU_THREAD_CS_YIELD_##_name(_context)
+
+/* recursive locks */
+#define MPIU_THREAD_CS_ENTER_LOCKNAME_RECURSIVE(name_,mutex_)           \
+    do {                                                                \
+        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to recursively ENTER lockname=%s", #name_); \
+        MPIU_Thread_CS_enter_lockname_recursive_impl_(MPIU_NEST_##name_, #name_, &mutex_); \
+    } while (0)
+
+#define MPIU_THREAD_CS_EXIT_LOCKNAME_RECURSIVE(name_,mutex_)            \
+    do {                                                                \
+        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to recursively EXIT lockname=%s", #name_); \
+        MPIU_Thread_CS_exit_lockname_recursive_impl_(MPIU_NEST_##name_, #name_, &mutex_); \
+    } while (0)
+
+#define MPIU_THREAD_CS_YIELD_LOCKNAME_RECURSIVE(name_,mutex_)           \
+    do {                                                                \
+        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to recursively YIELD lockname=%s", #name_); \
+        MPIU_Thread_CS_yield_lockname_recursive_impl_(MPIU_NEST_##name_, #name_, &mutex_); \
+    } while (0)
+
+/* regular locks */
+#define MPIU_THREAD_CS_ENTER_LOCKNAME(name_,mutex_)                     \
+    do {                                                                \
+        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to ENTER lockname=%s", #name_); \
+        MPIU_Thread_CS_enter_lockname_impl_(#name_, &mutex_); \
+    } while (0)
+
+#define MPIU_THREAD_CS_EXIT_LOCKNAME(name_,mutex_)                      \
+    do {                                                                \
+        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to EXIT lockname=%s", #name_); \
+        MPIU_Thread_CS_exit_lockname_impl_(#name_, &mutex_); \
+    } while (0)
+
+#define MPIU_THREAD_CS_YIELD_LOCKNAME(name_,mutex_)                     \
+    do {                                                                \
+        MPIU_DBG_MSG_S(THREAD,VERBOSE,"attempting to YIELD lockname=%s", #name_); \
+        MPIU_Thread_CS_yield_lockname_impl_(#name_, &mutex_); \
+    } while (0)
+
+
+enum MPIU_Nest_mutexes {
+    MPIU_NEST_GLOBAL = 0,
+    MPIU_NEST_POBJ,   /* Nesting does not really make sense for POBJ */
+    MPIU_NEST_NUM_MUTEXES
+};
+
+
+/* Definitions of the thread support for various levels of thread granularity */
+#if MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_GLOBAL
+#include "mpiu_thread_global.h"
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_PER_OBJECT
+#include "mpiu_thread_pobj.h"
+#elif MPICH_THREAD_GRANULARITY == MPIR_THREAD_GRANULARITY_LOCK_FREE
+#error lock-free not yet implemented
+#else
+#error Unrecognized thread granularity
+#endif
+
+
+#undef FUNCNAME
+#define FUNCNAME MPIU_Thread_CS_enter_lockname_impl_
+#undef FCNAME
+#define FCNAME MPL_QUOTE(FUNCNAME)
+/* these are inline functions instead of macros to avoid some of the
+ * MPIU_THREADPRIV_DECL scoping issues */
+MPL_DBG_ATTRIBUTE_NOINLINE ATTRIBUTE((unused))
+static MPL_DBG_INLINE_KEYWORD void
+MPIU_Thread_CS_enter_lockname_impl_(const char *lockname, MPIU_Thread_mutex_t * mutex)
+{
+    int err;
+    MPIU_DBG_MSG_S(THREAD, TYPICAL, "locking %s", lockname);
+    MPIU_Thread_mutex_lock(mutex, &err);
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPIU_Thread_CS_exit_lockname_impl_
+#undef FCNAME
+#define FCNAME MPL_QUOTE(FUNCNAME)
+MPL_DBG_ATTRIBUTE_NOINLINE ATTRIBUTE((unused))
+static MPL_DBG_INLINE_KEYWORD void
+MPIU_Thread_CS_exit_lockname_impl_(const char *lockname, MPIU_Thread_mutex_t * mutex)
+{
+    int err;
+    MPIU_DBG_MSG_S(THREAD, TYPICAL, "unlocking %s", lockname);
+    MPIU_Thread_mutex_unlock(mutex, &err);
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPIU_Thread_CS_yield_lockname_impl_
+#undef FCNAME
+#define FCNAME MPL_QUOTE(FUNCNAME)
+MPL_DBG_ATTRIBUTE_NOINLINE ATTRIBUTE((unused))
+static MPL_DBG_INLINE_KEYWORD void
+MPIU_Thread_CS_yield_lockname_impl_(const char *lockname, MPIU_Thread_mutex_t * mutex)
+{
+    MPIU_DBG_MSG_S(THREAD, TYPICAL, "yielding %s", lockname);
+    MPIU_Thread_yield(mutex);
+}
+
+/* ------------------------------------------------------------------- */
+/* recursive versions, these are for the few locks where it is difficult or
+ * impossible to eliminate recursive locking usage */
+
+#undef FUNCNAME
+#define FUNCNAME MPIU_Thread_CS_enter_lockname_recursive_impl_
+#undef FCNAME
+#define FCNAME MPL_QUOTE(FUNCNAME)
+/* these are inline functions instead of macros to avoid some of the
+ * MPIU_THREADPRIV_DECL scoping issues */
+MPL_DBG_ATTRIBUTE_NOINLINE ATTRIBUTE((unused))
+static MPL_DBG_INLINE_KEYWORD void
+MPIU_Thread_CS_enter_lockname_recursive_impl_(enum MPIU_Nest_mutexes kind,
+                                              const char *lockname, MPIU_Thread_mutex_t * mutex)
+{
+    int depth, err;
+    MPIU_THREADPRIV_DECL;
+    MPIU_THREADPRIV_GET;
+    depth = MPIU_THREADPRIV_FIELD(lock_depth)[kind];
+    MPIU_DBG_MSG_D(THREAD, TYPICAL, "recursive enter, depth=%d", depth);
+
+    MPIU_Assert(depth >= 0 && depth < 10);      /* probably a mismatch if we hit this */
+
+    if (depth == 0) {
+        MPIU_DBG_MSG_S(THREAD, TYPICAL, "locking %s", lockname);
+        MPIU_Thread_mutex_lock(mutex, &err);
+    }
+    MPIU_THREADPRIV_FIELD(lock_depth)[kind] += 1;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPIU_Thread_CS_exit_lockname_recursive_impl_
+#undef FCNAME
+#define FCNAME MPL_QUOTE(FUNCNAME)
+MPL_DBG_ATTRIBUTE_NOINLINE ATTRIBUTE((unused))
+static MPL_DBG_INLINE_KEYWORD void
+MPIU_Thread_CS_exit_lockname_recursive_impl_(enum MPIU_Nest_mutexes kind,
+                                             const char *lockname, MPIU_Thread_mutex_t * mutex)
+{
+    int depth, err;
+    MPIU_THREADPRIV_DECL;
+    MPIU_THREADPRIV_GET;
+    depth = MPIU_THREADPRIV_FIELD(lock_depth)[kind];
+    MPIU_DBG_MSG_D(THREAD, TYPICAL, "recursive exit, depth=%d", depth);
+
+    MPIU_Assert(depth > 0 && depth < 10);       /* probably a mismatch if we hit this */
+
+    if (depth == 1) {
+        MPIU_DBG_MSG_S(THREAD, TYPICAL, "unlocking %s", lockname);
+        MPIU_Thread_mutex_unlock(mutex, &err);
+        MPIU_Assert_fmt_msg(err == MPIU_THREAD_SUCCESS,
+                            ("mutex_unlock failed, err=%d (%s)", err, MPIU_Strerror(err)));
+
+    }
+    MPIU_THREADPRIV_FIELD(lock_depth)[kind] -= 1;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPIU_Thread_CS_yield_lockname_recursive_impl_
+#undef FCNAME
+#define FCNAME MPL_QUOTE(FUNCNAME)
+MPL_DBG_ATTRIBUTE_NOINLINE ATTRIBUTE((unused))
+static MPL_DBG_INLINE_KEYWORD void
+MPIU_Thread_CS_yield_lockname_recursive_impl_(enum MPIU_Nest_mutexes kind,
+                                              const char *lockname, MPIU_Thread_mutex_t * mutex)
+{
+    int depth ATTRIBUTE((unused));
+    MPIU_THREADPRIV_DECL;
+    MPIU_THREADPRIV_GET;
+    depth = MPIU_THREADPRIV_FIELD(lock_depth)[kind];
+    MPIU_DBG_MSG_D(THREAD, TYPICAL, "recursive yield, depth=%d", depth);
+
+    MPIU_Assert(depth > 0 && depth < 10);       /* we must hold the mutex */
+    /* no need to update depth, this is a thread-local value */
+
+    MPIU_DBG_MSG_S(THREAD, TYPICAL, "yielding %s", lockname);
+    MPIU_Thread_yield(mutex);
+}
+
+/* undef for safety, this is a commonly-included header */
+#undef FUNCNAME
+#undef FCNAME
+
+#endif /* !defined(MPIU_THREAD_MULTIPLE_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_pobj.h b/src/util/thread/mpiu_thread_pobj.h
new file mode 100644
index 0000000..fb9e187
--- /dev/null
+++ b/src/util/thread/mpiu_thread_pobj.h
@@ -0,0 +1,201 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPIU_THREAD_POBJ_H_INCLUDED)
+#define MPIU_THREAD_POBJ_H_INCLUDED
+
+/* There are multiple locks, one for each (major) object */
+
+/* MT FIXME the following description is almost right, but it needs minor
+ * updates and revision to account for the COMPLETION CS and other issues in the
+ * request */
+/* The fine-grained locking discipline for requests is unfortunately complicated:
+ *
+ * (1) Raw allocation and deallocation of requests is protected internally by
+ * the HANDLEALLOC critical section.  This is currently the same as the HANDLE
+ * CS, not sure why we have both...
+ *
+ * (2) Once allocated, a directly allocated request is intially held exclusively
+ * by a single thread.  Direct allocation is common for send requests, but recv
+ * requests are usually created differently.
+ *
+ * (3) Most receive requests are created as the result of a call to FDP_or_AEU
+ * or FDU_or_AEP.  Calls to these functions (along with the other receive queue
+ * functions) must be inside a MSGQUEUE CS.  This CS protects the queue data
+ * structures as well as any fields inside the requests while they are in the
+ * queue.  For example, assume a call to FDU_or_AEP, as in MPID_Recv.  If the
+ * FDU case hits, the MSGQUEUE CS may be released immediately after the call.
+ * If the AEP case hits, however, the MSGQUEUE CS must remain held until any
+ * request field manipulation (such as dev.recv_pending_count) is complete.
+ *
+ * (4) In both the send and receive request cases, there is usually a particular
+ * thread in some upper-level code (e.g. MPI_Send) with interest in the
+ * completion of the request.  This may or may not be a thread that is also
+ * making progress on this request (often not).  The upper level code must not
+ * attempt to access any request fields (such as the status) until completion is
+ * signalled by the lower layer.
+ *
+ * (5) Once removed from the receive queue, the request is once again
+ * exclusively owned by the dequeuing thread.  From here, the dequeuing thread
+ * may do whatever it wants with the request without holding any CS, until it
+ * signals the request's completion.  Signalling completion indicates that the
+ * thread in the upper layer polling on it may access the rest of the fields in
+ * the request.  This completion signalling is lock-free and must be implemented
+ * carefully to work correctly in the face of optimizing compilers and CPUs.
+ * The upper-level thread now wholly owns the request until it is deallocated.
+ *
+ * (6) In ch3:nemesis at least, multithreaded access to send requests is managed
+ * by the MPIDCOMM (progress engine) CS.  The completion signalling pattern
+ * applies here (think MPI_Isend/MPI_Wait).
+ *
+ * (7) Request cancellation is tricky-ish.  For send cancellation, it is
+ * possible that the completion counter is actually *incremented* because a
+ * pkt is sent to the recipient asking for remote cancellation.  By asking for
+ * cancellation (of any kind of req), the upper layer gives up its exclusive
+ * access to the request and must wait for the completion counter to drop to 0
+ * before exclusively accessing the request fields.
+ *
+ * The completion counter is a reference count, much like the object liveness
+ * reference count.  However it differs from a normal refcount because of
+ * guarantees in the MPI Standard.  Applications must not attempt to complete
+ * (wait/test/free) a given request concurrently in two separate threads.  So
+ * checking for cc==0 is safe because only one thread is ever allowed to make
+ * that check.
+ *
+ * A non-zero completion count must always be accompanied by a normal reference
+ * that is logically held by the progress engine.  Similarly, once the
+ * completion counter drops to zero, the progress engine is expected to release
+ * its reference.
+ */
+/* lock ordering: if MPIDCOMM+MSGQUEUE must be aquired at the same time, then
+ * the order should be to acquire MPIDCOMM first, then MSGQUEUE.  Release in
+ * reverse order. */
+
+#define MPIU_THREAD_CS_ENTER_GLOBAL(_context)
+#define MPIU_THREAD_CS_EXIT_GLOBAL(_context)
+#define MPIU_THREAD_CS_YIELD_GLOBAL(_context)
+
+#define MPIU_THREAD_CS_ENTER_POBJ(_context)             \
+    do {                                                \
+        MPIU_THREAD_CHECK_BEGIN;                        \
+        MPIU_THREAD_CS_ENTER_LOCKNAME(POBJ,_context);   \
+        MPIU_THREAD_CHECK_END;                          \
+    } while (0)
+
+#define MPIU_THREAD_CS_EXIT_POBJ(_context)              \
+    do {                                                \
+        MPIU_THREAD_CHECK_BEGIN;                        \
+        MPIU_THREAD_CS_EXIT_LOCKNAME(POBJ,_context);    \
+        MPIU_THREAD_CHECK_END;                          \
+    } while (0)
+
+#define MPIU_THREAD_CS_YIELD_POBJ(_context)             \
+    do {                                                \
+        MPIU_THREAD_CHECK_BEGIN;                        \
+        MPIU_THREAD_CS_YIELD_LOCKNAME(POBJ,_context);   \
+        MPIU_THREAD_CHECK_END;                          \
+    } while (0)
+
+
+/* define a type for the completion counter */
+#include "opa_primitives.h"
+
+typedef OPA_int_t MPIU_cc_t;
+
+/* implies no barrier, since this routine should only be used for request
+ * initialization */
+static inline void MPIU_cc_set(MPIU_cc_t * cc_ptr, int val)
+{
+    if (val == 0) {
+        /* values other than 0 do not enforce any ordering, and therefore do not
+         * start a HB arc */
+        /* MT FIXME using cc_set in this way is sloppy.  Sometimes the caller
+         * really does know that the cc value may cleared, but more likely this
+         * is just a hack to avoid the work of figuring out what the cc value
+         * currently is and decrementing it instead. */
+        /* barrier ensures that any state written before indicating completion is
+         * seen by the thread polling on the cc.  If OPA adds store-release
+         * semantics, we can convert to that instead. */
+        OPA_write_barrier();
+        MPL_VG_ANNOTATE_HAPPENS_BEFORE(cc_ptr);
+    }
+
+#if defined(MPL_VG_AVAILABLE)
+    /* MT subtle: store_int is actually safe to use, but Helgrind/DRD/TSan all
+     * view the store/load pair as a race.  Using an atomic operation for the
+     * store side makes all three happy.  DRD & TSan also support
+     * ANNOTATE_BENIGN_RACE, but Helgrind does not. */
+    OPA_swap_int(cc_ptr, val);
+#else
+    OPA_store_int(cc_ptr, val);
+#endif
+}
+
+ATTRIBUTE((unused))
+static MPL_DBG_INLINE_KEYWORD int MPIU_cc_is_complete(MPIU_cc_t * cc_ptr)
+{
+    int complete;
+
+    complete = (0 == OPA_load_int(cc_ptr));
+    if (complete) {
+        MPL_VG_ANNOTATE_HAPPENS_AFTER(cc_ptr);
+        OPA_read_barrier();
+    }
+
+    return complete;
+}
+
+/* incomplete_==TRUE iff the cc > 0 after the decr */
+#define MPIU_cc_decr(cc_ptr_, incomplete_)                                  \
+    do {                                                                    \
+        OPA_write_barrier();                                                \
+        MPL_VG_ANNOTATE_HAPPENS_BEFORE(cc_ptr_);                            \
+        *(incomplete_) = !OPA_decr_and_test_int(cc_ptr_);                   \
+        /* TODO check if this HA is actually necessary */                   \
+        if (!*(incomplete_)) {                                              \
+            MPL_VG_ANNOTATE_HAPPENS_AFTER(cc_ptr_);                         \
+        }                                                                   \
+    } while (0)
+
+/* MT FIXME does this need a HB/HA annotation?  This macro is only used for
+ * cancel_send right now. */
+/* was_incomplete_==TRUE iff the cc==0 before the decr */
+#define MPIU_cc_incr(cc_ptr_, was_incomplete_)                              \
+    do {                                                                    \
+        *(was_incomplete_) = OPA_fetch_and_incr_int(cc_ptr_);               \
+    } while (0)
+
+#define MPIU_cc_get(cc_) OPA_load_int(&(cc_))
+
+/* "publishes" the obj with handle value (handle_) via the handle pointer
+ * (hnd_lval_).  That is, it is a version of the following statement that fixes
+ * memory consistency issues:
+ *     (hnd_lval_) = (handle_);
+ *
+ * assumes that the following is always true: typeof(*hnd_lval_ptr_)==int
+ */
+/* This could potentially be generalized beyond MPI-handle objects, but we
+ * should only take that step after seeing good evidence of its use.  A general
+ * macro (that is portable to non-gcc compilers) will need type information to
+ * make the appropriate volatile cast. */
+/* Ideally _GLOBAL would use this too, but we don't want to count on OPA
+ * availability in _GLOBAL mode.  Instead the GLOBAL critical section should be
+ * used. */
+#define MPIU_OBJ_PUBLISH_HANDLE(hnd_lval_, handle_)                                 \
+    do {                                                                            \
+        if (MPIR_ThreadInfo.isThreaded) {                               \
+            /* wmb ensures all read-only object field values are seen before the */ \
+            /* handle value is seen at the application level */                     \
+            OPA_write_barrier();                                                    \
+            /* volatile ensures lval is not speculatively read or written */        \
+            *(volatile int *)&(hnd_lval_) = (handle_);                              \
+        }                                                                           \
+        else {                                                                      \
+            (hnd_lval_) = (handle_);                                                \
+        }                                                                           \
+    } while (0)
+
+#endif /* !defined(MPIU_THREAD_POBJ_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_posix.c b/src/util/thread/mpiu_thread_posix.c
index 9907e6f..22ba3d8 100644
--- a/src/util/thread/mpiu_thread_posix.c
+++ b/src/util/thread/mpiu_thread_posix.c
@@ -11,7 +11,7 @@
 #include "mpiutil.h"    /* for HAS_NO_SYMBOLS_WARNING */
 #include "mpiu_thread.h"
 
-MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
+MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 /* This file currently implements these as a preprocessor if/elif/else sequence.
  * This has the upside of not doing #includes for .c files or (poorly
diff --git a/src/util/thread/mpiu_thread_posix_funcs.h b/src/util/thread/mpiu_thread_posix_funcs.h
index ffeac31..1ffde48 100644
--- a/src/util/thread/mpiu_thread_posix_funcs.h
+++ b/src/util/thread/mpiu_thread_posix_funcs.h
@@ -248,9 +248,8 @@ do {                                                                       \
 									\
     /* FIXME: convert error to an MPIU_THREAD_ERR value */		\
     *(int *)(err_ptr_) = err__;                                         \
-    if (err__) {                                                        \
-        MPIU_DBG_MSG_FMT(THREAD,TYPICAL,(MPIU_DBG_FDEST,"error in cond_wait on cond=%p mutex=%p err__=%d",(cond_ptr_),(mutex_ptr_), err__)) \
-            }                                                           \
+    MPIU_Assert_fmt_msg(err__ == 0,                   \
+                        ("cond_wait failed, err=%d (%s)",err__,strerror(err__))); \
     MPIU_DBG_MSG_FMT(THREAD,TYPICAL,(MPIU_DBG_FDEST,"Exit cond_wait on cond=%p mutex=%p",(cond_ptr_),(mutex_ptr_))) \
 } while (0)
 
@@ -263,6 +262,8 @@ do {                                                               \
 								\
     /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
     *(int *)(err_ptr_) = err__;                                 \
+    MPIU_Assert_fmt_msg(err__ == 0,                     \
+                        ("cond_broadcast failed, err__=%d (%s)",err__,strerror(err__))); \
 } while (0)
 
 #define MPIU_Thread_cond_signal(cond_ptr_, err_ptr_)		\
@@ -274,6 +275,8 @@ do {                                                               \
 								\
     /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
     *(int *)(err_ptr_) = err__;                                 \
+    MPIU_Assert_fmt_msg(err__ == 0,                                     \
+                        ("cond_signal failed, err__=%d (%s)",err__,strerror(err__))); \
 } while (0)
 
 
@@ -308,7 +311,9 @@ do {                                                               \
     err__ = pthread_setspecific(*(tls_ptr_), (value_));		\
 								\
     /* FIXME: convert error to an MPIU_THREAD_ERR value */	\
-    *(int *)(err_ptr_) = err__;                                 \
+    *(int *)(err_ptr_) = err__;                             \
+    MPIU_Assert_fmt_msg(err__ == 0,                     \
+                        ("tls_set failed, err__=%d (%s)",err__,strerror(err__))); \
 } while (0)
 
 #define MPIU_Thread_tls_get(tls_ptr_, value_ptr_, err_ptr_)	\
diff --git a/src/util/thread/mpiu_thread_priv.h b/src/util/thread/mpiu_thread_priv.h
new file mode 100644
index 0000000..25afaef
--- /dev/null
+++ b/src/util/thread/mpiu_thread_priv.h
@@ -0,0 +1,112 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPIU_THREAD_PRIV_H_INCLUDED)
+#define MPIU_THREAD_PRIV_H_INCLUDED
+
+/* The following three macros define a way to portably access thread-private
+   storage in MPICH, and avoid extra overhead when MPICH is single
+   threaded
+   INITKEY - Create the key.  Must happen *before* the other threads
+             are created
+   INIT    - Create the thread-private storage.  Must happen once per thread
+   DECL    - Declare local variables
+   GET     - Access the thread-private storage
+   FIELD   - Access the thread-private field (by name)
+   FINALIZE - to be invoked when all threads no longer need access to the thread
+              local storage, such as at MPI_Finalize time
+
+   The "DECL" is the extern so that there is always a statement for
+   the declaration.
+*/
+
+#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);
+
+/* 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
+   definitions.
+
+   The approach is to have TWO MPICH_PerThread_t pointers.  One is local
+   (The MPIU_THREADPRIV_DECL is used in the routines local definitions),
+   as in the threaded version of these macros.  This is set by using a routine
+   to get thread-private storage.  The second is a preallocated, extern
+   MPICH_PerThread_t struct, as in the single threaded case.  Based on
+   MPIR_Process.isThreaded, one or the other is used.
+
+ */
+/* For the single threaded case, we use a preallocated structure
+   This structure is allocated in src/mpi/init/initthread.c */
+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);                                     \
+        }                                                               \
+    } while (0)
+
+#define MPIU_THREADPRIV_INIT                                            \
+    do {                                                                \
+        if (MPIR_ThreadInfo.isThreaded) {                               \
+            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); \
+        }                                                               \
+    } while (0)
+
+#define MPIU_THREADPRIV_GET                                             \
+    do {                                                                \
+        if (!MPIU_Thread) {                                             \
+            if (MPIR_ThreadInfo.isThreaded) {                           \
+                MPIU_Thread_tls_get(&MPIR_ThreadInfo.thread_storage, &MPIU_Thread); \
+                if (!MPIU_Thread) {                                     \
+                    MPIU_THREADPRIV_INIT; /* subtle, sets MPIU_Thread */ \
+                }                                                       \
+            }                                                           \
+            else {                                                      \
+                MPIU_Thread = &MPIU_ThreadSingle;                       \
+            }                                                           \
+            MPIU_Assert(MPIU_Thread);                                   \
+        }                                                               \
+    } 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_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_Thread_tls_set(&MPIR_ThreadInfo.thread_storage,NULL);  \
+            MPIU_Thread_tls_destroy(&MPIR_ThreadInfo.thread_storage,&tpf_err_); \
+            MPIU_Assert(tpf_err_ == 0);                                 \
+        }                                                               \
+        } while (0)
+
+#else /* defined(MPIU_TLS_SPECIFIER) */
+
+/* We have proper thread-local storage (TLS) support from the compiler, which
+ * should yield the best performance and simplest code, so we'll use that. */
+extern MPIU_TLS_SPECIFIER MPICH_PerThread_t MPIU_Thread;
+
+#define MPIU_THREADPRIV_INITKEY
+#define MPIU_THREADPRIV_INIT
+#define MPIU_THREADPRIV_DECL
+#define MPIU_THREADPRIV_GET
+#define MPIU_THREADPRIV_FIELD(a_) (MPIU_Thread.a_)
+#define MPIU_THREADPRIV_FINALIZE do{}while(0)
+
+#endif /* defined(MPIU_TLS_SPECIFIER) */
+
+#endif /* !defined(MPIU_THREAD_PRIV_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_single.h b/src/util/thread/mpiu_thread_single.h
new file mode 100644
index 0000000..3d4df92
--- /dev/null
+++ b/src/util/thread/mpiu_thread_single.h
@@ -0,0 +1,66 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPIU_THREAD_SINGLE_H_INCLUDED)
+#define MPIU_THREAD_SINGLE_H_INCLUDED
+
+#define MPIU_THREAD_CHECK_BEGIN
+#define MPIU_THREAD_CHECK_END
+
+/* If single threaded, make this point at a pre-allocated segment.
+   This structure is allocated in src/mpi/init/initthread.c */
+extern MPICH_PerThread_t MPIU_Thread;
+
+#define MPIU_THREADPRIV_INITKEY
+#define MPIU_THREADPRIV_INIT
+#define MPIU_THREADPRIV_DECL
+#define MPIU_THREADPRIV_GET
+#define MPIU_THREADPRIV_FIELD(a_) (MPIU_Thread.a_)
+
+/* Helper definitions for the default macro definitions */
+#define MPIU_THREAD_CS_ENTER(_name,_context)
+#define MPIU_THREAD_CS_EXIT(_name,_context)
+#define MPIU_THREAD_CS_YIELD(_name,_context)
+
+
+/* define a type for the completion counter */
+typedef int MPIU_cc_t;
+
+#define MPIU_cc_get(cc_) (cc_)
+#define MPIU_cc_set(cc_ptr_, val_) (*(cc_ptr_)) = (val_)
+#define MPIU_cc_is_complete(cc_ptr_) (0 == *(cc_ptr_))
+
+#define MPIU_cc_incr(cc_ptr_, was_incomplete_)  \
+    do {                                        \
+        *(was_incomplete_) = (*(cc_ptr_))++;    \
+    } while (0)
+
+#define MPIU_cc_decr(cc_ptr_, incomplete_)      \
+    do {                                        \
+        *(incomplete_) = --(*(cc_ptr_));        \
+    } while (0)
+
+
+/* "publishes" the obj with handle value (handle_) via the handle pointer
+ * (hnd_lval_).  That is, it is a version of the following statement that fixes
+ * memory consistency issues:
+ *     (hnd_lval_) = (handle_);
+ *
+ * assumes that the following is always true: typeof(*hnd_lval_ptr_)==int
+ */
+/* This could potentially be generalized beyond MPI-handle objects, but we
+ * should only take that step after seeing good evidence of its use.  A general
+ * macro (that is portable to non-gcc compilers) will need type information to
+ * make the appropriate volatile cast. */
+/* Ideally _GLOBAL would use this too, but we don't want to count on OPA
+ * availability in _GLOBAL mode.  Instead the GLOBAL critical section should be
+ * used. */
+#define MPIU_OBJ_PUBLISH_HANDLE(hnd_lval_, handle_)     \
+    do {                                                \
+        (hnd_lval_) = (handle_);                        \
+    } while (0)
+
+#endif /* !defined(MPIU_THREAD_SINGLE_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_solaris.c b/src/util/thread/mpiu_thread_solaris.c
index abb9717..390185f 100644
--- a/src/util/thread/mpiu_thread_solaris.c
+++ b/src/util/thread/mpiu_thread_solaris.c
@@ -11,7 +11,7 @@
 #include "mpiutil.h"    /* for HAS_NO_SYMBOLS_WARNING */
 #include "mpiu_thread.h"
 
-MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
+MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 /* This file currently implements these as a preprocessor if/elif/else sequence.
  * This has the upside of not doing #includes for .c files or (poorly
diff --git a/src/util/thread/mpiu_thread_win.c b/src/util/thread/mpiu_thread_win.c
index b3c2c35..161b102 100644
--- a/src/util/thread/mpiu_thread_win.c
+++ b/src/util/thread/mpiu_thread_win.c
@@ -11,7 +11,7 @@
 #include "mpiutil.h"    /* for HAS_NO_SYMBOLS_WARNING */
 #include "mpiu_thread.h"
 
-MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
+MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 /* This file currently implements these as a preprocessor if/elif/else sequence.
  * This has the upside of not doing #includes for .c files or (poorly
diff --git a/src/util/thread/mpiu_thread_win_funcs.h b/src/util/thread/mpiu_thread_win_funcs.h
index 6e91710..ff6cd9f 100644
--- a/src/util/thread/mpiu_thread_win_funcs.h
+++ b/src/util/thread/mpiu_thread_win_funcs.h
@@ -22,7 +22,7 @@ do{									\
         }								\
         else                                                            \
         {                                                               \
-            *(int *)(err_ptr_) = MPIU_THREAD_ERR_SUCCESS;                \
+            *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;                \
         }                                                               \
     }                                                                   \
 }while(0)
@@ -35,7 +35,7 @@ do{								\
     {                                                           \
         if (result__)                                           \
         {                                                       \
-            *(int *)(err_ptr_) = MPIU_THREAD_ERR_SUCCESS;        \
+            *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;        \
         }                                                       \
         else                                                    \
         {							\
@@ -52,7 +52,7 @@ do{								\
     {                                                           \
         if (result__)                                           \
         {                                                       \
-            *(int *)(err_ptr_) = MPIU_THREAD_ERR_SUCCESS;        \
+            *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;        \
         }                                                       \
         else                                                    \
         {							\
@@ -72,7 +72,7 @@ do{								\
         }							\
         else                                                    \
         {                                                       \
-            *(int *)(err_ptr_) = MPIU_THREAD_ERR_SUCCESS;        \
+            *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;        \
         }                                                       \
     }                                                           \
 }while(0)
diff --git a/src/util/timers/Makefile.mk b/src/util/timers/Makefile.mk
new file mode 100644
index 0000000..dc4e728
--- /dev/null
+++ b/src/util/timers/Makefile.mk
@@ -0,0 +1,10 @@
+## -*- Mode: Makefile; -*-
+## vim: set ft=automake :
+##
+## (C) 2011 by Argonne National Laboratory.
+##     See COPYRIGHT in top-level directory.
+##
+
+AM_CPPFLAGS += -I$(top_builddir)/src/util/timers
+nodist_noinst_HEADERS += src/util/timers/mpiu_timer.h
+mpi_core_sources += src/util/timers/mpiu_timer.c
diff --git a/src/util/timers/mpiu_timer.c b/src/util/timers/mpiu_timer.c
new file mode 100644
index 0000000..c0d72b7
--- /dev/null
+++ b/src/util/timers/mpiu_timer.c
@@ -0,0 +1,422 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpiu_timer.h"
+
+#if MPICH_TIMER_KIND == USE_GETHRTIME
+/*
+ * MPIU_Time_t is hrtime_t, which under Solaris is defined as a 64bit
+ * longlong_t .  However, the Solaris header files will define
+ * longlong_t as a structure in some circumstances, making arithmetic
+ * with hrtime_t invalid.  FIXME.
+ * To fix this, we'll need to test hrtime_t arithmetic in the configure
+ * program, and if it fails, check for the Solaris defintions (
+ * union { double _d; int32_t _l[2]; }.  Alternately, we may decide that
+ * if hrtime_t is not supported, then neither is gethrtime.
+ *
+ * Note that the Solaris sys/types.h file *assumes* that no other compiler
+ * supports an 8 byte long long.  We can also cast hrtime_t to long long
+ * if long long is available and 8 bytes.
+ */
+void MPIU_Wtime(MPIU_Time_t * timeval)
+{
+    *timeval = gethrtime();
+}
+
+void MPIU_Wtime_diff(MPIU_Time_t * t1, MPIU_Time_t * t2, double *diff)
+{
+    *diff = 1.0e-9 * (double) (*t2 - *t1);
+}
+
+void MPIU_Wtime_todouble(MPIU_Time_t * t, double *val)
+{
+    *val = 1.0e-9 * (*t);
+}
+
+void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
+{
+    *t3 += ((*t2) - (*t1));
+}
+
+double MPIU_Wtick(void)
+{
+    /* According to the documentation, ticks should be in nanoseconds.  This
+     * is untested */
+    return 1.0e-9;
+}
+void MPIU_Init_wtick();
+int MPIU_Wtime_init(void)
+{
+    MPIU_Init_wtick();
+    return 0;
+}
+
+#elif MPICH_TIMER_KIND == USE_CLOCK_GETTIME
+void MPIU_Wtime(MPIU_Time_t * timeval)
+{
+    /* POSIX timer (14.2.1, page 311) */
+    clock_gettime(CLOCK_REALTIME, timeval);
+}
+
+void MPIU_Wtime_diff(MPIU_Time_t * t1, MPIU_Time_t * t2, double *diff)
+{
+    *diff = ((double) (t2->tv_sec - t1->tv_sec) + 1.0e-9 * (double) (t2->tv_nsec - t1->tv_nsec));
+}
+
+void MPIU_Wtime_todouble(MPIU_Time_t * t, double *val)
+{
+    *val = ((double) t->tv_sec + 1.0e-9 * (double) t->tv_nsec);
+}
+
+void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
+{
+    int nsec, sec;
+
+    nsec = t2->tv_nsec - t1->tv_nsec;
+    sec = t2->tv_sec - t1->tv_sec;
+
+    t3->tv_sec += sec;
+    t3->tv_nsec += nsec;
+    while (t3->tv_nsec > 1000000000) {
+        t3->tv_nsec -= 1000000000;
+        t3->tv_sec++;
+    }
+}
+
+/* FIXME: We need to cleanup the use of the MPIU_Generic_wtick prototype */
+double MPIU_Generic_wtick(void);
+
+double MPIU_Wtick(void)
+{
+    struct timespec res;
+    int rc;
+
+    rc = clock_getres(CLOCK_REALTIME, &res);
+    if (!rc)
+        /* May return -1 for unimplemented ! */
+        return res.tv_sec + 1.0e-9 * res.tv_nsec;
+
+    /* Sigh.  If not implemented (POSIX allows that),
+     * then we need to use the generic tick routine */
+    return MPIU_Generic_wtick();
+}
+void MPIU_Init_wtick();
+int MPIU_Wtime_init(void)
+{
+    MPIU_Init_wtick();
+    return 0;
+}
+
+#define MPICH_NEEDS_GENERIC_WTICK
+/* Rename the function so that we can access it */
+#define MPIU_Wtick MPIU_Generic_wtick
+
+#elif MPICH_TIMER_KIND == USE_GETTIMEOFDAY
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+void MPIU_Wtime(MPIU_Time_t * tval)
+{
+    gettimeofday(tval, NULL);
+}
+
+void MPIU_Wtime_diff(MPIU_Time_t * t1, MPIU_Time_t * t2, double *diff)
+{
+    *diff = ((double) (t2->tv_sec - t1->tv_sec) + .000001 * (double) (t2->tv_usec - t1->tv_usec));
+}
+
+void MPIU_Wtime_todouble(MPIU_Time_t * t, double *val)
+{
+    *val = (double) t->tv_sec + .000001 * (double) t->tv_usec;
+}
+
+void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
+{
+    int usec, sec;
+
+    usec = t2->tv_usec - t1->tv_usec;
+    sec = t2->tv_sec - t1->tv_sec;
+    t3->tv_usec += usec;
+    t3->tv_sec += sec;
+    /* Handle carry to the integer seconds field */
+    while (t3->tv_usec > 1000000) {
+        t3->tv_usec -= 1000000;
+        t3->tv_sec++;
+    }
+}
+
+#define MPICH_NEEDS_GENERIC_WTICK
+
+
+#elif MPICH_TIMER_KIND == USE_LINUX86_CYCLE
+#include <sys/time.h>
+double MPIU_Seconds_per_tick = 0.0;
+double MPIU_Wtick(void)
+{
+    return MPIU_Seconds_per_tick;
+}
+
+int MPIU_Wtime_init(void)
+{
+    unsigned long long t1, t2;
+    struct timeval tv1, tv2;
+    double td1, td2;
+
+    gettimeofday(&tv1, NULL);
+    MPIU_Wtime(&t1);
+    usleep(250000);
+    gettimeofday(&tv2, NULL);
+    MPIU_Wtime(&t2);
+
+    td1 = tv1.tv_sec + tv1.tv_usec / 1000000.0;
+    td2 = tv2.tv_sec + tv2.tv_usec / 1000000.0;
+
+    MPIU_Seconds_per_tick = (td2 - td1) / (double) (t2 - t1);
+    return 0;
+}
+
+/* Time stamps created by a macro */
+void MPIU_Wtime_diff(MPIU_Time_t * t1, MPIU_Time_t * t2, double *diff)
+{
+    *diff = (double) (*t2 - *t1) * MPIU_Seconds_per_tick;
+}
+
+void MPIU_Wtime_todouble(MPIU_Time_t * t, double *val)
+{
+    /* This returns the number of cycles as the "time".  This isn't correct
+     * for implementing MPI_Wtime, but it does allow us to insert cycle
+     * counters into test programs */
+    *val = (double) *t * MPIU_Seconds_per_tick;
+}
+
+void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
+{
+    *t3 += (*t2 - *t1);
+}
+
+
+
+#elif MPICH_TIMER_KIND == USE_GCC_IA64_CYCLE
+#include <sys/time.h>
+double MPIU_Seconds_per_tick = 0.0;
+double MPIU_Wtick(void)
+{
+    return MPIU_Seconds_per_tick;
+}
+
+int MPIU_Wtime_init(void)
+{
+    unsigned long long t1, t2;
+    struct timeval tv1, tv2;
+    double td1, td2;
+
+    gettimeofday(&tv1, NULL);
+    MPIU_Wtime(&t1);
+    usleep(250000);
+    gettimeofday(&tv2, NULL);
+    MPIU_Wtime(&t2);
+
+    td1 = tv1.tv_sec + tv1.tv_usec / 1000000.0;
+    td2 = tv2.tv_sec + tv2.tv_usec / 1000000.0;
+
+    MPIU_Seconds_per_tick = (td2 - td1) / (double) (t2 - t1);
+    return 0;
+}
+
+/* Time stamps created by a macro */
+void MPIU_Wtime_diff(MPIU_Time_t * t1, MPIU_Time_t * t2, double *diff)
+{
+    *diff = (double) (*t2 - *t1) * MPIU_Seconds_per_tick;
+}
+
+void MPIU_Wtime_todouble(MPIU_Time_t * t, double *val)
+{
+    /* This returns the number of cycles as the "time".  This isn't correct
+     * for implementing MPI_Wtime, but it does allow us to insert cycle
+     * counters into test programs */
+    *val = (double) *t * MPIU_Seconds_per_tick;
+}
+
+void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
+{
+    *t3 += (*t2 - *t1);
+}
+
+#elif MPICH_TIMER_KIND == USE_LINUXALPHA_CYCLE
+/* FIXME: This should have been fixed in the configure, rather than as a
+   make-time error message */
+#error "LinuxAlpha cycle counter not supported"
+
+#elif (MPICH_TIMER_KIND == USE_WIN86_CYCLE) || (MPICH_TIMER_KIND == USE_WIN64_CYCLE)
+double MPIU_Seconds_per_tick = 0.0;
+double MPIU_Wtick(void)
+{
+    return MPIU_Seconds_per_tick;
+}
+
+void MPIU_Wtime_todouble(MPIU_Time_t * t, double *d)
+{
+    *d = (double) (__int64) * t * MPIU_Seconds_per_tick;
+}
+
+void MPIU_Wtime_diff(MPIU_Time_t * t1, MPIU_Time_t * t2, double *diff)
+{
+    *diff = (double) ((__int64) (*t2 - *t1)) * MPIU_Seconds_per_tick;
+}
+
+int MPIU_Wtime_init(void)
+{
+    MPIU_Time_t t1, t2;
+    DWORD s1, s2;
+    double d;
+    int i;
+
+    MPIU_Wtime(&t1);
+    MPIU_Wtime(&t1);
+
+    /* time an interval using both timers */
+    s1 = GetTickCount();
+    MPIU_Wtime(&t1);
+    /*Sleep(250); *//* Sleep causes power saving cpu's to stop which stops the counter */
+    while (GetTickCount() - s1 < 200) {
+        for (i = 2; i < 1000; i++)
+            d = (double) i / (double) (i - 1);
+    }
+    s2 = GetTickCount();
+    MPIU_Wtime(&t2);
+
+    /* calculate the frequency of the assembly cycle counter */
+    MPIU_Seconds_per_tick = ((double) (s2 - s1) / 1000.0) / (double) ((__int64) (t2 - t1));
+    /*
+     * printf("t2-t1 %10d\nsystime diff %d\nfrequency %g\n CPU MHz %g\n",
+     * (int)(t2-t1), (int)(s2 - s1), MPIU_Seconds_per_tick, MPIU_Seconds_per_tick * 1.0e6);
+     */
+    return 0;
+}
+#elif MPICH_TIMER_KIND == USE_QUERYPERFORMANCECOUNTER
+double MPIU_Seconds_per_tick = 0.0;     /* High performance counter frequency */
+int MPIU_Wtime_init(void)
+{
+    LARGE_INTEGER n;
+    QueryPerformanceFrequency(&n);
+    MPIU_Seconds_per_tick = 1.0 / (double) n.QuadPart;
+    return 0;
+}
+
+double MPIU_Wtick(void)
+{
+    return MPIU_Seconds_per_tick;
+}
+
+void MPIU_Wtime_todouble(MPIU_Time_t * t, double *val)
+{
+    *val = (double) t->QuadPart * MPIU_Seconds_per_tick;
+}
+
+void MPIU_Wtime_diff(MPIU_Time_t * t1, MPIU_Time_t * t2, double *diff)
+{
+    LARGE_INTEGER n;
+    n.QuadPart = t2->QuadPart - t1->QuadPart;
+    *diff = (double) n.QuadPart * MPIU_Seconds_per_tick;
+}
+
+void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
+{
+    t3->QuadPart += ((t2->QuadPart) - (t1->QuadPart));
+}
+
+
+#elif MPICH_TIMER_KIND == USE_MACH_ABSOLUTE_TIME
+static double MPIR_Wtime_mult;
+void MPIU_Init_wtick();
+int MPIU_Wtime_init(void)
+{
+    mach_timebase_info_data_t info;
+    mach_timebase_info(&info);
+    MPIR_Wtime_mult = 1.0e-9 * ((double) info.numer / (double) info.denom);
+    MPIU_Init_wtick();
+    return 0;
+}
+
+void MPIU_Wtime(MPIU_Time_t * timeval)
+{
+    *timeval = mach_absolute_time();
+}
+
+void MPIU_Wtime_diff(MPIU_Time_t * t1, MPIU_Time_t * t2, double *diff)
+{
+    *diff = (*t2 - *t1) * MPIR_Wtime_mult;
+}
+
+void MPIU_Wtime_todouble(MPIU_Time_t * t, double *val)
+{
+    *val = *t * MPIR_Wtime_mult;
+}
+
+void MPIU_Wtime_acc(MPIU_Time_t * t1, MPIU_Time_t * t2, MPIU_Time_t * t3)
+{
+    *t3 += *t2 - *t1;
+}
+
+/* FIXME: We need to cleanup the use of the MPIU_Generic_wtick prototype */
+double MPIU_Generic_wtick(void);
+
+double MPIU_Wtick(void)
+{
+    return MPIU_Generic_wtick();
+}
+
+#define MPICH_NEEDS_GENERIC_WTICK
+/* Rename the function so that we can access it */
+#define MPIU_Wtick MPIU_Generic_wtick
+
+
+#endif
+
+#ifdef MPICH_NEEDS_GENERIC_WTICK
+/*
+ * For timers that do not have defined resolutions, compute the resolution
+ * by sampling the clock itself.
+ *
+ */
+static double tickval = -1.0;
+
+void MPIU_Init_wtick(void)
+{
+    double timediff;
+    MPIU_Time_t t1, t2;
+    int cnt;
+    int icnt;
+
+    tickval = 1.0e6;
+    for (icnt = 0; icnt < 10; icnt++) {
+        cnt = 1000;
+        MPIU_Wtime(&t1);
+        do {
+            MPIU_Wtime(&t2);
+            MPIU_Wtime_diff(&t1, &t2, &timediff);
+            if (timediff > 0)
+                break;
+        }
+        while (cnt--);
+        if (cnt && timediff > 0.0 && timediff < tickval) {
+            MPIU_Wtime_diff(&t1, &t2, &tickval);
+        }
+    }
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPIU_Wtick
+#undef FCNAME
+#define FCNAME MPL_QUOTE(FUNCNAME)
+double MPIU_Wtick(void)
+{
+    return tickval;
+}
+#endif
diff --git a/src/include/mpichtimer.h.in b/src/util/timers/mpiu_timer.h.in
similarity index 68%
rename from src/include/mpichtimer.h.in
rename to src/util/timers/mpiu_timer.h.in
index fa0f8bd..d101880 100644
--- a/src/include/mpichtimer.h.in
+++ b/src/util/timers/mpiu_timer.h.in
@@ -3,11 +3,14 @@
  *  (C) 2001 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
  */
-#ifndef MPICHTIMER_H
-#define MPICHTIMER_H
+#ifndef MPIU_TIMER_H_INCLUDED
+#define MPIU_TIMER_H_INCLUDED
+
+#include "mpichconf.h"
+#include <stdlib.h>
 /*
  * This include file provide the definitions that are necessary to use the
- * timer calls, including the definition of the time stamp type and 
+ * timer calls, including the definition of the time stamp type and
  * any inlined timer calls.
  *
  * The include file timerconf.h (created by autoheader from configure.ac)
@@ -28,14 +31,14 @@
 #define USE_MACH_ABSOLUTE_TIME      11
 #define MPICH_TIMER_KIND @MPICH_TIMER_KIND@
 
-#if MPICH_TIMER_KIND == USE_GETHRTIME 
+#if MPICH_TIMER_KIND == USE_GETHRTIME
 #include <sys/time.h>
 #elif MPICH_TIMER_KIND == USE_CLOCK_GETTIME
 #include <time.h>
 #ifdef NEEDS_SYS_TIME_H
-/* Some OS'es mistakenly require sys/time.h to get the definition of 
+/* Some OS'es mistakenly require sys/time.h to get the definition of
    CLOCK_REALTIME (POSIX requires the definition to be in time.h) */
-#include <sys/time.h> 
+#include <sys/time.h>
 #endif
 #elif MPICH_TIMER_KIND == USE_GETTIMEOFDAY
 #include <sys/types.h>
@@ -54,38 +57,38 @@
 #endif
 
 /* Define a time stamp */
-typedef @MPID_TIMER_TYPE@ MPID_Time_t;
+typedef @MPICH_TIMER_TYPE@ MPIU_Time_t;
 
-/* 
+/*
  * Prototypes.  These are defined here so that inlined timer calls can
  * use them, as well as any profiling and timing code that is built into
  * MPICH
  */
 /*@
-  MPID_Wtime - Return a time stamp
-  
+  MPIU_Wtime - Return a time stamp
+
   Output Parameter:
-. timeval - A pointer to an 'MPID_Wtime_t' variable.
+. timeval - A pointer to an 'MPIU_Wtime_t' variable.
 
   Notes:
   This routine returns an `opaque` time value.  This difference between two
-  time values returned by 'MPID_Wtime' can be converted into an elapsed time
-  in seconds with the routine 'MPID_Wtime_diff'.
+  time values returned by 'MPIU_Wtime' can be converted into an elapsed time
+  in seconds with the routine 'MPIU_Wtime_diff'.
 
   This routine is defined this way to simplify its implementation as a macro.
-  For example, the for Intel x86 and gcc, 
+  For example, the for Intel x86 and gcc,
 .vb
-#define MPID_Wtime(timeval) \
+#define MPIU_Wtime(timeval) \
      __asm__ __volatile__("rdtsc" : "=A" (*timeval))
 .ve
 
   For some purposes, it is important
   that the timer calls change the timing of the code as little as possible.
   This form of a timer routine provides for a very fast timer that has
-  minimal impact on the rest of the code.  
+  minimal impact on the rest of the code.
 
   From a semantic standpoint, this format emphasizes that any particular
-  timer value has no meaning; only the difference between two values is 
+  timer value has no meaning; only the difference between two values is
   meaningful.
 
   Module:
@@ -95,79 +98,79 @@ typedef @MPID_TIMER_TYPE@ MPID_Time_t;
   MPI-2 allows 'MPI_Wtime' to be a macro.  We should make that easy; this
   version does not accomplish that.
   @*/
-void MPID_Wtime( MPID_Time_t * timeval);
+void MPIU_Wtime( MPIU_Time_t * timeval);
 
 /*@
-  MPID_Wtime_diff - Compute the difference between two time stamps
+  MPIU_Wtime_diff - Compute the difference between two time stamps
 
   Input Parameters:
-. t1, t2 - Two time values set by 'MPID_Wtime' on this process.
- 
+. t1, t2 - Two time values set by 'MPIU_Wtime' on this process.
+
 
   Output Parameter:
 . diff - The different in time between t2 and t1, measured in seconds.
 
-  Note: 
+  Note:
   If 't1' is null, then 't2' is assumed to be differences accumulated with
-  'MPID_Wtime_acc', and the output value gives the number of seconds that
+  'MPIU_Wtime_acc', and the output value gives the number of seconds that
   were accumulated.
 
   Question:
   Instead of handling a null value of 't1', should we have a separate
-  routine 'MPID_Wtime_todouble' that converts a single timestamp to a 
-  double value?  
+  routine 'MPIU_Wtime_todouble' that converts a single timestamp to a
+  double value?
 
   Module:
   Timer
   @*/
-void MPID_Wtime_diff( MPID_Time_t *t1, MPID_Time_t *t2, double *diff );
+void MPIU_Wtime_diff( MPIU_Time_t *t1, MPIU_Time_t *t2, double *diff );
 
 /*@
-  MPID_Wtime_acc - Accumulate time values
+  MPIU_Wtime_acc - Accumulate time values
 
   Input Parameters:
-. t1,t2,t3 - Three time values.  't3' is updated with the difference between 
+. t1,t2,t3 - Three time values.  't3' is updated with the difference between
              't2' and 't1': '*t3 += (t2 - t1)'.
 
   Notes:
-  This routine is used to accumulate the time spent with a block of code 
+  This routine is used to accumulate the time spent with a block of code
   without first converting the time stamps into a particular arithmetic
-  type such as a 'double'.  For example, if the 'MPID_Wtime' routine accesses
+  type such as a 'double'.  For example, if the 'MPIU_Wtime' routine accesses
   a cycle counter, this routine (or macro) can perform the accumulation using
-  integer arithmetic.  
+  integer arithmetic.
 
-  To convert a time value accumulated with this routine, use 'MPID_Wtime_diff' 
-  with a 't1' of zero.  
+  To convert a time value accumulated with this routine, use 'MPIU_Wtime_diff'
+  with a 't1' of zero.
 
   Module:
   Timer
   @*/
-void MPID_Wtime_acc( MPID_Time_t *t1, MPID_Time_t *t2, MPID_Time_t *t3 );
+void MPIU_Wtime_acc( MPIU_Time_t *t1, MPIU_Time_t *t2, MPIU_Time_t *t3 );
 
 /*@
-  MPID_Wtime_todouble - Converts an MPID timestamp to a double 
+  MPIU_Wtime_todouble - Converts an MPID timestamp to a double
 
   Input Parameter:
-. timeval - 'MPID_Time_t' time stamp
+. timeval - 'MPIU_Time_t' time stamp
 
   Output Parameter:
 . seconds - Time in seconds from an arbitrary (but fixed) time in the past
 
   Notes:
   This routine may be used to change a timestamp into a number of seconds,
-  suitable for 'MPI_Wtime'.  
+  suitable for 'MPI_Wtime'.
 
   @*/
-void MPID_Wtime_todouble( MPID_Time_t *timeval, double *seconds );
+void MPIU_Wtime_todouble( MPIU_Time_t *timeval, double *seconds );
 
 /*@
-  MPID_Wtick - Provide the resolution of the 'MPID_Wtime' timer
+  MPIU_Wtick - Provide the resolution of the 'MPIU_Wtime' timer
 
   Return value:
-  Resolution of the timer in seconds.  In many cases, this is the 
-  time between ticks of the clock that 'MPID_Wtime' returns.  In other
-  words, the minimum significant difference that can be computed by 
-  'MPID_Wtime_diff'.
+  Resolution of the timer in seconds.  In many cases, this is the
+  time between ticks of the clock that 'MPIU_Wtime' returns.  In other
+  words, the minimum significant difference that can be computed by
+  'MPIU_Wtime_diff'.
 
   Note that in some cases, the resolution may be estimated.  No application
   should expect either the same estimate in different runs or the same
@@ -176,10 +179,10 @@ void MPID_Wtime_todouble( MPID_Time_t *timeval, double *seconds );
   Module:
   Timer
   @*/
-double MPID_Wtick( void );
+double MPIU_Wtick( void );
 
 /*@
-  MPID_Wtime_init - Initialize the timer
+  MPIU_Wtime_init - Initialize the timer
 
   Note:
   This routine should perform any steps needed to initialize the timer.
@@ -187,52 +190,50 @@ double MPID_Wtick( void );
   if the timer is known to be the same for all processes in 'MPI_COMM_WORLD'
   (the value is zero by default).
 
-  If any operations need to be performed when the MPI program calls 
+  If any operations need to be performed when the MPI program calls
   'MPI_Finalize' this routine should register a handler with 'MPI_Finalize'
   (see the MPICH Design Document).
-  
+
   Return Values:
   0 on success.  -1 on Failure.  1 means that the timer may not be used
-  until after MPID_Init completes.  This allows the device to set up the
+  until after MPIU_Init completes.  This allows the device to set up the
   timer (first needed for Blue Gene support).
 
   Module:
   Timer
 
   @*/
-int MPID_Wtime_init(void);
+int MPIU_Wtime_init(void);
 
 /* Inlined timers.  Note that any definition of one of the functions
    prototyped above in terms of a macro will simply cause the compiler
    to use the macro instead of the function definition.
 
    Currently, all except the Windows performance counter timers
-   define MPID_Wtime_init as null; by default, the value of
+   define MPIU_Wtime_init as null; by default, the value of
    MPI_WTIME_IS_GLOBAL is false.
  */
 
-/* MPIDM_Wtime_todouble() is a hack to get a macro version
-   of the todouble function.  
+/* MPIUM_Wtime_todouble() is a hack to get a macro version
+   of the todouble function.
 
-   The logging library should save the native MPID_Timer_t 
-   structure to disk and use the todouble function in the 
+   The logging library should save the native MPIU_Timer_t
+   structure to disk and use the todouble function in the
    post-processsing step to convert the values to doubles.
    */
 
 /* The timer kind is set using AC_SUBST in the MPICH configure */
 #define MPICH_TIMER_KIND @MPICH_TIMER_KIND@
 
-#if MPICH_TIMER_KIND == USE_GETHRTIME 
-#define MPID_Wtime_init() 0
-#define MPIDM_Wtime_todouble MPID_Wtime_todouble
+#if MPICH_TIMER_KIND == USE_GETHRTIME
+#define MPIU_Wtime_init() 0
+#define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
 #elif MPICH_TIMER_KIND == USE_CLOCK_GETTIME
-#define MPID_Wtime_init() 0
-#define MPIDM_Wtime_todouble MPID_Wtime_todouble
+#define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
 #elif MPICH_TIMER_KIND == USE_GETTIMEOFDAY
-#define MPID_Wtime_init() 0
-#define MPIDM_Wtime_todouble MPID_Wtime_todouble
+#define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
 #elif MPICH_TIMER_KIND == USE_LINUX86_CYCLE
 /* The rdtsc instruction is not a "serializing" instruction, so the
@@ -242,54 +243,54 @@ int MPID_Wtime_init(void);
    the rdtscp instruction which is synchronizing, we use this when we
    can. */
 #ifdef LINUX86_CYCLE_RDTSCP
-#define MPID_Wtime(var_ptr) \
+#define MPIU_Wtime(var_ptr) \
     __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx ; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx")
 #elif defined(LINUX86_CYCLE_CPUID_RDTSC64)
 /* Here we have to save the rbx register for when the compiler is
    generating position independent code (e.g., when it's generating
    shared libraries) */
-#define MPID_Wtime(var_ptr)                                                                     \
+#define MPIU_Wtime(var_ptr)                                                                     \
      __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx" : "=A" (*var_ptr) : : "ecx")
 #elif defined(LINUX86_CYCLE_CPUID_RDTSC32)
 /* Here we have to save the ebx register for when the compiler is
    generating position independent code (e.g., when it's generating
    shared libraries) */
-#define MPID_Wtime(var_ptr)                                                                     \
+#define MPIU_Wtime(var_ptr)                                                                     \
      __asm__ __volatile__("push %%ebx ; cpuid ; rdtsc ; pop %%ebx" : "=A" (*var_ptr) : : "ecx")
 #elif defined(LINUX86_CYCLE_RDTSC)
 /* The configure test using cpuid must have failed, try just rdtsc by itself */
-#define MPID_Wtime(var_ptr) __asm__ __volatile__("rdtsc" : "=A" (*var_ptr))
+#define MPIU_Wtime(var_ptr) __asm__ __volatile__("rdtsc" : "=A" (*var_ptr))
 #else
 #error Dont know which Linux timer to use
 #endif
 
-extern double MPID_Seconds_per_tick;
-#define MPIDM_Wtime_todouble(t, d) *d = (double)*t * MPID_Seconds_per_tick
+extern double MPIU_Seconds_per_tick;
+#define MPIUM_Wtime_todouble(t, d) *d = (double)*t * MPIU_Seconds_per_tick
 
 #elif MPICH_TIMER_KIND == USE_GCC_IA64_CYCLE
 #ifdef __INTEL_COMPILER
 #include "ia64regs.h"
-#define MPID_Wtime(var_ptr) { MPID_Time_t t_val;\
+#define MPIU_Wtime(var_ptr) { MPIU_Time_t t_val;\
 	t_val=__getReg(_IA64_REG_AR_ITC); *var_ptr=t_val;}
 #else
-#define MPID_Wtime(var_ptr) { MPID_Time_t t_val;\
+#define MPIU_Wtime(var_ptr) { MPIU_Time_t t_val;\
 	__asm__ __volatile__("mov %0=ar.itc" : "=r" (t_val)); *var_ptr=t_val;}
 #endif
-extern double MPID_Seconds_per_tick;
-#define MPIDM_Wtime_todouble(t, d) *d = (double)*t * MPID_Seconds_per_tick
+extern double MPIU_Seconds_per_tick;
+#define MPIUM_Wtime_todouble(t, d) *d = (double)*t * MPIU_Seconds_per_tick
 
 #elif MPICH_TIMER_KIND == USE_LINUXALPHA_CYCLE
-#define MPID_Wtime_init() 0
-#define MPIDM_Wtime_todouble MPID_Wtime_todouble
+#define MPIU_Wtime_init() 0
+#define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
 #elif MPICH_TIMER_KIND == USE_QUERYPERFORMANCECOUNTER
-#define MPID_Wtime(var) QueryPerformanceCounter(var)
-extern double MPID_Seconds_per_tick;
-#define MPIDM_Wtime_todouble( t, d ) \
-  *d = (double)t->QuadPart * MPID_Seconds_per_tick /* convert to seconds */
+#define MPIU_Wtime(var) QueryPerformanceCounter(var)
+extern double MPIU_Seconds_per_tick;
+#define MPIUM_Wtime_todouble( t, d ) \
+  *d = (double)t->QuadPart * MPIU_Seconds_per_tick /* convert to seconds */
 
 #elif MPICH_TIMER_KIND == USE_WIN86_CYCLE
-#define MPID_Wtime(var_ptr) \
+#define MPIU_Wtime(var_ptr) \
 { \
     register int *f1 = (int*)var_ptr; \
     __asm cpuid \
@@ -298,12 +299,12 @@ extern double MPID_Seconds_per_tick;
     __asm mov [ecx], eax \
     __asm mov [ecx + TYPE int], edx \
 }
-extern double MPID_Seconds_per_tick;
-#define MPIDM_Wtime_todouble(t, d) *d = (double)(__int64)*t * MPID_Seconds_per_tick
-#define MPIDM_Wtime_diff(t1,t2,diff) *diff = (double)((__int64)( *t2 - *t1 )) * MPID_Seconds_per_tick
+extern double MPIU_Seconds_per_tick;
+#define MPIUM_Wtime_todouble(t, d) *d = (double)(__int64)*t * MPIU_Seconds_per_tick
+#define MPIUM_Wtime_diff(t1,t2,diff) *diff = (double)((__int64)( *t2 - *t1 )) * MPIU_Seconds_per_tick
 
 #elif MPICH_TIMER_KIND == USE_MACH_ABSOLUTE_TIME
-#define MPIDM_Wtime_todouble MPID_Wtime_todouble
+#define MPIUM_Wtime_todouble MPIU_Wtime_todouble
 
 #endif
 
diff --git a/src/util/type/mpiu_type_defs.h b/src/util/type/mpiu_type_defs.h
index c6990db..6126855 100644
--- a/src/util/type/mpiu_type_defs.h
+++ b/src/util/type/mpiu_type_defs.h
@@ -42,14 +42,7 @@
 #ifndef BOOL
 #define BOOL int
 #endif
-#ifndef TRUE
-#define TRUE 1
 #endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-#endif
-
 /* Use this macro for each parameter to a function that is not referenced in
    the body of the function */
 #ifdef HAVE_WINDOWS_H
diff --git a/src/util/wrappers/mpiu_shm_wrappers.h b/src/util/wrappers/mpiu_shm_wrappers.h
index 2579938..ea055e4 100644
--- a/src/util/wrappers/mpiu_shm_wrappers.h
+++ b/src/util/wrappers/mpiu_shm_wrappers.h
@@ -268,7 +268,7 @@ static inline int MPIU_SHMW_Hnd_deserialize_by_ref(MPIU_SHMW_Hnd_t hnd, char **s
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Hnd_serialize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Hnd_serialize(char *str, 
     MPIU_SHMW_Hnd_t hnd, int str_len)
 {
@@ -280,7 +280,7 @@ static inline int MPIU_SHMW_Hnd_serialize(char *str,
     MPIU_Assert(str_len >= MPIU_SHMW_GHND_SZ);
 
     rc = MPIU_SHMW_Ghnd_get_by_val(hnd, str, str_len);
-    MPIU_ERR_CHKANDJUMP(rc != 0, mpi_errno, MPI_ERR_OTHER, "**shmw_gethnd");
+    MPIR_ERR_CHKANDJUMP(rc != 0, mpi_errno, MPI_ERR_OTHER, "**shmw_gethnd");
 
 fn_exit:
     return mpi_errno;
@@ -299,7 +299,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Hnd_deserialize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Hnd_deserialize(
     MPIU_SHMW_Hnd_t hnd, const char *str_hnd, size_t str_hnd_len)
 {
@@ -307,21 +307,21 @@ static inline int MPIU_SHMW_Hnd_deserialize(
     int rc = -1;
 
     MPIU_Assert(MPIU_SHMW_Hnd_is_init(hnd));
-    MPIU_ERR_CHKINTERNAL(!str_hnd, mpi_errno, "ser hnd is null");
-    MPIU_ERR_CHKANDJUMP(str_hnd_len>=MPIU_SHMW_GHND_SZ,
+    MPIR_ERR_CHKINTERNAL(!str_hnd, mpi_errno, "ser hnd is null");
+    MPIR_ERR_CHKANDJUMP(str_hnd_len>=MPIU_SHMW_GHND_SZ,
         mpi_errno, MPI_ERR_OTHER, "**shmw_deserbufbig");
 
     MPIU_SHMW_Hnd_reset_val(hnd);
 
     rc = MPIU_SHMW_Ghnd_alloc(hnd);
-    MPIU_ERR_CHKANDJUMP1((rc != 0), mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP1((rc != 0), mpi_errno, MPI_ERR_OTHER,
         "**nomem", "**nomem %s", "shared mem global handle");
 
     rc = MPIU_SHMW_Ghnd_set_by_val(hnd, "%s", str_hnd);
     MPIU_Assert(rc == 0);
 
     mpi_errno = MPIU_SHMW_Seg_open(hnd, 0);
-    if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
     
 fn_exit:
     return mpi_errno;
@@ -342,7 +342,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Hnd_get_serialized_by_ref
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Hnd_get_serialized_by_ref(
     MPIU_SHMW_Hnd_t hnd, char **str_ptr)
 {
@@ -369,7 +369,7 @@ static inline int MPIU_SHMW_Hnd_get_serialized_by_ref(
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Hnd_deserialize_by_ref
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Hnd_deserialize_by_ref(
     MPIU_SHMW_Hnd_t hnd, char **ser_hnd_ptr)
 {
@@ -378,13 +378,13 @@ static inline int MPIU_SHMW_Hnd_deserialize_by_ref(
     MPIU_Assert(MPIU_SHMW_Hnd_is_init(hnd));
     MPIU_Assert(ser_hnd_ptr);
 
-    MPIU_ERR_CHKINTERNAL(!(*ser_hnd_ptr), mpi_errno, "ser hnd is null");
+    MPIR_ERR_CHKINTERNAL(!(*ser_hnd_ptr), mpi_errno, "ser hnd is null");
 
     MPIU_SHMW_Hnd_reset_val(hnd);
     MPIU_SHMW_Ghnd_set_by_ref(hnd, *ser_hnd_ptr);
 
     mpi_errno = MPIU_SHMW_Seg_open(hnd, 0);
-    if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
 fn_exit:
     return mpi_errno;
@@ -399,7 +399,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Hnd_init
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Hnd_init(
                     MPIU_SHMW_Hnd_t *hnd_ptr)
 {
@@ -409,7 +409,7 @@ static inline int MPIU_SHMW_Hnd_init(
     MPIU_Assert(hnd_ptr);
 
     rc = MPIU_SHMW_Hnd_alloc(hnd_ptr);
-    MPIU_ERR_CHKANDJUMP1((rc != 0), mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP1((rc != 0), mpi_errno, MPI_ERR_OTHER,
         "**nomem", "**nomem %s", "shared mem handle");
 
     MPIU_SHMW_Hnd_reset_val(*hnd_ptr);
@@ -427,7 +427,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Hnd_finalize
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Hnd_finalize(
                     MPIU_SHMW_Hnd_t *hnd_ptr)
 {
@@ -455,7 +455,7 @@ static inline int MPIU_SHMW_Hnd_finalize(
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Seg_create_attach_templ
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Seg_create_attach_templ(
     MPIU_SHMW_Hnd_t hnd, MPIU_Size_t seg_sz, char **shm_addr_ptr,
     int offset, int flag)
@@ -467,7 +467,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
     if(flag & MPIU_SHMW_FLAG_SHM_CREATE){
         lhnd = shmget(IPC_PRIVATE, seg_sz, IPC_CREAT | S_IRWXU);
         /* Return error if SHM seg already exists or create fails */
-        MPIU_ERR_CHKANDJUMP2((lhnd == -1) ||
+        MPIR_ERR_CHKANDJUMP2((lhnd == -1) ||
             (MPIU_OSW_Get_errno() == MPIU_SHMW_SEG_ALREADY_EXISTS),
             mpi_errno, MPI_ERR_OTHER, "**alloc_shar_mem",
             "**alloc_shar_mem %s %s", "shmget",
@@ -476,7 +476,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
         MPIU_SHMW_Lhnd_set(hnd, lhnd);
 
         rc = MPIU_SHMW_Ghnd_alloc(hnd);
-        MPIU_ERR_CHKANDJUMP1((rc != 0), mpi_errno, MPI_ERR_OTHER,
+        MPIR_ERR_CHKANDJUMP1((rc != 0), mpi_errno, MPI_ERR_OTHER,
             "**nomem", "**nomem %s", "shared mem global handle");
 
         rc = MPIU_SHMW_Ghnd_set_by_val(hnd, "%d", lhnd);
@@ -488,7 +488,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
 
         if(!MPIU_SHMW_Lhnd_is_valid(hnd)){
             lhnd = atoi(MPIU_SHMW_Ghnd_get_by_ref(hnd));
-            MPIU_ERR_CHKANDJUMP((lhnd == -1), mpi_errno,
+            MPIR_ERR_CHKANDJUMP((lhnd == -1), mpi_errno,
                 MPI_ERR_OTHER, "**shmw_badhnd");
 
             MPIU_SHMW_Lhnd_set(hnd, lhnd);
@@ -501,7 +501,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
 
         *shm_addr_ptr = shmat(MPIU_SHMW_Lhnd_get(hnd), NULL, 0x0);
 
-        MPIU_ERR_CHKANDJUMP2((*shm_addr_ptr == (void*)(-1)), mpi_errno, MPI_ERR_OTHER,
+        MPIR_ERR_CHKANDJUMP2((*shm_addr_ptr == (void*)(-1)), mpi_errno, MPI_ERR_OTHER,
             "**attach_shar_mem", "**attach_shar_mem %s %s",
             "shmat", MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
     }
@@ -520,20 +520,20 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Seg_detach
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Seg_detach(
     MPIU_SHMW_Hnd_t hnd, char **shm_addr_ptr, MPIU_Size_t seg_sz)
 {
     int mpi_errno = MPI_SUCCESS;
     int rc = -1;
 
-    MPIU_ERR_CHKANDJUMP(!MPIU_SHMW_Hnd_is_valid(hnd),
+    MPIR_ERR_CHKANDJUMP(!MPIU_SHMW_Hnd_is_valid(hnd),
         mpi_errno, MPI_ERR_OTHER, "**shmw_badhnd");
     MPIU_Assert(shm_addr_ptr);
-    MPIU_ERR_CHKINTERNAL(!(*shm_addr_ptr), mpi_errno, "shm address is null");
+    MPIR_ERR_CHKINTERNAL(!(*shm_addr_ptr), mpi_errno, "shm address is null");
 
     rc = shmdt(*shm_addr_ptr);
-    MPIU_ERR_CHKANDJUMP2((rc != 0), mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP2((rc != 0), mpi_errno, MPI_ERR_OTHER,
         "**detach_shar_mem","**detach_shar_mem %s %s",
         "shmdt", MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
     *shm_addr_ptr = NULL;
@@ -551,18 +551,18 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Seg_remove
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int  MPIU_SHMW_Seg_remove(MPIU_SHMW_Hnd_t hnd)
 {
     int mpi_errno = MPI_SUCCESS;
     struct shmid_ds ds;
     int rc = -1;
 
-    MPIU_ERR_CHKANDJUMP(!MPIU_SHMW_Hnd_is_valid(hnd),
+    MPIR_ERR_CHKANDJUMP(!MPIU_SHMW_Hnd_is_valid(hnd),
         mpi_errno, MPI_ERR_OTHER, "**shmw_badhnd");
 
     rc = shmctl(MPIU_SHMW_Lhnd_get(hnd), IPC_RMID, &ds);
-    MPIU_ERR_CHKANDJUMP2((rc != 0), mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP2((rc != 0), mpi_errno, MPI_ERR_OTHER,
         "**remove_shar_mem", "**remove_shar_mem %s %s","shmctl",
         MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
 
@@ -586,7 +586,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Seg_create_attach_templ
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Seg_create_attach_templ(
     MPIU_SHMW_Hnd_t hnd, MPIU_Size_t seg_sz, char **shm_addr_ptr,
     int offset, int flag)
@@ -605,22 +605,22 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
             chosen_fname = tmp_fname;
             lhnd = mkstemp(chosen_fname);
         }
-        MPIU_ERR_CHKANDJUMP1((lhnd == -1), mpi_errno, 
+        MPIR_ERR_CHKANDJUMP1((lhnd == -1), mpi_errno, 
             MPI_ERR_OTHER,"**mkstemp","**mkstemp %s",
             MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
 
         MPIU_SHMW_Lhnd_set(hnd, lhnd);
         rc = (MPIU_SHMW_Lhnd_t)lseek(lhnd, seg_sz - 1, SEEK_SET);
-        MPIU_ERR_CHKANDJUMP1((rc == -1), mpi_errno,
+        MPIR_ERR_CHKANDJUMP1((rc == -1), mpi_errno,
             MPI_ERR_OTHER, "**lseek", "**lseek %s",
             MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
 
         MPIU_OSW_RETRYON_INTR((rc == -1), (rc = (int)write(lhnd, "", 1)));
-        MPIU_ERR_CHKANDJUMP((rc == -1), mpi_errno, MPI_ERR_OTHER,
+        MPIR_ERR_CHKANDJUMP((rc == -1), mpi_errno, MPI_ERR_OTHER,
             "**write");
 
         rc = MPIU_SHMW_Ghnd_alloc(hnd);
-        MPIU_ERR_CHKANDJUMP1((rc != 0),mpi_errno, MPI_ERR_OTHER,
+        MPIR_ERR_CHKANDJUMP1((rc != 0),mpi_errno, MPI_ERR_OTHER,
             "**nomem", "**nomem %s", "shared memory global handle");
 
         rc = MPIU_SHMW_Ghnd_set_by_val(hnd, "%s", chosen_fname);
@@ -632,7 +632,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
 
         if(!MPIU_SHMW_Lhnd_is_valid(hnd)){
             lhnd = open(MPIU_SHMW_Ghnd_get_by_ref(hnd), O_RDWR);
-            MPIU_ERR_CHKANDJUMP1((lhnd == -1), mpi_errno,
+            MPIR_ERR_CHKANDJUMP1((lhnd == -1), mpi_errno,
                 MPI_ERR_OTHER, "**open", "**open %s",
                 MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
 
@@ -647,7 +647,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
 
         buf_ptr = mmap(NULL, seg_sz, PROT_READ | PROT_WRITE,
                         MAP_SHARED, MPIU_SHMW_Lhnd_get(hnd), 0);
-        MPIU_ERR_CHKANDJUMP2((buf_ptr == MAP_FAILED),
+        MPIR_ERR_CHKANDJUMP2((buf_ptr == MAP_FAILED),
             mpi_errno, MPI_ERR_OTHER, "**alloc_shar_mem",
             "**alloc_shar_mem %s %s", "mmap",
             MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
@@ -670,7 +670,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Seg_detach
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Seg_detach(
     MPIU_SHMW_Hnd_t hnd, char **shm_addr_ptr, MPIU_Size_t seg_sz)
 {
@@ -678,10 +678,10 @@ static inline int MPIU_SHMW_Seg_detach(
     int rc = -1;
 
     MPIU_Assert(shm_addr_ptr);
-    MPIU_ERR_CHKINTERNAL(!(*shm_addr_ptr), mpi_errno, "shm address is null");
+    MPIR_ERR_CHKINTERNAL(!(*shm_addr_ptr), mpi_errno, "shm address is null");
 
     rc = munmap(*shm_addr_ptr, seg_sz);
-    MPIU_ERR_CHKANDJUMP2((rc != 0), mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP2((rc != 0), mpi_errno, MPI_ERR_OTHER,
         "**detach_shar_mem", "**detach_shar_mem %s %s","munmap", 
         MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
     *shm_addr_ptr = NULL;
@@ -698,11 +698,11 @@ static inline int  MPIU_SHMW_Seg_remove(MPIU_SHMW_Hnd_t hnd)
     int mpi_errno = MPI_SUCCESS;
     int rc = -1;
 
-    MPIU_ERR_CHKANDJUMP(!MPIU_SHMW_Ghnd_is_valid(hnd),
+    MPIR_ERR_CHKANDJUMP(!MPIU_SHMW_Ghnd_is_valid(hnd),
         mpi_errno, MPI_ERR_OTHER, "**shmw_badhnd");
 
     rc = unlink(MPIU_SHMW_Ghnd_get_by_ref(hnd));
-    MPIU_ERR_CHKANDJUMP2((rc != 0), mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP2((rc != 0), mpi_errno, MPI_ERR_OTHER,
         "**remove_shar_mem", "**remove_shar_mem %s %s","unlink", 
         MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
 
@@ -720,7 +720,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Seg_create_attach_templ
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Seg_create_attach_templ(
     MPIU_SHMW_Hnd_t hnd, MPIU_Size_t seg_sz, char **shm_addr_ptr,
     int offset, int flag)
@@ -735,7 +735,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
         MPIU_Assert(flag & MPIU_SHMW_FLAG_SHM_CREATE);
 
         rc = MPIU_SHMW_Ghnd_set_uniq(hnd);
-        MPIU_ERR_CHKANDJUMP((rc == 0), mpi_errno, MPI_ERR_OTHER,
+        MPIR_ERR_CHKANDJUMP((rc == 0), mpi_errno, MPI_ERR_OTHER,
             "**shmw_sethnd");
     }
 
@@ -744,7 +744,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
                 PAGE_READWRITE, seg_sz_large.HighPart, seg_sz_large.LowPart,
                 MPIU_SHMW_Ghnd_get_by_ref(hnd));
         /* Return error if SHM seg already exists or create fails */
-        MPIU_ERR_CHKANDJUMP2((lhnd == INVALID_HANDLE_VALUE) ||
+        MPIR_ERR_CHKANDJUMP2((lhnd == INVALID_HANDLE_VALUE) ||
             (MPIU_OSW_Get_errno() == MPIU_SHMW_SEG_ALREADY_EXISTS),
             mpi_errno, MPI_ERR_OTHER, "**alloc_shar_mem",
             "**alloc_shar_mem %s %s", "CreateFileMapping",
@@ -759,7 +759,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
             /* Strangely OpenFileMapping() returns NULL on error! */
             lhnd = OpenFileMapping(FILE_MAP_WRITE, FALSE, 
                     MPIU_SHMW_Ghnd_get_by_ref(hnd));
-            MPIU_ERR_CHKANDJUMP2((lhnd == NULL), mpi_errno,
+            MPIR_ERR_CHKANDJUMP2((lhnd == NULL), mpi_errno,
                 MPI_ERR_OTHER, "**alloc_shar_mem", 
                 "**alloc_shar_mem %s %s", "OpenFileMapping",
                 MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
@@ -773,7 +773,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
 
         *shm_addr_ptr = (char *)MapViewOfFile(MPIU_SHMW_Lhnd_get(hnd),
                             FILE_MAP_WRITE, 0, offset, 0);
-        MPIU_ERR_CHKANDJUMP2(!(*shm_addr_ptr), mpi_errno, MPI_ERR_OTHER,
+        MPIR_ERR_CHKANDJUMP2(!(*shm_addr_ptr), mpi_errno, MPI_ERR_OTHER,
             "**attach_shar_mem", "**attach_shar_mem %s %s",
             "MapViewOfFile", MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
     }
@@ -788,7 +788,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Seg_detach
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Seg_detach(
     MPIU_SHMW_Hnd_t hnd, char **shm_addr_ptr, MPIU_Size_t seg_sz)
 {
@@ -796,13 +796,13 @@ static inline int MPIU_SHMW_Seg_detach(
     int rc = -1;
 
     MPIU_UNREFERENCED_ARG(seg_sz);
-    MPIU_ERR_CHKANDJUMP(!MPIU_SHMW_Hnd_is_valid(hnd),
+    MPIR_ERR_CHKANDJUMP(!MPIU_SHMW_Hnd_is_valid(hnd),
         mpi_errno, MPI_ERR_OTHER, "**shmw_badhnd");
     MPIU_Assert(shm_addr_ptr);
-    MPIU_ERR_CHKINTERNAL(!(*shm_addr_ptr), mpi_errno, "shm address is null");
+    MPIR_ERR_CHKINTERNAL(!(*shm_addr_ptr), mpi_errno, "shm address is null");
 
     rc = UnmapViewOfFile(*shm_addr_ptr);
-    MPIU_ERR_CHKANDJUMP2((rc == 0), mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP2((rc == 0), mpi_errno, MPI_ERR_OTHER,
         "**detach_shar_mem", "**detach_shar_mem %s %s","UnmapViewOfFile", 
         MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
     *shm_addr_ptr = NULL;
@@ -825,7 +825,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Seg_create
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Seg_create(
     MPIU_SHMW_Hnd_t hnd, MPIU_Size_t seg_sz)
 {
@@ -836,7 +836,7 @@ static inline int MPIU_SHMW_Seg_create(
 
     mpi_errno = MPIU_SHMW_Seg_create_attach_templ(hnd,
                     seg_sz, NULL, 0, MPIU_SHMW_FLAG_SHM_CREATE);
-    if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
 fn_exit:
     return mpi_errno;
@@ -852,7 +852,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Seg_open
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Seg_open(
     MPIU_SHMW_Hnd_t hnd, MPIU_Size_t seg_sz)
 {
@@ -862,7 +862,7 @@ static inline int MPIU_SHMW_Seg_open(
 
     mpi_errno = MPIU_SHMW_Seg_create_attach_templ(hnd, seg_sz,
             NULL, 0, MPIU_SHMW_FLAG_CLR);
-    if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
 fn_exit:
     return mpi_errno;
@@ -880,7 +880,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Seg_create_and_attach
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Seg_create_and_attach(
     MPIU_SHMW_Hnd_t hnd, MPIU_Size_t seg_sz, char **shm_addr_ptr, 
     int offset)
@@ -894,7 +894,7 @@ static inline int MPIU_SHMW_Seg_create_and_attach(
     mpi_errno = MPIU_SHMW_Seg_create_attach_templ(hnd, seg_sz,
                     shm_addr_ptr, offset, MPIU_SHMW_FLAG_SHM_CREATE |
                     MPIU_SHMW_FLAG_SHM_ATTACH);
-    if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
 fn_exit:
     return mpi_errno;
@@ -912,7 +912,7 @@ fn_fail:
 #undef FUNCNAME
 #define FUNCNAME MPIU_SHMW_Seg_attach
 #undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
+#define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SHMW_Seg_attach(
     MPIU_SHMW_Hnd_t hnd, MPIU_Size_t seg_sz, char **shm_addr_ptr,
     int offset)
@@ -924,7 +924,7 @@ static inline int MPIU_SHMW_Seg_attach(
 
     mpi_errno = MPIU_SHMW_Seg_create_attach_templ(hnd, seg_sz,
                 shm_addr_ptr, offset, MPIU_SHMW_FLAG_SHM_ATTACH);
-    if(mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if(mpi_errno != MPI_SUCCESS) { MPIR_ERR_POP(mpi_errno); }
 
 fn_exit:
     return mpi_errno;
diff --git a/src/util/wrappers/mpiu_sock_wrappers.h b/src/util/wrappers/mpiu_sock_wrappers.h
index bbb5bf5..f8ce7fe 100644
--- a/src/util/wrappers/mpiu_sock_wrappers.h
+++ b/src/util/wrappers/mpiu_sock_wrappers.h
@@ -49,7 +49,7 @@
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Inet_addr
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Inet_addr(ipv4_dd_str, inaddr) (              \
         ((*(inaddr) = inet_addr(ipv4_dd_str))                       \
             != INADDR_NONE)                                         \
@@ -64,7 +64,7 @@
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_init
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Init(void )
 {
     WSADATA wsaData;
@@ -89,7 +89,7 @@ static inline int MPIU_SOCKW_Init(void )
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Finalize
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Finalize()    (                               \
         (WSACleanup() == 0)                                         \
         ? MPI_SUCCESS                                               \
@@ -103,7 +103,7 @@ static inline int MPIU_SOCKW_Init(void )
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Sock_open
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Sock_open(domain, type, protocol, sock_ptr) ( \
         ((*sock_ptr = WSASocket(domain, type, protocol, NULL, 0,    \
             WSA_FLAG_OVERLAPPED)) != INVALID_SOCKET)                \
@@ -118,7 +118,7 @@ static inline int MPIU_SOCKW_Init(void )
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Sock_close
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Sock_close(sock)    (                         \
         (closesocket(sock) != SOCKET_ERROR)                         \
         ? MPI_SUCCESS                                               \
@@ -132,7 +132,7 @@ static inline int MPIU_SOCKW_Init(void )
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Bind
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Bind(sock, addr, addr_len) (                  \
         (bind(sock, (struct sockaddr *)addr, addr_len)              \
             != SOCKET_ERROR)                                        \
@@ -148,7 +148,7 @@ static inline int MPIU_SOCKW_Init(void )
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Bind_port_range
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Bind_port_range(
     MPIU_SOCKW_Sockfd_t sock, struct sockaddr_in *sin, 
     unsigned short int low_port, unsigned short int high_port)
@@ -169,12 +169,12 @@ static inline int MPIU_SOCKW_Bind_port_range(
         else{
             int err;
             err = MPIU_OSW_Get_errno();
-            MPIU_ERR_CHKANDJUMP2( ((err != WSAEADDRINUSE) &&
+            MPIR_ERR_CHKANDJUMP2( ((err != WSAEADDRINUSE) &&
                 (err != WSAEADDRNOTAVAIL)), mpi_errno, MPI_ERR_OTHER,
                 "**bind", "**bind %s %d", MPIU_OSW_Strerror(err), err);
         }
     }
-    MPIU_ERR_CHKANDJUMP2(!done, mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP2(!done, mpi_errno, MPI_ERR_OTHER,
         "**bindportrange", "**bindportrange %d %d", low_port, high_port);
 
 fn_exit:
@@ -186,7 +186,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Listen
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Listen(sock, backlog)  (                      \
         (listen(sock, backlog) != SOCKET_ERROR)                     \
         ? MPI_SUCCESS                                               \
@@ -200,7 +200,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Accept
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Accept(sock, addr, addr_len,                  \
         new_sock_ptr)(                                              \
         ((*new_sock_ptr = accept(sock, addr, addr_len))             \
@@ -221,7 +221,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Accept_ex
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Accept_ex(MPIU_SOCKW_Sockfd_t sock,
     void *addr, int addr_len, MPIU_SOCKW_Sockfd_t *new_sock_ptr,
     MPIU_EXOVERLAPPED *ov, int *nb_ptr)
@@ -235,7 +235,7 @@ static inline int MPIU_SOCKW_Accept_ex(MPIU_SOCKW_Sockfd_t sock,
     if( !AcceptEx(sock, *new_sock_ptr, addr, 0, addr_len/2, addr_len/2,
         (LPDWORD )nb_ptr, &(ov->ov)) ){
         err = MPIU_OSW_Get_errno();
-		MPIU_ERR_CHKANDJUMP2((err != ERROR_IO_PENDING), mpi_errno,
+		MPIR_ERR_CHKANDJUMP2((err != ERROR_IO_PENDING), mpi_errno,
 			MPI_ERR_OTHER, "**sock_accept", "**sock_accept %s %d",
 			MPIU_OSW_Strerror(err), err);
     }
@@ -249,7 +249,7 @@ static inline int MPIU_SOCKW_Accept_ex(MPIU_SOCKW_Sockfd_t sock,
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Connect
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Connect(
     MPIU_SOCKW_Sockfd_t sockfd, struct sockaddr *addr, 
     int addr_len, int *is_pending)
@@ -260,7 +260,7 @@ static inline int MPIU_SOCKW_Connect(
         int err;
         err = MPIU_OSW_Get_errno();
 
-        MPIU_ERR_CHKANDJUMP2((err != WSAEWOULDBLOCK), mpi_errno,
+        MPIR_ERR_CHKANDJUMP2((err != WSAEWOULDBLOCK), mpi_errno,
             MPI_ERR_OTHER, "**sock_connect", "**sock_connect %s %d",
             MPIU_OSW_Strerror(err), err);
 
@@ -277,7 +277,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Connect_ex
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Connect_ex(
     MPIU_SOCKW_Sockfd_t sockfd, struct sockaddr_in *addr, 
     int addr_len, MPIU_EXOVERLAPPED *ov)
@@ -304,13 +304,13 @@ static inline int MPIU_SOCKW_Connect_ex(
 
     if(err == SOCKET_ERROR){
         err = MPIU_OSW_Get_errno();
-        MPIU_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_OTHER, "**fail",
+        MPIR_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_OTHER, "**fail",
             "**fail %s %d", MPIU_OSW_Strerror(err), err);
     }
 
     if(!pfn_ConnectEx(sockfd, (struct sockaddr *)addr, addr_len, NULL, 0, (LPDWORD )&nb, &(ov->ov))){
         err = MPIU_OSW_Get_errno();
-		MPIU_ERR_CHKANDJUMP2((err != ERROR_IO_PENDING), mpi_errno,
+		MPIR_ERR_CHKANDJUMP2((err != ERROR_IO_PENDING), mpi_errno,
 			MPI_ERR_OTHER, "**sock_connect", "**sock_connect %s %d",
 			MPIU_OSW_Strerror(err), err);
     }
@@ -324,7 +324,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Read
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Read(sock, buf, buf_len, nb_rd_ptr)(          \
         ((*nb_rd_ptr = recv(sock, buf, buf_len, 0x0))               \
             != SOCKET_ERROR)                                        \
@@ -344,7 +344,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Readv
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Readv(MPIU_SOCKW_Sockfd_t sock,
     MPL_IOV *iov, int iov_cnt, int *nb_rd_ptr)
 {
@@ -356,7 +356,7 @@ static inline int MPIU_SOCKW_Readv(MPIU_SOCKW_Sockfd_t sock,
     if(WSARecv(sock, iov, iov_cnt, (LPDWORD )nb_rd_ptr, &flags, NULL, NULL)
         == SOCKET_ERROR){
         err = MPIU_OSW_Get_errno();
-        MPIU_ERR_CHKANDJUMP2(!( (err == WSAEWOULDBLOCK) ||
+        MPIR_ERR_CHKANDJUMP2(!( (err == WSAEWOULDBLOCK) ||
             (err == WSA_IO_PENDING) || (err == WSAEINTR) ),
             mpi_errno, MPI_ERR_OTHER, "**sock_read",
             "**sock_read %s %d", MPIU_OSW_Strerror(err), err);
@@ -374,7 +374,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Readv_ex
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Readv_ex(MPIU_SOCKW_Sockfd_t sock,
     MPL_IOV *iov, int iov_cnt, int *nb_rd_ptr, MPIU_EXOVERLAPPED *ov)
 {
@@ -386,7 +386,7 @@ static inline int MPIU_SOCKW_Readv_ex(MPIU_SOCKW_Sockfd_t sock,
     if(WSARecv(sock, iov, iov_cnt, (LPDWORD )nb_rd_ptr, &flags, MPIU_EX_GET_OVERLAPPED_PTR(ov), NULL)
         == SOCKET_ERROR){
         err = MPIU_OSW_Get_errno();
-        MPIU_ERR_CHKANDJUMP2(!( (err == WSAEWOULDBLOCK) ||
+        MPIR_ERR_CHKANDJUMP2(!( (err == WSAEWOULDBLOCK) ||
             (err == WSA_IO_PENDING) || (err == WSAEINTR) ), mpi_errno,
             MPI_ERR_OTHER, "**sock_read", "**sock_read %s %d",
             MPIU_OSW_Strerror(err), err);
@@ -407,7 +407,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Write
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Write(sock, buf, buf_len, nb_wr_ptr)(         \
         ((*nb_wr_ptr = send(sock, buf, buf_len, 0x0))               \
             != SOCKET_ERROR)                                        \
@@ -428,7 +428,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Writev
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Writev(sock, iov, iov_cnt, nb_wr_ptr)(        \
         (WSASend(sock, iov, iov_cnt, nb_wr_ptr, 0x0, NULL, NULL)    \
             != SOCKET_ERROR)                                        \
@@ -449,7 +449,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Writev_ex
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Writev_ex(MPIU_SOCKW_Sockfd_t sock,
     MPL_IOV *iov, int iov_cnt, int *nb_wr_ptr, MPIU_EXOVERLAPPED *ov)
 {
@@ -460,7 +460,7 @@ static inline int MPIU_SOCKW_Writev_ex(MPIU_SOCKW_Sockfd_t sock,
     if(WSASend(sock, iov, iov_cnt, (LPDWORD )nb_wr_ptr, 0x0, MPIU_EX_GET_OVERLAPPED_PTR(ov), NULL)
         == SOCKET_ERROR){
         err = MPIU_OSW_Get_errno();
-        MPIU_ERR_CHKANDJUMP2(!( (err == WSAEWOULDBLOCK) ||
+        MPIR_ERR_CHKANDJUMP2(!( (err == WSAEWOULDBLOCK) ||
             (err == WSA_IO_PENDING) || (err == WSAEINTR) ), mpi_errno,
             MPI_ERR_OTHER, "**sock_write", "**sock_write %s %d",
             MPIU_OSW_Strerror(err), err);
@@ -480,7 +480,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Sock_cntrl_nb
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Sock_cntrl_nb(sock, is_nb)(                   \
         (ioctlsocket(sock, FIONBIO, (u_long *)&is_nb)               \
             != SOCKET_ERROR)                                        \
@@ -495,7 +495,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Sock_setopt
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Sock_setopt(sock, level, opt_name,opt_val_ptr,\
         opt_len) (                                                  \
         (setsockopt(sock, level, opt_name,                          \
@@ -512,7 +512,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Sock_getopt
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Sock_getopt(sock, level, opt_name,opt_val_ptr,\
         opt_len_ptr) (                                              \
         (getsockopt(sock, level, opt_name, opt_val_ptr, opt_len_ptr)\
@@ -528,7 +528,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Sock_has_error
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Sock_has_error(MPIU_SOCKW_Sockfd_t sock)
 {
     int has_error = 0;
@@ -631,7 +631,7 @@ typedef MPIU_SOCKW_Timeval_t_ *MPIU_SOCKW_Timeval_hnd_t;
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Timeval_hnd_init
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Timeval_hnd_init(
     MPIU_SOCKW_Timeval_hnd_t *hnd_ptr)
 {
@@ -641,7 +641,7 @@ static inline int MPIU_SOCKW_Timeval_hnd_init(
 
     *hnd_ptr = (MPIU_SOCKW_Timeval_hnd_t)
                 MPIU_Malloc(sizeof(MPIU_SOCKW_Timeval_t_));
-    MPIU_ERR_CHKANDJUMP1( !(*hnd_ptr), mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP1( !(*hnd_ptr), mpi_errno, MPI_ERR_OTHER,
         "**nomem", "**nomem %s", "handle to timeval");
 
 fn_exit:
@@ -656,7 +656,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Timeval_hnd_set
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Timeval_hnd_set(
     MPIU_SOCKW_Timeval_hnd_t hnd, int tv_msec)
 {
@@ -673,7 +673,7 @@ static inline int MPIU_SOCKW_Timeval_hnd_set(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Timeval_hnd_finalize
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Timeval_hnd_finalize(
     MPIU_SOCKW_Timeval_hnd_t *hnd_ptr)
 {
@@ -707,7 +707,7 @@ static inline int MPIU_SOCKW_Timeval_hnd_finalize(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_hnd_init
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_hnd_init(
             MPIU_SOCKW_Waitset_hnd_t *hnd_ptr, int nfds)
 {
@@ -723,7 +723,7 @@ static inline int MPIU_SOCKW_Waitset_hnd_init(
     *hnd_ptr = (MPIU_SOCKW_Waitset_hnd_t) MPIU_Malloc(
             sizeof(MPIU_SOCKW_Waitset_));
 
-    MPIU_ERR_CHKANDJUMP1(!(*hnd_ptr), mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP1(!(*hnd_ptr), mpi_errno, MPI_ERR_OTHER,
         "**nomem", "**nomem %s", "handle to waitset");
 
     (*hnd_ptr)->nevents = 0;
@@ -741,7 +741,7 @@ static inline int MPIU_SOCKW_Waitset_hnd_init(
     (*hnd_ptr)->fdset = (MPIU_SOCKW_Waitset_sock_hnd_ *)
         MPIU_Malloc(FD_SETSIZE * sizeof(MPIU_SOCKW_Waitset_sock_hnd_));
 
-    MPIU_ERR_CHKANDJUMP1(!((*hnd_ptr)->fdset), mpi_errno, MPI_ERR_OTHER,
+    MPIR_ERR_CHKANDJUMP1(!((*hnd_ptr)->fdset), mpi_errno, MPI_ERR_OTHER,
         "**nomem", "**nomem %s", "fdset array in waitSet");
 
 fn_exit:
@@ -753,7 +753,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_hnd_finalize
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_hnd_finalize(
             MPIU_SOCKW_Waitset_hnd_t *hnd_ptr)
 {
@@ -773,7 +773,7 @@ static inline int MPIU_SOCKW_Waitset_hnd_finalize(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_has_more_evnts
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Waitset_has_more_evnts(waitset_hnd) (           \
         waitset_hnd->nevents                                         \
     )
@@ -781,7 +781,7 @@ static inline int MPIU_SOCKW_Waitset_hnd_finalize(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_wait
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_wait(
     MPIU_SOCKW_Waitset_hnd_t hnd, MPIU_SOCKW_Timeval_hnd_t timeout)
 {
@@ -808,7 +808,7 @@ static inline int MPIU_SOCKW_Waitset_wait(
     hnd->nevents = select(nfds,&(hnd->tmp_read_fds),
                             &(hnd->tmp_write_fds),
                             &(hnd->tmp_except_fds), timeout); 
-    MPIU_ERR_CHKANDJUMP2((hnd->nevents == SOCKET_ERROR), mpi_errno,
+    MPIR_ERR_CHKANDJUMP2((hnd->nevents == SOCKET_ERROR), mpi_errno,
         MPI_ERR_OTHER, "**select", "**select %s %d",
         MPIU_OSW_Strerror(MPIU_OSW_Get_errno()),MPIU_OSW_Get_errno());
 
@@ -821,7 +821,7 @@ fn_fail:
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_get_sock_evnts
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_get_sock_evnts_(
     MPIU_SOCKW_Waitset_hnd_t waitset_hnd, MPIU_SOCKW_Sockfd_t sock,
     int *flag_ptr)
@@ -863,7 +863,7 @@ static inline int MPIU_SOCKW_Waitset_get_sock_evnts_(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_get_nxt_sock_with_evnt
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_get_nxt_sock_with_evnt(
     MPIU_SOCKW_Waitset_hnd_t waitset_hnd,
     MPIU_SOCKW_Waitset_sock_hnd_t *sock_hnd_ptr)
@@ -896,7 +896,7 @@ static inline int MPIU_SOCKW_Waitset_get_nxt_sock_with_evnt(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_add_sock
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_add_sock(
     MPIU_SOCKW_Waitset_hnd_t waitset_hnd, MPIU_SOCKW_Sockfd_t sock,
     int flag, void *user_ptr, MPIU_SOCKW_Waitset_sock_hnd_t *sock_hnd_ptr)
@@ -944,7 +944,7 @@ static inline int MPIU_SOCKW_Waitset_add_sock(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_set_sock
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_set_sock(
     MPIU_SOCKW_Waitset_hnd_t waitset_hnd,
     MPIU_SOCKW_Waitset_sock_hnd_t sock_hnd, int flag)
@@ -978,7 +978,7 @@ static inline int MPIU_SOCKW_Waitset_set_sock(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_clr_sock
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_clr_sock(
     MPIU_SOCKW_Waitset_hnd_t waitset_hnd,
     MPIU_SOCKW_Waitset_sock_hnd_t sock_hnd, int flag)
@@ -1013,7 +1013,7 @@ static inline int MPIU_SOCKW_Waitset_clr_sock(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_rem_sock
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_rem_sock(
     MPIU_SOCKW_Waitset_hnd_t waitset_hnd,
     MPIU_SOCKW_Waitset_sock_hnd_t *sock_hnd_ptr)
@@ -1050,7 +1050,7 @@ static inline int MPIU_SOCKW_Waitset_rem_sock(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_sock_hnd_get_sockfd
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_sock_hnd_get_sockfd(
     MPIU_SOCKW_Waitset_sock_hnd_t sock_hnd,
     MPIU_SOCKW_Sockfd_t *sockfd_ptr)
@@ -1068,7 +1068,7 @@ static inline int MPIU_SOCKW_Waitset_sock_hnd_get_sockfd(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_sock_hnd_get_user_ptr
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_sock_hnd_get_user_ptr(
     MPIU_SOCKW_Waitset_sock_hnd_t sock_hnd, void **userp_ptr)
 {
@@ -1085,7 +1085,7 @@ static inline int MPIU_SOCKW_Waitset_sock_hnd_get_user_ptr(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_sock_hnd_set_user_ptr
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 static inline int MPIU_SOCKW_Waitset_sock_hnd_set_user_ptr(
     MPIU_SOCKW_Waitset_sock_hnd_t sock_hnd, void *user_ptr)
 {
@@ -1101,7 +1101,7 @@ static inline int MPIU_SOCKW_Waitset_sock_hnd_set_user_ptr(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_is_sock_readable
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Waitset_is_sock_readable(sock_hnd)(              \
         (MPIU_SOCKW_Waitset_sock_hnd_is_init_(sock_hnd))                \
         ? (sock_hnd->event_flag & MPIU_SOCKW_FLAG_SOCK_IS_READABLE_) \
@@ -1111,7 +1111,7 @@ static inline int MPIU_SOCKW_Waitset_sock_hnd_set_user_ptr(
 #   undef FUNCNAME
 #   define FUNCNAME MPIU_SOCKW_Waitset_is_sock_writeable
 #   undef FCNAME
-#   define FCNAME MPIU_QUOTE(FUNCNAME)
+#   define FCNAME MPL_QUOTE(FUNCNAME)
 #   define MPIU_SOCKW_Waitset_is_sock_writeable(sock_hnd)(             \
         (MPIU_SOCKW_Waitset_sock_hnd_is_init_(sock_hnd))                \
         ? (sock_hnd->event_flag & MPIU_SOCKW_FLAG_SOCK_IS_WRITEABLE_)\

http://git.mpich.org/mpich.git/commitdiff/395038058b875d202f765f19fada7a0f61662ee7

commit 395038058b875d202f765f19fada7a0f61662ee7
Author: Charles J Archer <charles.j.archer at intel.com>
Date:   Wed May 13 09:14:37 2015 -0700

    Generalize GPID structure for devices
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 575e847..6a3fa60 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -1257,6 +1257,14 @@ typedef struct MPID_Comm {
 } MPID_Comm;
 extern MPIU_Object_alloc_t MPID_Comm_mem;
 
+typedef struct MPID_Gpid {
+#ifdef MPID_DEV_GPID_DECL
+    MPID_DEV_GPID_DECL
+#else
+    int dummy;   /* don't create an empty structure */
+#endif
+}MPID_Gpid;
+
 /* this function should not be called by normal code! */
 int MPIR_Comm_delete_internal(MPID_Comm * comm_ptr);
 
diff --git a/src/mpi/comm/intercomm_create.c b/src/mpi/comm/intercomm_create.c
index 24faf6c..28180d9 100644
--- a/src/mpi/comm/intercomm_create.c
+++ b/src/mpi/comm/intercomm_create.c
@@ -125,8 +125,9 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
 {
     int mpi_errno = MPI_SUCCESS;
     MPIU_Context_id_t final_context_id, recvcontext_id;
-    int remote_size, *remote_lpids=0, *remote_gpids=0, singlePG;
-    int local_size, *local_gpids=0, *local_lpids=0;
+    int remote_size, *remote_lpids=0, singlePG;
+    int local_size,*local_lpids=0;
+    MPID_Gpid *local_gpids=NULL, *remote_gpids=NULL;
     int comm_info[3];
     int is_low_group = 0;
     int cts_tag;
@@ -176,22 +177,23 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
                                        remote_size ));
         /* With this information, we can now send and receive the
            global process ids from the peer. */
-        MPIU_CHKLMEM_MALLOC(remote_gpids,int*,2*remote_size*sizeof(int), mpi_errno,"remote_gpids");
+        MPIU_CHKLMEM_MALLOC(remote_gpids,MPID_Gpid*,remote_size*sizeof(MPID_Gpid), mpi_errno,"remote_gpids");
         MPIU_CHKLMEM_MALLOC(remote_lpids,int*,remote_size*sizeof(int), mpi_errno,"remote_lpids");
-        MPIU_CHKLMEM_MALLOC(local_gpids,int*,2*local_size*sizeof(int), mpi_errno,"local_gpids");
+        MPIU_CHKLMEM_MALLOC(local_gpids,MPID_Gpid*,local_size*sizeof(MPID_Gpid), mpi_errno,"local_gpids");
         MPIU_CHKLMEM_MALLOC(local_lpids,int*,local_size*sizeof(int), mpi_errno,"local_lpids");
 
         mpi_errno = MPID_GPID_GetAllInComm( local_comm_ptr, local_size, local_gpids, &singlePG );
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
 
         /* Exchange the lpid arrays */
-        mpi_errno = MPIC_Sendrecv( local_gpids, 2*local_size, MPI_INT,
+        mpi_errno = MPIC_Sendrecv( local_gpids, local_size*sizeof(MPID_Gpid), MPI_BYTE,
                                       remote_leader, cts_tag,
-                                      remote_gpids, 2*remote_size, MPI_INT,
+                                      remote_gpids, remote_size*sizeof(MPID_Gpid), MPI_BYTE,
                                       remote_leader, cts_tag, peer_comm_ptr,
                                       MPI_STATUS_IGNORE, &errflag );
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
 
+
         /* Convert the remote gpids to the lpids */
         mpi_errno = MPID_GPID_ToLpidArray( remote_size, remote_gpids, remote_lpids );
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
@@ -260,7 +262,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
         mpi_errno = MPIR_Bcast_impl( comm_info, 3, MPI_INT, local_leader, local_comm_ptr, &errflag );
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
         MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
-        mpi_errno = MPIR_Bcast_impl( remote_gpids, 2*remote_size, MPI_INT, local_leader,
+        mpi_errno = MPIR_Bcast_impl( remote_gpids, remote_size*sizeof(MPID_Gpid), MPI_BYTE, local_leader,
                                      local_comm_ptr, &errflag );
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
         MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
@@ -275,9 +277,9 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
         MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
         remote_size = comm_info[0];
-        MPIU_CHKLMEM_MALLOC(remote_gpids,int*,2*remote_size*sizeof(int), mpi_errno,"remote_gpids");
+        MPIU_CHKLMEM_MALLOC(remote_gpids,MPID_Gpid*,remote_size*sizeof(MPID_Gpid), mpi_errno,"remote_gpids");
         MPIU_CHKLMEM_MALLOC(remote_lpids,int*,remote_size*sizeof(int), mpi_errno,"remote_lpids");
-        mpi_errno = MPIR_Bcast_impl( remote_gpids, 2*remote_size, MPI_INT, local_leader,
+        mpi_errno = MPIR_Bcast_impl( remote_gpids, remote_size*sizeof(MPID_Gpid), MPI_BYTE, local_leader,
                                      local_comm_ptr, &errflag );
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
         MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
@@ -300,7 +302,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
     */
 #ifdef MPID_ICCREATE_REMOTECOMM_HOOK
     MPID_ICCREATE_REMOTECOMM_HOOK( peer_comm_ptr, local_comm_ptr,
-                                   remote_size, remote_gpids, local_leader );
+                                   remote_size, (const MPID_Gpid*)remote_gpids, local_leader );
 
 #endif
 
diff --git a/src/mpi/comm/intercomm_merge.c b/src/mpi/comm/intercomm_merge.c
index 2e5d234..798dda3 100644
--- a/src/mpi/comm/intercomm_merge.c
+++ b/src/mpi/comm/intercomm_merge.c
@@ -101,31 +101,31 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
            we use the gpids of the rank 0 member of the local and remote
            groups to choose an order in this case. */
         if (local_high == remote_high) {
-            int ingpid[2], outgpid[2];
+            MPID_Gpid ingpid, outgpid;
             
-            mpi_errno = MPID_GPID_Get( comm_ptr, 0, ingpid );
+            mpi_errno = MPID_GPID_Get( comm_ptr, 0, &ingpid );
             if (mpi_errno) MPIU_ERR_POP(mpi_errno);
             
-            mpi_errno = MPIC_Sendrecv( ingpid, 2, MPI_INT, 0, 1,
-                                          outgpid, 2, MPI_INT, 0, 1, comm_ptr,
+            mpi_errno = MPIC_Sendrecv( &ingpid, sizeof(MPID_Gpid), MPI_BYTE, 0, 1,
+                                          &outgpid, sizeof(MPID_Gpid), MPI_BYTE, 0, 1, comm_ptr,
                                           MPI_STATUS_IGNORE, &errflag );
             if (mpi_errno) MPIU_ERR_POP(mpi_errno);
 
             /* Note that the gpids cannot be the same because we are
                starting from a valid intercomm */
-            if (ingpid[0] < outgpid[0] ||
-                (ingpid[0] == outgpid[0] && ingpid[1] < outgpid[1])) {
-                local_high = 0;
-            }
-            else {
+            int rc = memcmp(&ingpid,&outgpid,sizeof(MPID_Gpid));
+            if(rc < 0)
                 local_high = 1;
-
-                /* req#3930: The merge algorithm will deadlock if the gpids are inadvertently the
-                   same due to implementation bugs in the MPID_GPID_Get() function */
-                MPIU_Assert( !(ingpid[0] == outgpid[0] && ingpid[1] == outgpid[1]) );
+            else if(rc > 0)
+                local_high = 0;
+            else
+                {
+                    /* req#3930: The merge algorithm will deadlock if the gpids are inadvertently the
+                       same due to implementation bugs in the MPID_GPID_Get() function */
+                    MPIU_Assert(rc != 0);
+                }
             }
         }
-    }
 
     /*
        All processes in the local group now need to get the
diff --git a/src/mpid/ch3/include/mpidpost.h b/src/mpid/ch3/include/mpidpost.h
index d4ce7f9..01fd8c0 100644
--- a/src/mpid/ch3/include/mpidpost.h
+++ b/src/mpid/ch3/include/mpidpost.h
@@ -174,13 +174,13 @@ int MPIDI_CH3_Comm_connect(char * port_name, int root, MPID_Comm * comm_ptr,
 
 /* Dynamic process support */
 int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size, 
-			    int local_gpids[], int *singlePG );
-int MPID_GPID_Get( MPID_Comm *comm_ptr, int rank, int gpid[] );
-int MPID_GPID_ToLpidArray( int size, int gpid[], int lpid[] );
+			    MPID_Gpid local_gpids[], int *singlePG );
+int MPID_GPID_Get( MPID_Comm *comm_ptr, int rank, MPID_Gpid *gpid );
+int MPID_GPID_ToLpidArray( int size, MPID_Gpid gpid[], int lpid[] );
 int MPID_Create_intercomm_from_lpids( MPID_Comm *newcomm_ptr,
 			    int size, const int lpids[] );
 int MPID_PG_ForwardPGInfo( MPID_Comm *peer_ptr, MPID_Comm *comm_ptr, 
-			   int nPGids, const int gpids[], 
+			   int nPGids, const MPID_Gpid gpids[],
 			   int root );
 /* PG_ForwardPGInfo is used as the implementation of the intercomm-create
    hook that is needed with dynamic processes because of limitations
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 1c6d5c5..7c01021 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -494,6 +494,8 @@ MPID_REQUEST_DECL
 #endif
 #endif
 
+#define MPID_DEV_GPID_DECL int gpid[2];
+
 /* Tell initthread to prepare a private comm_world */
 #define MPID_NEEDS_ICOMM_WORLD
 
diff --git a/src/mpid/ch3/src/mpid_vc.c b/src/mpid/ch3/src/mpid_vc.c
index 83ef54b..3f889c3 100644
--- a/src/mpid/ch3/src/mpid_vc.c
+++ b/src/mpid/ch3/src/mpid_vc.c
@@ -328,11 +328,11 @@ int MPID_Comm_get_lpid(MPID_Comm *comm_ptr, int idx, int * lpid_ptr, MPIU_BOOL i
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)
 int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size, 
-			    int local_gpids[], int *singlePG )
+			    MPID_Gpid local_gpids[], int *singlePG )
 {
     int mpi_errno = MPI_SUCCESS;
     int i;
-    int *gpid = local_gpids;
+    int *gpid = (int*)&local_gpids[0];
     int lastPGID = -1, pgid;
     MPIDI_VCR vc;
     MPIDI_STATE_DECL(MPID_STATE_MPID_GPID_GETALLINCOMM);
@@ -369,11 +369,11 @@ int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
 #define FUNCNAME MPID_GPID_Get
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_GPID_Get( MPID_Comm *comm_ptr, int rank, int gpid[] )
+int MPID_GPID_Get( MPID_Comm *comm_ptr, int rank, MPID_Gpid *in_gpid )
 {
     int      pgid;
     MPIDI_VCR vc;
-    
+    int*     gpid = (int*)in_gpid;
     vc = comm_ptr->dev.vcrt->vcr_table[rank];
 
     /* Get the process group id as an int */
@@ -394,12 +394,13 @@ int MPID_GPID_Get( MPID_Comm *comm_ptr, int rank, int gpid[] )
 #define FUNCNAME MPID_GPID_ToLpidArray
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_GPID_ToLpidArray( int size, int gpid[], int lpid[] )
+int MPID_GPID_ToLpidArray( int size, MPID_Gpid in_gpid[], int lpid[] )
 {
     int i, mpi_errno = MPI_SUCCESS;
     int pgid;
     MPIDI_PG_t *pg = 0;
     MPIDI_PG_iterator iter;
+    int *gpid = (int*)&in_gpid[0];
 
     for (i=0; i<size; i++) {
         MPIDI_PG_Get_iterator(&iter);
@@ -545,7 +546,7 @@ fn_fail:
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)
 int MPID_PG_ForwardPGInfo( MPID_Comm *peer_ptr, MPID_Comm *comm_ptr, 
-			   int nPGids, const int gpids[], 
+			   int nPGids, const MPID_Gpid in_gpids[],
 			   int root )
 {
     int mpi_errno = MPI_SUCCESS;
@@ -554,6 +555,8 @@ int MPID_PG_ForwardPGInfo( MPID_Comm *peer_ptr, MPID_Comm *comm_ptr,
     MPIDI_PG_iterator iter;
     MPIR_Errflag_t errflag = MPIR_ERR_NONE;
     
+    const int *gpids = (const int*)&in_gpids[0];
+
     /* Get the pgid for CommWorld (always attached to the first process 
        group) */
     MPIDI_PG_Get_iterator(&iter);

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

commit da5d528c230eb2f1ef8897e4070a9fd47f68d849
Author: Charles J Archer <charles.j.archer at intel.com>
Date:   Tue Jul 28 16:40:02 2015 -0700

    Fix ut array compile problem
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/src/include/mpiu_utarray.h b/src/include/mpiu_utarray.h
index 97e2719..d5bb238 100644
--- a/src/include/mpiu_utarray.h
+++ b/src/include/mpiu_utarray.h
@@ -235,7 +235,7 @@ typedef struct {
 /* last we pre-define a few icd for common utarrays of ints and strings */
 static void utarray_str_cpy(void *dst, const void *src) {
   char **_src = (char**)src, **_dst = (char**)dst;
-  *_dst = (*_src == NULL) ? NULL : utarray_strdup_(*_src);
+  *_dst = (*_src == NULL) ? NULL : (char*)utarray_strdup_(*_src);
 }
 static void utarray_str_dtor(void *elt) {
   char **eltc = (char**)elt;

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

Summary of changes:
 .gitignore                                         |    7 +-
 configure.ac                                       |   69 +-
 maint/Makefile.mk                                  |    1 -
 maint/extractcvars.in                              |    8 +-
 maint/extracterrmsgs                               |  104 +-
 maint/getcoverage.in                               |   10 +-
 maint/mpich-replace.sh                             |    3 +
 maint/template.c                                   |  131 ---
 src/binding/fortran/mpif_h/buildiface              |   41 +-
 src/binding/fortran/use_mpi/create_f90_complex.c   |    8 +-
 src/binding/fortran/use_mpi/create_f90_int.c       |    4 +-
 src/binding/fortran/use_mpi/create_f90_real.c      |    8 +-
 src/binding/fortran/use_mpi/create_f90_util.c      |    8 +-
 .../use_mpi_f08/wrappers_c/comm_spawn_multiple_c.c |    8 +-
 src/binding/fortran/use_mpi_f08/wrappers_c/utils.c |    4 +-
 src/glue/romio/glue_romio.c                        |   22 +-
 src/include/Makefile.mk                            |    5 +-
 src/include/glue_romio.h.in                        |    6 +-
 src/include/mpichconfconst.h                       |   16 +-
 src/include/mpichtimer.h.in                        |  310 ------
 src/include/mpierrs.h                              |  351 ++++----
 src/include/mpihandlemem.h                         |   35 -
 src/include/mpiimpl.h                              |   21 +-
 src/include/mpiimplthread.h                        | 1044 --------------------
 src/include/mpiimplthreadpost.h                    |  200 ----
 src/include/mpimem.h                               |   16 +-
 src/include/mpir_nbc.h                             |    6 +-
 src/include/mpishared.h                            |    5 -
 src/include/mpitimpl.h                             |   10 +-
 src/include/mpiu_utarray.h                         |    2 +-
 src/include/mpiutil.h                              |  348 +-------
 src/include/rlog.h                                 |    6 -
 src/include/rlog_macros.h                          |    2 +-
 src/mpi/attr/attr_delete.c                         |    4 +-
 src/mpi/attr/attr_get.c                            |    6 +-
 src/mpi/attr/attr_put.c                            |    4 +-
 src/mpi/attr/attrutil.c                            |   22 +-
 src/mpi/attr/comm_create_keyval.c                  |   10 +-
 src/mpi/attr/comm_delete_attr.c                    |    8 +-
 src/mpi/attr/comm_free_keyval.c                    |    8 +-
 src/mpi/attr/comm_get_attr.c                       |   12 +-
 src/mpi/attr/comm_set_attr.c                       |   18 +-
 src/mpi/attr/keyval_create.c                       |    4 +-
 src/mpi/attr/keyval_free.c                         |    4 +-
 src/mpi/attr/type_create_keyval.c                  |    6 +-
 src/mpi/attr/type_delete_attr.c                    |    4 +-
 src/mpi/attr/type_free_keyval.c                    |    4 +-
 src/mpi/attr/type_get_attr.c                       |    8 +-
 src/mpi/attr/type_set_attr.c                       |    8 +-
 src/mpi/attr/win_create_keyval.c                   |    6 +-
 src/mpi/attr/win_delete_attr.c                     |    4 +-
 src/mpi/attr/win_free_keyval.c                     |    4 +-
 src/mpi/attr/win_get_attr.c                        |   12 +-
 src/mpi/attr/win_set_attr.c                        |   10 +-
 src/mpi/coll/allgather.c                           |  102 +-
 src/mpi/coll/allgatherv.c                          |  120 ++--
 src/mpi/coll/allred_group.c                        |   50 +-
 src/mpi/coll/allreduce.c                           |  104 +-
 src/mpi/coll/alltoall.c                            |   78 +-
 src/mpi/coll/alltoallv.c                           |   62 +-
 src/mpi/coll/alltoallw.c                           |   56 +-
 src/mpi/coll/barrier.c                             |   76 +-
 src/mpi/coll/bcast.c                               |  160 ++--
 src/mpi/coll/exscan.c                              |   34 +-
 src/mpi/coll/gather.c                              |  118 ++--
 src/mpi/coll/gatherv.c                             |   36 +-
 src/mpi/coll/helper_fns.c                          |   86 +-
 src/mpi/coll/iallgather.c                          |   88 +-
 src/mpi/coll/iallgatherv.c                         |   88 +-
 src/mpi/coll/iallreduce.c                          |  114 ++--
 src/mpi/coll/ialltoall.c                           |   84 +-
 src/mpi/coll/ialltoallv.c                          |   48 +-
 src/mpi/coll/ialltoallw.c                          |   40 +-
 src/mpi/coll/ibarrier.c                            |   42 +-
 src/mpi/coll/ibcast.c                              |   90 +-
 src/mpi/coll/iexscan.c                             |   40 +-
 src/mpi/coll/igather.c                             |  102 +-
 src/mpi/coll/igatherv.c                            |   30 +-
 src/mpi/coll/ired_scat.c                           |  134 ++--
 src/mpi/coll/ired_scat_block.c                     |  136 ++--
 src/mpi/coll/ireduce.c                             |  112 ++--
 src/mpi/coll/iscan.c                               |   60 +-
 src/mpi/coll/iscatter.c                            |   86 +-
 src/mpi/coll/iscatterv.c                           |   30 +-
 src/mpi/coll/nbcutil.c                             |    2 +-
 src/mpi/coll/op_commutative.c                      |    8 +-
 src/mpi/coll/op_create.c                           |    4 +-
 src/mpi/coll/op_free.c                             |    4 +-
 src/mpi/coll/opband.c                              |    4 +-
 src/mpi/coll/opbor.c                               |    4 +-
 src/mpi/coll/opbxor.c                              |    4 +-
 src/mpi/coll/opland.c                              |    4 +-
 src/mpi/coll/oplor.c                               |    4 +-
 src/mpi/coll/oplxor.c                              |    4 +-
 src/mpi/coll/opmax.c                               |    4 +-
 src/mpi/coll/opmaxloc.c                            |    8 +-
 src/mpi/coll/opmin.c                               |    4 +-
 src/mpi/coll/opminloc.c                            |    8 +-
 src/mpi/coll/opno_op.c                             |    4 +-
 src/mpi/coll/opprod.c                              |    4 +-
 src/mpi/coll/opreplace.c                           |    6 +-
 src/mpi/coll/opsum.c                               |    4 +-
 src/mpi/coll/red_scat.c                            |  130 ++--
 src/mpi/coll/red_scat_block.c                      |  126 ++--
 src/mpi/coll/reduce.c                              |  128 ++--
 src/mpi/coll/reduce_local.c                        |    8 +-
 src/mpi/coll/scan.c                                |   74 +-
 src/mpi/coll/scatter.c                             |   94 +-
 src/mpi/coll/scatterv.c                            |   32 +-
 src/mpi/comm/comm_agree.c                          |   20 +-
 src/mpi/comm/comm_compare.c                        |   34 +-
 src/mpi/comm/comm_create.c                         |   62 +-
 src/mpi/comm/comm_create_group.c                   |   20 +-
 src/mpi/comm/comm_dup.c                            |   14 +-
 src/mpi/comm/comm_dup_with_info.c                  |   12 +-
 src/mpi/comm/comm_failure_ack.c                    |    6 +-
 src/mpi/comm/comm_failure_get_acked.c              |    6 +-
 src/mpi/comm/comm_free.c                           |    8 +-
 src/mpi/comm/comm_get_info.c                       |    8 +-
 src/mpi/comm/comm_group.c                          |   12 +-
 src/mpi/comm/comm_idup.c                           |   18 +-
 src/mpi/comm/comm_rank.c                           |    6 +-
 src/mpi/comm/comm_remote_group.c                   |   14 +-
 src/mpi/comm/comm_revoke.c                         |    8 +-
 src/mpi/comm/comm_set_info.c                       |   10 +-
 src/mpi/comm/comm_set_name.c                       |    4 +-
 src/mpi/comm/comm_shrink.c                         |   12 +-
 src/mpi/comm/comm_size.c                           |    2 +-
 src/mpi/comm/comm_split.c                          |   36 +-
 src/mpi/comm/comm_split_type.c                     |   12 +-
 src/mpi/comm/commutil.c                            |   83 +-
 src/mpi/comm/contextid.c                           |  112 ++-
 src/mpi/comm/intercomm_create.c                    |   82 +-
 src/mpi/comm/intercomm_merge.c                     |   70 +-
 src/mpi/datatype/address.c                         |    4 +-
 src/mpi/datatype/get_address.c                     |    4 +-
 src/mpi/datatype/get_count.c                       |    4 +-
 src/mpi/datatype/get_elements.c                    |    4 +-
 src/mpi/datatype/get_elements_x.c                  |   10 +-
 src/mpi/datatype/pack.c                            |   18 +-
 src/mpi/datatype/pack_external.c                   |    2 +-
 src/mpi/datatype/pack_size.c                       |    4 +-
 src/mpi/datatype/register_datarep.c                |    4 +-
 src/mpi/datatype/status_set_elements.c             |    2 +-
 src/mpi/datatype/status_set_elements_x.c           |   10 +-
 src/mpi/datatype/type_commit.c                     |   12 +-
 src/mpi/datatype/type_contiguous.c                 |   12 +-
 src/mpi/datatype/type_create_darray.c              |    8 +-
 src/mpi/datatype/type_create_hindexed.c            |    4 +-
 src/mpi/datatype/type_create_hindexed_block.c      |   12 +-
 src/mpi/datatype/type_create_hvector.c             |    4 +-
 src/mpi/datatype/type_create_indexed_block.c       |   12 +-
 src/mpi/datatype/type_create_resized.c             |    4 +-
 src/mpi/datatype/type_create_struct.c              |   12 +-
 src/mpi/datatype/type_create_subarray.c            |   22 +-
 src/mpi/datatype/type_dup.c                        |    6 +-
 src/mpi/datatype/type_extent.c                     |    2 +-
 src/mpi/datatype/type_free.c                       |    8 +-
 src/mpi/datatype/type_get_contents.c               |    4 +-
 src/mpi/datatype/type_get_envelope.c               |    4 +-
 src/mpi/datatype/type_get_extent.c                 |    4 +-
 src/mpi/datatype/type_get_extent_x.c               |    8 +-
 src/mpi/datatype/type_get_name.c                   |   19 +-
 src/mpi/datatype/type_get_true_extent.c            |    4 +-
 src/mpi/datatype/type_get_true_extent_x.c          |    8 +-
 src/mpi/datatype/type_hindexed.c                   |    4 +-
 src/mpi/datatype/type_hvector.c                    |   12 +-
 src/mpi/datatype/type_indexed.c                    |   12 +-
 src/mpi/datatype/type_lb.c                         |    2 +-
 src/mpi/datatype/type_match_size.c                 |   10 +-
 src/mpi/datatype/type_set_name.c                   |    2 +-
 src/mpi/datatype/type_size.c                       |    4 +-
 src/mpi/datatype/type_size_x.c                     |   10 +-
 src/mpi/datatype/type_struct.c                     |   12 +-
 src/mpi/datatype/type_vector.c                     |   12 +-
 src/mpi/datatype/typeutil.c                        |   10 +-
 src/mpi/datatype/unpack.c                          |    8 +-
 src/mpi/datatype/unpack_external.c                 |    4 +-
 src/mpi/debugger/dbginit.c                         |   18 +-
 src/mpi/errhan/add_error_class.c                   |    6 +-
 src/mpi/errhan/add_error_code.c                    |    6 +-
 src/mpi/errhan/add_error_string.c                  |    4 +-
 src/mpi/errhan/comm_call_errhandler.c              |    4 +-
 src/mpi/errhan/comm_create_errhandler.c            |   10 +-
 src/mpi/errhan/comm_get_errhandler.c               |   12 +-
 src/mpi/errhan/comm_set_errhandler.c               |   12 +-
 src/mpi/errhan/errhandler_create.c                 |    4 +-
 src/mpi/errhan/errhandler_free.c                   |    4 +-
 src/mpi/errhan/errhandler_get.c                    |    6 +-
 src/mpi/errhan/errhandler_set.c                    |    6 +-
 src/mpi/errhan/errutil.c                           |   40 +-
 src/mpi/errhan/file_call_errhandler.c              |    2 +-
 src/mpi/errhan/file_create_errhandler.c            |    6 +-
 src/mpi/errhan/file_get_errhandler.c               |    4 +-
 src/mpi/errhan/file_set_errhandler.c               |    2 +-
 src/mpi/errhan/win_call_errhandler.c               |    4 +-
 src/mpi/errhan/win_create_errhandler.c             |    6 +-
 src/mpi/errhan/win_get_errhandler.c                |    8 +-
 src/mpi/errhan/win_set_errhandler.c                |    4 +-
 src/mpi/group/group_compare.c                      |    8 +-
 src/mpi/group/group_difference.c                   |    8 +-
 src/mpi/group/group_excl.c                         |   10 +-
 src/mpi/group/group_free.c                         |   10 +-
 src/mpi/group/group_incl.c                         |    8 +-
 src/mpi/group/group_intersection.c                 |   10 +-
 src/mpi/group/group_range_excl.c                   |    8 +-
 src/mpi/group/group_range_incl.c                   |    8 +-
 src/mpi/group/group_translate_ranks.c              |   10 +-
 src/mpi/group/group_union.c                        |   10 +-
 src/mpi/group/grouputil.c                          |    9 +-
 src/mpi/info/info_create.c                         |    6 +-
 src/mpi/info/info_delete.c                         |   12 +-
 src/mpi/info/info_dup.c                            |   12 +-
 src/mpi/info/info_free.c                           |    4 +-
 src/mpi/info/info_get.c                            |   16 +-
 src/mpi/info/info_getn.c                           |    8 +-
 src/mpi/info/info_getnth.c                         |   12 +-
 src/mpi/info/info_getvallen.c                      |   14 +-
 src/mpi/info/info_set.c                            |   18 +-
 src/mpi/info/infoutil.c                            |    6 +-
 src/mpi/init/abort.c                               |    4 +-
 src/mpi/init/async.c                               |   22 +-
 src/mpi/init/finalize.c                            |   17 +-
 src/mpi/init/initthread.c                          |  112 +--
 src/mpi/misc/library_version.c                     |    2 +-
 src/mpi/pt2pt/bsend.c                              |    4 +-
 src/mpi/pt2pt/bsend_init.c                         |    4 +-
 src/mpi/pt2pt/bsendutil.c                          |   26 +-
 src/mpi/pt2pt/bufattach.c                          |    4 +-
 src/mpi/pt2pt/buffree.c                            |    4 +-
 src/mpi/pt2pt/cancel.c                             |   26 +-
 src/mpi/pt2pt/greq_complete.c                      |    8 +-
 src/mpi/pt2pt/greq_start.c                         |   14 +-
 src/mpi/pt2pt/ibsend.c                             |   18 +-
 src/mpi/pt2pt/improbe.c                            |    8 +-
 src/mpi/pt2pt/imrecv.c                             |   12 +-
 src/mpi/pt2pt/iprobe.c                             |    4 +-
 src/mpi/pt2pt/irecv.c                              |    4 +-
 src/mpi/pt2pt/irsend.c                             |    4 +-
 src/mpi/pt2pt/isend.c                              |    6 +-
 src/mpi/pt2pt/issend.c                             |    4 +-
 src/mpi/pt2pt/mpir_request.c                       |   54 +-
 src/mpi/pt2pt/mprobe.c                             |    8 +-
 src/mpi/pt2pt/mrecv.c                              |   12 +-
 src/mpi/pt2pt/probe.c                              |    4 +-
 src/mpi/pt2pt/recv.c                               |    6 +-
 src/mpi/pt2pt/recv_init.c                          |    4 +-
 src/mpi/pt2pt/request_free.c                       |    4 +-
 src/mpi/pt2pt/request_get_status.c                 |    4 +-
 src/mpi/pt2pt/rsend.c                              |    4 +-
 src/mpi/pt2pt/rsend_init.c                         |    4 +-
 src/mpi/pt2pt/send.c                               |    4 +-
 src/mpi/pt2pt/send_init.c                          |    4 +-
 src/mpi/pt2pt/sendrecv.c                           |    6 +-
 src/mpi/pt2pt/sendrecv_rep.c                       |    4 +-
 src/mpi/pt2pt/ssend.c                              |    6 +-
 src/mpi/pt2pt/ssend_init.c                         |    4 +-
 src/mpi/pt2pt/start.c                              |    4 +-
 src/mpi/pt2pt/startall.c                           |    4 +-
 src/mpi/pt2pt/test.c                               |   14 +-
 src/mpi/pt2pt/test_cancelled.c                     |    2 +-
 src/mpi/pt2pt/testall.c                            |   10 +-
 src/mpi/pt2pt/testany.c                            |    6 +-
 src/mpi/pt2pt/testsome.c                           |    6 +-
 src/mpi/pt2pt/wait.c                               |   16 +-
 src/mpi/pt2pt/waitall.c                            |   28 +-
 src/mpi/pt2pt/waitany.c                            |    6 +-
 src/mpi/pt2pt/waitsome.c                           |    6 +-
 src/mpi/rma/accumulate.c                           |    4 +-
 src/mpi/rma/alloc_mem.c                            |    4 +-
 src/mpi/rma/compare_and_swap.c                     |    4 +-
 src/mpi/rma/fetch_and_op.c                         |    8 +-
 src/mpi/rma/free_mem.c                             |    4 +-
 src/mpi/rma/get.c                                  |    4 +-
 src/mpi/rma/get_accumulate.c                       |    4 +-
 src/mpi/rma/put.c                                  |    4 +-
 src/mpi/rma/raccumulate.c                          |    4 +-
 src/mpi/rma/rget.c                                 |    4 +-
 src/mpi/rma/rget_accumulate.c                      |    4 +-
 src/mpi/rma/rmatypeutil.c                          |    4 +-
 src/mpi/rma/rput.c                                 |    4 +-
 src/mpi/rma/win_allocate.c                         |    4 +-
 src/mpi/rma/win_allocate_shared.c                  |   12 +-
 src/mpi/rma/win_attach.c                           |    4 +-
 src/mpi/rma/win_complete.c                         |    4 +-
 src/mpi/rma/win_create.c                           |    4 +-
 src/mpi/rma/win_create_dynamic.c                   |    4 +-
 src/mpi/rma/win_detach.c                           |    4 +-
 src/mpi/rma/win_fence.c                            |    4 +-
 src/mpi/rma/win_flush.c                            |    4 +-
 src/mpi/rma/win_flush_all.c                        |    4 +-
 src/mpi/rma/win_flush_local.c                      |    4 +-
 src/mpi/rma/win_flush_local_all.c                  |    4 +-
 src/mpi/rma/win_free.c                             |    5 +-
 src/mpi/rma/win_get_group.c                        |    4 +-
 src/mpi/rma/win_get_info.c                         |    4 +-
 src/mpi/rma/win_lock.c                             |    8 +-
 src/mpi/rma/win_lock_all.c                         |    6 +-
 src/mpi/rma/win_post.c                             |    4 +-
 src/mpi/rma/win_set_info.c                         |    4 +-
 src/mpi/rma/win_shared_query.c                     |    4 +-
 src/mpi/rma/win_start.c                            |    4 +-
 src/mpi/rma/win_sync.c                             |    4 +-
 src/mpi/rma/win_test.c                             |    4 +-
 src/mpi/rma/win_unlock.c                           |    4 +-
 src/mpi/rma/win_unlock_all.c                       |    4 +-
 src/mpi/rma/win_wait.c                             |    4 +-
 src/mpi/romio/adio/common/ad_iread_coll.c          |    2 +-
 src/mpi/romio/adio/common/ad_iwrite_coll.c         |    2 +-
 src/mpi/romio/adio/include/adioi.h                 |    2 +-
 src/mpi/romio/mpi-io/close.c                       |    4 +-
 src/mpi/romio/mpi-io/delete.c                      |    4 +-
 src/mpi/romio/mpi-io/fsync.c                       |    4 +-
 src/mpi/romio/mpi-io/get_errh.c                    |    4 +-
 src/mpi/romio/mpi-io/get_group.c                   |    4 +-
 src/mpi/romio/mpi-io/get_info.c                    |    4 +-
 src/mpi/romio/mpi-io/get_view.c                    |    4 +-
 src/mpi/romio/mpi-io/ioreq_c2f.c                   |    6 +-
 src/mpi/romio/mpi-io/ioreq_f2c.c                   |    4 +-
 src/mpi/romio/mpi-io/iotest.c                      |    4 +-
 src/mpi/romio/mpi-io/iotestall.c                   |    4 +-
 src/mpi/romio/mpi-io/iotestany.c                   |    4 +-
 src/mpi/romio/mpi-io/iotestsome.c                  |    4 +-
 src/mpi/romio/mpi-io/iowait.c                      |    4 +-
 src/mpi/romio/mpi-io/iowaitall.c                   |    4 +-
 src/mpi/romio/mpi-io/iowaitany.c                   |    4 +-
 src/mpi/romio/mpi-io/iowaitsome.c                  |    4 +-
 src/mpi/romio/mpi-io/iread.c                       |    4 +-
 src/mpi/romio/mpi-io/iread_all.c                   |    4 +-
 src/mpi/romio/mpi-io/iread_sh.c                    |    4 +-
 src/mpi/romio/mpi-io/iwrite.c                      |    4 +-
 src/mpi/romio/mpi-io/iwrite_all.c                  |    4 +-
 src/mpi/romio/mpi-io/iwrite_sh.c                   |    4 +-
 src/mpi/romio/mpi-io/mpioimpl.h                    |   18 +-
 src/mpi/romio/mpi-io/open.c                        |    4 +-
 src/mpi/romio/mpi-io/prealloc.c                    |    4 +-
 src/mpi/romio/mpi-io/read.c                        |    4 +-
 src/mpi/romio/mpi-io/read_all.c                    |    4 +-
 src/mpi/romio/mpi-io/read_allb.c                   |    4 +-
 src/mpi/romio/mpi-io/read_alle.c                   |    4 +-
 src/mpi/romio/mpi-io/read_ord.c                    |    4 +-
 src/mpi/romio/mpi-io/read_ordb.c                   |    4 +-
 src/mpi/romio/mpi-io/read_orde.c                   |    4 +-
 src/mpi/romio/mpi-io/read_sh.c                     |    4 +-
 src/mpi/romio/mpi-io/register_datarep.c            |    4 +-
 src/mpi/romio/mpi-io/seek.c                        |    4 +-
 src/mpi/romio/mpi-io/seek_sh.c                     |    4 +-
 src/mpi/romio/mpi-io/set_atom.c                    |    4 +-
 src/mpi/romio/mpi-io/set_errh.c                    |    4 +-
 src/mpi/romio/mpi-io/set_info.c                    |    4 +-
 src/mpi/romio/mpi-io/set_size.c                    |    4 +-
 src/mpi/romio/mpi-io/set_view.c                    |    4 +-
 src/mpi/romio/mpi-io/write.c                       |    4 +-
 src/mpi/romio/mpi-io/write_all.c                   |    4 +-
 src/mpi/romio/mpi-io/write_allb.c                  |    4 +-
 src/mpi/romio/mpi-io/write_alle.c                  |    4 +-
 src/mpi/romio/mpi-io/write_ord.c                   |    4 +-
 src/mpi/romio/mpi-io/write_ordb.c                  |    4 +-
 src/mpi/romio/mpi-io/write_orde.c                  |    4 +-
 src/mpi/romio/mpi-io/write_sh.c                    |    4 +-
 src/mpi/spawn/close_port.c                         |    6 +-
 src/mpi/spawn/comm_accept.c                        |    8 +-
 src/mpi/spawn/comm_connect.c                       |    8 +-
 src/mpi/spawn/comm_disconnect.c                    |    4 +-
 src/mpi/spawn/comm_join.c                          |   18 +-
 src/mpi/spawn/comm_spawn.c                         |    4 +-
 src/mpi/spawn/comm_spawn_multiple.c                |    4 +-
 src/mpi/spawn/lookup_name.c                        |    6 +-
 src/mpi/spawn/open_port.c                          |    6 +-
 src/mpi/spawn/publish_name.c                       |    6 +-
 src/mpi/spawn/unpublish_name.c                     |    6 +-
 src/mpi/timer/Makefile.mk                          |    4 -
 src/mpi/timer/mpidtime.c                           |  424 --------
 src/mpi/topo/cart_coords.c                         |    4 +-
 src/mpi/topo/cart_create.c                         |   26 +-
 src/mpi/topo/cart_get.c                            |    4 +-
 src/mpi/topo/cart_map.c                            |   14 +-
 src/mpi/topo/cart_rank.c                           |    8 +-
 src/mpi/topo/cart_shift.c                          |   12 +-
 src/mpi/topo/cart_sub.c                            |   14 +-
 src/mpi/topo/cartdim_get.c                         |    2 +-
 src/mpi/topo/dims_create.c                         |    2 +-
 src/mpi/topo/dist_gr_create.c                      |   32 +-
 src/mpi/topo/dist_gr_create_adj.c                  |   14 +-
 src/mpi/topo/dist_gr_neighb.c                      |   18 +-
 src/mpi/topo/dist_gr_neighb_count.c                |   12 +-
 src/mpi/topo/graph_get.c                           |    6 +-
 src/mpi/topo/graph_map.c                           |   12 +-
 src/mpi/topo/graph_nbr.c                           |   10 +-
 src/mpi/topo/graphcreate.c                         |   14 +-
 src/mpi/topo/graphdimsget.c                        |    2 +-
 src/mpi/topo/graphnbrcnt.c                         |   10 +-
 src/mpi/topo/inhb_allgather.c                      |   30 +-
 src/mpi/topo/inhb_allgatherv.c                     |   30 +-
 src/mpi/topo/inhb_alltoall.c                       |   32 +-
 src/mpi/topo/inhb_alltoallv.c                      |   32 +-
 src/mpi/topo/inhb_alltoallw.c                      |   32 +-
 src/mpi/topo/nhb_allgather.c                       |   18 +-
 src/mpi/topo/nhb_allgatherv.c                      |   18 +-
 src/mpi/topo/nhb_alltoall.c                        |   18 +-
 src/mpi/topo/nhb_alltoallv.c                       |   18 +-
 src/mpi/topo/nhb_alltoallw.c                       |   18 +-
 src/mpi/topo/topoutil.c                            |   26 +-
 src/mpi_t/cat_changed.c                            |    2 +-
 src/mpi_t/cat_get_categories.c                     |    6 +-
 src/mpi_t/cat_get_cvars.c                          |    6 +-
 src/mpi_t/cat_get_index.c                          |    2 +-
 src/mpi_t/cat_get_info.c                           |    2 +-
 src/mpi_t/cat_get_num.c                            |    2 +-
 src/mpi_t/cat_get_pvars.c                          |    6 +-
 src/mpi_t/cvar_get_index.c                         |    2 +-
 src/mpi_t/cvar_get_info.c                          |    2 +-
 src/mpi_t/cvar_get_num.c                           |    2 +-
 src/mpi_t/cvar_handle_alloc.c                      |    6 +-
 src/mpi_t/cvar_handle_free.c                       |    2 +-
 src/mpi_t/cvar_read.c                              |    8 +-
 src/mpi_t/cvar_write.c                             |    8 +-
 src/mpi_t/enum_get_info.c                          |    2 +-
 src/mpi_t/enum_get_item.c                          |    2 +-
 src/mpi_t/mpit_finalize.c                          |    2 +-
 src/mpi_t/mpit_initthread.c                        |    2 +-
 src/mpi_t/pvar_get_index.c                         |    2 +-
 src/mpi_t/pvar_get_info.c                          |    2 +-
 src/mpi_t/pvar_get_num.c                           |    2 +-
 src/mpi_t/pvar_handle_alloc.c                      |    4 +-
 src/mpi_t/pvar_handle_free.c                       |    6 +-
 src/mpi_t/pvar_read.c                              |    4 +-
 src/mpi_t/pvar_readreset.c                         |    4 +-
 src/mpi_t/pvar_reset.c                             |    4 +-
 src/mpi_t/pvar_session_create.c                    |    4 +-
 src/mpi_t/pvar_session_free.c                      |    4 +-
 src/mpi_t/pvar_start.c                             |    4 +-
 src/mpi_t/pvar_stop.c                              |    4 +-
 src/mpi_t/pvar_write.c                             |    4 +-
 .../ch3/channels/nemesis/include/mpid_nem_impl.h   |   20 +-
 .../ch3/channels/nemesis/include/mpid_nem_inline.h |   82 ++-
 .../ch3/channels/nemesis/include/mpid_nem_queue.h  |    6 +-
 .../ch3/channels/nemesis/include/mpidi_ch3_impl.h  |   20 +-
 .../ch3/channels/nemesis/netmod/llc/llc_cancel.c   |    2 +-
 .../ch3/channels/nemesis/netmod/llc/llc_fini.c     |    4 +-
 .../ch3/channels/nemesis/netmod/llc/llc_init.c     |   32 +-
 .../ch3/channels/nemesis/netmod/llc/llc_poll.c     |   22 +-
 .../ch3/channels/nemesis/netmod/llc/llc_probe.c    |    6 +-
 .../ch3/channels/nemesis/netmod/llc/llc_send.c     |   52 +-
 src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c  |   15 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_cancel.c   |    4 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_init.c     |   74 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_poll.c     |   24 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_probe.c    |   12 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_send.c     |   38 +-
 src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c  |   14 +-
 .../ch3/channels/nemesis/netmod/ofi/ofi_impl.h     |   12 +-
 .../ch3/channels/nemesis/netmod/ofi/ofi_init.c     |   48 +-
 src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_msg.c |   10 +-
 .../nemesis/netmod/ofi/ofi_probe_template.c        |    2 +-
 .../ch3/channels/nemesis/netmod/ofi/ofi_progress.c |    2 +-
 .../nemesis/netmod/ofi/ofi_tagged_template.c       |    4 +-
 .../channels/nemesis/netmod/portals4/ptl_init.c    |  166 ++--
 .../ch3/channels/nemesis/netmod/portals4/ptl_lmt.c |   10 +-
 .../ch3/channels/nemesis/netmod/portals4/ptl_nm.c  |   64 +-
 .../channels/nemesis/netmod/portals4/ptl_poll.c    |   34 +-
 .../channels/nemesis/netmod/portals4/ptl_probe.c   |   48 +-
 .../channels/nemesis/netmod/portals4/ptl_recv.c    |   66 +-
 .../channels/nemesis/netmod/portals4/ptl_send.c    |   40 +-
 .../ch3/channels/nemesis/netmod/portals4/rptl.c    |   20 +-
 .../channels/nemesis/netmod/portals4/rptl_init.c   |   10 +-
 .../ch3/channels/nemesis/netmod/portals4/rptl_op.c |    4 +-
 src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c  |  202 ++--
 .../ch3/channels/nemesis/netmod/tcp/tcp_ckpt.c     |   18 +-
 .../ch3/channels/nemesis/netmod/tcp/tcp_finalize.c |    8 +-
 .../ch3/channels/nemesis/netmod/tcp/tcp_getip.c    |   18 +-
 .../ch3/channels/nemesis/netmod/tcp/tcp_init.c     |  122 ++--
 .../ch3/channels/nemesis/netmod/tcp/tcp_send.c     |  114 ++--
 .../ch3/channels/nemesis/netmod/tcp/tcp_utility.c  |   38 +-
 src/mpid/ch3/channels/nemesis/src/ch3_finalize.c   |    6 +-
 src/mpid/ch3/channels/nemesis/src/ch3_init.c       |   36 +-
 src/mpid/ch3/channels/nemesis/src/ch3_isend.c      |   18 +-
 src/mpid/ch3/channels/nemesis/src/ch3_isendv.c     |   20 +-
 src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c  |   12 +-
 src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c |   14 +-
 src/mpid/ch3/channels/nemesis/src/ch3_progress.c   |  190 ++--
 src/mpid/ch3/channels/nemesis/src/ch3_rma_shm.c    |   12 +-
 src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c    |  126 ++--
 src/mpid/ch3/channels/nemesis/src/ch3i_comm.c      |   24 +-
 .../ch3/channels/nemesis/src/ch3i_eagernoncontig.c |   12 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_alloc.c |   94 +-
 .../ch3/channels/nemesis/src/mpid_nem_barrier.c    |    6 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_ckpt.c  |   54 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c |    6 +-
 .../ch3/channels/nemesis/src/mpid_nem_finalize.c   |    6 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c  |   72 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c   |  100 +-
 .../ch3/channels/nemesis/src/mpid_nem_lmt_dma.c    |   84 +-
 .../ch3/channels/nemesis/src/mpid_nem_lmt_shm.c    |   87 +-
 .../channels/nemesis/src/mpid_nem_lmt_vmsplice.c   |   58 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich.c |    6 +-
 .../ch3/channels/nemesis/src/mpid_nem_mpich_rma.c  |  114 ++--
 .../ch3/channels/nemesis/src/mpid_nem_network.c    |    4 +-
 .../channels/nemesis/src/mpid_nem_network_poll.c   |    2 +-
 .../ch3/channels/sock/include/mpidi_ch3_post.h     |    4 +-
 src/mpid/ch3/channels/sock/include/mpidi_ch3_pre.h |    2 +-
 src/mpid/ch3/channels/sock/src/ch3_finalize.c      |    4 +-
 src/mpid/ch3/channels/sock/src/ch3_init.c          |    8 +-
 src/mpid/ch3/channels/sock/src/ch3_isend.c         |   10 +-
 src/mpid/ch3/channels/sock/src/ch3_isendv.c        |   10 +-
 src/mpid/ch3/channels/sock/src/ch3_istartmsg.c     |   18 +-
 src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c    |   18 +-
 src/mpid/ch3/channels/sock/src/ch3_progress.c      |  162 ++--
 src/mpid/ch3/channels/sock/src/ch3_win_fns.c       |    6 +-
 src/mpid/ch3/channels/sock/src/ch3i_errno.c        |    2 +-
 src/mpid/ch3/include/mpid_rma_issue.h              |  118 ++--
 src/mpid/ch3/include/mpid_rma_lockqueue.h          |    4 +-
 src/mpid/ch3/include/mpid_rma_oplist.h             |   38 +-
 src/mpid/ch3/include/mpid_rma_shm.h                |   36 +-
 src/mpid/ch3/include/mpidimpl.h                    |   66 +--
 src/mpid/ch3/include/mpidpkt.h                     |   20 +-
 src/mpid/ch3/include/mpidpost.h                    |    8 +-
 src/mpid/ch3/include/mpidpre.h                     |    7 +
 src/mpid/ch3/include/mpidrma.h                     |  114 ++--
 src/mpid/ch3/src/ch3u_buffer.c                     |    6 +-
 src/mpid/ch3/src/ch3u_comm.c                       |   42 +-
 src/mpid/ch3/src/ch3u_comm_spawn_multiple.c        |   66 +-
 src/mpid/ch3/src/ch3u_eager.c                      |   94 +-
 src/mpid/ch3/src/ch3u_eagersync.c                  |   54 +-
 src/mpid/ch3/src/ch3u_handle_connection.c          |   66 +-
 src/mpid/ch3/src/ch3u_handle_op_req.c              |    4 +-
 src/mpid/ch3/src/ch3u_handle_recv_pkt.c            |   32 +-
 src/mpid/ch3/src/ch3u_handle_recv_req.c            |  200 ++--
 src/mpid/ch3/src/ch3u_handle_revoke_pkt.c          |    6 +-
 src/mpid/ch3/src/ch3u_handle_send_req.c            |   28 +-
 src/mpid/ch3/src/ch3u_port.c                       |  156 ++--
 src/mpid/ch3/src/ch3u_recvq.c                      |   50 +-
 src/mpid/ch3/src/ch3u_request.c                    |   12 +-
 src/mpid/ch3/src/ch3u_rma_ops.c                    |  112 ++--
 src/mpid/ch3/src/ch3u_rma_pkthandler.c             |  224 +++---
 src/mpid/ch3/src/ch3u_rma_progress.c               |   68 +-
 src/mpid/ch3/src/ch3u_rma_reqops.c                 |   40 +-
 src/mpid/ch3/src/ch3u_rma_sync.c                   |  196 ++--
 src/mpid/ch3/src/ch3u_rndv.c                       |   56 +-
 src/mpid/ch3/src/ch3u_win_fns.c                    |   54 +-
 src/mpid/ch3/src/mpid_abort.c                      |    2 +-
 src/mpid/ch3/src/mpid_aint.c                       |    8 +-
 src/mpid/ch3/src/mpid_cancel_recv.c                |    4 +-
 src/mpid/ch3/src/mpid_cancel_send.c                |   22 +-
 src/mpid/ch3/src/mpid_comm_disconnect.c            |    8 +-
 src/mpid/ch3/src/mpid_comm_failure_ack.c           |    8 +-
 src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c  |    4 +-
 src/mpid/ch3/src/mpid_comm_revoke.c                |   10 +-
 src/mpid/ch3/src/mpid_comm_spawn_multiple.c        |    6 +-
 src/mpid/ch3/src/mpid_finalize.c                   |   16 +-
 src/mpid/ch3/src/mpid_get_universe_size.c          |    8 +-
 src/mpid/ch3/src/mpid_getpname.c                   |    4 +-
 src/mpid/ch3/src/mpid_improbe.c                    |   30 +-
 src/mpid/ch3/src/mpid_imrecv.c                     |   10 +-
 src/mpid/ch3/src/mpid_init.c                       |   72 +-
 src/mpid/ch3/src/mpid_iprobe.c                     |   28 +-
 src/mpid/ch3/src/mpid_irecv.c                      |   22 +-
 src/mpid/ch3/src/mpid_irsend.c                     |   10 +-
 src/mpid/ch3/src/mpid_isend.c                      |   10 +-
 src/mpid/ch3/src/mpid_issend.c                     |    4 +-
 src/mpid/ch3/src/mpid_mprobe.c                     |   26 +-
 src/mpid/ch3/src/mpid_mrecv.c                      |    8 +-
 src/mpid/ch3/src/mpid_port.c                       |   36 +-
 src/mpid/ch3/src/mpid_probe.c                      |   24 +-
 src/mpid/ch3/src/mpid_recv.c                       |   26 +-
 src/mpid/ch3/src/mpid_rma.c                        |   55 +-
 src/mpid/ch3/src/mpid_rsend.c                      |    8 +-
 src/mpid/ch3/src/mpid_send.c                       |   16 +-
 src/mpid/ch3/src/mpid_ssend.c                      |    4 +-
 src/mpid/ch3/src/mpid_startall.c                   |   12 +-
 src/mpid/ch3/src/mpid_vc.c                         |   97 +-
 src/mpid/ch3/src/mpidi_isend_self.c                |   16 +-
 src/mpid/ch3/src/mpidi_pg.c                        |   92 +-
 src/mpid/ch3/src/mpidi_rma.c                       |   18 +-
 src/mpid/ch3/util/ftb/ftb.c                        |   18 +-
 src/mpid/ch3/util/sock/ch3u_connect_sock.c         |  130 ++--
 src/mpid/ch3/util/sock/ch3u_getinterfaces.c        |    6 +-
 src/mpid/ch3/util/sock/ch3u_init_sock.c            |    4 +-
 src/mpid/ch3/util/unordered/unordered.c            |    2 +-
 src/mpid/common/Makefile.mk                        |    1 +
 src/mpid/common/datatype/dataloop/darray_support.c |   38 +-
 .../common/datatype/dataloop/subarray_support.c    |   16 +-
 src/mpid/common/datatype/mpid_dataloop.h           |    6 +-
 src/mpid/common/datatype/mpid_ext32_segment.c      |    8 +-
 src/mpid/common/datatype/mpid_segment.c            |   30 +-
 .../common/datatype/mpid_type_create_pairtype.c    |    2 +-
 src/mpid/common/datatype/mpid_type_dup.c           |    2 +-
 src/mpid/common/hcoll/hcoll_init.c                 |   20 +-
 src/mpid/common/hcoll/hcoll_ops.c                  |   16 +-
 src/mpid/common/hcoll/hcoll_rte.c                  |   48 +-
 src/mpid/common/sched/mpid_sched.c                 |   86 +-
 src/mpid/common/sock/iocp/sock.c                   |   91 +-
 src/mpid/common/sock/poll/sock_immed.i             |   18 +-
 src/mpid/common/sock/poll/sock_init.i              |    4 +-
 src/mpid/common/sock/poll/sock_misc.i              |   12 +-
 src/mpid/common/sock/poll/sock_post.i              |   32 +-
 src/mpid/common/sock/poll/sock_set.i               |   18 +-
 src/mpid/common/sock/poll/sock_wait.i              |   27 +-
 src/mpid/common/sock/poll/socki_util.i             |   28 +-
 src/mpid/common/thread/Makefile.mk                 |    5 +-
 src/mpid/common/thread/mpid_thread.h               |  307 ------
 src/mpid/common/thread/mpid_thread_fallback.h      |  318 ++++++
 src/mpid/common/thread/subconfigure.m4             |    6 -
 src/mpid/common/timers/Makefile.mk                 |    8 +
 src/mpid/common/timers/mpid_timers_fallback.h      |   18 +
 src/mpid/pamid/include/mpidi_macros.h              |   10 +-
 src/mpid/pamid/include/mpidi_mutex.h               |    6 +-
 src/mpid/pamid/include/mpidi_thread.h              |    6 +-
 .../pamid/src/coll/allgather/mpido_allgather.c     |    2 +-
 src/mpid/pamid/src/mpid_aint.c                     |    4 +-
 src/mpid/pamid/src/mpid_init.c                     |   14 +-
 src/mpid/pamid/src/mpid_progress.c                 |    6 +-
 src/mpid/pamid/src/mpid_progress.h                 |    2 +-
 src/mpid/pamid/src/mpid_request.c                  |    2 +-
 src/mpid/pamid/src/mpidi_env.c                     |   12 +-
 src/mpid/pamid/src/pt2pt/mpid_cancel.c             |    4 +-
 src/mpid/pamid/src/pt2pt/mpid_isend.h              |    2 +-
 src/mpl/include/mpl.h                              |   52 +-
 src/mutex/mutex_create.c                           |    2 +-
 src/mutex/mutex_free.c                             |    2 +-
 src/mutex/mutex_lock.c                             |    2 +-
 src/mutex/mutex_unlock.c                           |    2 +-
 src/nameserv/file/file_nameserv.c                  |    4 +-
 src/nameserv/pmi/pmi_nameserv.c                    |   26 +-
 src/pmi/pmi2/poe/poe2pmi.c                         |    4 +-
 src/pmi/pmi2/simple/simple2pmi.c                   |   28 +-
 src/util/Makefile.mk                               |    3 +
 src/util/assert/Makefile.mk                        |   12 +
 src/util/assert/mpiassert.h                        |  163 +++
 src/util/dbg/dbg_printf.c                          |   33 +-
 src/util/instrm/instr.c                            |    2 +-
 src/util/logging/rlog/TraceInput/trace_input.c     |   18 +-
 src/util/logging/rlog/irlog2rlog.c                 |    6 -
 src/util/logging/rlog/rlog.c                       |   16 +-
 src/util/logging/rlog/rlogutil.c                   |   22 +-
 src/util/mem/argstr.c                              |    8 +-
 src/util/mem/handlemem.c                           |   19 +-
 src/util/mem/trmem.c                               |   48 +-
 src/util/multichannel/mpi.c                        |    2 +-
 src/util/pointer/Makefile.mk                       |   12 +
 src/util/pointer/mpiu_pointer.h                    |   59 ++
 src/util/procmap/local_proc.c                      |   20 +-
 src/util/thread/Makefile.mk                        |    6 +
 src/util/thread/mpiu_thread.c                      |   33 +
 src/util/thread/mpiu_thread.h                      |  353 +++-----
 src/util/thread/mpiu_thread_global.h               |   81 ++
 src/util/thread/mpiu_thread_multiple.h             |  200 ++++
 src/util/thread/mpiu_thread_pobj.h                 |  201 ++++
 src/util/thread/mpiu_thread_posix.c                |    2 +-
 src/util/thread/mpiu_thread_posix_funcs.h          |  469 +++++-----
 src/util/thread/mpiu_thread_posix_types.h          |    6 +-
 src/util/thread/mpiu_thread_priv.h                 |  112 +++
 src/util/thread/mpiu_thread_single.h               |   66 ++
 src/util/thread/mpiu_thread_solaris.c              |    2 +-
 src/util/thread/mpiu_thread_solaris_funcs.h        |  344 +++----
 src/util/thread/mpiu_thread_win.c                  |    2 +-
 src/util/thread/mpiu_thread_win_funcs.h            |  101 +--
 src/util/thread/mpiu_thread_win_types.h            |   12 +-
 src/util/timers/Makefile.mk                        |   10 +
 src/util/timers/mpiu_timer.c                       |  410 ++++++++
 src/util/timers/mpiu_timer.h.in                    |  311 ++++++
 src/util/type/mpiu_type_defs.h                     |   13 +-
 src/util/wrappers/mpiu_shm_wrappers.h              |  110 +-
 src/util/wrappers/mpiu_sock_wrappers.h             |  106 +-
 664 files changed, 9557 insertions(+), 10440 deletions(-)
 create mode 100755 maint/mpich-replace.sh
 delete mode 100644 maint/template.c
 delete mode 100644 src/include/mpichtimer.h.in
 delete mode 100644 src/include/mpiimplthread.h
 delete mode 100644 src/include/mpiimplthreadpost.h
 delete mode 100644 src/mpi/timer/mpidtime.c
 delete mode 100644 src/mpid/common/thread/mpid_thread.h
 create mode 100644 src/mpid/common/thread/mpid_thread_fallback.h
 create mode 100644 src/mpid/common/timers/Makefile.mk
 create mode 100644 src/mpid/common/timers/mpid_timers_fallback.h
 create mode 100644 src/util/assert/Makefile.mk
 create mode 100644 src/util/assert/mpiassert.h
 create mode 100644 src/util/pointer/Makefile.mk
 create mode 100644 src/util/pointer/mpiu_pointer.h
 create mode 100644 src/util/thread/mpiu_thread.c
 create mode 100644 src/util/thread/mpiu_thread_global.h
 create mode 100644 src/util/thread/mpiu_thread_multiple.h
 create mode 100644 src/util/thread/mpiu_thread_pobj.h
 create mode 100644 src/util/thread/mpiu_thread_priv.h
 create mode 100644 src/util/thread/mpiu_thread_single.h
 create mode 100644 src/util/timers/Makefile.mk
 create mode 100644 src/util/timers/mpiu_timer.c
 create mode 100644 src/util/timers/mpiu_timer.h.in


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list