[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2-158-g643a500

Service Account noreply at mpich.org
Wed Jan 27 15:42:55 CST 2016


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  643a500c1ba7a1659a1c6701afb9e04f99f98b69 (commit)
       via  cb422019e918c34d6195612dd07a5b524951af5e (commit)
       via  e193c76c6607041cb2e6b0843d770f92c8f8df9c (commit)
       via  39d20ef64b48d27bb05a69d3305ae8ab510c960d (commit)
       via  e4335c2a117144d240b7e6dd559f6eebd00b47e3 (commit)
       via  29a65bf34a99fb21dc690f9d085b8392ef08f120 (commit)
       via  2bea90555ef22d99df104152c627ca9fb61e0d10 (commit)
       via  06c3bf79045c2d606d08919659ee5a73317fa478 (commit)
       via  63ce5c1c6ec5a04146baa8e08e1cce0b9a70e47c (commit)
       via  033799edbde9e4e24854d67cbb02c02a8b2b93f3 (commit)
       via  f45a7cadf8f9637b87a45d2a6deffb83d46f6d01 (commit)
       via  f155a7a191d8594c3d70c93fb1e87fa0b72a4bb4 (commit)
       via  8ede598279eade2e26430d93e7febcfc6bbd180e (commit)
       via  f12183882384d2a703af40d11b5b5b84f9d581c1 (commit)
       via  aef5988e0db730679f8de5958587ff77dfbc7bdc (commit)
       via  7537e6cf1c1d5959f7a60998488b415482e5c718 (commit)
       via  3226d099d87dd9f651f36aa616809446c92d206d (commit)
       via  c473c9697d55004f1c26b57db96931873a7751fd (commit)
       via  2b9dce854f17f484ffeaf2d542843efdd0c03a2f (commit)
       via  81e97eb4f349360294fe1ea71d989c67cec4dac5 (commit)
       via  78f7ba35b5467db291dbd1e090e7de0a036e5b47 (commit)
       via  e7789d21362e4c182c244b0944eb2ea20b358033 (commit)
       via  658dbbc4e380af5677cf0aae7867fb2ca0a145e9 (commit)
       via  6f99cf0557bf3867c2f4bb410981e3255b45ef9e (commit)
       via  1c6ac3af032083d0f3587e79bd03abf566b84b83 (commit)
       via  3705475cc6267520f4b8b50bbb7b094c0949e6d2 (commit)
       via  7540dd7b3e64e40754305f5ac9475d1d1f8263c9 (commit)
       via  2de17d96390e4eb905dcc42a00000b8545ba668b (commit)
       via  cbe60c0176ad8f6d4cce9844002f6b436177de3a (commit)
       via  14348c29ec91b3ce7517de300832d2dca85f063d (commit)
       via  28d12fc3eed7527e43888459c5ca5cb67d360102 (commit)
       via  d8f5696ace1c6a94ab293f7ddcc82f6e146b8518 (commit)
       via  5cb1bedf62285019b8ffe881da083cb9e603131c (commit)
       via  ca025aef5251368c3ece5d7bb8f31112fd4678c2 (commit)
       via  ca995aa6962a0eb2dcf23e30bbc7396237ee22f5 (commit)
       via  22cd1f15b8cda4987c6e100bc1ecdd4f99b9ff88 (commit)
       via  d4e2ed9cb185e8bbf60cce25d2aa1d7b78be91a2 (commit)
       via  c6040586b21ab0fc037302fc973fd37b952c4bad (commit)
       via  2019f1ce369fc147558526146927a1fa29a805ac (commit)
       via  97a6552e698c89ce151a18569788428e07dd30b9 (commit)
       via  984e4aebd30df8dfee0d16c9c178818f83bd6ee4 (commit)
       via  90e5cad43ce8c3dd5daa94edd5aa365437a57fab (commit)
       via  4c799ed63694c616f5bcce1e37aa805cdd4a4a16 (commit)
       via  c785e5167091e381ba8e59d127d4f896377fb9af (commit)
       via  cf7d213ed2739f18cdfbfb8d03bc4c85aa399226 (commit)
       via  b33ae626426653945ce0cd4f3dd40df34130518b (commit)
       via  b1754ce2b07238a71309a0eb01e2d2791af64437 (commit)
       via  a03917c99ed4dd8e63aa482f63bd2e65f74e3ba2 (commit)
       via  1c121530dd6909e71b280d2d540072fd456b0ce6 (commit)
       via  416fb3285a2c062553a3d83f892fd2d22559f729 (commit)
       via  b25093377303f390dae54bf00bb2614776f1c70c (commit)
       via  781b6215eaf63f592b71b34cc6cf90801fec2038 (commit)
       via  558c9681f2a3faa386c3ac62790963cd357afd4d (commit)
      from  cbf74623c060ad0a71f3de2ecdb4b7a3321b40e0 (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/643a500c1ba7a1659a1c6701afb9e04f99f98b69

commit 643a500c1ba7a1659a1c6701afb9e04f99f98b69
Author: Pavan Balaji <balaji at anl.gov>
Date:   Sat Jan 23 23:05:00 2016 -0600

    threads: revert hack added in [7f3a8beed663].
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/include/mpimem.h b/src/include/mpimem.h
index 339f04c..a247452 100644
--- a/src/include/mpimem.h
+++ b/src/include/mpimem.h
@@ -88,11 +88,9 @@ typedef int MPIU_BOOL;
 #ifdef USE_MEMORY_TRACING
 
 /* Define these as invalid C to catch their use in the code */
-#if 0
 #define malloc(a)         'Error use MPL_malloc' :::
 #define calloc(a,b)       'Error use MPL_calloc' :::
 #define free(a)           'Error use MPL_free'   :::
-#endif
 #define realloc(a)        'Error use MPL_realloc' :::
 #if defined(strdup) || defined(__strdup)
 #undef strdup
diff --git a/src/mpl/include/mpl_thread_priv.h b/src/mpl/include/mpl_thread_priv.h
index 4ce9bf2..034cff9 100644
--- a/src/mpl/include/mpl_thread_priv.h
+++ b/src/mpl/include/mpl_thread_priv.h
@@ -31,7 +31,7 @@ void MPLI_cleanup_tls(void *a);
         MPL_thread_tls_create(MPLI_cleanup_tls, &(key) , err_ptr_);     \
         if (unlikely(*((int *) err_ptr_)))                              \
             break;                                                      \
-        thread_ptr = calloc(1, sizeof(var));                            \
+        thread_ptr = MPL_calloc(1, sizeof(var));                        \
         if (unlikely(!thread_ptr)) {                                    \
             *((int *) err_ptr_) = MPL_THREAD_ERROR;                     \
             break;                                                      \
@@ -47,7 +47,7 @@ void MPLI_cleanup_tls(void *a);
             if (unlikely(*((int *) err_ptr_)))                          \
                 break;                                                  \
             if (!thread_ptr) {                                          \
-                thread_ptr = calloc(1, sizeof(var));                    \
+                thread_ptr = MPL_calloc(1, sizeof(var));                \
                 if (unlikely(!thread_ptr)) {                            \
                     *((int *) err_ptr_) = MPL_THREAD_ERROR;             \
                     break;                                              \
@@ -72,7 +72,7 @@ void MPLI_cleanup_tls(void *a);
             break;                                      \
                                                         \
         if (thread_ptr)                                 \
-            free(thread_ptr);                           \
+            MPL_free(thread_ptr);                       \
                                                         \
         MPL_thread_tls_set(&(key), NULL, err_ptr_);     \
         if (unlikely(*((int *) err_ptr_)))              \
diff --git a/src/mpl/src/thread/mpl_thread.c b/src/mpl/src/thread/mpl_thread.c
index 23507f0..f1e95b5 100644
--- a/src/mpl/src/thread/mpl_thread.c
+++ b/src/mpl/src/thread/mpl_thread.c
@@ -16,7 +16,7 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 void MPLI_cleanup_tls(void *a)
 {
     if (a)
-        free(a);
+        MPL_free(a);
 }
 
 #endif
diff --git a/src/mpl/src/thread/mpl_thread_posix.c b/src/mpl/src/thread/mpl_thread_posix.c
index 36c8284..89efc25 100644
--- a/src/mpl/src/thread/mpl_thread_posix.c
+++ b/src/mpl/src/thread/mpl_thread_posix.c
@@ -43,7 +43,7 @@ void MPL_thread_create(MPL_thread_func_t func, void *data, MPL_thread_id_t * idp
     int err = MPL_THREAD_SUCCESS;
 
     /* FIXME: faster allocation, or avoid it all together? */
-    thread_info = (struct MPLI_thread_info *) malloc(sizeof(struct MPLI_thread_info));
+    thread_info = (struct MPLI_thread_info *) MPL_malloc(sizeof(struct MPLI_thread_info));
     if (thread_info != NULL) {
         pthread_attr_t attr;
 
@@ -82,7 +82,7 @@ void *MPLI_thread_start(void *arg)
     MPL_thread_func_t func = thread_info->func;
     void *data = thread_info->data;
 
-    free(arg);
+    MPL_free(arg);
 
     func(data);
 
diff --git a/src/mpl/src/thread/mpl_thread_solaris.c b/src/mpl/src/thread/mpl_thread_solaris.c
index 1e05f1f..15aaec0 100644
--- a/src/mpl/src/thread/mpl_thread_solaris.c
+++ b/src/mpl/src/thread/mpl_thread_solaris.c
@@ -43,7 +43,7 @@ void MPL_thread_create(MPL_thread_func_t func, void *data, MPL_thread_id_t * idp
     int err = MPL_THREAD_SUCCESS;
 
     /* FIXME: faster allocation, or avoid it all together? */
-    thread_info = (struct MPLI_thread_info *) malloc(sizeof(struct MPLI_thread_info));
+    thread_info = (struct MPLI_thread_info *) MPL_malloc(sizeof(struct MPLI_thread_info));
     if (thread_info != NULL) {
         thread_info->func = func;
         thread_info->data = data;
@@ -73,7 +73,7 @@ void *MPLI_thread_start(void *arg)
     MPL_thread_func_t func = thread_info->func;
     void *data = thread_info->data;
 
-    free(arg);
+    MPL_free(arg);
 
     func(data);
 
diff --git a/src/mpl/src/thread/mpl_thread_win.c b/src/mpl/src/thread/mpl_thread_win.c
index 133e439..d501654 100644
--- a/src/mpl/src/thread/mpl_thread_win.c
+++ b/src/mpl/src/thread/mpl_thread_win.c
@@ -41,7 +41,7 @@ void MPL_thread_create(MPL_thread_func_t func, void *data, MPL_thread_id_t * idp
     struct MPLI_thread_info *thread_info;
     int err = MPL_THREAD_SUCCESS;
 
-    thread_info = (struct MPLI_thread_info *) malloc(sizeof(struct MPLI_thread_info));
+    thread_info = (struct MPLI_thread_info *) MPL_malloc(sizeof(struct MPLI_thread_info));
     if (thread_info != NULL) {
         thread_info->func = func;
         thread_info->data = data;
@@ -72,7 +72,7 @@ DWORD WINAPI MPLI_thread_start(LPVOID arg)
     MPL_thread_func_t func = thread_info->func;
     void *data = thread_info->data;
 
-    free(arg);
+    MPL_free(arg);
 
     func(data);
 
@@ -198,7 +198,7 @@ void MPL_thread_cond_destroy(MPL_thread_cond_t * cond, int *err)
     while (cond->fifo_head) {
         iter = cond->fifo_head;
         cond->fifo_head = cond->fifo_head->next;
-        free(iter);
+        MPL_free(iter);
     }
     MPL_thread_mutex_destroy(&cond->fifo_mutex, err);
     if (err != NULL && *err != MPL_THREAD_SUCCESS) {
@@ -239,12 +239,12 @@ void MPL_thread_cond_wait(MPL_thread_cond_t * cond, MPL_thread_mutex_t * mutex,
         return;
     }
     if (cond->fifo_tail == NULL) {
-        cond->fifo_tail = (MPLI_win_thread_cond_fifo_t *) malloc(sizeof(MPLI_win_thread_cond_fifo_t));
+        cond->fifo_tail = (MPLI_win_thread_cond_fifo_t *) MPL_malloc(sizeof(MPLI_win_thread_cond_fifo_t));
         cond->fifo_head = cond->fifo_tail;
     }
     else {
         cond->fifo_tail->next =
-            (MPLI_win_thread_cond_fifo_t *) malloc(sizeof(MPLI_win_thread_cond_fifo_t));
+            (MPLI_win_thread_cond_fifo_t *) MPL_malloc(sizeof(MPLI_win_thread_cond_fifo_t));
         cond->fifo_tail = cond->fifo_tail->next;
     }
     if (cond->fifo_tail == NULL) {
@@ -312,7 +312,7 @@ void MPL_thread_cond_broadcast(MPL_thread_cond_t * cond, int *err)
         }
         temp = fifo;
         fifo = fifo->next;
-        free(temp);
+        MPL_free(temp);
     }
     if (err != NULL) {
         *err = MPL_THREAD_SUCCESS;
@@ -339,10 +339,10 @@ void MPL_thread_cond_signal(MPL_thread_cond_t * cond, int *err)
     if (fifo) {
         if (!SetEvent(fifo->event) && err != NULL) {
             *err = GetLastError();
-            free(fifo);
+            MPL_free(fifo);
             return;
         }
-        free(fifo);
+        MPL_free(fifo);
     }
     if (err != NULL) {
         *err = MPL_THREAD_SUCCESS;

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

commit cb422019e918c34d6195612dd07a5b524951af5e
Author: Pavan Balaji <balaji at anl.gov>
Date:   Sat Jan 23 20:29:55 2016 -0600

    mem: move the memory allocation code to MPL.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/confdb/aclocal_romio.m4 b/confdb/aclocal_romio.m4
index af80d3c..64091ba 100644
--- a/confdb/aclocal_romio.m4
+++ b/confdb/aclocal_romio.m4
@@ -794,7 +794,7 @@ define(PAC_TEST_MPIU_FUNCS,[
 #include "stdio.h"
   main(Int argc, char **argv)
   {
-      MPIU_Free(NULL);
+      MPL_free(NULL);
   }
 EOF
   rm -f conftest$EXEEXT
diff --git a/maint/extractcvars.in b/maint/extractcvars.in
index b21b688..ed95bd6 100755
--- a/maint/extractcvars.in
+++ b/maint/extractcvars.in
@@ -347,7 +347,7 @@ EOT
     if ($p->{type} eq 'string') {
 print OUTPUT_C <<EOT;
     if (tmp_str != NULL) {
-        ${var_name} = MPIU_Strdup(tmp_str);
+        ${var_name} = MPL_strdup(tmp_str);
         ${ns}_assert(${var_name});
         if (${var_name} == NULL) {
             MPIU_CHKMEM_SETERR(mpi_errno, strlen(tmp_str), "dup of string for ${var_name}");
@@ -385,7 +385,7 @@ foreach my $p (@cvars) {
         # Need to cleanup after whatever was strduped by the init routine
 print OUTPUT_C <<EOT;
     if (${var_name} != NULL) {
-        MPIU_Free(${var_name});
+        MPL_free(${var_name});
         ${var_name} = NULL;
     }
 
diff --git a/src/binding/fortran/mpif_h/buildiface b/src/binding/fortran/mpif_h/buildiface
index 2598ffd..488fb43 100755
--- a/src/binding/fortran/mpif_h/buildiface
+++ b/src/binding/fortran/mpif_h/buildiface
@@ -37,8 +37,8 @@ $routine_pattern = "[A-Z][a-z0-9_]*";
 my @routine_prefixes = qw(MPI_ MPIX_);
 my @out_prefixes = qw(mpi_ mpix_);
 
-$malloc = "MPIU_Malloc";
-$free   = "MPIU_Free";
+$malloc = "MPL_malloc";
+$free   = "MPL_free";
 $header_file = "mpi_fortimpl.h";
 $debug = 0;
 $writeRoutineList = 0;   # Set to 1 to get a list of MPI routines
diff --git a/src/binding/fortran/mpif_h/mpi_fortimpl.h b/src/binding/fortran/mpif_h/mpi_fortimpl.h
index 313a166..364187c 100644
--- a/src/binding/fortran/mpif_h/mpi_fortimpl.h
+++ b/src/binding/fortran/mpif_h/mpi_fortimpl.h
@@ -220,10 +220,10 @@ typedef char *MPID_FCHAR_T;
 /* style: allow:malloc:1 sig:0 */
 /* style: allow:free:1 sig:0 */
 /* style: allow:calloc:1 sig:0 */
-#ifndef MPIU_Malloc
-#define MPIU_Malloc(a)    malloc((unsigned)(a))
-#define MPIU_Calloc(a,b)  calloc((unsigned)(a),(unsigned)(b))
-#define MPIU_Free(a)      free((void *)(a))
+#ifndef MPL_malloc
+#define MPL_malloc(a)    malloc((unsigned)(a))
+#define MPL_calloc(a,b)  calloc((unsigned)(a),(unsigned)(b))
+#define MPL_free(a)      free((void *)(a))
 #endif
 
 /* To avoid constant allocation/deallocation of temporary arrays, define
diff --git a/src/binding/fortran/use_mpi_f08/wrappers_c/comm_spawn_c.c b/src/binding/fortran/use_mpi_f08/wrappers_c/comm_spawn_c.c
index 52c08e7..016a342 100644
--- a/src/binding/fortran/use_mpi_f08/wrappers_c/comm_spawn_c.c
+++ b/src/binding/fortran/use_mpi_f08/wrappers_c/comm_spawn_c.c
@@ -24,7 +24,7 @@ int MPIR_Comm_spawn_c(const char *command, char *argv_f, int maxprocs, MPI_Info
     mpi_errno = PMPI_Comm_spawn(command, argv_c, maxprocs, info, root, comm, intercomm, array_of_errcodes);
 
     if (argv_c != MPI_ARGV_NULL) {
-        MPIU_Free(argv_c);
+        MPL_free(argv_c);
     }
 
 fn_exit:
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 7ea4cc7..deb0db8 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
@@ -54,12 +54,12 @@ int MPIR_Comm_spawn_multiple_c(int count, char* array_of_commands_f,
     if ((char***)array_of_argv_f == MPI_ARGVS_NULL) {
         array_of_argv_c = MPI_ARGVS_NULL;
     } else {
-        array_of_argv_c = (char***) MPIU_Malloc(sizeof(char**)*count);
+        array_of_argv_c = (char***) MPL_malloc(sizeof(char**)*count);
         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);
+        buf = (char*)MPL_malloc(sizeof(char)*len);
         if (!buf) MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
 
         for (i = 0; i < count; i++) {
@@ -70,9 +70,9 @@ int MPIR_Comm_spawn_multiple_c(int count, char* array_of_commands_f,
             do {
                 if (offset + argv_elem_len > len) { /* Make sure buf is big enough */
                     len = offset + argv_elem_len;
-                    newbuf = (char*)MPIU_Realloc(buf, len);
+                    newbuf = (char*)MPL_realloc(buf, len);
                     if (!newbuf) {
-                        MPIU_Free(buf);
+                        MPL_free(buf);
                         MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
                     }
                     buf = newbuf;
@@ -94,24 +94,24 @@ int MPIR_Comm_spawn_multiple_c(int count, char* array_of_commands_f,
             mpi_errno = MPIR_Fortran_array_of_string_f2c(buf, &(array_of_argv_c[i]), argv_elem_len, 0, 0);
             if (mpi_errno != MPI_SUCCESS) {
                 for (j = i - 1; j >= 0; j--)
-                    MPIU_Free(array_of_argv_c[j]);
-                MPIU_Free(buf);
+                    MPL_free(array_of_argv_c[j]);
+                MPL_free(buf);
                 goto fn_fail;
             }
         }
 
-        MPIU_Free(buf);
+        MPL_free(buf);
     }
 
     mpi_errno = PMPI_Comm_spawn_multiple(count, array_of_commands_c, array_of_argv_c,
             array_of_maxprocs, array_of_info, root, comm, intercomm, array_of_errcodes);
 
-    MPIU_Free(array_of_commands_c);
+    MPL_free(array_of_commands_c);
 
     if (array_of_argv_c != MPI_ARGVS_NULL) {
         for (i = 0; i < count; i++)
-            MPIU_Free(array_of_argv_c[i]);
-        MPIU_Free(array_of_argv_c);
+            MPL_free(array_of_argv_c[i]);
+        MPL_free(array_of_argv_c);
     }
 
 fn_exit:
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 0128384..73c07db 100644
--- a/src/binding/fortran/use_mpi_f08/wrappers_c/utils.c
+++ b/src/binding/fortran/use_mpi_f08/wrappers_c/utils.c
@@ -56,7 +56,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 */
+    buf = (char*) MPL_malloc(sizeof(char*) * num_strs + sizeof(char) * (num_chars + num_strs)); /* Add \0 for each string */
     if (buf == NULL) {
         MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
     }
diff --git a/src/include/mpimem.h b/src/include/mpimem.h
index d448b57..339f04c 100644
--- a/src/include/mpimem.h
+++ b/src/include/mpimem.h
@@ -56,9 +56,9 @@ extern MPL_DBG_Class MPIR_DBG_STRING;
   MPICH explicity prohibits the appearence of 'malloc', 'free', 
   'calloc', 'realloc', or 'strdup' in any code implementing a device or 
   MPI call (of course, users may use any of these calls in their code).  
-  Instead, you must use 'MPIU_Malloc' etc.; if these are defined
+  Instead, you must use 'MPL_malloc' etc.; if these are defined
   as 'malloc', that is allowed, but an explicit use of 'malloc' instead of
-  'MPIU_Malloc' in the source code is not allowed.  This restriction is
+  'MPL_malloc' in the source code is not allowed.  This restriction is
   made to simplify the use of portable tools to test for memory leaks, 
   overwrites, and other consistency checks.
 
@@ -86,114 +86,21 @@ typedef int MPIU_BOOL;
 /* ------------------------------------------------------------------------- */
 
 #ifdef USE_MEMORY_TRACING
-/*M
-  MPIU_Malloc - Allocate memory
-
-  Synopsis:
-.vb
-  void *MPIU_Malloc( size_t len )
-.ve
-
-  Input Parameter:
-. len - Length of memory to allocate in bytes
-
-  Return Value:
-  Pointer to allocated memory, or null if memory could not be allocated.
-
-  Notes:
-  This routine will often be implemented as the simple macro
-.vb
-  #define MPIU_Malloc(n) malloc(n)
-.ve
-  However, it can also be defined as 
-.vb
-  #define MPIU_Malloc(n) MPL_trmalloc(n,__LINE__,__FILE__)
-.ve
-  where 'MPL_trmalloc' is a tracing version of 'malloc' that is included with
-  MPICH.
-
-  Module:
-  Utility
-  M*/
-#define MPIU_Malloc(a)    MPL_trmalloc((a),__LINE__,__FILE__)
-
-/*M
-  MPIU_Calloc - Allocate memory that is initialized to zero.
-
-  Synopsis:
-.vb
-    void *MPIU_Calloc( size_t nelm, size_t elsize )
-.ve
-
-  Input Parameters:
-+ nelm - Number of elements to allocate
-- elsize - Size of each element.
-
-  Notes:
-  Like 'MPIU_Malloc' and 'MPIU_Free', this will often be implemented as a 
-  macro but may use 'MPL_trcalloc' to provide a tracing version.
-
-  Module:
-  Utility
-  M*/
-#define MPIU_Calloc(a,b)  \
-    MPL_trcalloc((a),(b),__LINE__,__FILE__)
-
-/*M
-  MPIU_Free - Free memory
-
-  Synopsis:
-.vb
-   void MPIU_Free( void *ptr )
-.ve
-
-  Input Parameter:
-. ptr - Pointer to memory to be freed.  This memory must have been allocated
-  with 'MPIU_Malloc'.
-
-  Notes:
-  This routine will often be implemented as the simple macro
-.vb
-  #define MPIU_Free(n) free(n)
-.ve
-  However, it can also be defined as 
-.vb
-  #define MPIU_Free(n) MPL_trfree(n,__LINE__,__FILE__)
-.ve
-  where 'MPL_trfree' is a tracing version of 'free' that is included with
-  MPICH.
-
-  Module:
-  Utility
-  M*/
-#define MPIU_Free(a)      MPL_trfree(a,__LINE__,__FILE__)
-
-#define MPIU_Strdup(a)    MPL_trstrdup(a,__LINE__,__FILE__)
-
-#define MPIU_Realloc(a,b)    MPL_trrealloc((a),(b),__LINE__,__FILE__)
 
 /* Define these as invalid C to catch their use in the code */
 #if 0
-#define malloc(a)         'Error use MPIU_Malloc' :::
-#define calloc(a,b)       'Error use MPIU_Calloc' :::
-#define free(a)           'Error use MPIU_Free'   :::
+#define malloc(a)         'Error use MPL_malloc' :::
+#define calloc(a,b)       'Error use MPL_calloc' :::
+#define free(a)           'Error use MPL_free'   :::
 #endif
-#define realloc(a)        'Error use MPIU_Realloc' :::
+#define realloc(a)        'Error use MPL_realloc' :::
 #if defined(strdup) || defined(__strdup)
 #undef strdup
 #endif
     /* The ::: should cause the compiler to choke; the string 
        will give the explanation */
 #undef strdup /* in case strdup is a macro */
-#define strdup(a)         'Error use MPIU_Strdup' :::
-
-#else /* USE_MEMORY_TRACING */
-/* No memory tracing; just use native functions */
-#define MPIU_Malloc(a)    malloc((size_t)(a))
-#define MPIU_Calloc(a,b)  calloc((size_t)(a),(size_t)(b))
-#define MPIU_Free(a)      free((void *)(a))
-#define MPIU_Realloc(a,b)  realloc((void *)(a),(size_t)(b))
-#define MPIU_Strdup       MPL_strdup
+#define strdup(a)         'Error use MPL_strdup' :::
 
 #endif /* USE_MEMORY_TRACING */
 
@@ -237,7 +144,7 @@ typedef int MPIU_BOOL;
  MPIU_AssertDeclValue(const int mpiu_chklmem_stk_sz_,n_)
 
 #define MPIU_CHKLMEM_MALLOC_ORSTMT(pointer_,type_,nbytes_,rc_,name_,stmt_) \
-{pointer_ = (type_)MPIU_Malloc(nbytes_); \
+{pointer_ = (type_)MPL_malloc(nbytes_); \
 if (pointer_) { \
     MPIU_Assert(mpiu_chklmem_stk_sp_<mpiu_chklmem_stk_sz_);\
     mpiu_chklmem_stk_[mpiu_chklmem_stk_sp_++] = pointer_;\
@@ -247,7 +154,7 @@ if (pointer_) { \
 }}
 #define MPIU_CHKLMEM_FREEALL() \
     do { while (mpiu_chklmem_stk_sp_ > 0) {\
-       MPIU_Free( mpiu_chklmem_stk_[--mpiu_chklmem_stk_sp_] ); } } while(0)
+       MPL_free( mpiu_chklmem_stk_[--mpiu_chklmem_stk_sp_] ); } } while(0)
 #endif /* HAVE_ALLOCA */
 #define MPIU_CHKLMEM_MALLOC(pointer_,type_,nbytes_,rc_,name_) \
     MPIU_CHKLMEM_MALLOC_ORJUMP(pointer_,type_,nbytes_,rc_,name_)
@@ -264,7 +171,7 @@ if (pointer_) { \
  MPIU_AssertDeclValue(const int mpiu_chklbigmem_stk_sz_,n_)
 
 #define MPIU_CHKLBIGMEM_MALLOC_ORSTMT(pointer_,type_,nbytes_,rc_,name_,stmt_) \
-{pointer_ = (type_)MPIU_Malloc(nbytes_); \
+{pointer_ = (type_)MPL_malloc(nbytes_); \
 if (pointer_) { \
     MPIU_Assert(mpiu_chklbigmem_stk_sp_<mpiu_chklbigmem_stk_sz_);\
     mpiu_chklbigmem_stk_[mpiu_chklbigmem_stk_sp_++] = pointer_;\
@@ -274,7 +181,7 @@ if (pointer_) { \
 }}
 #define MPIU_CHKLBIGMEM_FREEALL() \
     { while (mpiu_chklbigmem_stk_sp_ > 0) {\
-       MPIU_Free( mpiu_chklbigmem_stk_[--mpiu_chklbigmem_stk_sp_] ); } }
+       MPL_free( mpiu_chklbigmem_stk_[--mpiu_chklbigmem_stk_sp_] ); } }
 
 #define MPIU_CHKLBIGMEM_MALLOC(pointer_,type_,nbytes_,rc_,name_) \
     MPIU_CHKLBIGMEM_MALLOC_ORJUMP(pointer_,type_,nbytes_,rc_,name_)
@@ -287,7 +194,7 @@ if (pointer_) { \
  int mpiu_chkpmem_stk_sp_=0;\
  MPIU_AssertDeclValue(const int mpiu_chkpmem_stk_sz_,n_)
 #define MPIU_CHKPMEM_MALLOC_ORSTMT(pointer_,type_,nbytes_,rc_,name_,stmt_) \
-{pointer_ = (type_)MPIU_Malloc(nbytes_); \
+{pointer_ = (type_)MPL_malloc(nbytes_); \
 if (pointer_) { \
     MPIU_Assert(mpiu_chkpmem_stk_sp_<mpiu_chkpmem_stk_sz_);\
     mpiu_chkpmem_stk_[mpiu_chkpmem_stk_sp_++] = pointer_;\
@@ -300,7 +207,7 @@ if (pointer_) { \
     mpiu_chkpmem_stk_[mpiu_chkpmem_stk_sp_++] = pointer_;}
 #define MPIU_CHKPMEM_REAP() \
     { while (mpiu_chkpmem_stk_sp_ > 0) {\
-       MPIU_Free( mpiu_chkpmem_stk_[--mpiu_chkpmem_stk_sp_] ); } }
+       MPL_free( mpiu_chkpmem_stk_[--mpiu_chkpmem_stk_sp_] ); } }
 #define MPIU_CHKPMEM_COMMIT() \
     mpiu_chkpmem_stk_sp_ = 0
 #define MPIU_CHKPMEM_MALLOC(pointer_,type_,nbytes_,rc_,name_) \
@@ -315,7 +222,7 @@ if (pointer_) { \
     MPIU_CHKPMEM_CALLOC_ORSTMT(pointer_,type_,nbytes_,rc_,name_,goto fn_fail)
 #define MPIU_CHKPMEM_CALLOC_ORSTMT(pointer_,type_,nbytes_,rc_,name_,stmt_) \
     do {                                                                   \
-        pointer_ = (type_)MPIU_Calloc(1, (nbytes_));                       \
+        pointer_ = (type_)MPL_calloc(1, (nbytes_));                       \
         if (pointer_) {                                                    \
             MPIU_Assert(mpiu_chkpmem_stk_sp_<mpiu_chkpmem_stk_sz_);        \
             mpiu_chkpmem_stk_[mpiu_chkpmem_stk_sp_++] = pointer_;          \
@@ -328,7 +235,7 @@ if (pointer_) { \
 
 /* A special version for routines that only allocate one item */
 #define MPIU_CHKPMEM_MALLOC1(pointer_,type_,nbytes_,rc_,name_,stmt_) \
-{pointer_ = (type_)MPIU_Malloc(nbytes_); \
+{pointer_ = (type_)MPL_malloc(nbytes_); \
     if (!(pointer_) && (nbytes_ > 0)) {	   \
     MPIU_CHKMEM_SETERR(rc_,nbytes_,name_); \
     stmt_;\
@@ -338,16 +245,16 @@ if (pointer_) { \
  * realloc unsafely (direct ptr assignment).  Zero-size reallocs returning NULL
  * are handled and are not considered an error. */
 #define MPIU_REALLOC_OR_FREE_AND_JUMP(ptr_,size_,rc_) do { \
-    void *realloc_tmp_ = MPIU_Realloc((ptr_), (size_)); \
+    void *realloc_tmp_ = MPL_realloc((ptr_), (size_)); \
     if ((size_) && !realloc_tmp_) { \
-        MPIU_Free(ptr_); \
+        MPL_free(ptr_); \
         MPIR_ERR_SETANDJUMP2(rc_,MPI_ERR_OTHER,"**nomem2","**nomem2 %d %s",(size_),MPL_QUOTE(ptr_)); \
     } \
     (ptr_) = realloc_tmp_; \
 } while (0)
 /* this version does not free ptr_ */
 #define MPIU_REALLOC_ORJUMP(ptr_,size_,rc_) do { \
-    void *realloc_tmp_ = MPIU_Realloc((ptr_), (size_)); \
+    void *realloc_tmp_ = MPL_realloc((ptr_), (size_)); \
     if (size_) \
         MPIR_ERR_CHKANDJUMP2(!realloc_tmp_,rc_,MPI_ERR_OTHER,"**nomem2","**nomem2 %d %s",(size_),MPL_QUOTE(ptr_)); \
     (ptr_) = realloc_tmp_; \
diff --git a/src/include/mpir_nbc.h b/src/include/mpir_nbc.h
index bc70dbf..1f76adf 100644
--- a/src/include/mpir_nbc.h
+++ b/src/include/mpir_nbc.h
@@ -119,7 +119,7 @@ int MPIR_Sched_cb_free_buf(MPID_Comm *comm, int tag, void *state);
 
 #define MPIR_SCHED_CHKPMEM_MALLOC_ORSTMT(pointer_,type_,nbytes_,rc_,name_,stmt_)  \
     do {                                                                          \
-        (pointer_) = (type_)MPIU_Malloc(nbytes_);                                 \
+        (pointer_) = (type_)MPL_malloc(nbytes_);                                 \
         if (pointer_) {                                                           \
             MPIU_Assert(mpir_sched_chkpmem_stk_sp_ < mpir_sched_chkpmem_stk_sz_); \
             mpir_sched_chkpmem_stk_[mpir_sched_chkpmem_stk_sp_++] = (pointer_);   \
@@ -136,7 +136,7 @@ int MPIR_Sched_cb_free_buf(MPID_Comm *comm, int tag, void *state);
 #define MPIR_SCHED_CHKPMEM_REAP(sched_)                                       \
     do {                                                                      \
         while (mpir_sched_chkpmem_stk_sp_ > 0) {                              \
-            MPIU_Free(mpir_sched_chkpmem_stk_[--mpir_sched_chkpmem_stk_sp_]); \
+            MPL_free(mpir_sched_chkpmem_stk_[--mpir_sched_chkpmem_stk_sp_]); \
         }                                                                     \
     } while (0)
 
diff --git a/src/include/mpitimpl.h b/src/include/mpitimpl.h
index 992ac72..2045bff 100644
--- a/src/include/mpitimpl.h
+++ b/src/include/mpitimpl.h
@@ -1317,7 +1317,7 @@ void get_timer_time_in_double(MPIR_T_pvar_timer_t *timer, void *obj_handle,
                 (pvar_table_entry_t *)utarray_eltptr(pvar_table, idx_); \
             if (pvar != NULL) { \
                 pvar->active = FALSE; \
-                /* Do not do MPIU_Free(pvar->info), since it may be re-activated */ \
+                /* Do not do MPL_free(pvar->info), since it may be re-activated */ \
             } \
         } \
     } while (0)
diff --git a/src/include/mpiu_utarray.h b/src/include/mpiu_utarray.h
index d5bb238..ed1d33f 100644
--- a/src/include/mpiu_utarray.h
+++ b/src/include/mpiu_utarray.h
@@ -2,7 +2,7 @@
  * - The file name has been changed to avoid conflicts with any system-installed
  *   "utlist.h" header files.
  * - malloc/free/realloc usages have been substituted with utarray_malloc_
- *   (etc.) indirection macros and then changed to use MPIU_Malloc and friends
+ *   (etc.) indirection macros and then changed to use MPL_malloc and friends
  * - add a ut_ptr_icd for the common case of dynamic tables of pointers
  * - intentionally omitted from "mpiimpl.h" in order to require using code to
  *   opt-in
@@ -50,10 +50,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 /* MPICH modification: override these to change what malloc/free/realloc
  * routines are used by the utarray code */
-#define utarray_malloc_(x_)     MPIU_Malloc(x_)
-#define utarray_free_(x_)       MPIU_Free(x_)
-#define utarray_realloc_(x_,y_) MPIU_Realloc(x_,y_)
-#define utarray_strdup_(x_)     MPIU_Strdup(x_)
+#define utarray_malloc_(x_)     MPL_malloc(x_)
+#define utarray_free_(x_)       MPL_free(x_)
+#define utarray_realloc_(x_,y_) MPL_realloc(x_,y_)
+#define utarray_strdup_(x_)     MPL_strdup(x_)
 
 #ifndef utarray_oom
 #define utarray_oom() exit(-1)
diff --git a/src/include/mpiu_uthash.h b/src/include/mpiu_uthash.h
index f455310..b70e51d 100644
--- a/src/include/mpiu_uthash.h
+++ b/src/include/mpiu_uthash.h
@@ -3,7 +3,7 @@
  * 1) Rename header from "uthash.h" to "mpiu_uthash.h" to avoid accidentally
  * pulling in a system-installed version of the header.
  *
- * 2) Use MPIU_Malloc/MPIU_Free instead of malloc/free
+ * 2) Use MPL_malloc/MPL_free instead of malloc/free
  *
  * The actual macros themselves have not been namespaced, so if a plain
  * "uthash.h" is included anywhere in the tree then there could be a conflict.
@@ -81,10 +81,10 @@ typedef unsigned char uint8_t;
 #define uthash_fatal(msg) exit(-1)        /* fatal error (out of memory,etc) */
 #endif
 #ifndef uthash_malloc
-#define uthash_malloc(sz) MPIU_Malloc(sz)      /* malloc fcn                      */
+#define uthash_malloc(sz) MPL_malloc(sz)      /* malloc fcn                      */
 #endif
 #ifndef uthash_free
-#define uthash_free(ptr,sz) MPIU_Free(ptr)     /* free fcn                        */
+#define uthash_free(ptr,sz) MPL_free(ptr)     /* free fcn                        */
 #endif
 
 #ifndef uthash_noexpand_fyi
diff --git a/src/mpi/coll/nbcutil.c b/src/mpi/coll/nbcutil.c
index 080df12..b7000ce 100644
--- a/src/mpi/coll/nbcutil.c
+++ b/src/mpi/coll/nbcutil.c
@@ -12,7 +12,7 @@
 #define FCNAME MPL_QUOTE(FUNCNAME)
 int MPIR_Sched_cb_free_buf(MPID_Comm *comm, int tag, void *state)
 {
-    MPIU_Free(state);
+    MPL_free(state);
     return MPI_SUCCESS;
 }
 
diff --git a/src/mpi/comm/comm_create.c b/src/mpi/comm/comm_create.c
index 4cdb762..eacddd7 100644
--- a/src/mpi/comm/comm_create.c
+++ b/src/mpi/comm/comm_create.c
@@ -260,7 +260,7 @@ int MPIR_Comm_create_intra(MPID_Comm *comm_ptr, MPID_Group *group_ptr,
 
 fn_exit:
     if (mapping)
-        MPIU_Free(mapping);
+        MPL_free(mapping);
 
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_COMM_CREATE_INTRA);
     return mpi_errno;
@@ -446,7 +446,7 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
 fn_exit:
     MPIU_CHKLMEM_FREEALL();
     if (mapping)
-        MPIU_Free(mapping);
+        MPL_free(mapping);
 
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_COMM_CREATE_INTER);
     return mpi_errno;
diff --git a/src/mpi/comm/comm_create_group.c b/src/mpi/comm/comm_create_group.c
index e0402e0..5a21001 100644
--- a/src/mpi/comm/comm_create_group.c
+++ b/src/mpi/comm/comm_create_group.c
@@ -103,7 +103,7 @@ int MPIR_Comm_create_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr, int tag
 
 fn_exit:
     if (mapping)
-        MPIU_Free(mapping);
+        MPL_free(mapping);
 
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_COMM_CREATE_GROUP);
     return mpi_errno;
diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c
index 47a508c..2ba75e3 100644
--- a/src/mpi/comm/commutil.c
+++ b/src/mpi/comm/commutil.c
@@ -229,14 +229,14 @@ static int cleanup_default_collops(void *unused)
         if (default_collops[i]) {
             MPIU_Assert(default_collops[i]->ref_count >= 1);
             if (--default_collops[i]->ref_count == 0)
-                MPIU_Free(default_collops[i]);
+                MPL_free(default_collops[i]);
             default_collops[i] = NULL;
         }
     }
     if (ic_default_collops) {
         MPIU_Assert(ic_default_collops->ref_count >= 1);
         if (--ic_default_collops->ref_count == 0)
-            MPIU_Free(ic_default_collops);
+            MPL_free(ic_default_collops);
     }
     return MPI_SUCCESS;
 }
@@ -500,8 +500,8 @@ int MPIR_Comm_map_free(MPID_Comm * comm)
     for (mapper = comm->mapper_head; mapper;) {
         tmp = mapper->next;
         if (mapper->type == MPIR_COMM_MAP_IRREGULAR && mapper->free_mapping)
-            MPIU_Free(mapper->src_mapping);
-        MPIU_Free(mapper);
+            MPL_free(mapper->src_mapping);
+        MPL_free(mapper);
         mapper = tmp;
     }
     comm->mapper_head = NULL;
@@ -565,9 +565,9 @@ int MPIR_Comm_commit(MPID_Comm * comm)
             MPL_DBG_MSG_P(MPIR_DBG_COMM, VERBOSE, "MPIU_Find_local_and_external failed for comm_ptr=%p",
                            comm);
             if (comm->intranode_table)
-                MPIU_Free(comm->intranode_table);
+                MPL_free(comm->intranode_table);
             if (comm->internode_table)
-                MPIU_Free(comm->internode_table);
+                MPL_free(comm->internode_table);
 
             mpi_errno = MPI_SUCCESS;
             goto fn_exit;
@@ -657,9 +657,9 @@ int MPIR_Comm_commit(MPID_Comm * comm)
 
   fn_exit:
     if (external_procs != NULL)
-        MPIU_Free(external_procs);
+        MPL_free(external_procs);
     if (local_procs != NULL)
-        MPIU_Free(local_procs);
+        MPL_free(local_procs);
 
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_COMM_COMMIT);
     return mpi_errno;
@@ -966,7 +966,7 @@ int MPIR_Comm_delete_internal(MPID_Comm * comm_ptr)
          * destroy_hook to allow the device to manage these vtables in a custom
          * fashion */
         if (comm_ptr->coll_fns && --comm_ptr->coll_fns->ref_count == 0) {
-            MPIU_Free(comm_ptr->coll_fns);
+            MPL_free(comm_ptr->coll_fns);
             comm_ptr->coll_fns = NULL;
         }
 
@@ -985,9 +985,9 @@ int MPIR_Comm_delete_internal(MPID_Comm * comm_ptr)
         if (comm_ptr->node_roots_comm)
             MPIR_Comm_release(comm_ptr->node_roots_comm);
         if (comm_ptr->intranode_table != NULL)
-            MPIU_Free(comm_ptr->intranode_table);
+            MPL_free(comm_ptr->intranode_table);
         if (comm_ptr->internode_table != NULL)
-            MPIU_Free(comm_ptr->internode_table);
+            MPL_free(comm_ptr->internode_table);
 
         /* Free the context value.  This should come after freeing the
          * intra/inter-node communicators since those free calls won't
@@ -1119,7 +1119,7 @@ static int free_hint_handles(void *ignore)
     if (MPID_hint_fns) {
         HASH_ITER(hh, MPID_hint_fns, curr_hint, tmp) {
             HASH_DEL(MPID_hint_fns, curr_hint);
-            MPIU_Free(curr_hint);
+            MPL_free(curr_hint);
         }
     }
 
@@ -1148,7 +1148,7 @@ int MPIR_Comm_register_hint(const char *hint_key, MPIR_Comm_hint_fn_t fn, void *
         MPIR_Add_finalize(free_hint_handles, NULL, MPIR_FINALIZE_CALLBACK_PRIO - 1);
     }
 
-    hint_elt = MPIU_Malloc(sizeof(struct MPIR_Comm_hint_fn_elt));
+    hint_elt = MPL_malloc(sizeof(struct MPIR_Comm_hint_fn_elt));
     strncpy(hint_elt->name, hint_key, MPI_MAX_INFO_KEY);
     hint_elt->state = state;
     hint_elt->fn = fn;
diff --git a/src/mpi/comm/contextid.c b/src/mpi/comm/contextid.c
index 777bff4..e4ca2e7 100644
--- a/src/mpi/comm/contextid.c
+++ b/src/mpi/comm/contextid.c
@@ -846,7 +846,7 @@ static int sched_cb_gcn_allocate_cid(MPID_Comm * comm, int tag, void *state)
      * So we need to clean the memory allocated for it. */
     MPIR_Comm_map_free(st->new_comm);
     MPIU_Handle_obj_free(&MPID_Comm_mem, st->new_comm);
-    MPIU_Free(st);
+    MPL_free(st);
     goto fn_exit;
 }
 
diff --git a/src/mpi/debugger/dbginit.c b/src/mpi/debugger/dbginit.c
index dc6fe9c..0ce4d2c 100644
--- a/src/mpi/debugger/dbginit.c
+++ b/src/mpi/debugger/dbginit.c
@@ -210,7 +210,7 @@ void MPIR_WaitForDebugger( void )
 	int  hostlen;
 	int  val;
 
-	MPIR_proctable    = (MPIR_PROCDESC *)MPIU_Malloc( 
+	MPIR_proctable    = (MPIR_PROCDESC *)MPL_malloc(
 					 size * sizeof(MPIR_PROCDESC) );
 	for (i=0; i<size; i++) {
 	    /* Initialize the proctable */
@@ -220,7 +220,7 @@ void MPIR_WaitForDebugger( void )
 	}
 
 	PMPI_Get_processor_name( hostname, &hostlen );
-	MPIR_proctable[0].host_name       = (char *)MPIU_Strdup( hostname );
+	MPIR_proctable[0].host_name       = (char *)MPL_strdup( hostname );
 	MPIR_proctable[0].executable_name = 0;
 	MPIR_proctable[0].pid             = getpid();
 
@@ -228,7 +228,7 @@ void MPIR_WaitForDebugger( void )
 	    int msg[2];
 	    PMPI_Recv( msg, 2, MPI_INT, i, 0, MPI_COMM_WORLD,MPI_STATUS_IGNORE);
 	    MPIR_proctable[i].pid = msg[1];
-	    MPIR_proctable[i].host_name = (char *)MPIU_Malloc( msg[0] + 1 );
+	    MPIR_proctable[i].host_name = (char *)MPL_malloc( msg[0] + 1 );
 	    PMPI_Recv( MPIR_proctable[i].host_name, msg[0]+1, MPI_CHAR, 
 		       i, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE );
 	    MPIR_proctable[i].host_name[msg[0]] = 0;
@@ -359,7 +359,7 @@ void MPIR_Sendq_remember( MPID_Request *req,
 	pool = p->next;
     }
     else {
-	p = (MPIR_Sendq *)MPIU_Malloc( sizeof(MPIR_Sendq) );
+	p = (MPIR_Sendq *)MPL_malloc( sizeof(MPIR_Sendq) );
 	if (!p) {
 	    /* Just ignore it */
             req->dbg_next = NULL;
@@ -408,14 +408,14 @@ static int SendqFreePool( void *d )
     p = pool;
     while (p) {
 	pool = p->next;
-	MPIU_Free( p );
+	MPL_free( p );
 	p = pool;
     }
     /* Free the list of pending sends */
     p    = MPIR_Sendq_head;
     while (p) {
 	MPIR_Sendq_head = p->next;
-	MPIU_Free( p );
+	MPL_free( p );
 	p = MPIR_Sendq_head;
     }
     return 0;
@@ -427,7 +427,7 @@ static void SendqInit( void )
 
     /* Preallocated a few send requests */
     for (i=0; i<10; i++) {
-	p = (MPIR_Sendq *)MPIU_Malloc( sizeof(MPIR_Sendq) );
+	p = (MPIR_Sendq *)MPL_malloc( sizeof(MPIR_Sendq) );
 	if (!p) {
 	    /* Just ignore it */
 	    break;
@@ -504,9 +504,9 @@ static int MPIR_FreeProctable( void *ptable )
     int i;
     MPIR_PROCDESC *proctable = (MPIR_PROCDESC *)ptable;
     for (i=0; i<MPIR_proctable_size; i++) {
-	if (proctable[i].host_name) { MPIU_Free( proctable[i].host_name ); }
+	if (proctable[i].host_name) { MPL_free( proctable[i].host_name ); }
     }
-    MPIU_Free( proctable );
+    MPL_free( proctable );
 
     return 0;
 }
diff --git a/src/mpi/errhan/dynerrutil.c b/src/mpi/errhan/dynerrutil.c
index 1b066b8..a4ed589 100644
--- a/src/mpi/errhan/dynerrutil.c
+++ b/src/mpi/errhan/dynerrutil.c
@@ -139,7 +139,7 @@ int MPIR_Err_set_msg( int code, const char *msg_string )
 
     /* --------------------------------------------------------------------- */
     msg_len = strlen( msg_string );
-    str = (char *)MPIU_Malloc( msg_len + 1 );
+    str = (char *)MPL_malloc( msg_len + 1 );
     /* --BEGIN ERROR HANDLING-- */
     if (!str) {
 	return MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
@@ -154,25 +154,25 @@ int MPIR_Err_set_msg( int code, const char *msg_string )
     if (errcode) {
 	if (errcode < first_free_code) {
 	    if (user_code_msgs[errcode]) {
-		MPIU_Free( (void*)(user_code_msgs[errcode]) );
+		MPL_free( (void*)(user_code_msgs[errcode]) );
 	    }
 	    user_code_msgs[errcode] = (const char *)str;
 	}
 	else {
 	    /* FIXME : Unallocated error code? */
-	    MPIU_Free( str );
+	    MPL_free( str );
 	}
     }
     else {
 	if (errclass < first_free_class) {
 	    if (user_class_msgs[errclass]) {
-		MPIU_Free( (void*)(user_class_msgs[errclass]) );
+		MPL_free( (void*)(user_class_msgs[errclass]) );
 	    }
 	    user_class_msgs[errclass] = (const char *)str;
 	}
 	else {
 	    /* FIXME : Unallocated error code? */
-	    MPIU_Free( str );
+	    MPL_free( str );
 	}
     }
        
@@ -322,12 +322,12 @@ static int MPIR_Dynerrcodes_finalize( void *p ATTRIBUTE((unused)) )
 
         for (i=0; i<first_free_class; i++) {
             if (user_class_msgs[i])
-                MPIU_Free((char *) user_class_msgs[i]);
+                MPL_free((char *) user_class_msgs[i]);
         }
 
         for (i=0; i<first_free_code; i++) {
             if (user_code_msgs[i])
-                MPIU_Free((char *) user_code_msgs[i]);
+                MPL_free((char *) user_code_msgs[i]);
         }
     }
     return 0;
diff --git a/src/mpi/errhan/errnames.txt b/src/mpi/errhan/errnames.txt
index e76d87c..de94a8b 100644
--- a/src/mpi/errhan/errnames.txt
+++ b/src/mpi/errhan/errnames.txt
@@ -560,7 +560,7 @@ is too big (> MPIU_SHMW_GHND_SZ)
 #
 **MPIDI_CH3I_SHM_Attach_to_mem:MPIDI_CH3I_SHM_Attach_to_mem failed
 **MPIDI_CH3I_SHM_Attach_to_mem %d:MPIDI_CH3I_SHM_Attach_to_mem failed, error %d
-**MPIU_Strdup:MPIU_Strdup failed
+**MPL_strdup:MPL_strdup failed
 **business_card:Invalid business card
 **business_card %s:Invalid business card (%s)
 **OpenProcess:OpenProcess failed
diff --git a/src/mpi/errhan/errutil.c b/src/mpi/errhan/errutil.c
index a9a0a52..bc1832d 100644
--- a/src/mpi/errhan/errutil.c
+++ b/src/mpi/errhan/errutil.c
@@ -1564,7 +1564,7 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig,
     MPI_Count c;
     void *p;
 
-    fmt = MPIU_Strdup(fmt_orig);
+    fmt = MPL_strdup(fmt_orig);
     if (fmt == NULL)
     {
 	if (maxlen > 0 && str != NULL)
@@ -1791,7 +1791,7 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig,
 	MPL_strncpy(str, begin, maxlen);
     }
     /* Free the dup'ed format string */
-    MPIU_Free( fmt );
+    MPL_free( fmt );
 
     return mpi_errno;
 }
diff --git a/src/mpi/errhan/windefmsg.h b/src/mpi/errhan/windefmsg.h
index b5c1085..57b2d0f 100644
--- a/src/mpi/errhan/windefmsg.h
+++ b/src/mpi/errhan/windefmsg.h
@@ -24,8 +24,8 @@ static const char short_gen3[] = "**GetMemTwice";
 static const char long_gen3[]  = "Global shared memory initializer called more than once";
 static const char short_gen4[] = "**MPIDI_CH3I_SHM_Attach_to_mem";
 static const char long_gen4[]  = "MPIDI_CH3I_SHM_Attach_to_mem failed";
-static const char short_gen5[] = "**MPIU_Strdup";
-static const char long_gen5[]  = "MPIU_Strdup failed";
+static const char short_gen5[] = "**MPL_strdup";
+static const char long_gen5[]  = "MPL_strdup failed";
 static const char short_gen6[] = "**MapViewOfFileEx";
 static const char long_gen6[]  = "MapViewOfFileEx failed";
 static const char short_gen7[] = "**OpenProcess";
@@ -217,7 +217,7 @@ static const char long_gen99[]  = "[ch3:sock] failed to handle connection accept
 static const char short_gen100[] = "**ch3|sock|scopenresp";
 static const char long_gen100[]  = "[ch3:sock] failed to handle open response packet";
 static const char short_gen101[] = "**ch3|sock|strdup";
-static const char long_gen101[]  = "[ch3:sock] MPIU_Strdup failed";
+static const char long_gen101[]  = "[ch3:sock] MPL_strdup failed";
 static const char short_gen102[] = "**ch3|syncack";
 static const char long_gen102[]  = "failure occurred while attempting to send eager synchronization packet";
 static const char short_gen103[] = "**ch3|unknownpkt";
@@ -1255,7 +1255,7 @@ static const char long_gen618[]  = "unable to bind socket to port";
 static const char short_gen619[] = "**sock|poll|eqfail";
 static const char long_gen619[]  = "fatal error: failed to enqueue an event; event was lost";
 static const char short_gen620[] = "**sock|poll|eqmalloc";
-static const char long_gen620[]  = "MPIU_Malloc failed to allocate memory for an event queue structure";
+static const char long_gen620[]  = "MPL_malloc failed to allocate memory for an event queue structure";
 static const char short_gen621[] = "**sock|poll|listen";
 static const char long_gen621[]  = "listen() failed";
 static const char short_gen622[] = "**sock|poll|nodelay";
diff --git a/src/mpi/group/groupdebug.c b/src/mpi/group/groupdebug.c
index b4bc3b2..3284e57 100644
--- a/src/mpi/group/groupdebug.c
+++ b/src/mpi/group/groupdebug.c
@@ -29,7 +29,7 @@ void MPITEST_Group_create( int nproc, int myrank, MPI_Group *new_group )
 	PMPI_Abort( MPI_COMM_WORLD, 1 );
     }
     MPIU_Object_set_ref( new_group_ptr, 1 );
-    new_group_ptr->lrank_to_lpid = (MPID_Group_pmap_t *)MPIU_Malloc( nproc * sizeof(MPID_Group_pmap_t) );
+    new_group_ptr->lrank_to_lpid = (MPID_Group_pmap_t *)MPL_malloc( nproc * sizeof(MPID_Group_pmap_t) );
     if (!new_group_ptr->lrank_to_lpid) {
 	fprintf( stderr, "Could not create lrank map for new group\n" );
 	PMPI_Abort( MPI_COMM_WORLD, 1 );
diff --git a/src/mpi/group/grouputil.c b/src/mpi/group/grouputil.c
index 34c9d9c..7623a70 100644
--- a/src/mpi/group/grouputil.c
+++ b/src/mpi/group/grouputil.c
@@ -46,7 +46,7 @@ int MPIR_Group_release(MPID_Group *group_ptr)
     MPIR_Group_release_ref(group_ptr, &inuse);
     if (!inuse) {
         /* Only if refcount is 0 do we actually free. */
-        MPIU_Free(group_ptr->lrank_to_lpid);
+        MPL_free(group_ptr->lrank_to_lpid);
         MPIU_Handle_obj_free( &MPID_Group_mem, group_ptr );
     }
     return mpi_errno;
@@ -71,7 +71,7 @@ int MPIR_Group_create( int nproc, MPID_Group **new_group_ptr )
     /* --END ERROR HANDLING-- */
     MPIU_Object_set_ref( *new_group_ptr, 1 );
     (*new_group_ptr)->lrank_to_lpid = 
-	(MPID_Group_pmap_t *)MPIU_Malloc( nproc * sizeof(MPID_Group_pmap_t) );
+	(MPID_Group_pmap_t *)MPL_malloc( nproc * sizeof(MPID_Group_pmap_t) );
     /* --BEGIN ERROR HANDLING-- */
     if (!(*new_group_ptr)->lrank_to_lpid) {
 	MPIU_Handle_obj_free( &MPID_Group_mem, *new_group_ptr );
diff --git a/src/mpi/info/info_delete.c b/src/mpi/info/info_delete.c
index a7a8ed1..b2fde73 100644
--- a/src/mpi/info/info_delete.c
+++ b/src/mpi/info/info_delete.c
@@ -98,8 +98,8 @@ int MPI_Info_delete( MPI_Info info, const char *key )
 
     while (curr_ptr) {
 	if (!strncmp(curr_ptr->key, key, MPI_MAX_INFO_KEY)) {
-	    MPIU_Free(curr_ptr->key);   
-	    MPIU_Free(curr_ptr->value);
+	    MPL_free(curr_ptr->key);
+	    MPL_free(curr_ptr->value);
 	    prev_ptr->next = curr_ptr->next;
 	    MPIU_Handle_obj_free( &MPID_Info_mem, curr_ptr );
 	    break;
diff --git a/src/mpi/info/info_dup.c b/src/mpi/info/info_dup.c
index 6ff8479..3e92ef1 100644
--- a/src/mpi/info/info_dup.c
+++ b/src/mpi/info/info_dup.c
@@ -56,8 +56,8 @@ int MPIR_Info_dup_impl(MPID_Info *info_ptr, MPID_Info **new_info_ptr)
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         curr_new         = curr_new->next;
-        curr_new->key    = MPIU_Strdup(curr_old->key);
-        curr_new->value  = MPIU_Strdup(curr_old->value);
+        curr_new->key    = MPL_strdup(curr_old->key);
+        curr_new->value  = MPL_strdup(curr_old->value);
 
         curr_old         = curr_old->next;
     }
diff --git a/src/mpi/info/info_set.c b/src/mpi/info/info_set.c
index 0e839de..2b28d62 100644
--- a/src/mpi/info/info_set.c
+++ b/src/mpi/info/info_set.c
@@ -144,8 +144,8 @@ int MPIR_Info_set_impl(MPID_Info *info_ptr, const char *key, const char *value)
     while (curr_ptr) {
         if (!strncmp(curr_ptr->key, key, MPI_MAX_INFO_KEY)) {
             /* Key already present; replace value */
-            MPIU_Free(curr_ptr->value);
-            curr_ptr->value = MPIU_Strdup(value);
+            MPL_free(curr_ptr->value);
+            curr_ptr->value = MPL_strdup(value);
             break;
         }
         prev_ptr = curr_ptr;
@@ -159,8 +159,8 @@ int MPIR_Info_set_impl(MPID_Info *info_ptr, const char *key, const char *value)
 
         /*printf( "Inserting new elm %x at %x\n", curr_ptr->id, prev_ptr->id );*/
         prev_ptr->next   = curr_ptr;
-        curr_ptr->key    = MPIU_Strdup(key);
-        curr_ptr->value  = MPIU_Strdup(value);
+        curr_ptr->key    = MPL_strdup(key);
+        curr_ptr->value  = MPL_strdup(value);
     }
 
 fn_exit:
diff --git a/src/mpi/info/infoutil.c b/src/mpi/info/infoutil.c
index 9c3df05..52d92b1 100644
--- a/src/mpi/info/infoutil.c
+++ b/src/mpi/info/infoutil.c
@@ -39,8 +39,8 @@ void MPIU_Info_free( MPID_Info *info_ptr )
     /* printf( "Returning info %x\n", info_ptr->id ); */
     /* First, free the string storage */
     while (curr_ptr) {
-	MPIU_Free(curr_ptr->key);
-	MPIU_Free(curr_ptr->value);
+	MPL_free(curr_ptr->key);
+	MPL_free(curr_ptr->value);
 	last_ptr = curr_ptr;
 	curr_ptr = curr_ptr->next;
         MPIU_Handle_obj_free(&MPID_Info_mem, last_ptr);
diff --git a/src/mpi/pt2pt/ibsend.c b/src/mpi/pt2pt/ibsend.c
index 478f106..e29644d 100644
--- a/src/mpi/pt2pt/ibsend.c
+++ b/src/mpi/pt2pt/ibsend.c
@@ -46,7 +46,7 @@ PMPI_LOCAL int MPIR_Ibsend_free( void *extra )
 {
     ibsend_req_info *ibsend_info = (ibsend_req_info *)extra;
 
-    MPIU_Free( ibsend_info );
+    MPL_free( ibsend_info );
 
     return MPI_SUCCESS;
 }
@@ -108,7 +108,7 @@ int MPIR_Ibsend_impl(const void *buf, int count, MPI_Datatype datatype, int dest
     MPIR_SENDQ_REMEMBER(request_ptr, dest, tag, comm_ptr->context_id);
 
     /* FIXME: use the memory management macros */
-    ibinfo = (ibsend_req_info *)MPIU_Malloc( sizeof(ibsend_req_info) );
+    ibinfo = (ibsend_req_info *)MPL_malloc( sizeof(ibsend_req_info) );
     ibinfo->req       = request_ptr;
     ibinfo->cancelled = 0;
     mpi_errno = MPIR_Grequest_start_impl( MPIR_Ibsend_query, MPIR_Ibsend_free,
diff --git a/src/mpi/topo/dist_gr_create.c b/src/mpi/topo/dist_gr_create.c
index ec5de8b..1b0eba0 100644
--- a/src/mpi/topo/dist_gr_create.c
+++ b/src/mpi/topo/dist_gr_create.c
@@ -207,10 +207,10 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
     for (i = 0; i < comm_size; ++i) {
         /* can't use CHKLMEM macros b/c we are in a loop */
         if (rin_sizes[i]) {
-            rin[i] = MPIU_Malloc(rin_sizes[i] * sizeof(int));
+            rin[i] = MPL_malloc(rin_sizes[i] * sizeof(int));
         }
         if (rout_sizes[i]) {
-            rout[i] = MPIU_Malloc(rout_sizes[i] * sizeof(int));
+            rout[i] = MPL_malloc(rout_sizes[i] * sizeof(int));
         }
     }
 
@@ -300,13 +300,13 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
 
     /* can't use CHKPMEM macros for this b/c we need to realloc */
     in_capacity = 10; /* arbitrary */
-    dist_graph_ptr->in = MPIU_Malloc(in_capacity*sizeof(int));
+    dist_graph_ptr->in = MPL_malloc(in_capacity*sizeof(int));
     if (dist_graph_ptr->is_weighted)
-        dist_graph_ptr->in_weights = MPIU_Malloc(in_capacity*sizeof(int));
+        dist_graph_ptr->in_weights = MPL_malloc(in_capacity*sizeof(int));
     out_capacity = 10; /* arbitrary */
-    dist_graph_ptr->out = MPIU_Malloc(out_capacity*sizeof(int));
+    dist_graph_ptr->out = MPL_malloc(out_capacity*sizeof(int));
     if (dist_graph_ptr->is_weighted)
-        dist_graph_ptr->out_weights = MPIU_Malloc(out_capacity*sizeof(int));
+        dist_graph_ptr->out_weights = MPL_malloc(out_capacity*sizeof(int));
 
     for (i = 0; i < in_out_peers[0]; ++i) {
         MPI_Status status;
@@ -319,7 +319,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
         /* 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));
+        buf = MPL_malloc(count*sizeof(int));
         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);
@@ -340,7 +340,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
             if (dist_graph_ptr->is_weighted)
                 dist_graph_ptr->in_weights[deg] = buf[2*j+1];
         }
-        MPIU_Free(buf);
+        MPL_free(buf);
     }
 
     for (i = 0; i < in_out_peers[1]; ++i) {
@@ -353,7 +353,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
         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));
+        buf = MPL_malloc(count*sizeof(int));
         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);
@@ -374,7 +374,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
             if (dist_graph_ptr->is_weighted)
                 dist_graph_ptr->out_weights[deg] = buf[2*j+1];
         }
-        MPIU_Free(buf);
+        MPL_free(buf);
     }
 
     mpi_errno = MPIC_Waitall(idx, reqs, MPI_STATUSES_IGNORE, &errflag);
@@ -400,9 +400,9 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
   fn_exit:
     for (i = 0; i < comm_size; ++i) {
         if (rin[i])
-            MPIU_Free(rin[i]);
+            MPL_free(rin[i]);
         if (rout[i])
-            MPIU_Free(rout[i]);
+            MPL_free(rout[i]);
     }
 
     MPIU_CHKLMEM_FREEALL();
@@ -414,13 +414,13 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
     /* --BEGIN ERROR HANDLING-- */
   fn_fail:
     if (dist_graph_ptr && dist_graph_ptr->in)
-        MPIU_Free(dist_graph_ptr->in);
+        MPL_free(dist_graph_ptr->in);
     if (dist_graph_ptr && dist_graph_ptr->in_weights)
-        MPIU_Free(dist_graph_ptr->in_weights);
+        MPL_free(dist_graph_ptr->in_weights);
     if (dist_graph_ptr && dist_graph_ptr->out)
-        MPIU_Free(dist_graph_ptr->out);
+        MPL_free(dist_graph_ptr->out);
     if (dist_graph_ptr && dist_graph_ptr->out_weights)
-        MPIU_Free(dist_graph_ptr->out_weights);
+        MPL_free(dist_graph_ptr->out_weights);
     MPIU_CHKPMEM_REAP();
 #ifdef HAVE_ERROR_CHECKING
     mpi_errno = MPIR_Err_create_code(
diff --git a/src/mpi/topo/topoutil.c b/src/mpi/topo/topoutil.c
index 6f446c6..e97c11a 100644
--- a/src/mpi/topo/topoutil.c
+++ b/src/mpi/topo/topoutil.c
@@ -102,7 +102,7 @@ static int *MPIR_Copy_array( int n, const int a[], int *err )
         return NULL;
     }
 
-    new_p = (int *)MPIU_Malloc( n * sizeof(int) );
+    new_p = (int *)MPL_malloc( n * sizeof(int) );
 
     /* --BEGIN ERROR HANDLING-- */
     if (!new_p) {
@@ -217,24 +217,24 @@ static int MPIR_Topology_delete_fn ( MPI_Comm comm ATTRIBUTE((unused)),
     /* FIXME - free the attribute data structure */
     
     if (topology->kind == MPI_CART) {
-	MPIU_Free( topology->topo.cart.dims );
-	MPIU_Free( topology->topo.cart.periodic );
-	MPIU_Free( topology->topo.cart.position );
-	MPIU_Free( topology );
+	MPL_free( topology->topo.cart.dims );
+	MPL_free( topology->topo.cart.periodic );
+	MPL_free( topology->topo.cart.position );
+	MPL_free( topology );
     }
     else if (topology->kind == MPI_GRAPH) {
-	MPIU_Free( topology->topo.graph.index );
-	MPIU_Free( topology->topo.graph.edges );
-	MPIU_Free( topology );
+	MPL_free( topology->topo.graph.index );
+	MPL_free( topology->topo.graph.edges );
+	MPL_free( topology );
     }
     else if (topology->kind == MPI_DIST_GRAPH) {
-        MPIU_Free(topology->topo.dist_graph.in);
-        MPIU_Free(topology->topo.dist_graph.out);
+        MPL_free(topology->topo.dist_graph.in);
+        MPL_free(topology->topo.dist_graph.out);
         if (topology->topo.dist_graph.in_weights)
-            MPIU_Free(topology->topo.dist_graph.in_weights);
+            MPL_free(topology->topo.dist_graph.in_weights);
         if (topology->topo.dist_graph.out_weights)
-            MPIU_Free(topology->topo.dist_graph.out_weights);
-        MPIU_Free(topology );
+            MPL_free(topology->topo.dist_graph.out_weights);
+        MPL_free(topology );
     }
     /* --BEGIN ERROR HANDLING-- */
     else {
diff --git a/src/mpi_t/cvar_handle_free.c b/src/mpi_t/cvar_handle_free.c
index da2544f..9d240ed 100644
--- a/src/mpi_t/cvar_handle_free.c
+++ b/src/mpi_t/cvar_handle_free.c
@@ -66,7 +66,7 @@ int MPI_T_cvar_handle_free(MPI_T_cvar_handle *handle)
     /* ... body of routine ...  */
 
     hnd = *handle;
-    MPIU_Free(hnd);
+    MPL_free(hnd);
     *handle = MPI_T_CVAR_HANDLE_NULL;
 
     /* ... end of body of routine ... */
diff --git a/src/mpi_t/mpit.c b/src/mpi_t/mpit.c
index d814f34..0ade54a 100644
--- a/src/mpi_t/mpit.c
+++ b/src/mpi_t/mpit.c
@@ -39,7 +39,7 @@ void MPIR_T_enum_create(const char *enum_name, MPI_T_enum *handle)
 
     utarray_extend_back(enum_table);
     e = (MPIR_T_enum_t *)utarray_back(enum_table);
-    e->name = MPIU_Strdup(enum_name);
+    e->name = MPL_strdup(enum_name);
     MPIU_Assert(e->name);
 #ifdef HAVE_ERROR_CHECKING
     e->kind = MPIR_T_ENUM_HANDLE;
@@ -62,7 +62,7 @@ void MPIR_T_enum_add_item(MPI_T_enum handle, const char *item_name, int item_val
 
     utarray_extend_back(handle->items);
     item = (enum_item_t *)utarray_back(handle->items);
-    item->name = MPIU_Strdup(item_name);
+    item->name = MPL_strdup(item_name);
     MPIU_Assert(item->name);
     item->value = item_value;
 }
@@ -81,7 +81,7 @@ static cat_table_entry_t *MPIR_T_cat_create(const char *cat_name)
     /* New a category */
     utarray_extend_back(cat_table);
     cat =(cat_table_entry_t *)utarray_back(cat_table);
-    cat->name = MPIU_Strdup(cat_name);
+    cat->name = MPL_strdup(cat_name);
     cat->desc = NULL;
     utarray_new(cat->cvar_indices, &ut_int_icd);
     utarray_new(cat->pvar_indices, &ut_int_icd);
@@ -89,7 +89,7 @@ static cat_table_entry_t *MPIR_T_cat_create(const char *cat_name)
 
     /* Record <cat_name, cat_idx> in cat_hash */
     cat_idx = utarray_len(cat_table) - 1;
-    hash_entry = MPIU_Malloc(sizeof(name2index_hash_t));
+    hash_entry = MPL_malloc(sizeof(name2index_hash_t));
     MPIU_Assert(hash_entry);
     /* Need not to Strdup cat_name, since cat_table and cat_hash co-exist */
     hash_entry->name = cat_name;
@@ -251,12 +251,12 @@ int MPIR_T_cat_add_desc(const char *cat_name, const char *cat_desc)
         cat_idx = hash_entry->idx;
         cat = (cat_table_entry_t *)utarray_eltptr(cat_table, cat_idx);
         MPIU_Assert(cat->desc == NULL);
-        cat->desc = MPIU_Strdup(cat_desc);
+        cat->desc = MPL_strdup(cat_desc);
         MPIU_Assert(cat->desc);
     } else {
         /* Not found, so create a new category */
         cat = MPIR_T_cat_create(cat_name);
-        cat->desc = MPIU_Strdup(cat_desc);
+        cat->desc = MPL_strdup(cat_desc);
         MPIU_Assert(cat->desc);
         /* Notify categories have been changed */
         cat_stamp++;
@@ -313,12 +313,12 @@ void MPIR_T_CVAR_REGISTER_impl(
         cvar = (cvar_table_entry_t *)utarray_back(cvar_table);
         cvar->active = TRUE;
         cvar->datatype = dtype;
-        cvar->name = MPIU_Strdup(name);
+        cvar->name = MPL_strdup(name);
         MPIU_Assert(cvar->name);
         if (dtype != MPI_CHAR) {
             cvar->addr = (void *)addr;
         } else {
-            cvar->addr = MPIU_Malloc(count);
+            cvar->addr = MPL_malloc(count);
             MPIU_Assert(cvar->addr);
             if (defaultval.str == NULL) {
                 ((char *)(cvar->addr))[0] = '\0';
@@ -335,12 +335,12 @@ void MPIR_T_CVAR_REGISTER_impl(
         cvar->get_addr = get_addr;
         cvar->get_count = get_count;
         cvar->defaultval = defaultval;
-        cvar->desc = MPIU_Strdup(desc);
+        cvar->desc = MPL_strdup(desc);
         MPIU_Assert(cvar->desc);
 
         /* Record <name, index> in hash table */
         cvar_idx = utarray_len(cvar_table) - 1;
-        hash_entry = MPIU_Malloc(sizeof(name2index_hash_t));
+        hash_entry = MPL_malloc(sizeof(name2index_hash_t));
         MPIU_Assert(hash_entry);
         /* Need not to Strdup name, since cvar_table and cvar_hash co-exist */
         hash_entry->name =name;
@@ -400,7 +400,7 @@ void MPIR_T_PVAR_REGISTER_impl(
         pvar->active = TRUE;
         pvar->varclass = varclass;
         pvar->datatype = dtype;
-        pvar->name = MPIU_Strdup(name);
+        pvar->name = MPL_strdup(name);
         MPIU_Assert(pvar->name);
         pvar->addr = addr;
         pvar->count = count;
@@ -410,12 +410,12 @@ void MPIR_T_PVAR_REGISTER_impl(
         pvar->flags = flags;
         pvar->get_value = get_value;
         pvar->get_count = get_count;
-        pvar->desc = MPIU_Strdup(desc);
+        pvar->desc = MPL_strdup(desc);
         MPIU_Assert(pvar->desc);
 
         /* Record <name, index> in hash table */
         pvar_idx = utarray_len(pvar_table) - 1;
-        hash_entry = MPIU_Malloc(sizeof(name2index_hash_t));
+        hash_entry = MPL_malloc(sizeof(name2index_hash_t));
         MPIU_Assert(hash_entry);
         /* Need not to Strdup name, since pvar_table and pvar_hashs co-exist */
         hash_entry->name = name;
diff --git a/src/mpi_t/mpit_finalize.c b/src/mpi_t/mpit_finalize.c
index 13923e2..dbdfd39 100644
--- a/src/mpi_t/mpit_finalize.c
+++ b/src/mpi_t/mpit_finalize.c
@@ -36,12 +36,12 @@ static void MPIR_T_enum_env_finalize(void)
         /* Free all entries */
         for (i = 0; i < utarray_len(enum_table); i++) {
             e = (MPIR_T_enum_t *)utarray_eltptr(enum_table, i);
-            MPIU_Free((void *)e->name);
+            MPL_free((void *)e->name);
 
             /* Free items in this enum */
             for (j = 0; j < utarray_len(e->items); j++) {
                 item = (enum_item_t *)utarray_eltptr(e->items, j);
-                MPIU_Free((void *)item->name);
+                MPL_free((void *)item->name);
             }
 
             utarray_free(e->items);
@@ -62,8 +62,8 @@ static void MPIR_T_cat_env_finalize(void)
         /* Free all entries */
         for (i = 0; i < utarray_len(cat_table); i++) {
             cat = (cat_table_entry_t *)utarray_eltptr(cat_table, i);
-            MPIU_Free((void *)cat->name);
-            MPIU_Free((void *)cat->desc);
+            MPL_free((void *)cat->name);
+            MPL_free((void *)cat->desc);
             utarray_free(cat->cvar_indices);
             utarray_free(cat->pvar_indices);
             utarray_free(cat->subcat_indices);
@@ -79,7 +79,7 @@ static void MPIR_T_cat_env_finalize(void)
         /* Free all entries */
         HASH_ITER(hh, cat_hash, current, tmp) {
             HASH_DEL(cat_hash, current);
-            MPIU_Free(current);
+            MPL_free(current);
         }
 
         /* Free cat_hash itself */
@@ -100,9 +100,9 @@ static void MPIR_T_cvar_env_finalize(void)
         /* Free all entries */
         for (i = 0; i < utarray_len(cvar_table); i++) {
             cvar = (cvar_table_entry_t *)utarray_eltptr(cvar_table, i);
-            MPIU_Free((void *)cvar->name);
-            MPIU_Free((void *)cvar->desc);
-            if (cvar->datatype == MPI_CHAR) MPIU_Free(cvar->addr);
+            MPL_free((void *)cvar->name);
+            MPL_free((void *)cvar->desc);
+            if (cvar->datatype == MPI_CHAR) MPL_free(cvar->addr);
         }
 
         /* Free pvar_table itself */
@@ -115,7 +115,7 @@ static void MPIR_T_cvar_env_finalize(void)
         /* Free all entries */
         HASH_ITER(hh, cvar_hash, current, tmp) {
             HASH_DEL(cvar_hash, current);
-            MPIU_Free(current);
+            MPL_free(current);
         }
 
         /* Free cvar_hash itself */
@@ -133,8 +133,8 @@ static void MPIR_T_pvar_env_finalize(void)
         /* Free all entries */
         for (i = 0; i < utarray_len(pvar_table); i++) {
             pvar = (pvar_table_entry_t *)utarray_eltptr(pvar_table, i);
-            MPIU_Free((void *)pvar->name);
-            MPIU_Free((void *)pvar->desc);
+            MPL_free((void *)pvar->name);
+            MPL_free((void *)pvar->desc);
         }
 
         /* Free pvar_table itself */
@@ -148,7 +148,7 @@ static void MPIR_T_pvar_env_finalize(void)
             /* Free all entries */
             HASH_ITER(hh, pvar_hashs[i], current, tmp) {
                 HASH_DEL(pvar_hashs[i], current);
-                MPIU_Free(current);
+                MPL_free(current);
             }
 
             /* Free pvar_hashs[i] itself */
diff --git a/src/mpi_t/pvar_handle_free.c b/src/mpi_t/pvar_handle_free.c
index e75d470..ced8761 100644
--- a/src/mpi_t/pvar_handle_free.c
+++ b/src/mpi_t/pvar_handle_free.c
@@ -59,7 +59,7 @@ int MPIR_T_pvar_handle_free_impl(MPI_T_pvar_session session, MPI_T_pvar_handle *
         }
     }
 
-    MPIU_Free(hnd);
+    MPL_free(hnd);
     *handle = MPI_T_PVAR_HANDLE_NULL;
 
 fn_exit:
diff --git a/src/mpi_t/pvar_session_free.c b/src/mpi_t/pvar_session_free.c
index 4f68b9f..51a93c5 100644
--- a/src/mpi_t/pvar_session_free.c
+++ b/src/mpi_t/pvar_session_free.c
@@ -44,9 +44,9 @@ int MPIR_T_pvar_session_free_impl(MPI_T_pvar_session *session)
      * view.*/
     MPL_DL_FOREACH_SAFE((*session)->hlist, hnd, tmp) {
         MPL_DL_DELETE((*session)->hlist, hnd);
-        MPIU_Free(hnd);
+        MPL_free(hnd);
     }
-    MPIU_Free(*session);
+    MPL_free(*session);
     *session = MPI_T_PVAR_SESSION_NULL;
 
 fn_exit:
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 37a4920..6e4a55c 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
@@ -250,7 +250,7 @@ static inline void MPIDI_CH3I_SHM_Wins_unlink(MPIDI_SHM_Wins_list_t * list, MPID
     if (elem != NULL) {
         tmp_elem = elem;
         MPL_DL_DELETE(*list, elem);
-        MPIU_Free(tmp_elem);
+        MPL_free(tmp_elem);
     }
 }
 
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 12d31b1..73ae1b6 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
@@ -110,13 +110,13 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
                 MPID_Datatype_is_contig(sreq->dev.datatype, &is_contig);
                 if (!is_contig && REQ_FIELD(sreq, pack_buf)) {
                     dprintf("llc_send_handler,non-contiguous,free pack_buf\n");
-                    MPIU_Free(REQ_FIELD(sreq, pack_buf));
+                    MPL_free(REQ_FIELD(sreq, pack_buf));
                 }
             }
 
             if ((REQ_FIELD(sreq, rma_buf) != NULL && sreq->dev.datatype_ptr &&
                  sreq->dev.segment_size > 0)) {
-                MPIU_Free(REQ_FIELD(sreq, rma_buf));    // allocated in MPID_nem_llc_SendNoncontig
+                MPL_free(REQ_FIELD(sreq, rma_buf));    // allocated in MPID_nem_llc_SendNoncontig
                 REQ_FIELD(sreq, rma_buf) = NULL;
             }
 
@@ -264,7 +264,7 @@ int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
         write_to_buf = (void *) ((char *) req->dev.user_buf + dt_true_lb);
     }
     else {
-        REQ_FIELD(req, pack_buf) = MPIU_Malloc(data_sz);
+        REQ_FIELD(req, pack_buf) = MPL_malloc(data_sz);
         MPIR_ERR_CHKANDJUMP(!REQ_FIELD(req, pack_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
         write_to_buf = REQ_FIELD(req, pack_buf);
     }
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 d9c11ba..be4d818 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
@@ -178,7 +178,7 @@ int MPID_nem_llc_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
         req->status.MPI_TAG = probe.tag & 0xffffffff;
         req->dev.recv_data_sz = probe.len;
         MPIR_STATUS_SET_COUNT(req->status, req->dev.recv_data_sz);
-        req->dev.tmpbuf = MPIU_Malloc(req->dev.recv_data_sz);
+        req->dev.tmpbuf = MPL_malloc(req->dev.recv_data_sz);
         MPIU_Assert(req->dev.tmpbuf);
 
         /* receive message in req->dev.tmpbuf */
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 3f2893f..5991a2a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
@@ -129,7 +129,7 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
         MPIDI_msg_sz_t segment_size = data_sz;
         MPIDI_msg_sz_t last = segment_size;
         MPIU_Assert(last > 0);
-        REQ_FIELD(sreq, pack_buf) = MPIU_Malloc((size_t) data_sz);
+        REQ_FIELD(sreq, pack_buf) = MPL_malloc((size_t) data_sz);
         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);
@@ -363,7 +363,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);
+        REQ_FIELD(sreq, rma_buf) = MPL_malloc((size_t) sreq->dev.segment_size);
         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));
@@ -547,14 +547,14 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
             }
 #ifdef	notdef_hsiz_hack
             if (bsiz > 0) {
-                buff = MPIU_Malloc(bsiz + sizeof(MPID_nem_llc_netmod_hdr_t));
+                buff = MPL_malloc(bsiz + sizeof(MPID_nem_llc_netmod_hdr_t));
                 if (buff == 0) {
                     nw = -1;    /* ENOMEM */
                     goto bad;
                 }
             }
 #else /* notdef_hsiz_hack */
-            buff = MPIU_Malloc(bsiz + sizeof(MPID_nem_llc_netmod_hdr_t));
+            buff = MPL_malloc(bsiz + sizeof(MPID_nem_llc_netmod_hdr_t));
             if (buff == 0) {
                 nw = -1;        /* ENOMEM */
                 goto bad;
@@ -565,7 +565,7 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
         lcmd = LLC_cmd_alloc2(1, 1, 1);
         if (lcmd == 0) {
             if (buff != 0) {
-                MPIU_Free(buff);
+                MPL_free(buff);
                 buff = 0;
             }
             nw = -1;    /* ENOMEM */
@@ -645,7 +645,7 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
             }
             else {
                 if (lcmd->iov_local[0].addr != 0) {
-                    MPIU_Free((void *) lcmd->iov_local[0].addr);
+                    MPL_free((void *) lcmd->iov_local[0].addr);
                     lcmd->iov_local[0].addr = 0;
                 }
                 (void) LLC_cmd_free(lcmd, 1);
@@ -767,7 +767,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
                 (*sfnc) (vp_sreq, &reqid);
 
                 if (lcmd->iov_local[0].addr != 0) {
-                    MPIU_Free((void *) lcmd->iov_local[0].addr);
+                    MPL_free((void *) lcmd->iov_local[0].addr);
                     lcmd->iov_local[0].addr = 0;
                 }
                 llc_errno = LLC_cmd_free(lcmd, 1);
@@ -849,7 +849,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
                         }
                         dprintf("llc_poll,ref_count=%d,pack_buf=%p\n", req->ref_count,
                                 REQ_FIELD(req, pack_buf));
-                        MPIU_Free(REQ_FIELD(req, pack_buf));
+                        MPL_free(REQ_FIELD(req, pack_buf));
                     }
 
                     req->status.MPI_TAG = events[0].side.initiator.tag & 0xffffffff;;
@@ -908,7 +908,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
                     MPID_Request_complete(req);
 
                     if (lcmd->iov_local[0].addr != 0) {
-                        MPIU_Free((void *) lcmd->iov_local[0].addr);
+                        MPL_free((void *) lcmd->iov_local[0].addr);
                         lcmd->iov_local[0].addr = 0;
                     }
                 }
@@ -1050,7 +1050,7 @@ int MPID_nem_llc_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
         MPIDI_msg_sz_t segment_size = data_sz;
         MPIDI_msg_sz_t last = segment_size;
         MPIU_Assert(last > 0);
-        REQ_FIELD(sreq, pack_buf) = MPIU_Malloc((size_t) data_sz);
+        REQ_FIELD(sreq, pack_buf) = MPL_malloc((size_t) data_sz);
         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);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
index 6e6bece..dd5dcb1 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
@@ -235,7 +235,7 @@ static inline void list_grow_mxm_req(list_head_t * list_head)
     int count = MXM_MPICH_MAX_REQ;
 
     while (count--) {
-        mxm_req = (MPID_nem_mxm_req_t *) MPIU_Malloc(sizeof(MPID_nem_mxm_req_t));
+        mxm_req = (MPID_nem_mxm_req_t *) MPL_malloc(sizeof(MPID_nem_mxm_req_t));
         list_enqueue(list_head, &mxm_req->queue);
     }
 }
@@ -376,7 +376,7 @@ static inline void _dbg_mxm_hexdump(void *ptr, int buflen)
         return;
 
     len = 80 * (buflen / 16 + 1);
-    str = (char *) MPIU_Malloc(len);
+    str = (char *) MPL_malloc(len);
     for (i = 0; i < buflen; i += 16) {
         cur_len += MPL_snprintf(str + cur_len, len - cur_len, "%06x: ", i);
         for (j = 0; j < 16; j++)
@@ -393,7 +393,7 @@ static inline void _dbg_mxm_hexdump(void *ptr, int buflen)
         cur_len += MPL_snprintf(str + cur_len, len - cur_len, "\n");
     }
     _dbg_mxm_out(8, NULL, 1, NULL, NULL, -1, "%s", str);
-    MPIU_Free(str);
+    MPL_free(str);
 }
 
 static inline char *_tag_val_to_str(int tag, char *out, int max)
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 e7fc2e1..6cbd25c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
@@ -291,7 +291,7 @@ int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc)
             MPIR_ERR_POP(mpi_errno);
 #endif
 
-        business_card = (char *) MPIU_Malloc(val_max_sz);
+        business_card = (char *) MPL_malloc(val_max_sz);
         mpi_errno = vc->pg->getConnInfo(vc->pg_rank, business_card, val_max_sz, vc->pg);
         if (mpi_errno)
             MPIR_ERR_POP(mpi_errno);
@@ -302,7 +302,7 @@ int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc)
         if (mpi_errno)
             MPIR_ERR_POP(mpi_errno);
 
-        MPIU_Free(business_card);
+        MPL_free(business_card);
     }
 
     MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
@@ -420,9 +420,9 @@ static int _mxm_conf(void)
 
     _mxm_obj.compiletime_version = MXM_VERNO_STRING;
 #if MXM_API >= MXM_VERSION(3,0)
-    _mxm_obj.runtime_version = MPIU_Strdup(mxm_get_version_string());
+    _mxm_obj.runtime_version = MPL_strdup(mxm_get_version_string());
 #else
-    _mxm_obj.runtime_version = MPIU_Malloc(sizeof(MXM_VERNO_STRING) + 10);
+    _mxm_obj.runtime_version = MPL_malloc(sizeof(MXM_VERNO_STRING) + 10);
     snprintf(_mxm_obj.runtime_version, (sizeof(MXM_VERNO_STRING) + 9),
              "%ld.%ld", (cur_ver >> MXM_MAJOR_BIT) & 0xff, (cur_ver >> MXM_MINOR_BIT) & 0xff);
 #endif
@@ -492,7 +492,7 @@ static int _mxm_init(int rank, int size)
     _mxm_obj.mxm_rank = rank;
     _mxm_obj.mxm_np = size;
     _mxm_obj.endpoint =
-        (MPID_nem_mxm_ep_t *) MPIU_Malloc(_mxm_obj.mxm_np * sizeof(MPID_nem_mxm_ep_t));
+        (MPID_nem_mxm_ep_t *) MPL_malloc(_mxm_obj.mxm_np * sizeof(MPID_nem_mxm_ep_t));
     memset(_mxm_obj.endpoint, 0, _mxm_obj.mxm_np * sizeof(MPID_nem_mxm_ep_t));
 
     list_init(&_mxm_obj.free_queue);
@@ -516,7 +516,7 @@ static int _mxm_fini(void)
     if (_mxm_obj.mxm_context) {
 
         while (!list_is_empty(&_mxm_obj.free_queue)) {
-            MPIU_Free(list_dequeue(&_mxm_obj.free_queue));
+            MPL_free(list_dequeue(&_mxm_obj.free_queue));
         }
 
 #if MXM_API >= MXM_VERSION(3,1)
@@ -530,7 +530,7 @@ static int _mxm_fini(void)
         }
 
         if (_mxm_obj.endpoint)
-            MPIU_Free(_mxm_obj.endpoint);
+            MPL_free(_mxm_obj.endpoint);
 
         _mxm_barrier();
 
@@ -546,7 +546,7 @@ static int _mxm_fini(void)
         mxm_config_free_ep_opts(_mxm_obj.mxm_ep_opts);
         mxm_config_free_context_opts(_mxm_obj.mxm_ctx_opts);
 
-        MPIU_Free(_mxm_obj.runtime_version);
+        MPL_free(_mxm_obj.runtime_version);
     }
 
   fn_exit:
@@ -620,7 +620,7 @@ static int _mxm_disconnect(MPID_nem_mxm_ep_t * ep)
                              "**mxm_ep_disconnect %s", mxm_error_string(ret));
 
         while (!list_is_empty(&ep->free_queue)) {
-            MPIU_Free(list_dequeue(&ep->free_queue));
+            MPL_free(list_dequeue(&ep->free_queue));
         }
     }
 
@@ -680,7 +680,7 @@ static int _mxm_del_comm(MPID_Comm * comm, void *param)
     if (mxm_mq[0])
         mxm_mq_destroy(mxm_mq[0]);
 
-    MPIU_Free(mxm_mq);
+    MPL_free(mxm_mq);
 
     comm->dev.ch.netmod_priv = NULL;
 
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 c69c5bb..9848062 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
@@ -303,7 +303,7 @@ static int _mxm_handle_rreq(MPID_Request * req)
             n_iov = req_area->iov_count;
             iov_buf = req_area->iov_buf;
             if (last && n_iov > 0) {
-                iov = MPIU_Malloc(n_iov * sizeof(*iov));
+                iov = MPL_malloc(n_iov * sizeof(*iov));
                 MPIU_Assert(iov);
 
                 for (index = 0; index < n_iov; index++) {
@@ -313,7 +313,7 @@ static int _mxm_handle_rreq(MPID_Request * req)
 
                 MPID_Segment_unpack_vector(req->dev.segment_ptr, req->dev.segment_first, &last, iov,
                                            &n_iov);
-                MPIU_Free(iov);
+                MPL_free(iov);
             }
             if (req_area->iov_count > MXM_MPICH_MAX_IOV) {
                 tmp_buf = req_area->iov_buf;
@@ -337,7 +337,7 @@ static int _mxm_handle_rreq(MPID_Request * req)
     MPIU_Assert(complete == TRUE);
 
     if (tmp_buf)
-        MPIU_Free(tmp_buf);
+        MPL_free(tmp_buf);
 
     return complete;
 }
@@ -460,7 +460,7 @@ static int _mxm_process_rdtype(MPID_Request ** rreq_p, MPI_Datatype datatype,
     MPID_Segment_count_contig_blocks(rreq->dev.segment_ptr, rreq->dev.segment_first, &last,
                                      (MPI_Aint *) & n_iov);
     MPIU_Assert(n_iov > 0);
-    iov = MPIU_Malloc(n_iov * sizeof(*iov));
+    iov = MPL_malloc(n_iov * sizeof(*iov));
     MPIU_Assert(iov);
 
     last = rreq->dev.segment_size;
@@ -478,7 +478,7 @@ static int _mxm_process_rdtype(MPID_Request ** rreq_p, MPI_Datatype datatype,
 
     if (n_iov <= MXM_REQ_DATA_MAX_IOV) {
         if (n_iov > MXM_MPICH_MAX_IOV) {
-            *iov_buf = (mxm_req_buffer_t *) MPIU_Malloc(n_iov * sizeof(**iov_buf));
+            *iov_buf = (mxm_req_buffer_t *) MPL_malloc(n_iov * sizeof(**iov_buf));
             MPIU_Assert(*iov_buf);
         }
 
@@ -493,14 +493,14 @@ static int _mxm_process_rdtype(MPID_Request ** rreq_p, MPI_Datatype datatype,
     else {
         MPI_Aint packsize = 0;
         MPIR_Pack_size_impl(rreq->dev.user_count, rreq->dev.datatype, &packsize);
-        rreq->dev.tmpbuf = MPIU_Malloc((size_t) packsize);
+        rreq->dev.tmpbuf = MPL_malloc((size_t) packsize);
         MPIU_Assert(rreq->dev.tmpbuf);
         rreq->dev.tmpbuf_sz = packsize;
         (*iov_buf)[0].ptr = rreq->dev.tmpbuf;
         (*iov_buf)[0].length = (size_t) packsize;
         *iov_count = 1;
     }
-    MPIU_Free(iov);
+    MPL_free(iov);
 
   fn_exit:
     return mpi_errno;
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 332b2fb..fc164e5 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
@@ -150,7 +150,7 @@ int MPID_nem_mxm_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
         req->status.MPI_SOURCE = mxm_req.completion.sender_imm;
         req->dev.recv_data_sz = mxm_req.completion.sender_len;
         MPIR_STATUS_SET_COUNT(req->status, req->dev.recv_data_sz);
-        req->dev.tmpbuf = MPIU_Malloc(req->dev.recv_data_sz);
+        req->dev.tmpbuf = MPL_malloc(req->dev.recv_data_sz);
         MPIU_Assert(req->dev.tmpbuf);
 
         mxm_req.base.completed_cb = NULL;
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 7359225..cf815cf 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
@@ -209,7 +209,7 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     MPIU_Assert(last > 0 && last - sreq->dev.segment_first > 0);
 
     if (last > 0) {
-        sreq->dev.tmpbuf = MPIU_Malloc((size_t) (sreq->dev.segment_size - sreq->dev.segment_first));
+        sreq->dev.tmpbuf = MPL_malloc((size_t) (sreq->dev.segment_size - sreq->dev.segment_first));
         MPIU_Assert(sreq->dev.tmpbuf);
         MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, &last, sreq->dev.tmpbuf);
         MPIU_Assert(last == sreq->dev.segment_size);
@@ -306,7 +306,7 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Data
 
             last = data_sz;
             if (packsize > 0) {
-                sreq->dev.tmpbuf = MPIU_Malloc((size_t) packsize);
+                sreq->dev.tmpbuf = MPL_malloc((size_t) packsize);
                 MPIU_Assert(sreq->dev.tmpbuf);
                 MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
                 MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
@@ -409,7 +409,7 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
 
             last = data_sz;
             if (packsize > 0) {
-                sreq->dev.tmpbuf = MPIU_Malloc((size_t) packsize);
+                sreq->dev.tmpbuf = MPL_malloc((size_t) packsize);
                 MPIU_Assert(sreq->dev.tmpbuf);
                 MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
                 MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
@@ -512,7 +512,7 @@ int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
 
             last = data_sz;
             if (packsize > 0) {
-                sreq->dev.tmpbuf = MPIU_Malloc((size_t) packsize);
+                sreq->dev.tmpbuf = MPL_malloc((size_t) packsize);
                 MPIU_Assert(sreq->dev.tmpbuf);
                 MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
                 MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
@@ -616,7 +616,7 @@ int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Da
 
             last = data_sz;
             if (packsize > 0) {
-                sreq->dev.tmpbuf = MPIU_Malloc((size_t) packsize);
+                sreq->dev.tmpbuf = MPL_malloc((size_t) packsize);
                 MPIU_Assert(sreq->dev.tmpbuf);
                 MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
                 MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
@@ -663,12 +663,12 @@ int _mxm_handle_sreq(MPID_Request * req)
     vc_area->pending_sends -= 1;
     if (req->dev.tmpbuf) {
         if (req->dev.datatype_ptr || req->ch.noncontig) {
-            MPIU_Free(req->dev.tmpbuf);
+            MPL_free(req->dev.tmpbuf);
         }
     }
 
     if (req_area->iov_count > MXM_MPICH_MAX_IOV) {
-        MPIU_Free(req_area->iov_buf);
+        MPL_free(req_area->iov_buf);
         req_area->iov_buf = req_area->tmp_buf;
         req_area->iov_count = 0;
     }
@@ -810,7 +810,7 @@ static int _mxm_process_sdtype(MPID_Request ** sreq_p, MPI_Datatype datatype,
     MPID_Segment_count_contig_blocks(sreq->dev.segment_ptr, sreq->dev.segment_first, &last,
                                      (MPI_Aint *) & n_iov);
     MPIU_Assert(n_iov > 0);
-    iov = MPIU_Malloc(n_iov * sizeof(*iov));
+    iov = MPL_malloc(n_iov * sizeof(*iov));
     MPIU_Assert(iov);
 
     last = sreq->dev.segment_size;
@@ -827,7 +827,7 @@ static int _mxm_process_sdtype(MPID_Request ** sreq_p, MPI_Datatype datatype,
 #endif
 
     if (n_iov > MXM_MPICH_MAX_IOV) {
-        *iov_buf = (mxm_req_buffer_t *) MPIU_Malloc(n_iov * sizeof(**iov_buf));
+        *iov_buf = (mxm_req_buffer_t *) MPL_malloc(n_iov * sizeof(**iov_buf));
         MPIU_Assert(*iov_buf);
     }
 
@@ -848,7 +848,7 @@ static int _mxm_process_sdtype(MPID_Request ** sreq_p, MPI_Datatype datatype,
     }
     else {
         int offset = 0;
-        sreq->dev.tmpbuf = MPIU_Malloc(size_to_copy);
+        sreq->dev.tmpbuf = MPL_malloc(size_to_copy);
         sreq->dev.tmpbuf_sz = size_to_copy;
         MPIU_Assert(sreq->dev.tmpbuf);
         for (index = (MXM_REQ_DATA_MAX_IOV - 1); index < n_iov; index++) {
@@ -860,7 +860,7 @@ static int _mxm_process_sdtype(MPID_Request ** sreq_p, MPI_Datatype datatype,
         (*iov_buf)[MXM_REQ_DATA_MAX_IOV - 1].length = size_to_copy;
         *iov_count = MXM_REQ_DATA_MAX_IOV;
     }
-    MPIU_Free(iov);
+    MPL_free(iov);
 
   fn_exit:
     return mpi_errno;
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 e129a91..9669fd4 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
@@ -117,10 +117,10 @@ static inline int MPID_nem_ofi_conn_req_callback(cq_tagged_entry_t * wc, MPID_Re
                    GET_RCD_IGNORE_MASK(),
                    (void *) &(REQ_OFI(gl_data.conn_req)->ofi_context)), trecv);
 
-    addr = MPIU_Malloc(gl_data.bound_addrlen);
+    addr = MPL_malloc(gl_data.bound_addrlen);
     MPIU_Assertp(addr);
 
-    vc = MPIU_Malloc(sizeof(MPIDI_VC_t));
+    vc = MPL_malloc(sizeof(MPIDI_VC_t));
     MPIU_Assertp(vc);
 
     MPIDI_VC_Init(vc, NULL, 0);
@@ -140,12 +140,12 @@ static inline int MPID_nem_ofi_conn_req_callback(cq_tagged_entry_t * wc, MPID_Re
     MPIDI_CH3I_Acceptq_enqueue(vc, vc->port_name_tag);
     MPIDI_CH3I_INCR_PROGRESS_COMPLETION_COUNT;
   fn_exit:
-    MPIU_Free(addr);
+    MPL_free(addr);
     END_FUNC(FCNAME);
     return mpi_errno;
   fn_fail:
     if (vc)
-        MPIU_Free(vc);
+        MPL_free(vc);
     goto fn_exit;
 }
 
@@ -169,7 +169,7 @@ static inline int MPID_nem_ofi_handle_packet(cq_tagged_entry_t * wc ATTRIBUTE((u
       vc = REQ_OFI(rreq)->vc;
       MPIU_Assert(vc);
       MPIDI_CH3I_NM_OFI_RC(MPID_nem_handle_pkt(vc, REQ_OFI(rreq)->pack_buffer, REQ_OFI(rreq)->pack_buffer_size));
-      MPIU_Free(REQ_OFI(rreq)->pack_buffer);
+      MPL_free(REQ_OFI(rreq)->pack_buffer);
     }
     MPIDI_CH3I_NM_OFI_RC(MPID_Request_complete(rreq));
     END_FUNC_RC(FCNAME);
@@ -216,7 +216,7 @@ static inline int MPID_nem_ofi_preposted_callback(cq_tagged_entry_t * wc, MPID_R
     VC_READY_CHECK(vc);
 
     pkt_len = REQ_OFI(rreq)->msg_bytes;
-    pack_buffer = (char *) MPIU_Malloc(pkt_len);
+    pack_buffer = (char *) MPL_malloc(pkt_len);
     /* If the pack buffer is NULL, let OFI handle the truncation
      * in the progress loop
      */
@@ -278,7 +278,7 @@ int MPID_nem_ofi_connect_to_root_callback(cq_tagged_entry_t * wc ATTRIBUTE((unus
     BEGIN_FUNC(FCNAME);
 
     if (REQ_OFI(sreq)->pack_buffer)
-        MPIU_Free(REQ_OFI(sreq)->pack_buffer);
+        MPL_free(REQ_OFI(sreq)->pack_buffer);
 
     MPIDI_CH3I_NM_OFI_RC(MPID_Request_complete(sreq));
 
@@ -337,7 +337,7 @@ int MPID_nem_ofi_cm_init(MPIDI_PG_t * pg_p, int pg_rank ATTRIBUTE((unused)))
     /* Post recv for connection requests */
     /* --------------------------------- */
     MPID_nem_ofi_create_req(&conn_req, 1);
-    conn_req->dev.user_buf = MPIU_Malloc(OFI_KVSAPPSTRLEN * sizeof(char));
+    conn_req->dev.user_buf = MPL_malloc(OFI_KVSAPPSTRLEN * sizeof(char));
     conn_req->dev.OnDataAvail = NULL;
     conn_req->dev.next = NULL;
     REQ_OFI(conn_req)->vc = NULL;       /* We don't know the source yet */
@@ -378,7 +378,7 @@ int MPID_nem_ofi_cm_finalize()
     MPIDI_CH3I_NM_OFI_RC(MPID_Request_complete(gl_data.persistent_req));
 
     FI_RC(fi_cancel((fid_t) gl_data.endpoint, &(REQ_OFI(gl_data.conn_req)->ofi_context)), cancel);
-    MPIU_Free(gl_data.conn_req->dev.user_buf);
+    MPL_free(gl_data.conn_req->dev.user_buf);
     MPIR_STATUS_SET_CANCEL_BIT(gl_data.conn_req->status, TRUE);
     MPIR_STATUS_SET_COUNT(gl_data.conn_req->status, 0);
     MPIDI_CH3I_NM_OFI_RC(MPID_Request_complete(gl_data.conn_req));
@@ -400,7 +400,7 @@ int MPID_nem_ofi_vc_connect(MPIDI_VC_t * vc)
     char bc[OFI_KVSAPPSTRLEN], *addr = NULL;
 
     BEGIN_FUNC(FCNAME);
-    addr = MPIU_Malloc(gl_data.bound_addrlen);
+    addr = MPL_malloc(gl_data.bound_addrlen);
     MPIU_Assert(addr);
     MPIU_Assert(1 != VC_OFI(vc)->ready);
 
@@ -418,7 +418,7 @@ int MPID_nem_ofi_vc_connect(MPIDI_VC_t * vc)
 
   fn_exit:
     if (addr)
-        MPIU_Free(addr);
+        MPL_free(addr);
     END_FUNC(FCNAME);
     return mpi_errno;
 
@@ -528,8 +528,8 @@ int MPID_nem_ofi_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
     uint64_t conn_req_send_bits;
 
     BEGIN_FUNC(FCNAME);
-    addr = MPIU_Malloc(gl_data.bound_addrlen);
-    bc = MPIU_Malloc(OFI_KVSAPPSTRLEN);
+    addr = MPL_malloc(gl_data.bound_addrlen);
+    bc = MPL_malloc(OFI_KVSAPPSTRLEN);
     MPIU_Assertp(addr);
     MPIU_Assertp(bc);
     my_bc = bc;
@@ -580,12 +580,12 @@ int MPID_nem_ofi_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
     gl_data.cm_vcs = new_vc;
   fn_exit:
     if (addr)
-        MPIU_Free(addr);
+        MPL_free(addr);
     END_FUNC(FCNAME);
     return mpi_errno;
   fn_fail:
     if (my_bc)
-        MPIU_Free(my_bc);
+        MPL_free(my_bc);
     goto fn_exit;
 }
 
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 058d134..c778af8 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c
@@ -104,7 +104,7 @@ int MPID_nem_ofi_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
     hints->domain_attr->data_progress    = FI_PROGRESS_AUTO;
     char *provname;
     provname                             = MPIR_CVAR_OFI_USE_PROVIDER?
-      MPIU_Strdup(MPIR_CVAR_OFI_USE_PROVIDER):NULL;
+      MPL_strdup(MPIR_CVAR_OFI_USE_PROVIDER):NULL;
     hints->fabric_attr->prov_name        = provname;
     FI_RC(fi_getinfo(fi_version,    /* Interface version requested               */
                      NULL,          /* Optional name or fabric to resolve        */
@@ -197,7 +197,7 @@ int MPID_nem_ofi_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
     /* Free providers info         */
     /* --------------------------- */
     if(provname) {
-      MPIU_Free(provname);
+      MPL_free(provname);
       hints->fabric_attr->prov_name = NULL;
     }
 
@@ -264,7 +264,7 @@ int MPID_nem_ofi_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
     /* The addressing mode is "map", so we must provide     */
     /* storage to store the per destination addresses       */
     /* ---------------------------------------------------- */
-    fi_addrs = MPIU_Malloc(pg_p->size * sizeof(fi_addr_t));
+    fi_addrs = MPL_malloc(pg_p->size * sizeof(fi_addr_t));
     FI_RC(fi_av_insert(gl_data.av, addrs, pg_p->size, fi_addrs, 0ULL, NULL), avmap);
 
     /* ---------------------------------------------------- */
@@ -294,7 +294,7 @@ int MPID_nem_ofi_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
     MPIDI_CH3I_NM_OFI_RC(MPID_nem_ofi_cm_init(pg_p, pg_rank));
   fn_exit:
     if (fi_addrs)
-        MPIU_Free(fi_addrs);
+        MPL_free(fi_addrs);
     MPIU_CHKLMEM_FREEALL();
     END_FUNC(FCNAME);
     return mpi_errno;
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 14a7677..fc64d51 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_msg.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_msg.c
@@ -132,10 +132,10 @@ static int MPID_nem_ofi_data_callback(cq_tagged_entry_t * wc, MPID_Request * sre
          */
         if (MPIR_cc_get(sreq->cc) == 1) {
             if (REQ_OFI(sreq)->pack_buffer)
-                MPIU_Free(REQ_OFI(sreq)->pack_buffer);
+                MPL_free(REQ_OFI(sreq)->pack_buffer);
 
             if (REQ_OFI(sreq)->real_hdr)
-                MPIU_Free(REQ_OFI(sreq)->real_hdr);
+                MPL_free(REQ_OFI(sreq)->real_hdr);
 
             reqFn = sreq->dev.OnDataAvail;
             if (!reqFn) {
@@ -228,7 +228,7 @@ int MPID_nem_ofi_iSendContig(MPIDI_VC_t * vc,
     MPID_nem_ofi_init_req(sreq);
     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);
+      REQ_OFI(sreq)->real_hdr        = MPL_malloc(sizeof(MPIDI_CH3_Pkt_t)+sreq->dev.ext_hdr_sz);
       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;
@@ -243,7 +243,7 @@ int MPID_nem_ofi_iSendContig(MPIDI_VC_t * vc,
                   sreq->dev.ext_hdr_ptr, sreq->dev.ext_hdr_sz);
       }
     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));
+        REQ_OFI(sreq)->real_hdr = MPL_malloc(sizeof(MPIDI_CH3_Pkt_t));
         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);
@@ -254,7 +254,7 @@ int MPID_nem_ofi_iSendContig(MPIDI_VC_t * vc,
         REQ_OFI(sreq)->iov_count       = 2;
     }
     else {
-      pack_buffer = MPIU_Malloc(pkt_len);
+      pack_buffer = MPL_malloc(pkt_len);
       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);
@@ -290,7 +290,7 @@ int MPID_nem_ofi_SendNoncontig(MPIDI_VC_t * vc,
     last = sreq->dev.segment_size;
     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);
+    pack_buffer = MPL_malloc(pkt_len);
     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);
@@ -327,7 +327,7 @@ int MPID_nem_ofi_iStartContigMsg(MPIDI_VC_t * vc,
     sreq->dev.next = NULL;
     pkt_len = sizeof(MPIDI_CH3_Pkt_t) + data_sz;
     if(gl_data.iov_limit > 1) {
-      REQ_OFI(sreq)->real_hdr = MPIU_Malloc(sizeof(MPIDI_CH3_Pkt_t));
+      REQ_OFI(sreq)->real_hdr = MPL_malloc(sizeof(MPIDI_CH3_Pkt_t));
       MPIU_Memcpy(REQ_OFI(sreq)->real_hdr, hdr, hdr_sz);
       REQ_OFI(sreq)->iov[0].iov_base = REQ_OFI(sreq)->real_hdr;
       REQ_OFI(sreq)->iov[0].iov_len  = sizeof(MPIDI_CH3_Pkt_t);
@@ -336,7 +336,7 @@ int MPID_nem_ofi_iStartContigMsg(MPIDI_VC_t * vc,
       REQ_OFI(sreq)->iov_count       = 2;
     }
     else {
-      pack_buffer = MPIU_Malloc(pkt_len);
+      pack_buffer = MPL_malloc(pkt_len);
       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);
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 2fe8a69..1201000 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_progress.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_progress.c
@@ -65,7 +65,7 @@ int MPID_nem_ofi_poll(int in_blocking_poll)
                 reqFn = req->dev.OnDataAvail;
                 if (reqFn) {
                     if (REQ_OFI(req)->pack_buffer) {
-                        MPIU_Free(REQ_OFI(req)->pack_buffer);
+                        MPL_free(REQ_OFI(req)->pack_buffer);
                     }
                     vc = REQ_OFI(req)->vc;
 
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_tagged.c b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_tagged.c
index fe62b02..cd05d03 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_tagged.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_tagged.c
@@ -59,7 +59,7 @@ static inline int MPID_nem_ofi_send_callback(cq_tagged_entry_t * wc ATTRIBUTE((u
     int mpi_errno = MPI_SUCCESS;
     BEGIN_FUNC(FCNAME);
     if (REQ_OFI(sreq)->pack_buffer)
-        MPIU_Free(REQ_OFI(sreq)->pack_buffer);
+        MPL_free(REQ_OFI(sreq)->pack_buffer);
     MPIDI_CH3I_NM_OFI_RC(MPID_Request_complete(sreq));
     END_FUNC_RC(FCNAME);
 }
@@ -125,7 +125,7 @@ int MPID_nem_ofi_anysource_matched(MPID_Request * rreq)
          * to clean up tmp space.
          */
         if (REQ_OFI(rreq)->pack_buffer) {
-            MPIU_Free(REQ_OFI(rreq)->pack_buffer);
+            MPL_free(REQ_OFI(rreq)->pack_buffer);
         }
         matched = FALSE;
     }else{
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 d91aca1..25a6df2 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
@@ -48,7 +48,7 @@ int ADD_SUFFIX(MPID_nem_ofi_recv_callback)(cq_tagged_entry_t * wc, MPID_Request
                                MPI_BYTE, &err0, rreq->dev.user_buf,
                                rreq->dev.user_count, rreq->dev.datatype, &sz, &err1);
         MPIR_STATUS_SET_COUNT(rreq->status, sz);
-        MPIU_Free(REQ_OFI(rreq)->pack_buffer);
+        MPL_free(REQ_OFI(rreq)->pack_buffer);
         if (err0 || err1) {
             rreq->status.MPI_ERROR = MPI_ERR_TYPE;
         }
@@ -150,7 +150,7 @@ ADD_SUFFIX(do_isend)(struct MPIDI_VC *vc,
     MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
     send_buffer = (char *) buf + dt_true_lb;
     if (!dt_contig) {
-        send_buffer = (char *) MPIU_Malloc(data_sz);
+        send_buffer = (char *) MPL_malloc(data_sz);
         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,
@@ -315,7 +315,7 @@ int ADD_SUFFIX(MPID_nem_ofi_recv_posted)(struct MPIDI_VC *vc, struct MPID_Reques
         recv_buffer = (char *) rreq->dev.user_buf + dt_true_lb;
     }
     else {
-        recv_buffer = (char *) MPIU_Malloc(data_sz);
+        recv_buffer = (char *) MPL_malloc(data_sz);
         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_nm.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
index 6fbeae2..fb3ab31 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -53,7 +53,7 @@ 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);
     incr_expected_recv_ptr(REQ_PTL(req)->bytes_put);
     /* Free resources */
-    MPIU_Free(TMPBUF(req));
+    MPL_free(TMPBUF(req));
     MPID_Request_release(req);
     return mpi_errno;
 }
@@ -113,7 +113,7 @@ int MPID_nem_ptl_nm_init(void)
     overflow_me.min_free = PTL_MAX_EAGER;
 
     /* allocate all overflow space at once */
-    tmp_ptr = MPIU_Malloc(NUM_RECV_BUFS * BUFSIZE);
+    tmp_ptr = MPL_malloc(NUM_RECV_BUFS * BUFSIZE);
     expected_recv_ptr = tmp_ptr;
     expected_recv_idx = 0;
 
@@ -178,7 +178,7 @@ int MPID_nem_ptl_nm_finalize(void)
                          MPID_nem_ptl_strerror(ret));
 
     /* Freeing first element because the allocation was a single contiguous buffer */
-    MPIU_Free(recvbufs[0]);
+    MPL_free(recvbufs[0]);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_NM_FINALIZE);
@@ -206,7 +206,7 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
 
     MPIDI_FUNC_ENTER(MPID_STATE_SEND_PKT);
     
-    sendbuf = MPIU_Malloc(sendbuf_sz);
+    sendbuf = MPL_malloc(sendbuf_sz);
     MPIU_Assert(sendbuf != NULL);
     MPIU_Memcpy(sendbuf, hdr_p, sizeof(MPIDI_CH3_Pkt_t));
     sendbuf_ptr = sendbuf + sizeof(MPIDI_CH3_Pkt_t);
@@ -272,7 +272,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
     MPIDI_STATE_DECL(MPID_STATE_SEND_NONCONTIG_PKT);
     MPIDI_FUNC_ENTER(MPID_STATE_SEND_NONCONTIG_PKT);
 
-    sendbuf = MPIU_Malloc(sendbuf_sz);
+    sendbuf = MPL_malloc(sendbuf_sz);
     MPIU_Assert(sendbuf != NULL);
     MPIU_Memcpy(sendbuf, hdr_p, sizeof(MPIDI_CH3_Pkt_t));
     sendbuf_ptr = sendbuf + sizeof(MPIDI_CH3_Pkt_t);
@@ -295,7 +295,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
 
         if (remaining) {  /* Post MEs for the remote gets */
             ptl_size_t *offset = (ptl_size_t *)sendbuf_ptr;
-            TMPBUF(sreq) = MPIU_Malloc(remaining);
+            TMPBUF(sreq) = MPL_malloc(remaining);
             *offset = (ptl_size_t)TMPBUF(sreq);
             first = last;
             last = sreq->dev.segment_size;
@@ -486,7 +486,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                 else {
                     MPID_Request *req = MPID_Request_create();
                     /* This request is actually complete; just needs to wait to enforce ordering */
-                    TMPBUF(req) = MPIU_Malloc(packet_sz);
+                    TMPBUF(req) = MPL_malloc(packet_sz);
                     MPIU_Assert(TMPBUF(req));
                     MPIU_Memcpy(TMPBUF(req), e->start, packet_sz);
                     REQ_PTL(req)->bytes_put = packet_sz;
@@ -506,7 +506,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                 MPIDI_CH3U_Request_decrement_cc(req, &incomplete);  /* We'll increment it below */
                 REQ_PTL(req)->event_handler = MPID_nem_ptl_nm_ctl_event_handler;
                 REQ_PTL(req)->bytes_put = packet_sz + remaining - sizeof(ptl_size_t);
-                TMPBUF(req) = MPIU_Malloc(REQ_PTL(req)->bytes_put);
+                TMPBUF(req) = MPL_malloc(REQ_PTL(req)->bytes_put);
                 MPIU_Assert(TMPBUF(req) != NULL);
                 MPIU_Memcpy(TMPBUF(req), e->start, packet_sz);
                 REQ_PTL(req)->recv_ptr = e->start;
@@ -548,7 +548,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
 
             MPID_Request_get_ptr(handle, req);
             if (--REQ_PTL(req)->num_gets == 0) {
-                MPIU_Free(TMPBUF(req));
+                MPL_free(TMPBUF(req));
                 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) {
@@ -563,7 +563,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
         {
             MPID_Request *const req = e->user_ptr;
 
-            MPIU_Free(SENDBUF(req));
+            MPL_free(SENDBUF(req));
             REQ_PTL(req)->put_done = 1;
             if (REQ_PTL(req)->num_gets == 0) {  /* Otherwise GET will do it */
                 mpi_errno = on_data_avail(req);
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 b90c8cb..8365552 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
@@ -65,7 +65,7 @@ int MPID_nem_ptl_poll_finalize(void)
             ret = PtlMEUnlink(overflow_me_handle[i]);
             MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink", "**ptlmeunlink %s", MPID_nem_ptl_strerror(ret));
         }
-        MPIU_Free(overflow_buf[i]);
+        MPL_free(overflow_buf[i]);
     }
     
  fn_exit:
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 a02f036..a21b89c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
@@ -366,7 +366,7 @@ int MPID_nem_ptl_pkt_cancel_send_req_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pk
 
     /* if the message was found, free the temporary buffer used to copy the data */
     if (REQ_PTL(search_req)->found)
-        MPIU_Free(search_req->dev.tmpbuf);
+        MPL_free(search_req->dev.tmpbuf);
 
     MPID_Request_release(search_req);
     if (resp_req != NULL)
@@ -405,7 +405,7 @@ int MPID_nem_ptl_pkt_cancel_send_resp_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *p
             }
         }
         if (REQ_PTL(sreq)->get_me_p)
-            MPIU_Free(REQ_PTL(sreq)->get_me_p);
+            MPL_free(REQ_PTL(sreq)->get_me_p);
 
         MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"message cancelled");
     } else {
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 6b67920..4623c79 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
@@ -68,7 +68,7 @@ static int handler_recv_complete(const ptl_event_t *e)
 
     for (i = 0; i < MPID_NEM_PTL_NUM_CHUNK_BUFFERS; ++i)
         if (REQ_PTL(rreq)->chunk_buffer[i])
-            MPIU_Free(REQ_PTL(rreq)->chunk_buffer[i]);
+            MPL_free(REQ_PTL(rreq)->chunk_buffer[i]);
     
     mpi_errno = MPID_Request_complete(rreq);
     if (mpi_errno) {
@@ -404,7 +404,7 @@ static int handler_recv_dequeue_unpack_large(const ptl_event_t *e)
     MPID_Segment_unpack(rreq->dev.segment_ptr, rreq->dev.segment_first, &last, buf);
     MPIU_Assert(last == PTL_LARGE_THRESHOLD);
     rreq->dev.segment_first += PTL_LARGE_THRESHOLD;
-    MPIU_Free(REQ_PTL(rreq)->chunk_buffer[0]);
+    MPL_free(REQ_PTL(rreq)->chunk_buffer[0]);
 
     MPIU_CHKPMEM_MALLOC(REQ_PTL(rreq)->chunk_buffer[0], void *, rreq->dev.segment_size - rreq->dev.segment_first,
                         mpi_errno, "chunk_buffer");
@@ -770,7 +770,7 @@ int MPID_nem_ptl_lmt_start_recv(MPIDI_VC_t *vc,  MPID_Request *rreq, MPL_IOV s_c
             big_get(REQ_PTL(rreq)->chunk_buffer[0], rreq->dev.segment_size - rreq->dev.segment_first, vc, match_bits, rreq);
         }
     }
-    MPIU_Free(rreq->dev.tmpbuf);
+    MPL_free(rreq->dev.tmpbuf);
     rreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = 0;  /* Required for do_cts in mpid_nem_lmt.c */
 
  fn_exit:
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 abb5c76..5b82965 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
@@ -30,7 +30,7 @@ static void big_meappend(void *buf, ptl_size_t left_to_send, MPIDI_VC_t *vc, ptl
     me.min_free = 0;
 
     /* allocate enough handles to cover all get operations */
-    REQ_PTL(sreq)->get_me_p = MPIU_Malloc(sizeof(ptl_handle_me_t) *
+    REQ_PTL(sreq)->get_me_p = MPL_malloc(sizeof(ptl_handle_me_t) *
                                         ((left_to_send / MPIDI_nem_ptl_ni_limits.max_msg_size) + 1));
 
     /* queue up as many entries as necessary to describe the entire message */
@@ -78,10 +78,10 @@ static int handler_send(const ptl_event_t *e)
 
         for (i = 0; i < MPID_NEM_PTL_NUM_CHUNK_BUFFERS; ++i)
             if (REQ_PTL(sreq)->chunk_buffer[i])
-                MPIU_Free(REQ_PTL(sreq)->chunk_buffer[i]);
+                MPL_free(REQ_PTL(sreq)->chunk_buffer[i]);
 
         if (REQ_PTL(sreq)->get_me_p)
-            MPIU_Free(REQ_PTL(sreq)->get_me_p);
+            MPL_free(REQ_PTL(sreq)->get_me_p);
     }
     mpi_errno = MPID_Request_complete(sreq);
     if (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 4541275..aee798f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
@@ -781,11 +781,11 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
                 /* discard pending events, since we will retransmit
                  * this op anyway */
                 if (op->u.put.ack) {
-                    MPIU_Free(op->u.put.ack);
+                    MPL_free(op->u.put.ack);
                     op->u.put.ack = NULL;
                 }
                 if (op->u.put.send) {
-                    MPIU_Free(op->u.put.send);
+                    MPL_free(op->u.put.send);
                     op->u.put.send = NULL;
                 }
             }
@@ -829,7 +829,7 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
              * events */
             if (op->u.put.pt_type == RPTL_PT_CONTROL) {
                 /* drop the ack event */
-                MPIU_Free(op->u.put.ack);
+                MPL_free(op->u.put.ack);
                 MPL_DL_DELETE(op->target->control_op_list, op);
                 rptli_op_free(op);
 
@@ -847,7 +847,7 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
                     memcpy(&pending_event, op->u.put.ack, sizeof(ptl_event_t));
                     pending_event_valid = 1;
                 }
-                MPIU_Free(op->u.put.ack);
+                MPL_free(op->u.put.ack);
                 MPL_DL_DELETE(op->target->data_op_list, op);
                 rptli_op_free(op);
             }
@@ -866,7 +866,7 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
              * events */
             if (op->u.put.pt_type == RPTL_PT_CONTROL) {
                 /* drop the send event */
-                MPIU_Free(op->u.put.send);
+                MPL_free(op->u.put.send);
                 MPL_DL_DELETE(op->target->control_op_list, op);
                 rptli_op_free(op);
 
@@ -882,7 +882,7 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
                     /* user asked for an ACK, so return it to the user
                      * and queue up the SEND event for next time */
                     memcpy(&pending_event, op->u.put.send, sizeof(ptl_event_t));
-                    MPIU_Free(op->u.put.send);
+                    MPL_free(op->u.put.send);
                     assert(pending_event_valid == 0);
                     pending_event_valid = 1;
                 }
@@ -890,7 +890,7 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
                     /* user didn't ask for an ACK, overwrite the ACK
                      * event with the pending send event */
                     memcpy(event, op->u.put.send, sizeof(ptl_event_t));
-                    MPIU_Free(op->u.put.send);
+                    MPL_free(op->u.put.send);
 
                     /* set the event user pointer again, since we
                      * copied over the original event */
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 8b875fe..cf76678 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_init.c
@@ -116,11 +116,11 @@ int MPID_nem_ptl_rptl_drain_eq(int eq_count, ptl_handle_eq_t *eq)
         while (target->op_segment_list) {
             op_segment = target->op_segment_list;
             MPL_DL_DELETE(target->op_segment_list, op_segment);
-            MPIU_Free(op_segment);
+            MPL_free(op_segment);
         }
 
         t = target->next;
-        MPIU_Free(target);
+        MPL_free(target);
         target = t;
     }
 
@@ -224,11 +224,11 @@ int MPID_nem_ptl_rptl_ptfini(ptl_pt_index_t pt_index)
             ret = PtlMEUnlink(rptl->control.me[i]);
             RPTLU_ERR_POP(ret, "Error unlinking control buffers\n");
         }
-        MPIU_Free(rptl->control.me);
+        MPL_free(rptl->control.me);
     }
 
     MPL_DL_DELETE(rptl_info.rptl_list, rptl);
-    MPIU_Free(rptl);
+    MPL_free(rptl);
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_RPTL_PTFINI);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
index daa6193..8300fe5 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
@@ -201,8 +201,8 @@ static int free_sc_plfd_tbls (void)
 {
     int mpi_errno = MPI_SUCCESS;
 
-    MPIU_Free(g_sc_tbl);
-    MPIU_Free(MPID_nem_tcp_plfd_tbl);
+    MPL_free(g_sc_tbl);
+    MPL_free(MPID_nem_tcp_plfd_tbl);
     return mpi_errno;
 }
 
@@ -253,8 +253,8 @@ static int expand_sc_plfd_tbls (void)
         }
     }
 
-    MPIU_Free(g_sc_tbl);
-    MPIU_Free(MPID_nem_tcp_plfd_tbl);
+    MPL_free(g_sc_tbl);
+    MPL_free(MPID_nem_tcp_plfd_tbl);
     g_sc_tbl = new_sc_tbl;
     MPID_nem_tcp_plfd_tbl = new_plfd_tbl;
     for (i = g_tbl_capacity; i < new_capacity; i++) {
@@ -312,7 +312,7 @@ static int find_free_entry(int *idx)
     if (!Q_EMPTY(freeq)) {
         Q_DEQUEUE(&freeq, ((freenode_t **)&node)); 
         *idx = node->index;
-        MPIU_Free(node);
+        MPL_free(node);
         goto fn_exit;
     }
 
@@ -1761,12 +1761,12 @@ int MPID_nem_tcp_sm_finalize(void)
     /* walk the freeq and free all the elements */
     while (!Q_EMPTY(freeq)) {
         Q_DEQUEUE(&freeq, ((freenode_t **)&node)); 
-        MPIU_Free(node);
+        MPL_free(node);
     }
 
     free_sc_plfd_tbls();
 
-    MPIU_Free(recv_buf);
+    MPL_free(recv_buf);
 
     return MPI_SUCCESS;
 }
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 89f3d3f..f3464fc 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_getip.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_getip.c
@@ -102,7 +102,7 @@ int MPIDI_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found )
 	struct ifconf			ifconf;
 	int				rc;
 
-	buf_ptr = (char *) MPIU_Malloc(buf_len);
+	buf_ptr = (char *) MPL_malloc(buf_len);
 	if (buf_ptr == NULL) {
 	    MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d", buf_len);
 	}
@@ -125,7 +125,7 @@ int MPIDI_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found )
 	    buf_len_prev = ifconf.ifc_len;
 	}
 	
-	MPIU_Free(buf_ptr);
+	MPL_free(buf_ptr);
 	buf_len += NUM_IFREQS * sizeof(struct ifreq);
     }
 
@@ -212,7 +212,7 @@ int MPIDI_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found )
 
 fn_exit:
     if (NULL != buf_ptr)
-        MPIU_Free(buf_ptr);
+        MPL_free(buf_ptr);
     if (fd >= 0)
         close(fd);
     
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 d3f5199..62b18fe 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
@@ -248,7 +248,7 @@ static int ckpt_restart(void)
     /* publish business card */
     mpi_errno = MPIDI_PG_SetConnInfo(MPIDI_Process.my_pg_rank, (const char *)publish_bc_orig);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
-    MPIU_Free(publish_bc_orig);
+    MPL_free(publish_bc_orig);
 
     for (i = 0; i < MPIDI_Process.my_pg->size; ++i) {
         MPIDI_VC_t *vc;
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 4be687e..84f475c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
@@ -194,7 +194,7 @@ int MPID_nem_tcp_send_finalize(void)
     {
         MPID_nem_tcp_send_q_element_t *e;
         S_POP (&free_buffers, &e);
-        MPIU_Free (e);
+        MPL_free (e);
     }
     return mpi_errno;
 }
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_init.c b/src/mpid/ch3/channels/nemesis/src/ch3_init.c
index 7a51a40..6a8e393 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_init.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_init.c
@@ -357,7 +357,7 @@ int MPIDI_CH3_InitCompleted(void)
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         ep_tmp = ep;
         ep = ep->next;
-        MPIU_Free(ep_tmp);
+        MPL_free(ep_tmp);
     }
 
  fn_exit:
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
index a8ca2b4..a7c403a 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
@@ -122,7 +122,7 @@ static int check_terminating_vcs(void)
         MPID_Request_release(ep->req);
         mpi_errno = shm_connection_terminated(ep->vc);
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
-        MPIU_Free(ep);
+        MPL_free(ep);
     }
     
  fn_exit:
@@ -1017,7 +1017,7 @@ int MPIDI_CH3I_Progress_finalize(void)
 
     while(qn_head) {
         ent = qn_head->next;
-        MPIU_Free(qn_head);
+        MPL_free(qn_head);
         qn_head = ent;
     }
 
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 8d03bd2..ee4cb25 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_rma_shm.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_rma_shm.c
@@ -89,7 +89,7 @@ int MPIDI_CH3_SHM_Win_free(MPID_Win ** win_ptr)
     /* Free shared memory region */
     if ((*win_ptr)->shm_allocated) {
         /* free shm_base_addrs that's only used for shared memory windows */
-        MPIU_Free((*win_ptr)->shm_base_addrs);
+        MPL_free((*win_ptr)->shm_base_addrs);
 
         /* Only allocate and allocate_shared allocate new shared segments */
         if (((*win_ptr)->create_flavor == MPI_WIN_FLAVOR_SHARED ||
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c b/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c
index a76bd91..aec3780 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c
@@ -106,7 +106,7 @@ int MPIDI_CH3I_comm_destroy(MPID_Comm *comm, void *param)
         --cf->ref_count;
         if (cf->ref_count == 0) {
             utarray_erase(coll_fns_array, utarray_eltidx(coll_fns_array, cf), 1);
-            MPIU_Free(cf);
+            MPL_free(cf);
         }
             
         if (comm->dev.ch.barrier_vars && OPA_fetch_and_decr_int(&comm->dev.ch.barrier_vars->usage_cnt) == 1) {
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 ae85cb1..ae1b927 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_alloc.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_alloc.c
@@ -419,7 +419,7 @@ int MPIDI_CH3I_Seg_commit(MPID_nem_seg_ptr_t memory, int num_local, int local_ra
         size_left -= ep->len;
         current_addr = (char *)current_addr + ep->len;
 
-        MPIU_Free(ep);
+        MPL_free(ep);
 
         MPIU_Assert((char *)current_addr <= (char *)start_addr + segment_len);
     }
@@ -455,7 +455,7 @@ int MPIDI_CH3I_Seg_destroy(void)
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEG_DESTROY);
 
     if (MPID_nem_mem_region.num_local == 1)
-        MPIU_Free(MPID_nem_mem_region.memory.base_addr);
+        MPL_free(MPID_nem_mem_region.memory.base_addr);
     else
     {
         mpi_errno = MPIU_SHMW_Seg_detach(MPID_nem_mem_region.memory.hnd, 
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 94332d1..055c01b 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_ckpt.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_ckpt.c
@@ -243,9 +243,9 @@ static int reinit_pmi(void)
     ret = PMI_KVS_Get_name_length_max(&pg_id_sz);
     CHECK_ERR(ret, "pmi_get_id_length_max");
     
-    MPIU_Free(MPIDI_Process.my_pg->id);
+    MPL_free(MPIDI_Process.my_pg->id);
    
-    MPIDI_Process.my_pg->id = MPIU_Malloc(pg_id_sz + 1);
+    MPIDI_Process.my_pg->id = MPL_malloc(pg_id_sz + 1);
     CHECK_ERR(MPIDI_Process.my_pg->id == NULL, "malloc failed");
 
     ret = PMI_KVS_Get_my_name(MPIDI_Process.my_pg->id, pg_id_sz);
@@ -255,9 +255,9 @@ static int reinit_pmi(void)
     ret = PMI_KVS_Get_name_length_max(&kvs_name_sz);
     CHECK_ERR(ret, "PMI_KVS_Get_name_length_max");
     
-    MPIU_Free(MPIDI_Process.my_pg->connData);
+    MPL_free(MPIDI_Process.my_pg->connData);
    
-    MPIDI_Process.my_pg->connData = MPIU_Malloc(kvs_name_sz + 1);
+    MPIDI_Process.my_pg->connData = MPL_malloc(kvs_name_sz + 1);
     CHECK_ERR(MPIDI_Process.my_pg->connData == NULL, "malloc failed");
 
     ret = PMI_KVS_Get_my_name(MPIDI_Process.my_pg->connData, kvs_name_sz);
@@ -294,7 +294,7 @@ static int restore_env(pid_t parent_pid, int rank)
         /* remove newline */
         if (var_val[len-1] == '\n')
             var_val[len-1] = '\0';
-        ret = MPL_putenv(MPIU_Strdup(var_val));
+        ret = MPL_putenv(MPL_strdup(var_val));
         CHECK_ERR(ret != 0, MPIU_Strerror (errno));
     }
 
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 24575ff..51e0f6e 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_finalize.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_finalize.c
@@ -27,23 +27,23 @@ int MPID_nem_finalize(void)
 /*     MPIU_Assert(MPID_nem_queue_empty( MPID_nem_mem_region.RecvQ[MPID_nem_mem_region.rank])); */
 
     /* these are allocated in MPID_nem_mpich_init, not MPID_nem_init */
-    MPIU_Free(MPID_nem_recv_seqno);
-    MPIU_Free(MPID_nem_fboxq_elem_list);
+    MPL_free(MPID_nem_recv_seqno);
+    MPL_free(MPID_nem_fboxq_elem_list);
 
     /* from MPID_nem_init */
-    MPIU_Free(MPID_nem_mem_region.FreeQ);
-    MPIU_Free(MPID_nem_mem_region.RecvQ);
-    MPIU_Free(MPID_nem_mem_region.local_ranks);
+    MPL_free(MPID_nem_mem_region.FreeQ);
+    MPL_free(MPID_nem_mem_region.RecvQ);
+    MPL_free(MPID_nem_mem_region.local_ranks);
     if (MPID_nem_mem_region.ext_procs > 0)
-        MPIU_Free(MPID_nem_mem_region.ext_ranks);
-    MPIU_Free(MPID_nem_mem_region.seg);
-    MPIU_Free(MPID_nem_mem_region.mailboxes.out);
-    MPIU_Free(MPID_nem_mem_region.mailboxes.in);
+        MPL_free(MPID_nem_mem_region.ext_ranks);
+    MPL_free(MPID_nem_mem_region.seg);
+    MPL_free(MPID_nem_mem_region.mailboxes.out);
+    MPL_free(MPID_nem_mem_region.mailboxes.in);
 
-    MPIU_Free(MPID_nem_mem_region.local_procs);
+    MPL_free(MPID_nem_mem_region.local_procs);
 
 #ifdef MEM_REGION_IN_HEAP
-    MPIU_Free(MPID_nem_mem_region_ptr);
+    MPL_free(MPID_nem_mem_region_ptr);
 #endif /* MEM_REGION_IN_HEAP */
 
     mpi_errno = MPID_nem_netmod_func->finalize();
@@ -58,7 +58,7 @@ int MPID_nem_finalize(void)
 #endif /*PAPI_MONITOR */
     
     if (ENABLE_PVAR_NEM) {
-        MPIU_Free(MPID_nem_fbox_fall_back_to_queue_count);
+        MPL_free(MPID_nem_fbox_fall_back_to_queue_count);
     }
 
  fn_exit:
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 7452c04..504e124 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
@@ -80,7 +80,7 @@ static int MPID_nem_init_stats(int n_local_ranks)
     int mpi_errno = MPI_SUCCESS;
 
     if (ENABLE_PVAR_NEM) {
-        MPID_nem_fbox_fall_back_to_queue_count = MPIU_Calloc(n_local_ranks, sizeof(unsigned long long));
+        MPID_nem_fbox_fall_back_to_queue_count = MPL_calloc(n_local_ranks, sizeof(unsigned long long));
     }
 
     MPIR_T_PVAR_COUNTER_REGISTER_DYNAMIC(
@@ -391,7 +391,7 @@ 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) MPIR_ERR_POP(mpi_errno);
-    MPIU_Free(publish_bc_orig);
+    MPL_free(publish_bc_orig);
 
 
     mpi_errno = MPID_nem_barrier();
@@ -620,7 +620,7 @@ MPID_nem_vc_destroy(MPIDI_VC_t *vc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_VC_DESTROY);
 
-    MPIU_Free(vc_ch->pending_pkt);
+    MPL_free(vc_ch->pending_pkt);
 
     mpi_errno = MPID_nem_netmod_func->vc_destroy(vc);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
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 c0525f6..bdacac4 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
@@ -564,7 +564,7 @@ static int do_cts(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
     /* free cookie buffer allocated in RTS handler */
     if (rreq->ch.lmt_tmp_cookie.MPL_IOV_LEN)
     {
-        MPIU_Free(rreq->ch.lmt_tmp_cookie.MPL_IOV_BUF);
+        MPL_free(rreq->ch.lmt_tmp_cookie.MPL_IOV_BUF);
         rreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = 0;
     }
 
@@ -598,7 +598,7 @@ static int do_send(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
     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);
+    MPL_free(sreq->ch.lmt_tmp_cookie.MPL_IOV_BUF);
     sreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = 0;
 
     *complete = TRUE;
@@ -631,7 +631,7 @@ static int do_cookie(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
     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);
+    MPL_free(req->ch.lmt_tmp_cookie.MPL_IOV_BUF);
     req->ch.lmt_tmp_cookie.MPL_IOV_LEN = 0;
 
     *complete = TRUE;
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 b3dee42..e22a137 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
@@ -443,7 +443,7 @@ int MPID_nem_lmt_dma_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV s_co
 
     /* XXX DJG FIXME this looks like it always pushes! */
     /* push request if not complete for progress checks later */
-    node = MPIU_Malloc(sizeof(struct lmt_dma_node));
+    node = MPL_malloc(sizeof(struct lmt_dma_node));
     node->vc = vc;
     node->req = rreq;
     node->status_p = status;
@@ -472,7 +472,7 @@ int MPID_nem_lmt_dma_done_send(MPIDI_VC_t *vc, MPID_Request *sreq)
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LMT_DMA_DONE_SEND);
 
     /* free cookie from RTS packet */
-    MPIU_Free(sreq->ch.s_cookie);
+    MPL_free(sreq->ch.s_cookie);
 
     /* We shouldn't ever need to handle the more IOVs case here.  The DONE
        message should only be sent when all of the data is truly transferred.
@@ -607,7 +607,7 @@ int MPID_nem_lmt_dma_progress(void)
                         free_me = cur;
                         cur = cur->next;
                     }
-                    if (free_me) MPIU_Free(free_me);
+                    if (free_me) MPL_free(free_me);
                     --MPID_nem_local_lmt_pending;
                     continue;
                 }
@@ -634,7 +634,7 @@ int MPID_nem_lmt_dma_progress(void)
                     cur = cur->next;
                 }
 
-                if (free_me) MPIU_Free(free_me);
+                if (free_me) MPL_free(free_me);
                 --MPID_nem_local_lmt_pending;
                 continue;
                 
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 d1d91e1..68beb93 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
@@ -742,7 +742,7 @@ static inline int lmt_shm_progress_vc(MPIDI_VC_t *vc, int *done)
 
     if (done_req)
     {
-        MPIU_Free(vc_ch->lmt_active_lmt);
+        MPL_free(vc_ch->lmt_active_lmt);
         vc_ch->lmt_active_lmt = NULL;
 
         if (LMT_SHM_Q_EMPTY(vc_ch->lmt_queue))
@@ -788,7 +788,7 @@ int MPID_nem_lmt_shm_progress(void)
             f = pe;
             pe = pe->next;
             LMT_SHM_L_REMOVE(f);
-            MPIU_Free(f);
+            MPL_free(f);
         }
         else
             pe = pe->next;
@@ -842,7 +842,7 @@ int MPID_nem_lmt_shm_vc_terminated(MPIDI_VC_t *vc)
         MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Clearing active LMT");
         vc_ch->lmt_active_lmt->req->status.MPI_ERROR = req_errno;
         MPID_Request_complete(vc_ch->lmt_active_lmt->req);
-        MPIU_Free(vc_ch->lmt_active_lmt);
+        MPL_free(vc_ch->lmt_active_lmt);
         vc_ch->lmt_active_lmt = NULL;
     }
 
@@ -854,7 +854,7 @@ int MPID_nem_lmt_shm_vc_terminated(MPIDI_VC_t *vc)
         LMT_SHM_Q_DEQUEUE(&vc_ch->lmt_queue, &we);
         we->req->status.MPI_ERROR = req_errno;
         MPID_Request_complete(we->req);
-        MPIU_Free(we);
+        MPL_free(we);
     }
 
  fn_exit:
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 70b07e7..78138ef 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
@@ -195,7 +195,7 @@ int MPID_nem_lmt_vmsplice_initiate_lmt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPI
         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);
+        vc_ch->lmt_copy_buf_handle = MPL_strdup(pipe_name);
         /* XXX DJG hack */
 #undef free
         free(pipe_name);
@@ -269,7 +269,7 @@ int MPID_nem_lmt_vmsplice_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV
 
     if (vc_ch->lmt_recv_copy_buf_handle == NULL) {
         MPIU_Assert(s_cookie.MPL_IOV_BUF != NULL);
-        vc_ch->lmt_recv_copy_buf_handle = MPIU_Strdup(s_cookie.MPL_IOV_BUF);
+        vc_ch->lmt_recv_copy_buf_handle = MPL_strdup(s_cookie.MPL_IOV_BUF);
     }
 
     /* XXX DJG FIXME in a real version we would want to cache the fd on the vc
@@ -288,7 +288,7 @@ int MPID_nem_lmt_vmsplice_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV
 
     /* push request if not complete for progress checks later */
     if (!complete) {
-        node = MPIU_Malloc(sizeof(struct lmt_vmsplice_node));
+        node = MPL_malloc(sizeof(struct lmt_vmsplice_node));
         node->pipe_fd = pipe_fd;
         node->req = rreq;
         node->next = outstanding_head;
@@ -355,7 +355,7 @@ int MPID_nem_lmt_vmsplice_progress(void)
                 free_me = cur;
                 cur = cur->next;
             }
-            if (free_me) MPIU_Free(free_me);
+            if (free_me) MPL_free(free_me);
             --MPID_nem_local_lmt_pending;
         }
 
@@ -408,7 +408,7 @@ int MPID_nem_lmt_vmsplice_start_send(MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV
 
     if (!complete) {
         /* push for later progress */
-        node = MPIU_Malloc(sizeof(struct lmt_vmsplice_node));
+        node = MPL_malloc(sizeof(struct lmt_vmsplice_node));
         node->pipe_fd = pipe_fd;
         node->req = sreq;
         node->next = outstanding_head;
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 4d83682..9451e72 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
@@ -63,8 +63,8 @@ MPID_nem_mpich_free_win (MPID_nem_mpich_win_t *win)
     mpi_errno = MPID_nem_detach_shared_memory (win->home_address, win->len);
     if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 
-    MPIU_Free (win->handle);
-    MPIU_Free (win);
+    MPL_free (win->handle);
+    MPL_free (win);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_MPICH_FREE_WIN);
diff --git a/src/mpid/ch3/channels/sock/src/ch3_init.c b/src/mpid/ch3/channels/sock/src/ch3_init.c
index e03bf0f..c0b0f6c 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_init.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_init.c
@@ -58,7 +58,7 @@ int MPIDI_CH3_Init(int has_parent, MPIDI_PG_t * pg_p, int pg_rank )
     return mpi_errno;
  fn_fail:
     if (publish_bc_orig != NULL) {
-        MPIU_Free(publish_bc_orig);
+        MPL_free(publish_bc_orig);
     }           
     goto fn_exit;
 }
diff --git a/src/mpid/ch3/include/mpid_rma_issue.h b/src/mpid/ch3/include/mpid_rma_issue.h
index 82ddee4..8c056d5 100644
--- a/src/mpid/ch3/include/mpid_rma_issue.h
+++ b/src/mpid/ch3/include/mpid_rma_issue.h
@@ -118,7 +118,7 @@ static int init_accum_ext_pkt(MPIDI_CH3_Pkt_flags_t flags,
         _ext_hdr_sz = sizeof(MPIDI_CH3_Ext_pkt_accum_stream_derived_t);
         _total_sz = _ext_hdr_sz + target_dtp->dataloop_size;
 
-        _ext_hdr_ptr = (MPIDI_CH3_Ext_pkt_accum_stream_derived_t *) MPIU_Malloc(_total_sz);
+        _ext_hdr_ptr = (MPIDI_CH3_Ext_pkt_accum_stream_derived_t *) MPL_malloc(_total_sz);
         if (_ext_hdr_ptr == NULL) {
             MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_stream_derived_t");
@@ -136,7 +136,7 @@ static int init_accum_ext_pkt(MPIDI_CH3_Pkt_flags_t flags,
 
         _total_sz = sizeof(MPIDI_CH3_Ext_pkt_accum_stream_t);
 
-        _ext_hdr_ptr = (MPIDI_CH3_Ext_pkt_accum_stream_t *) MPIU_Malloc(_total_sz);
+        _ext_hdr_ptr = (MPIDI_CH3_Ext_pkt_accum_stream_t *) MPL_malloc(_total_sz);
         if (_ext_hdr_ptr == NULL) {
             MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_stream_t");
@@ -153,7 +153,7 @@ static int init_accum_ext_pkt(MPIDI_CH3_Pkt_flags_t flags,
         _ext_hdr_sz = sizeof(MPIDI_CH3_Ext_pkt_accum_derived_t);
         _total_sz = _ext_hdr_sz + target_dtp->dataloop_size;
 
-        _ext_hdr_ptr = (MPIDI_CH3_Ext_pkt_accum_derived_t *) MPIU_Malloc(_total_sz);
+        _ext_hdr_ptr = (MPIDI_CH3_Ext_pkt_accum_derived_t *) MPL_malloc(_total_sz);
         if (_ext_hdr_ptr == NULL) {
             MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_derived_t");
@@ -172,7 +172,7 @@ static int init_accum_ext_pkt(MPIDI_CH3_Pkt_flags_t flags,
     return mpi_errno;
   fn_fail:
     if ((*ext_hdr_ptr))
-        MPIU_Free((*ext_hdr_ptr));
+        MPL_free((*ext_hdr_ptr));
     (*ext_hdr_ptr) = NULL;
     (*ext_hdr_sz) = 0;
     goto fn_exit;
@@ -377,7 +377,7 @@ static int issue_from_origin_buffer(MPIDI_RMA_Op_t * rma_op, MPIDI_VC_t * vc,
         if (req->dev.datatype_ptr)
             MPID_Datatype_release(req->dev.datatype_ptr);
         if (req->dev.ext_hdr_ptr)
-            MPIU_Free(req->dev.ext_hdr_ptr);
+            MPL_free(req->dev.ext_hdr_ptr);
         MPID_Request_release(req);
     }
 
@@ -432,7 +432,7 @@ static int issue_put_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
             /* dataloop is behind of extended header on origin.
              * TODO: support extended header array */
             ext_hdr_sz = sizeof(MPIDI_CH3_Ext_pkt_put_derived_t) + target_dtp_ptr->dataloop_size;
-            ext_hdr_ptr = MPIU_Malloc(ext_hdr_sz);
+            ext_hdr_ptr = MPL_malloc(ext_hdr_sz);
             if (!ext_hdr_ptr) {
                 MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                      "**nomem %s", "MPIDI_CH3_Ext_pkt_put_derived_t");
@@ -589,7 +589,7 @@ static int issue_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
 
                 if (stream_unit_count > 1) {
                     rma_op->multi_reqs =
-                        (MPID_Request **) MPIU_Malloc(sizeof(MPID_Request *) * rma_op->reqs_size);
+                        (MPID_Request **) MPL_malloc(sizeof(MPID_Request *) * rma_op->reqs_size);
                     for (i = 0; i < rma_op->reqs_size; i++)
                         rma_op->multi_reqs[i] = NULL;
                 }
@@ -626,7 +626,7 @@ static int issue_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
     }
     else if (rma_op->reqs_size > 1) {
         if (rma_op->multi_reqs != NULL) {
-            MPIU_Free(rma_op->multi_reqs);
+            MPL_free(rma_op->multi_reqs);
             rma_op->multi_reqs = NULL;
         }
     }
@@ -737,7 +737,7 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
 
     if (rma_op->reqs_size > 1) {
         rma_op->multi_reqs =
-            (MPID_Request **) MPIU_Malloc(sizeof(MPID_Request *) * rma_op->reqs_size);
+            (MPID_Request **) MPL_malloc(sizeof(MPID_Request *) * rma_op->reqs_size);
         for (i = 0; i < rma_op->reqs_size; i++)
             rma_op->multi_reqs[i] = NULL;
     }
@@ -858,7 +858,7 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
                 MPID_Request_release(rma_op->multi_reqs[i]);
             }
         }
-        MPIU_Free(rma_op->multi_reqs);
+        MPL_free(rma_op->multi_reqs);
         rma_op->multi_reqs = NULL;
     }
     rma_op->reqs_size = 0;
@@ -937,7 +937,7 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
          * dataloop is behind of extended header on origin.
          * TODO: support extended header array */
         ext_hdr_sz = sizeof(MPIDI_CH3_Ext_pkt_get_derived_t) + dtp->dataloop_size;
-        ext_hdr_ptr = MPIU_Malloc(ext_hdr_sz);
+        ext_hdr_ptr = MPL_malloc(ext_hdr_sz);
         if (!ext_hdr_ptr) {
             MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_get_derived_t");
@@ -967,7 +967,7 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
             req->dev.ext_hdr_ptr = ext_hdr_ptr;
         }
         else {
-            MPIU_Free(ext_hdr_ptr);
+            MPL_free(ext_hdr_ptr);
         }
     }
 
diff --git a/src/mpid/ch3/include/mpid_rma_lockqueue.h b/src/mpid/ch3/include/mpid_rma_lockqueue.h
index 057b2b9..2fa6f3b 100644
--- a/src/mpid/ch3/include/mpid_rma_lockqueue.h
+++ b/src/mpid/ch3/include/mpid_rma_lockqueue.h
@@ -57,7 +57,7 @@ static inline int MPIDI_CH3I_Win_target_lock_entry_free(MPID_Win * win_ptr,
 
     if (target_lock_entry->data != NULL) {
         win_ptr->current_target_lock_data_bytes -= target_lock_entry->buf_size;
-        MPIU_Free(target_lock_entry->data);
+        MPL_free(target_lock_entry->data);
     }
 
     /* use PREPEND when return objects back to the pool
diff --git a/src/mpid/ch3/include/mpid_rma_oplist.h b/src/mpid/ch3/include/mpid_rma_oplist.h
index 1680ae8..3755546 100644
--- a/src/mpid/ch3/include/mpid_rma_oplist.h
+++ b/src/mpid/ch3/include/mpid_rma_oplist.h
@@ -210,7 +210,7 @@ static inline int MPIDI_CH3I_Win_op_free(MPID_Win * win_ptr, MPIDI_RMA_Op_t * e)
     int mpi_errno = MPI_SUCCESS;
 
     if (e->multi_reqs != NULL) {
-        MPIU_Free(e->multi_reqs);
+        MPL_free(e->multi_reqs);
     }
 
     /* We enqueue elements to the right pool, so when they get freed
diff --git a/src/mpid/ch3/include/mpid_rma_shm.h b/src/mpid/ch3/include/mpid_rma_shm.h
index dcee36c..d6dfab2 100644
--- a/src/mpid/ch3/include/mpid_rma_shm.h
+++ b/src/mpid/ch3/include/mpid_rma_shm.h
@@ -374,7 +374,7 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
         first = stream_offset;
         last = stream_offset + stream_size;
 
-        packed_buf = MPIU_Malloc(stream_size);
+        packed_buf = MPL_malloc(stream_size);
 
         seg = MPID_Segment_alloc();
         MPIR_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
@@ -386,12 +386,12 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
         MPID_Datatype_is_contig(basic_type, &is_predef_contig);
 
         if (!is_predef_contig) {
-            void *tmpbuf = MPIU_Malloc(stream_count * predefined_dtp_extent);
+            void *tmpbuf = MPL_malloc(stream_count * predefined_dtp_extent);
             mpi_errno = MPIR_Localcopy(tmpbuf, stream_count, basic_type,
                                        packed_buf, stream_size, MPI_BYTE);
             if (mpi_errno != MPI_SUCCESS)
                 MPIR_ERR_POP(mpi_errno);
-            MPIU_Free(packed_buf);
+            MPL_free(packed_buf);
             packed_buf = tmpbuf;
         }
 
@@ -411,7 +411,7 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
         if (mpi_errno != MPI_SUCCESS)
             MPIR_ERR_POP(mpi_errno);
 
-        MPIU_Free(packed_buf);
+        MPL_free(packed_buf);
     }
 
   fn_exit:
@@ -521,7 +521,7 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
         first = stream_offset;
         last = stream_offset + stream_size;
 
-        packed_buf = MPIU_Malloc(stream_size);
+        packed_buf = MPL_malloc(stream_size);
 
         seg = MPID_Segment_alloc();
         MPIR_ERR_CHKANDJUMP1(seg == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
@@ -533,12 +533,12 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
         MPID_Datatype_is_contig(basic_type, &is_predef_contig);
 
         if (!is_predef_contig) {
-            void *tmpbuf = MPIU_Malloc(stream_count * predefined_dtp_extent);
+            void *tmpbuf = MPL_malloc(stream_count * predefined_dtp_extent);
             mpi_errno = MPIR_Localcopy(tmpbuf, stream_count, basic_type,
                                        packed_buf, stream_size, MPI_BYTE);
             if (mpi_errno != MPI_SUCCESS)
                 MPIR_ERR_POP(mpi_errno);
-            MPIU_Free(packed_buf);
+            MPL_free(packed_buf);
             packed_buf = tmpbuf;
         }
 
@@ -550,7 +550,7 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
         if (mpi_errno != MPI_SUCCESS)
             MPIR_ERR_POP(mpi_errno);
 
-        MPIU_Free(packed_buf);
+        MPL_free(packed_buf);
     }
 
     if (shm_locked) {
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index 8efd2ba..c89be45 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -827,7 +827,7 @@ extern MPIDI_CH3U_SRBuf_element_t * MPIDI_CH3U_SRBuf_pool;
         MPIDI_CH3U_SRBuf_element_t * tmp;                               \
         if (!MPIDI_CH3U_SRBuf_pool) {                                   \
              MPIDI_CH3U_SRBuf_pool =                                    \
-                MPIU_Malloc(sizeof(MPIDI_CH3U_SRBuf_element_t));        \
+                MPL_malloc(sizeof(MPIDI_CH3U_SRBuf_element_t));        \
             MPIDI_CH3U_SRBuf_pool->next = NULL;                         \
         }                                                               \
         tmp = MPIDI_CH3U_SRBuf_pool;                                    \
@@ -1110,15 +1110,15 @@ int MPIDI_CH3U_Win_gather_info(void *, MPI_Aint, int, MPID_Info *, MPID_Comm *,
 
 #ifdef MPIDI_CH3I_HAS_ALLOC_MEM
 void* MPIDI_CH3I_Alloc_mem(size_t size, MPID_Info *info_ptr);
-/* fallback to MPIU_Malloc if channel does not have its own RMA memory allocator */
+/* fallback to MPL_malloc if channel does not have its own RMA memory allocator */
 #else
-#define MPIDI_CH3I_Alloc_mem(size, info_ptr)    MPIU_Malloc(size)
+#define MPIDI_CH3I_Alloc_mem(size, info_ptr)    MPL_malloc(size)
 #endif
 
 #ifdef MPIDI_CH3I_HAS_FREE_MEM
 int MPIDI_CH3I_Free_mem(void *ptr);
 #else
-#define MPIDI_CH3I_Free_mem(ptr)    MPIU_Free(ptr);
+#define MPIDI_CH3I_Free_mem(ptr)    MPL_free(ptr);
 #endif
 
 /* Pvars */
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 38cd5e8..1775417 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -411,13 +411,13 @@ static inline int enqueue_lock_origin(MPID_Win * win_ptr, MPIDI_VC_t * vc,
         if (new_ptr != NULL) {
             if (win_ptr->current_target_lock_data_bytes + buf_size <
                 MPIR_CVAR_CH3_RMA_TARGET_LOCK_DATA_BYTES) {
-                new_ptr->data = MPIU_Malloc(buf_size);
+                new_ptr->data = MPL_malloc(buf_size);
             }
 
             if (new_ptr->data == NULL) {
                 /* Note that there are two possible reasons to make new_ptr->data to be NULL:
                  * (1) win_ptr->current_target_lock_data_bytes + buf_size >= MPIR_CVAR_CH3_RMA_TARGET_LOCK_DATA_BYTES;
-                 * (2) MPIU_Malloc(buf_size) failed.
+                 * (2) MPL_malloc(buf_size) failed.
                  * In such cases, we cannot allocate memory for lock data, so we give up
                  * buffering lock data, however, we still buffer lock request.
                  */
@@ -777,7 +777,7 @@ static inline int handle_lock_ack_with_op(MPID_Win * win_ptr,
             MPIU_Assert(op->multi_reqs != NULL && op->multi_reqs[0] != NULL);
             MPID_Request_release(op->multi_reqs[0]);
             /* free req array in this op */
-            MPIU_Free(op->multi_reqs);
+            MPL_free(op->multi_reqs);
             op->multi_reqs = NULL;
             op->reqs_size = 0;
         }
@@ -968,7 +968,7 @@ static inline int do_accumulate_op(void *source_buf, int source_count, MPI_Datat
         vec_len = dtp->max_contig_blocks * target_count + 1;
         /* +1 needed because Rob says so */
         dloop_vec = (DLOOP_VECTOR *)
-            MPIU_Malloc(vec_len * sizeof(DLOOP_VECTOR));
+            MPL_malloc(vec_len * sizeof(DLOOP_VECTOR));
         /* --BEGIN ERROR HANDLING-- */
         if (!dloop_vec) {
             mpi_errno =
@@ -1021,7 +1021,7 @@ static inline int do_accumulate_op(void *source_buf, int source_count, MPI_Datat
         }
 
         MPID_Segment_free(segp);
-        MPIU_Free(dloop_vec);
+        MPL_free(dloop_vec);
     }
 
   fn_exit:
diff --git a/src/mpid/ch3/src/ch3u_buffer.c b/src/mpid/ch3/src/ch3u_buffer.c
index b7b7596..d601bef 100644
--- a/src/mpid/ch3/src/ch3u_buffer.c
+++ b/src/mpid/ch3/src/ch3u_buffer.c
@@ -129,7 +129,7 @@ void MPIDI_CH3U_Buffer_copy(
 	MPID_Segment rseg;
 	MPIDI_msg_sz_t rfirst;
 
-	buf = MPIU_Malloc(MPIDI_COPY_BUFFER_SZ);
+	buf = MPL_malloc(MPIDI_COPY_BUFFER_SZ);
 	/* --BEGIN ERROR HANDLING-- */
 	if (buf == NULL)
 	{
@@ -214,7 +214,7 @@ void MPIDI_CH3U_Buffer_copy(
 	}
 
 	*rsz = rfirst;
-	MPIU_Free(buf);
+	MPL_free(buf);
     }
 
   fn_exit:
diff --git a/src/mpid/ch3/src/ch3u_comm.c b/src/mpid/ch3/src/ch3u_comm.c
index 595efd4..1a0428a 100644
--- a/src/mpid/ch3/src/ch3u_comm.c
+++ b/src/mpid/ch3/src/ch3u_comm.c
@@ -416,12 +416,12 @@ static int register_hook_finalize(void *param)
 
     MPL_LL_FOREACH_SAFE(create_hooks_head, elt, tmp) {
         MPL_LL_DELETE(create_hooks_head, create_hooks_tail, elt);
-        MPIU_Free(elt);
+        MPL_free(elt);
     }
     
     MPL_LL_FOREACH_SAFE(destroy_hooks_head, elt, tmp) {
         MPL_LL_DELETE(destroy_hooks_head, destroy_hooks_tail, elt);
-        MPIU_Free(elt);
+        MPL_free(elt);
     }
 
  fn_exit:
diff --git a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
index d57e62c..23b6165 100644
--- a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
+++ b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
@@ -49,7 +49,7 @@ static int  mpi_to_pmi_keyvals( MPID_Info *info_ptr, PMI_keyval_t **kv_ptr,
     if (nkeys == 0) {
 	goto fn_exit;
     }
-    kv = (PMI_keyval_t *)MPIU_Malloc( nkeys * sizeof(PMI_keyval_t) );
+    kv = (PMI_keyval_t *)MPL_malloc( nkeys * sizeof(PMI_keyval_t) );
     if (!kv) { MPIR_ERR_POP(mpi_errno); }
 
     for (i=0; i<nkeys; i++) {
@@ -58,8 +58,8 @@ static int  mpi_to_pmi_keyvals( MPID_Info *info_ptr, PMI_keyval_t **kv_ptr,
 	MPIR_Info_get_valuelen_impl( info_ptr, key, &vallen, &flag );
         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 );
+	kv[i].key = MPL_strdup(key);
+	kv[i].val = MPL_malloc( vallen + 1 );
 	if (!kv[i].key || !kv[i].val) { 
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem" );
 	}
@@ -84,13 +84,13 @@ static void free_pmi_keyvals(PMI_keyval_t **kv, int size, int *counts)
 	for (j=0; j<counts[i]; j++)
 	{
 	    if (kv[i][j].key != NULL)
-		MPIU_Free((char *)kv[i][j].key);
+		MPL_free((char *)kv[i][j].key);
 	    if (kv[i][j].val != NULL)
-		MPIU_Free(kv[i][j].val);
+		MPL_free(kv[i][j].val);
 	}
 	if (kv[i] != NULL)
 	{
-	    MPIU_Free(kv[i]);
+	    MPL_free(kv[i]);
 	}
     }
 }
@@ -124,7 +124,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
 	for (i=0; i<count; i++) {
 	    total_num_processes += maxprocs[i];
 	}
-	pmi_errcodes = (int*)MPIU_Malloc(sizeof(int) * total_num_processes);
+	pmi_errcodes = (int*)MPL_malloc(sizeof(int) * total_num_processes);
 	if (pmi_errcodes == NULL) {
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
@@ -144,13 +144,13 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
 #ifdef USE_PMI2_API
         MPIU_Assert(count > 0);
         {
-            int *argcs = MPIU_Malloc(count*sizeof(int));
+            int *argcs = MPL_malloc(count*sizeof(int));
             struct MPID_Info preput;
             struct MPID_Info *preput_p[1] = { &preput };
 
             MPIU_Assert(argcs);
             /*
-            info_keyval_sizes = MPIU_Malloc(count * sizeof(int));
+            info_keyval_sizes = MPL_malloc(count * sizeof(int));
             */
 
             /* FIXME cheating on constness */
@@ -186,7 +186,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
                                        pmi_errcodes);
             MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
             /*MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);*/
-            MPIU_Free(argcs);
+            MPL_free(argcs);
             if (pmi_errno != PMI2_SUCCESS) {
                 MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER,
                      "**pmi_spawn_multiple", "**pmi_spawn_multiple %d", pmi_errno);
@@ -199,9 +199,9 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
            the necessary arrays of key/value pairs */
 
         /* convert the infos into PMI keyvals */
-        info_keyval_sizes   = (int *) MPIU_Malloc(count * sizeof(int));
+        info_keyval_sizes   = (int *) MPL_malloc(count * sizeof(int));
         info_keyval_vectors = 
-            (PMI_keyval_t**) MPIU_Malloc(count * sizeof(PMI_keyval_t*));
+            (PMI_keyval_t**) MPL_malloc(count * sizeof(PMI_keyval_t*));
         if (!info_keyval_sizes || !info_keyval_vectors) { 
             MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
         }
@@ -291,11 +291,11 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
  fn_exit:
     if (info_keyval_vectors) {
 	free_pmi_keyvals(info_keyval_vectors, count, info_keyval_sizes);
-	MPIU_Free(info_keyval_sizes);
-	MPIU_Free(info_keyval_vectors);
+	MPL_free(info_keyval_sizes);
+	MPL_free(info_keyval_vectors);
     }
     if (pmi_errcodes) {
-	MPIU_Free(pmi_errcodes);
+	MPL_free(pmi_errcodes);
     }
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_COMM_SPAWN_MULTIPLE);
     return mpi_errno;
@@ -354,7 +354,7 @@ int MPIDI_CH3_GetParentPort(char ** parent_port)
             goto fn_exit;
 	}
 #endif
-	parent_port_name = MPIU_Strdup(val);
+	parent_port_name = MPL_strdup(val);
 	if (parent_port_name == NULL) {
 	    MPIR_ERR_POP(mpi_errno); /* FIXME DARIUS */
 	}
@@ -370,7 +370,7 @@ int MPIDI_CH3_GetParentPort(char ** parent_port)
 void MPIDI_CH3_FreeParentPort(void)
 {
     if (parent_port_name) {
-	MPIU_Free( parent_port_name );
+	MPL_free( parent_port_name );
 	parent_port_name = 0;
     }
 }
diff --git a/src/mpid/ch3/src/ch3u_eager.c b/src/mpid/ch3/src/ch3u_eager.c
index c25f2fe..4f62505 100644
--- a/src/mpid/ch3/src/ch3u_eager.c
+++ b/src/mpid/ch3/src/ch3u_eager.c
@@ -450,7 +450,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	    /* printf( "Allocating into tmp\n" ); fflush(stdout); */
 	    recv_data_sz = rreq->dev.recv_data_sz;
         MPIR_T_PVAR_LEVEL_INC(RECVQ, unexpected_recvq_buffer_size, recv_data_sz);
-	    rreq->dev.tmpbuf = MPIU_Malloc(recv_data_sz);
+	    rreq->dev.tmpbuf = MPL_malloc(recv_data_sz);
 	    if (!rreq->dev.tmpbuf) {
 		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	    }
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
index 9338eb9..87c7604 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
@@ -248,7 +248,7 @@ int MPIDI_CH3U_Receive_data_unexpected(MPID_Request * rreq, char *buf, MPIDI_msg
        with flow control */
     MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
     
-    rreq->dev.tmpbuf = MPIU_Malloc(rreq->dev.recv_data_sz);
+    rreq->dev.tmpbuf = MPL_malloc(rreq->dev.recv_data_sz);
     if (!rreq->dev.tmpbuf) {
 	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
 			     rreq->dev.recv_data_sz);
@@ -383,7 +383,7 @@ int MPIDI_CH3U_Post_data_receive_unexpected(MPID_Request * rreq)
        with flow control */
     MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
     
-    rreq->dev.tmpbuf = MPIU_Malloc(rreq->dev.recv_data_sz);
+    rreq->dev.tmpbuf = MPL_malloc(rreq->dev.recv_data_sz);
     if (!rreq->dev.tmpbuf) {
 	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
 			     rreq->dev.recv_data_sz);
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_req.c b/src/mpid/ch3/src/ch3u_handle_recv_req.c
index 7dfa2eb..fe167bd 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_req.c
@@ -532,7 +532,7 @@ int MPIDI_CH3_ReqHandler_FOPRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
         /* free the temporary buffer.
          * When origin data is zero, there
          * is no temporary buffer allocated */
-        MPIU_Free((char *) rreq->dev.user_buf);
+        MPL_free((char *) rreq->dev.user_buf);
     }
 
     /* mark data transfer as complete and decrement CC */
@@ -960,7 +960,7 @@ int MPIDI_CH3_ReqHandler_UnpackUEBufComplete(MPIDI_VC_t * vc ATTRIBUTE((unused))
     if (!recv_pending) {
         if (rreq->dev.recv_data_sz > 0) {
             MPIDI_CH3U_Request_unpack_uebuf(rreq);
-            MPIU_Free(rreq->dev.tmpbuf);
+            MPL_free(rreq->dev.tmpbuf);
         }
     }
     else {
@@ -1463,7 +1463,7 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
     recv_count = MPL_MIN((total_len / type_size), (MPIDI_CH3U_SRBuf_size / type_extent));
     MPIU_Assert(recv_count > 0);
 
-    sreq->dev.user_buf = (void *) MPIU_Malloc(recv_count * type_size);
+    sreq->dev.user_buf = (void *) MPL_malloc(recv_count * type_size);
 
     MPID_Datatype_is_contig(get_accum_pkt->datatype, &is_contig);
 
@@ -1600,7 +1600,7 @@ static inline int perform_fop_in_lock_queue(MPID_Win * win_ptr,
         resp_req->dev.target_win_handle = win_ptr->handle;
         resp_req->dev.flags = fop_pkt->flags;
 
-        resp_req->dev.user_buf = (void *) MPIU_Malloc(type_size);
+        resp_req->dev.user_buf = (void *) MPL_malloc(type_size);
 
         /* here we increment the Active Target counter to guarantee the GET-like
          * operation are completed when counter reaches zero. */
diff --git a/src/mpid/ch3/src/ch3u_handle_send_req.c b/src/mpid/ch3/src/ch3u_handle_send_req.c
index 10c9f9f..c0b1919 100644
--- a/src/mpid/ch3/src/ch3u_handle_send_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_send_req.c
@@ -138,7 +138,7 @@ int MPIDI_CH3_ReqHandler_GaccumSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq
      * is finished. Only GACC used user_buf. FOP and CAS can fit all data
      * in response packet. */
     if (rreq->dev.user_buf != NULL)
-        MPIU_Free(rreq->dev.user_buf);
+        MPL_free(rreq->dev.user_buf);
 
     MPID_Win_get_ptr(rreq->dev.target_win_handle, win_ptr);
 
@@ -207,7 +207,7 @@ int MPIDI_CH3_ReqHandler_CASSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
      * is finished. Only GACC used user_buf. FOP and CAS can fit all data
      * in response packet. */
     if (rreq->dev.user_buf != NULL)
-        MPIU_Free(rreq->dev.user_buf);
+        MPL_free(rreq->dev.user_buf);
 
     MPID_Win_get_ptr(rreq->dev.target_win_handle, win_ptr);
 
@@ -275,7 +275,7 @@ int MPIDI_CH3_ReqHandler_FOPSendComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
      * is finished. Only GACC used user_buf. FOP and CAS can fit all data
      * in response packet. */
     if (rreq->dev.user_buf != NULL)
-        MPIU_Free(rreq->dev.user_buf);
+        MPL_free(rreq->dev.user_buf);
 
     MPID_Win_get_ptr(rreq->dev.target_win_handle, win_ptr);
 
diff --git a/src/mpid/ch3/src/ch3u_port.c b/src/mpid/ch3/src/ch3u_port.c
index 003fea1..6ff7cc5 100644
--- a/src/mpid/ch3/src/ch3u_port.c
+++ b/src/mpid/ch3/src/ch3u_port.c
@@ -601,7 +601,7 @@ static int ExtractLocalPGInfo( MPID_Comm *comm_p,
     MPIU_CHKPMEM_MALLOC(pg_list,pg_node*,sizeof(pg_node),mpi_errno,
 			"pg_list");
     
-    pg_list->pg_id = MPIU_Strdup(comm_p->dev.vcrt->vcr_table[0]->pg->id);
+    pg_list->pg_id = MPL_strdup(comm_p->dev.vcrt->vcr_table[0]->pg->id);
     pg_list->index = cur_index++;
     pg_list->next = NULL;
     /* XXX DJG FIXME-MT should we be checking this?  the add/release macros already check this */
@@ -632,13 +632,13 @@ static int ExtractLocalPGInfo( MPID_Comm *comm_p,
 	    pg_iter = pg_iter->next;
 	}
 	if (pg_iter == NULL) {
-	    /* We use MPIU_Malloc directly because we do not know in 
+	    /* We use MPL_malloc directly because we do not know in
 	       advance how many nodes we may allocate */
-	    pg_iter = (pg_node*)MPIU_Malloc(sizeof(pg_node));
+	    pg_iter = (pg_node*)MPL_malloc(sizeof(pg_node));
 	    if (!pg_iter) {
 		MPIR_ERR_POP(mpi_errno);
 	    }
-	    pg_iter->pg_id = MPIU_Strdup(comm_p->dev.vcrt->vcr_table[i]->pg->id);
+	    pg_iter->pg_id = MPL_strdup(comm_p->dev.vcrt->vcr_table[i]->pg->id);
 	    pg_iter->index = cur_index++;
 	    pg_iter->next = NULL;
 	    mpi_errno = MPIDI_PG_To_string(comm_p->dev.vcrt->vcr_table[i]->pg, &pg_iter->str,
@@ -705,7 +705,7 @@ static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr,
 	    if (mpi_errno != MPI_SUCCESS) {
 		MPIR_ERR_POP(mpi_errno);
 	    }
-	    pg_str = (char*)MPIU_Malloc(j);
+	    pg_str = (char*)MPL_malloc(j);
 	    if (pg_str == NULL) {
 		MPIR_ERR_POP(mpi_errno);
 	    }
@@ -725,7 +725,7 @@ static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr,
 
 	if (rank != root) {
 	    /* The root has already allocated this string */
-	    pg_str = (char*)MPIU_Malloc(j);
+	    pg_str = (char*)MPL_malloc(j);
 	    if (pg_str == NULL) {
 		MPIR_ERR_POP(mpi_errno);
 	    }
@@ -743,7 +743,7 @@ static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr,
 	    MPIR_ERR_POP(mpi_errno);
 	}
 	
-	MPIU_Free(pg_str);
+	MPL_free(pg_str);
     }
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_RECEIVEPGANDDISTRIBUTE);
@@ -808,7 +808,7 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
         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);
+	    pg_str = (char *)MPL_malloc(len);
             if (!pg_str) {
                 MPIU_CHKMEM_SETERR(mpi_errno, len, "pg_str");
                 goto fn_exit;
@@ -817,7 +817,7 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
 	mpi_errno = MPIR_Bcast_impl( pg_str, len, MPI_CHAR, root, comm_p, &errflag);
         if (mpi_errno) {
             if (rank != root)
-                MPIU_Free( pg_str );
+                MPL_free( pg_str );
             MPIR_ERR_POP(mpi_errno);
         }
         MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
@@ -832,7 +832,7 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
 			(char *)pgptr->id );
 			fflush(stdout); */
 	    }
-	    MPIU_Free( pg_str );
+	    MPL_free( pg_str );
 	}
     }
 
@@ -843,11 +843,11 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
        the PG fields are valid for that function */
     while (pg_list) {
 	pg_next = pg_list->next;
-	MPIU_Free( pg_list->str );
+	MPL_free( pg_list->str );
 	if (pg_list->pg_id ) {
-	    MPIU_Free( pg_list->pg_id );
+	    MPL_free( pg_list->pg_id );
 	}
-	MPIU_Free( pg_list );
+	MPL_free( pg_list );
 	pg_list = pg_next;
     }
 
@@ -894,9 +894,9 @@ static int SendPGtoPeerAndFree( MPID_Comm *tmp_comm, int *sendtag_p,
 	}
 	
 	pg_list = pg_list->next;
-	MPIU_Free(pg_iter->str);
-	MPIU_Free(pg_iter->pg_id);
-	MPIU_Free(pg_iter);
+	MPL_free(pg_iter->str);
+	MPL_free(pg_iter->pg_id);
+	MPL_free(pg_iter);
     }
 
  fn_exit:
@@ -1223,7 +1223,7 @@ static int FreeNewVC( MPIDI_VC_t *new_vc )
     }
 
     MPIDI_CH3_VC_Destroy(new_vc);
-    MPIU_Free(new_vc);
+    MPL_free(new_vc);
 
  fn_fail:
     return mpi_errno;
@@ -1272,7 +1272,7 @@ int MPIDI_CH3I_Acceptq_enqueue(MPIDI_VC_t * vc, int port_name_tag )
 
     /* FIXME: Use CHKPMEM */
     q_item = (MPIDI_CH3I_Acceptq_t *)
-        MPIU_Malloc(sizeof(MPIDI_CH3I_Acceptq_t)); 
+        MPL_malloc(sizeof(MPIDI_CH3I_Acceptq_t));
     /* --BEGIN ERROR HANDLING-- */
     if (q_item == NULL)
     {
@@ -1329,7 +1329,7 @@ int MPIDI_CH3I_Acceptq_dequeue(MPIDI_VC_t ** vc, int port_name_tag)
 	    else
 		prev->next = q_item->next;
 
-	    MPIU_Free(q_item);
+	    MPL_free(q_item);
 	    AcceptQueueSize--;
 	    break;;
 	}
diff --git a/src/mpid/ch3/src/ch3u_request.c b/src/mpid/ch3/src/ch3u_request.c
index 9ab3b01..6f673a5 100644
--- a/src/mpid/ch3/src/ch3u_request.c
+++ b/src/mpid/ch3/src/ch3u_request.c
@@ -681,7 +681,7 @@ void MPID_Request_release(MPID_Request *req)
         }
 
         if (req->greq_fns != NULL) {
-            MPIU_Free(req->greq_fns);
+            MPL_free(req->greq_fns);
         }
 
         if (req->dev.datatype_ptr != NULL) {
@@ -697,7 +697,7 @@ void MPID_Request_release(MPID_Request *req)
         }
 
         if (req->dev.ext_hdr_ptr != NULL) {
-            MPIU_Free(req->dev.ext_hdr_ptr);
+            MPL_free(req->dev.ext_hdr_ptr);
         }
 
         MPIU_Handle_obj_free(&MPID_Request_mem, req);
diff --git a/src/mpid/ch3/src/ch3u_rma_pkthandler.c b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
index 1d23568..0b87edf 100644
--- a/src/mpid/ch3/src/ch3u_rma_pkthandler.c
+++ b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
@@ -193,7 +193,7 @@ static int MPIDI_CH3_ExtPktHandler_Accumulate(MPIDI_CH3_Pkt_flags_t flags,
 
     if ((flags & MPIDI_CH3_PKT_FLAG_RMA_STREAM) && is_derived_dt) {
         (*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));
+        (*ext_hdr_ptr) = MPL_malloc(sizeof(MPIDI_CH3_Ext_pkt_accum_stream_derived_t));
         if ((*ext_hdr_ptr) == NULL) {
             MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_stream_derived_t");
@@ -201,7 +201,7 @@ static int MPIDI_CH3_ExtPktHandler_Accumulate(MPIDI_CH3_Pkt_flags_t flags,
     }
     else if (flags & MPIDI_CH3_PKT_FLAG_RMA_STREAM) {
         (*ext_hdr_sz) = sizeof(MPIDI_CH3_Ext_pkt_accum_stream_t);
-        (*ext_hdr_ptr) = MPIU_Malloc(sizeof(MPIDI_CH3_Ext_pkt_accum_stream_t));
+        (*ext_hdr_ptr) = MPL_malloc(sizeof(MPIDI_CH3_Ext_pkt_accum_stream_t));
         if ((*ext_hdr_ptr) == NULL) {
             MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_stream_t");
@@ -209,7 +209,7 @@ static int MPIDI_CH3_ExtPktHandler_Accumulate(MPIDI_CH3_Pkt_flags_t flags,
     }
     else if (is_derived_dt) {
         (*ext_hdr_sz) = sizeof(MPIDI_CH3_Ext_pkt_accum_derived_t);
-        (*ext_hdr_ptr) = MPIU_Malloc(sizeof(MPIDI_CH3_Ext_pkt_accum_derived_t));
+        (*ext_hdr_ptr) = MPL_malloc(sizeof(MPIDI_CH3_Ext_pkt_accum_derived_t));
         if ((*ext_hdr_ptr) == NULL) {
             MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem",
                                  "**nomem %s", "MPIDI_CH3_Ext_pkt_accum_derived_t");
@@ -221,7 +221,7 @@ static int MPIDI_CH3_ExtPktHandler_Accumulate(MPIDI_CH3_Pkt_flags_t flags,
     return mpi_errno;
   fn_fail:
     if ((*ext_hdr_ptr) != NULL)
-        MPIU_Free((*ext_hdr_ptr));
+        MPL_free((*ext_hdr_ptr));
     (*ext_hdr_ptr) = NULL;
     (*ext_hdr_sz) = 0;
     goto fn_exit;
@@ -361,7 +361,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
             /* allocate extended header in the request,
              * only including fixed-length variables defined in packet type. */
             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);
+            req->dev.ext_hdr_ptr = MPL_malloc(req->dev.ext_hdr_sz);
             if (!req->dev.ext_hdr_ptr) {
                 MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
                                      "MPIDI_CH3_Ext_pkt_put_derived_t");
@@ -369,7 +369,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
             /* put dataloop in a separate buffer to be reused in datatype.
              * It will be freed when free datatype. */
-            req->dev.dataloop = MPIU_Malloc(put_pkt->info.dataloop_size);
+            req->dev.dataloop = MPL_malloc(put_pkt->info.dataloop_size);
             if (!req->dev.dataloop) {
                 MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
                                      put_pkt->info.dataloop_size);
@@ -588,7 +588,7 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
         /* allocate extended header in the request,
          * only including fixed-length variables defined in packet type. */
         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);
+        req->dev.ext_hdr_ptr = MPL_malloc(req->dev.ext_hdr_sz);
         if (!req->dev.ext_hdr_ptr) {
             MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
                                  "MPIDI_CH3_Ext_pkt_get_derived_t");
@@ -596,7 +596,7 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
         /* put dataloop in a separate buffer to be reused in datatype.
          * It will be freed when free datatype. */
-        req->dev.dataloop = MPIU_Malloc(get_pkt->info.dataloop_size);
+        req->dev.dataloop = MPL_malloc(get_pkt->info.dataloop_size);
         if (!req->dev.dataloop) {
             MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
                                  get_pkt->info.dataloop_size);
@@ -799,7 +799,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
             /* Put dataloop in a separate buffer to be reused in datatype.
              * It will be freed when free datatype. */
-            req->dev.dataloop = MPIU_Malloc(accum_pkt->info.dataloop_size);
+            req->dev.dataloop = MPL_malloc(accum_pkt->info.dataloop_size);
             if (!req->dev.dataloop) {
                 MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
                                      accum_pkt->info.dataloop_size);
@@ -1086,7 +1086,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
             /* Put dataloop in a separate buffer to be reused in datatype.
              * It will be freed when free datatype. */
-            req->dev.dataloop = MPIU_Malloc(get_accum_pkt->info.dataloop_size);
+            req->dev.dataloop = MPL_malloc(get_accum_pkt->info.dataloop_size);
             if (!req->dev.dataloop) {
                 MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
                                      get_accum_pkt->info.dataloop_size);
@@ -1464,7 +1464,7 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
             MPID_Datatype_get_extent_macro(fop_pkt->datatype, extent);
 
-            req->dev.user_buf = MPIU_Malloc(extent);
+            req->dev.user_buf = MPL_malloc(extent);
             if (!req->dev.user_buf) {
                 MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d", extent);
             }
diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c
index 6d0c5b5..c4195d4 100644
--- a/src/mpid/ch3/src/ch3u_rma_sync.c
+++ b/src/mpid/ch3/src/ch3u_rma_sync.c
@@ -1029,7 +1029,7 @@ int MPID_Win_complete(MPID_Win * win_ptr)
     win_ptr->states.access_state = MPIDI_RMA_NONE;
 
     /* free start group stored in window */
-    MPIU_Free(win_ptr->start_ranks_in_win_grp);
+    MPL_free(win_ptr->start_ranks_in_win_grp);
     win_ptr->start_ranks_in_win_grp = NULL;
 
   fn_exit:
diff --git a/src/mpid/ch3/src/mpid_cancel_send.c b/src/mpid/ch3/src/mpid_cancel_send.c
index e70a605..1d159af 100644
--- a/src/mpid/ch3/src/mpid_cancel_send.c
+++ b/src/mpid/ch3/src/mpid_cancel_send.c
@@ -252,7 +252,7 @@ int MPIDI_CH3_PktHandler_CancelSendReq( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"message cancelled");
 	if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_EAGER_MSG && rreq->dev.recv_data_sz > 0)
 	{
-	    MPIU_Free(rreq->dev.tmpbuf);
+	    MPL_free(rreq->dev.tmpbuf);
 	}
 	if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_RNDV_MSG)
 	{
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 9b04c48..7d23a6d 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
@@ -18,7 +18,7 @@ static void group_to_bitarray(MPID_Group *group, MPID_Comm *orig_comm, int **bit
 
     /* Calculate the bitarray size in ints and allocate space */
     *bitarray_size = (orig_comm->local_size / (8 * sizeof(int)) + (orig_comm->local_size % (8 * sizeof(int)) ? 1 : 0));
-    *bitarray = (int *) MPIU_Malloc(sizeof(int) * *bitarray_size);
+    *bitarray = (int *) MPL_malloc(sizeof(int) * *bitarray_size);
 
     /* If the group is empty, return an empty bitarray. */
     if (group == MPID_Group_empty) {
@@ -27,8 +27,8 @@ static void group_to_bitarray(MPID_Group *group, MPID_Comm *orig_comm, int **bit
     }
 
     /* Get the ranks of group in orig_comm */
-    group_ranks = (int *) MPIU_Malloc(sizeof(int) * group->size);
-    comm_ranks = (int *) MPIU_Malloc(sizeof(int) * group->size);
+    group_ranks = (int *) MPL_malloc(sizeof(int) * group->size);
+    comm_ranks = (int *) MPL_malloc(sizeof(int) * group->size);
 
     for (i = 0; i < group->size; i++) group_ranks[i] = i;
     for (i = 0; i < *bitarray_size; i++) *bitarray[i] = 0;
@@ -45,8 +45,8 @@ static void group_to_bitarray(MPID_Group *group, MPID_Comm *orig_comm, int **bit
         *bitarray[index] |= mask;
     }
 
-    MPIU_Free(group_ranks);
-    MPIU_Free(comm_ranks);
+    MPL_free(group_ranks);
+    MPL_free(comm_ranks);
 }
 
 /* Generates an MPID_Group from a bitarray */
@@ -109,7 +109,7 @@ int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_grou
 
     /* Generate a bitarray based on the list of failed procs */
     group_to_bitarray(local_fail, comm_ptr, &bitarray, &bitarray_size);
-    remote_bitarray = MPIU_Malloc(sizeof(int) * bitarray_size);
+    remote_bitarray = MPL_malloc(sizeof(int) * bitarray_size);
     if (local_fail != MPID_Group_empty)
         MPIR_Group_release(local_fail);
 
@@ -152,8 +152,8 @@ int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_grou
         *failed_group = bitarray_to_group(comm_ptr, remote_bitarray);
     }
 
-    MPIU_Free(bitarray);
-    MPIU_Free(remote_bitarray);
+    MPL_free(bitarray);
+    MPL_free(remote_bitarray);
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_COMM_GET_ALL_FAILED_PROCS);
diff --git a/src/mpid/ch3/src/mpid_finalize.c b/src/mpid/ch3/src/mpid_finalize.c
index c6a9ae2..49ba490 100644
--- a/src/mpid/ch3/src/mpid_finalize.c
+++ b/src/mpid/ch3/src/mpid_finalize.c
@@ -140,14 +140,14 @@ int MPID_Finalize(void)
 	p = MPIDI_CH3U_SRBuf_pool;
 	while (p) {
 	    pNext = p->next;
-	    MPIU_Free(p);
+	    MPL_free(p);
 	    p = pNext;
 	}
     }
 
     MPIDI_RMA_finalize();
     
-    MPIU_Free(MPIDI_failed_procs_string);
+    MPL_free(MPIDI_failed_procs_string);
 
     MPIDU_Ftb_finalize();
 
diff --git a/src/mpid/ch3/src/mpid_imrecv.c b/src/mpid/ch3/src/mpid_imrecv.c
index 78e36d9..69d1510 100644
--- a/src/mpid/ch3/src/mpid_imrecv.c
+++ b/src/mpid/ch3/src/mpid_imrecv.c
@@ -73,7 +73,7 @@ int MPID_Imrecv(void *buf, int count, MPI_Datatype datatype,
             if (rreq->dev.recv_data_sz > 0)
             {
                 MPIDI_CH3U_Request_unpack_uebuf(rreq);
-                MPIU_Free(rreq->dev.tmpbuf);
+                MPL_free(rreq->dev.tmpbuf);
             }
 
             mpi_errno = rreq->status.MPI_ERROR;
diff --git a/src/mpid/ch3/src/mpid_init.c b/src/mpid/ch3/src/mpid_init.c
index 58f3afd..3f364d2 100644
--- a/src/mpid/ch3/src/mpid_init.c
+++ b/src/mpid/ch3/src/mpid_init.c
@@ -140,10 +140,10 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
     /* Create the string that will cache the last group of failed processes
      * we received from PMI */
 #ifdef USE_PMI2_API
-    MPIDI_failed_procs_string = MPIU_Malloc(sizeof(char) * PMI2_MAX_VALLEN);
+    MPIDI_failed_procs_string = MPL_malloc(sizeof(char) * PMI2_MAX_VALLEN);
 #else
     PMI_KVS_Get_value_length_max(&val);
-    MPIDI_failed_procs_string = MPIU_Malloc(sizeof(char) * (val+1));
+    MPIDI_failed_procs_string = MPL_malloc(sizeof(char) * (val+1));
 #endif
 
     /*
@@ -456,7 +456,7 @@ static int init_pg( int *argc, char ***argv,
 #ifdef USE_PMI2_API
         
         /* This memory will be freed by the PG_Destroy if there is an error */
-	pg_id = MPIU_Malloc(MAX_JOBID_LEN);
+	pg_id = MPL_malloc(MAX_JOBID_LEN);
 	if (pg_id == NULL) {
 	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
 				 MAX_JOBID_LEN);
@@ -479,7 +479,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);
+	pg_id = MPL_malloc(pg_id_sz + 1);
 	if (pg_id == NULL) {
 	    MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
 				 pg_id_sz+1);
@@ -497,7 +497,7 @@ static int init_pg( int *argc, char ***argv,
     }
     else {
 	/* Create a default pg id */
-	pg_id = MPIU_Malloc(2);
+	pg_id = MPL_malloc(2);
 	if (pg_id == NULL) {
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**nomem");
 	}
@@ -578,7 +578,7 @@ int MPIDI_CH3I_BCInit( char **bc_val_p, int *val_max_sz_p )
     }
 #endif
     /* This memroy is returned by this routine */
-    *bc_val_p = MPIU_Malloc(*val_max_sz_p);
+    *bc_val_p = MPL_malloc(*val_max_sz_p);
     if (*bc_val_p == NULL) {
 	MPIR_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER, "**nomem","**nomem %d",
 			     *val_max_sz_p);
@@ -600,7 +600,7 @@ int MPIDI_CH3I_BCFree( char *bc_val )
 {
     /* */
     if (bc_val) {
-	MPIU_Free( bc_val );
+	MPL_free( bc_val );
     }
     
     return 0;
@@ -618,7 +618,7 @@ static int pg_destroy(MPIDI_PG_t * pg)
 {
     if (pg->id != NULL)
     { 
-	MPIU_Free(pg->id);
+	MPL_free(pg->id);
     }
     
     return MPI_SUCCESS;
diff --git a/src/mpid/ch3/src/mpid_irecv.c b/src/mpid/ch3/src/mpid_irecv.c
index 0404663..8338b2c 100644
--- a/src/mpid/ch3/src/mpid_irecv.c
+++ b/src/mpid/ch3/src/mpid_irecv.c
@@ -90,7 +90,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
                 if (rreq->dev.recv_data_sz > 0)
                 {
                     MPIDI_CH3U_Request_unpack_uebuf(rreq);
-                    MPIU_Free(rreq->dev.tmpbuf);
+                    MPL_free(rreq->dev.tmpbuf);
                 }
 
                 mpi_errno = rreq->status.MPI_ERROR;
diff --git a/src/mpid/ch3/src/mpid_recv.c b/src/mpid/ch3/src/mpid_recv.c
index 6b3d56b..6b3b45f 100644
--- a/src/mpid/ch3/src/mpid_recv.c
+++ b/src/mpid/ch3/src/mpid_recv.c
@@ -94,7 +94,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
                 if (rreq->dev.recv_data_sz > 0)
                 {
                     MPIDI_CH3U_Request_unpack_uebuf(rreq);
-                    MPIU_Free(rreq->dev.tmpbuf);
+                    MPL_free(rreq->dev.tmpbuf);
                 }
 
                 mpi_errno = rreq->status.MPI_ERROR;
diff --git a/src/mpid/ch3/src/mpid_vc.c b/src/mpid/ch3/src/mpid_vc.c
index bdb4a28..5f1dabc 100644
--- a/src/mpid/ch3/src/mpid_vc.c
+++ b/src/mpid/ch3/src/mpid_vc.c
@@ -240,7 +240,7 @@ int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt, int isDisconnect )
 	    }
 	}
 
-	MPIU_Free(vcrt);
+	MPL_free(vcrt);
     }
 
  fn_exit:    
@@ -984,7 +984,7 @@ static int populate_ids_from_mapping(char *mapping, MPID_Node_id_t *max_node_id,
             *max_node_id = pg->vct[i].node_id;
 
 fn_exit:
-    MPIU_Free(mb);
+    MPL_free(mb);
     return mpi_errno;
 fn_fail:
     /* --BEGIN ERROR HANDLING-- */
diff --git a/src/mpid/ch3/src/mpidi_pg.c b/src/mpid/ch3/src/mpidi_pg.c
index 568c4df..68bc98f 100644
--- a/src/mpid/ch3/src/mpidi_pg.c
+++ b/src/mpid/ch3/src/mpidi_pg.c
@@ -323,17 +323,17 @@ int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
             }
 
 	    MPIDI_PG_Destroy_fn(pg);
-	    MPIU_Free(pg->vct);
+	    MPL_free(pg->vct);
 	    if (pg->connData) {
 		if (pg->freeConnInfo) {
 		    (*pg->freeConnInfo)( pg );
 		}
 		else {
-		    MPIU_Free(pg->connData);
+		    MPL_free(pg->connData);
 		}
 	    }
 	    mpi_errno = MPIDI_CH3_PG_Destroy(pg);
-	    MPIU_Free(pg);
+	    MPL_free(pg);
 
 	    goto fn_exit;
 	}
@@ -515,7 +515,7 @@ int MPIDI_PG_Create_from_string(const char * str, MPIDI_PG_t ** pg_pptr,
     }
     
     pg_ptr = *pg_pptr;
-    pg_ptr->id = MPIU_Strdup( str );
+    pg_ptr->id = MPL_strdup( str );
     
     /* Set up the functions to use strings to manage connection information */
     MPIDI_PG_InitConnString( pg_ptr );
@@ -739,7 +739,7 @@ static int connToStringKVS( char **buf_p, int *slen, MPIDI_PG_t *pg )
        needed space */
     len = 0;
     curSlen = 10 + pg->size * 128;
-    string = (char *)MPIU_Malloc( curSlen );
+    string = (char *)MPL_malloc( curSlen );
 
     /* Start with the id of the pg */
     while (*pg_idStr && len < curSlen) 
@@ -783,7 +783,7 @@ static int connToStringKVS( char **buf_p, int *slen, MPIDI_PG_t *pg )
 	if (len + vallen + 1 >= curSlen) {
 	    char *nstring = 0;
             curSlen += (pg->size - i) * (vallen + 1 );
-	    nstring = MPIU_Realloc( string, curSlen );
+	    nstring = MPL_realloc( string, curSlen );
 	    if (!nstring) {
 		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	    }
@@ -802,7 +802,7 @@ static int connToStringKVS( char **buf_p, int *slen, MPIDI_PG_t *pg )
  fn_exit:
     return mpi_errno;
  fn_fail:
-    if (string) MPIU_Free(string);
+    if (string) MPL_free(string);
     goto fn_exit;
 }
 static int connFromStringKVS( const char *buf ATTRIBUTE((unused)), 
@@ -814,7 +814,7 @@ static int connFromStringKVS( const char *buf ATTRIBUTE((unused)),
 static int connFreeKVS( MPIDI_PG_t *pg )
 {
     if (pg->connData) {
-	MPIU_Free( pg->connData );
+	MPL_free( pg->connData );
     }
     return MPI_SUCCESS;
 }
@@ -829,7 +829,7 @@ int MPIDI_PG_InitConnKVS( MPIDI_PG_t *pg )
 #ifdef USE_PMI2_API
     int mpi_errno = MPI_SUCCESS;
     
-    pg->connData = (char *)MPIU_Malloc(MAX_JOBID_LEN);
+    pg->connData = (char *)MPL_malloc(MAX_JOBID_LEN);
     if (pg->connData == NULL) {
 	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**nomem");
     }
@@ -847,7 +847,7 @@ int MPIDI_PG_InitConnKVS( MPIDI_PG_t *pg )
 			     "**pmi_kvs_get_name_length_max %d", pmi_errno);
     }
     
-    pg->connData = (char *)MPIU_Malloc(kvs_name_sz + 1);
+    pg->connData = (char *)MPL_malloc(kvs_name_sz + 1);
     if (pg->connData == NULL) {
 	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**nomem");
     }
@@ -867,7 +867,7 @@ int MPIDI_PG_InitConnKVS( MPIDI_PG_t *pg )
  fn_exit:
     return mpi_errno;
  fn_fail:
-    if (pg->connData) { MPIU_Free(pg->connData); }
+    if (pg->connData) { MPL_free(pg->connData); }
     goto fn_exit;
 }
 
@@ -989,13 +989,13 @@ static int connFromString( const char *buf, MPIDI_PG_t *pg )
     pg->size = atoi( buf );
     while (*buf) buf++; buf++;
 
-    conninfo = (MPIDI_ConnInfo *)MPIU_Malloc( sizeof(MPIDI_ConnInfo) );
-    conninfo->connStrings = (char **)MPIU_Malloc( pg->size * sizeof(char *));
+    conninfo = (MPIDI_ConnInfo *)MPL_malloc( sizeof(MPIDI_ConnInfo) );
+    conninfo->connStrings = (char **)MPL_malloc( pg->size * sizeof(char *));
 
     /* For now, make a copy of each item */
     for (i=0; i<pg->size; i++) {
 	/* printf( "Adding conn[%d] = %s\n", i, buf );fflush(stdout); */
-	conninfo->connStrings[i] = MPIU_Strdup( buf );
+	conninfo->connStrings[i] = MPL_strdup( buf );
 	while (*buf) buf++;
 	buf++;
     }
@@ -1013,10 +1013,10 @@ static int connFree( MPIDI_PG_t *pg )
     int i;
 
     for (i=0; i<pg->size; i++) {
-	MPIU_Free( conninfo->connStrings[i] );
+	MPL_free( conninfo->connStrings[i] );
     }
-    MPIU_Free( conninfo->connStrings );
-    MPIU_Free( conninfo );
+    MPL_free( conninfo->connStrings );
+    MPL_free( conninfo );
 
     return MPI_SUCCESS;
 }
diff --git a/src/mpid/ch3/src/mpidi_rma.c b/src/mpid/ch3/src/mpidi_rma.c
index 941eb6e..53cf8c7 100644
--- a/src/mpid/ch3/src/mpidi_rma.c
+++ b/src/mpid/ch3/src/mpidi_rma.c
@@ -132,8 +132,8 @@ void MPIDI_RMA_finalize(void)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_RMA_FINALIZE);
 
-    MPIU_Free(global_rma_op_pool_start);
-    MPIU_Free(global_rma_target_pool_start);
+    MPL_free(global_rma_op_pool_start);
+    MPL_free(global_rma_target_pool_start);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RMA_FINALIZE);
 }
@@ -207,11 +207,11 @@ int MPID_Win_free(MPID_Win ** win_ptr)
         MPIR_ERR_POP(mpi_errno);
 
     if ((*win_ptr)->basic_info_table != NULL)
-        MPIU_Free((*win_ptr)->basic_info_table);
-    MPIU_Free((*win_ptr)->op_pool_start);
-    MPIU_Free((*win_ptr)->target_pool_start);
-    MPIU_Free((*win_ptr)->slots);
-    MPIU_Free((*win_ptr)->target_lock_entry_pool_start);
+        MPL_free((*win_ptr)->basic_info_table);
+    MPL_free((*win_ptr)->op_pool_start);
+    MPL_free((*win_ptr)->target_pool_start);
+    MPL_free((*win_ptr)->slots);
+    MPL_free((*win_ptr)->target_lock_entry_pool_start);
 
     MPIU_Assert((*win_ptr)->current_target_lock_data_bytes == 0);
 
@@ -219,7 +219,7 @@ int MPID_Win_free(MPID_Win ** win_ptr)
     if ((*win_ptr)->create_flavor == MPI_WIN_FLAVOR_ALLOCATE ||
         (*win_ptr)->create_flavor == MPI_WIN_FLAVOR_SHARED) {
         if ((*win_ptr)->shm_allocated == FALSE && (*win_ptr)->size > 0) {
-            MPIU_Free((*win_ptr)->base);
+            MPL_free((*win_ptr)->base);
         }
     }
 
diff --git a/src/mpid/ch3/util/sock/ch3u_connect_sock.c b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
index 3eda03f..602bc81 100644
--- a/src/mpid/ch3/util/sock/ch3u_connect_sock.c
+++ b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
@@ -305,7 +305,7 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
 	}
     	vcch = &vc->ch;
         vcch->state = MPIDI_CH3I_VC_STATE_FAILED;
-        MPIU_Free(conn);
+        MPL_free(conn);
         goto fn_fail;
     }
     /* --END ERROR HANDLING-- */
@@ -757,7 +757,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 	MPIDI_CH3I_Pkt_sc_open_resp_t *openresp = 
 	    (MPIDI_CH3I_Pkt_sc_open_resp_t *)&conn->pkt.type;
 
-	vc = (MPIDI_VC_t *) MPIU_Malloc(sizeof(MPIDI_VC_t));
+	vc = (MPIDI_VC_t *) MPL_malloc(sizeof(MPIDI_VC_t));
 	/* --BEGIN ERROR HANDLING-- */
 	if (vc == NULL) {
 	    mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, FCNAME, __LINE__, MPI_ERR_OTHER,
@@ -1379,8 +1379,8 @@ static void connection_destroy(MPIDI_CH3I_Connection_t * conn)
 
     MPIDI_FUNC_ENTER(MPID_STATE_CONNECTION_DESTROY);
 
-    MPIU_Free(conn->pg_id);
-    MPIU_Free(conn);
+    MPL_free(conn->pg_id);
+    MPL_free(conn);
     
     MPIDI_FUNC_EXIT(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 06794e5..b2e5c4b 100644
--- a/src/mpid/ch3/util/sock/ch3u_getinterfaces.c
+++ b/src/mpid/ch3/util/sock/ch3u_getinterfaces.c
@@ -227,7 +227,7 @@ static int MPIDI_CH3U_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found )
 	struct ifconf			ifconf;
 	int				rc;
 
-	buf_ptr = (char *) MPIU_Malloc(buf_len);
+	buf_ptr = (char *) MPL_malloc(buf_len);
 	if (buf_ptr == NULL) {
 	    fprintf( stderr, "Unable to allocate %d bytes\n", buf_len );
 	    return 1;
@@ -253,7 +253,7 @@ static int MPIDI_CH3U_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found )
 	    buf_len_prev = ifconf.ifc_len;
 	}
 	
-	MPIU_Free(buf_ptr);
+	MPL_free(buf_ptr);
 	buf_len += NUM_IFREQS * sizeof(struct ifreq);
     }
 	
@@ -332,7 +332,7 @@ static int MPIDI_CH3U_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found )
 #endif
     }
 
-    MPIU_Free(buf_ptr);
+    MPL_free(buf_ptr);
     close(fd);
     
     /* If we found a unique address, use that */
diff --git a/src/mpid/ch3/util/sock/findinterfaces.c b/src/mpid/ch3/util/sock/findinterfaces.c
index a4ace46..e7273b9 100644
--- a/src/mpid/ch3/util/sock/findinterfaces.c
+++ b/src/mpid/ch3/util/sock/findinterfaces.c
@@ -117,7 +117,7 @@ static int GetLocalIPs(int32_t *pIP, int max)
 	struct ifconf			ifconf;
 	int				rc;
 
-	buf_ptr = (char *) MPIU_Malloc(buf_len);
+	buf_ptr = (char *) MPL_malloc(buf_len);
 	if (buf_ptr == NULL)
 	    return 0;
 	
@@ -141,7 +141,7 @@ static int GetLocalIPs(int32_t *pIP, int max)
 	    buf_len_prev = ifconf.ifc_len;
 	}
 	
-	MPIU_Free(buf_ptr);
+	MPL_free(buf_ptr);
 	buf_len += NUM_IFREQS * sizeof(struct ifreq);
     }
 	
@@ -190,7 +190,7 @@ static int GetLocalIPs(int32_t *pIP, int max)
 #	endif
     }
 
-    MPIU_Free(buf_ptr);
+    MPL_free(buf_ptr);
     close(fd);
 
     return n;
diff --git a/src/mpid/ch3/util/unordered/unordered.c b/src/mpid/ch3/util/unordered/unordered.c
index d42ab0a..6c6098d 100644
--- a/src/mpid/ch3/util/unordered/unordered.c
+++ b/src/mpid/ch3/util/unordered/unordered.c
@@ -18,8 +18,8 @@ int MPIDI_CH3U_Handle_unordered_recv_pkt(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt)
 
 #if defined(MPIDI_CH3_MSGS_UNORDERED)
 
-#define MPIDI_CH3U_Pkt_send_container_alloc() (MPIU_Malloc(sizeof(MPIDI_CH3_Pkt_send_container_t)))
-#define MPIDI_CH3U_Pkt_send_container_free(pc_) MPIU_Free(pc_)
+#define MPIDI_CH3U_Pkt_send_container_alloc() (MPL_malloc(sizeof(MPIDI_CH3_Pkt_send_container_t)))
+#define MPIDI_CH3U_Pkt_send_container_free(pc_) MPL_free(pc_)
 
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3U_Handle_unordered_recv_pkt
diff --git a/src/mpid/common/datatype/mpid_dataloop.h b/src/mpid/common/datatype/mpid_dataloop.h
index e2b150e..dd1e5ea 100644
--- a/src/mpid/common/datatype/mpid_dataloop.h
+++ b/src/mpid/common/datatype/mpid_dataloop.h
@@ -77,8 +77,8 @@
     MPIU_Ensure_Aint_fits_in_pointer(value_)
 
 /* allocate and free functions must also be defined. */
-#define DLOOP_Malloc MPIU_Malloc
-#define DLOOP_Free   MPIU_Free
+#define DLOOP_Malloc MPL_malloc
+#define DLOOP_Free   MPL_free
 
 /* assert function */
 #define DLOOP_Assert MPIU_Assert
diff --git a/src/mpid/common/datatype/mpid_datatype_contents.c b/src/mpid/common/datatype/mpid_datatype_contents.c
index 8cf924c..6b82950 100644
--- a/src/mpid/common/datatype/mpid_datatype_contents.c
+++ b/src/mpid/common/datatype/mpid_datatype_contents.c
@@ -59,7 +59,7 @@ int MPID_Datatype_set_contents(MPID_Datatype *new_dtp,
 
     contents_size = struct_sz + types_sz + ints_sz + aints_sz;
 
-    cp = (MPID_Datatype_contents *) MPIU_Malloc(contents_size);
+    cp = (MPID_Datatype_contents *) MPL_malloc(contents_size);
     /* --BEGIN ERROR HANDLING-- */
     if (cp == NULL) {
 	mpi_errno = MPIR_Err_create_code(MPI_SUCCESS,
@@ -130,7 +130,7 @@ void MPID_Datatype_free_contents(MPID_Datatype *dtp)
 	}
     }
 
-    MPIU_Free(dtp->contents);
+    MPL_free(dtp->contents);
     dtp->contents = NULL;
 }
 
diff --git a/src/mpid/common/datatype/mpid_type_debug.c b/src/mpid/common/datatype/mpid_type_debug.c
index cef21b1..586bec4 100644
--- a/src/mpid/common/datatype/mpid_type_debug.c
+++ b/src/mpid/common/datatype/mpid_type_debug.c
@@ -506,9 +506,9 @@ static char *MPIDI_Datatype_depth_spacing(int depth)
 }
 
 #define __mpidi_datatype_free_and_return { \
- if (cp->nr_ints  > 0) MPIU_Free(ints);   \
- if (cp->nr_aints > 0) MPIU_Free(aints);   \
- if (cp->nr_types > 0) MPIU_Free(types);   \
+ if (cp->nr_ints  > 0) MPL_free(ints);   \
+ if (cp->nr_aints > 0) MPL_free(aints);   \
+ if (cp->nr_types > 0) MPL_free(types);   \
  return;                                 }
 
 void MPIDI_Datatype_contents_printf(MPI_Datatype type,
@@ -540,17 +540,17 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 
     if (cp->nr_ints > 0)
     {
-      ints = (int *) MPIU_Malloc(cp->nr_ints * sizeof(int));
+      ints = (int *) MPL_malloc(cp->nr_ints * sizeof(int));
       MPIDI_Datatype_get_contents_ints(cp, ints);
     }
 
     if (cp->nr_aints > 0) {
-      aints = (MPI_Aint *) MPIU_Malloc(cp->nr_aints * sizeof(MPI_Aint));
+      aints = (MPI_Aint *) MPL_malloc(cp->nr_aints * sizeof(MPI_Aint));
       MPIDI_Datatype_get_contents_aints(cp, aints);
     }
 
     if (cp->nr_types > 0) {
-      types = (MPI_Datatype *) MPIU_Malloc(cp->nr_types * sizeof(MPI_Datatype));
+      types = (MPI_Datatype *) MPL_malloc(cp->nr_types * sizeof(MPI_Datatype));
       MPIDI_Datatype_get_contents_types(cp, types);
     }
 
diff --git a/src/mpid/common/datatype/mpid_type_indexed.c b/src/mpid/common/datatype/mpid_type_indexed.c
index 69e23a1..6ec22c3 100644
--- a/src/mpid/common/datatype/mpid_type_indexed.c
+++ b/src/mpid/common/datatype/mpid_type_indexed.c
@@ -216,7 +216,7 @@ int MPID_Type_indexed(int count,
     new_dtp->is_contig = 0;
     if(old_is_contig)
     {
-	MPI_Aint *blklens = MPIU_Malloc(count *sizeof(MPI_Aint));
+	MPI_Aint *blklens = MPL_malloc(count *sizeof(MPI_Aint));
 	for (i=0; i<count; i++)
 		blklens[i] = blocklength_array[i];
         contig_count = MPID_Type_indexed_count_contig(count,
@@ -230,7 +230,7 @@ int MPID_Type_indexed(int count,
         {
             new_dtp->is_contig = 1;
         }
-	MPIU_Free(blklens);
+	MPL_free(blklens);
     }
 
     *newtype = new_dtp->handle;
diff --git a/src/mpid/common/hcoll/hcoll_init.c b/src/mpid/common/hcoll/hcoll_init.c
index 200c919..750cc94 100644
--- a/src/mpid/common/hcoll/hcoll_init.c
+++ b/src/mpid/common/hcoll/hcoll_init.c
@@ -181,7 +181,7 @@ int hcoll_comm_create(MPID_Comm * comm_ptr, void *param)
         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));
+    comm_ptr->coll_fns = (MPID_Collops *) MPL_malloc(sizeof(MPID_Collops));
     memset(comm_ptr->coll_fns, 0, sizeof(MPID_Collops));
     if (comm_ptr->hcoll_priv.hcoll_origin_coll_fns != 0) {
         memcpy(comm_ptr->coll_fns, comm_ptr->hcoll_priv.hcoll_origin_coll_fns,
@@ -226,7 +226,7 @@ int hcoll_comm_destroy(MPID_Comm * comm_ptr, void *param)
     context_destroyed = 0;
     if ((NULL != comm_ptr) && (0 != comm_ptr->hcoll_priv.is_hcoll_init)) {
         if (NULL != comm_ptr->coll_fns) {
-            MPIU_Free(comm_ptr->coll_fns);
+            MPL_free(comm_ptr->coll_fns);
         }
         comm_ptr->coll_fns = comm_ptr->hcoll_priv.hcoll_origin_coll_fns;
         hcoll_destroy_context(comm_ptr->hcoll_priv.hcoll_context,
diff --git a/src/mpid/common/sched/mpidu_sched.c b/src/mpid/common/sched/mpidu_sched.c
index 0836d30..5af6535 100644
--- a/src/mpid/common/sched/mpidu_sched.c
+++ b/src/mpid/common/sched/mpidu_sched.c
@@ -474,7 +474,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));
+        s->entries = MPL_realloc(s->entries, 2 * s->size * sizeof(struct MPIDU_Sched_entry));
         if (s->entries == NULL)
             MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomem");
         s->size *= 2;
@@ -971,8 +971,8 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
             }
 
             s->req = NULL;
-            MPIU_Free(s->entries);
-            MPIU_Free(s);
+            MPL_free(s->entries);
+            MPL_free(s);
 
             if (made_progress)
                 *made_progress = TRUE;
diff --git a/src/mpid/common/sock/iocp/sock.c b/src/mpid/common/sock/iocp/sock.c
index 4a86cc2..cc02e84 100644
--- a/src/mpid/common/sock/iocp/sock.c
+++ b/src/mpid/common/sock/iocp/sock.c
@@ -553,7 +553,7 @@ static int already_used_or_add(char *host, socki_host_name_t **list)
     }
 
     /* the host has not been used so add a node for it */
-    iter = (socki_host_name_t*)MPIU_Malloc(sizeof(socki_host_name_t));
+    iter = (socki_host_name_t*)MPL_malloc(sizeof(socki_host_name_t));
     if (!iter)
     {
 	/* if out of memory then treat it as not found */
@@ -587,7 +587,7 @@ static void socki_free_host_list(socki_host_name_t *list)
     {
 	iter = list;
 	list = list->next;
-	MPIU_Free(iter);
+	MPL_free(iter);
     }
 }
 
@@ -844,7 +844,7 @@ int MPIDU_Sock_native_to_sock(MPIDU_Sock_set_t set, MPIDU_SOCK_NATIVE_FD fd, voi
     }
 
     /* setup the structures */
-    sock_state = (sock_state_t*)MPIU_Malloc(sizeof(sock_state_t));
+    sock_state = (sock_state_t*)MPL_malloc(sizeof(sock_state_t));
     if (sock_state == NULL)
     {
 	mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPIDU_SOCK_ERR_NOMEM, "**nomem", 0);
@@ -902,7 +902,7 @@ int MPIDU_Sock_listen(MPIDU_Sock_set_t set, void * user_ptr, int * port, MPIDU_S
 	return mpi_errno;
     }
 
-    listen_state = (sock_state_t*)MPIU_Malloc(sizeof(sock_state_t));
+    listen_state = (sock_state_t*)MPL_malloc(sizeof(sock_state_t));
     init_state_struct(listen_state);
     mpi_errno = easy_create_ranged(&listen_state->listen_sock, *port, INADDR_ANY);
     if (mpi_errno != MPI_SUCCESS)
@@ -933,10 +933,10 @@ int MPIDU_Sock_listen(MPIDU_Sock_set_t set, void * user_ptr, int * port, MPIDU_S
     /* post the accept(s) last to make sure the listener state structure is completely initialized before
        a completion thread has the chance to satisfy the AcceptEx call */
 
-    listener_copies = (sock_state_t**)MPIU_Malloc(g_num_posted_accepts * sizeof(sock_state_t*));
+    listener_copies = (sock_state_t**)MPL_malloc(g_num_posted_accepts * sizeof(sock_state_t*));
     for (i=0; i<g_num_posted_accepts; i++)
     {
-	listener_copies[i] = (sock_state_t*)MPIU_Malloc(sizeof(sock_state_t));
+	listener_copies[i] = (sock_state_t*)MPL_malloc(sizeof(sock_state_t));
 	MPIDI_FUNC_ENTER(MPID_STATE_MEMCPY);
 	memcpy(listener_copies[i], listen_state, sizeof(*listen_state));
 	MPIDI_FUNC_EXIT(MPID_STATE_MEMCPY);
@@ -947,14 +947,14 @@ int MPIDU_Sock_listen(MPIDU_Sock_set_t set, void * user_ptr, int * port, MPIDU_S
 	mpi_errno = post_next_accept(listener_copies[i]);
 	if (mpi_errno != MPI_SUCCESS)
 	{
-	    MPIU_Free(listener_copies);
+	    MPL_free(listener_copies);
 	    mpi_errno = MPIR_Err_create_code(mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPIDU_SOCK_ERR_FAIL, "**post_accept", 0);
 	    MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_LISTEN);
 	    return mpi_errno;
 	}
     }
     listen_state->list = listener_copies[g_num_posted_accepts-1];
-    MPIU_Free(listener_copies);
+    MPL_free(listener_copies);
 
     *sock = listen_state;
     /*printf("listening socket %d\n", listen_state->listen_sock);fflush(stdout);*/
@@ -984,7 +984,7 @@ int MPIDU_Sock_accept(MPIDU_Sock_t listener_sock, MPIDU_Sock_set_t set, void * u
 	return mpi_errno;
     }
 
-    accept_state = MPIU_Malloc(sizeof(sock_state_t));
+    accept_state = MPL_malloc(sizeof(sock_state_t));
     if (accept_state == NULL)
     {
 	*sock = NULL;
@@ -1158,7 +1158,7 @@ int MPIDU_Sock_post_connect(MPIDU_Sock_set_t set, void * user_ptr, char * host_d
     memset(&sockAddr,0,sizeof(sockAddr));
 
     /* setup the structures */
-    connect_state = (sock_state_t*)MPIU_Malloc(sizeof(sock_state_t));
+    connect_state = (sock_state_t*)MPL_malloc(sizeof(sock_state_t));
     init_state_struct(connect_state);
     connect_state->cur_host = connect_state->host_description;
     MPL_strncpy(connect_state->host_description, host_description, SOCKI_DESCRIPTION_LENGTH);
diff --git a/src/mpid/common/sock/poll/errnames.txt b/src/mpid/common/sock/poll/errnames.txt
index 98bdc2f..f7b7717 100644
--- a/src/mpid/common/sock/poll/errnames.txt
+++ b/src/mpid/common/sock/poll/errnames.txt
@@ -11,7 +11,7 @@
 **sock|poll|connclosed %d %d %d %s:connection closed by peer (set=%d,sock=%d,errno=%d:%s)
 **sock|poll|connfailed %d %d %d %s:connection failure (set=%d,sock=%d,errno=%d:%s)
 **sock|poll|connrefused %d %d %s:connection refused (set=%d,sock=%d,host=%s)
-**sock|poll|eqmalloc:MPIU_Malloc failed to allocate memory for an event queue structure
+**sock|poll|eqmalloc:MPL_malloc failed to allocate memory for an event queue structure
 **sock|poll|eqfail:fatal error: failed to enqueue an event; event was lost
 **sock|poll|eqfail %d %d %d:fatal error: failed to enqueue an event; event was lost (set=%d,sock=%d,op=%d)
 **sock|poll|getport %d %s:failed to obtain port number of listener (errno=%d:%s)
diff --git a/src/mpid/common/sock/poll/sock_set.i b/src/mpid/common/sock/poll/sock_set.i
index ad101d4..f1dabce 100644
--- a/src/mpid/common/sock/poll/sock_set.i
+++ b/src/mpid/common/sock/poll/sock_set.i
@@ -22,7 +22,7 @@ int MPIDU_Sock_create_set(struct MPIDU_Sock_set ** sock_setp)
     /*
      * Allocate and initialized a new sock set structure
      */
-    sock_set = MPIU_Malloc(sizeof(struct MPIDU_Sock_set));
+    sock_set = MPL_malloc(sizeof(struct MPIDU_Sock_set));
     /* --BEGIN ERROR HANDLING-- */
     if (sock_set == NULL)
     { 
@@ -163,7 +163,7 @@ int MPIDU_Sock_create_set(struct MPIDU_Sock_set ** sock_setp)
 	MPIR_THREAD_CHECK_END;
 #	endif
 	
-	MPIU_Free(sock_set);
+	MPL_free(sock_set);
     }
 
     goto fn_exit;
@@ -255,8 +255,8 @@ int MPIDU_Sock_destroy_set(struct MPIDU_Sock_set * sock_set)
     /*
      * Free structures used by the sock set
      */
-    MPIU_Free(sock_set->pollinfos);
-    MPIU_Free(sock_set->pollfds);
+    MPL_free(sock_set->pollinfos);
+    MPL_free(sock_set->pollfds);
 
     /*
      * Reset the sock set fields
@@ -273,7 +273,7 @@ int MPIDU_Sock_destroy_set(struct MPIDU_Sock_set * sock_set)
     /*
      * Free the structure
      */
-    MPIU_Free(sock_set);
+    MPL_free(sock_set);
     
 #ifdef USE_SOCK_VERIFY
   fn_exit:
diff --git a/src/mpid/common/sock/poll/socki_util.i b/src/mpid/common/sock/poll/socki_util.i
index 594b0cc..f9dde27 100644
--- a/src/mpid/common/sock/poll/socki_util.i
+++ b/src/mpid/common/sock/poll/socki_util.i
@@ -421,7 +421,7 @@ int MPIDI_Sock_update_sock_set( struct MPIDU_Sock_set *sock_set,
     }
 
     if (sock_set->pollfds_active != sock_set->pollfds) {
-	MPIU_Free(sock_set->pollfds_active);
+	MPL_free(sock_set->pollfds_active);
     }
 
     sock_set->pollfds_updated = FALSE;
@@ -576,7 +576,7 @@ static int MPIDU_Socki_sock_alloc(struct MPIDU_Sock_set * sock_set, struct MPIDU
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDU_SOCKI_SOCK_ALLOC);
     
     /* FIXME: Should this use the CHKPMEM macros (perm malloc)? */
-    sock = MPIU_Malloc(sizeof(struct MPIDU_Sock));
+    sock = MPL_malloc(sizeof(struct MPIDU_Sock));
     /* --BEGIN ERROR HANDLING-- */
     if (sock == NULL)
     {
@@ -609,7 +609,7 @@ static int MPIDU_Socki_sock_alloc(struct MPIDU_Sock_set * sock_set, struct MPIDU
     {
 	int elem;
 	
-	pollfds = MPIU_Malloc((sock_set->poll_array_sz + MPIDU_SOCK_SET_DEFAULT_SIZE) * sizeof(struct pollfd));
+	pollfds = MPL_malloc((sock_set->poll_array_sz + MPIDU_SOCK_SET_DEFAULT_SIZE) * sizeof(struct pollfd));
 	/* --BEGIN ERROR HANDLING-- */
 	if (pollfds == NULL)
 	{
@@ -618,7 +618,7 @@ static int MPIDU_Socki_sock_alloc(struct MPIDU_Sock_set * sock_set, struct MPIDU
 	    goto fn_fail;
 	}
 	/* --END ERROR HANDLING-- */
-	pollinfos = MPIU_Malloc((sock_set->poll_array_sz + MPIDU_SOCK_SET_DEFAULT_SIZE) * sizeof(struct pollinfo));
+	pollinfos = MPL_malloc((sock_set->poll_array_sz + MPIDU_SOCK_SET_DEFAULT_SIZE) * sizeof(struct pollinfo));
 	/* --BEGIN ERROR HANDLING-- */
 	if (pollinfos == NULL)
 	{
@@ -642,7 +642,7 @@ static int MPIDU_Socki_sock_alloc(struct MPIDU_Sock_set * sock_set, struct MPIDU
 #	    ifndef MPICH_IS_THREADED
 	    {
 		memcpy(pollfds, sock_set->pollfds, sock_set->poll_array_sz * sizeof(struct pollfd));
-		MPIU_Free(sock_set->pollfds);
+		MPL_free(sock_set->pollfds);
 	    }
 #	    else
 	    {
@@ -652,13 +652,13 @@ static int MPIDU_Socki_sock_alloc(struct MPIDU_Sock_set * sock_set, struct MPIDU
 		}
 		if  (sock_set->pollfds_active != sock_set->pollfds)
 		{
-		    MPIU_Free(sock_set->pollfds);
+		    MPL_free(sock_set->pollfds);
 		}
 	    }
 #           endif
 	    
 	    memcpy(pollinfos, sock_set->pollinfos, sock_set->poll_array_sz * sizeof(struct pollinfo));
-	    MPIU_Free(sock_set->pollinfos);
+	    MPL_free(sock_set->pollinfos);
 	}
 
 	sock_set->poll_array_elems = avail_elem + 1;
@@ -741,17 +741,17 @@ static int MPIDU_Socki_sock_alloc(struct MPIDU_Sock_set * sock_set, struct MPIDU
   fn_fail:
     if (pollinfos != NULL)
     {
-	MPIU_Free(pollinfos);
+	MPL_free(pollinfos);
     }
 
     if (pollfds != NULL)
     {
-	MPIU_Free(pollfds);
+	MPL_free(pollfds);
     }
 	
     if (sock != NULL)
     {
-	MPIU_Free(sock);
+	MPL_free(sock);
     }
     
     goto fn_exit;
@@ -821,7 +821,7 @@ static void MPIDU_Socki_sock_free(struct MPIDU_Sock * sock)
     sock->sock_set = NULL;
     sock->elem = -1;
     
-    MPIU_Free(sock);
+    MPL_free(sock);
     
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCKI_SOCK_FREE);
 }
@@ -852,7 +852,7 @@ static int MPIDU_Socki_event_enqueue(struct pollinfo * pollinfo, MPIDU_Sock_op_t
 	int i;
 	struct MPIDU_Socki_eventq_table *eventq_table;
 
-	eventq_table = MPIU_Malloc(sizeof(struct MPIDU_Socki_eventq_table));
+	eventq_table = MPL_malloc(sizeof(struct MPIDU_Socki_eventq_table));
 	/* --BEGIN ERROR HANDLING-- */
 	if (eventq_table == NULL)
 	{
@@ -959,7 +959,7 @@ static void MPIDU_Socki_free_eventq_mem(void)
     eventq_table = MPIDU_Socki_eventq_table_head;
     while (eventq_table) {
         eventq_table_next = eventq_table->next;
-        MPIU_Free(eventq_table);
+        MPL_free(eventq_table);
         eventq_table = eventq_table_next;
     }
     MPIDU_Socki_eventq_table_head = NULL;
diff --git a/src/mpid/pamid/include/mpidi_macros.h b/src/mpid/pamid/include/mpidi_macros.h
index 24a5722..8c79b3b 100644
--- a/src/mpid/pamid/include/mpidi_macros.h
+++ b/src/mpid/pamid/include/mpidi_macros.h
@@ -108,10 +108,10 @@ _data_sz_out)                                                   \
  * \param[in] type  The type of the memory, excluding "*"
  * \return Address or NULL
  */
-#define MPIU_Calloc0(count, type)               \
+#define MPL_calloc0(count, type)               \
 ({                                              \
   size_t __size = (count) * sizeof(type);       \
-  type* __p = MPIU_Malloc(__size);              \
+  type* __p = MPL_malloc(__size);              \
   MPID_assert(__p != NULL);                     \
   if (__p != NULL)                              \
     memset(__p, 0, __size);                     \
@@ -122,7 +122,7 @@ _data_sz_out)                                                   \
 ({                                              \
   if (*(p) != NULL)                             \
     {                                           \
-      MPIU_Free(*(p));                          \
+      MPL_free(*(p));                          \
       *(p) = NULL;                              \
     }                                           \
 })
@@ -136,12 +136,12 @@ _data_sz_out)                                                   \
 #define MPID_VCR_GET_LPIDS(comm, taskids)                      \
 ({                                                             \
   int i;                                                       \
-  taskids=MPIU_Malloc((comm->local_size)*sizeof(pami_task_t)); \
+  taskids=MPL_malloc((comm->local_size)*sizeof(pami_task_t)); \
   MPID_assert(taskids != NULL);                                \
   for(i=0; i<comm->local_size; i++)                            \
     taskids[i] = comm->vcr[i]->taskid;                         \
 })
-#define MPID_VCR_FREE_LPIDS(taskids) MPIU_Free(taskids)
+#define MPID_VCR_FREE_LPIDS(taskids) MPL_free(taskids)
 
 #define MPID_GPID_Get(comm_ptr, rank, gpid)             \
 ({                                                      \
diff --git a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
index ff493c7..f09c068 100644
--- a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
+++ b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
@@ -84,7 +84,7 @@ int MPIDO_Allgather_allreduce(const void *sendbuf,
        (send_size & 0x3)==0 &&  /*integer/long allgathers only*/
        (sendtype != MPI_DOUBLE || recvtype != MPI_DOUBLE))       
   {
-    double *tmprbuf = (double *)MPIU_Malloc(recv_size*2);
+    double *tmprbuf = (double *)MPL_malloc(recv_size*2);
     if (tmprbuf == NULL)
       goto direct_algo; /*skip int to fp conversion and go to direct
 			  algo*/
@@ -114,7 +114,7 @@ int MPIDO_Allgather_allreduce(const void *sendbuf,
     for(i = (rank+1)*send_size/sizeof(int); i < recv_size/sizeof(int); ++i) 
       sibuf[i] = (int)tmprbuf[i];
 
-    MPIU_Free(tmprbuf);
+    MPL_free(tmprbuf);
     return rc;
   }
 
@@ -368,7 +368,7 @@ MPIDO_Allgather(const void *sendbuf,
        int is_recv_dev_buf = MPIDI_cuda_is_device_buf(recvbuf);
        if(is_send_dev_buf)
        {
-         scbuf = MPIU_Malloc(sdt_extent * sendcount);
+         scbuf = MPL_malloc(sdt_extent * sendcount);
          cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, sdt_extent * sendcount, cudaMemcpyDeviceToHost);
          if (cudaSuccess != cudaerr)
            fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
@@ -377,7 +377,7 @@ MPIDO_Allgather(const void *sendbuf,
          scbuf = sendbuf;
        if(is_recv_dev_buf)
        {
-         rcbuf = MPIU_Malloc(rdt_extent * recvcount);
+         rcbuf = MPL_malloc(rdt_extent * recvcount);
          if(sendbuf == MPI_IN_PLACE)
          {
            cudaError_t cudaerr = CudaMemcpy(rcbuf, recvbuf, rdt_extent * recvcount, cudaMemcpyDeviceToHost);
@@ -390,13 +390,13 @@ MPIDO_Allgather(const void *sendbuf,
        else
          rcbuf = recvbuf;
        int cuda_res =  MPIR_Allgather(scbuf, sendcount, sendtype, rcbuf, recvcount, recvtype, comm_ptr, mpierrno);
-       if(is_send_dev_buf)MPIU_Free(scbuf);
+       if(is_send_dev_buf)MPL_free(scbuf);
        if(is_recv_dev_buf)
          {
            cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, rdt_extent * recvcount, cudaMemcpyHostToDevice);
            if (cudaSuccess != cudaerr)
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
-           MPIU_Free(rcbuf);
+           MPL_free(rcbuf);
          }
        return cuda_res;
     }
@@ -709,7 +709,7 @@ MPIDO_Allgather_simple(const void *sendbuf,
 
   if(!rcv_data_contig)
   {
-    rcv_noncontig_buff = MPIU_Malloc(recv_size * size);
+    rcv_noncontig_buff = MPL_malloc(recv_size * size);
     rbuf = rcv_noncontig_buff;
     if(rcv_noncontig_buff == NULL)
     {
@@ -739,7 +739,7 @@ MPIDO_Allgather_simple(const void *sendbuf,
 
      if(!snd_data_contig)
      {
-        snd_noncontig_buff = MPIU_Malloc(send_size);
+        snd_noncontig_buff = MPL_malloc(send_size);
         sbuf = snd_noncontig_buff;
         if(snd_noncontig_buff == NULL)
         {
@@ -778,9 +778,9 @@ MPIDO_Allgather_simple(const void *sendbuf,
    {
       MPIR_Localcopy(rcv_noncontig_buff, recv_size * size, MPI_CHAR,
                         recvbuf,         recvcount,     recvtype);
-      MPIU_Free(rcv_noncontig_buff);   
+      MPL_free(rcv_noncontig_buff);
    }
-   if(!snd_data_contig)  MPIU_Free(snd_noncontig_buff);
+   if(!snd_data_contig)  MPL_free(snd_noncontig_buff);
    TRACE_ERR("Allgather done\n");
    return MPI_SUCCESS;
 }
diff --git a/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c b/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
index a870b69..6ae680f 100644
--- a/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
+++ b/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
@@ -87,7 +87,7 @@ int MPIDO_Allgatherv_allreduce(const void *sendbuf,
   if ( buffer_sum <= MAX_ALLGATHERV_ALLREDUCE_BUFFER_SIZE &&
        (send_size & 0x3)==0 && (recv_size & 0x3)==0)  
   {
-    double *tmprbuf = (double *)MPIU_Malloc(buffer_sum*2);
+    double *tmprbuf = (double *)MPL_malloc(buffer_sum*2);
     if (tmprbuf == NULL)
       goto direct_algo; /*skip int to fp conversion and go to direct
 			  algo*/
@@ -119,7 +119,7 @@ int MPIDO_Allgatherv_allreduce(const void *sendbuf,
     for(i = start/sizeof(int); i < buffer_sum/sizeof(int); ++i) 
       sibuf[i] = (int)tmprbuf[i];
 
-    MPIU_Free(tmprbuf);
+    MPL_free(tmprbuf);
     return rc;
   }
 
@@ -382,7 +382,7 @@ MPIDO_Allgatherv(const void *sendbuf,
        int is_recv_dev_buf = MPIDI_cuda_is_device_buf(recvbuf);
        if(is_send_dev_buf)
        {
-         scbuf = MPIU_Malloc(sdt_extent * sendcount);
+         scbuf = MPL_malloc(sdt_extent * sendcount);
          cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, sdt_extent * sendcount, cudaMemcpyDeviceToHost);
          if (cudaSuccess != cudaerr)
            fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
@@ -404,7 +404,7 @@ MPIDO_Allgatherv(const void *sendbuf,
            }
          }
          rtotal_buf = (highest_displs+highest_recvcount)*rdt_extent;
-         rcbuf = MPIU_Malloc(rtotal_buf);
+         rcbuf = MPL_malloc(rtotal_buf);
          if(sendbuf == MPI_IN_PLACE)
          {
            cudaError_t cudaerr = CudaMemcpy(rcbuf, recvbuf, rtotal_buf, cudaMemcpyDeviceToHost);
@@ -417,13 +417,13 @@ MPIDO_Allgatherv(const void *sendbuf,
        else
          rcbuf = recvbuf;
        int cuda_res =  MPIR_Allgatherv(scbuf, sendcount, sendtype, rcbuf, recvcounts, displs, recvtype, comm_ptr, mpierrno);
-       if(is_send_dev_buf)MPIU_Free(scbuf);
+       if(is_send_dev_buf)MPL_free(scbuf);
        if(is_recv_dev_buf)
          {
            cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, rtotal_buf, cudaMemcpyHostToDevice);
            if (cudaSuccess != cudaerr)
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
-           MPIU_Free(rcbuf);
+           MPL_free(rcbuf);
          }
        return cuda_res;
     }
@@ -769,7 +769,7 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
       scount = send_size;
       if(!snd_data_contig)
    {
-        snd_noncontig_buff = MPIU_Malloc(send_size);
+        snd_noncontig_buff = MPL_malloc(send_size);
         sbuf = snd_noncontig_buff;
         if(snd_noncontig_buff == NULL)
    {
@@ -792,8 +792,8 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
     totalrecvcount = recvcounts[0];
     recvcontinuous = displs[0] == 0? 1 : 0 ;
     int i;
-    precvdispls = lrecvdispls = MPIU_Malloc(size*sizeof(int));
-    precvcounts = lrecvcounts = MPIU_Malloc(size*sizeof(int));
+    precvdispls = lrecvdispls = MPL_malloc(size*sizeof(int));
+    precvcounts = lrecvcounts = MPL_malloc(size*sizeof(int));
     lrecvdispls[0]= 0;
     lrecvcounts[0]= rcvtypelen * recvcounts[0];
     for(i=1; i<size; ++i)
@@ -808,7 +808,7 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
     TRACE_ERR("Pack receive rcv_contig %zu, recvok %zd, totalrecvcount %zu, recvcontinuous %zu, rcvtypelen %zu, recv_size %zu\n",
               (size_t)rcv_data_contig, (size_t)recvok, (size_t)totalrecvcount, (size_t)recvcontinuous,(size_t)rcvtypelen, (size_t)recv_size);
 
-    rcv_noncontig_buff = MPIU_Malloc(recv_size);
+    rcv_noncontig_buff = MPL_malloc(recv_size);
     rbuf = rcv_noncontig_buff;
     if(rcv_noncontig_buff == NULL)
     {
@@ -875,11 +875,11 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
                   (size_t)extent, (size_t)i,(size_t)displs[i],(size_t)i,(size_t)recvcounts[i],(size_t)displs[i], *(int*)rcbuf);
       }
     }
-    MPIU_Free(rcv_noncontig_buff);
+    MPL_free(rcv_noncontig_buff);
   }
-  if(!snd_data_contig)  MPIU_Free(snd_noncontig_buff);
-  if(lrecvdispls) MPIU_Free(lrecvdispls);
-  if(lrecvcounts) MPIU_Free(lrecvcounts);
+  if(!snd_data_contig)  MPL_free(snd_noncontig_buff);
+  if(lrecvdispls) MPL_free(lrecvdispls);
+  if(lrecvcounts) MPL_free(lrecvcounts);
 
    return MPI_SUCCESS;
 }
diff --git a/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c b/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
index 5396191..aba15ef 100644
--- a/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
+++ b/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
@@ -128,7 +128,7 @@ int MPIDO_Allreduce(const void *sendbuf,
        int is_recv_dev_buf = MPIDI_cuda_is_device_buf(recvbuf);
        if(is_send_dev_buf)
        {
-         scbuf = MPIU_Malloc(dt_extent * count);
+         scbuf = MPL_malloc(dt_extent * count);
          cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, dt_extent * count, cudaMemcpyDeviceToHost);
          if (cudaSuccess != cudaerr) 
            fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
@@ -137,7 +137,7 @@ int MPIDO_Allreduce(const void *sendbuf,
          scbuf = sendbuf;
        if(is_recv_dev_buf)
        {
-         rcbuf = MPIU_Malloc(dt_extent * count);
+         rcbuf = MPL_malloc(dt_extent * count);
          if(sendbuf == MPI_IN_PLACE)
          {
            cudaError_t cudaerr = CudaMemcpy(rcbuf, recvbuf, dt_extent * count, cudaMemcpyDeviceToHost);
@@ -150,13 +150,13 @@ int MPIDO_Allreduce(const void *sendbuf,
        else
          rcbuf = recvbuf;
        int cuda_res =  MPIR_Allreduce(scbuf, rcbuf, count, dt, op, comm_ptr, mpierrno);
-       if(is_send_dev_buf)MPIU_Free(scbuf);
+       if(is_send_dev_buf)MPL_free(scbuf);
        if(is_recv_dev_buf)
          {
            cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, dt_extent * count, cudaMemcpyHostToDevice);
            if (cudaSuccess != cudaerr)
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
-           MPIU_Free(rcbuf);
+           MPL_free(rcbuf);
          }
        return cuda_res;
     }
diff --git a/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c b/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
index 2eed145..84f5500 100644
--- a/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
+++ b/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
@@ -103,7 +103,7 @@ int MPIDO_Alltoall(const void *sendbuf,
        int is_recv_dev_buf = MPIDI_cuda_is_device_buf(recvbuf);
        if(is_send_dev_buf)
        {
-         scbuf = MPIU_Malloc(sdt_extent * sendcount);
+         scbuf = MPL_malloc(sdt_extent * sendcount);
          cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, sdt_extent * sendcount, cudaMemcpyDeviceToHost);
          if (cudaSuccess != cudaerr)
            fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
@@ -112,7 +112,7 @@ int MPIDO_Alltoall(const void *sendbuf,
          scbuf = sendbuf;
        if(is_recv_dev_buf)
        {
-         rcbuf = MPIU_Malloc(recvcount * rdt_extent);
+         rcbuf = MPL_malloc(recvcount * rdt_extent);
          if(sendbuf == MPI_IN_PLACE)
          {
            cudaError_t cudaerr = CudaMemcpy(rcbuf, recvbuf, recvcount * rdt_extent, cudaMemcpyDeviceToHost);
@@ -125,13 +125,13 @@ int MPIDO_Alltoall(const void *sendbuf,
        else
          rcbuf = recvbuf;
        int cuda_res =  MPIR_Alltoall_intra(scbuf, sendcount, sendtype, rcbuf, recvcount, recvtype, comm_ptr, mpierrno);
-       if(is_send_dev_buf)MPIU_Free(scbuf);
+       if(is_send_dev_buf)MPL_free(scbuf);
        if(is_recv_dev_buf)
          {
            cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, recvcount * rdt_extent, cudaMemcpyHostToDevice);
            if (cudaSuccess != cudaerr)
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
-           MPIU_Free(rcbuf);
+           MPL_free(rcbuf);
          }
        return cuda_res;
     }
@@ -338,7 +338,7 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
     send_size = sndlen * sendcount;
     if(!snd_contig)
     {
-      snd_noncontig_buff = MPIU_Malloc(send_size*size);
+      snd_noncontig_buff = MPL_malloc(send_size*size);
       sbuf = snd_noncontig_buff;
       if(snd_noncontig_buff == NULL)
       {
@@ -354,7 +354,7 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
 
   if(!rcv_contig)
   {
-    rcv_noncontig_buff = MPIU_Malloc(recv_size*size);
+    rcv_noncontig_buff = MPL_malloc(recv_size*size);
     rbuf = rcv_noncontig_buff;
     if(rcv_noncontig_buff == NULL)
     {
@@ -406,9 +406,9 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
    {
       MPIR_Localcopy(rcv_noncontig_buff, recv_size*size, MPI_CHAR,
                         recvbuf,         recvcount*size,     recvtype);
-      MPIU_Free(rcv_noncontig_buff);
+      MPL_free(rcv_noncontig_buff);
    }
-   if(!snd_contig)  MPIU_Free(snd_noncontig_buff);
+   if(!snd_contig)  MPL_free(snd_noncontig_buff);
 
    TRACE_ERR("Leaving MPIDO_Alltoall_optimized\n");
    return MPI_SUCCESS;
diff --git a/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c b/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
index 7843798..bbd3a4e 100644
--- a/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
+++ b/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
@@ -103,8 +103,8 @@ int MPIDO_Alltoallv(const void *sendbuf,
         size_t totalsendcount = sendcounts[0];
         sendcontinuous = senddispls[0] == 0? 1 : 0 ;
         int i;
-        psenddispls = lsenddispls = MPIU_Malloc(size*sizeof(int));
-        psendcounts = lsendcounts = MPIU_Malloc(size*sizeof(int));
+        psenddispls = lsenddispls = MPL_malloc(size*sizeof(int));
+        psendcounts = lsendcounts = MPL_malloc(size*sizeof(int));
         lsenddispls[0]= 0;
         lsendcounts[0]= sndtypelen * sendcounts[0];
         for(i=1; i<size; ++i)
@@ -118,7 +118,7 @@ int MPIDO_Alltoallv(const void *sendbuf,
         send_size = sndtypelen * totalsendcount;
         TRACE_ERR("Pack receive sndv_contig %zu, sendok %zd, totalsendcount %zu, sendcontinuous %zu, sndtypelen %zu,  send_size %zu\n",
                 (size_t)snd_contig, (size_t)sendok, (size_t)totalsendcount, (size_t)sendcontinuous, (size_t) sndtypelen, (size_t)send_size);
-        snd_noncontig_buff = MPIU_Malloc(send_size);
+        snd_noncontig_buff = MPL_malloc(send_size);
         sbuf = snd_noncontig_buff;
         if(snd_noncontig_buff == NULL)
         {
@@ -157,8 +157,8 @@ int MPIDO_Alltoallv(const void *sendbuf,
       totalrecvcount = recvcounts[0];
       recvcontinuous = recvdispls[0] == 0? 1 : 0 ;
       int i;
-      precvdispls = lrecvdispls = MPIU_Malloc(size*sizeof(int));
-      precvcounts = lrecvcounts = MPIU_Malloc(size*sizeof(int));
+      precvdispls = lrecvdispls = MPL_malloc(size*sizeof(int));
+      precvcounts = lrecvcounts = MPL_malloc(size*sizeof(int));
       lrecvdispls[0]= 0;
       lrecvcounts[0]= rcvtypelen * recvcounts[0];
       for(i=1; i<size; ++i)
@@ -172,7 +172,7 @@ int MPIDO_Alltoallv(const void *sendbuf,
       recv_size = rcvtypelen * totalrecvcount;
       TRACE_ERR("Pack receive rcv_contig %zu, recvok %zd, totalrecvcount %zu, recvcontinuous %zu, rcvtypelen %zu, recv_size %zu\n",
                 (size_t)rcv_contig, (size_t)recvok, (size_t)totalrecvcount, (size_t)recvcontinuous,(size_t)rcvtypelen, (size_t)recv_size);
-      rcv_noncontig_buff = MPIU_Malloc(recv_size);
+      rcv_noncontig_buff = MPL_malloc(recv_size);
       rbuf = rcv_noncontig_buff;
       if(rcv_noncontig_buff == NULL)
       {
@@ -187,8 +187,8 @@ int MPIDO_Alltoallv(const void *sendbuf,
         size_t totalsendcount = recvcounts[0];
         sendcontinuous = recvdispls[0] == 0? 1 : 0 ;
         int i;
-        psenddispls = lsenddispls = MPIU_Malloc(size*sizeof(int));
-        psendcounts = lsendcounts = MPIU_Malloc(size*sizeof(int));
+        psenddispls = lsenddispls = MPL_malloc(size*sizeof(int));
+        psendcounts = lsendcounts = MPL_malloc(size*sizeof(int));
         lsenddispls[0]= 0;
         lsendcounts[0]= rcvtypelen * recvcounts[0];
         for(i=1; i<size; ++i)
@@ -202,7 +202,7 @@ int MPIDO_Alltoallv(const void *sendbuf,
         send_size = rcvtypelen * totalsendcount;
         TRACE_ERR("Pack MPI_IN_PLACE receive sndv_contig %zu, sendok %zd, totalsendcount %zu, sendcontinuous %zu, rcvtypelen %zu,  send_size %zu\n",
                 (size_t)snd_contig, (size_t)sendok, (size_t)totalsendcount, (size_t)sendcontinuous, (size_t) rcvtypelen, (size_t)send_size);
-        snd_noncontig_buff = MPIU_Malloc(send_size);
+        snd_noncontig_buff = MPL_malloc(send_size);
         sbuf = snd_noncontig_buff;
         if(snd_noncontig_buff == NULL)
         {
@@ -382,13 +382,13 @@ int MPIDO_Alltoallv(const void *sendbuf,
                       (size_t)extent, (size_t)i,(size_t)recvdispls[i],(size_t)i,(size_t)recvcounts[i],(size_t)recvdispls[i], *(int*)rcbuf);
          }
       }
-      MPIU_Free(rcv_noncontig_buff);
+      MPL_free(rcv_noncontig_buff);
    }
-   if(!snd_contig || (sendok != PAMI_SUCCESS))  MPIU_Free(snd_noncontig_buff);
-   if(lrecvdispls) MPIU_Free(lrecvdispls);
-   if(lsenddispls) MPIU_Free(lsenddispls);
-   if(lrecvcounts) MPIU_Free(lrecvcounts);
-   if(lsendcounts) MPIU_Free(lsendcounts);
+   if(!snd_contig || (sendok != PAMI_SUCCESS))  MPL_free(snd_noncontig_buff);
+   if(lrecvdispls) MPL_free(lrecvdispls);
+   if(lsenddispls) MPL_free(lsenddispls);
+   if(lrecvcounts) MPL_free(lrecvcounts);
+   if(lsendcounts) MPL_free(lsendcounts);
 
    TRACE_ERR("Leaving alltoallv\n");
 
@@ -495,8 +495,8 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
       size_t totalsendcount = sendcounts[0];
       sendcontinuous = senddispls[0] == 0? 1 : 0 ;
       int i;
-      psenddispls = lsenddispls = MPIU_Malloc(size*sizeof(int));
-      psendcounts = lsendcounts = MPIU_Malloc(size*sizeof(int));
+      psenddispls = lsenddispls = MPL_malloc(size*sizeof(int));
+      psendcounts = lsendcounts = MPL_malloc(size*sizeof(int));
       lsenddispls[0]= 0;
       lsendcounts[0]= sndtypelen * sendcounts[0];
       for(i=1; i<size; ++i)
@@ -510,7 +510,7 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
       send_size = sndtypelen * totalsendcount;
       TRACE_ERR("Pack receive sndv_contig %zu, sendok %zd, totalsendcount %zu, sendcontinuous %zu, sndtypelen %zu,  send_size %zu\n",
                 (size_t)snd_contig, (size_t)sendok, (size_t)totalsendcount, (size_t)sendcontinuous, (size_t) sndtypelen, (size_t)send_size);
-      snd_noncontig_buff = MPIU_Malloc(send_size);
+      snd_noncontig_buff = MPL_malloc(send_size);
       sbuf = snd_noncontig_buff;
       if(snd_noncontig_buff == NULL)
    {
@@ -549,8 +549,8 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
     totalrecvcount = recvcounts[0];
     recvcontinuous = recvdispls[0] == 0? 1 : 0 ;
     int i;
-    precvdispls = lrecvdispls = MPIU_Malloc(size*sizeof(int));
-    precvcounts = lrecvcounts = MPIU_Malloc(size*sizeof(int));
+    precvdispls = lrecvdispls = MPL_malloc(size*sizeof(int));
+    precvcounts = lrecvcounts = MPL_malloc(size*sizeof(int));
     lrecvdispls[0]= 0;
     lrecvcounts[0]= rcvtypelen * recvcounts[0];
     for(i=1; i<size; ++i)
@@ -564,7 +564,7 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
     recv_size = rcvtypelen * totalrecvcount;
     TRACE_ERR("Pack receive rcv_contig %zu, recvok %zd, totalrecvcount %zu, recvcontinuous %zu, rcvtypelen %zu, recv_size %zu\n",
               (size_t)rcv_contig, (size_t)recvok, (size_t)totalrecvcount, (size_t)recvcontinuous,(size_t)rcvtypelen, (size_t)recv_size);
-    rcv_noncontig_buff = MPIU_Malloc(recv_size);
+    rcv_noncontig_buff = MPL_malloc(recv_size);
     rbuf = rcv_noncontig_buff;
     if(rcv_noncontig_buff == NULL)
     {
@@ -579,8 +579,8 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
       size_t totalsendcount = recvcounts[0];
       sendcontinuous = recvdispls[0] == 0? 1 : 0 ;
       int i;
-      psenddispls = lsenddispls = MPIU_Malloc(size*sizeof(int));
-      psendcounts = lsendcounts = MPIU_Malloc(size*sizeof(int));
+      psenddispls = lsenddispls = MPL_malloc(size*sizeof(int));
+      psendcounts = lsendcounts = MPL_malloc(size*sizeof(int));
       lsenddispls[0]= 0;
       lsendcounts[0]= rcvtypelen * recvcounts[0];
       for(i=1; i<size; ++i)
@@ -594,7 +594,7 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
       send_size = rcvtypelen * totalsendcount;
       TRACE_ERR("Pack MPI_IN_PLACE receive sndv_contig %zu, sendok %zd, totalsendcount %zu, sendcontinuous %zu, rcvtypelen %zu,  send_size %zu\n",
                 (size_t)snd_contig, (size_t)sendok, (size_t)totalsendcount, (size_t)sendcontinuous, (size_t) rcvtypelen, (size_t)send_size);
-      snd_noncontig_buff = MPIU_Malloc(send_size);
+      snd_noncontig_buff = MPL_malloc(send_size);
       sbuf = snd_noncontig_buff;
       if(snd_noncontig_buff == NULL)
       {
@@ -683,13 +683,13 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
                   (size_t)extent, (size_t)i,(size_t)recvdispls[i],(size_t)i,(size_t)recvcounts[i],(size_t)recvdispls[i], *(int*)rcbuf);
       }
     }
-    MPIU_Free(rcv_noncontig_buff);
+    MPL_free(rcv_noncontig_buff);
   }
-  if(!snd_contig || (sendok != PAMI_SUCCESS))  MPIU_Free(snd_noncontig_buff);
-  if(lrecvdispls) MPIU_Free(lrecvdispls);
-  if(lsenddispls) MPIU_Free(lsenddispls);
-  if(lrecvcounts) MPIU_Free(lrecvcounts);
-  if(lsendcounts) MPIU_Free(lsendcounts);
+  if(!snd_contig || (sendok != PAMI_SUCCESS))  MPL_free(snd_noncontig_buff);
+  if(lrecvdispls) MPL_free(lrecvdispls);
+  if(lsenddispls) MPL_free(lsenddispls);
+  if(lrecvcounts) MPL_free(lrecvcounts);
+  if(lsendcounts) MPL_free(lsendcounts);
 
 
    TRACE_ERR("Leaving alltoallv\n");
diff --git a/src/mpid/pamid/src/coll/bcast/mpido_bcast.c b/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
index 6ebf6eb..404fec6 100644
--- a/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
+++ b/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
@@ -112,7 +112,7 @@ int MPIDO_Bcast(void *buffer,
 
    if(!data_contig)
    {
-      noncontig_buff = MPIU_Malloc(data_size);
+      noncontig_buff = MPL_malloc(data_size);
       data_buffer = noncontig_buff;
       if(noncontig_buff == NULL)
       {
@@ -260,7 +260,7 @@ int MPIDO_Bcast(void *buffer,
       if(rank != root)
          MPIR_Localcopy(noncontig_buff, data_size, MPI_CHAR,
                         buffer,         count,     datatype);
-      MPIU_Free(noncontig_buff);
+      MPL_free(noncontig_buff);
    }
 
    TRACE_ERR("leaving bcast\n");
@@ -325,7 +325,7 @@ int MPIDO_Bcast_simple(void *buffer,
 
    if(!data_contig)
    {
-      noncontig_buff = MPIU_Malloc(data_size);
+      noncontig_buff = MPL_malloc(data_size);
       data_buffer = noncontig_buff;
       if(noncontig_buff == NULL)
       {
@@ -363,7 +363,7 @@ int MPIDO_Bcast_simple(void *buffer,
       if(rank != root)
          MPIR_Localcopy(noncontig_buff, data_size, MPI_CHAR,
                         buffer,         count,     datatype);
-      MPIU_Free(noncontig_buff);
+      MPL_free(noncontig_buff);
    }
 
    TRACE_ERR("Exiting MPIDO_Bcast_optimized\n");
diff --git a/src/mpid/pamid/src/coll/gather/mpido_gather.c b/src/mpid/pamid/src/coll/gather/mpido_gather.c
index abbfd3d..117f7ee 100644
--- a/src/mpid/pamid/src/coll/gather/mpido_gather.c
+++ b/src/mpid/pamid/src/coll/gather/mpido_gather.c
@@ -75,11 +75,11 @@ int MPIDO_Gather_reduce(void * sendbuf,
     /* this will likely suck */
     else
     {
-      inplacetemp = MPIU_Malloc(rbytes * sizeof(char));
+      inplacetemp = MPL_malloc(rbytes * sizeof(char));
       memcpy(inplacetemp, recvbuf+(rank * rbytes), rbytes);
       memset(tempbuf, 0, sbytes * size * sizeof(char));
       memcpy(tempbuf+(rank * rbytes), inplacetemp, rbytes);
-      MPIU_Free(inplacetemp);
+      MPL_free(inplacetemp);
     }
   }
   /* everyone might need to speciifcally allocate a tempbuf, or
@@ -91,7 +91,7 @@ int MPIDO_Gather_reduce(void * sendbuf,
    * then copy our contribution to the right spot in the big buffer */
   else
   {
-    tempbuf = MPIU_Malloc(sbytes * size * sizeof(char));
+    tempbuf = MPL_malloc(sbytes * size * sizeof(char));
     if(!tempbuf)
       return MPIR_Err_create_code(MPI_SUCCESS,
                                   MPIR_ERR_RECOVERABLE,
@@ -114,7 +114,7 @@ int MPIDO_Gather_reduce(void * sendbuf,
                     mpierrno);
 
   if(rank != root)
-    MPIU_Free(tempbuf);
+    MPL_free(tempbuf);
 
   return rc;
 }
@@ -203,7 +203,7 @@ int MPIDO_Gather(const void *sendbuf,
        int is_recv_dev_buf = (rank == root) ? MPIDI_cuda_is_device_buf(recvbuf) : 0;
        if(is_send_dev_buf)
        {
-         scbuf = MPIU_Malloc(sdt_extent * sendcount);
+         scbuf = MPL_malloc(sdt_extent * sendcount);
          cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, sdt_extent * sendcount, cudaMemcpyDeviceToHost);
          if (cudaSuccess != cudaerr)
            fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
@@ -212,7 +212,7 @@ int MPIDO_Gather(const void *sendbuf,
          scbuf = sendbuf;
        if(is_recv_dev_buf)
        {
-         rcbuf = MPIU_Malloc(rdt_extent * recvcount);
+         rcbuf = MPL_malloc(rdt_extent * recvcount);
          if(sendbuf == MPI_IN_PLACE)
          {
            cudaError_t cudaerr = CudaMemcpy(rcbuf, recvbuf, rdt_extent * recvcount, cudaMemcpyDeviceToHost);
@@ -225,13 +225,13 @@ int MPIDO_Gather(const void *sendbuf,
        else
          rcbuf = recvbuf;
        int cuda_res =  MPIR_Gather(scbuf, sendcount, sendtype, rcbuf, recvcount, recvtype, root, comm_ptr, mpierrno);
-       if(is_send_dev_buf)MPIU_Free(scbuf);
+       if(is_send_dev_buf)MPL_free(scbuf);
        if(is_recv_dev_buf)
          {
            cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, rdt_extent * recvcount, cudaMemcpyHostToDevice);
            if (cudaSuccess != cudaerr)
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
-           MPIU_Free(rcbuf);
+           MPL_free(rcbuf);
          }
        return cuda_res;
     }
@@ -486,7 +486,7 @@ int MPIDO_Gather_simple(const void *sendbuf,
     sbuf = (char *)sendbuf + true_lb;
     if (!snd_contig)
     {
-        snd_noncontig_buff = MPIU_Malloc(send_size);
+        snd_noncontig_buff = MPL_malloc(send_size);
         sbuf = snd_noncontig_buff;
         if(snd_noncontig_buff == NULL)
         {
@@ -537,7 +537,7 @@ int MPIDO_Gather_simple(const void *sendbuf,
       rbuf = (char *)recvbuf + true_lb;
       if (!rcv_contig)
       {
-        rcv_noncontig_buff = MPIU_Malloc(recv_size * size);
+        rcv_noncontig_buff = MPL_malloc(recv_size * size);
         rbuf = rcv_noncontig_buff;
         if(rcv_noncontig_buff == NULL)
         {
@@ -599,9 +599,9 @@ int MPIDO_Gather_simple(const void *sendbuf,
    {
       MPIR_Localcopy(rcv_noncontig_buff, recv_size*size, MPI_CHAR,
                         recvbuf,         recvcount*size,     recvtype);
-      MPIU_Free(rcv_noncontig_buff);
+      MPL_free(rcv_noncontig_buff);
    }
-   if(!snd_contig)  MPIU_Free(snd_noncontig_buff);
+   if(!snd_contig)  MPL_free(snd_noncontig_buff);
 
    TRACE_ERR("Leaving MPIDO_Gather_optimized\n");
    return MPI_SUCCESS;
diff --git a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
index d0d6b95..7975b83 100644
--- a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
+++ b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
@@ -96,7 +96,7 @@ int MPIDO_Gatherv(const void *sendbuf,
        int is_recv_dev_buf = (rank == root) ? MPIDI_cuda_is_device_buf(recvbuf) : 0;
        if(is_send_dev_buf)
        {
-         scbuf = MPIU_Malloc(sdt_extent * sendcount);
+         scbuf = MPL_malloc(sdt_extent * sendcount);
          cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, sdt_extent * sendcount, cudaMemcpyDeviceToHost);
          if (cudaSuccess != cudaerr)
            fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
@@ -118,7 +118,7 @@ int MPIDO_Gatherv(const void *sendbuf,
            }
          }
          rtotal_buf = (highest_displs+highest_recvcount)*rdt_extent;
-         rcbuf = MPIU_Malloc(rtotal_buf);
+         rcbuf = MPL_malloc(rtotal_buf);
          if(sendbuf == MPI_IN_PLACE)
          {
            cudaError_t cudaerr = CudaMemcpy(rcbuf, recvbuf, rtotal_buf, cudaMemcpyDeviceToHost);
@@ -131,13 +131,13 @@ int MPIDO_Gatherv(const void *sendbuf,
        else
          rcbuf = recvbuf;
        int cuda_res =  MPIR_Gatherv(scbuf, sendcount, sendtype, rcbuf, recvcounts, displs, recvtype, root, comm_ptr, mpierrno);
-       if(is_send_dev_buf)MPIU_Free(scbuf);
+       if(is_send_dev_buf)MPL_free(scbuf);
        if(is_recv_dev_buf)
          {
            cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, rtotal_buf, cudaMemcpyHostToDevice);
            if (cudaSuccess != cudaerr)
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
-           MPIU_Free(rcbuf);
+           MPL_free(rcbuf);
          }
        return cuda_res;
     }
@@ -370,7 +370,7 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
     sbuf = (char *)sendbuf + send_true_lb;
     if(!snd_contig)
     {
-      snd_noncontig_buff = MPIU_Malloc(send_size);
+      snd_noncontig_buff = MPL_malloc(send_size);
       sbuf = snd_noncontig_buff;
       if(snd_noncontig_buff == NULL)
       {
@@ -422,8 +422,8 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
                                 rcvlen, data_ptr, recv_true_lb);
       totalrecvcount = recvcounts[0];
       recvcontinuous = displs[0] == 0? 1 : 0 ;
-          rcounts = (int*)MPIU_Malloc(size);
-          rdispls = (int*)MPIU_Malloc(size);
+          rcounts = (int*)MPL_malloc(size);
+          rdispls = (int*)MPL_malloc(size);
       rdispls[0] = 0;
       rcounts[0] = rcvlen * recvcounts[0];
       for(i = 1; i < size; i++)
@@ -436,7 +436,7 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
           }
       recv_size = rcvlen * totalrecvcount;
 
-          rcv_noncontig_buff = MPIU_Malloc(recv_size);
+          rcv_noncontig_buff = MPL_malloc(recv_size);
           rbuf = rcv_noncontig_buff;
           rtype = PAMI_TYPE_BYTE;
           if(rcv_noncontig_buff == NULL)
@@ -521,14 +521,14 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
       }
 
     }
-      MPIU_Free(rcv_noncontig_buff);
+      MPL_free(rcv_noncontig_buff);
       if(rank == root)
       {
-         MPIU_Free(rcounts);
-         MPIU_Free(rdispls);
+         MPL_free(rcounts);
+         MPL_free(rdispls);
       }
    }
-   if(!snd_contig)  MPIU_Free(snd_noncontig_buff);
+   if(!snd_contig)  MPL_free(snd_noncontig_buff);
 
 
    TRACE_ERR("Leaving MPIDO_Gatherv_optimized\n");
diff --git a/src/mpid/pamid/src/coll/red_scat/mpido_red_scat.c b/src/mpid/pamid/src/coll/red_scat/mpido_red_scat.c
index 55870a8..b3fd99d 100644
--- a/src/mpid/pamid/src/coll/red_scat/mpido_red_scat.c
+++ b/src/mpid/pamid/src/coll/red_scat/mpido_red_scat.c
@@ -62,7 +62,7 @@ int MPIDO_Reduce_scatter(const void *sendbuf,
 
        if(is_send_dev_buf)
        {
-         scbuf = MPIU_Malloc(dt_extent * total_buf);
+         scbuf = MPL_malloc(dt_extent * total_buf);
          cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, dt_extent * total_buf, cudaMemcpyDeviceToHost);
          if (cudaSuccess != cudaerr) 
            fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
@@ -72,7 +72,7 @@ int MPIDO_Reduce_scatter(const void *sendbuf,
 
        if(is_recv_dev_buf)
        {
-         rcbuf = MPIU_Malloc(total_buf * dt_extent);
+         rcbuf = MPL_malloc(total_buf * dt_extent);
          if(sendbuf == MPI_IN_PLACE)
          {
            cudaError_t cudaerr = CudaMemcpy(rcbuf, recvbuf, dt_extent * total_buf, cudaMemcpyDeviceToHost);
@@ -86,13 +86,13 @@ int MPIDO_Reduce_scatter(const void *sendbuf,
          rcbuf = recvbuf;
 
        int cuda_res =  MPIR_Reduce_scatter(scbuf, rcbuf, recvcounts, datatype, op, comm_ptr, mpierrno);
-       if(is_send_dev_buf)MPIU_Free(scbuf);
+       if(is_send_dev_buf)MPL_free(scbuf);
        if(is_recv_dev_buf)
        {
          cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, dt_extent * total_buf, cudaMemcpyHostToDevice);
          if (cudaSuccess != cudaerr)
            fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
-         MPIU_Free(rcbuf);
+         MPL_free(rcbuf);
        }
        return cuda_res;
     }
@@ -135,7 +135,7 @@ int MPIDO_Reduce_scatter_block(const void *sendbuf,
        int i;
        if(is_send_dev_buf)
        {
-         scbuf = MPIU_Malloc(dt_extent * recvcount * size);
+         scbuf = MPL_malloc(dt_extent * recvcount * size);
          cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, dt_extent * recvcount * size, cudaMemcpyDeviceToHost);
          if (cudaSuccess != cudaerr) 
            fprintf(stderr, "cudaMemcpy failed: %s recvbuf: %p scbuf: %p is_send_dev_buf: %d is_recv_dev_buf: %p sendbuf: %p\n", CudaGetErrorString(cudaerr), recvbuf, scbuf, is_send_dev_buf,is_recv_dev_buf, sendbuf );
@@ -145,7 +145,7 @@ int MPIDO_Reduce_scatter_block(const void *sendbuf,
 
        if(is_recv_dev_buf)
        {
-         rcbuf = MPIU_Malloc(dt_extent * recvcount * size);
+         rcbuf = MPL_malloc(dt_extent * recvcount * size);
          if(sendbuf == MPI_IN_PLACE)
          {
            cudaError_t cudaerr = CudaMemcpy(rcbuf, recvbuf, dt_extent * recvcount * size, cudaMemcpyDeviceToHost);
@@ -163,13 +163,13 @@ int MPIDO_Reduce_scatter_block(const void *sendbuf,
          cuda_res =  MPIR_Reduce_scatter_block_intra(scbuf, rcbuf, recvcount, datatype, op, comm_ptr, mpierrno);
        else 
          cuda_res =  MPIR_Reduce_scatter_block_inter(scbuf, rcbuf, recvcount, datatype, op, comm_ptr, mpierrno);
-       if(is_send_dev_buf)MPIU_Free(scbuf);
+       if(is_send_dev_buf)MPL_free(scbuf);
        if(is_recv_dev_buf)
        {
          cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, dt_extent * recvcount * size, cudaMemcpyHostToDevice);
          if (cudaSuccess != cudaerr)
            fprintf(stderr, "cudaMemcpy failed: %s recvbuf: %p rcbuf: %p is_send_dev_buf: %d is_recv_dev_buf: %p sendbuf: %p\n", CudaGetErrorString(cudaerr), recvbuf, rcbuf, is_send_dev_buf,is_recv_dev_buf, sendbuf );
-         MPIU_Free(rcbuf);
+         MPL_free(rcbuf);
        }
        return cuda_res;
     }
diff --git a/src/mpid/pamid/src/coll/reduce/mpido_reduce.c b/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
index 3668141..e5ff16b 100644
--- a/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
+++ b/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
@@ -99,7 +99,7 @@ int MPIDO_Reduce(const void *sendbuf,
       void *destbuf = recvbuf;
       if(rank != root) /* temp buffer for non-root destbuf */
       {
-         tbuf = destbuf = MPIU_Malloc(tsize);
+         tbuf = destbuf = MPL_malloc(tsize);
       }
       /* Switch to comm->coll_fns->fn() */
       MPIDO_Allreduce(sendbuf,
@@ -110,7 +110,7 @@ int MPIDO_Reduce(const void *sendbuf,
                       comm_ptr,
                       mpierrno);
       if(tbuf)
-         MPIU_Free(tbuf);
+         MPL_free(tbuf);
       return 0;
    }
    if(selected_type == MPID_COLL_USE_MPICH || rc != MPI_SUCCESS)
@@ -128,7 +128,7 @@ int MPIDO_Reduce(const void *sendbuf,
          int is_recv_dev_buf = MPIDI_cuda_is_device_buf(recvbuf);
          if(is_send_dev_buf)
          {
-           scbuf = MPIU_Malloc(dt_extent * count);
+           scbuf = MPL_malloc(dt_extent * count);
            cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, dt_extent * count, cudaMemcpyDeviceToHost);
            if (cudaSuccess != cudaerr) 
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
@@ -137,7 +137,7 @@ int MPIDO_Reduce(const void *sendbuf,
            scbuf = sendbuf;
          if(is_recv_dev_buf)
          {
-           rcbuf = MPIU_Malloc(dt_extent * count);
+           rcbuf = MPL_malloc(dt_extent * count);
            if(sendbuf == MPI_IN_PLACE)
            {
              cudaError_t cudaerr = CudaMemcpy(rcbuf, recvbuf, dt_extent * count, cudaMemcpyDeviceToHost);
@@ -150,13 +150,13 @@ int MPIDO_Reduce(const void *sendbuf,
          else
            rcbuf = recvbuf;
          int cuda_res =  MPIR_Reduce(scbuf, rcbuf, count, datatype, op, root, comm_ptr, mpierrno);
-         if(is_send_dev_buf)MPIU_Free(scbuf);
+         if(is_send_dev_buf)MPL_free(scbuf);
          if(is_recv_dev_buf)
          {
            cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, dt_extent * count, cudaMemcpyHostToDevice);
            if (cudaSuccess != cudaerr)
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
-           MPIU_Free(rcbuf);
+           MPL_free(rcbuf);
          }
          return cuda_res;
       }
diff --git a/src/mpid/pamid/src/coll/scan/mpido_scan.c b/src/mpid/pamid/src/coll/scan/mpido_scan.c
index 718d377..9c2c29a 100644
--- a/src/mpid/pamid/src/coll/scan/mpido_scan.c
+++ b/src/mpid/pamid/src/coll/scan/mpido_scan.c
@@ -146,7 +146,7 @@ int MPIDO_Doscan(const void *sendbuf, void *recvbuf,
          int is_recv_dev_buf = MPIDI_cuda_is_device_buf(recvbuf);
          if(is_send_dev_buf)
          {
-           scbuf = MPIU_Malloc(dt_extent * count);
+           scbuf = MPL_malloc(dt_extent * count);
            cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, dt_extent * count, cudaMemcpyDeviceToHost);
            if (cudaSuccess != cudaerr) 
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
@@ -155,7 +155,7 @@ int MPIDO_Doscan(const void *sendbuf, void *recvbuf,
            scbuf = sendbuf;
          if(is_recv_dev_buf)
          {
-           rcbuf = MPIU_Malloc(dt_extent * count);
+           rcbuf = MPL_malloc(dt_extent * count);
            if(sendbuf == MPI_IN_PLACE)
            {
            cudaError_t cudaerr = CudaMemcpy(rcbuf, recvbuf, dt_extent * count, cudaMemcpyDeviceToHost);
@@ -172,13 +172,13 @@ int MPIDO_Doscan(const void *sendbuf, void *recvbuf,
            cuda_res =  MPIR_Exscan(scbuf, rcbuf, count, datatype, op, comm_ptr, mpierrno);
          else
            cuda_res =  MPIR_Scan(scbuf, rcbuf, count, datatype, op, comm_ptr, mpierrno);
-         if(is_send_dev_buf)MPIU_Free(scbuf);
+         if(is_send_dev_buf)MPL_free(scbuf);
          if(is_recv_dev_buf)
          {
            cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, dt_extent * count, cudaMemcpyHostToDevice);
            if (cudaSuccess != cudaerr)
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
-           MPIU_Free(rcbuf);
+           MPL_free(rcbuf);
          }
          return cuda_res;
       }
diff --git a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
index 806ac8d..8262c51 100644
--- a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
+++ b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
@@ -62,7 +62,7 @@ int MPIDO_Scatter_bcast(void * sendbuf,
                             recvtype,
                             nbytes);
 
-    tempbuf = MPIU_Malloc(nbytes * size);
+    tempbuf = MPL_malloc(nbytes * size);
     if(!tempbuf)
     {
       return MPIR_Err_create_code(MPI_SUCCESS,
@@ -83,7 +83,7 @@ int MPIDO_Scatter_bcast(void * sendbuf,
     memcpy(recvbuf, tempbuf+(rank*nbytes), nbytes);
 
   if (rank!=root)
-    MPIU_Free(tempbuf);
+    MPL_free(tempbuf);
 
   return rc;
 }
@@ -151,7 +151,7 @@ int MPIDO_Scatter(const void *sendbuf,
        int is_recv_dev_buf = MPIDI_cuda_is_device_buf(recvbuf);
        if(is_send_dev_buf)
        {
-         scbuf = MPIU_Malloc(sdt_extent * sendcount);
+         scbuf = MPL_malloc(sdt_extent * sendcount);
          cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, sdt_extent * sendcount, cudaMemcpyDeviceToHost);
          if (cudaSuccess != cudaerr)
            fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
@@ -160,19 +160,19 @@ int MPIDO_Scatter(const void *sendbuf,
          scbuf = sendbuf;
        if(is_recv_dev_buf)
        {
-         rcbuf = MPIU_Malloc(rdt_extent * recvcount);
+         rcbuf = MPL_malloc(rdt_extent * recvcount);
          CudaMemcpy(rcbuf, recvbuf, rdt_extent * recvcount, cudaMemcpyDeviceToHost);
        }
        else
          rcbuf = recvbuf;
        int cuda_res =  MPIR_Scatter(scbuf, sendcount, sendtype, rcbuf, recvcount, recvtype, root, comm_ptr, mpierrno);
-       if(is_send_dev_buf)MPIU_Free(scbuf);
+       if(is_send_dev_buf)MPL_free(scbuf);
        if(is_recv_dev_buf)
          {
            cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, rdt_extent * recvcount, cudaMemcpyHostToDevice);
            if (cudaSuccess != cudaerr)
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
-           MPIU_Free(rcbuf);
+           MPL_free(rcbuf);
          }
        return cuda_res;
     }
@@ -419,7 +419,7 @@ int MPIDO_Scatter_simple(const void *sendbuf,
     {
       if (!snd_contig)
       {
-        snd_noncontig_buff = MPIU_Malloc(send_size * size);
+        snd_noncontig_buff = MPL_malloc(send_size * size);
         sbuf = snd_noncontig_buff;
         if(snd_noncontig_buff == NULL)
         {
@@ -440,7 +440,7 @@ int MPIDO_Scatter_simple(const void *sendbuf,
       {
         if (!rcv_contig)
         {
-          rcv_noncontig_buff = MPIU_Malloc(recv_size);
+          rcv_noncontig_buff = MPL_malloc(recv_size);
           rbuf = rcv_noncontig_buff;
           if(rcv_noncontig_buff == NULL)
           {
@@ -458,7 +458,7 @@ int MPIDO_Scatter_simple(const void *sendbuf,
     {
       if (!rcv_contig)
       {
-        rcv_noncontig_buff = MPIU_Malloc(recv_size);
+        rcv_noncontig_buff = MPL_malloc(recv_size);
         rbuf = rcv_noncontig_buff;
         if(rcv_noncontig_buff == NULL)
         {
@@ -520,9 +520,9 @@ int MPIDO_Scatter_simple(const void *sendbuf,
    {
       MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR,
                         recvbuf,         recvcount,     recvtype);
-      MPIU_Free(rcv_noncontig_buff);
+      MPL_free(rcv_noncontig_buff);
    }
-   if(!snd_contig)  MPIU_Free(snd_noncontig_buff);
+   if(!snd_contig)  MPL_free(snd_noncontig_buff);
 
 
    TRACE_ERR("Leaving MPIDO_Scatter_optimized\n");
diff --git a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
index 485f0a6..c479870 100644
--- a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
+++ b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
@@ -51,7 +51,7 @@ int MPIDO_Scatterv_bcast(void *sendbuf,
 
   if (rank != root)
   {
-    tempbuf = MPIU_Malloc(dtsize * sum);
+    tempbuf = MPL_malloc(dtsize * sum);
     if (!tempbuf)
       return MPIR_Err_create_code(MPI_SUCCESS,
                                   MPIR_ERR_RECOVERABLE,
@@ -72,7 +72,7 @@ int MPIDO_Scatterv_bcast(void *sendbuf,
   memcpy(recvbuf, tempbuf + displs[rank], sendcounts[rank] * dtsize);
 
   if (rank != root)
-    MPIU_Free(tempbuf);
+    MPL_free(tempbuf);
 
   return rc;
 }
@@ -103,7 +103,7 @@ int MPIDO_Scatterv_alltoallv(void * sendbuf,
                           recvtype,
                           rbytes);
 
-  rbuf = MPIU_Malloc(size * rbytes * sizeof(char));
+  rbuf = MPL_malloc(size * rbytes * sizeof(char));
   if(!rbuf)
   {
     return MPIR_Err_create_code(MPI_SUCCESS,
@@ -122,15 +122,15 @@ int MPIDO_Scatterv_alltoallv(void * sendbuf,
   }
   else
   {
-    sdispls = MPIU_Malloc(size * sizeof(int));
-    scounts = MPIU_Malloc(size * sizeof(int));
-    sbuf = MPIU_Malloc(rbytes * sizeof(char));
+    sdispls = MPL_malloc(size * sizeof(int));
+    scounts = MPL_malloc(size * sizeof(int));
+    sbuf = MPL_malloc(rbytes * sizeof(char));
     if(!sdispls || !scounts || !sbuf)
     {
       if(sdispls)
-        MPIU_Free(sdispls);
+        MPL_free(sdispls);
       if(scounts)
-        MPIU_Free(scounts);
+        MPL_free(scounts);
       return MPIR_Err_create_code(MPI_SUCCESS,
                                   MPIR_ERR_RECOVERABLE,
                                   __FUNCTION__,
@@ -142,12 +142,12 @@ int MPIDO_Scatterv_alltoallv(void * sendbuf,
     memset(scounts, 0, size*sizeof(int));
   }
 
-  rdispls = MPIU_Malloc(size * sizeof(int));
-  rcounts = MPIU_Malloc(size * sizeof(int));
+  rdispls = MPL_malloc(size * sizeof(int));
+  rcounts = MPL_malloc(size * sizeof(int));
   if(!rdispls || !rcounts)
   {
     if(rdispls)
-      MPIU_Free(rdispls);
+      MPL_free(rdispls);
     return MPIR_Err_create_code(MPI_SUCCESS,
                                 MPIR_ERR_RECOVERABLE,
                                 __FUNCTION__,
@@ -175,22 +175,22 @@ int MPIDO_Scatterv_alltoallv(void * sendbuf,
 
   if(rank == root && recvbuf == MPI_IN_PLACE)
   {
-    MPIU_Free(rbuf);
-    MPIU_Free(rdispls);
-    MPIU_Free(rcounts);
+    MPL_free(rbuf);
+    MPL_free(rdispls);
+    MPL_free(rcounts);
     return rc;
   }
   else
   {
     memcpy(recvbuf, rbuf, rbytes);
-    MPIU_Free(rbuf);
-    MPIU_Free(rdispls);
-    MPIU_Free(rcounts);
+    MPL_free(rbuf);
+    MPL_free(rdispls);
+    MPL_free(rcounts);
     if(rank != root)
     {
-      MPIU_Free(sbuf);
-      MPIU_Free(sdispls);
-      MPIU_Free(scounts);
+      MPL_free(sbuf);
+      MPL_free(sdispls);
+      MPL_free(scounts);
     }
   }
 
@@ -271,7 +271,7 @@ int MPIDO_Scatterv(const void *sendbuf,
            }
          }
          stotal_buf = (highest_displs+highest_sendcount)*sdt_extent;
-         scbuf = MPIU_Malloc(stotal_buf);
+         scbuf = MPL_malloc(stotal_buf);
          cudaError_t cudaerr = CudaMemcpy(scbuf, sendbuf, stotal_buf, cudaMemcpyDeviceToHost);
          if (cudaSuccess != cudaerr)
            fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
@@ -280,19 +280,19 @@ int MPIDO_Scatterv(const void *sendbuf,
          scbuf = sendbuf;
        if(is_recv_dev_buf)
        {
-         rcbuf = MPIU_Malloc(recvcount * rdt_extent);
+         rcbuf = MPL_malloc(recvcount * rdt_extent);
          CudaMemcpy(rcbuf, recvbuf, recvcount * rdt_extent, cudaMemcpyDeviceToHost);
        }
        else
          rcbuf = recvbuf;
        int cuda_res =  MPIR_Scatterv(scbuf, sendcounts, displs, sendtype, rcbuf, recvcount, recvtype, root, comm_ptr, mpierrno);
-       if(is_send_dev_buf)MPIU_Free(scbuf);
+       if(is_send_dev_buf)MPL_free(scbuf);
        if(is_recv_dev_buf)
          {
            cudaError_t cudaerr = CudaMemcpy(recvbuf, rcbuf, recvcount * rdt_extent, cudaMemcpyHostToDevice);
            if (cudaSuccess != cudaerr)
              fprintf(stderr, "cudaMemcpy failed: %s\n", CudaGetErrorString(cudaerr));
-           MPIU_Free(rcbuf);
+           MPL_free(rcbuf);
          }
        return cuda_res;
     }
@@ -562,8 +562,8 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
      {
        if (!snd_contig)
        {
-          scounts = (int*)MPIU_Malloc(size);
-          sdispls = (int*)MPIU_Malloc(size);
+          scounts = (int*)MPL_malloc(size);
+          sdispls = (int*)MPL_malloc(size);
           for(i = 0; i < size; i++)
           {
             scounts[i] = ssize * sendcounts[i];
@@ -571,7 +571,7 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
             send_size += scounts[i];
             sndcount  += sendcounts[i];
           }
-          snd_noncontig_buff = MPIU_Malloc(send_size);
+          snd_noncontig_buff = MPL_malloc(send_size);
           sbuf = snd_noncontig_buff;
           stype = PAMI_TYPE_BYTE;
           if(snd_noncontig_buff == NULL)
@@ -594,7 +594,7 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
    {
      if (!rcv_contig)
      {
-       rcv_noncontig_buff = MPIU_Malloc(recv_size);
+       rcv_noncontig_buff = MPL_malloc(recv_size);
        rbuf = rcv_noncontig_buff;
        if(rcv_noncontig_buff == NULL)
        {
@@ -635,13 +635,13 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
    {
       MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR,
                         recvbuf,         recvcount,     recvtype);
-      MPIU_Free(rcv_noncontig_buff);
+      MPL_free(rcv_noncontig_buff);
    }
    if(!snd_contig) 
    {
-     MPIU_Free(snd_noncontig_buff);
-     MPIU_Free(scounts);
-     MPIU_Free(sdispls);
+     MPL_free(snd_noncontig_buff);
+     MPL_free(scounts);
+     MPL_free(sdispls);
    }
 
    TRACE_ERR("Leaving MPIDO_Scatterv_optimized\n");
diff --git a/src/mpid/pamid/src/comm/mpid_comm.c b/src/mpid/pamid/src/comm/mpid_comm.c
index 5359da8..83786b1 100644
--- a/src/mpid/pamid/src/comm/mpid_comm.c
+++ b/src/mpid/pamid/src/comm/mpid_comm.c
@@ -76,7 +76,7 @@ pami_result_t MPIDI_Comm_create_from_pami_geom(pami_geometry_range_t  *task_slic
   {
     num_tasks += (task_slices[i].hi - task_slices[i].lo) + 1;
   }
-  ranks = MPIU_Calloc0(num_tasks, int);
+  ranks = MPL_calloc0(num_tasks, int);
   for(i = 0; i < slice_count; i++)
   {
     int slice_sz = (task_slices[i].hi - task_slices[i].lo) + 1;
@@ -230,7 +230,7 @@ void MPIDI_Coll_comm_create(MPID_Comm *comm)
   if(comm->comm_kind != MPID_INTRACOMM) return;
   /* Create a geometry */
 
-  comm->coll_fns = MPIU_Calloc0(1, MPID_Collops);
+  comm->coll_fns = MPL_calloc0(1, MPID_Collops);
   MPID_assert(comm->coll_fns != NULL);
 
    if(comm->mpid.geometry != MPIDI_Process.world_geometry)
diff --git a/src/mpid/pamid/src/comm/mpid_optcolls.c b/src/mpid/pamid/src/comm/mpid_optcolls.c
index 03192f3..15b45d4 100644
--- a/src/mpid/pamid/src/comm/mpid_optcolls.c
+++ b/src/mpid/pamid/src/comm/mpid_optcolls.c
@@ -37,7 +37,7 @@ static int MPIDI_Check_FCA_envvar(char *string, int *user_range_hi)
       return 1;
     int len = strlen(env);
     len++;
-    char *temp = MPIU_Malloc(sizeof(char) * len);
+    char *temp = MPL_malloc(sizeof(char) * len);
     char *ptrToFree = temp;
     strcpy(temp, env);
     char *sepptr;
@@ -51,7 +51,7 @@ static int MPIDI_Check_FCA_envvar(char *string, int *user_range_hi)
         if(strcasecmp(subsepptr, string) == 0)
         {
           *user_range_hi = atoi(temp_sepptr);
-          MPIU_Free(ptrToFree);
+          MPL_free(ptrToFree);
           return 1;
         }
         else
@@ -62,7 +62,7 @@ static int MPIDI_Check_FCA_envvar(char *string, int *user_range_hi)
         if(strcasecmp(sepptr, string) == 0)
         {
           *user_range_hi = -1;
-          MPIU_Free(ptrToFree);
+          MPL_free(ptrToFree);
           return 1;
         }
         else
@@ -70,7 +70,7 @@ static int MPIDI_Check_FCA_envvar(char *string, int *user_range_hi)
       }
     }
     /* We didn't find it, but the end var was set, so return 0 */
-    MPIU_Free(ptrToFree);
+    MPL_free(ptrToFree);
     return 0;
   }
   if(MPIDI_Process.optimized.collectives == MPID_COLL_FCA)
diff --git a/src/mpid/pamid/src/comm/mpid_selectcolls.c b/src/mpid/pamid/src/comm/mpid_selectcolls.c
index db4ac0c..7c5f247 100644
--- a/src/mpid/pamid/src/comm/mpid_selectcolls.c
+++ b/src/mpid/pamid/src/comm/mpid_selectcolls.c
@@ -617,13 +617,13 @@ void MPIDI_Comm_coll_query(MPID_Comm *comm)
       if(num_algorithms[0] || num_algorithms[1])
       {
          comm->mpid.coll_algorithm[i][0] = (pami_algorithm_t *)
-               MPIU_Malloc(sizeof(pami_algorithm_t) * num_algorithms[0]);
+               MPL_malloc(sizeof(pami_algorithm_t) * num_algorithms[0]);
          comm->mpid.coll_metadata[i][0] = (pami_metadata_t *)
-               MPIU_Malloc(sizeof(pami_metadata_t) * num_algorithms[0]);
+               MPL_malloc(sizeof(pami_metadata_t) * num_algorithms[0]);
          comm->mpid.coll_algorithm[i][1] = (pami_algorithm_t *)
-               MPIU_Malloc(sizeof(pami_algorithm_t) * num_algorithms[1]);
+               MPL_malloc(sizeof(pami_algorithm_t) * num_algorithms[1]);
          comm->mpid.coll_metadata[i][1] = (pami_metadata_t *)
-               MPIU_Malloc(sizeof(pami_metadata_t) * num_algorithms[1]);
+               MPL_malloc(sizeof(pami_metadata_t) * num_algorithms[1]);
          comm->mpid.coll_count[i][0] = num_algorithms[0];
          comm->mpid.coll_count[i][1] = num_algorithms[1];
 
diff --git a/src/mpid/pamid/src/dyntask/mpid_comm_disconnect.c b/src/mpid/pamid/src/dyntask/mpid_comm_disconnect.c
index acf9d47..4bd2400 100644
--- a/src/mpid/pamid/src/dyntask/mpid_comm_disconnect.c
+++ b/src/mpid/pamid/src/dyntask/mpid_comm_disconnect.c
@@ -261,8 +261,8 @@ int MPID_Comm_disconnect(MPID_Comm *comm_ptr)
 	    }
 	  }
 	  k=0;
-	  /*	  local_list = MPIU_Malloc(local_tasks*sizeof(pami_task_t)); */
-	  ranks = MPIU_Malloc(local_tasks*sizeof(int));
+          /*	  local_list = MPL_malloc(local_tasks*sizeof(pami_task_t)); */
+          ranks = MPL_malloc(local_tasks*sizeof(int));
 
 	  for(i=0;i<comm_ptr->local_size;i++) {
 	    for(j=0;j<gsize;j++) {
@@ -371,7 +371,7 @@ int MPID_Comm_disconnect(MPID_Comm *comm_ptr)
 	      total_leaders++;
 	  }
 	  TRACE_ERR("total_leaders=%d\n", total_leaders);
-	  leader_tids = MPIU_Malloc(total_leaders*sizeof(int));
+          leader_tids = MPL_malloc(total_leaders*sizeof(int));
 	  MPIDI_get_allremote_leaders(leader_tids, comm_ptr);
 	  
 	  { /* First Pair of Send / Recv -- All smaller task send to all larger tasks */
@@ -425,7 +425,7 @@ int MPID_Comm_disconnect(MPID_Comm *comm_ptr)
 	    MPIDI_wait_for_AM(comm_ptr->mpid.world_intercomm_cntr, expected_lastAM,
 			      LAST_AM);
 	  }
-	  MPIU_Free(leader_tids);
+          MPL_free(leader_tids);
 	}
 
 	TRACE_ERR("_try_to_disconnect: Going inside final barrier for tranid %lld\n",comm_ptr->mpid.world_intercomm_cntr);
@@ -439,8 +439,8 @@ int MPID_Comm_disconnect(MPID_Comm *comm_ptr)
 	MPIDI_free_tranid_node(comm_ptr->mpid.world_intercomm_cntr);
         mpi_errno = MPIR_Comm_release(comm_ptr,1);
         if (mpi_errno) TRACE_ERR("MPIR_Comm_release returned with mpi_errno=%d\n", mpi_errno);
-	/*	MPIU_Free(local_list); */
-	MPIU_Free(ranks);
+        /*	MPL_free(local_list); */
+        MPL_free(ranks);
     }
     return mpi_errno;
 }
diff --git a/src/mpid/pamid/src/dyntask/mpid_comm_spawn_multiple.c b/src/mpid/pamid/src/dyntask/mpid_comm_spawn_multiple.c
index 6e4a8c8..b7b7eae 100644
--- a/src/mpid/pamid/src/dyntask/mpid_comm_spawn_multiple.c
+++ b/src/mpid/pamid/src/dyntask/mpid_comm_spawn_multiple.c
@@ -37,7 +37,7 @@ static int  MPIDI_mpi_to_pmi_keyvals( MPID_Info *info_ptr, PMI_keyval_t **kv_ptr
     if (nkeys == 0) {
 	goto fn_exit;
     }
-    kv = (PMI_keyval_t *)MPIU_Malloc( nkeys * sizeof(PMI_keyval_t) );
+    kv = (PMI_keyval_t *)MPL_malloc( nkeys * sizeof(PMI_keyval_t) );
 
     for (i=0; i<nkeys; i++) {
 	mpi_errno = MPIR_Info_get_nthkey_impl( info_ptr, i, key );
@@ -45,8 +45,8 @@ static int  MPIDI_mpi_to_pmi_keyvals( MPID_Info *info_ptr, PMI_keyval_t **kv_ptr
           TRACE_ERR("MPIR_Info_get_nthkey_impl returned with mpi_errno=%d\n", mpi_errno);
 	MPIR_Info_get_valuelen_impl( info_ptr, key, &vallen, &flag );
 
-	kv[i].key = MPIU_Strdup(key);
-	kv[i].val = MPIU_Malloc( vallen + 1 );
+        kv[i].key = MPL_strdup(key);
+        kv[i].val = MPL_malloc( vallen + 1 );
 	MPIR_Info_get_impl( info_ptr, key, vallen+1, kv[i].val, &flag );
 	TRACE_OUT("key: <%s>, value: <%s>\n", kv[i].key, kv[i].val);
     }
@@ -69,13 +69,13 @@ static void MPIDI_free_pmi_keyvals(PMI_keyval_t **kv, int size, int *counts)
 	for (j=0; j<counts[i]; j++)
 	{
 	    if (kv[i][j].key != NULL)
-		MPIU_Free((char *)kv[i][j].key);
+                MPL_free((char *)kv[i][j].key);
 	    if (kv[i][j].val != NULL)
-		MPIU_Free(kv[i][j].val);
+                MPL_free(kv[i][j].val);
 	}
 	if (kv[i] != NULL)
 	{
-	    MPIU_Free(kv[i]);
+            MPL_free(kv[i]);
 	}
     }
 }
@@ -159,7 +159,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
 	for (i=0; i<count; i++) {
 	    total_num_processes += maxprocs[i];
 	}
-	pmi_errcodes = (int*)MPIU_Malloc(sizeof(int) * total_num_processes);
+        pmi_errcodes = (int*)MPL_malloc(sizeof(int) * total_num_processes);
 
 	/* initialize them to 0 */
 	for (i=0; i<total_num_processes; i++)
@@ -174,13 +174,13 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
 #ifdef USE_PMI2_API
         MPIU_Assert(count > 0);
         {
-            int *argcs = MPIU_Malloc(count*sizeof(int));
+            int *argcs = MPL_malloc(count*sizeof(int));
             struct MPID_Info preput;
             struct MPID_Info *preput_p[2] = { &preput, &tmp_info_ptr };
 
             MPIU_Assert(argcs);
 
-            info_keyval_sizes = MPIU_Malloc(count * sizeof(int));
+            info_keyval_sizes = MPL_malloc(count * sizeof(int));
 
             /* FIXME cheating on constness */
             preput.key = (char *)MPIDI_PARENT_PORT_KVSKEY;
@@ -217,7 +217,7 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
 	    TRACE_ERR("after PMI2_Job_Spawn - pmi_errno=%d jobId=%s\n", pmi_errno, jobId);
             MPIU_THREAD_CS_ENTER(ALLFUNC,);
 
-	    tmp=MPIU_Strdup(jobId);
+            tmp=MPL_strdup(jobId);
 	    tmp_ret = atoi(strtok(tmp, ";"));
 
 	    if( (pmi_errno == PMI2_SUCCESS) && (tmp_ret != -1) ) {
@@ -229,9 +229,9 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
               PAMI_Resume(MPIDI_Context[0], &ldest, 1);
             }
 
-            MPIU_Free(tmp);
+            MPL_free(tmp);
 
-            MPIU_Free(argcs);
+            MPL_free(argcs);
             if (pmi_errno != PMI2_SUCCESS) {
                TRACE_ERR("PMI2_Job_Spawn returned with pmi_errno=%d\n", pmi_errno);
             }
@@ -243,9 +243,9 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
            the necessary arrays of key/value pairs */
 
         /* convert the infos into PMI keyvals */
-        info_keyval_sizes   = (int *) MPIU_Malloc(count * sizeof(int));
+        info_keyval_sizes   = (int *) MPL_malloc(count * sizeof(int));
         info_keyval_vectors =
-            (PMI_keyval_t**) MPIU_Malloc(count * sizeof(PMI_keyval_t*));
+            (PMI_keyval_t**) MPL_malloc(count * sizeof(PMI_keyval_t*));
 
         if (!info_ptrs) {
             for (i=0; i<count; i++) {
@@ -338,13 +338,13 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands,
  fn_exit:
     if (info_keyval_vectors) {
 	MPIDI_free_pmi_keyvals(info_keyval_vectors, count, info_keyval_sizes);
-	MPIU_Free(info_keyval_vectors);
+        MPL_free(info_keyval_vectors);
     }
     if (info_keyval_sizes) {
-	MPIU_Free(info_keyval_sizes);
+        MPL_free(info_keyval_sizes);
     }
     if (pmi_errcodes) {
-	MPIU_Free(pmi_errcodes);
+        MPL_free(pmi_errcodes);
     }
     return mpi_errno;
  fn_fail:
@@ -390,7 +390,7 @@ int MPIDI_GetParentPort(char ** parent_port)
             goto fn_exit;
 	}
 #endif
-	parent_port_name = MPIU_Strdup(val);
+        parent_port_name = MPL_strdup(val);
     }
 
     *parent_port = parent_port_name;
@@ -405,7 +405,7 @@ int MPIDI_GetParentPort(char ** parent_port)
 void MPIDI_FreeParentPort(void)
 {
     if (parent_port_name) {
-	MPIU_Free( parent_port_name );
+        MPL_free( parent_port_name );
 	parent_port_name = 0;
     }
 }
diff --git a/src/mpid/pamid/src/dyntask/mpidi_pg.c b/src/mpid/pamid/src/dyntask/mpidi_pg.c
index 7678742..d1a9768 100644
--- a/src/mpid/pamid/src/dyntask/mpidi_pg.c
+++ b/src/mpid/pamid/src/dyntask/mpidi_pg.c
@@ -127,9 +127,9 @@ int MPIDI_PG_Finalize(void)
    if(world_max_worldid != -1) {
      world_max_worldid++;
      wid_bit_array_size = (world_max_worldid + CHAR_BIT -1) / CHAR_BIT;
-     wid_bit_array = MPIU_Malloc(wid_bit_array_size*sizeof(unsigned char));
+     wid_bit_array = MPL_malloc(wid_bit_array_size*sizeof(unsigned char));
      memset(wid_bit_array, 0, wid_bit_array_size*sizeof(unsigned char));
-     root_wid_barray = MPIU_Malloc(wid_bit_array_size*sizeof(unsigned char));
+     root_wid_barray = MPL_malloc(wid_bit_array_size*sizeof(unsigned char));
 
      memset(root_wid_barray, 0, wid_bit_array_size*sizeof(unsigned char));
      conn_node     = _conn_info_list;
@@ -146,7 +146,7 @@ int MPIDI_PG_Finalize(void)
      MPIR_Reduce_impl(wid_bit_array,root_wid_barray,wid_bit_array_size,
 		   MPI_UNSIGNED_CHAR,MPI_BOR,0,MPIR_Process.comm_world,&mpi_errno);
 
-     MPIU_Free(wid_bit_array);
+     MPL_free(wid_bit_array);
    }
 
    if(MPIR_Process.comm_world->rank == 0) {
@@ -168,7 +168,7 @@ int MPIDI_PG_Finalize(void)
    mpi_errno = PMI2_KVS_Fence();
    TRACE_ERR("PMI2_KVS_Fence returned with mpi_errno=%d\n", mpi_errno);
 
-   MPIU_Free(root_wid_barray); /* root_wid_barray is now NULL for non-root */
+   MPL_free(root_wid_barray); /* root_wid_barray is now NULL for non-root */
 
 #if 0
    pthread_create(&finalize_req_thread, NULL, mpidi_finalize_req, NULL);
@@ -190,9 +190,9 @@ int MPIDI_PG_Finalize(void)
 
    if(_conn_info_list) {
      if(_conn_info_list->rem_taskids)
-       MPIU_Free(_conn_info_list->rem_taskids);
+       MPL_free(_conn_info_list->rem_taskids);
      else
-       MPIU_Free(_conn_info_list);
+       MPL_free(_conn_info_list);
    }
    /* Free the storage associated with the process groups */
    pg = MPIDI_PG_list;
@@ -240,8 +240,8 @@ int MPIDI_PG_Create(int vct_sz, void * pg_id, MPIDI_PG_t ** pg_ptr)
     int mpi_errno = MPI_SUCCESS;
     char *cp, *world_tasks, *cp1;
 
-    pg = MPIU_Malloc(sizeof(MPIDI_PG_t));
-    pg->vct = MPIU_Malloc(sizeof(struct MPID_VCR_t)*vct_sz);
+    pg = MPL_malloc(sizeof(MPIDI_PG_t));
+    pg->vct = MPL_malloc(sizeof(struct MPID_VCR_t)*vct_sz);
 
     pg->handle = 0;
     /* The reference count indicates the number of vc's that are or
@@ -249,7 +249,7 @@ int MPIDI_PG_Create(int vct_sz, void * pg_id, MPIDI_PG_t ** pg_ptr)
        except for MPI_COMM_WORLD. */
     MPIU_Object_set_ref(pg, 0);
     pg->size = vct_sz;
-    pg->id   = MPIU_Strdup(pg_id);
+    pg->id   = MPL_strdup(pg_id);
     TRACE_ERR("PG_Create - pg=%x pg->id=%s pg->vct=%x\n", pg, pg->id, pg->vct);
     /* Initialize the connection information to null.  Use
        the appropriate MPIDI_PG_InitConnXXX routine to set up these
@@ -349,7 +349,7 @@ int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
 
 	    MPIDI_PG_Destroy_fn(pg);
 	    TRACE_ERR("destroying pg->vct=%x\n", pg->vct);
-	    MPIU_Free(pg->vct);
+            MPL_free(pg->vct);
 	    TRACE_ERR("after destroying pg->vct=%x\n", pg->vct);
 
 	    if (pg->connData) {
@@ -359,12 +359,12 @@ int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
 		}
 		else {
                     TRACE_ERR("free pg->connData\n");
-		    MPIU_Free(pg->connData);
+                    MPL_free(pg->connData);
 		}
 	    }
 
 	    TRACE_ERR("final destroying pg\n");
-	    MPIU_Free(pg);
+            MPL_free(pg);
 
 	    goto fn_exit;
 	}
@@ -498,7 +498,7 @@ int MPIDI_PG_Create_from_string(const char * str, MPIDI_PG_t ** pg_pptr,
     vct_sz = atoi(p);
 
     while (*p) p++;p++;
-    char *p_tmp = MPIU_Strdup(p);
+    char *p_tmp = MPL_strdup(p);
     TRACE_ERR("before MPIDI_PG_Create - p=%s p_tmp=%s vct_sz=%d\n", p, p_tmp, vct_sz);
     mpi_errno = MPIDI_PG_Create(vct_sz, (void *)str, pg_pptr);
     if (mpi_errno != MPI_SUCCESS) {
@@ -511,7 +511,7 @@ int MPIDI_PG_Create_from_string(const char * str, MPIDI_PG_t ** pg_pptr,
 	pg_ptr->vct[i].taskid=atoi(strtok(NULL,":"));
     }
     TRACE_ERR("pg_ptr->id = %s\n",(*pg_pptr)->id);
-    MPIU_Free(p_tmp);
+    MPL_free(p_tmp);
 
     if(verbose)
       MPIU_PG_Printall(stderr);
@@ -609,7 +609,7 @@ int MPIDI_connToStringKVS( char **buf_p, int *slen, MPIDI_PG_t *pg )
        needed space */
     len = 0;
     curSlen = 10 + pg->size * 128;
-    string = (char *)MPIU_Malloc( curSlen );
+    string = (char *)MPL_malloc( curSlen );
 
     /* Start with the id of the pg */
     while (*pg_idStr && len < curSlen)
@@ -628,7 +628,7 @@ int MPIDI_connToStringKVS( char **buf_p, int *slen, MPIDI_PG_t *pg )
       if (len+vallen+1 >= curSlen) {
         char *nstring = 0;
         curSlen += (pg->size - i) * (vallen + 1 );
-        nstring = MPIU_Realloc( string, curSlen);
+        nstring = MPL_realloc( string, curSlen);
         MPID_assert(nstring != NULL);
         string = nstring;
       }
@@ -670,7 +670,7 @@ int MPIDI_connToStringKVS( char **buf_p, int *slen, MPIDI_PG_t *pg )
 	if (len + vallen + 1 >= curSlen) {
 	    char *nstring = 0;
             curSlen += (pg->size - i) * (vallen + 1 );
-	    nstring = MPIU_Realloc( string, curSlen);
+            nstring = MPL_realloc( string, curSlen);
 	    if (!nstring) {
 		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	    }
@@ -690,7 +690,7 @@ int MPIDI_connToStringKVS( char **buf_p, int *slen, MPIDI_PG_t *pg )
  fn_exit:
     return mpi_errno;
  fn_fail:
-    if (string) MPIU_Free(string);
+    if (string) MPL_free(string);
     goto fn_exit;
 }
 
@@ -703,7 +703,7 @@ static int MPIDI_connFromStringKVS( const char *buf ATTRIBUTE((unused)),
 static int MPIDI_connFreeKVS( MPIDI_PG_t *pg )
 {
     if (pg->connData) {
-	MPIU_Free( pg->connData );
+        MPL_free( pg->connData );
     }
     return MPI_SUCCESS;
 }
@@ -714,9 +714,9 @@ int MPIDI_PG_InitConnKVS( MPIDI_PG_t *pg )
 #ifdef USE_PMI2_API
     int mpi_errno = MPI_SUCCESS;
 
-    pg->connData = (char *)MPIU_Malloc(MAX_JOBID_LEN);
+    pg->connData = (char *)MPL_malloc(MAX_JOBID_LEN);
     if (pg->connData == NULL) {
-	TRACE_ERR("MPIDI_PG_InitConnKVS - MPIU_Malloc failure\n");
+        TRACE_ERR("MPIDI_PG_InitConnKVS - MPL_malloc failure\n");
     }
 
     mpi_errno = PMI2_Job_GetId(pg->connData, MAX_JOBID_LEN);
@@ -732,7 +732,7 @@ int MPIDI_PG_InitConnKVS( MPIDI_PG_t *pg )
 			     "**pmi_kvs_get_name_length_max %d", pmi_errno);
     }
 
-    pg->connData = (char *)MPIU_Malloc(kvs_name_sz + 1);
+    pg->connData = (char *)MPL_malloc(kvs_name_sz + 1);
     if (pg->connData == NULL) {
 	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**nomem");
     }
@@ -752,7 +752,7 @@ int MPIDI_PG_InitConnKVS( MPIDI_PG_t *pg )
  fn_exit:
     return mpi_errno;
  fn_fail:
-    if (pg->connData) { MPIU_Free(pg->connData); }
+    if (pg->connData) { MPL_free(pg->connData); }
     goto fn_exit;
 }
 
@@ -804,7 +804,7 @@ static int MPIDI_connToString( char **buf_p, int *slen, MPIDI_PG_t *pg )
     MPIDI_ConnInfo *connInfo = (MPIDI_ConnInfo *)pg->connData;
 
     /* Create this from the string array */
-    str = (char *)MPIU_Malloc(connInfo->toStringLen);
+    str = (char *)MPL_malloc(connInfo->toStringLen);
 
 #if defined(MPICH_DEBUG_MEMINIT)
     memset(str, 0, connInfo->toStringLen);
@@ -871,13 +871,13 @@ static int MPIDI_connFromString( const char *buf, MPIDI_PG_t *pg )
     pg->size = atoi( buf );
     while (*buf) buf++; buf++;
 
-    conninfo = (MPIDI_ConnInfo *)MPIU_Malloc( sizeof(MPIDI_ConnInfo) );
-    conninfo->connStrings = (char **)MPIU_Malloc( pg->size * sizeof(char *));
+    conninfo = (MPIDI_ConnInfo *)MPL_malloc( sizeof(MPIDI_ConnInfo) );
+    conninfo->connStrings = (char **)MPL_malloc( pg->size * sizeof(char *));
 
     /* For now, make a copy of each item */
     for (i=0; i<pg->size; i++) {
 	/* printf( "Adding conn[%d] = %s\n", i, buf );fflush(stdout); */
-	conninfo->connStrings[i] = MPIU_Strdup( buf );
+        conninfo->connStrings[i] = MPL_strdup( buf );
 	while (*buf) buf++;
 	buf++;
     }
@@ -897,10 +897,10 @@ static int MPIDI_connFree( MPIDI_PG_t *pg )
     int i;
 
     for (i=0; i<pg->size; i++) {
-	MPIU_Free( conninfo->connStrings[i] );
+        MPL_free( conninfo->connStrings[i] );
     }
-    MPIU_Free( conninfo->connStrings );
-    MPIU_Free( conninfo );
+    MPL_free( conninfo->connStrings );
+    MPL_free( conninfo );
 
     return MPI_SUCCESS;
 }
@@ -928,7 +928,7 @@ int MPIDI_PG_Dup_vcr( MPIDI_PG_t *pg, int rank, pami_task_t taskid, MPID_VCR *vc
     TRACE_ERR("ENTER MPIDI_PG_Dup_vcr - pg->id=%s rank=%d taskid=%d\n", pg->id, rank, taskid);
     pg->vct[rank].taskid = taskid;
 
-    vcr = MPIU_Malloc(sizeof(struct MPID_VCR_t));
+    vcr = MPL_malloc(sizeof(struct MPID_VCR_t));
     TRACE_ERR("MPIDI_PG_Dup_vcr- pg->vct[%d].pg=%x pg=%x vcr=%x vcr->pg=%x\n", rank, pg->vct[rank].pg, pg, vcr, vcr->pg);
     vcr->pg = pg;
     vcr->pg_rank = rank;
diff --git a/src/mpid/pamid/src/dyntask/mpidi_port.c b/src/mpid/pamid/src/dyntask/mpidi_port.c
index 3e2a2b9..db532e4 100644
--- a/src/mpid/pamid/src/dyntask/mpidi_port.c
+++ b/src/mpid/pamid/src/dyntask/mpidi_port.c
@@ -88,9 +88,9 @@ void MPIDI_Recvfrom_remote_world(pami_context_t    context,
   pami_endpoint_t dest;
 
 
-  q_item = MPIU_Malloc(sizeof(MPIDI_Acceptq_t));
-  q_item->vcr = MPIU_Malloc(sizeof(struct MPID_VCR_t));
-  q_item->vcr->pg = MPIU_Malloc(sizeof(MPIDI_PG_t));
+  q_item = MPL_malloc(sizeof(MPIDI_Acceptq_t));
+  q_item->vcr = MPL_malloc(sizeof(struct MPID_VCR_t));
+  q_item->vcr->pg = MPL_malloc(sizeof(MPIDI_PG_t));
   MPIU_Object_set_ref(q_item->vcr->pg, 0);
   TRACE_ERR("ENTER MPIDI_Acceptq_enqueue-1 q_item=%llx _msginfo=%llx (AM_struct *)_msginfo=%llx ((AM_struct *)_msginfo)->vcr=%llx\n", q_item, _msginfo, (AM_struct *)_msginfo, ((AM_struct *)_msginfo)->vcr);
   q_item->port_name_tag = ((AM_struct *)_msginfo)->port_name_tag;
@@ -224,8 +224,8 @@ int MPIDI_Connect_to_root(const char * port_name,
 
     /* First, create a new vc (we may use this to pass to a generic
        connection routine) */
-    vc = MPIU_Malloc(sizeof(struct MPID_VCR_t));
-    vc->pg = MPIU_Malloc(sizeof(MPIDI_PG_t));
+    vc = MPL_malloc(sizeof(struct MPID_VCR_t));
+    vc->pg = MPL_malloc(sizeof(MPIDI_PG_t));
     MPIU_Object_set_ref(vc->pg, 0);
     TRACE_ERR("vc from MPIDI_Connect_to_root=%llx vc->pg=%llx\n", vc, vc->pg);
     /* FIXME - where does this vc get freed? */
@@ -459,8 +459,8 @@ void MPIDI_add_new_tranid(long long tranid)
 
   MPIU_THREAD_CS_ENTER(MSGQUEUE,0);
   if(_transactionID_list == NULL) {
-    _transactionID_list = (transactionID_struct*) MPIU_Malloc(sizeof(transactionID_struct));
-    _transactionID_list->cntr_for_AM = MPIU_Malloc(TOTAL_AM*sizeof(int));
+    _transactionID_list = (transactionID_struct*) MPL_malloc(sizeof(transactionID_struct));
+    _transactionID_list->cntr_for_AM = MPL_malloc(TOTAL_AM*sizeof(int));
     _transactionID_list->tranid = tranid;
     for(i=0;i<TOTAL_AM;i++)
       _transactionID_list->cntr_for_AM[i] = 0;
@@ -473,10 +473,10 @@ void MPIDI_add_new_tranid(long long tranid)
   while(tridtmp->next != NULL)
     tridtmp = tridtmp->next;
 
-  tridtmp->next = (transactionID_struct*) MPIU_Malloc(sizeof(transactionID_struct));
+  tridtmp->next = (transactionID_struct*) MPL_malloc(sizeof(transactionID_struct));
   tridtmp = tridtmp->next;
   tridtmp->tranid  = tranid;
-  tridtmp->cntr_for_AM = MPIU_Malloc(TOTAL_AM*sizeof(int));
+  tridtmp->cntr_for_AM = MPL_malloc(TOTAL_AM*sizeof(int));
   for(i=0;i<TOTAL_AM;i++)
     tridtmp->cntr_for_AM[i] = 0;
   tridtmp->next    = NULL;
@@ -539,7 +539,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 
 	/* Make an array to translate local ranks to process group index
 	   and rank */
-	local_translation = MPIU_Malloc(local_comm_size*sizeof(pg_translation));
+        local_translation = MPL_malloc(local_comm_size*sizeof(pg_translation));
 /*	MPIU_CHKLMEM_MALLOC(local_translation,pg_translation*,
 			    local_comm_size*sizeof(pg_translation),
 			    mpi_errno,"local_translation"); */
@@ -598,8 +598,8 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 
    TRACE_ERR("MPIDI_Comm_connect - n_remote_pgs=%d remote_comm_size=%d context_id=%d\n", n_remote_pgs,
 	remote_comm_size, context_id);
-    remote_pg = MPIU_Malloc(n_remote_pgs * sizeof(MPIDI_PG_t*));
-    remote_translation = MPIU_Malloc(remote_comm_size * sizeof(pg_translation));
+    remote_pg = MPL_malloc(n_remote_pgs * sizeof(MPIDI_PG_t*));
+    remote_translation = MPL_malloc(remote_comm_size * sizeof(pg_translation));
     /* Exchange the process groups and their corresponding KVSes */
     if (rank == root)
     {
@@ -634,7 +634,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
                                  root, comm_ptr, &errflag);
     if (mpi_errno) TRACE_ERR("MPIR_Bcast_intra returned with mpi_errno=%d\n", mpi_errno);
 
-    char *pginfo = MPIU_Malloc(256*sizeof(char));
+    char *pginfo = MPL_malloc(256*sizeof(char));
     memset(pginfo, 0, 256);
     char cp[20];
     for (i=0; i<remote_comm_size; i++)
@@ -651,7 +651,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     pginfo[strlen(pginfo)]='\0';
     TRACE_ERR("connection info %s\n", pginfo);
     /*MPIDI_Parse_connection_info(n_remote_pgs, remote_pg);*/
-    MPIU_Free(pginfo);
+    MPL_free(pginfo);
 
     mpi_errno = MPIR_Comm_create(newcomm);
     if (mpi_errno) TRACE_ERR("MPIR_Comm_create returned with mpi_errno=%d\n", mpi_errno);
@@ -695,7 +695,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     TRACE_ERR("connect:free new vc\n");
 
 fn_exit:
-    if(local_translation) MPIU_Free(local_translation);
+    if(local_translation) MPL_free(local_translation);
     return mpi_errno;
 
 fn_fail:
@@ -731,9 +731,9 @@ static int MPIDI_ExtractLocalPGInfo( struct MPID_Comm *comm_p,
        group id, size and all its KVS values */
 
     cur_index = 0;
-    pg_list = MPIU_Malloc(sizeof(pg_node));
+    pg_list = MPL_malloc(sizeof(pg_node));
 
-    pg_list->pg_id = MPIU_Strdup(comm_p->vcr[0]->pg->id);
+    pg_list->pg_id = MPL_strdup(comm_p->vcr[0]->pg->id);
     pg_list->index = cur_index++;
     pg_list->next = NULL;
     /* XXX DJG FIXME-MT should we be checking this?  the add/release macros already check this */
@@ -770,10 +770,10 @@ static int MPIDI_ExtractLocalPGInfo( struct MPID_Comm *comm_p,
 	    pg_iter = pg_iter->next;
 	}
 	if (pg_iter == NULL) {
-	    /* We use MPIU_Malloc directly because we do not know in
+            /* We use MPL_malloc directly because we do not know in
 	       advance how many nodes we may allocate */
-	    pg_iter = (pg_node*)MPIU_Malloc(sizeof(pg_node));
-	    pg_iter->pg_id = MPIU_Strdup(comm_p->vcr[i]->pg->id);
+            pg_iter = (pg_node*)MPL_malloc(sizeof(pg_node));
+            pg_iter->pg_id = MPL_strdup(comm_p->vcr[i]->pg->id);
 	    pg_iter->index = cur_index++;
 	    pg_iter->next = NULL;
 	    mpi_errno = MPIDI_PG_To_string(comm_p->vcr[i]->pg, &pg_iter->str,
@@ -828,7 +828,7 @@ static int MPIDI_ReceivePGAndDistribute( struct MPID_Comm *tmp_comm, struct MPID
 	    if (mpi_errno != MPI_SUCCESS) {
 		TRACE_ERR("MPIC_Recv returned with mpi_errno=%d\n", mpi_errno);
 	    }
-	    pg_str = (char*)MPIU_Malloc(j);
+            pg_str = (char*)MPL_malloc(j);
 	    mpi_errno = MPIC_Recv(pg_str, j, MPI_CHAR, 0, recvtag++,
 				  tmp_comm, MPI_STATUS_IGNORE, &errflag);
 	    *recvtag_p = recvtag;
@@ -844,7 +844,7 @@ static int MPIDI_ReceivePGAndDistribute( struct MPID_Comm *tmp_comm, struct MPID
 
 	if (rank != root) {
 	    /* The root has already allocated this string */
-	    pg_str = (char*)MPIU_Malloc(j);
+            pg_str = (char*)MPL_malloc(j);
 	}
 	TRACE_ERR("accept:broadcasting string of length %d\n", j);
 	pg_str[j-1]='\0';
@@ -862,7 +862,7 @@ static int MPIDI_ReceivePGAndDistribute( struct MPID_Comm *tmp_comm, struct MPID
 	    TRACE_ERR("MPIDI_PG_Create_from_string returned with mpi_errno=%d\n", mpi_errno);
 	}
 
-	MPIU_Free(pg_str);
+        MPL_free(pg_str);
     }
     /*MPIDI_Parse_connection_info(pg_str); */
  fn_exit:
@@ -886,13 +886,13 @@ void MPIDI_Add_connection_info(int wid, int wsize, pami_task_t *taskids) {
   /* FIXME: check the lock */
   MPIU_THREAD_CS_ENTER(MSGQUEUE,0);
   if(_conn_info_list == NULL) { /* Connection list is not yet created */
-    _conn_info_list = (conn_info*) MPIU_Malloc(sizeof(conn_info));
+    _conn_info_list = (conn_info*) MPL_malloc(sizeof(conn_info));
     _conn_info_list->rem_world_id = wid;
       _conn_info_list->ref_count    = 1;
 
     ref_count = _conn_info_list->ref_count;
     if(taskids != NULL) {
-      _conn_info_list->rem_taskids = MPIU_Malloc((wsize+1)*sizeof(int));
+      _conn_info_list->rem_taskids = MPL_malloc((wsize+1)*sizeof(int));
       for(i=0;i<wsize;i++) {
         _conn_info_list->rem_taskids[i] = taskids[i];
       }
@@ -913,7 +913,7 @@ void MPIDI_Add_connection_info(int wid, int wsize, pami_task_t *taskids) {
     if(tmp_node1) {  /* Connection already exists. Increment reference count */
       if(tmp_node1->ref_count == 0) {
         if(taskids != NULL) {
-          tmp_node1->rem_taskids = MPIU_Malloc((wsize+1)*sizeof(int));
+          tmp_node1->rem_taskids = MPL_malloc((wsize+1)*sizeof(int));
           for(i=0;i<wsize;i++) {
             tmp_node1->rem_taskids[i] = taskids[i];
           }
@@ -925,14 +925,14 @@ void MPIDI_Add_connection_info(int wid, int wsize, pami_task_t *taskids) {
       ref_count = tmp_node1->ref_count;
     }
     else {           /* Connection do not exists. Create a new connection */
-      tmp_node2->next = (conn_info*) MPIU_Malloc(sizeof(conn_info));
+      tmp_node2->next = (conn_info*) MPL_malloc(sizeof(conn_info));
       tmp_node2 = tmp_node2->next;
       tmp_node2->rem_world_id = wid;
         tmp_node2->ref_count    = 1;
 
       ref_count = tmp_node2->ref_count;
       if(taskids != NULL) {
-        tmp_node2->rem_taskids = MPIU_Malloc((wsize+1)*sizeof(int));
+        tmp_node2->rem_taskids = MPL_malloc((wsize+1)*sizeof(int));
         for(i=0;i<wsize;i++) {
           tmp_node2->rem_taskids[i] = taskids[i];
         }
@@ -975,13 +975,13 @@ void MPIDI_Parse_connection_info(int n_remote_pgs, MPIDI_PG_t **remote_pg) {
         if (mpi_errno) TRACE_ERR("MPIDI_PG_Find failed\n");
 
          if (existing_pg != NULL) {
-	  taskids = MPIU_Malloc((existing_pg->size)*sizeof(pami_task_t));
+             taskids = MPL_malloc((existing_pg->size)*sizeof(pami_task_t));
           for(i=0; i<existing_pg->size; i++) {
              taskids[i]=existing_pg->vct[i].taskid;
 	     TRACE_ERR("id=%s taskids[%d]=%d\n", (char*)(remote_pg[p]->id), i, taskids[i]);
           }
           MPIDI_Add_connection_info(atoi((char*)(remote_pg[p]->id)), existing_pg->size, taskids);
-	  MPIU_Free(taskids);
+          MPL_free(taskids);
         }
   }
 }
@@ -1036,8 +1036,8 @@ void MPIDI_free_tranid_node(long long tranid)
     if(tridtmp->tranid == tranid) {
       /* If there is only one node */
       if(_transactionID_list->next == NULL) {
-        MPIU_Free(_transactionID_list->cntr_for_AM);
-        MPIU_Free(_transactionID_list);
+        MPL_free(_transactionID_list->cntr_for_AM);
+        MPL_free(_transactionID_list);
         _transactionID_list = NULL;
         MPIU_THREAD_CS_EXIT(MSGQUEUE,0);
         return;
@@ -1045,15 +1045,15 @@ void MPIDI_free_tranid_node(long long tranid)
       /* If more than one node and if this is the first node of the list */
       if(tridtmp == _transactionID_list && tridtmp->next != NULL) {
         _transactionID_list = _transactionID_list->next;
-        MPIU_Free(tridtmp->cntr_for_AM);
-        MPIU_Free(tridtmp);
+        MPL_free(tridtmp->cntr_for_AM);
+        MPL_free(tridtmp);
         MPIU_THREAD_CS_EXIT(MSGQUEUE,0);
         return;
       }
       /* For rest all other nodes position of the list */
       tridtmp2->next = tridtmp->next;
-      MPIU_Free(tridtmp->cntr_for_AM);
-      MPIU_Free(tridtmp);
+      MPL_free(tridtmp->cntr_for_AM);
+      MPL_free(tridtmp);
         MPIU_THREAD_CS_EXIT(MSGQUEUE,0);
       return;
     }
@@ -1074,8 +1074,8 @@ void MPIDI_free_all_tranid_node()
   while(_transactionID_list != NULL) {
     tridtmp = _transactionID_list;
     _transactionID_list = _transactionID_list->next;
-    MPIU_Free(tridtmp->cntr_for_AM);
-    MPIU_Free(tridtmp);
+    MPL_free(tridtmp->cntr_for_AM);
+    MPL_free(tridtmp);
   }
   MPIU_THREAD_CS_EXIT(MSGQUEUE,0);
 }
@@ -1109,9 +1109,9 @@ static int MPIDI_SendPGtoPeerAndFree( struct MPID_Comm *tmp_comm, int *sendtag_p
 	}
 
 	pg_list = pg_list->next;
-	MPIU_Free(pg_iter->str);
-	MPIU_Free(pg_iter->pg_id);
-	MPIU_Free(pg_iter);
+        MPL_free(pg_iter->str);
+        MPL_free(pg_iter->pg_id);
+        MPL_free(pg_iter);
     }
 
  fn_exit:
@@ -1186,7 +1186,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
 
 	/* Make an array to translate local ranks to process group index and
 	   rank */
-	local_translation = MPIU_Malloc(local_comm_size*sizeof(pg_translation));
+        local_translation = MPL_malloc(local_comm_size*sizeof(pg_translation));
 /*	MPIU_CHKLMEM_MALLOC(local_translation,pg_translation*,
 			    local_comm_size*sizeof(pg_translation),
 			    mpi_errno,"local_translation"); */
@@ -1247,8 +1247,8 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     n_remote_pgs     = recv_ints[0];
     remote_comm_size = recv_ints[1];
     context_id       = recv_ints[2];
-    remote_pg = MPIU_Malloc(n_remote_pgs * sizeof(MPIDI_PG_t*));
-    remote_translation =  MPIU_Malloc(remote_comm_size * sizeof(pg_translation));
+    remote_pg = MPL_malloc(n_remote_pgs * sizeof(MPIDI_PG_t*));
+    remote_translation =  MPL_malloc(remote_comm_size * sizeof(pg_translation));
     TRACE_ERR("[%d]accept:remote process groups: %d\nremote comm size: %d\nrecv_char: %s\n", rank, n_remote_pgs, remote_comm_size, remote_taskids);
 
     /* Exchange the process groups and their corresponding KVSes */
@@ -1291,7 +1291,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
                                  root, comm_ptr, &errflag);
     if (mpi_errno) TRACE_ERR("MPIR_Bcast_intra returned with mpi_errno=%d\n", mpi_errno);
     TRACE_ERR("[%d]accept:Received remote_translation after broadcast:\n", rank);
-    char *pginfo = MPIU_Malloc(256*sizeof(char));
+    char *pginfo = MPL_malloc(256*sizeof(char));
     memset(pginfo, 0, 256);
     char cp[20];
     for (i=0; i<remote_comm_size; i++)
@@ -1308,7 +1308,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     pginfo[strlen(pginfo)]='\0';
     TRACE_ERR("connection info %s\n", pginfo);
 /*    MPIDI_Parse_connection_info(n_remote_pgs, remote_pg); */
-    MPIU_Free(pginfo);
+    MPL_free(pginfo);
 
 
     /* Now fill in newcomm */
@@ -1347,7 +1347,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     }
 
 fn_exit:
-    if(local_translation) MPIU_Free(local_translation);
+    if(local_translation) MPL_free(local_translation);
     return mpi_errno;
 
 fn_fail:
@@ -1467,7 +1467,7 @@ static int MPIDI_SetupNewIntercomm( struct MPID_Comm *comm_ptr, int remote_comm_
           index++;
       }
       if(index) {
-        intercomm->mpid.world_ids = MPIU_Malloc((index+i+1)*sizeof(int));
+        intercomm->mpid.world_ids = MPL_malloc((index+i+1)*sizeof(int));
         /* Current index i inside intercomm->mpid.world_ids is
          * the place where next world_id can be added
          */
@@ -1481,7 +1481,7 @@ static int MPIDI_SetupNewIntercomm( struct MPID_Comm *comm_ptr, int remote_comm_
    }
    else {
     index=0;
-    intercomm->mpid.world_ids = MPIU_Malloc((n_remote_pgs+1)*sizeof(int));
+    intercomm->mpid.world_ids = MPL_malloc((n_remote_pgs+1)*sizeof(int));
     PMI2_Job_GetId(jobId, jobIdSize);
     for(i=0;i<n_remote_pgs;i++) {
       if(atoi(jobId) != atoi((char *)remote_pg[i]->id) )
@@ -1540,8 +1540,8 @@ static int MPIDI_SetupNewIntercomm( struct MPID_Comm *comm_ptr, int remote_comm_
    }
 
  fn_exit:
-    if(remote_pg) MPIU_Free(remote_pg);
-    if(remote_translation) MPIU_Free(remote_translation);
+    if(remote_pg) MPL_free(remote_pg);
+    if(remote_translation) MPL_free(remote_translation);
     return mpi_errno;
 
  fn_fail:
@@ -1570,7 +1570,7 @@ int MPIDI_Acceptq_dequeue(MPID_VCR * vcr, int port_name_tag)
 	    else
 		prev->next = q_item->next;
 
-	    MPIU_Free(q_item);
+            MPL_free(q_item);
 	    AcceptQueueSize--;
 	    break;;
 	}
@@ -1666,8 +1666,8 @@ void MPIDI_delete_conn_record(int wid) {
         tmp_node2->next = tmp_node1->next;
       }
       if(tmp_node1->rem_taskids != NULL)
-        MPIU_Free(tmp_node1->rem_taskids);
-      MPIU_Free(tmp_node1);
+        MPL_free(tmp_node1->rem_taskids);
+      MPL_free(tmp_node1);
       break;
     }
     tmp_node2 = tmp_node1;
@@ -1689,7 +1689,7 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
     peer_comm_size = comm_p->local_size;
     rank            = comm_p->rank;
 
-    local_translation = (pg_translation*)MPIU_Malloc(peer_comm_size*sizeof(pg_translation));
+    local_translation = (pg_translation*)MPL_malloc(peer_comm_size*sizeof(pg_translation));
     if (rank == root) {
 	/* Get the process groups known to the *peercomm* */
 	MPIDI_ExtractLocalPGInfo( peercomm_p, local_translation, &pg_head,
@@ -1717,7 +1717,7 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
 	}
 	mpi_errno = MPIR_Bcast_impl( &len, 1, MPI_INT, root, comm_p, &errflag);
 	if (rank != root) {
-	    pg_str = (char *)MPIU_Malloc(len);
+            pg_str = (char *)MPL_malloc(len);
 	    if (!pg_str) {
 		goto fn_exit;
 	    }
@@ -1725,7 +1725,7 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
 	mpi_errno = MPIR_Bcast_impl( pg_str, len, MPI_CHAR, root, comm_p, &errflag);
 	if (mpi_errno) {
 	    if (rank != root)
-		MPIU_Free( pg_str );
+                MPL_free( pg_str );
 	}
 
 	if (rank != root) {
@@ -1738,7 +1738,7 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
 			(char *)pgptr->id );
 			fflush(stdout); */
 	    }
-	    MPIU_Free( pg_str );
+            MPL_free( pg_str );
 	}
     }
 
@@ -1749,16 +1749,16 @@ int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root )
        the PG fields are valid for that function */
     while (pg_list) {
 	pg_next = pg_list->next;
-	MPIU_Free( pg_list->str );
+        MPL_free( pg_list->str );
 	if (pg_list->pg_id ) {
-	    MPIU_Free( pg_list->pg_id );
+            MPL_free( pg_list->pg_id );
 	}
-	MPIU_Free( pg_list );
+        MPL_free( pg_list );
 	pg_list = pg_next;
     }
 
  fn_exit:
-    MPIU_Free(local_translation);
+    MPL_free(local_translation);
     return mpi_errno;
  fn_fail:
     goto fn_exit;
diff --git a/src/mpid/pamid/src/misc/mpid_mem.c b/src/mpid/pamid/src/misc/mpid_mem.c
index 8b7a685..18d7840 100644
--- a/src/mpid/pamid/src/misc/mpid_mem.c
+++ b/src/mpid/pamid/src/misc/mpid_mem.c
@@ -30,13 +30,13 @@
 void *MPID_Alloc_mem( size_t size, MPID_Info *info_ptr )
 {
     void *ap;
-    ap = MPIU_Malloc(size);
+    ap = MPL_malloc(size);
     return ap;
 }
 
 int MPID_Free_mem( void *ptr )
 {
     int mpi_errno = MPI_SUCCESS;
-    MPIU_Free(ptr);
+    MPL_free(ptr);
     return mpi_errno;
 }
diff --git a/src/mpid/pamid/src/mpid_buffer.c b/src/mpid/pamid/src/mpid_buffer.c
index 9c21293..367f99f 100644
--- a/src/mpid/pamid/src/mpid_buffer.c
+++ b/src/mpid/pamid/src/mpid_buffer.c
@@ -104,7 +104,7 @@ void MPIDI_Buffer_copy(
       if(MPIDI_Process.cuda_aware_support_on && MPIDI_cuda_is_device_buf(rbuf))
       {
         MPID_Datatype_get_extent_macro(rdt, rdt_extent);
-        char *buf =  MPIU_Malloc(rdt_extent * rcount);
+        char *buf =  MPL_malloc(rdt_extent * rcount);
         memset(buf, 0, rdt_extent * rcount);        
         MPID_Segment seg;
         DLOOP_Offset last;
@@ -124,7 +124,7 @@ void MPIDI_Buffer_copy(
         
         cudaError_t cudaerr = CudaMemcpy(rbuf + rdt_true_lb, buf, rdt_extent * rcount, cudaMemcpyHostToDevice);
 
-        MPIU_Free(buf);
+        MPL_free(buf);
 
         goto fn_exit;
 
@@ -172,7 +172,7 @@ void MPIDI_Buffer_copy(
         MPID_Segment rseg;
         MPIDI_msg_sz_t rfirst;
 
-        buf = MPIU_Malloc(MPIDI_COPY_BUFFER_SZ);
+        buf = MPL_malloc(MPIDI_COPY_BUFFER_SZ);
         /* --BEGIN ERROR HANDLING-- */
         if (buf == NULL)
         {
@@ -242,7 +242,7 @@ void MPIDI_Buffer_copy(
         }
 
         *rsz = rfirst;
-        MPIU_Free(buf);
+        MPL_free(buf);
     }
 
   fn_exit:
diff --git a/src/mpid/pamid/src/mpid_finalize.c b/src/mpid/pamid/src/mpid_finalize.c
index bdee91a..2790369 100644
--- a/src/mpid/pamid/src/mpid_finalize.c
+++ b/src/mpid/pamid/src/mpid_finalize.c
@@ -46,9 +46,9 @@ void MPIDI_close_pe_extension() {
          TRACE_ERR("ERROR close PAMI_Extension failed rc %d", rc);
      }
      if (mpich_env)
-         MPIU_Free(mpich_env);
+         MPL_free(mpich_env);
      if (mpid_statp)
-         MPIU_Free(mpid_statp);
+         MPL_free(mpid_statp);
 
 }
 #endif
@@ -88,7 +88,7 @@ int MPID_Finalize()
     MPIDI_FreeParentPort();
   }
   if(_conn_info_list) 
-    MPIU_Free(_conn_info_list);
+    MPL_free(_conn_info_list);
   MPIDI_free_all_tranid_node();
 #endif
 
@@ -117,19 +117,19 @@ int MPID_Finalize()
  {  int i;
   for (i=0; i< MPIDI_Process.numTasks; i++) {
       if (MPIDI_Trace_buf[i].R)
-          MPIU_Free(MPIDI_Trace_buf[i].R);
+          MPL_free(MPIDI_Trace_buf[i].R);
       if (MPIDI_Trace_buf[i].PR)
-          MPIU_Free(MPIDI_Trace_buf[i].PR);
+          MPL_free(MPIDI_Trace_buf[i].PR);
       if (MPIDI_Trace_buf[i].S)
-          MPIU_Free(MPIDI_Trace_buf[i].S);
+          MPL_free(MPIDI_Trace_buf[i].S);
   }
  }
- MPIU_Free(MPIDI_Trace_buf);
+ MPL_free(MPIDI_Trace_buf);
 #endif
 
 #ifdef OUT_OF_ORDER_HANDLING
-  MPIU_Free(MPIDI_In_cntr);
-  MPIU_Free(MPIDI_Out_cntr);
+  MPL_free(MPIDI_In_cntr);
+  MPL_free(MPIDI_Out_cntr);
 #endif
 
  if (TOKEN_FLOW_CONTROL_ON)
@@ -137,8 +137,8 @@ int MPID_Finalize()
      #if TOKEN_FLOW_CONTROL
      extern char *EagerLimit;
 
-     if (EagerLimit) MPIU_Free(EagerLimit);
-     MPIU_Free(MPIDI_Token_cntr);
+     if (EagerLimit) MPL_free(EagerLimit);
+     MPL_free(MPIDI_Token_cntr);
      MPIDI_close_mm();
      #else
      MPID_assert_always(0);
diff --git a/src/mpid/pamid/src/mpid_init.c b/src/mpid/pamid/src/mpid_init.c
index 5026b25..6b91595 100644
--- a/src/mpid/pamid/src/mpid_init.c
+++ b/src/mpid/pamid/src/mpid_init.c
@@ -481,13 +481,13 @@ MPIDI_PAMI_client_init(int* rank, int* size, int* mpidi_dynamic_tasking, char **
     if (env != NULL)
       {
         size_t n = strlen(env);
-        char * tmp = (char *) MPIU_Malloc(n+1);
+        char * tmp = (char *) MPL_malloc(n+1);
         strncpy(tmp,env,n);
         if (n>0) tmp[n]=0;
 
         MPIDI_atoi(tmp, &MPIDI_Process.disable_internal_eager_scale);
 
-        MPIU_Free(tmp);
+        MPL_free(tmp);
       }
 
     if (MPIDI_Process.disable_internal_eager_scale <= *size)
@@ -622,7 +622,7 @@ void MPIDI_Init_collsel_extension()
                     MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_NONE;
                 }
               }
-              MPIU_Free(collsel_collectives);
+              MPL_free(collsel_collectives);
             }
           }
           else
@@ -764,10 +764,10 @@ MPIDI_PAMI_context_init(int* threading, int *size)
 
   MPIDI_Process.numTasks= numTasks = PAMIX_Client_query(MPIDI_Client, PAMI_CLIENT_NUM_TASKS).value.intval;
 #ifdef OUT_OF_ORDER_HANDLING
-  MPIDI_In_cntr = MPIU_Calloc0(numTasks, MPIDI_In_cntr_t);
+  MPIDI_In_cntr = MPL_calloc0(numTasks, MPIDI_In_cntr_t);
   if(MPIDI_In_cntr == NULL)
     MPID_abort();
-  MPIDI_Out_cntr = MPIU_Calloc0(numTasks, MPIDI_Out_cntr_t);
+  MPIDI_Out_cntr = MPL_calloc0(numTasks, MPIDI_Out_cntr_t);
   if(MPIDI_Out_cntr == NULL)
     MPID_abort();
   memset((void *) MPIDI_In_cntr,0, sizeof(MPIDI_In_cntr_t));
@@ -777,15 +777,15 @@ MPIDI_PAMI_context_init(int* threading, int *size)
 
 #ifdef MPIDI_TRACE
       int i;
-      MPIDI_Trace_buf = MPIU_Calloc0(numTasks, MPIDI_Trace_buf_t);
+      MPIDI_Trace_buf = MPL_calloc0(numTasks, MPIDI_Trace_buf_t);
       if(MPIDI_Trace_buf == NULL) MPID_abort();
       memset((void *) MPIDI_Trace_buf,0, sizeof(MPIDI_Trace_buf_t));
       for (i=0; i < numTasks; i++) {
-          MPIDI_Trace_buf[i].R=MPIU_Calloc0(N_MSGS, recv_status);
+          MPIDI_Trace_buf[i].R=MPL_calloc0(N_MSGS, recv_status);
           if (MPIDI_Trace_buf[i].R==NULL) MPID_abort();
-          MPIDI_Trace_buf[i].PR=MPIU_Calloc0(N_MSGS, posted_recv);
+          MPIDI_Trace_buf[i].PR=MPL_calloc0(N_MSGS, posted_recv);
           if (MPIDI_Trace_buf[i].PR ==NULL) MPID_abort();
-          MPIDI_Trace_buf[i].S=MPIU_Calloc0(N_MSGS, send_status);
+          MPIDI_Trace_buf[i].S=MPL_calloc0(N_MSGS, send_status);
           if (MPIDI_Trace_buf[i].S ==NULL) MPID_abort();
       }
 #endif
@@ -937,7 +937,7 @@ MPIDI_PAMI_dispath_init()
        #if TOKEN_FLOW_CONTROL
         int i;
         MPIDI_mm_init(MPIDI_Process.numTasks,&MPIDI_Process.pt2pt.limits.application.eager.remote,&MPIDI_Process.mp_buf_mem);
-        MPIDI_Token_cntr = MPIU_Calloc0(MPIDI_Process.numTasks, MPIDI_Token_cntr_t);
+        MPIDI_Token_cntr = MPL_calloc0(MPIDI_Process.numTasks, MPIDI_Token_cntr_t);
         memset((void *) MPIDI_Token_cntr,0, (sizeof(MPIDI_Token_cntr_t) * MPIDI_Process.numTasks));
         for (i=0; i < MPIDI_Process.numTasks; i++)
         {
@@ -1092,13 +1092,13 @@ MPIDI_PAMI_init(int* rank, int* size, int* threading)
     }
 #ifdef MPIDI_BANNER
   if ((*rank == 0) && (MPIDI_Process.mp_infolevel >=1)) {
-       char* buf = (char *) MPIU_Malloc(160);
+       char* buf = (char *) MPL_malloc(160);
        int   rc  = MPIDI_Banner(buf);
        if ( rc == 0 )
             fprintf(stderr, "%s\n", buf);
        else
             TRACE_ERR("mpid_banner() return code=%d task %d",rc,*rank);
-       MPIU_Free(buf);
+       MPL_free(buf);
   }
 #endif
 }
@@ -1159,17 +1159,17 @@ MPIDI_VCRT_init(int rank, int size, char *world_tasks, MPIDI_PG_t *pg)
 #ifdef DYNAMIC_TASKING
   if(mpidi_dynamic_tasking) {
     i=0;
-    world_tasks_save = MPIU_Strdup(world_tasks);
+    world_tasks_save = MPL_strdup(world_tasks);
     if(world_tasks != NULL) {
       comm->vcr[0]->taskid = atoi(strtok(world_tasks, ":"));
       while( (cp=strtok(NULL, ":")) != NULL) {
         comm->vcr[++i]->taskid= atoi(cp);
       }
     }
-    MPIU_Free(world_tasks_save);
+    MPL_free(world_tasks_save);
 
         /* This memory will be freed by the PG_Destroy if there is an error */
-        pg_id = MPIU_Malloc(MAX_JOBID_LEN);
+        pg_id = MPL_malloc(MAX_JOBID_LEN);
 
         mpi_errno = PMI2_Job_GetId(pg_id, MAX_JOBID_LEN);
         TRACE_ERR("PMI2_Job_GetId - pg_id=%s\n", pg_id);
@@ -1489,7 +1489,7 @@ int MPIDI_Banner(char * bufPtr) {
 
     sprintf(msgBuf,"MPICH library was compiled on");
 
-    tmx=MPIU_Malloc(sizeof(struct tm));
+    tmx=MPL_malloc(sizeof(struct tm));
     sprintf(buf,__DATE__" "__TIME__);
 
     if ((void *) NULL == strptime(buf, "%B %d %Y %T", tmx))
@@ -1514,7 +1514,7 @@ int MPIDI_Banner(char * bufPtr) {
 
     }
 
-    MPIU_Free(tmx);
+    MPL_free(tmx);
     return MPI_SUCCESS;
 }
 #endif
@@ -1549,7 +1549,7 @@ int MPIDI_PG_Destroy_id(MPIDI_PG_t * pg)
     if (pg->id != NULL)
     {
 	TRACE_ERR("free pg id =%p pg=%p\n", pg->id, pg);
-	MPIU_Free(pg->id);
+        MPL_free(pg->id);
 	TRACE_ERR("done free pg id \n");
     }
 
@@ -1622,7 +1622,7 @@ int MPIDI_InitPG( int *argc, char ***argv,
 #ifdef USE_PMI2_API
 
         /* This memory will be freed by the PG_Destroy if there is an error */
-	pg_id = MPIU_Malloc(MAX_JOBID_LEN);
+        pg_id = MPL_malloc(MAX_JOBID_LEN);
 
         mpi_errno = PMI2_Job_GetId(pg_id, MAX_JOBID_LEN);
 	TRACE_ERR("PMI2_Job_GetId - pg_id=%s\n", pg_id);
@@ -1637,7 +1637,7 @@ int MPIDI_InitPG( 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);
+        pg_id = MPL_malloc(pg_id_sz + 1);
 
 	/* Note in the singleton init case, the pg_id is a dummy.
 	   We'll want to replace this value if we join an
@@ -1650,7 +1650,7 @@ int MPIDI_InitPG( int *argc, char ***argv,
     }
     else {
 	/* Create a default pg id */
-	pg_id = MPIU_Malloc(2);
+        pg_id = MPL_malloc(2);
 	MPL_strncpy( pg_id, "0", 2 );
     }
 
@@ -1669,7 +1669,7 @@ int MPIDI_InitPG( int *argc, char ***argv,
      */
     TRACE_ERR("pg_size=%d pg_id=%p pg_id=%s\n", pg_size, pg_id, pg_id);
     mpi_errno = MPIDI_PG_Create(pg_size, pg_id, &pg);
-    MPIU_Free(pg_id);
+    MPL_free(pg_id);
     if (mpi_errno != MPI_SUCCESS) {
       TRACE_ERR("MPIDI_PG_Create returned with mpi_errno=%d\n", mpi_errno);
     }
diff --git a/src/mpid/pamid/src/mpid_request.h b/src/mpid/pamid/src/mpid_request.h
index 462b726..f25ae00 100644
--- a/src/mpid/pamid/src/mpid_request.h
+++ b/src/mpid/pamid/src/mpid_request.h
@@ -281,12 +281,12 @@ MPID_Request_release_inline(MPID_Request *req)
     MPID_assert(MPIR_cc_is_complete(&req->cc));
 
     if (req->comm)              MPIR_Comm_release(req->comm, 0);
-    if (req->greq_fns)          MPIU_Free(req->greq_fns);
+    if (req->greq_fns)          MPL_free(req->greq_fns);
     if (req->mpid.datatype_ptr) MPID_Datatype_release(req->mpid.datatype_ptr);
     if (req->mpid.uebuf_malloc== mpiuMalloc) {
-        MPIU_Free(req->mpid.uebuf);
+        MPL_free(req->mpid.uebuf);
     }
-    if(req->mpid.win_req)       MPIU_Free(req->mpid.win_req);
+    if(req->mpid.win_req)       MPL_free(req->mpid.win_req);
 #if TOKEN_FLOW_CONTROL
     else if (req->mpid.uebuf_malloc == mpidiBufMM) {
         MPIU_THREAD_CS_ENTER(MSGQUEUE,0);
@@ -304,7 +304,7 @@ static inline void
 MPID_Request_discard_inline(MPID_Request *req)
 {
     if (req->mpid.uebuf_malloc == mpiuMalloc) {
-        MPIU_Free(req->mpid.uebuf);
+        MPL_free(req->mpid.uebuf);
     }
 #if TOKEN_FLOW_CONTROL
     else if (req->mpid.uebuf_malloc == mpidiBufMM) {
diff --git a/src/mpid/pamid/src/mpid_vc.c b/src/mpid/pamid/src/mpid_vc.c
index 6179941..965455a 100644
--- a/src/mpid/pamid/src/mpid_vc.c
+++ b/src/mpid/pamid/src/mpid_vc.c
@@ -67,11 +67,11 @@ int MPID_VCRT_Create(int size, MPID_VCRT *vcrt_ptr)
     struct MPIDI_VCRT * vcrt;
     int i,result;
 
-    vcrt = MPIU_Malloc(sizeof(struct MPIDI_VCRT));
-    vcrt->vcr_table = MPIU_Malloc(size*sizeof(MPID_VCR));
+    vcrt = MPL_malloc(sizeof(struct MPIDI_VCRT));
+    vcrt->vcr_table = MPL_malloc(size*sizeof(MPID_VCR));
 
     for(i = 0; i < size; i++) {
-	vcrt->vcr_table[i] = MPIU_Malloc(sizeof(struct MPID_VCR_t));
+        vcrt->vcr_table[i] = MPL_malloc(sizeof(struct MPID_VCR_t));
     }
     if (vcrt != NULL)
     {
@@ -116,7 +116,7 @@ int MPID_VCRT_Release(MPID_VCRT vcrt, int isDisconnect)
                 if (inuse == 0)
                  {
                    MPIDI_PG_Destroy(vcr->pg);
-                   MPIU_Free(vcr);
+                   MPL_free(vcr);
                  }
                  continue;
               }
@@ -125,21 +125,21 @@ int MPID_VCRT_Release(MPID_VCRT vcrt, int isDisconnect)
             MPIDI_PG_release_ref(vcr->pg, &inuse);
             if (inuse == 0)
               MPIDI_PG_Destroy(vcr->pg);
-        if(vcr) MPIU_Free(vcr);
+        if(vcr) MPL_free(vcr);
        }
-       MPIU_Free(vcrt->vcr_table);
+       MPL_free(vcrt->vcr_table);
      } /** CHECK */
      else {
       for (i = 0; i < vcrt->size; i++)
-	MPIU_Free(vcrt->vcr_table[i]);
-      MPIU_Free(vcrt->vcr_table);vcrt->vcr_table=NULL;
+          MPL_free(vcrt->vcr_table[i]);
+      MPL_free(vcrt->vcr_table);vcrt->vcr_table=NULL;
      }
 #else
       for (i = 0; i < vcrt->size; i++)
-	MPIU_Free(vcrt->vcr_table[i]);
-      MPIU_Free(vcrt->vcr_table);vcrt->vcr_table=NULL;
+          MPL_free(vcrt->vcr_table[i]);
+      MPL_free(vcrt->vcr_table);vcrt->vcr_table=NULL;
 #endif
-     MPIU_Free(vcrt);vcrt=NULL;
+     MPL_free(vcrt);vcrt=NULL;
     }
     return MPI_SUCCESS;
 }
diff --git a/src/mpid/pamid/src/mpidi_bufmm.c b/src/mpid/pamid/src/mpidi_bufmm.c
index 0134556..a466fe1 100644
--- a/src/mpid/pamid/src/mpidi_bufmm.c
+++ b/src/mpid/pamid/src/mpidi_bufmm.c
@@ -228,7 +228,7 @@ void MPIDI_calc_tokens(int nTasks,uint *eager_limit_in, unsigned long *buf_mem_i
           /* putenv MP_EAGER_LIMIT if it is changed                          */
           /* MP_EAGER_LIMIT always has a value.                              */
           /* need to check whether MP_EAGER_LIMIT has been export            */
-          EagerLimit = (char*)MPIU_Malloc(32 * sizeof(char));
+          EagerLimit = (char*)MPL_malloc(32 * sizeof(char));
           sprintf(EagerLimit, "MP_EAGER_LIMIT=%d",val);
           rc = putenv(EagerLimit);
           if (rc !=0) {
@@ -280,7 +280,7 @@ static char *MPIDI_init_flex(char *hp)
        OVERHEAD * fcount * FLEX_NUM;
    kk=fcount *FLEX_NUM *sizeof(char *);
    size = ALIGN8(kk);
-   area = (char **) MPIU_Malloc(size);
+   area = (char **) MPL_malloc(size);
    malloc_list[nMallocs].ptr=(void *) area;
    malloc_list[nMallocs].size=size;
    malloc_list[nMallocs].type=FLEX;
@@ -415,7 +415,7 @@ int MPIDI_mm_init(int nTasks,uint *eager_limit_in,unsigned long *buf_mem_in)
 #   endif
     if (eager_limit_in == 0) return 0;  /* no EA buffer is needed */
     maxMallocs=MAX_MALLOCS;
-    malloc_list=(malloc_list_t *) MPIU_Malloc(maxMallocs * sizeof(malloc_list_t));
+    malloc_list=(malloc_list_t *) MPL_malloc(maxMallocs * sizeof(malloc_list_t));
     if (malloc_list == NULL) return errno;
     nMallocs=0;
     mem_inuse=0;
@@ -439,7 +439,7 @@ int MPIDI_mm_init(int nTasks,uint *eager_limit_in,unsigned long *buf_mem_in)
     }
     sizetrans[i] = sizetrans[i-1];
      /* 65536 is for flex stack which is not part of buf_mem_size */
-     heap = MPIU_Malloc(buf_mem + 65536);
+     heap = MPL_malloc(buf_mem + 65536);
      if (heap == NULL) return errno;
     malloc_list[nMallocs].ptr=(void *) heap;
     malloc_list[nMallocs].size=buf_mem + 65536;
@@ -479,9 +479,9 @@ void MPIDI_close_mm()
 
     if (nMallocs != 0) {
       for (i=0; i< nMallocs; i++) {
-        MPIU_Free((void *) (malloc_list[i].ptr));
+        MPL_free((void *) (malloc_list[i].ptr));
       }
-     MPIU_Free(malloc_list);
+     MPL_free(malloc_list);
     }
 }
 
@@ -619,8 +619,8 @@ static void MPIDI_buddy_free(void *ptr)
 #  ifdef TRACE
    int nAllocs =0;   /* number of times MPIDI_mm_alloc() is called */
    int nFree =0;   /* number of times MPIDI_mm_free() is called */
-   int nM=0;       /* number of times MPIU_Malloc() is called   */
-   int nF=0;       /* number of times MPIU_Free() is called     */
+   int nM=0;       /* number of times MPL_malloc() is called   */
+   int nF=0;       /* number of times MPL_free() is called     */
 #  endif 
 void *MPIDI_mm_alloc(size_t size)
 {
@@ -641,7 +641,7 @@ void *MPIDI_mm_alloc(size_t size)
    }
    if (pt == NULL) {
        MPIU_THREAD_CS_ENTER(MSGQUEUE,0);
-       pt=MPIU_Malloc(size);
+       pt=MPL_malloc(size);
        MPIU_THREAD_CS_EXIT(MSGQUEUE,0);
        if (MPIDI_Process.mp_statistics) {
            mem_inuse = mem_inuse + sizetable[tmp];
@@ -705,7 +705,7 @@ void MPIDI_mm_free(void *ptr, size_t size)
      nF++;
      printf("free nF=%d size=%d ptr=0x%p \n",nF,sizetable[bucket],ptr); fflush(stdout);
 #    endif
-     MPIU_Free(ptr);
+     MPL_free(ptr);
      MPIU_THREAD_CS_EXIT(MSGQUEUE,0);
    }
 #  ifdef TRACE
diff --git a/src/mpid/pamid/src/mpidi_env.c b/src/mpid/pamid/src/mpidi_env.c
index 09d7764..3198723 100644
--- a/src/mpid/pamid/src/mpidi_env.c
+++ b/src/mpid/pamid/src/mpidi_env.c
@@ -807,7 +807,7 @@ MPIDI_Env_setup(int rank, int requested)
     if (env != NULL)
       {
         size_t i, n = strlen(env);
-        char * tmp = (char *) MPIU_Malloc(n+1);
+        char * tmp = (char *) MPL_malloc(n+1);
         strncpy(tmp,env,n);
         if (n>0) tmp[n]=0;
 
@@ -831,7 +831,7 @@ MPIDI_Env_setup(int rank, int requested)
               }
           }
 
-        MPIU_Free (tmp);
+        MPL_free (tmp);
       }
   }
 
@@ -1027,8 +1027,8 @@ MPIDI_Env_setup(int rank, int requested)
       ENV_Deprecated(names, 1, &found_deprecated_env_var, rank, 0);
     }
 #if (MPIDI_STATISTICS || MPIDI_PRINTENV)
-    mpich_env=(MPIDI_printenv_t *) MPIU_Malloc(sizeof(MPIDI_printenv_t)+1);
-    mpid_statp=(MPIX_stats_t *) MPIU_Malloc(sizeof(MPIX_stats_t)+1);
+    mpich_env=(MPIDI_printenv_t *) MPL_malloc(sizeof(MPIDI_printenv_t)+1);
+    mpid_statp=(MPIX_stats_t *) MPL_malloc(sizeof(MPIX_stats_t)+1);
     memset((void *)mpich_env,0,sizeof(MPIDI_printenv_t));
     memset((void *)mpid_statp,0,sizeof(MPIX_stats_t));
     /* If MP_STATISTICS is set, each task prints statistics data at the end of an MPI jobs */
diff --git a/src/mpid/pamid/src/mpidi_pami_datatype.c b/src/mpid/pamid/src/mpidi_pami_datatype.c
index b700ea0..395f613 100644
--- a/src/mpid/pamid/src/mpidi_pami_datatype.c
+++ b/src/mpid/pamid/src/mpidi_pami_datatype.c
@@ -42,14 +42,14 @@ void MPIDI_PAMI_datatype_commit_hook (MPI_Datatype *ptr)
       MPID_Datatype_get_ptr(*ptr, datatype_ptr);
 
       pami_result_t pami_dtop_result;
-      datatype_ptr->device_datatype = (pami_type_t *) MPIU_Malloc(sizeof(pami_type_t));
+      datatype_ptr->device_datatype = (pami_type_t *) MPL_malloc(sizeof(pami_type_t));
       pami_dtop_result = PAMI_Type_create ((pami_type_t *)datatype_ptr->device_datatype);
       MPIU_Assert(pami_dtop_result == PAMI_SUCCESS);
 
       /* Flatten the non-contiguous data type into arrays describing the contiguous chunks.
        */
-      MPI_Aint *dt_offset_array = (MPI_Aint *) MPIU_Malloc(datatype_ptr->max_contig_blocks * sizeof(MPI_Aint));
-      MPI_Aint *dt_size_array = (MPI_Aint *) MPIU_Malloc(datatype_ptr->max_contig_blocks * sizeof(MPI_Aint));
+      MPI_Aint *dt_offset_array = (MPI_Aint *) MPL_malloc(datatype_ptr->max_contig_blocks * sizeof(MPI_Aint));
+      MPI_Aint *dt_size_array = (MPI_Aint *) MPL_malloc(datatype_ptr->max_contig_blocks * sizeof(MPI_Aint));
       MPI_Aint dt_array_len = datatype_ptr->max_contig_blocks;
       int rc = MPIR_Type_flatten(*ptr, dt_offset_array, dt_size_array, &dt_array_len);
 
@@ -73,8 +73,8 @@ void MPIDI_PAMI_datatype_commit_hook (MPI_Datatype *ptr)
        */
       pami_dtop_result = PAMI_Type_complete (*(pami_type_t*)(datatype_ptr->device_datatype),1);
       MPIU_Assert(pami_dtop_result == PAMI_SUCCESS);
-      MPIU_Free(dt_offset_array);
-      MPIU_Free(dt_size_array);
+      MPL_free(dt_offset_array);
+      MPL_free(dt_size_array);
     }
   return;
 }
@@ -93,7 +93,7 @@ void MPIDI_PAMI_datatype_destroy_hook (MPID_Datatype *ptr)
         pami_result_t pami_dtop_result;
         pami_dtop_result = PAMI_Type_destroy ((pami_type_t *)ptr->device_datatype);
         MPIU_Assert(pami_dtop_result == PAMI_SUCCESS);
-        MPIU_Free(ptr->device_datatype);
+        MPL_free(ptr->device_datatype);
       }
     }
 }
@@ -117,14 +117,14 @@ void MPIDI_PAMI_datatype_dup_hook (MPI_Datatype *ptr)
       MPID_Datatype_get_ptr(*ptr, datatype_ptr);
 
       pami_result_t pami_dtop_result;
-      datatype_ptr->device_datatype = (pami_type_t *) MPIU_Malloc(sizeof(pami_type_t));
+      datatype_ptr->device_datatype = (pami_type_t *) MPL_malloc(sizeof(pami_type_t));
       pami_dtop_result = PAMI_Type_create ((pami_type_t *)datatype_ptr->device_datatype);
       MPIU_Assert(pami_dtop_result == PAMI_SUCCESS);
 
       /* Flatten the non-contiguous data type into arrays describing the contiguous chunks.
        */
-      MPI_Aint *dt_offset_array = (MPI_Aint *) MPIU_Malloc(datatype_ptr->max_contig_blocks * sizeof(MPI_Aint));
-      MPI_Aint *dt_size_array = (MPI_Aint *) MPIU_Malloc(datatype_ptr->max_contig_blocks * sizeof(MPI_Aint));
+      MPI_Aint *dt_offset_array = (MPI_Aint *) MPL_malloc(datatype_ptr->max_contig_blocks * sizeof(MPI_Aint));
+      MPI_Aint *dt_size_array = (MPI_Aint *) MPL_malloc(datatype_ptr->max_contig_blocks * sizeof(MPI_Aint));
       MPI_Aint dt_array_len = datatype_ptr->max_contig_blocks;
       int rc = MPIR_Type_flatten(*ptr, dt_offset_array, dt_size_array, &dt_array_len);
 
@@ -148,8 +148,8 @@ void MPIDI_PAMI_datatype_dup_hook (MPI_Datatype *ptr)
        */
       pami_dtop_result = PAMI_Type_complete (*(pami_type_t*)(datatype_ptr->device_datatype),1);
       MPIU_Assert(pami_dtop_result == PAMI_SUCCESS);
-      MPIU_Free(dt_offset_array);
-      MPIU_Free(dt_size_array);
+      MPL_free(dt_offset_array);
+      MPL_free(dt_size_array);
     }
   return;
 }
diff --git a/src/mpid/pamid/src/mpidi_util.c b/src/mpid/pamid/src/mpidi_util.c
index e5fc834..20ce459 100644
--- a/src/mpid/pamid/src/mpidi_util.c
+++ b/src/mpid/pamid/src/mpidi_util.c
@@ -138,7 +138,7 @@ void MPIDI_Setup_networkenv()
       }
 
       if ( NULL != network )  {
-           mpich_env->network_string = (char *) MPIU_Malloc(strlen(network)+1);
+           mpich_env->network_string = (char *) MPL_malloc(strlen(network)+1);
            if( NULL !=   mpich_env->network_string )  {
               memcpy(mpich_env->network_string,network,strlen(network)+1);
            }
@@ -190,7 +190,7 @@ int  MPIDI_Update_mpenv()
         CopySendBufSize = SendBufSize - sizeof(MPIDI_MsgInfo);
         mpich_env->copySendBufSize = CopySendBufSize;
 
-        pami_config = (pami_configuration_t *) MPIU_Malloc(10 * sizeof(pami_configuration_t));
+        pami_config = (pami_configuration_t *) MPL_malloc(10 * sizeof(pami_configuration_t));
         memset((void *) pami_config,0, sizeof(pami_config));
         pami_config[0].name = (pami_attribute_name_t)PAMI_CONTEXT_MAX_PKT_SZ;
         pami_config[1].name = (pami_attribute_name_t)PAMI_CONTEXT_RFIFO_SZ;
@@ -219,7 +219,7 @@ int  MPIDI_Update_mpenv()
         }
         /* obtain minimum message size for bulk xfer (rdma)  */
         mpich_env->rdma_min_msg_size = (long) pami_config[4].value.intval;
-        MPIU_Free(pami_config);
+        MPL_free(pami_config);
 }
 
 
@@ -639,7 +639,7 @@ int MPIDI_Print_mpenv(int rank,int size)
         strcpy(sender.striping_type, striping_type_set[(mpich_env->strip_type)]);
 
 
-        pami_config = (pami_configuration_t *) MPIU_Malloc(10 * sizeof(pami_configuration_t));
+        pami_config = (pami_configuration_t *) MPL_malloc(10 * sizeof(pami_configuration_t));
         memset((void *) pami_config,0, sizeof(pami_config));
         pami_config[0].name = (pami_attribute_name_t)PAMI_CONTEXT_ACK_THRESH;
         pami_config[1].name = (pami_attribute_name_t)PAMI_CONTEXT_REXMIT_BUF_CNT;
@@ -659,7 +659,7 @@ int MPIDI_Print_mpenv(int rank,int size)
             strcpy(sender.rc_qp_use_lmc, "YES");
         else
             strcpy(sender.rc_qp_use_lmc, "NO");
-        MPIU_Free(pami_config);
+        MPL_free(pami_config);
 
         /* - Begin Bulk transfer/RDMA & IB settings */
         if ( mpich_env->use_rdma == PAMI_HINT_DISABLE )
@@ -700,9 +700,9 @@ int MPIDI_Print_mpenv(int rank,int size)
         }
 
         if (mytask == 0) {  /* allocate a receive buffer for the gather of the base structure */
-                gatherer = (MPIDI_printenv_t*) MPIU_Malloc(task_count * sizeof(MPIDI_printenv_t));
+                gatherer = (MPIDI_printenv_t*) MPL_malloc(task_count * sizeof(MPIDI_printenv_t));
                 if (!gatherer) {
-                        TRACE_ERR("_mpi_printenv gatherer MPIU_Malloc failed rc=%d\n",rc);
+                        TRACE_ERR("_mpi_printenv gatherer MPL_malloc failed rc=%d\n",rc);
                         return 1;
                 }
                 memset(gatherer,0,task_count*sizeof(MPIDI_printenv_t));
@@ -775,7 +775,7 @@ int MPIDI_Print_mpenv(int rank,int size)
 
 
         if (mytask == 0) {
-            MPIU_Free(gatherer);
+            MPL_free(gatherer);
         }
 
         return 0;
@@ -791,13 +791,13 @@ void MPIDI_print_statistics() {
        if (MPIDI_Process.mp_statistics) {
            MPIDI_Statistics_write(stdout);
            if (mpid_statp) {
-               MPIU_Free(mpid_statp);
+               MPL_free(mpid_statp);
                mpid_statp=NULL;
            }
        }
     if (MPIDI_Process.mp_printenv) {
         if (mpich_env) {
-            MPIU_Free(mpich_env);
+            MPL_free(mpich_env);
             mpich_env=NULL;
         }
     }
@@ -1334,10 +1334,10 @@ static void MPIDI_collsel_init_advisor_params(advisor_params_t *params)
 
 static void MPIDI_collsel_free_advisor_params(advisor_params_t *params)
 {
-  if(params->collectives) MPIU_Free(params->collectives);
-  if(params->procs_per_node) MPIU_Free(params->procs_per_node);
-  if(params->geometry_sizes) MPIU_Free(params->geometry_sizes);
-  if(params->message_sizes) MPIU_Free(params->message_sizes);
+  if(params->collectives) MPL_free(params->collectives);
+  if(params->procs_per_node) MPL_free(params->procs_per_node);
+  if(params->geometry_sizes) MPL_free(params->geometry_sizes);
+  if(params->message_sizes) MPL_free(params->message_sizes);
 }
 
 
@@ -1370,7 +1370,7 @@ static void MPIDI_collsel_init_xfer_tables()
 static int MPIDI_collsel_process_collectives(char *coll_arg, advisor_params_t *params)
 {
   int i, ret = 0, arg_len = strlen(coll_arg);
-  char *collectives = (char *) MPIU_Malloc(arg_len + 1);
+  char *collectives = (char *) MPL_malloc(arg_len + 1);
   char *coll;
   int infolevel = 0;
 #if (MPIDI_STATISTICS || MPIDI_PRINTENV)
@@ -1380,11 +1380,11 @@ static int MPIDI_collsel_process_collectives(char *coll_arg, advisor_params_t *p
   /* if already set via config file, free it */
   if(params->collectives)
   {
-    MPIU_Free(params->collectives);
+    MPL_free(params->collectives);
     params->num_collectives = 0;
   }
   /* Allocating some extra space should be fine */
-  params->collectives = (pami_xfer_type_t *)MPIU_Malloc(sizeof(pami_xfer_type_t)*PAMI_XFER_COUNT);
+  params->collectives = (pami_xfer_type_t *)MPL_malloc(sizeof(pami_xfer_type_t)*PAMI_XFER_COUNT);
 
   strcpy(collectives, coll_arg);
   coll = strtok(collectives,",");
@@ -1443,12 +1443,12 @@ static int MPIDI_collsel_process_collectives(char *coll_arg, advisor_params_t *p
   }
   if(params->num_collectives == 0)
   {
-    MPIU_Free(params->collectives);
+    MPL_free(params->collectives);
     params->collectives = NULL;
     ret = 1;
   }
 
-  MPIU_Free(collectives);
+  MPL_free(collectives);
   return ret;
 }
 
@@ -1456,18 +1456,18 @@ static int MPIDI_collsel_process_collectives(char *coll_arg, advisor_params_t *p
 static int MPIDI_collsel_process_msg_sizes(char *msg_sizes_arg, advisor_params_t *params)
 {
   int ret = 0, arg_len = strlen(msg_sizes_arg);
-  char *msg_sizes = (char *) MPIU_Malloc(arg_len + 1);
+  char *msg_sizes = (char *) MPL_malloc(arg_len + 1);
   char *msg_sz;
   size_t tmp;
   size_t array_size = 50;
   /* if already set via config file, free it */
   if(params->message_sizes)
   {
-    MPIU_Free(params->message_sizes);
+    MPL_free(params->message_sizes);
     params->num_message_sizes = 0;
   }
   /* Allocating some extra space should be fine */
-  params->message_sizes = (size_t *)MPIU_Malloc(sizeof(size_t) * array_size);
+  params->message_sizes = (size_t *)MPL_malloc(sizeof(size_t) * array_size);
 
   strcpy(msg_sizes, msg_sizes_arg);
   msg_sz = strtok(msg_sizes,",");
@@ -1476,7 +1476,7 @@ static int MPIDI_collsel_process_msg_sizes(char *msg_sizes_arg, advisor_params_t
     tmp = strtol(msg_sz, NULL, 10);
     if(tmp == 0)
     {
-      MPIU_Free(params->message_sizes);
+      MPL_free(params->message_sizes);
       params->message_sizes = NULL;
       if(!task_id)
       {
@@ -1489,13 +1489,13 @@ static int MPIDI_collsel_process_msg_sizes(char *msg_sizes_arg, advisor_params_t
     if(params->num_message_sizes >= array_size)
     {
       array_size *= 2;
-      params->message_sizes = (size_t *) MPIU_Realloc(params->message_sizes,
+      params->message_sizes = (size_t *) MPL_realloc(params->message_sizes,
                                                       sizeof(size_t) * array_size);
     }
     params->message_sizes[params->num_message_sizes++] = tmp;
     msg_sz = strtok(NULL,",");
   }
-  MPIU_Free(msg_sizes);
+  MPL_free(msg_sizes);
   return ret;
 }
 
@@ -1503,18 +1503,18 @@ static int MPIDI_collsel_process_msg_sizes(char *msg_sizes_arg, advisor_params_t
 static int MPIDI_collsel_process_geo_sizes(char *geo_sizes_arg, advisor_params_t *params)
 {
   int ret = 0, arg_len = strlen(geo_sizes_arg);
-  char *geo_sizes = (char *) MPIU_Malloc(arg_len + 1);
+  char *geo_sizes = (char *) MPL_malloc(arg_len + 1);
   char *geo_sz;
   size_t tmp;
   size_t array_size = 50;
   /* if already set via config file, free it */
   if(params->geometry_sizes)
   {
-    MPIU_Free(params->geometry_sizes);
+    MPL_free(params->geometry_sizes);
     params->num_geometry_sizes = 0;
   }
   /* Allocating some extra space should be fine */
-  params->geometry_sizes = (size_t *)MPIU_Malloc(sizeof(size_t) * array_size);
+  params->geometry_sizes = (size_t *)MPL_malloc(sizeof(size_t) * array_size);
 
   strcpy(geo_sizes, geo_sizes_arg);
   geo_sz = strtok(geo_sizes,",");
@@ -1523,7 +1523,7 @@ static int MPIDI_collsel_process_geo_sizes(char *geo_sizes_arg, advisor_params_t
     tmp = strtol(geo_sz, NULL, 10);
     if(tmp < 2 || tmp > num_tasks)
     {
-      MPIU_Free(params->geometry_sizes);
+      MPL_free(params->geometry_sizes);
       params->geometry_sizes = NULL;
       if(!task_id)
       {
@@ -1536,13 +1536,13 @@ static int MPIDI_collsel_process_geo_sizes(char *geo_sizes_arg, advisor_params_t
     if(params->num_geometry_sizes >= array_size)
     {
       array_size *= 2;
-      params->geometry_sizes = (size_t *) MPIU_Realloc(params->geometry_sizes,
+      params->geometry_sizes = (size_t *) MPL_realloc(params->geometry_sizes,
                                                        sizeof(size_t) * array_size);
     }
     params->geometry_sizes[params->num_geometry_sizes++] = tmp;
     geo_sz = strtok(NULL,",");
   }
-  MPIU_Free(geo_sizes);
+  MPL_free(geo_sizes);
   return ret;
 }
 
@@ -1565,7 +1565,7 @@ static int MPIDI_collsel_process_output_file(char *filename, char **out_file)
     }
     fprintf(stderr, "File %s already exists, renaming existing file\n", filename);
 
-    newname = (char *) MPIU_Malloc(filename_len + 5);
+    newname = (char *) MPL_malloc(filename_len + 5);
     for (i = 0; i < 500; ++i)
     {
       sprintf(newname,"%s.%d", filename, i);
@@ -1575,7 +1575,7 @@ static int MPIDI_collsel_process_output_file(char *filename, char **out_file)
         break;
       }
     }
-    MPIU_Free(newname);
+    MPL_free(newname);
     if(i == 500 || ret != 0)
     {
       fprintf(stderr, "Error renaming file\n");
@@ -1583,8 +1583,8 @@ static int MPIDI_collsel_process_output_file(char *filename, char **out_file)
     }
   }
   /* if file name is already set via config file, free it */
-  if(*out_file) MPIU_Free(*out_file);
-  *out_file = (char *)MPIU_Malloc(filename_len + 1);
+  if(*out_file) MPL_free(*out_file);
+  *out_file = (char *)MPL_malloc(filename_len + 1);
   strcpy(*out_file, filename);
 
   return ret;
@@ -1648,7 +1648,7 @@ static int MPIDI_collsel_process_ini_file(const char *filename, advisor_params_t
             filename, strerror(errno));
     return 1;
   }
-  line = (char *) MPIU_Malloc(2000);
+  line = (char *) MPL_malloc(2000);
 
   while (fgets(line, 2000, file) != NULL)
   {
@@ -1718,7 +1718,7 @@ static int MPIDI_collsel_process_ini_file(const char *filename, advisor_params_t
     }
     if(ret) break;
   }
-  MPIU_Free(line);
+  MPL_free(line);
   fclose(file);
 
   return ret;
@@ -1825,7 +1825,7 @@ static int MPIDI_collsel_process_arg(int argc, char *argv[], advisor_params_t *p
    /* If user did not specify any collectives, benchmark all */
    if(params->num_collectives == 0)
    {
-     params->collectives = (pami_xfer_type_t *)MPIU_Malloc(sizeof(pami_xfer_type_t)*PAMI_XFER_COUNT);
+     params->collectives = (pami_xfer_type_t *)MPL_malloc(sizeof(pami_xfer_type_t)*PAMI_XFER_COUNT);
      for(i = 0; i < PAMI_XFER_COUNT; i++)
      {
        if(i == 4 || i == 7 || i == 10 || i == 14)
@@ -1881,7 +1881,7 @@ int MPIDI_collsel_pami_tune_parse_params(int argc, char ** argv)
     MPIDI_collsel_print_usage();
     return PAMI_ERROR;
   }
-  MPIDI_Collsel_advisor_params.procs_per_node = (size_t*)MPIU_Malloc(1 * sizeof(size_t));
+  MPIDI_Collsel_advisor_params.procs_per_node = (size_t*)MPL_malloc(1 * sizeof(size_t));
   MPIDI_Collsel_advisor_params.num_procs_per_node = 1;
   MPIDI_Collsel_advisor_params.procs_per_node[0] = PAMIX_Client_query(MPIDI_Client, PAMI_CLIENT_NUM_LOCAL_TASKS  ).value.intval;
 
diff --git a/src/mpid/pamid/src/mpix/mpix.c b/src/mpid/pamid/src/mpix/mpix.c
index 6385e87..96d1746 100644
--- a/src/mpid/pamid/src/mpix/mpix.c
+++ b/src/mpid/pamid/src/mpix/mpix.c
@@ -99,7 +99,7 @@ void MPIX_Dump_stacks()
     }
   /* This is #ifdef'd out:  In debug libraries, it causes a compile error. */
 #if 0
-  free(bt_strings); /* Since this is not allocated by MPIU_Malloc, do not use MPIU_Free */
+  free(bt_strings); /* Since this is not allocated by MPL_malloc, do not use MPL_free */
 #endif
 }
 #else
diff --git a/src/mpid/pamid/src/onesided/mpid_1s.c b/src/mpid/pamid/src/onesided/mpid_1s.c
index 87358f0..7d3db88 100644
--- a/src/mpid/pamid/src/onesided/mpid_1s.c
+++ b/src/mpid/pamid/src/onesided/mpid_1s.c
@@ -44,8 +44,8 @@ MPIDI_Win_DoneCB(pami_context_t  context,
                                      req->origin.datatype);
           MPID_assert(mpi_errno == MPI_SUCCESS);
           MPID_Datatype_release(req->origin.dt.pointer);
-          MPIU_Free(req->buffer);
-          MPIU_Free(req->user_buffer);
+          MPL_free(req->buffer);
+          MPL_free(req->user_buffer);
           req->buffer_free = 0;
         }
     }
@@ -58,16 +58,16 @@ MPIDI_Win_DoneCB(pami_context_t  context,
       MPID_Request * req_handle = req->req_handle;
 
       if (req->buffer_free) {
-          MPIU_Free(req->buffer);
-          MPIU_Free(req->user_buffer);
+          MPL_free(req->buffer);
+          MPL_free(req->user_buffer);
           req->buffer_free = 0;
       }
       MPIDI_Win_datatype_unmap(&req->target.dt);
       if (req->accum_headers)
-          MPIU_Free(req->accum_headers);
+          MPL_free(req->accum_headers);
 
       if (!((req->type > MPIDI_WIN_REQUEST_GET_ACCUMULATE) && (req->type <=MPIDI_WIN_REQUEST_RGET_ACCUMULATE)))
-          MPIU_Free(req);
+          MPL_free(req);
 
       if(req_handle) {
 
@@ -125,7 +125,7 @@ MPIDI_Win_datatype_map(MPIDI_Datatype * dt)
     {
       unsigned map_size = dt->pointer->max_contig_blocks*dt->count + 1;
       dt->num_contig = map_size;
-      dt->map = (DLOOP_VECTOR*)MPIU_Malloc(map_size * sizeof(DLOOP_VECTOR));
+      dt->map = (DLOOP_VECTOR*)MPL_malloc(map_size * sizeof(DLOOP_VECTOR));
       MPID_assert(dt->map != NULL);
 
       DLOOP_Offset last = dt->pointer->size*dt->count;
@@ -147,5 +147,5 @@ void
 MPIDI_Win_datatype_unmap(MPIDI_Datatype * dt)
 {
   if (dt->map != &dt->__map)
-    MPIU_Free(dt->map);;
+    MPL_free(dt->map);;
 }
diff --git a/src/mpid/pamid/src/onesided/mpid_win_accumulate.c b/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
index 50255d6..39ecead 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
@@ -162,7 +162,7 @@ MPID_Accumulate(const void   *origin_addr,
 {
   int mpi_errno = MPI_SUCCESS;
   int shm_locked = 0;
-  MPIDI_Win_request *req = MPIU_Calloc0(1, MPIDI_Win_request);
+  MPIDI_Win_request *req = MPL_calloc0(1, MPIDI_Win_request);
   req->win          = win;
   if(win->mpid.request_based != 1)
     req->type         = MPIDI_WIN_REQUEST_ACCUMULATE;
@@ -247,7 +247,7 @@ MPID_Accumulate(const void   *origin_addr,
       if(req->req_handle)
         MPIR_cc_set(req->req_handle->cc_ptr, 0);
       else
-        MPIU_Free(req);
+        MPL_free(req);
       return MPI_SUCCESS;
     }
 
@@ -262,7 +262,7 @@ MPID_Accumulate(const void   *origin_addr,
   else
     {
       req->buffer_free = 1;
-      req->buffer      = MPIU_Malloc(req->origin.dt.size);
+      req->buffer      = MPL_malloc(req->origin.dt.size);
       MPID_assert(req->buffer != NULL);
       int mpi_errno = 0;
       mpi_errno = MPIR_Localcopy(origin_addr,
@@ -310,7 +310,7 @@ MPID_Accumulate(const void   *origin_addr,
        (*uop)((void *) origin_addr, dest_addr, &one, &origin_datatype);
 
 
-        MPIU_Free(req);
+        MPL_free(req);
         ++win->mpid.sync.complete;
 
    } else { /* non-shared    */
@@ -331,7 +331,7 @@ MPID_Accumulate(const void   *origin_addr,
     MPID_assert(basic_type != MPI_DATATYPE_NULL);
 
     unsigned index;
-    MPIDI_Win_MsgInfo * headers = MPIU_Calloc0(req->target.dt.num_contig, MPIDI_Win_MsgInfo);
+    MPIDI_Win_MsgInfo * headers = MPL_calloc0(req->target.dt.num_contig, MPIDI_Win_MsgInfo);
     req->accum_headers = headers;
     for (index=0; index < req->target.dt.num_contig; ++index) {
      headers[index].addr = win->mpid.info[target_rank].base_addr + req->offset +
diff --git a/src/mpid/pamid/src/onesided/mpid_win_allocate.c b/src/mpid/pamid/src/onesided/mpid_win_allocate.c
index 1e73675..aebc0d6 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_allocate.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_allocate.c
@@ -66,7 +66,7 @@ MPID_Win_allocate(MPI_Aint     size,
   win = *win_ptr;
 
   if (size > 0) {
-      baseP = MPIU_Malloc(size);
+      baseP = MPL_malloc(size);
   #ifndef MPIDI_NO_ASSERT
       MPID_assert(baseP != NULL);
   #else
diff --git a/src/mpid/pamid/src/onesided/mpid_win_allocate_shared.c b/src/mpid/pamid/src/onesided/mpid_win_allocate_shared.c
index 416e358..01db84f 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_allocate_shared.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_allocate_shared.c
@@ -342,7 +342,7 @@ MPID_getSharedSegment(MPI_Aint     size,
                 new_size += size;
         }
 
-        base_pp = MPIU_Malloc(new_size);
+        base_pp = MPL_malloc(new_size);
         MPID_assert(base_pp !=NULL);
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
 
@@ -366,13 +366,13 @@ MPID_getSharedSegment(MPI_Aint     size,
          * the node to determine the amount of shared memory to allocate
          */
         MPI_Aint * size_array;
-        size_array = MPIU_Malloc (2*comm_size*sizeof(MPI_Aint));
+        size_array = MPL_malloc (2*comm_size*sizeof(MPI_Aint));
         size_array[rank] = (MPI_Aint) size;
         mpi_errno = MPIR_Allgather_impl(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
                                         size_array, 1 * sizeof(MPI_Aint), MPI_BYTE,
                                         (*win_ptr)->comm_ptr, &errflag);
         if (mpi_errno) {
-            MPIU_Free(size_array);
+            MPL_free(size_array);
             MPIU_ERR_POP(mpi_errno);
         }
 
@@ -418,7 +418,7 @@ MPID_getSharedSegment(MPI_Aint     size,
         win->base = (void *) ((long) win->mpid.shm->base_addr + (long ) MPIDI_ROUND_UP_PAGESIZE((sizeof(MPIDI_Win_shm_ctrl_t) + ((comm_size+1) * sizeof(void *))),pageSize));
 
 
-        MPIU_Free(size_array);
+        MPL_free(size_array);
 
         /* increment the shared counter */
         OPA_fetch_and_add_int((OPA_int_t *) &win->mpid.shm->ctrl->shm_count,(int) 1);
@@ -503,7 +503,7 @@ MPID_Win_allocate_shared(MPI_Aint     size,
   mpi_errno =MPIDI_Win_init(size,disp_unit,win_ptr, info, comm_ptr, MPI_WIN_FLAVOR_SHARED, MPI_WIN_UNIFIED);
   if (mpi_errno) MPIU_ERR_POP(mpi_errno);
   win = *win_ptr;
-  win->mpid.shm = MPIU_Malloc(sizeof(MPIDI_Win_shm_t));
+  win->mpid.shm = MPL_malloc(sizeof(MPIDI_Win_shm_t));
   MPID_assert(win->mpid.shm != NULL);
   memset(win->mpid.shm, 0, sizeof(MPIDI_Win_shm_t));
 
@@ -553,7 +553,7 @@ fn_exit:
 fn_fail:
     if (win != NULL)
       if (win->mpid.shm != NULL)
-        MPIU_Free(win->mpid.shm);
+        MPL_free(win->mpid.shm);
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 
diff --git a/src/mpid/pamid/src/onesided/mpid_win_compare_and_swap.c b/src/mpid/pamid/src/onesided/mpid_win_compare_and_swap.c
index eddd15f..f20410e 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_compare_and_swap.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_compare_and_swap.c
@@ -87,7 +87,7 @@ int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
      logical, or byte, per the classes given on page 165. */
   MPIR_ERRTEST_TYPE_RMA_ATOMIC(datatype, mpi_errno);
 
-  req = (MPIDI_Win_request *) MPIU_Calloc0(1, MPIDI_Win_request);
+  req = (MPIDI_Win_request *) MPL_calloc0(1, MPIDI_Win_request);
   req->win          = win;
   req->type         = MPIDI_WIN_REQUEST_COMPARE_AND_SWAP;
 
@@ -104,7 +104,7 @@ int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
 
   if (req->origin.dt.size == 0)
     {
-      MPIU_Free(req);
+      MPL_free(req);
       return MPI_SUCCESS;
     }
 
diff --git a/src/mpid/pamid/src/onesided/mpid_win_create.c b/src/mpid/pamid/src/onesided/mpid_win_create.c
index a907189..d509671 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_create.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_create.c
@@ -56,7 +56,7 @@ MPIDI_Win_init( MPI_Aint length,
   size = comm_ptr->local_size;
   rank = comm_ptr->rank;
 
-  win->mpid.info = MPIU_Malloc(size * sizeof(struct MPIDI_Win_info));
+  win->mpid.info = MPL_malloc(size * sizeof(struct MPIDI_Win_info));
   MPID_assert(win->mpid.info != NULL);
   memset((void *) win->mpid.info,0,(size * sizeof(struct MPIDI_Win_info)));
   winfo = &win->mpid.info[rank];
diff --git a/src/mpid/pamid/src/onesided/mpid_win_create_dynamic.c b/src/mpid/pamid/src/onesided/mpid_win_create_dynamic.c
index b3897c3..a8a50bb 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_create_dynamic.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_create_dynamic.c
@@ -61,12 +61,12 @@ MPID_Win_create_dynamic( MPID_Info  * info,
   void *base = NULL;
   size_t length = 0;
   Kernel_MemoryRegion_t memregion;
-  void *tmpbuf = MPIU_Malloc(sizeof(int));
+  void *tmpbuf = MPL_malloc(sizeof(int));
   Kernel_CreateMemoryRegion(&memregion, tmpbuf, sizeof(int));
   //Reset base to base VA of local heap
   base = memregion.BaseVa;
   length = memregion.Bytes;
-  MPIU_Free(tmpbuf);
+  MPL_free(tmpbuf);
   
   if (length != 0)
     {
diff --git a/src/mpid/pamid/src/onesided/mpid_win_fetch_and_op.c b/src/mpid/pamid/src/onesided/mpid_win_fetch_and_op.c
index 826afab..5cf1508 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_fetch_and_op.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_fetch_and_op.c
@@ -236,7 +236,7 @@ int MPID_Fetch_and_op(const void *origin_addr, void *result_addr,
     }  
   }
 
-  req = (MPIDI_Win_request *) MPIU_Calloc0(1, MPIDI_Win_request);
+  req = (MPIDI_Win_request *) MPL_calloc0(1, MPIDI_Win_request);
   req->win          = win;
   req->type         = MPIDI_WIN_REQUEST_FETCH_AND_OP;
 
@@ -283,7 +283,7 @@ int MPID_Fetch_and_op(const void *origin_addr, void *result_addr,
 
   if (req->origin.dt.size == 0) 
     {
-      MPIU_Free(req);
+      MPL_free(req);
       return MPI_SUCCESS;
     }
 
diff --git a/src/mpid/pamid/src/onesided/mpid_win_free.c b/src/mpid/pamid/src/onesided/mpid_win_free.c
index 1db090d..a4ec6d5 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_free.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_free.c
@@ -55,9 +55,9 @@ int MPIDI_SHM_Win_free(MPID_Win **win_ptr)
     MPID_Abort(NULL, MPI_ERR_RMA_SHARED, -1, "MPI_Win_free error");
 #endif
   } else {/* one task on a node */
-    MPIU_Free((*win_ptr)->mpid.shm->base_addr);
+    MPL_free((*win_ptr)->mpid.shm->base_addr);
   }
-  MPIU_Free((*win_ptr)->mpid.shm);
+  MPL_free((*win_ptr)->mpid.shm);
   (*win_ptr)->mpid.shm = NULL;
 
  fn_fail:
@@ -100,7 +100,7 @@ MPID_Win_free(MPID_Win **win_ptr)
 
 
   if (win->create_flavor == MPI_WIN_FLAVOR_ALLOCATE)
-    MPIU_Free(win->base);
+    MPL_free(win->base);
 
   struct MPIDI_Win_info *winfo = &win->mpid.info[rank];
 #ifdef USE_PAMI_RDMA
@@ -119,9 +119,9 @@ MPID_Win_free(MPID_Win **win_ptr)
     }
 #endif
 
-  MPIU_Free(win->mpid.info);
+  MPL_free(win->mpid.info);
   if (win->mpid.work.msgQ) 
-      MPIU_Free(win->mpid.work.msgQ);
+      MPL_free(win->mpid.work.msgQ);
 
   MPIR_Comm_release(win->comm_ptr, 0);
 
diff --git a/src/mpid/pamid/src/onesided/mpid_win_get.c b/src/mpid/pamid/src/onesided/mpid_win_get.c
index 8bd68cc..835888c 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_get.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_get.c
@@ -240,7 +240,7 @@ MPID_Get(void         *origin_addr,
   int mpi_errno = MPI_SUCCESS;
   int shm_locked=0;
   void *target_addr;
-  MPIDI_Win_request *req = MPIU_Calloc0(1, MPIDI_Win_request);
+  MPIDI_Win_request *req = MPL_calloc0(1, MPIDI_Win_request);
   req->win          = win;
   if(win->mpid.request_based != 1) 
     req->type         = MPIDI_WIN_REQUEST_GET;
@@ -289,7 +289,7 @@ MPID_Get(void         *origin_addr,
       if(req->req_handle)
          MPIR_cc_set(req->req_handle->cc_ptr, 0);
       else
-         MPIU_Free(req);
+         MPL_free(req);
       return MPI_SUCCESS;
     }
 
@@ -321,7 +321,7 @@ MPID_Get(void         *origin_addr,
       if(req->req_handle)
         MPIR_cc_set(req->req_handle->cc_ptr, 0);
       else
-        MPIU_Free(req);
+        MPL_free(req);
       return mpi_errno;
     }
   req->target.rank = target_rank;
@@ -342,7 +342,7 @@ MPID_Get(void         *origin_addr,
   else
     {
       req->buffer_free = 1;
-      req->buffer      = MPIU_Malloc(req->origin.dt.size);
+      req->buffer      = MPL_malloc(req->origin.dt.size);
       MPID_assert(req->buffer != NULL);
 
       MPID_Datatype_add_ref(req->origin.dt.pointer);
diff --git a/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c b/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c
index 3831757..07b402f 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c
@@ -62,8 +62,8 @@ MPIDI_Win_GetAccSendAckDoneCB(pami_context_t   context,
 			     pami_result_t    result)
 {
   MPIDI_Win_GetAccMsgInfo *msginfo = (MPIDI_Win_GetAccMsgInfo *) _info;
-  MPIU_Free(msginfo->tptr);
-  MPIU_Free(msginfo);
+  MPL_free(msginfo->tptr);
+  MPL_free(msginfo);
 }
 
 static void 
@@ -78,7 +78,7 @@ MPIDI_Win_GetAccumSendAck(pami_context_t   context,
   //Copy from msginfo->addr to a contiguous buffer
   char *buffer = NULL;
 
-  buffer      = MPIU_Malloc(msginfo->size);
+  buffer      = MPL_malloc(msginfo->size);
   MPID_assert(buffer != NULL);
   
   if (msginfo->num_contig == 1)
@@ -136,7 +136,7 @@ MPIDI_WinGetAccumCB(pami_context_t    context,
   MPID_assert(msginfo_size == sizeof(MPIDI_Win_GetAccMsgInfo));
   MPID_assert(_msginfo != NULL);
   MPIDI_Win_GetAccMsgInfo * msginfo = (MPIDI_Win_GetAccMsgInfo *) 
-    MPIU_Malloc(sizeof(MPIDI_Win_GetAccMsgInfo));
+    MPL_malloc(sizeof(MPIDI_Win_GetAccMsgInfo));
 
   *msginfo = *(MPIDI_Win_GetAccMsgInfo *)_msginfo;
   msginfo->src_endpoint = sender;
@@ -161,7 +161,7 @@ MPIDI_WinGetAccumCB(pami_context_t    context,
     //send
     MPIDI_Win_GetAccumSendAck (context, msginfo, PAMI_SUCCESS);  
   else 
-    MPIU_Free(msginfo);
+    MPL_free(msginfo);
 }
 
 static void
@@ -178,11 +178,11 @@ MPIDI_Win_GetAccDoneCB(pami_context_t  context,
       MPID_Request * req_handle = req->req_handle;
 
       if (req->buffer_free) {
-          MPIU_Free(req->buffer);
+          MPL_free(req->buffer);
           req->buffer_free = 0;
       }
       if (req->accum_headers)
-          MPIU_Free(req->accum_headers);
+          MPL_free(req->accum_headers);
 
       MPIDI_Win_datatype_unmap(&req->target.dt);
       MPIDI_Win_datatype_unmap(&req->result.dt);      
@@ -191,7 +191,7 @@ MPIDI_Win_GetAccDoneCB(pami_context_t  context,
           if (req_handle) {
               req_handle->mpid.win_req = NULL;
           }
-          MPIU_Free(req);
+          MPL_free(req);
       }
       /* The instant this completion counter is set to zero another thread
        * may notice the change and begin freeing request resources. The
@@ -222,9 +222,9 @@ MPIDI_Win_GetAccAckDoneCB(pami_context_t   context,
 		   msginfo->tptr,
 		   msginfo->size,
 		   MPI_CHAR);
-    MPIU_Free(msginfo->tptr);
+    MPL_free(msginfo->tptr);
   }
-  MPIU_Free(msginfo);
+  MPL_free(msginfo);
   
   MPIDI_Win_GetAccDoneCB(context, req, result);
 }
@@ -243,14 +243,14 @@ MPIDI_WinGetAccumAckCB(pami_context_t    context,
   MPID_assert(recv   != NULL);
   MPID_assert(sndbuf == NULL);
   MPID_assert(_msginfo != NULL);
-  MPIDI_Win_GetAccMsgInfo * msginfo =MPIU_Malloc(sizeof(MPIDI_Win_GetAccMsgInfo));
+  MPIDI_Win_GetAccMsgInfo * msginfo =MPL_malloc(sizeof(MPIDI_Win_GetAccMsgInfo));
   *msginfo = *(const MPIDI_Win_GetAccMsgInfo *)_msginfo;
   MPIDI_Win_request *req = (MPIDI_Win_request *) msginfo->request;
   
   msginfo->tptr = NULL;
   recv->addr = req->result.addr;
   if (req->result_num_contig > 1)
-    recv->addr = msginfo->tptr = MPIU_Malloc(msginfo->size); 
+    recv->addr = msginfo->tptr = MPL_malloc(msginfo->size);
   
   recv->type        = PAMI_TYPE_BYTE;
   recv->offset      = 0;
@@ -376,7 +376,7 @@ MPID_Get_accumulate(const void   * origin_addr,
   }
   
   MPIDI_Win_request *req;
-  req = MPIU_Calloc0(1, MPIDI_Win_request);
+  req = MPL_calloc0(1, MPIDI_Win_request);
   req->win      = win;
   if(win->mpid.request_based != 1) 
     req->type         = MPIDI_WIN_REQUEST_GET_ACCUMULATE;
@@ -461,7 +461,7 @@ MPID_Get_accumulate(const void   * origin_addr,
       if(req->req_handle)
          MPIR_cc_set(req->req_handle->cc_ptr, 0);
       else
-         MPIU_Free(req);
+         MPL_free(req);
       return MPI_SUCCESS;
     }
 
@@ -476,7 +476,7 @@ MPID_Get_accumulate(const void   * origin_addr,
   else
     {
       req->buffer_free = 1;
-      req->buffer      = MPIU_Malloc(req->origin.dt.size);
+      req->buffer      = MPL_malloc(req->origin.dt.size);
       MPID_assert(req->buffer != NULL);
 
       int mpi_errno = 0;
@@ -518,8 +518,8 @@ MPID_Get_accumulate(const void   * origin_addr,
         ++win->mpid.sync.complete;
 
        if (req->buffer_free) {
-           MPIU_Free(req->buffer);
-           MPIU_Free(req->user_buffer);
+           MPL_free(req->buffer);
+           MPL_free(req->user_buffer);
            req->buffer_free = 0;
        }
        MPIDI_Win_datatype_unmap(&req->target.dt);
@@ -528,7 +528,7 @@ MPID_Get_accumulate(const void   * origin_addr,
        if(req->req_handle) {
           MPIR_cc_set(req->req_handle->cc_ptr, 0);
        } else { 
-           MPIU_Free(req);
+           MPL_free(req);
        }
    } else {    /* non-shared  */
   //We wait for #messages depending on target and result_datatype
@@ -549,7 +549,7 @@ MPID_Get_accumulate(const void   * origin_addr,
     MPID_assert(basic_type != MPI_DATATYPE_NULL);
 
     unsigned index;
-    MPIDI_Win_GetAccMsgInfo * headers = MPIU_Calloc0(req->target.dt.num_contig, MPIDI_Win_GetAccMsgInfo);
+    MPIDI_Win_GetAccMsgInfo * headers = MPL_calloc0(req->target.dt.num_contig, MPIDI_Win_GetAccMsgInfo);
     req->accum_headers = headers;
     for (index=0; index < req->target.dt.num_contig; ++index) {
      headers[index].addr = win->mpid.info[target_rank].base_addr + req->offset +
diff --git a/src/mpid/pamid/src/onesided/mpid_win_lock.c b/src/mpid/pamid/src/onesided/mpid_win_lock.c
index e9b4d5b..4066db5 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_lock.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_lock.c
@@ -57,7 +57,7 @@ MPIDI_WinLockAdvance(pami_context_t   context,
           MPIDI_WinLockAllAck_post(context, lock->rank, win);
        else
           MPID_assert_always(0);
-      MPIU_Free(lock);
+      MPL_free(lock);
       MPIDI_WinLockAdvance(context, win);
     }
 }
@@ -88,7 +88,7 @@ MPIDI_WinLockReq_proc(pami_context_t              context,
                       unsigned                    peer)
 {
   MPID_Win * win = info->win;
-  struct MPIDI_Win_lock* lock = MPIU_Calloc0(1, struct MPIDI_Win_lock);
+  struct MPIDI_Win_lock* lock = MPL_calloc0(1, struct MPIDI_Win_lock);
   if (info->type == MPIDI_WIN_MSGTYPE_LOCKREQ)
        lock->mtype = MPIDI_REQUEST_LOCK;
   else if (info->type == MPIDI_WIN_MSGTYPE_LOCKALLREQ) {
diff --git a/src/mpid/pamid/src/onesided/mpid_win_lock_all.c b/src/mpid/pamid/src/onesided/mpid_win_lock_all.c
index 1ab8657..1a888fa 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_lock_all.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_lock_all.c
@@ -104,9 +104,9 @@ MPID_Win_lock_all(int      assert,
    nMask=(win->mpid.max_ctrlsends - 1);
    if (!win->mpid.work.msgQ) {
        if (size < (win->mpid.max_ctrlsends)) {
-           win->mpid.work.msgQ = (void *) MPIU_Calloc0(size, MPIDI_WinLock_info);
+           win->mpid.work.msgQ = (void *) MPL_calloc0(size, MPIDI_WinLock_info);
        }  else {
-           win->mpid.work.msgQ = (void *) MPIU_Calloc0((win->mpid.max_ctrlsends), MPIDI_WinLock_info);
+           win->mpid.work.msgQ = (void *) MPL_calloc0((win->mpid.max_ctrlsends), MPIDI_WinLock_info);
        }
        MPID_assert(win->mpid.work.msgQ != NULL);
        win->mpid.work.count=0;
diff --git a/src/mpid/pamid/src/onesided/mpid_win_put.c b/src/mpid/pamid/src/onesided/mpid_win_put.c
index f2329ec..2d7b8e3 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_put.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_put.c
@@ -242,7 +242,7 @@ MPID_Put(const void   *origin_addr,
   int mpi_errno = MPI_SUCCESS;
   int shm_locked=0;
   void * target_addr;
-  MPIDI_Win_request *req = MPIU_Calloc0(1, MPIDI_Win_request);
+  MPIDI_Win_request *req = MPL_calloc0(1, MPIDI_Win_request);
   req->win          = win;
   if(win->mpid.request_based != 1) 
     req->type         = MPIDI_WIN_REQUEST_PUT;
@@ -293,7 +293,7 @@ MPID_Put(const void   *origin_addr,
       if(req->req_handle)
        MPIR_cc_set(req->req_handle->cc_ptr, 0);
       else
-       MPIU_Free(req);
+       MPL_free(req);
       return MPI_SUCCESS;
     }
 
@@ -324,7 +324,7 @@ MPID_Put(const void   *origin_addr,
        if(req->req_handle)
          MPIR_cc_set(req->req_handle->cc_ptr, 0);
        else
-         MPIU_Free(req);
+         MPL_free(req);
        return mpi_errno;
      }
   req->target.rank = target_rank;
@@ -345,7 +345,7 @@ MPID_Put(const void   *origin_addr,
   else
     {
       req->buffer_free = 1;
-      req->buffer      = MPIU_Malloc(req->origin.dt.size);
+      req->buffer      = MPL_malloc(req->origin.dt.size);
       MPID_assert(req->buffer != NULL);
 
       int mpi_errno = 0;
diff --git a/src/mpid/pamid/src/pt2pt/mpid_cancel.c b/src/mpid/pamid/src/pt2pt/mpid_cancel.c
index a7c2b8d..4bcb99e 100644
--- a/src/mpid/pamid/src/pt2pt/mpid_cancel.c
+++ b/src/mpid/pamid/src/pt2pt/mpid_cancel.c
@@ -109,7 +109,7 @@ MPID_Cancel_send(MPID_Request * sreq)
        * required to avoid a leak here just isn't worth it.
        * Hopefully people aren't cancelling sends too much.
        */
-      pami_work_t  * work    = MPIU_Malloc(sizeof(pami_work_t));
+      pami_work_t  * work    = MPL_malloc(sizeof(pami_work_t));
       PAMI_Context_post(context, work, MPIDI_CancelReq_post, sreq);
     }
   else
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c b/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c
index 9484e43..e5f0fc4 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c
@@ -125,7 +125,7 @@ MPIDI_RecvCB(pami_context_t    context,
         newreq->mpid.uebuflen = sndlen;
         if (!(TOKEN_FLOW_CONTROL_ON))
           {
-            newreq->mpid.uebuf = MPIU_Malloc(sndlen);
+            newreq->mpid.uebuf = MPL_malloc(sndlen);
             newreq->mpid.uebuf_malloc = mpiuMalloc ;
           }
         else
@@ -276,7 +276,7 @@ MPIDI_RecvCB(pami_context_t    context,
         {
           if (!TOKEN_FLOW_CONTROL_ON)
             {
-              rreq->mpid.uebuf    = MPIU_Malloc(sndlen);
+              rreq->mpid.uebuf    = MPL_malloc(sndlen);
               rreq->mpid.uebuf_malloc = mpiuMalloc;
             }
           else
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c b/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c
index 063fe1d..946a9cd 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c
@@ -88,7 +88,7 @@ MPIDI_RecvShortCB(pami_context_t    context,
         newreq->mpid.uebuflen = sndlen;
         if (!TOKEN_FLOW_CONTROL_ON)
           {
-            newreq->mpid.uebuf = MPIU_Malloc(sndlen);
+            newreq->mpid.uebuf = MPL_malloc(sndlen);
             newreq->mpid.uebuf_malloc = mpiuMalloc;
           }
         else
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_callback_util.c b/src/mpid/pamid/src/pt2pt/mpidi_callback_util.c
index 8bc98d1..8a439aa 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_callback_util.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_callback_util.c
@@ -119,7 +119,7 @@ MPIDI_Callback_process_trunc(pami_context_t  context,
     {
       MPIDI_Request_setCA(rreq, MPIDI_CA_UNPACK_UEBUF_AND_COMPLETE);
       rreq->mpid.uebuflen = MPIR_STATUS_GET_COUNT(rreq->status);
-      rreq->mpid.uebuf    = MPIU_Malloc(MPIR_STATUS_GET_COUNT(rreq->status));
+      rreq->mpid.uebuf    = MPL_malloc(MPIR_STATUS_GET_COUNT(rreq->status));
       MPID_assert(rreq->mpid.uebuf != NULL);
       rreq->mpid.uebuf_malloc = mpiuMalloc;
 
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_rendezvous.c b/src/mpid/pamid/src/pt2pt/mpidi_rendezvous.c
index d7f0a0c..cf3e65e 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_rendezvous.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_rendezvous.c
@@ -92,7 +92,7 @@ MPIDI_RendezvousTransfer(pami_context_t   context,
   else
     {
       MPIDI_Request_setCA(rreq, MPIDI_CA_UNPACK_UEBUF_AND_COMPLETE);
-      rcvbuf = MPIU_Malloc(rcvlen);
+      rcvbuf = MPL_malloc(rcvlen);
       MPID_assert(rcvbuf != NULL);
       rreq->mpid.uebuf    = rcvbuf;
       rreq->mpid.uebuflen = rcvlen;
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c b/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c
index 4826696..c9263fc 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c
@@ -355,7 +355,7 @@ MPIDI_SendMsg_process_userdefined_dt(MPID_Request      * sreq,
       {
         MPI_Aint dt_extent;
         MPID_Datatype_get_extent_macro(sreq->mpid.datatype, dt_extent);
-        buf =  MPIU_Malloc(dt_extent * sreq->mpid.userbufcount);
+        buf =  MPL_malloc(dt_extent * sreq->mpid.userbufcount);
 
         cudaError_t cudaerr = CudaMemcpy(buf, sreq->mpid.userbuf, dt_extent * sreq->mpid.userbufcount, cudaMemcpyDeviceToHost);
         if (cudaSuccess != cudaerr) {
@@ -368,7 +368,7 @@ MPIDI_SendMsg_process_userdefined_dt(MPID_Request      * sreq,
       MPID_Segment segment;
 
       if(data_sz != 0) {
-        sreq->mpid.uebuf = sndbuf = MPIU_Malloc(data_sz);
+        sreq->mpid.uebuf = sndbuf = MPL_malloc(data_sz);
         if (unlikely(sndbuf == NULL))
           {
             sreq->status.MPI_ERROR = MPI_ERR_NO_SPACE;
@@ -396,7 +396,7 @@ MPIDI_SendMsg_process_userdefined_dt(MPID_Request      * sreq,
         MPID_assert(last == data_sz);
 #if CUDA_AWARE_SUPPORT
         if(MPIDI_Process.cuda_aware_support_on && on_device)
-          MPIU_Free(buf);
+          MPL_free(buf);
 #endif
       } else {
 	sndbuf = NULL;
diff --git a/src/mpl/configure.ac b/src/mpl/configure.ac
index 61ca76b..42d8d70 100644
--- a/src/mpl/configure.ac
+++ b/src/mpl/configure.ac
@@ -68,15 +68,47 @@ AC_ARG_ENABLE(g,
 
 	    none|no   - No debugging
 	    log       - Enable debug event logging
+	    mem       - Enable memory tracing
 	    yes|all   - All of the above choices (except "none", obviously)
 	]),,[enable_g=none])
 
-if test "$enable_g" = "no" -o "$enable_g" = "none" ; then
-   :
-elif test "$enable_g" = "log" -o "$enable_g" = "yes" -o "$enable_g" = "all" ; then
+# enable-g
+# strip off multiple options, separated by commas
+PAC_PUSH_FLAG(IFS)
+IFS=","
+for option in $enable_g ; do
+    case "$option" in
+	 log)
+	 enable_g_log=yes
+	 ;;
+
+	 mem)
+	 enable_g_mem=yes
+	 ;;
+
+	 all|yes)
+	 enable_g_log=yes
+	 enable_g_mem=yes
+	 ;;
+
+	 no|none)
+	 ;;
+
+	 *)
+	 AC_MSG_WARN([Unknown value $option for enable-g])
+	 ;;
+    esac
+done
+PAC_POP_FLAG(IFS)
+
+if test "$enable_g_log" = "yes" ; then
    AC_DEFINE([USE_DBG_LOGGING],[1],[Define to enable logging macros])
 fi
 
+if test "$enable_g_mem" = "yes" ; then
+   AC_DEFINE([USE_MEMORY_TRACING],[1],[Define to enable memory tracing])
+fi
+
 
 # support gcov test coverage information
 PAC_ENABLE_COVERAGE
diff --git a/src/mpl/include/mpl_str.h b/src/mpl/include/mpl_str.h
index c6e3255..57861f2 100644
--- a/src/mpl/include/mpl_str.h
+++ b/src/mpl/include/mpl_str.h
@@ -25,16 +25,6 @@ extern int snprintf(char *, size_t, const char *, ...) ATTRIBUTE((format(printf,
 int MPL_snprintf(char *, size_t, const char *, ...) ATTRIBUTE((format(printf,3,4)));
 #endif /* MPL_HAVE_SNPRINTF */
 
-#if defined MPL_NEEDS_STRDUP_DECL && !defined strdup
-extern char *strdup(const char *);
-#endif /* MPL_NEEDS_STRDUP_DECL */
-
-#if defined MPL_HAVE_STRDUP
-#define MPL_strdup strdup
-#else
-char *MPL_strdup(const char *str);
-#endif /* MPL_HAVE_STRDUP */
-
 int MPL_strncpy(char *dest, const char *src, size_t n);
 char *MPL_strsep(char **stringp, const char *delim);
 
diff --git a/src/mpl/include/mpl_trmem.h b/src/mpl/include/mpl_trmem.h
index f0d3602..2b41174 100644
--- a/src/mpl/include/mpl_trmem.h
+++ b/src/mpl/include/mpl_trmem.h
@@ -7,6 +7,112 @@
 #if !defined(MPL_TRMEM_H_INCLUDED)
 #define MPL_TRMEM_H_INCLUDED
 
+#if defined MPL_NEEDS_STRDUP_DECL && !defined strdup
+extern char *strdup(const char *);
+#endif /* MPL_NEEDS_STRDUP_DECL */
+
+#if defined(MPL_USE_MEMORY_TRACING)
+#define MPL_strdup(a)    MPL_trstrdup(a,__LINE__,__FILE__)
+#elif defined(MPL_HAVE_STRDUP)
+#define MPL_strdup strdup
+#else
+char *MPL_strdup(const char *str);
+#endif /* defined(MPL_USE_MEMORY_TRACING) || defined(MPL_HAVE_STRDUP) */
+
+#ifdef MPL_USE_MEMORY_TRACING
+/*M
+  MPL_malloc - Allocate memory
+
+  Synopsis:
+.vb
+  void *MPL_malloc( size_t len )
+.ve
+
+  Input Parameter:
+. len - Length of memory to allocate in bytes
+
+  Return Value:
+  Pointer to allocated memory, or null if memory could not be allocated.
+
+  Notes:
+  This routine will often be implemented as the simple macro
+.vb
+  #define MPL_malloc(n) malloc(n)
+.ve
+  However, it can also be defined as
+.vb
+  #define MPL_malloc(n) MPL_trmalloc(n,__LINE__,__FILE__)
+.ve
+  where 'MPL_trmalloc' is a tracing version of 'malloc' that is included with
+  MPICH.
+
+  Module:
+  Utility
+  M*/
+#define MPL_malloc(a)    MPL_trmalloc((a),__LINE__,__FILE__)
+
+/*M
+  MPL_calloc - Allocate memory that is initialized to zero.
+
+  Synopsis:
+.vb
+    void *MPL_calloc( size_t nelm, size_t elsize )
+.ve
+
+  Input Parameters:
++ nelm - Number of elements to allocate
+- elsize - Size of each element.
+
+  Notes:
+  Like 'MPL_malloc' and 'MPL_free', this will often be implemented as a
+  macro but may use 'MPL_trcalloc' to provide a tracing version.
+
+  Module:
+  Utility
+  M*/
+#define MPL_calloc(a,b)    MPL_trcalloc((a),(b),__LINE__,__FILE__)
+
+/*M
+  MPL_free - Free memory
+
+  Synopsis:
+.vb
+   void MPL_free( void *ptr )
+.ve
+
+  Input Parameter:
+. ptr - Pointer to memory to be freed.  This memory must have been allocated
+  with 'MPL_malloc'.
+
+  Notes:
+  This routine will often be implemented as the simple macro
+.vb
+  #define MPL_free(n) free(n)
+.ve
+  However, it can also be defined as
+.vb
+  #define MPL_free(n) MPL_trfree(n,__LINE__,__FILE__)
+.ve
+  where 'MPL_trfree' is a tracing version of 'free' that is included with
+  MPICH.
+
+  Module:
+  Utility
+  M*/
+#define MPL_free(a)      MPL_trfree(a,__LINE__,__FILE__)
+
+#define MPL_realloc(a,b)    MPL_trrealloc((a),(b),__LINE__,__FILE__)
+
+#else /* USE_MEMORY_TRACING */
+/* No memory tracing; just use native functions */
+#define MPL_malloc(a)    malloc((size_t)(a))
+#define MPL_calloc(a,b)  calloc((size_t)(a),(size_t)(b))
+#define MPL_free(a)      free((void *)(a))
+#define MPL_realloc(a,b)  realloc((void *)(a),(size_t)(b))
+
+#endif /* USE_MEMORY_TRACING */
+
+
 /* FIXME: Consider an option of specifying __attribute__((malloc)) for
    gcc - this lets gcc-style compilers know that the returned pointer
    does not alias any pointer prior to the call.
diff --git a/src/nameserv/file/file_nameserv.c b/src/nameserv/file/file_nameserv.c
index 858b093..2c30622 100644
--- a/src/nameserv/file/file_nameserv.c
+++ b/src/nameserv/file/file_nameserv.c
@@ -71,7 +71,7 @@ int MPID_NS_Create( const MPID_Info *info_ptr, MPID_NS_Handle *handle_ptr )
     struct stat st;
     int        err, ret;
 
-    *handle_ptr = (MPID_NS_Handle)MPIU_Malloc( sizeof(struct MPID_NS_Handle) );
+    *handle_ptr = (MPID_NS_Handle)MPL_malloc( sizeof(struct MPID_NS_Handle) );
     /* --BEGIN ERROR HANDLING-- */
     if (!*handle_ptr) {
 	err = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem", 0 );
@@ -128,7 +128,7 @@ int MPID_NS_Publish( MPID_NS_Handle handle, const MPID_Info *info_ptr,
     /* Add the file name to the known files now, in case there is 
        a failure during open or writing */
     if (handle->nactive < MPID_MAX_NAMEPUB) {
-	handle->filenames[handle->nactive++] = MPIU_Strdup( filename );
+	handle->filenames[handle->nactive++] = MPL_strdup( filename );
     }
     else {
 	/* --BEGIN ERROR HANDLING-- */
@@ -263,7 +263,7 @@ int MPID_NS_Unpublish( MPID_NS_Handle handle, const MPID_Info *info_ptr,
 	    strcmp( filename, handle->filenames[i] ) == 0) {
 	    /* unlink the file only if we find it */
 	    unlink( filename );
-	    MPIU_Free( handle->filenames[i] );
+	    MPL_free( handle->filenames[i] );
 	    handle->filenames[i] = 0;
 	    break;
 	}
@@ -296,10 +296,10 @@ int MPID_NS_Free( MPID_NS_Handle *handle_ptr )
 	if (handle->filenames[i]) {
 	    /* Remove the file if it still exists */
 	    unlink( handle->filenames[i] );
-	    MPIU_Free( handle->filenames[i] );
+	    MPL_free( handle->filenames[i] );
 	}
     }
-    MPIU_Free( *handle_ptr );
+    MPL_free( *handle_ptr );
     *handle_ptr = 0;
 
     return 0;
diff --git a/src/nameserv/pmi/pmi_nameserv.c b/src/nameserv/pmi/pmi_nameserv.c
index 3d55386..03f00c6 100644
--- a/src/nameserv/pmi/pmi_nameserv.c
+++ b/src/nameserv/pmi/pmi_nameserv.c
@@ -155,7 +155,7 @@ int MPID_NS_Create( const MPID_Info *info_ptr, MPID_NS_Handle *handle_ptr )
     int length;
     char *pmi_namepub_kvs;
 
-    *handle_ptr = (MPID_NS_Handle)MPIU_Malloc( sizeof(struct MPID_NS_Handle) );
+    *handle_ptr = (MPID_NS_Handle)MPL_malloc( sizeof(struct MPID_NS_Handle) );
     /* --BEGIN ERROR HANDLING-- */
     if (!*handle_ptr)
     {
@@ -172,7 +172,7 @@ int MPID_NS_Create( const MPID_Info *info_ptr, MPID_NS_Handle *handle_ptr )
     }
     /* --END ERROR HANDLING-- */
 
-    (*handle_ptr)->kvsname = (char*)MPIU_Malloc(length);
+    (*handle_ptr)->kvsname = (char*)MPL_malloc(length);
     /* --BEGIN ERROR HANDLING-- */
     if (!(*handle_ptr)->kvsname)
     {
@@ -292,8 +292,8 @@ int MPID_NS_Free( MPID_NS_Handle *handle_ptr )
     static const char FCNAME[] = "MPID_NS_Free";
     int err;
 
-    MPIU_Free( (*handle_ptr)->kvsname );
-    MPIU_Free( *handle_ptr );
+    MPL_free( (*handle_ptr)->kvsname );
+    MPL_free( *handle_ptr );
     *handle_ptr = 0;
 
     return 0;
diff --git a/src/pm/gforker/mpiexec.c b/src/pm/gforker/mpiexec.c
index 1951a17..33fd636 100644
--- a/src/pm/gforker/mpiexec.c
+++ b/src/pm/gforker/mpiexec.c
@@ -161,7 +161,7 @@ int main( int argc, char *argv[], char *envp[] )
        init, allowing an MPI process to contact a waiting mpiexec that 
        would serve as a process manager.  This option is not implemented */
     if (getenv("MPIEXEC_USE_PORT")) {
-	s.pmiinfo.portName = (char *)MPIU_Malloc( 1024 );
+	s.pmiinfo.portName = (char *)MPL_malloc( 1024 );
 	if (!s.pmiinfo.portName) {
 	    MPL_error_printf( "Failed to allocate storage for portName" );
 	}
diff --git a/src/pm/remshell/mpiexec.c b/src/pm/remshell/mpiexec.c
index c446a28..96e16cc 100644
--- a/src/pm/remshell/mpiexec.c
+++ b/src/pm/remshell/mpiexec.c
@@ -266,7 +266,7 @@ int mypostfork( void *predata, void *data, ProcessState *pState )
 	char rankStr[12];
 
 	/* Insert into app->args */
-	newargs = (const char **) MPIU_Malloc( (app->nArgs + 14 + 1) * 
+        newargs = (const char **) MPL_malloc( (app->nArgs + 14 + 1) *
 					  sizeof(char *) );
 	if (!pState->hostname) {
 	    MPL_error_printf( "No hostname avaliable for %s\n", app->exename );
@@ -276,7 +276,7 @@ int mypostfork( void *predata, void *data, ProcessState *pState )
 	snprintf( rankStr, sizeof(rankStr)-1, "%d", pState->id );
 	rankStr[12-1] = 0;
 	curarg = 0;
-        newargs[curarg++] = MPIU_Strdup( "-Y" );
+        newargs[curarg++] = MPL_strdup( "-Y" );
 
 	newargs[curarg++] = pState->hostname;
 	curarg += AddEnvSetToCmdLine( "PMI_PORT", s->pmiinfo.portName, 
@@ -294,7 +294,7 @@ int mypostfork( void *predata, void *data, ProcessState *pState )
 	    newargs[j+curarg] = app->args[j];
 	}
 	newargs[j+curarg] = 0;
-	app->exename = MPIU_Strdup( "/usr/bin/ssh" );
+	app->exename = MPL_strdup( "/usr/bin/ssh" );
 
 	app->args = newargs;
 	app->nArgs += curarg;
@@ -431,19 +431,19 @@ static int AddEnvSetToCmdLine( const char *envName, const char *envValue,
     }
 
     if (useCSHFormat) {
-	args[nArgs++] = MPIU_Strdup( "setenv" );
-	args[nArgs++] = MPIU_Strdup( envName );
-	args[nArgs++] = MPIU_Strdup( envValue ); 
-	args[nArgs++] = MPIU_Strdup( ";" );
+	args[nArgs++] = MPL_strdup( "setenv" );
+	args[nArgs++] = MPL_strdup( envName );
+        args[nArgs++] = MPL_strdup( envValue );
+	args[nArgs++] = MPL_strdup( ";" );
     }
     else {
 	char tmpBuf[1024];
-	args[nArgs++] = MPIU_Strdup( "export" );
+	args[nArgs++] = MPL_strdup( "export" );
 	MPL_strncpy( tmpBuf, envName, sizeof(tmpBuf) );
 	MPL_strnapp( tmpBuf, "=", sizeof(tmpBuf) );
 	MPL_strnapp( tmpBuf, envValue, sizeof(tmpBuf) );
-	args[nArgs++] = MPIU_Strdup( tmpBuf );
-	args[nArgs++] = MPIU_Strdup( ";" );
+	args[nArgs++] = MPL_strdup( tmpBuf );
+	args[nArgs++] = MPL_strdup( ";" );
     }
     return nArgs;
 }
diff --git a/src/pm/util/cmnargs.c b/src/pm/util/cmnargs.c
index d8b00cc..389cc13 100644
--- a/src/pm/util/cmnargs.c
+++ b/src/pm/util/cmnargs.c
@@ -123,7 +123,7 @@ int MPIE_Args( int argc, char *argv[], ProcessUniverse *mypUniv,
        override the environment */
 
     /* Allocate the members of the ProcessUniverse structure */
-    mypUniv->worlds = (ProcessWorld*) MPIU_Malloc( sizeof(ProcessWorld) );
+    mypUniv->worlds = (ProcessWorld*) MPL_malloc( sizeof(ProcessWorld) );
     mypUniv->worlds->nApps     = 0;
     mypUniv->worlds->nProcess  = 0;
     mypUniv->worlds->nextWorld = 0;
@@ -189,8 +189,8 @@ int MPIE_Args( int argc, char *argv[], ProcessUniverse *mypUniv,
  	else if ( strncmp( argv[i], "-pmi_args", 8 ) == 0) {
 	    if (i+4 < argc ) {
 		mypUniv->fromSingleton   = 1;
-		mypUniv->portKey         = MPIU_Strdup( argv[i+3] );
-		mypUniv->singletonIfname = MPIU_Strdup( argv[i+2] );
+		mypUniv->portKey         = MPL_strdup( argv[i+3] );
+		mypUniv->singletonIfname = MPL_strdup( argv[i+2] );
 		mypUniv->singletonPID    = atoi(argv[i+4] );
 		mypUniv->singletonPort   = atoi(argv[i+1] );
 		i += 4;
@@ -273,7 +273,7 @@ int MPIE_Args( int argc, char *argv[], ProcessUniverse *mypUniv,
 	    }
 	    
 	    /* Create a new app and add to the app list*/
-	    pApp = (ProcessApp*) MPIU_Malloc( sizeof(ProcessApp) );
+	    pApp = (ProcessApp*) MPL_malloc( sizeof(ProcessApp) );
 	    *nextAppPtr = pApp;
 	    nextAppPtr = &(pApp->nextApp);
 	    pApp->nextApp = 0;
@@ -584,7 +584,7 @@ int MPIE_ParseSoftspec( const char *str, ProcessSoftSpec *sspec )
 	p1++;
     }
     sspec->nelm   = nelm;
-    sspec->tuples = (int (*)[3]) MPIU_Malloc( nelm * sizeof(int [3]));
+    sspec->tuples = (int (*)[3]) MPL_malloc( nelm * sizeof(int [3]));
 
     nelm = 0;
     while ( *p ) {
@@ -704,7 +704,7 @@ static int LineToArgv( char *linebuf, char *(argv[]), int maxargv )
 	while (*p && !isspace(*p)) p++;
 
 	/* Convert the entry into a copy */
-	argv[argc] = MPIU_Strdup( argv[argc] );
+	argv[argc] = MPL_strdup( argv[argc] );
 	argc++;
 	*p++ = 0;
     }
diff --git a/src/pm/util/dbgiface.c b/src/pm/util/dbgiface.c
index a8d2382..c2c3aed 100644
--- a/src/pm/util/dbgiface.c
+++ b/src/pm/util/dbgiface.c
@@ -80,7 +80,7 @@ int MPIE_InitForDebugger( ProcessWorld *pWorld )
     static char myhostname[MAX_HOST_NAME+1];
 
     MPIR_proctable = (struct MPIR_PROCDESC *)
-	MPIU_Malloc( np * sizeof(struct MPIR_PROCDESC) );
+	MPL_malloc( np * sizeof(struct MPIR_PROCDESC) );
 
     i = 0;
     while (apps && i < np) {
@@ -126,7 +126,7 @@ int MPIE_InitForDebugger( ProcessWorld *pWorld )
 /* This routine is provided to free memory allocated in this routine */
 int MPIE_FreeFromDebugger( void )
 {
-    if (MPIR_proctable) { MPIU_Free( MPIR_proctable ); }
+    if (MPIR_proctable) { MPL_free( MPIR_proctable ); }
     return 0;
 }
 
diff --git a/src/pm/util/env.c b/src/pm/util/env.c
index 8da4cd9..7fcacea 100644
--- a/src/pm/util/env.c
+++ b/src/pm/util/env.c
@@ -44,7 +44,7 @@ int MPIE_ArgsCheckForEnv( int argc, char *argv[], ProcessWorld *pWorld,
 
     if ( strncmp( argv[0], "-env",  4) == 0) {
 	if (!*appEnv) {
-	    env = (EnvInfo *)MPIU_Malloc( sizeof(EnvInfo) );
+	    env = (EnvInfo *)MPL_malloc( sizeof(EnvInfo) );
 	    env->includeAll = 1;
 	    env->envPairs   = 0;
 	    env->envNames   = 0;
@@ -56,7 +56,7 @@ int MPIE_ArgsCheckForEnv( int argc, char *argv[], ProcessWorld *pWorld,
     }
     else if (strncmp( argv[0], "-genv", 5 ) == 0) {
 	if (!pWorld->genv) {
-	    env = (EnvInfo *)MPIU_Malloc( sizeof(EnvInfo) );
+	    env = (EnvInfo *)MPL_malloc( sizeof(EnvInfo) );
 	    env->includeAll = 1;
 	    env->envPairs   = 0;
 	    env->envNames   = 0;
@@ -77,9 +77,9 @@ int MPIE_ArgsCheckForEnv( int argc, char *argv[], ProcessWorld *pWorld,
 	if (!argv[1] || !argv[2]) {
 	    mpiexec_usage( "Missing arguments to -env or -genv" );
 	}
-	p             = (EnvData *)MPIU_Malloc( sizeof(EnvData) );
-	p->name       = (const char *)MPIU_Strdup( argv[1] );
-	p->value      = (const char *)MPIU_Strdup( argv[2] );
+	p             = (EnvData *)MPL_malloc( sizeof(EnvData) );
+	p->name       = (const char *)MPL_strdup( argv[1] );
+	p->value      = (const char *)MPL_strdup( argv[2] );
 	p->envvalue   = 0;
 	p->nextData   = env->envPairs;
 	env->envPairs = p;
@@ -104,9 +104,9 @@ int MPIE_ArgsCheckForEnv( int argc, char *argv[], ProcessWorld *pWorld,
 	    while (*lPtr && *lPtr != ',') lPtr++;
             /* The length of any environment string will fit in an int */
 	    namelen       = (int)(lPtr - name);
-	    p             = (EnvData *)MPIU_Malloc( sizeof(EnvData) );
+	    p             = (EnvData *)MPL_malloc( sizeof(EnvData) );
 	    p->value      = 0;
-	    p->name       = (const char *)MPIU_Malloc( namelen + 1 );
+	    p->name       = (const char *)MPL_malloc( namelen + 1 );
 	    p->envvalue   = 0;
 	    for (i=0; i<namelen; i++) ((char *)p->name)[i] = name[i];
 	    ((char *)p->name)[namelen] = 0;
@@ -261,7 +261,7 @@ int MPIE_EnvInitData( EnvData *elist, int getValue )
 		value = "";
 	    }
 	    slen = strlen( elist->name ) + strlen(value) + 2;
-	    str  = (char *)MPIU_Malloc( slen );
+	    str  = (char *)MPL_malloc( slen );
 	    if (!str) {
 		return 1;
 	    }
@@ -290,7 +290,7 @@ int MPIE_Putenv( ProcessWorld *pWorld, const char *env_string )
 
     /* FIXME: This should be getGenv (so allocation/init in one place) */
     if (!pWorld->genv) {
-	genv = (EnvInfo *)MPIU_Malloc( sizeof(EnvInfo) );
+	genv = (EnvInfo *)MPL_malloc( sizeof(EnvInfo) );
 	genv->includeAll = 1;
 	genv->envPairs   = 0;
 	genv->envNames   = 0;
@@ -298,11 +298,11 @@ int MPIE_Putenv( ProcessWorld *pWorld, const char *env_string )
     }
     genv           = pWorld->genv;
 
-    p              = (EnvData *)MPIU_Malloc( sizeof(EnvData) );
+    p              = (EnvData *)MPL_malloc( sizeof(EnvData) );
     if (!p) return 1;
     p->name        = 0;
     p->value       = 0;
-    p->envvalue    = (const char *)MPIU_Strdup( env_string );
+    p->envvalue    = (const char *)MPL_strdup( env_string );
     if (!p->envvalue) return 1;
     p->nextData    = genv->envPairs;
     genv->envPairs = p;
diff --git a/src/pm/util/labelout.c b/src/pm/util/labelout.c
index 7634ea4..2c0adb6 100644
--- a/src/pm/util/labelout.c
+++ b/src/pm/util/labelout.c
@@ -90,7 +90,7 @@ int IOLabelSetupFinishInServer( IOLabelSetup *iofds, ProcessState *pState )
     close( iofds->readErr[1] );
 
     /* We need dedicated storage for the private data */
-    leader = (IOLabel *)MPIU_Malloc( sizeof(IOLabel) );
+    leader = (IOLabel *)MPL_malloc( sizeof(IOLabel) );
     if (useLabels) {
 	IOLabelSetLabelText( outLabelPattern, 
 			     leader->label, sizeof(leader->label),
@@ -101,7 +101,7 @@ int IOLabelSetupFinishInServer( IOLabelSetup *iofds, ProcessState *pState )
     }
     leader->lastNL = 1;
     leader->dest   = stdout;
-    leadererr = (IOLabel *)MPIU_Malloc( sizeof(IOLabel) );
+    leadererr = (IOLabel *)MPL_malloc( sizeof(IOLabel) );
     if (useLabels) {
 	IOLabelSetLabelText( errLabelPattern, 
 			     leadererr->label, sizeof(leadererr->label),
diff --git a/src/pm/util/pmiserv.c b/src/pm/util/pmiserv.c
index 1f5a380..60e7131 100644
--- a/src/pm/util/pmiserv.c
+++ b/src/pm/util/pmiserv.c
@@ -237,7 +237,7 @@ PMIProcess *PMISetupNewProcess( int fd, ProcessState *pState )
 {
     PMIProcess *pmiprocess;
 
-    pmiprocess = (PMIProcess *)MPIU_Malloc( sizeof(PMIProcess) );
+    pmiprocess = (PMIProcess *)MPL_malloc( sizeof(PMIProcess) );
     if (!pmiprocess) return 0;
     pmiprocess->fd           = fd;
     pmiprocess->nextChar     = pmiprocess->readBuf;
@@ -265,13 +265,13 @@ PMIProcess *PMISetupNewProcess( int fd, ProcessState *pState )
 int PMISetupNewGroup( int nProcess, PMIKVSpace *kvs )
 {
     PMIGroup *g;
-    curPMIGroup = (PMIGroup *)MPIU_Malloc( sizeof(PMIGroup) );
+    curPMIGroup = (PMIGroup *)MPL_malloc( sizeof(PMIGroup) );
     if (!curPMIGroup) return 1;
 
     curPMIGroup->nProcess   = nProcess;
     curPMIGroup->groupID    = pmimaster.nGroups++;
     curPMIGroup->nInBarrier = 0;
-    curPMIGroup->pmiProcess = (PMIProcess **)MPIU_Malloc( 
+    curPMIGroup->pmiProcess = (PMIProcess **)MPL_malloc(
 					 sizeof(PMIProcess*) * nProcess );
     if (!curPMIGroup->pmiProcess) return 1;
     curPMIGroup->nextGroup  = 0;
@@ -456,7 +456,7 @@ static PMIKVSpace *fPMIKVSAllocate( void )
     static int kvsnum = 0;    /* Used to generate names */
 
     /* Create the space */
-    kvs = (PMIKVSpace *)MPIU_Malloc( sizeof(PMIKVSpace) );
+    kvs = (PMIKVSpace *)MPL_malloc( sizeof(PMIKVSpace) );
     if (!kvs) {
 	MPL_internal_error_printf( "too many kvs's\n" );
 	return 0;
@@ -544,7 +544,7 @@ static int fPMIKVSAddPair( PMIKVSpace *kvs,
 	pprev = &(p->nextPair);
 	p = p->nextPair;
     }
-    pair = (PMIKVPair *)MPIU_Malloc( sizeof(PMIKVPair) );
+    pair = (PMIKVPair *)MPL_malloc( sizeof(PMIKVPair) );
     if (!pair) {
 	return -1;
     }
@@ -593,7 +593,7 @@ static int PMIKVSFree( PMIKVSpace *kvs )
     p = kvs->pairs;
     while (p) {
 	pNext = p->nextPair;
-	MPIU_Free( p );
+	MPL_free( p );
 	p = pNext;
     }
 
@@ -605,7 +605,7 @@ static int PMIKVSFree( PMIKVSpace *kvs )
 	rc = strcmp( k->kvsname, kvs->kvsname );
 	if (rc == 0) {
 	    *kPrev = k->nextKVS;
-	    MPIU_Free( k );
+	    MPL_free( k );
 	    break;
 	}
 	kPrev = &(k->nextKVS);
@@ -1011,7 +1011,7 @@ static int fPMI_Handle_spawn( PMIProcess *pentry )
     DBG_PRINTFCOND(pmidebug,( "Entering fPMI_Handle_spawn\n" ));
 
     if (!pentry->spawnWorld) {
-	pWorld = (ProcessWorld *)MPIU_Malloc( sizeof(ProcessWorld) );
+	pWorld = (ProcessWorld *)MPL_malloc( sizeof(ProcessWorld) );
 	if (!pWorld) return 1;
 	
 	pentry->spawnWorld = pWorld;
@@ -1036,7 +1036,7 @@ static int fPMI_Handle_spawn( PMIProcess *pentry )
        commands */ 
 
     /* Create a new app */
-    app = (ProcessApp *)MPIU_Malloc( sizeof(ProcessApp) );
+    app = (ProcessApp *)MPL_malloc( sizeof(ProcessApp) );
     if (!app) return 1;
     app->myAppNum  = 0;
     app->exename   = 0;
@@ -1108,7 +1108,7 @@ static int fPMI_Handle_spawn( PMIProcess *pentry )
 	    pWorld->nProcess += app->nProcess;
 	}
 	else if (strcmp( "execname", cmdPtr ) == 0) {
-	    app->exename = MPIU_Strdup( valPtr );
+	    app->exename = MPL_strdup( valPtr );
 	}
 	else if (strcmp( "totspawns", cmdPtr ) == 0) {
 	    /* This tells us how many separate spawn commands
@@ -1135,7 +1135,7 @@ static int fPMI_Handle_spawn( PMIProcess *pentry )
 				   argnum, PMI_MAX_ARGS-1 );
 		return 1;
 	    }
-	    args[argnum] = MPIU_Strdup( valPtr );
+	    args[argnum] = MPL_strdup( valPtr );
 	}
 	else if (strcmp( "preput_num", cmdPtr ) == 0) {
 	    preputNum = atoi(valPtr);
@@ -1191,7 +1191,7 @@ static int fPMI_Handle_spawn( PMIProcess *pentry )
     }	
 
     if (app->nArgs > 0) {
-	app->args  = (const char **)MPIU_Malloc( app->nArgs * sizeof(char *) );
+	app->args  = (const char **)MPL_malloc( app->nArgs * sizeof(char *) );
 	for (i=0; i<app->nArgs; i++) {
 	    app->args[i] = args[i];
 	    args[i]      = 0;
@@ -1320,16 +1320,16 @@ int PMI_InitSingletonConnection( int fd, PMIProcess *pmiprocess )
 static int fPMIInfoKey( ProcessApp *app, const char key[], const char val[] )
 {
     if (strcmp( key, "host" ) == 0) {
-	app->hostname = MPIU_Strdup( val );
+	app->hostname = MPL_strdup( val );
     }
     else if (strcmp( key, "arch" ) == 0) {
-	app->arch     = MPIU_Strdup( val );
+	app->arch     = MPL_strdup( val );
     }
     else if (strcmp( key, "wdir" ) == 0) {
-	app->wdir     = MPIU_Strdup( val );
+	app->wdir     = MPL_strdup( val );
     }
     else if (strcmp( key, "path" ) == 0) {
-	app->path     = MPIU_Strdup( val );
+	app->path     = MPL_strdup( val );
     }
     else if (strcmp( key, "soft" ) == 0) {
 	MPIE_ParseSoftspec( val, &app->soft );
diff --git a/src/pm/util/pmutil.h b/src/pm/util/pmutil.h
index 9f897f5..8b079c7 100644
--- a/src/pm/util/pmutil.h
+++ b/src/pm/util/pmutil.h
@@ -85,23 +85,23 @@ extern int MPIE_Debug;
    second option is used for now. */
 /* No memory tracing; just use native functions */
 #include <stdlib.h>
-#define MPIU_Malloc(a)    malloc((size_t)(a))
-#define MPIU_Calloc(a,b)  calloc((size_t)(a),(size_t)(b))
-#define MPIU_Free(a)      free((void *)(a))
-#define MPIU_Realloc(a,b)  realloc((void *)(a),(size_t)(b))
+#define MPL_malloc(a)    malloc((size_t)(a))
+#define MPL_calloc(a,b)  calloc((size_t)(a),(size_t)(b))
+#define MPL_free(a)      free((void *)(a))
+#define MPL_realloc(a,b)  realloc((void *)(a),(size_t)(b))
 
 int MPL_strncpy( char *outstr, const char *instr, size_t maxlen );
 int MPL_strnapp( char *, const char *, size_t );
-char *MPIU_Strdup( const char * );
+char *MPL_strdup( const char * );
 
 #ifdef HAVE_STRDUP
 /* Watch for the case where strdup is defined as a macro by a header include */
 # if defined(NEEDS_STRDUP_DECL) && !defined(strdup)
 extern char *strdup( const char * );
 # endif
-#define MPIU_Strdup(a)    strdup(a)
+#define MPL_strdup(a)    strdup(a)
 #else
-/* Don't define MPIU_Strdup, provide it in safestr.c */
+/* Don't define MPL_strdup, provide it in safestr.c */
 #endif /* HAVE_STRDUP */
 /* Provide a fallback snprintf for systems that do not have one */
 #ifdef HAVE_SNPRINTF
diff --git a/src/pm/util/process.c b/src/pm/util/process.c
index 039ec35..a06b50a 100644
--- a/src/pm/util/process.c
+++ b/src/pm/util/process.c
@@ -114,7 +114,7 @@ int MPIE_ForkProcesses( ProcessWorld *pWorld, char *envp[],
     while (app) {
 	/* Allocate process state if necessary */
 	if (!app->pState) {
-	    pState = (ProcessState *)MPIU_Malloc( 
+            pState = (ProcessState *)MPL_malloc(
 		app->nProcess * sizeof(ProcessState) );
 	    if (!pState) {
 		return -1;
@@ -255,8 +255,8 @@ int MPIE_ExecProgram( ProcessState *pState, char *envp[] )
     char pathstring[MAXPATHLEN+10];
     /* We allocate these on the heap to help catch array overrun errors
        such as those in ticket #719.  */
-    char **client_env = MPIU_Malloc(MAX_CLIENT_ENV * sizeof(char *));
-    char **client_arg = MPIU_Malloc(MAX_CLIENT_ARG * sizeof(char *));
+    char **client_env = MPL_malloc(MAX_CLIENT_ENV * sizeof(char *));
+    char **client_arg = MPL_malloc(MAX_CLIENT_ARG * sizeof(char *));
 
     app = pState->app;
 
@@ -992,7 +992,7 @@ int MPIE_SetupSingleton( ProcessUniverse *mypUniv )
 
     pWorld		  = &mypUniv->worlds[0];
     pWorld->nProcess      = 1;
-    pApp		  = (ProcessApp *) MPIU_Malloc( sizeof(ProcessApp) );
+    pApp		  = (ProcessApp *) MPL_malloc( sizeof(ProcessApp) );
     pApp->nextApp	  = 0;
     pWorld->nApps	  = 1;
     pWorld->apps          = pApp;
@@ -1006,7 +1006,7 @@ int MPIE_SetupSingleton( ProcessUniverse *mypUniv )
     pApp->args		  = 0;
     pApp->nArgs		  = 0;
     pApp->myAppNum	  = 0;
-    pState		  = (ProcessState *) MPIU_Malloc( sizeof(ProcessState) );
+    pState		  = (ProcessState *) MPL_malloc( sizeof(ProcessState) );
     pApp->pState	  = pState;
 
     pState[0].app	  = pApp;
diff --git a/src/pm/util/rm.c b/src/pm/util/rm.c
index 59e7ea3..4f69686 100644
--- a/src/pm/util/rm.c
+++ b/src/pm/util/rm.c
@@ -75,7 +75,7 @@ int MPIE_ChooseHosts( ProcessWorld *pWorld,
     app = pWorld->apps;
     while (app) {
 	if (!app->pState) {
-	    pState = (ProcessState *)MPIU_Malloc( 
+            pState = (ProcessState *)MPL_malloc(
 		app->nProcess * sizeof(ProcessState) );
 	    if (!pState) {
 		return -1;
@@ -141,7 +141,7 @@ int MPIE_ChooseHosts( ProcessWorld *pWorld,
 				mt->desc[curHost].hostname, i ));
 		    nNeeded --;
 		    nForApp--;
-		    pState[i].hostname = MPIU_Strdup( mt->desc[curHost].hostname );
+		    pState[i].hostname = MPL_strdup( mt->desc[curHost].hostname );
 		    mt->desc[curHost].np--;
 		    if (mt->desc[curHost].np == 0) 
 			curHost++;
@@ -256,7 +256,7 @@ MachineTable *MPIE_ReadMachines( const char *arch, int nNeeded,
 	MPL_error_printf( "Could not open machines file %s\n", machinesfile );
 	return 0;
     }
-    mt = (MachineTable *)MPIU_Malloc( sizeof(MachineTable) );
+    mt = (MachineTable *)MPL_malloc( sizeof(MachineTable) );
     if (!mt) {
 	MPL_internal_error_printf( "Could not allocate machine table\n" );
 	return 0;
@@ -264,7 +264,7 @@ MachineTable *MPIE_ReadMachines( const char *arch, int nNeeded,
     
     /* This may be larger than needed if the machines file has
        fewer entries than nNeeded */
-    mt->desc = (MachineDesc *)MPIU_Malloc( nNeeded * sizeof(MachineDesc) );
+    mt->desc = (MachineDesc *)MPL_malloc( nNeeded * sizeof(MachineDesc) );
     if (!mt->desc) {
 	return 0;
     }
@@ -335,9 +335,9 @@ MachineTable *MPIE_ReadMachines( const char *arch, int nNeeded,
 	/* Save the names */
 
 	/* Initialize the fields for this new entry */
-	mt->desc[nFound].hostname    = MPIU_Strdup( name );
+	mt->desc[nFound].hostname    = MPL_strdup( name );
 	if (login) 
-	    mt->desc[nFound].login   = MPIU_Strdup( login );
+	    mt->desc[nFound].login   = MPL_strdup( login );
 	else
 	    mt->desc[nFound].login = 0;
 	if (npstring) {
@@ -354,7 +354,7 @@ MachineTable *MPIE_ReadMachines( const char *arch, int nNeeded,
 	else 
 	    mt->desc[nFound].np      = 1;
 	if (netname) 
-	    mt->desc[nFound].netname = MPIU_Strdup( netname );
+	    mt->desc[nFound].netname = MPL_strdup( netname );
 	else
 	    mt->desc[nFound].netname = 0;
 
@@ -374,11 +374,11 @@ int MPIE_RMProcessArg( int argc, char *argv[], void *extra )
 	cmd = argv[0] + 12;
 
 	if (cmd[0] == 0) {
-	    machinefile = MPIU_Strdup( argv[1] );
+	    machinefile = MPL_strdup( argv[1] );
 	    incr = 2;
 	}
 	else if (strcmp( cmd, "path" ) == 0) {
-	    machinefilePath = MPIU_Strdup( argv[1] );
+	    machinefilePath = MPL_strdup( argv[1] );
 	    incr = 2;
 	}
 	/* else not an argument for this routine */
@@ -391,16 +391,16 @@ int MPIE_FreeMachineTable( MachineTable *mt )
 {
     int i;
     for (i=0; i<mt->nHosts; i++) {
-	MPIU_Free( mt->desc[i].hostname );
+	MPL_free( mt->desc[i].hostname );
 	if (mt->desc[i].login) {
-	    MPIU_Free( mt->desc[i].login );
+	    MPL_free( mt->desc[i].login );
 	}
 	if (mt->desc[i].netname) {
-	    MPIU_Free( mt->desc[i].netname );
+	    MPL_free( mt->desc[i].netname );
 	}
     }
-    MPIU_Free( mt->desc );
-    MPIU_Free( mt );
+    MPL_free( mt->desc );
+    MPL_free( mt );
 
     return 0;
 }
diff --git a/src/pmi/pmi2/poe/poe2pmi.c b/src/pmi/pmi2/poe/poe2pmi.c
index 47bd865..9f31798 100644
--- a/src/pmi/pmi2/poe/poe2pmi.c
+++ b/src/pmi/pmi2/poe/poe2pmi.c
@@ -339,7 +339,7 @@ int _mpi_world_exiting_handler(int world_id)
     rc = -2;
   }
 
-/*  if(cookie) MPIU_Free(cookie);*/
+/*  if(cookie) MPL_free(cookie);*/
   return PAMI_SUCCESS;
 }
 
@@ -392,7 +392,7 @@ int _mpi_reduce_for_dyntask(int *sendbuf, int *recvbuf)
   MPIR_Errflag_t errflag = MPIR_ERR_NONE;
 
   int TASKS= world_size;
-  children = MPIU_Malloc(TASKS*sizeof(int));
+  children = MPL_malloc(TASKS*sizeof(int));
 
   comm_ptr = MPIR_Process.comm_world;
 
@@ -444,6 +444,6 @@ int _mpi_reduce_for_dyntask(int *sendbuf, int *recvbuf)
   if(world_rank == 0) {
     *recvbuf = result;
   }
-  MPIU_Free(children);
+  MPL_free(children);
   return 0;
 }
diff --git a/src/pmi/pmi2/simple/pmi2compat.h b/src/pmi/pmi2/simple/pmi2compat.h
index a926331..28941a3 100644
--- a/src/pmi/pmi2/simple/pmi2compat.h
+++ b/src/pmi/pmi2/simple/pmi2compat.h
@@ -6,9 +6,9 @@
 
 #include "mpiimpl.h"
 
-#define PMI2U_Malloc MPIU_Malloc
-#define PMI2U_Free MPIU_Free
-#define PMI2U_Strdup MPIU_Strdup
+#define PMI2U_Malloc MPL_malloc
+#define PMI2U_Free MPL_free
+#define PMI2U_Strdup MPL_strdup
 #define PMI2U_Strnapp MPL_strnapp
 #define PMI2U_Assert MPIU_Assert
 #define PMI2U_Exit MPL_exit
diff --git a/src/pmi/simple/simple_pmi.c b/src/pmi/simple/simple_pmi.c
index 9053b8d..e86f348 100644
--- a/src/pmi/simple/simple_pmi.c
+++ b/src/pmi/simple/simple_pmi.c
@@ -46,7 +46,7 @@
 #endif
 
 #include "mpl.h"            /* Get ATTRIBUTE, some base functions */
-/* mpimem includes the definitions for MPIU_Malloc and MPIU_Free */
+/* mpimem includes the definitions for MPL_malloc and MPL_free */
 #include "mpimem.h"
 
 /* Temporary debug definitions */
diff --git a/src/util/logging/rlog/TraceInput/logformat_trace_InputLog.c b/src/util/logging/rlog/TraceInput/logformat_trace_InputLog.c
index 573da71..6b0d0ed 100644
--- a/src/util/logging/rlog/TraceInput/logformat_trace_InputLog.c
+++ b/src/util/logging/rlog/TraceInput/logformat_trace_InputLog.c
@@ -222,7 +222,7 @@ Java_logformat_trace_InputLog_getNextCategory( JNIEnv *env, jobject this )
     if ( legend_sz ) {
         legend_max  = legend_sz+1;
 	if (legend_max > ACHAR_LENGTH)
-	    legend_base = (char *) MPIU_Malloc( legend_max * sizeof( char ) );
+	    legend_base = (char *) MPL_malloc( legend_max * sizeof( char ) );
 	else
 	    legend_base = slegend_base;
     }
@@ -233,7 +233,7 @@ Java_logformat_trace_InputLog_getNextCategory( JNIEnv *env, jobject this )
     if ( label_sz > 0 ) {
         label_max   = label_sz+1;
 	if (label_max > ACHAR_LENGTH)
-	    label_base  = (char *) MPIU_Malloc( label_max * sizeof( char ) );
+	    label_base  = (char *) MPL_malloc( label_max * sizeof( char ) );
 	else
 	    label_base = slabel_base;
     }
@@ -244,7 +244,7 @@ Java_logformat_trace_InputLog_getNextCategory( JNIEnv *env, jobject this )
     if ( methods_sz > 0 ) {
         methods_max  = methods_sz;
 	if (methods_max > AINT_LENGTH)
-	    methods_base = (int *)  MPIU_Malloc( methods_max * sizeof( int ) );
+	    methods_base = (int *)  MPL_malloc( methods_max * sizeof( int ) );
 	else
 	    methods_base = smethods_base;
     }
@@ -262,11 +262,11 @@ Java_logformat_trace_InputLog_getNextCategory( JNIEnv *env, jobject this )
         fprintf( errfile, "%s\n", TRACE_Get_err_string( ierr ) );
         fflush( errfile );
 	if ( legend_base != NULL && legend_base != slegend_base )
-	    MPIU_Free( legend_base );
+	    MPL_free( legend_base );
 	if ( label_base != NULL && label_base != slabel_base )
-	    MPIU_Free( label_base );
+	    MPL_free( label_base );
 	if ( methods_base != NULL && methods_base != smethods_base )
-	    MPIU_Free( methods_base );
+	    MPL_free( methods_base );
         return NULL;
     }
 
@@ -315,17 +315,17 @@ Java_logformat_trace_InputLog_getNextCategory( JNIEnv *env, jobject this )
     if ( jlegend != NULL )
         (*env)->DeleteLocalRef( env, jlegend );
     if ( legend_base != NULL && legend_base != slegend_base )
-        MPIU_Free( legend_base );
+        MPL_free( legend_base );
 
     if ( jlabel != NULL )
         (*env)->DeleteLocalRef( env, jlabel );
     if ( label_base != NULL && label_base != slabel_base )
-        MPIU_Free( label_base );
+        MPL_free( label_base );
 
     if ( jmethods != NULL )
         (*env)->DeleteLocalRef( env, jmethods );
     if ( methods_base != NULL && methods_base != smethods_base )
-        MPIU_Free( methods_base );
+        MPL_free( methods_base );
 
     return objdef;
 }
@@ -378,20 +378,20 @@ Java_logformat_trace_InputLog_getNextYCoordMap( JNIEnv *env, jobject this )
     }
 
     /* Prepare various arrays for C data */
-    title_name    = (char *) MPIU_Malloc( max_title_name * sizeof(char) );
-    column_names  = (char **) MPIU_Malloc( (ncolumns-1) * sizeof(char *) );
+    title_name    = (char *) MPL_malloc( max_title_name * sizeof(char) );
+    column_names  = (char **) MPL_malloc( (ncolumns-1) * sizeof(char *) );
     for ( icol = 0; icol < ncolumns-1; icol++ )
-        column_names[ icol ] = (char *) MPIU_Malloc( max_column_name
+        column_names[ icol ] = (char *) MPL_malloc( max_column_name
                                               * sizeof(char) );
     coordmap_max  = nrows * ncolumns;
-    coordmap_base = (int *) MPIU_Malloc( coordmap_max * sizeof( int ) );
+    coordmap_base = (int *) MPL_malloc( coordmap_max * sizeof( int ) );
     coordmap_sz   = 0;
     coordmap_pos  = 0;
 
    	methods_pos  = 0;
     if ( methods_sz > 0 ) {
         methods_max  = methods_sz;
-        methods_base = (int *) MPIU_Malloc( methods_max * sizeof( int ) );
+        methods_base = (int *) MPL_malloc( methods_max * sizeof( int ) );
     }
     else
         methods_base = NULL;
@@ -405,17 +405,17 @@ Java_logformat_trace_InputLog_getNextYCoordMap( JNIEnv *env, jobject this )
         fprintf( errfile, "Error: %s\n", TRACE_Get_err_string( ierr ) );
         fflush( errfile );
 	if ( coordmap_base != NULL )
-	    MPIU_Free( coordmap_base );
+	    MPL_free( coordmap_base );
 	if ( title_name != NULL )
-	    MPIU_Free( title_name );
+	    MPL_free( title_name );
 	if ( column_names != NULL ) {
 	    for ( icol = 0; icol < ncolumns-1; icol++ )
 		if ( column_names[ icol ] != NULL )
-		    MPIU_Free( column_names[ icol ] );
-		MPIU_Free( column_names );
+		    MPL_free( column_names[ icol ] );
+		MPL_free( column_names );
 	}
 	if ( methods_base != NULL )
-	    MPIU_Free( methods_base );
+	    MPL_free( methods_base );
         return NULL;
     }
 
@@ -475,21 +475,21 @@ Java_logformat_trace_InputLog_getNextYCoordMap( JNIEnv *env, jobject this )
     if ( coordmap_pos > 0 )
         (*env)->DeleteLocalRef( env, j_coordmap_elems );
     if ( coordmap_base != NULL )
-        MPIU_Free( coordmap_base );
+        MPL_free( coordmap_base );
 
     if ( title_name != NULL )
-        MPIU_Free( title_name );
+        MPL_free( title_name );
     if ( column_names != NULL ) {
         for ( icol = 0; icol < ncolumns-1; icol++ )
             if ( column_names[ icol ] != NULL )
-                MPIU_Free( column_names[ icol ] );
-        MPIU_Free( column_names );
+                MPL_free( column_names[ icol ] );
+        MPL_free( column_names );
     }
 
     if ( jmethods != NULL )
         (*env)->DeleteLocalRef( env, jmethods );
     if ( methods_base != NULL )
-        MPIU_Free( methods_base );
+        MPL_free( methods_base );
 
     return ycoordmap;
 }
@@ -539,19 +539,19 @@ Java_logformat_trace_InputLog_getNextPrimitive( JNIEnv *env, jobject this )
     tcoord_pos  = 0;
     tcoord_max  = tcoord_sz;
     if (tcoord_max > ADOUBLE_LENGTH)
-	tcoord_base = (double *) MPIU_Malloc( tcoord_max * sizeof( double ) );
+	tcoord_base = (double *) MPL_malloc( tcoord_max * sizeof( double ) );
     else
 	tcoord_base = stcoord_base;
     ycoord_pos  = 0;
     ycoord_max  = ycoord_sz;
     if (ycoord_max > AINT_LENGTH)
-	ycoord_base = (int *)    MPIU_Malloc( ycoord_max * sizeof( int ) );
+	ycoord_base = (int *)    MPL_malloc( ycoord_max * sizeof( int ) );
     else
 	ycoord_base = sycoord_base;
     info_pos    = 0;
     info_max    = info_sz;
     if (info_max > AINT_LENGTH)
-	info_base   = (char *)   MPIU_Malloc( info_max * sizeof( char ) );
+	info_base   = (char *)   MPL_malloc( info_max * sizeof( char ) );
     else
 	info_base = sinfo_base;
     ierr = TRACE_Get_next_primitive( tracefile, &type_idx,
@@ -565,11 +565,11 @@ Java_logformat_trace_InputLog_getNextPrimitive( JNIEnv *env, jobject this )
         fprintf( errfile, "%s\n", TRACE_Get_err_string( ierr ) );
         fflush( errfile );
 	if ( tcoord_base != NULL && tcoord_base != stcoord_base )
-	    MPIU_Free( tcoord_base );
+	    MPL_free( tcoord_base );
 	if ( ycoord_base != NULL && ycoord_base != sycoord_base )
-	    MPIU_Free( ycoord_base );
+	    MPL_free( ycoord_base );
 	if ( info_base != NULL && info_base != sinfo_base )
-	    MPIU_Free( info_base );
+	    MPL_free( info_base );
         return NULL;
     }
 
@@ -617,17 +617,17 @@ Java_logformat_trace_InputLog_getNextPrimitive( JNIEnv *env, jobject this )
     if ( tcoord_pos > 0 )
         (*env)->DeleteLocalRef( env, j_tcoords );
     if ( tcoord_base != NULL && tcoord_base != stcoord_base )
-        MPIU_Free( tcoord_base );
+        MPL_free( tcoord_base );
 
     if ( ycoord_pos > 0 )
         (*env)->DeleteLocalRef( env, j_ycoords );
     if ( ycoord_base != NULL && ycoord_base != sycoord_base )
-        MPIU_Free( ycoord_base );
+        MPL_free( ycoord_base );
 
     if ( info_pos > 0 )
         (*env)->DeleteLocalRef( env, j_infos );
     if ( info_base != NULL && info_base != sinfo_base )
-        MPIU_Free( info_base );
+        MPL_free( info_base );
 
     return prime;
 }
@@ -676,7 +676,7 @@ Java_logformat_trace_InputLog_getNextComposite( JNIEnv *env, jobject this )
     if ( cm_info_sz > 0 ) {
         cm_info_pos    = 0;
         cm_info_max    = cm_info_sz;
-        cm_info_base   = (char *)   MPIU_Malloc( cm_info_max * sizeof( char ) );
+        cm_info_base   = (char *)   MPL_malloc( cm_info_max * sizeof( char ) );
         ierr = TRACE_Get_next_composite( tracefile, &cmplx_type_idx,
                                          &cm_info_sz, cm_info_base,
                                          &cm_info_pos, cm_info_max );
@@ -736,7 +736,7 @@ Java_logformat_trace_InputLog_getNextComposite( JNIEnv *env, jobject this )
     if ( cm_info_sz > 0 && cm_info_pos > 0 )
         (*env)->DeleteLocalRef( env, j_cm_infos );
     if ( cm_info_base != NULL )
-        MPIU_Free( cm_info_base );
+        MPL_free( cm_info_base );
 
     return cmplx;
 }
diff --git a/src/util/logging/rlog/TraceInput/trace_input.c b/src/util/logging/rlog/TraceInput/trace_input.c
index b844e84..f0f28c6 100644
--- a/src/util/logging/rlog/TraceInput/trace_input.c
+++ b/src/util/logging/rlog/TraceInput/trace_input.c
@@ -81,14 +81,14 @@ TRACE_EXPORT int TRACE_Open( const char filespec[], TRACE_file *fp )
 	return TRACEINPUT_SUCCESS;
     }
 
-    *fp = (_trace_file*)MPIU_Malloc(sizeof(_trace_file));
+    *fp = (_trace_file*)MPL_malloc(sizeof(_trace_file));
     if (*fp == NULL)
 	return TRACEINPUT_FAIL;
 
     (*fp)->pInput = pInput = RLOG_CreateInputStruct(filespec);
     if (pInput == NULL)
     {
-	MPIU_Free(*fp);
+	MPL_free(*fp);
 	*fp = NULL;
 	return TRACEINPUT_FAIL;
     }
@@ -96,15 +96,15 @@ TRACE_EXPORT int TRACE_Open( const char filespec[], TRACE_file *fp )
     (*fp)->bArrowAvail = (RLOG_GetNextArrow(pInput, &(*fp)->arrow) == 0);
     if (pInput->nNumRanks > 0)
     {
-	(*fp)->ppEvent = (RLOG_EVENT**)MPIU_Malloc(sizeof(RLOG_EVENT*) * pInput->nNumRanks);
-	(*fp)->ppEventAvail = (int**)MPIU_Malloc(sizeof(int*) * pInput->nNumRanks);
+	(*fp)->ppEvent = (RLOG_EVENT**)MPL_malloc(sizeof(RLOG_EVENT*) * pInput->nNumRanks);
+	(*fp)->ppEventAvail = (int**)MPL_malloc(sizeof(int*) * pInput->nNumRanks);
 
 	for (i=0; i<pInput->nNumRanks; i++)
 	{
 	    if (pInput->pNumEventRecursions[i] > 0)
 	    {
-		(*fp)->ppEvent[i] = (RLOG_EVENT*)MPIU_Malloc(sizeof(RLOG_EVENT) * pInput->pNumEventRecursions[i]);
-		(*fp)->ppEventAvail[i] = (int*)MPIU_Malloc(sizeof(int) * pInput->pNumEventRecursions[i]);
+		(*fp)->ppEvent[i] = (RLOG_EVENT*)MPL_malloc(sizeof(RLOG_EVENT) * pInput->pNumEventRecursions[i]);
+		(*fp)->ppEventAvail[i] = (int*)MPL_malloc(sizeof(int) * pInput->pNumEventRecursions[i]);
 	    }
 	    else
 	    {
@@ -140,17 +140,17 @@ TRACE_EXPORT int TRACE_Close( TRACE_file *fp )
 	for (i=0; i<(*fp)->pInput->nNumRanks; i++)
 	{
 	    if ( (*fp)->ppEvent[i] )
-		MPIU_Free( (*fp)->ppEvent[i] );
+		MPL_free( (*fp)->ppEvent[i] );
 	    if ( (*fp)->ppEventAvail[i] )
-		MPIU_Free( (*fp)->ppEventAvail[i] );
+		MPL_free( (*fp)->ppEventAvail[i] );
 	}
 	RLOG_CloseInputStruct(&(*fp)->pInput);
     }
     if ((*fp)->ppEvent)
-	MPIU_Free( (*fp)->ppEvent );
+	MPL_free( (*fp)->ppEvent );
     if ((*fp)->ppEventAvail)
-	MPIU_Free( (*fp)->ppEventAvail );
-    MPIU_Free( (*fp) );
+	MPL_free( (*fp)->ppEventAvail );
+    MPL_free( (*fp) );
     *fp = NULL;
 
     return TRACEINPUT_SUCCESS;
diff --git a/src/util/logging/rlog/irlog2rlog.c b/src/util/logging/rlog/irlog2rlog.c
index f1539e5..1b24484 100644
--- a/src/util/logging/rlog/irlog2rlog.c
+++ b/src/util/logging/rlog/irlog2rlog.c
@@ -144,7 +144,7 @@ ArrowNode *GetArrowNode(int rank)
 	pNode = pNode->pNext;
     }
 
-    pNode = (ArrowNode *)MPIU_Malloc(sizeof(ArrowNode));
+    pNode = (ArrowNode *)MPL_malloc(sizeof(ArrowNode));
     pNode->pEndList = NULL;
     pNode->pStartList = NULL;
     pNode->rank = rank;
@@ -228,7 +228,7 @@ void SaveArrow(RLOG_IARROW *pArrow)
 	pEnd = ExtractEndNode(pNode, pArrow->rank, pArrow->tag);
 	if (pEnd == NULL)
 	{
-	    pStart = (StartArrowStruct *)MPIU_Malloc(sizeof(StartArrowStruct));
+	    pStart = (StartArrowStruct *)MPL_malloc(sizeof(StartArrowStruct));
 	    pStart->src = pArrow->rank;
 	    pStart->tag = pArrow->tag;
 	    pStart->length = pArrow->length;
@@ -256,7 +256,7 @@ void SaveArrow(RLOG_IARROW *pArrow)
 	arrow.leftright = RLOG_ARROW_LEFT;
 	/* fwrite(&arrow, sizeof(RLOG_ARROW), 1, g_fArrow); */
 	WriteFileData(&arrow, sizeof(RLOG_ARROW), g_fArrow);
-	MPIU_Free(pEnd);
+	MPL_free(pEnd);
     }
     else
     {
@@ -273,13 +273,13 @@ void SaveArrow(RLOG_IARROW *pArrow)
 	    arrow.start_time = pStart->start_time;
 	    arrow.length = pStart->length; /* the sender length is more accurate than the receiver length */
 	    arrow.leftright = RLOG_ARROW_RIGHT;
-	    MPIU_Free(pStart);
+	    MPL_free(pStart);
 	    /* fwrite(&arrow, sizeof(RLOG_ARROW), 1, g_fArrow); */
 	    WriteFileData(&arrow, sizeof(RLOG_ARROW), g_fArrow);
 	}
 	else
 	{
-	    pEnd = (EndArrowStruct *)MPIU_Malloc(sizeof(EndArrowStruct));
+	    pEnd = (EndArrowStruct *)MPL_malloc(sizeof(EndArrowStruct));
 	    pEnd->src = pArrow->remote;
 	    pEnd->tag = pArrow->tag;
 	    pEnd->timestamp = pArrow->timestamp;
@@ -314,7 +314,7 @@ RecursionStruct *GetLevel(int rank, int recursion)
 	pLevel = pLevel->next;
     }
 
-    pLevel = (RecursionStruct*)MPIU_Malloc(sizeof(RecursionStruct));
+    pLevel = (RecursionStruct*)MPL_malloc(sizeof(RecursionStruct));
     MPL_snprintf(pLevel->filename, 1024, "irlog.%d.%d.tmp", rank, recursion);
     pLevel->fout = fopen(pLevel->filename, "w+b");
     pLevel->rank = rank;
@@ -352,7 +352,7 @@ void SaveState(RLOG_STATE *pState)
 	pIter = pIter->next;
     }
 
-    pIter = (RLOG_State_list*)MPIU_Malloc(sizeof(RLOG_State_list));
+    pIter = (RLOG_State_list*)MPL_malloc(sizeof(RLOG_State_list));
     memcpy(&pIter->state, pState, sizeof(RLOG_STATE));
     pIter->next = g_pList;
     g_pList = pIter;
@@ -388,7 +388,7 @@ void AppendFile(FILE *fout, FILE *fin)
     int num_read, num_written;
     char *buffer, *buf;
 
-    buffer = (char*)MPIU_Malloc(sizeof(char) * BUFFER_SIZE);
+    buffer = (char*)MPL_malloc(sizeof(char) * BUFFER_SIZE);
 
     total = ftell(fin);
     fseek(fin, 0L, SEEK_SET);
@@ -416,7 +416,7 @@ void AppendFile(FILE *fout, FILE *fin)
 	}
     }
 
-    MPIU_Free(buffer);
+    MPL_free(buffer);
 }
 
 int FindMinRank(RecursionStruct *pLevel)
@@ -493,7 +493,7 @@ void RemoveLevel(int rank)
 		pLevel = pLevel->next;
 		fclose(pTrailer->fout);
 		unlink(pTrailer->filename);
-		MPIU_Free(pTrailer);
+		MPL_free(pTrailer);
 		pTrailer = pLevel;
 	    }
 	    else
@@ -501,7 +501,7 @@ void RemoveLevel(int rank)
 		pTrailer->next = pLevel->next;
 		fclose(pLevel->fout);
 		unlink(pLevel->filename);
-		MPIU_Free(pLevel);
+		MPL_free(pLevel);
 		pLevel = pTrailer->next;
 	    }
 	}
@@ -600,7 +600,7 @@ void GenerateNewArgv(int *pargc, char ***pargv, int n)
     char *buffer, *str;
 
     length = (sizeof(char*) * (n+3)) +strlen((*pargv)[0]) + 1 + strlen((*pargv)[1]) + 1 + (15 * n);
-    buffer = (char*)MPIU_Malloc(length);
+    buffer = (char*)MPL_malloc(length);
 
     argc = n+2;
     argv = (char**)buffer;
@@ -668,7 +668,7 @@ int main(int argc, char *argv[])
     }
 
     /* read the arrows from all the files in order */
-    ppInput = (IRLOG_IOStruct**)MPIU_Malloc(nNumInputs * sizeof(IRLOG_IOStruct*));
+    ppInput = (IRLOG_IOStruct**)MPL_malloc(nNumInputs * sizeof(IRLOG_IOStruct*));
     for (i=0; i<nNumInputs; i++)
     {
 	ppInput[i] = IRLOG_CreateInputStruct(argv[i+2]);
@@ -837,7 +837,7 @@ int main(int argc, char *argv[])
     {
 	pState = g_pList;
 	g_pList = g_pList->next;
-	MPIU_Free(pState);
+	MPL_free(pState);
     }
     if (g_fArrow)
     {
@@ -846,7 +846,7 @@ int main(int argc, char *argv[])
     }
 
     if (s_bFreeArgv)
-	MPIU_Free(argv);
+	MPL_free(argv);
 
     return 0;
 }
diff --git a/src/util/logging/rlog/irlogutil.c b/src/util/logging/rlog/irlogutil.c
index ba9e3e8..4442ad2 100644
--- a/src/util/logging/rlog/irlogutil.c
+++ b/src/util/logging/rlog/irlogutil.c
@@ -58,7 +58,7 @@ IRLOG_IOStruct *IRLOG_CreateInputStruct(const char *filename)
     IRLOG_IOStruct *pInput;
 
     /* allocate an input structure */
-    pInput = (IRLOG_IOStruct*)MPIU_Malloc(sizeof(IRLOG_IOStruct));
+    pInput = (IRLOG_IOStruct*)MPL_malloc(sizeof(IRLOG_IOStruct));
     if (pInput == NULL)
     {
 	MPL_error_printf("malloc failed - %s\n", strerror(errno));
@@ -69,7 +69,7 @@ IRLOG_IOStruct *IRLOG_CreateInputStruct(const char *filename)
     if (pInput->f == NULL)
     {
 	MPL_error_printf("fopen(%s) failed, error: %s\n", filename, strerror(errno));
-	MPIU_Free(pInput);
+	MPL_free(pInput);
 	return NULL;
     }
     /* read some data */
@@ -78,7 +78,7 @@ IRLOG_IOStruct *IRLOG_CreateInputStruct(const char *filename)
     {
 	MPL_error_printf("Unable to read data from the input file.\n");
 	fclose(pInput->f);
-	MPIU_Free(pInput);
+	MPL_free(pInput);
 	return NULL;
     }
     /* set the data fields and get the first record */
@@ -89,7 +89,7 @@ IRLOG_IOStruct *IRLOG_CreateInputStruct(const char *filename)
     {
 	MPL_error_printf("Unable to get the first record from the file.\n");
 	fclose(pInput->f);
-	MPIU_Free(pInput);
+	MPL_free(pInput);
 	return NULL;
     }
     return pInput;
@@ -100,7 +100,7 @@ IRLOG_IOStruct *IRLOG_CreateOutputStruct(const char *filename)
     IRLOG_IOStruct *pOutput = NULL;
 
     /* allocate a data structure */
-    pOutput = (IRLOG_IOStruct*)MPIU_Malloc(sizeof(IRLOG_IOStruct));
+    pOutput = (IRLOG_IOStruct*)MPL_malloc(sizeof(IRLOG_IOStruct));
     if (pOutput == NULL)
     {
 	MPL_error_printf("malloc failed - %s\n", strerror(errno));
@@ -112,7 +112,7 @@ IRLOG_IOStruct *IRLOG_CreateOutputStruct(const char *filename)
     if (pOutput->f == NULL)
     {
 	MPL_error_printf("Unable to open output file '%s' - %s\n", filename, strerror(errno));
-	MPIU_Free(pOutput);
+	MPL_free(pOutput);
 	return NULL;
     }
 
@@ -216,7 +216,7 @@ int IRLOG_WriteRecord(RLOG_HEADER *pRecord, IRLOG_IOStruct *pOutput)
 int IRLOG_CloseInputStruct(IRLOG_IOStruct **ppInput)
 {
     fclose((*ppInput)->f);
-    MPIU_Free(*ppInput);
+    MPL_free(*ppInput);
     *ppInput = NULL;
     return 0;
 }
@@ -225,7 +225,7 @@ int IRLOG_CloseOutputStruct(IRLOG_IOStruct **ppOutput)
 {
     WriteFileData((*ppOutput)->buffer, (int)((*ppOutput)->pCurHeader - (*ppOutput)->buffer), (*ppOutput)->f);
     fclose((*ppOutput)->f);
-    MPIU_Free(*ppOutput);
+    MPL_free(*ppOutput);
     *ppOutput = NULL;
     return 0;
 }
diff --git a/src/util/logging/rlog/minalignrlog.c b/src/util/logging/rlog/minalignrlog.c
index 53e251a..8dd9cb0 100644
--- a/src/util/logging/rlog/minalignrlog.c
+++ b/src/util/logging/rlog/minalignrlog.c
@@ -131,7 +131,7 @@ int main(int argc, char *argv[])
 	}
     }
 
-    pOffset = (double*)MPIU_Malloc(range * sizeof(double));
+    pOffset = (double*)MPL_malloc(range * sizeof(double));
     if (pOffset == NULL)
     {
 	printf("malloc failed\n");
diff --git a/src/util/logging/rlog/rlog.c b/src/util/logging/rlog/rlog.c
index 7fd54f3..e870920 100644
--- a/src/util/logging/rlog/rlog.c
+++ b/src/util/logging/rlog/rlog.c
@@ -65,7 +65,7 @@ RLOG_Struct* RLOG_InitLog(int rank, int size)
 {
     RLOG_Struct* pRLOG;
 
-    pRLOG = (RLOG_Struct*)MPIU_Malloc(sizeof(RLOG_Struct));
+    pRLOG = (RLOG_Struct*)MPL_malloc(sizeof(RLOG_Struct));
     if (pRLOG == NULL)
 	return NULL;
 
@@ -81,7 +81,7 @@ RLOG_Struct* RLOG_InitLog(int rank, int size)
     if (pRLOG->pOutput == NULL)
     {
 	MPL_error_printf("RLOG Error: unable to allocate an output structure.\n");
-	MPIU_Free(pRLOG);
+	MPL_free(pRLOG);
 	return NULL;
     }
 
diff --git a/src/util/logging/rlog/rlogutil.c b/src/util/logging/rlog/rlogutil.c
index d0131df..f49ef28 100644
--- a/src/util/logging/rlog/rlogutil.c
+++ b/src/util/logging/rlog/rlogutil.c
@@ -81,7 +81,7 @@ RLOG_IOStruct *RLOG_CreateInputStruct(const char *filename)
     int type, length;
 
     /* allocate an input structure */
-    pInput = (RLOG_IOStruct*)MPIU_Malloc(sizeof(RLOG_IOStruct));
+    pInput = (RLOG_IOStruct*)MPL_malloc(sizeof(RLOG_IOStruct));
     if (pInput == NULL)
     {
 	MPL_error_printf("malloc failed - %s\n", strerror(errno));
@@ -99,7 +99,7 @@ RLOG_IOStruct *RLOG_CreateInputStruct(const char *filename)
     if (pInput->f == NULL)
     {
 	MPL_error_printf("fopen(%s) failed, error: %s\n", filename, strerror(errno));
-	MPIU_Free(pInput);
+	MPL_free(pInput);
 	return NULL;
     }
     pInput->nNumRanks = 0;
@@ -125,14 +125,14 @@ RLOG_IOStruct *RLOG_CreateInputStruct(const char *filename)
 	    pInput->nNumRanks = pInput->header.nMaxRank + 1 - pInput->header.nMinRank;
 	    min_rank = pInput->header.nMinRank;
 	    
-	    pInput->pRank = (int*)MPIU_Malloc(pInput->nNumRanks * sizeof(int));
-	    pInput->pNumEventRecursions = (int*)MPIU_Malloc(pInput->nNumRanks * sizeof(int));
-	    pInput->ppNumEvents = (int**)MPIU_Malloc(pInput->nNumRanks * sizeof(int*));
-	    pInput->ppCurEvent = (int**)MPIU_Malloc(pInput->nNumRanks * sizeof(int*));
-	    pInput->ppCurGlobalEvent = (int**)MPIU_Malloc(pInput->nNumRanks * sizeof(int*));
-	    pInput->gppCurEvent = (RLOG_EVENT**)MPIU_Malloc(pInput->nNumRanks * sizeof(RLOG_EVENT*));
-	    pInput->gppPrevEvent = (RLOG_EVENT**)MPIU_Malloc(pInput->nNumRanks * sizeof(RLOG_EVENT*));
-	    pInput->ppEventOffset = (long**)MPIU_Malloc(pInput->nNumRanks * sizeof(long*));
+	    pInput->pRank = (int*)MPL_malloc(pInput->nNumRanks * sizeof(int));
+	    pInput->pNumEventRecursions = (int*)MPL_malloc(pInput->nNumRanks * sizeof(int));
+	    pInput->ppNumEvents = (int**)MPL_malloc(pInput->nNumRanks * sizeof(int*));
+	    pInput->ppCurEvent = (int**)MPL_malloc(pInput->nNumRanks * sizeof(int*));
+	    pInput->ppCurGlobalEvent = (int**)MPL_malloc(pInput->nNumRanks * sizeof(int*));
+	    pInput->gppCurEvent = (RLOG_EVENT**)MPL_malloc(pInput->nNumRanks * sizeof(RLOG_EVENT*));
+	    pInput->gppPrevEvent = (RLOG_EVENT**)MPL_malloc(pInput->nNumRanks * sizeof(RLOG_EVENT*));
+	    pInput->ppEventOffset = (long**)MPL_malloc(pInput->nNumRanks * sizeof(long*));
 	    for (i=0; i<pInput->nNumRanks; i++)
 	    {
 		pInput->pRank[i] = -1;
@@ -163,7 +163,7 @@ RLOG_IOStruct *RLOG_CreateInputStruct(const char *filename)
 	    if (cur_rank - min_rank >= pInput->nNumRanks)
 	    {
 		MPL_error_printf("Error: event section out of range - %d <= %d <= %d\n", pInput->header.nMinRank, cur_rank, pInput->header.nMaxRank);
-		MPIU_Free(pInput);
+		MPL_free(pInput);
 		return NULL;
 	    }
 	    rank_index = cur_rank - min_rank;
@@ -171,12 +171,12 @@ RLOG_IOStruct *RLOG_CreateInputStruct(const char *filename)
 	    /*printf("levels: %d\n", pInput->nNumEventRecursions);*/
 	    if (pInput->pNumEventRecursions[rank_index])
 	    {
-		pInput->ppCurEvent[rank_index] = (int*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
-		pInput->ppCurGlobalEvent[rank_index] = (int*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
-		pInput->gppCurEvent[rank_index] = (RLOG_EVENT*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(RLOG_EVENT));
-		pInput->gppPrevEvent[rank_index] = (RLOG_EVENT*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(RLOG_EVENT));
-		pInput->ppNumEvents[rank_index] = (int*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
-		pInput->ppEventOffset[rank_index] = (long*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(long));
+		pInput->ppCurEvent[rank_index] = (int*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
+		pInput->ppCurGlobalEvent[rank_index] = (int*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
+		pInput->gppCurEvent[rank_index] = (RLOG_EVENT*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(RLOG_EVENT));
+		pInput->gppPrevEvent[rank_index] = (RLOG_EVENT*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(RLOG_EVENT));
+		pInput->ppNumEvents[rank_index] = (int*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
+		pInput->ppEventOffset[rank_index] = (long*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(long));
 	    }
 	    for (i=0; i<pInput->pNumEventRecursions[rank_index]; i++)
 	    {
@@ -234,7 +234,7 @@ static int ModifyArrows(FILE *f, int nNumArrows, int nMin, double *pOffsets, int
     arrow_pos = ftell(f);
     if (arrow_pos == -1)
 	return errno;
-    pArray = (RLOG_ARROW*)MPIU_Malloc(nNumArrows * sizeof(RLOG_ARROW));
+    pArray = (RLOG_ARROW*)MPL_malloc(nNumArrows * sizeof(RLOG_ARROW));
     if (pArray)
     {
 	MPL_msg_printf("Modifying %d arrows\n", nNumArrows);
@@ -243,7 +243,7 @@ static int ModifyArrows(FILE *f, int nNumArrows, int nMin, double *pOffsets, int
 	error = ReadFileData((char*)pArray, nNumArrows * sizeof(RLOG_ARROW), f);
 	if (error)
 	{
-	    MPIU_Free(pArray);
+	    MPL_free(pArray);
 	    return error;
 	}
 
@@ -287,11 +287,11 @@ static int ModifyArrows(FILE *f, int nNumArrows, int nMin, double *pOffsets, int
 	error = WriteFileData((char*)pArray, nNumArrows * sizeof(RLOG_ARROW), f);
 	if (error)
 	{
-	    MPIU_Free(pArray);
+	    MPL_free(pArray);
 	    return error;
 	}
 	fseek(f, 0, SEEK_CUR);
-	MPIU_Free(pArray);
+	MPL_free(pArray);
     }
     else
     {
@@ -344,7 +344,7 @@ int RLOG_ModifyEvents(const char *filename, double *pOffsets, int n)
     int error;
 
     /* allocate an input structure */
-    pInput = (RLOG_IOStruct*)MPIU_Malloc(sizeof(RLOG_IOStruct));
+    pInput = (RLOG_IOStruct*)MPL_malloc(sizeof(RLOG_IOStruct));
     if (pInput == NULL)
     {
 	MPL_error_printf("malloc failed - %s\n", strerror(errno));
@@ -362,7 +362,7 @@ int RLOG_ModifyEvents(const char *filename, double *pOffsets, int n)
     if (pInput->f == NULL)
     {
 	MPL_error_printf("fopen(%s) failed, error: %s\n", filename, strerror(errno));
-	MPIU_Free(pInput);
+	MPL_free(pInput);
 	return -1;
     }
     pInput->nNumRanks = 0;
@@ -388,14 +388,14 @@ int RLOG_ModifyEvents(const char *filename, double *pOffsets, int n)
 	    pInput->nNumRanks = pInput->header.nMaxRank + 1 - pInput->header.nMinRank;
 	    min_rank = pInput->header.nMinRank;
 	    
-	    pInput->pRank = (int*)MPIU_Malloc(pInput->nNumRanks * sizeof(int));
-	    pInput->pNumEventRecursions = (int*)MPIU_Malloc(pInput->nNumRanks * sizeof(int));
-	    pInput->ppNumEvents = (int**)MPIU_Malloc(pInput->nNumRanks * sizeof(int*));
-	    pInput->ppCurEvent = (int**)MPIU_Malloc(pInput->nNumRanks * sizeof(int*));
-	    pInput->ppCurGlobalEvent = (int**)MPIU_Malloc(pInput->nNumRanks * sizeof(int*));
-	    pInput->gppCurEvent = (RLOG_EVENT**)MPIU_Malloc(pInput->nNumRanks * sizeof(RLOG_EVENT*));
-	    pInput->gppPrevEvent = (RLOG_EVENT**)MPIU_Malloc(pInput->nNumRanks * sizeof(RLOG_EVENT*));
-	    pInput->ppEventOffset = (long**)MPIU_Malloc(pInput->nNumRanks * sizeof(long*));
+	    pInput->pRank = (int*)MPL_malloc(pInput->nNumRanks * sizeof(int));
+	    pInput->pNumEventRecursions = (int*)MPL_malloc(pInput->nNumRanks * sizeof(int));
+	    pInput->ppNumEvents = (int**)MPL_malloc(pInput->nNumRanks * sizeof(int*));
+	    pInput->ppCurEvent = (int**)MPL_malloc(pInput->nNumRanks * sizeof(int*));
+	    pInput->ppCurGlobalEvent = (int**)MPL_malloc(pInput->nNumRanks * sizeof(int*));
+	    pInput->gppCurEvent = (RLOG_EVENT**)MPL_malloc(pInput->nNumRanks * sizeof(RLOG_EVENT*));
+	    pInput->gppPrevEvent = (RLOG_EVENT**)MPL_malloc(pInput->nNumRanks * sizeof(RLOG_EVENT*));
+	    pInput->ppEventOffset = (long**)MPL_malloc(pInput->nNumRanks * sizeof(long*));
 	    for (i=0; i<pInput->nNumRanks; i++)
 	    {
 		pInput->pRank[i] = -1;
@@ -441,12 +441,12 @@ int RLOG_ModifyEvents(const char *filename, double *pOffsets, int n)
 	    /*printf("levels: %d\n", pInput->nNumEventRecursions);*/
 	    if (pInput->pNumEventRecursions[rank_index])
 	    {
-		pInput->ppCurEvent[rank_index] = (int*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
-		pInput->ppCurGlobalEvent[rank_index] = (int*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
-		pInput->gppCurEvent[rank_index] = (RLOG_EVENT*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(RLOG_EVENT));
-		pInput->gppPrevEvent[rank_index] = (RLOG_EVENT*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(RLOG_EVENT));
-		pInput->ppNumEvents[rank_index] = (int*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
-		pInput->ppEventOffset[rank_index] = (long*)MPIU_Malloc(pInput->pNumEventRecursions[rank_index] * sizeof(long));
+		pInput->ppCurEvent[rank_index] = (int*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
+		pInput->ppCurGlobalEvent[rank_index] = (int*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
+		pInput->gppCurEvent[rank_index] = (RLOG_EVENT*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(RLOG_EVENT));
+		pInput->gppPrevEvent[rank_index] = (RLOG_EVENT*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(RLOG_EVENT));
+		pInput->ppNumEvents[rank_index] = (int*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(int));
+		pInput->ppEventOffset[rank_index] = (long*)MPL_malloc(pInput->pNumEventRecursions[rank_index] * sizeof(long));
 	    }
 	    for (i=0; i<pInput->pNumEventRecursions[rank_index]; i++)
 	    {
@@ -495,31 +495,31 @@ int RLOG_CloseInputStruct(RLOG_IOStruct **ppInput)
     for (i=0; i<(*ppInput)->nNumRanks; i++)
     {
 	if ((*ppInput)->ppCurEvent[i])
-	    MPIU_Free((*ppInput)->ppCurEvent[i]);
+	    MPL_free((*ppInput)->ppCurEvent[i]);
 	if ((*ppInput)->ppCurGlobalEvent[i])
-	    MPIU_Free((*ppInput)->ppCurGlobalEvent[i]);
+	    MPL_free((*ppInput)->ppCurGlobalEvent[i]);
 	if ((*ppInput)->gppCurEvent[i])
-	    MPIU_Free((*ppInput)->gppCurEvent[i]);
+	    MPL_free((*ppInput)->gppCurEvent[i]);
 	if ((*ppInput)->gppPrevEvent[i])
-	    MPIU_Free((*ppInput)->gppPrevEvent[i]);
+	    MPL_free((*ppInput)->gppPrevEvent[i]);
 	if ((*ppInput)->ppEventOffset[i])
-	    MPIU_Free((*ppInput)->ppEventOffset[i]);
+	    MPL_free((*ppInput)->ppEventOffset[i]);
 	if ((*ppInput)->ppNumEvents[i])
-	    MPIU_Free((*ppInput)->ppNumEvents[i]);
+	    MPL_free((*ppInput)->ppNumEvents[i]);
     }
     if ((*ppInput)->ppCurEvent)
-	MPIU_Free((*ppInput)->ppCurEvent);
+	MPL_free((*ppInput)->ppCurEvent);
     if ((*ppInput)->ppCurGlobalEvent)
-	MPIU_Free((*ppInput)->ppCurGlobalEvent);
+	MPL_free((*ppInput)->ppCurGlobalEvent);
     if ((*ppInput)->gppCurEvent)
-	MPIU_Free((*ppInput)->gppCurEvent);
+	MPL_free((*ppInput)->gppCurEvent);
     if ((*ppInput)->gppPrevEvent)
-	MPIU_Free((*ppInput)->gppPrevEvent);
+	MPL_free((*ppInput)->gppPrevEvent);
     if ((*ppInput)->ppEventOffset)
-	MPIU_Free((*ppInput)->ppEventOffset);
+	MPL_free((*ppInput)->ppEventOffset);
     if ((*ppInput)->ppNumEvents)
-	MPIU_Free((*ppInput)->ppNumEvents);
-    MPIU_Free(*ppInput);
+	MPL_free((*ppInput)->ppNumEvents);
+    MPL_free(*ppInput);
     *ppInput = NULL;
     return 0;
 }
diff --git a/src/util/mem/handlemem.c b/src/util/mem/handlemem.c
index 05ac95f..4681c3d 100644
--- a/src/util/mem/handlemem.c
+++ b/src/util/mem/handlemem.c
@@ -90,10 +90,10 @@ static int handle_free( void *((*indirect)[]), int indirect_size )
     
     /* Remove any allocated storage */
     for (i=0; i<indirect_size; i++) {
-	MPIU_Free( (*indirect)[i] );
+	MPL_free( (*indirect)[i] );
     }
     if (indirect) {
-	MPIU_Free( indirect );
+	MPL_free( indirect );
     }
     /* This does *not* remove any objects that the user created 
        and then did not destroy */
@@ -163,7 +163,7 @@ static void *handle_indirect_init( void *(**indirect)[],
     /* Create the table */
     if (!*indirect) {
 	/* printf( "Creating indirect table with %d pointers to blocks in it\n", indirect_num_blocks ); */
-	*indirect = (void *)MPIU_Calloc(indirect_num_blocks, sizeof(void *));
+	*indirect = (void *)MPL_calloc(indirect_num_blocks, sizeof(void *));
 	if (!*indirect) {
 	    return 0;
 	}
@@ -178,7 +178,7 @@ static void *handle_indirect_init( void *(**indirect)[],
 
     /* Create the next block */
     /* printf("Creating indirect block number %d with %d objects in it\n", *indirect_size, indirect_num_indices); */
-    block_ptr = (void *)MPIU_Calloc( indirect_num_indices, obj_size );
+    block_ptr = (void *)MPL_calloc( indirect_num_indices, obj_size );
     if (!block_ptr) { 
 	return 0;
     }
@@ -557,7 +557,7 @@ static int check_handles_on_finalize( void *objmem_ptr )
     }
 
     if (objmem->indirect_size > 0) {
-	nIndirect = (int *)MPIU_Calloc( objmem->indirect_size, sizeof(int) );
+	nIndirect = (int *)MPL_calloc( objmem->indirect_size, sizeof(int) );
     }
     /* Count the number of items in the avail list.  These include
        all objects, whether direct or indirect allocation */
@@ -612,7 +612,7 @@ static int check_handles_on_finalize( void *objmem_ptr )
     }
 
     if (nIndirect) { 
-	MPIU_Free( nIndirect );
+	MPL_free( nIndirect );
     }
 
     if (leaked_handles && MPIR_CVAR_ABORT_ON_LEAKED_HANDLES) {
diff --git a/src/util/procmap/local_proc.c b/src/util/procmap/local_proc.c
index f13b80d..3af27aa 100644
--- a/src/util/procmap/local_proc.c
+++ b/src/util/procmap/local_proc.c
@@ -179,12 +179,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);
+    *local_ranks_p =  MPL_realloc (local_ranks, sizeof(int) * local_size);
     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);
+    *external_ranks_p = MPL_realloc (external_ranks, sizeof(int) * external_size);
     MPIR_ERR_CHKANDJUMP (*external_ranks_p == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem2");
 
     /* no need to realloc */
diff --git a/src/util/wrappers/mpiu_shm_wrappers.h b/src/util/wrappers/mpiu_shm_wrappers.h
index 1bc2800..4534fb6 100644
--- a/src/util/wrappers/mpiu_shm_wrappers.h
+++ b/src/util/wrappers/mpiu_shm_wrappers.h
@@ -54,7 +54,7 @@
 /* Returns 0 on success, -1 on error */
 #define MPIU_SHMW_Hnd_ref_alloc(hnd)(                               \
     ((hnd)->ghnd = (MPIU_SHMW_Ghnd_t)                               \
-                    MPIU_Malloc(MPIU_SHMW_GHND_SZ)) ? 0 : -1        \
+                    MPL_malloc(MPIU_SHMW_GHND_SZ)) ? 0 : -1        \
 )
 
 #ifdef  USE_SYSV_SHM
@@ -185,7 +185,7 @@ static inline int MPIU_SHMW_Ghnd_set_uniq(MPIU_SHMW_Hnd_t hnd)
 static inline int MPIU_SHMW_Ghnd_alloc(MPIU_SHMW_Hnd_t hnd)
 {
     if(!(hnd->ghnd)){
-        hnd->ghnd = (MPIU_SHMW_Ghnd_t)MPIU_Malloc(MPIU_SHMW_GHND_SZ);
+        hnd->ghnd = (MPIU_SHMW_Ghnd_t)MPL_malloc(MPIU_SHMW_GHND_SZ);
         if(!(hnd->ghnd)){ return -1; }
     }
     /* Global handle is no longer static */
@@ -214,7 +214,7 @@ static inline int MPIU_SHMW_Ghnd_alloc(MPIU_SHMW_Hnd_t hnd)
 static inline int MPIU_SHMW_Hnd_alloc(MPIU_SHMW_Hnd_t *hnd_ptr)
 {
     MPIU_Assert(hnd_ptr);
-    *hnd_ptr = (MPIU_SHMW_Hnd_t) MPIU_Malloc(MPIU_SHMW_HND_SZ);
+    *hnd_ptr = (MPIU_SHMW_Hnd_t) MPL_malloc(MPIU_SHMW_HND_SZ);
     if(*hnd_ptr){
         (*hnd_ptr)->flag = MPIU_SHMW_FLAG_GHND_STATIC;
     }
@@ -244,9 +244,9 @@ static inline void MPIU_SHMW_Hnd_free(MPIU_SHMW_Hnd_t hnd)
 {
     if(MPIU_SHMW_Hnd_is_init(hnd)){
         if(!(hnd->flag & MPIU_SHMW_FLAG_GHND_STATIC)){
-            MPIU_Free(hnd->ghnd);
+            MPL_free(hnd->ghnd);
         }
-        MPIU_Free(hnd);
+        MPL_free(hnd);
     }
 }
 
diff --git a/src/util/wrappers/mpiu_sock_wrappers.h b/src/util/wrappers/mpiu_sock_wrappers.h
index 17e116d..eac8ba8 100644
--- a/src/util/wrappers/mpiu_sock_wrappers.h
+++ b/src/util/wrappers/mpiu_sock_wrappers.h
@@ -485,7 +485,7 @@ static inline int MPIU_SOCKW_Timeval_hnd_init(
     MPIU_Assert(hnd_ptr);
 
     *hnd_ptr = (MPIU_SOCKW_Timeval_hnd_t)
-                MPIU_Malloc(sizeof(MPIU_SOCKW_Timeval_t_));
+                MPL_malloc(sizeof(MPIU_SOCKW_Timeval_t_));
     MPIR_ERR_CHKANDJUMP1( !(*hnd_ptr), mpi_errno, MPI_ERR_OTHER,
         "**nomem", "**nomem %s", "handle to timeval");
 
@@ -527,7 +527,7 @@ static inline int MPIU_SOCKW_Timeval_hnd_finalize(
     MPIU_Assert(hnd_ptr);
 
     if(MPIU_SOCKW_Timeval_hnd_is_init_(*hnd_ptr)){
-        MPIU_Free(*hnd_ptr);
+        MPL_free(*hnd_ptr);
     }
     *hnd_ptr = NULL;
 
@@ -565,7 +565,7 @@ static inline int MPIU_SOCKW_Waitset_hnd_init(
         nfds = FD_SETSIZE;
     }
 
-    *hnd_ptr = (MPIU_SOCKW_Waitset_hnd_t) MPIU_Malloc(
+    *hnd_ptr = (MPIU_SOCKW_Waitset_hnd_t) MPL_malloc(
             sizeof(MPIU_SOCKW_Waitset_));
 
     MPIR_ERR_CHKANDJUMP1(!(*hnd_ptr), mpi_errno, MPI_ERR_OTHER,
@@ -584,7 +584,7 @@ static inline int MPIU_SOCKW_Waitset_hnd_init(
 
     /* FIXME: Cheating - Expand dynamically */
     (*hnd_ptr)->fdset = (MPIU_SOCKW_Waitset_sock_hnd_ *)
-        MPIU_Malloc(FD_SETSIZE * sizeof(MPIU_SOCKW_Waitset_sock_hnd_));
+        MPL_malloc(FD_SETSIZE * sizeof(MPIU_SOCKW_Waitset_sock_hnd_));
 
     MPIR_ERR_CHKANDJUMP1(!((*hnd_ptr)->fdset), mpi_errno, MPI_ERR_OTHER,
         "**nomem", "**nomem %s", "fdset array in waitSet");
@@ -607,8 +607,8 @@ static inline int MPIU_SOCKW_Waitset_hnd_finalize(
     MPIU_Assert(hnd_ptr);
 
     if(MPIU_SOCKW_Waitset_hnd_is_init_(*hnd_ptr)){
-        MPIU_Free((*hnd_ptr)->fdset);
-        MPIU_Free(*hnd_ptr);
+        MPL_free((*hnd_ptr)->fdset);
+        MPL_free(*hnd_ptr);
     }
 
     *hnd_ptr = NULL;
diff --git a/test/mpi/datatype/segtest.c b/test/mpi/datatype/segtest.c
index 9148d6f..504aa13 100644
--- a/test/mpi/datatype/segtest.c
+++ b/test/mpi/datatype/segtest.c
@@ -42,7 +42,7 @@ MPID_Dataloop *MPID_Dataloop_init_contig(int count)
 {
     MPID_Dataloop *ct;
 
-    ct = (MPID_Dataloop *) MPIU_Malloc(sizeof(MPID_Dataloop));
+    ct = (MPID_Dataloop *) MPL_malloc(sizeof(MPID_Dataloop));
     ct->kind = MPID_DTYPE_CONTIG | DATALOOP_FINAL_MASK;
     ct->loop_params.c_t.count = count;
     ct->loop_params.c_t.dataloop = 0;
@@ -59,7 +59,7 @@ MPID_Dataloop *MPID_Dataloop_init_vector(int count, int blocksize, int stride)
 {
     MPID_Dataloop *v;
 
-    v = (MPID_Dataloop *) MPIU_Malloc(sizeof(MPID_Dataloop));
+    v = (MPID_Dataloop *) MPL_malloc(sizeof(MPID_Dataloop));
     v->kind = MPID_DTYPE_VECTOR | DATALOOP_FINAL_MASK;
     v->loop_params.v_t.count = count;
     v->loop_params.v_t.blocksize = blocksize;
@@ -80,11 +80,11 @@ MPID_Dataloop *MPID_Dataloop_init_blockindexed(int count, int blocksize, MPI_Ain
     MPI_Aint extent;
     int i;
 
-    bi = (MPID_Dataloop *) MPIU_Malloc(sizeof(MPID_Dataloop));
+    bi = (MPID_Dataloop *) MPL_malloc(sizeof(MPID_Dataloop));
     bi->kind = MPID_DTYPE_BLOCKINDEXED | DATALOOP_FINAL_MASK;
     bi->loop_params.bi_t.count = count;
     bi->loop_params.bi_t.blocksize = blocksize;
-    bi->loop_params.bi_t.offset = (MPI_Aint *) MPIU_Malloc(sizeof(MPI_Aint) * count);
+    bi->loop_params.bi_t.offset = (MPI_Aint *) MPL_malloc(sizeof(MPI_Aint) * count);
     for (i = 0; i < count; i++) {
         bi->loop_params.bi_t.offset[i] = offset[i];
         if (offset[i] + blocksize > extent)
@@ -106,11 +106,11 @@ MPID_Dataloop *MPID_Dataloop_init_indexed(int count, int *blocksize, MPI_Aint *
     MPI_Aint extent = 0;
     int i;
 
-    it = (MPID_Dataloop *) MPIU_Malloc(sizeof(MPID_Dataloop));
+    it = (MPID_Dataloop *) MPL_malloc(sizeof(MPID_Dataloop));
     it->kind = MPID_DTYPE_INDEXED | DATALOOP_FINAL_MASK;
     it->loop_params.i_t.count = count;
-    it->loop_params.i_t.blocksize = (int *) MPIU_Malloc(sizeof(int) * count);
-    it->loop_params.i_t.offset = (MPI_Aint *) MPIU_Malloc(sizeof(MPI_Aint) * count);
+    it->loop_params.i_t.blocksize = (int *) MPL_malloc(sizeof(int) * count);
+    it->loop_params.i_t.offset = (MPI_Aint *) MPL_malloc(sizeof(MPI_Aint) * count);
     for (i = 0; i < count; i++) {
         it->loop_params.i_t.offset[i] = offset[i];
         it->loop_params.i_t.blocksize[i] = blocksize[i];
@@ -140,14 +140,14 @@ int main(int argc, char **argv)
     MPI_Type_vector(count, 1, 7, MPI_INT, &vectype);
 
     /* Initialize the data */
-    src_buf = (char *) MPIU_Malloc((count - 1) * stride + blocksize);
+    src_buf = (char *) MPL_malloc((count - 1) * stride + blocksize);
     for (i = 0; i < (count - 1) * stride + blocksize; i++)
         src_buf[i] = -i;
     for (i = 0; i < count; i++) {
         for (j = 0; j < blocksize; j++)
             src_buf[i * stride + j] = i * blocksize + j;
     }
-    dest_buf = (char *) MPIU_Malloc(count * blocksize);
+    dest_buf = (char *) MPL_malloc(count * blocksize);
     for (i = 0; i < count * blocksize; i++) {
         dest_buf[i] = -i;
     }
diff --git a/test/mpi/group/glpid.c b/test/mpi/group/glpid.c
index 43b1364..5685a67 100644
--- a/test/mpi/group/glpid.c
+++ b/test/mpi/group/glpid.c
@@ -22,7 +22,7 @@ int main(int argc, char *argv[])
     group.rank = 0;
     group.idx_of_first_lpid = -1;
     group.lrank_to_lpid = (MPID_Group_pmap_t *)
-        MPIU_Malloc(group.size * sizeof(MPID_Group_pmap_t));
+        MPL_malloc(group.size * sizeof(MPID_Group_pmap_t));
     for (i = 0; i < group.size; i++) {
         group.lrank_to_lpid[i].lrank = i;
         group.lrank_to_lpid[i].lpid = group.size - i - 1;

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

commit e193c76c6607041cb2e6b0843d770f92c8f8df9c
Author: Pavan Balaji <balaji at anl.gov>
Date:   Sat Jan 23 01:36:55 2016 -0600

    mem: remove MPIU_tr routines.
    
    These routines simply call the MPL equivalents, and are redundant.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/binding/cxx/buildiface b/src/binding/cxx/buildiface
index 53589da..1c218f9 100755
--- a/src/binding/cxx/buildiface
+++ b/src/binding/cxx/buildiface
@@ -2115,20 +2115,20 @@ int _mpi_lineno = __LINE__;
 // FIXME: determine whether the type definition is needed, and include the
 // correct definition.
 typedef unsigned int size_t;
-extern \"C\" void *MPIU_trmalloc( size_t, int, const char [] );
-extern \"C\" void MPIU_trfree( void *, int, const char [] );
-extern \"C\" void MPIU_trdump( void *, int );
+extern \"C\" void *MPL_trmalloc( size_t, int, const char [] );
+extern \"C\" void MPL_trfree( void *, int, const char [] );
+extern \"C\" void MPL_trdump( void *, int );
 void *operator new(size_t size) {
-    void *p = MPIU_trmalloc( size, _mpi_lineno, __FILE__ );
+    void *p = MPL_trmalloc( size, _mpi_lineno, __FILE__ );
     return p;}
 void operator delete(void *p) {
-    MPIU_trfree( p, _mpi_lineno, __FILE__ );}
+    MPL_trfree( p, _mpi_lineno, __FILE__ );}
 void *operator new[]( size_t size) {
-    void *p = MPIU_trmalloc( size, _mpi_lineno, __FILE__ );
+    void *p = MPL_trmalloc( size, _mpi_lineno, __FILE__ );
     return p;}
 void operator delete[](void *p) {
-    MPIU_trfree( p, _mpi_lineno, __FILE__ );}
-#define MPIX_TRSummary() MPIU_trdump( 0, -1 )
+    MPL_trfree( p, _mpi_lineno, __FILE__ );}
+#define MPIX_TRSummary() MPL_trdump( 0, -1 )
 #define MPIX_SetLineno _mpi_lineno = __LINE__ + 1
 #else
 #define MPIX_TRSummary()
diff --git a/src/include/glue_romio.h.in b/src/include/glue_romio.h.in
index b3a1f03..ae0a65d 100644
--- a/src/include/glue_romio.h.in
+++ b/src/include/glue_romio.h.in
@@ -54,12 +54,5 @@ void MPIR_Ext_cs_yield(void);
 /* to facilitate error checking */
 int MPIR_Ext_datatype_iscommitted(MPI_Datatype datatype);
 
-/* prototypes for the mem tracing routines */
-void *MPIU_trmalloc(size_t a, int lineno, const char fname[]);
-void MPIU_trfree(void *a_ptr, int line, const char fname[]);
-void *MPIU_trcalloc(size_t nelem, size_t elsize, int lineno, const char fname[]);
-void *MPIU_trrealloc(void *p, size_t size, int lineno, const char fname[]);
-void *MPIU_trstrdup(const char *str, int lineno, const char fname[]);
-
 #endif /* defined(GLUE_ROMIO_H_INCLUDED) */
 
diff --git a/src/include/mpifunc.h b/src/include/mpifunc.h
index b42d7c5..e5cbc77 100644
--- a/src/include/mpifunc.h
+++ b/src/include/mpifunc.h
@@ -26,13 +26,13 @@
 #if defined(MPL_USE_DBG_LOGGING)
 #define MPIR_FUNC_ENTER(a) MPL_DBG_MSG(MPL_DBG_ROUTINE_ENTER,TYPICAL,"Entering "#a)
 #elif defined(MPICH_DEBUG_MEMARENA)
-#define MPIR_FUNC_ENTER(a) MPIU_trvalid("Entering " #a)
+#define MPIR_FUNC_ENTER(a) MPL_trvalid("Entering " #a)
 #endif
 
 #if defined(MPL_USE_DBG_LOGGING)
 #define MPIR_FUNC_EXIT(a) MPL_DBG_MSG(MPL_DBG_ROUTINE_EXIT,TYPICAL,"Leaving "#a)
 #elif defined(MPICH_DEBUG_MEMARENA)
-#define MPIR_FUNC_EXIT(a) MPIU_trvalid("Leaving " #a)
+#define MPIR_FUNC_EXIT(a) MPL_trvalid("Leaving " #a)
 #endif
 
 #endif /* MPIFUNC_H_INCLUDED */
diff --git a/src/include/mpimem.h b/src/include/mpimem.h
index 5d13d2c..d448b57 100644
--- a/src/include/mpimem.h
+++ b/src/include/mpimem.h
@@ -85,15 +85,6 @@ typedef int MPIU_BOOL;
 
 /* ------------------------------------------------------------------------- */
 
-void MPIU_trinit(int, int);
-void *MPIU_trmalloc(size_t, int, const char []);
-void MPIU_trfree(void *, int, const char []);
-int MPIU_trvalid(const char []);
-void *MPIU_trcalloc(size_t, size_t, int, const char []);
-void *MPIU_trrealloc(void *, size_t, int, const char[]);
-void *MPIU_trstrdup(const char *, int, const char[]);
-void MPIU_trdump(FILE *, int);
-
 #ifdef USE_MEMORY_TRACING
 /*M
   MPIU_Malloc - Allocate memory
@@ -116,15 +107,15 @@ void MPIU_trdump(FILE *, int);
 .ve
   However, it can also be defined as 
 .vb
-  #define MPIU_Malloc(n) MPIU_trmalloc(n,__LINE__,__FILE__)
+  #define MPIU_Malloc(n) MPL_trmalloc(n,__LINE__,__FILE__)
 .ve
-  where 'MPIU_trmalloc' is a tracing version of 'malloc' that is included with 
+  where 'MPL_trmalloc' is a tracing version of 'malloc' that is included with
   MPICH.
 
   Module:
   Utility
   M*/
-#define MPIU_Malloc(a)    MPIU_trmalloc((a),__LINE__,__FILE__)
+#define MPIU_Malloc(a)    MPL_trmalloc((a),__LINE__,__FILE__)
 
 /*M
   MPIU_Calloc - Allocate memory that is initialized to zero.
@@ -140,13 +131,13 @@ void MPIU_trdump(FILE *, int);
 
   Notes:
   Like 'MPIU_Malloc' and 'MPIU_Free', this will often be implemented as a 
-  macro but may use 'MPIU_trcalloc' to provide a tracing version.
+  macro but may use 'MPL_trcalloc' to provide a tracing version.
 
   Module:
   Utility
   M*/
 #define MPIU_Calloc(a,b)  \
-    MPIU_trcalloc((a),(b),__LINE__,__FILE__)
+    MPL_trcalloc((a),(b),__LINE__,__FILE__)
 
 /*M
   MPIU_Free - Free memory
@@ -167,19 +158,19 @@ void MPIU_trdump(FILE *, int);
 .ve
   However, it can also be defined as 
 .vb
-  #define MPIU_Free(n) MPIU_trfree(n,__LINE__,__FILE__)
+  #define MPIU_Free(n) MPL_trfree(n,__LINE__,__FILE__)
 .ve
-  where 'MPIU_trfree' is a tracing version of 'free' that is included with 
+  where 'MPL_trfree' is a tracing version of 'free' that is included with
   MPICH.
 
   Module:
   Utility
   M*/
-#define MPIU_Free(a)      MPIU_trfree(a,__LINE__,__FILE__)
+#define MPIU_Free(a)      MPL_trfree(a,__LINE__,__FILE__)
 
-#define MPIU_Strdup(a)    MPIU_trstrdup(a,__LINE__,__FILE__)
+#define MPIU_Strdup(a)    MPL_trstrdup(a,__LINE__,__FILE__)
 
-#define MPIU_Realloc(a,b)    MPIU_trrealloc((a),(b),__LINE__,__FILE__)
+#define MPIU_Realloc(a,b)    MPL_trrealloc((a),(b),__LINE__,__FILE__)
 
 /* Define these as invalid C to catch their use in the code */
 #if 0
diff --git a/src/mpi/init/finalize.c b/src/mpi/init/finalize.c
index 1b7eefa..40db211 100644
--- a/src/mpi/init/finalize.c
+++ b/src/mpi/init/finalize.c
@@ -275,7 +275,7 @@ int MPI_Finalize( void )
 	    /* The second argument is the min id to print; memory allocated 
 	       after MPI_Init is given an id of one.  This allows us to
 	       ignore, if desired, memory leaks in the MPID_Init call */
-	    MPIU_trdump( (void *)0, -1 );
+	    MPL_trdump( (void *)0, -1 );
 	}
     }
 #endif
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 894de82..fcbfc91 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -527,7 +527,7 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
     MPIU_Timer_init(MPIR_Process.comm_world->rank,
 		    MPIR_Process.comm_world->local_size);
 #ifdef USE_MEMORY_TRACING
-    MPIU_trinit( MPIR_Process.comm_world->rank, MPIR_ThreadInfo.isThreaded );
+    MPL_trinit( MPIR_Process.comm_world->rank, MPIR_ThreadInfo.isThreaded );
     /* Indicate that we are near the end of the init step; memory 
        allocated already will have an id of zero; this helps 
        separate memory leaks in the initialization code from 
diff --git a/src/mpi/romio/adio/common/malloc.c b/src/mpi/romio/adio/common/malloc.c
index 73c5a70..dd45b1e 100644
--- a/src/mpi/romio/adio/common/malloc.c
+++ b/src/mpi/romio/adio/common/malloc.c
@@ -45,7 +45,7 @@ void *ADIOI_Malloc_fn(size_t size, int lineno, const char *fname)
     new = (void *) memalign(XFS_MEMALIGN, size);
 #else
 #ifdef HAVE_MPIU_FUNCS
-    new = (void *) MPIU_trmalloc(size, lineno, fname);
+    new = (void *) MPL_trmalloc(size, lineno, fname);
 #else
     new = (void *) malloc(size);
 #endif
@@ -64,7 +64,7 @@ void *ADIOI_Calloc_fn(size_t nelem, size_t elsize, int lineno, const char *fname
     void *new;
 
 #ifdef HAVE_MPIU_FUNCS
-    new = (void *) MPIU_trcalloc(nelem, elsize, lineno, fname);
+    new = (void *) MPL_trcalloc(nelem, elsize, lineno, fname);
 #else
     new = (void *) calloc(nelem, elsize);
 #endif
@@ -82,7 +82,7 @@ void *ADIOI_Realloc_fn(void *ptr, size_t size, int lineno, const char *fname)
     void *new;
 
 #ifdef HAVE_MPIU_FUNCS
-    new = (void *) MPIU_trrealloc(ptr, size, lineno, fname);
+    new = (void *) MPL_trrealloc(ptr, size, lineno, fname);
 #else
     new = (void *) realloc(ptr, size);
 #endif
@@ -104,7 +104,7 @@ void ADIOI_Free_fn(void *ptr, int lineno, const char *fname)
     }
 
 #ifdef HAVE_MPIU_FUNCS
-    MPIU_trfree(ptr, lineno, fname);
+    MPL_trfree(ptr, lineno, fname);
 #else
     free(ptr);
 #endif
diff --git a/src/util/mem/Makefile.mk b/src/util/mem/Makefile.mk
index a503246..d7cf614 100644
--- a/src/util/mem/Makefile.mk
+++ b/src/util/mem/Makefile.mk
@@ -11,7 +11,6 @@ noinst_HEADERS +=                               \
     src/util/mem/mpiu_strerror.h
 
 mpi_core_sources += \
-    src/util/mem/trmem.c      \
     src/util/mem/handlemem.c  \
     src/util/mem/strerror.c
 
diff --git a/src/util/mem/handlemem.c b/src/util/mem/handlemem.c
index 1917796..05ac95f 100644
--- a/src/util/mem/handlemem.c
+++ b/src/util/mem/handlemem.c
@@ -355,7 +355,7 @@ void *MPIU_Handle_obj_alloc_unsafe(MPIU_Object_alloc_t *objmem)
     if (ptr) {
 #ifdef USE_MEMORY_TRACING
     /* We set the object to an invalid pattern.  This is similar to 
-       what is done by MPIU_trmalloc by default (except that trmalloc uses
+       what is done by MPL_trmalloc by default (except that trmalloc uses
        0xda as the byte in the memset)
     */
         /* if the object was previously freed then MEMPOOL_FREE marked it as
diff --git a/src/util/mem/trmem.c b/src/util/mem/trmem.c
deleted file mode 100644
index f99e06f..0000000
--- a/src/util/mem/trmem.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2008 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include "mpiimpl.h"
-
-/* Various helper functions add thread safety to the MPL_tr* functions.  These
- * have to be functions because we cannot portably wrap the calls as macros and
- * still use real (non-out-argument) return values. */
-
-void MPIU_trinit(int rank, int need_thread_safety)
-{
-    MPL_trinit(rank, need_thread_safety);
-}
-
-void MPIU_trdump(FILE *fp, int minid)
-{
-    MPL_trdump(fp, minid);
-}
-
-void *MPIU_trmalloc(size_t a, int lineno, const char fname[])
-{
-    return MPL_trmalloc(a, lineno, fname);
-}
-
-void MPIU_trfree(void *a_ptr, int line, const char fname[])
-{
-    MPL_trfree(a_ptr, line, fname);
-}
-
-int MPIU_trvalid(const char str[])
-{
-    return MPL_trvalid(str);
-}
-
-void *MPIU_trcalloc(size_t nelem, size_t elsize, int lineno, const char fname[])
-{
-    return MPL_trcalloc(nelem, elsize, lineno, fname);
-}
-
-void *MPIU_trrealloc(void *p, size_t size, int lineno, const char fname[])
-{
-    return MPL_trrealloc(p, size, lineno, fname);
-}
-
-void *MPIU_trstrdup(const char *str, int lineno, const char fname[])
-{
-    return MPL_trstrdup(str, lineno, fname);
-}

http://git.mpich.org/mpich.git/commitdiff/39d20ef64b48d27bb05a69d3305ae8ab510c960d

commit 39d20ef64b48d27bb05a69d3305ae8ab510c960d
Author: Pavan Balaji <balaji at anl.gov>
Date:   Sat Jan 23 00:18:14 2016 -0600

    mem: move memalloc thread lock code to MPL.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 3ef16ac..72ad697 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -590,7 +590,6 @@ extern MPID_Info MPID_Info_direct[];
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL || \
     MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
 extern MPID_Thread_mutex_t MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX;
-extern MPID_Thread_mutex_t MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX;
 #endif
 
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
diff --git a/src/include/mpimem.h b/src/include/mpimem.h
index 5a67c18..5d13d2c 100644
--- a/src/include/mpimem.h
+++ b/src/include/mpimem.h
@@ -85,7 +85,7 @@ typedef int MPIU_BOOL;
 
 /* ------------------------------------------------------------------------- */
 
-void MPIU_trinit(int);
+void MPIU_trinit(int, int);
 void *MPIU_trmalloc(size_t, int, const char []);
 void MPIU_trfree(void *, int, const char []);
 int MPIU_trvalid(const char []);
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 2baea92..894de82 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -169,7 +169,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL || \
     MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
 MPID_Thread_mutex_t MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX;
-MPID_Thread_mutex_t MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX;
 #endif
 
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
@@ -193,8 +192,6 @@ static int thread_cs_init( void )
 /* There is a single, global lock, held for the duration of an MPI call */
     MPID_Thread_mutex_create(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX, &err);
-    MPIU_Assert(err == 0);
 
 #elif MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
     /* MPICH_THREAD_GRANULARITY_PER_OBJECT: Multiple locks */
@@ -210,8 +207,6 @@ static int thread_cs_init( void )
     MPIU_Assert(err == 0);
     MPID_Thread_mutex_create(&MPIR_THREAD_POBJ_PMI_MUTEX, &err);
     MPIU_Assert(err == 0);
-    MPID_Thread_mutex_create(&MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX, &err);
-    MPIU_Assert(err == 0);
 
 #elif MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_LOCK_FREE
 /* Updates to shared data and access to shared services is handled without 
@@ -532,7 +527,7 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
     MPIU_Timer_init(MPIR_Process.comm_world->rank,
 		    MPIR_Process.comm_world->local_size);
 #ifdef USE_MEMORY_TRACING
-    MPIU_trinit( MPIR_Process.comm_world->rank );
+    MPIU_trinit( MPIR_Process.comm_world->rank, MPIR_ThreadInfo.isThreaded );
     /* Indicate that we are near the end of the init step; memory 
        allocated already will have an id of zero; this helps 
        separate memory leaks in the initialization code from 
diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index 2af0330..dd00b86 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -101,17 +101,6 @@ M*/
             per_thread->lock_depth++;                                   \
         }                                                               \
     } while (0)
-#define MPIDUI_THREAD_CS_ENTER_ALLGRAN(mutex)                           \
-    do {                                                                \
-        if (MPIR_ThreadInfo.isThreaded) {                               \
-            int err_ = 0;                                               \
-            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking ALLGRAN mutex"); \
-            MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_mutex_lock %p", &mutex); \
-            MPIDU_Thread_mutex_lock(&mutex, &err_);                     \
-            MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_mutex_lock %p", &mutex); \
-            MPIU_Assert(err_ == 0);                                     \
-        }                                                               \
-    } while (0)
 #define MPIDUI_THREAD_CS_ENTER_POBJ(mutex) do {} while (0)
 
 #else /* MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_POBJ */
@@ -127,7 +116,6 @@ M*/
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
-#define MPIDUI_THREAD_CS_ENTER_ALLGRAN  MPIDUI_THREAD_CS_ENTER_POBJ
 #define MPIDUI_THREAD_CS_ENTER_GLOBAL(mutex) do {} while (0)
 
 #endif  /* MPICH_THREAD_GRANULARITY */
@@ -135,7 +123,6 @@ M*/
 #else  /* !defined(MPICH_IS_THREADED) */
 
 #define MPIDUI_THREAD_CS_ENTER_GLOBAL(mutex) do {} while (0)
-#define MPIDUI_THREAD_CS_ENTER_ALLGRAN(mutex) do {} while (0)
 #define MPIDUI_THREAD_CS_ENTER_POBJ(mutex) do {} while (0)
 
 #endif /* MPICH_IS_THREADED */
@@ -176,16 +163,6 @@ M*/
         }                                                               \
     } while (0)
 
-#define MPIDUI_THREAD_CS_EXIT_ALLGRAN(mutex)                            \
-    do {                                                                \
-        if (MPIR_ThreadInfo.isThreaded) {                               \
-            int err_ = 0;                                               \
-            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking ALLGRAN mutex"); \
-            MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIDU_Thread_mutex_unlock %p", &mutex); \
-            MPIDU_Thread_mutex_unlock(&mutex, &err_);                   \
-            MPIU_Assert(err_ == 0);                                     \
-        }                                                               \
-    } while (0)
 #define MPIDUI_THREAD_CS_EXIT_POBJ(mutex) do {} while (0)
 
 #else /* MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_POBJ */
@@ -200,7 +177,6 @@ M*/
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
-#define MPIDUI_THREAD_CS_EXIT_ALLGRAN  MPIDUI_THREAD_CS_EXIT_POBJ
 #define MPIDUI_THREAD_CS_EXIT_GLOBAL(mutex) do {} while (0)
 
 #endif  /* MPICH_THREAD_GRANULARITY */
@@ -208,7 +184,6 @@ M*/
 #else  /* !defined(MPICH_IS_THREADED) */
 
 #define MPIDUI_THREAD_CS_EXIT_GLOBAL(mutex) do {} while (0)
-#define MPIDUI_THREAD_CS_EXIT_ALLGRAN(mutex) do {} while (0)
 #define MPIDUI_THREAD_CS_EXIT_POBJ(mutex) do {} while (0)
 
 #endif /* MPICH_IS_THREADED */
@@ -239,15 +214,6 @@ M*/
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
-#define MPIDUI_THREAD_CS_YIELD_ALLGRAN(mutex)                           \
-    do {                                                                \
-        if (MPIR_ThreadInfo.isThreaded) {                               \
-            int err_ = 0;                                               \
-            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding ALLGRAN mutex"); \
-            MPIDU_Thread_yield(&mutex, &err_);                          \
-            MPIU_Assert(err_ == 0);                                     \
-        }                                                               \
-    } while (0)
 #define MPIDUI_THREAD_CS_YIELD_POBJ(mutex) do {} while (0)
 
 #else /* MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_POBJ */
@@ -261,7 +227,6 @@ M*/
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
-#define MPIDUI_THREAD_CS_YIELD_ALLGRAN  MPIDUI_THREAD_CS_YIELD_POBJ
 #define MPIDUI_THREAD_CS_YIELD_GLOBAL(mutex) do {} while (0)
 
 #endif  /* MPICH_THREAD_GRANULARITY */
@@ -269,7 +234,6 @@ M*/
 #else  /* !defined(MPICH_IS_THREADED) */
 
 #define MPIDUI_THREAD_CS_YIELD_GLOBAL(mutex) do {} while (0)
-#define MPIDUI_THREAD_CS_YIELD_ALLGRAN(mutex) do {} while (0)
 #define MPIDUI_THREAD_CS_YIELD_POBJ(mutex) do {} while (0)
 
 #endif /* MPICH_IS_THREADED */
diff --git a/src/mpl/include/mpl_trmem.h b/src/mpl/include/mpl_trmem.h
index 6d7d7d0..f0d3602 100644
--- a/src/mpl/include/mpl_trmem.h
+++ b/src/mpl/include/mpl_trmem.h
@@ -11,7 +11,7 @@
    gcc - this lets gcc-style compilers know that the returned pointer
    does not alias any pointer prior to the call.
  */
-void MPL_trinit(int);
+void MPL_trinit(int, int);
 void *MPL_trmalloc(size_t, int, const char[]);
 void MPL_trfree(void *, int, const char[]);
 int MPL_trvalid(const char[]);
diff --git a/src/mpl/src/mem/mpl_trmem.c b/src/mpl/src/mem/mpl_trmem.c
index 8580902..01cb7f8 100644
--- a/src/mpl/src/mem/mpl_trmem.c
+++ b/src/mpl/src/mem/mpl_trmem.c
@@ -86,6 +86,39 @@ static volatile size_t TRMaxOverhead = 314572800;
 /* Used to limit allocation */
 static volatile size_t TRMaxMemAllow = 0;
 
+static int TR_is_threaded = 0;
+
+#if MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE
+
+static MPL_thread_mutex_t memalloc_mutex;
+
+#define TR_THREAD_CS_ENTER                                              \
+    do {                                                                \
+        if (TR_is_threaded) {                                           \
+            int err;                                                    \
+            MPL_thread_mutex_lock(&memalloc_mutex, &err);               \
+            if (err)                                                    \
+                MPL_error_printf("Error acquiring memalloc mutex lock\n"); \
+        }                                                               \
+    } while (0)
+
+#define TR_THREAD_CS_EXIT                                               \
+    do {                                                                \
+        if (TR_is_threaded) {                                           \
+            int err;                                                    \
+            MPL_thread_mutex_unlock(&memalloc_mutex, &err);             \
+            if (err)                                                    \
+                MPL_error_printf("Error releasing memalloc mutex lock\n"); \
+        }                                                               \
+    } while (0)
+
+#else  /* MPL_THREAD_PACKAGE_NAME == MPL_THREAD_PACKAGE_NONE */
+
+#define TR_THREAD_CS_ENTER
+#define TR_THREAD_CS_EXIT
+
+#endif  /* MPL_THREAD_PACKAGE_NAME */
+
 /*
  * Printing of addresses.
  *
@@ -130,7 +163,7 @@ static void addrToHex(void *addr, char string[MAX_ADDRESS_CHARS])
    MPL_trinit - Setup the space package.  Only needed for
    error messages and flags.
 +*/
-void MPL_trinit(int rank)
+void MPL_trinit(int rank, int need_thread_safety)
 {
     char *s;
 
@@ -163,6 +196,25 @@ void MPL_trinit(int rank)
         TRMaxOverhead = (size_t)l;
     }
 
+    /* If the upper layer asked for thread safety and there's no
+     * threading package available, we need to return an error. */
+#if MPL_THREAD_PACKAGE_NAME == MPL_THREAD_PACKAGE_NONE
+    if (need_thread_safety)
+        MPL_error_printf("No thread package to provide thread-safe memory allocation\n");
+#endif
+
+#if MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE
+    if (need_thread_safety) {
+        int err;
+
+        MPL_thread_mutex_create(&memalloc_mutex, &err);
+        if (err) {
+            MPL_error_printf("Error creating memalloc mutex\n");
+        }
+
+        TR_is_threaded = 1;
+    }
+#endif
 }
 
 /*+C
@@ -177,7 +229,7 @@ Input Parameters:
     double aligned pointer to requested storage, or null if not
     available.
  +*/
-void *MPL_trmalloc(size_t a, int lineno, const char fname[])
+static void *trmalloc(size_t a, int lineno, const char fname[])
 {
     TRSPACE *head;
     char *new = NULL;
@@ -272,6 +324,17 @@ void *MPL_trmalloc(size_t a, int lineno, const char fname[])
     return (void *) new;
 }
 
+void *MPL_trmalloc(size_t a, int lineno, const char fname[])
+{
+    void *retval;
+
+    TR_THREAD_CS_ENTER;
+    retval = trmalloc(a, lineno, fname);
+    TR_THREAD_CS_EXIT;
+
+    return retval;
+}
+
 /*+C
    MPL_trfree - Free with tracing
 
@@ -280,7 +343,7 @@ Input Parameters:
 .  line - line in file where called
 -  file - Name of file where called
  +*/
-void MPL_trfree(void *a_ptr, int line, const char file[])
+static void trfree(void *a_ptr, int line, const char file[])
 {
     TRSPACE *head;
     unsigned long *nend;
@@ -427,6 +490,13 @@ void MPL_trfree(void *a_ptr, int line, const char file[])
     free(head);
 }
 
+void MPL_trfree(void *a_ptr, int line, const char fname[])
+{
+    TR_THREAD_CS_ENTER;
+    trfree(a_ptr, line, fname);
+    TR_THREAD_CS_EXIT;
+}
+
 /*+C
    MPL_trvalid - test the allocated blocks for validity.  This can be used to
    check for memory overwrites.
@@ -454,7 +524,7 @@ $   Block at address %lx is corrupted
 
    No output is generated if there are no problems detected.
 +*/
-int MPL_trvalid( const char str[] )
+static int trvalid( const char str[] )
 {
     return MPL_trvalid2( str, -1, (const char *)0 );
 }
@@ -543,6 +613,15 @@ int MPL_trvalid2(const char str[], int line, const char file[] )
     return errs;
 }
 
+int MPL_trvalid(const char str[])
+{
+    int retval;
+    TR_THREAD_CS_ENTER;
+    retval = trvalid(str);
+    TR_THREAD_CS_EXIT;
+    return retval;
+}
+
 /*+C
   MPL_trdump - Dump the allocated memory blocks to a file
 
@@ -551,7 +630,7 @@ Input Parameters:
 -  minid - Only print allocated memory blocks whose id is at least 'minid'
 
  +*/
-void MPL_trdump(FILE * fp, int minid)
+static void trdump(FILE * fp, int minid)
 {
     TRSPACE *head;
 #ifdef VALGRIND_MAKE_MEM_NOACCESS
@@ -600,6 +679,13 @@ void MPL_trdump(FILE * fp, int minid)
  */
 }
 
+void MPL_trdump(FILE *fp, int minid)
+{
+    TR_THREAD_CS_ENTER;
+    trdump(fp, minid);
+    TR_THREAD_CS_EXIT;
+}
+
 /*+C
     MPL_trcalloc - Calloc with tracing
 
@@ -613,17 +699,26 @@ Input Parameters:
     Double aligned pointer to requested storage, or null if not
     available.
  +*/
-void *MPL_trcalloc(size_t nelem, size_t elsize, int lineno, const char fname[])
+static void *trcalloc(size_t nelem, size_t elsize, int lineno, const char fname[])
 {
     void *p;
 
-    p = MPL_trmalloc(nelem * elsize, lineno, fname);
+    p = trmalloc(nelem * elsize, lineno, fname);
     if (p) {
         memset(p, 0, nelem * elsize);
     }
     return p;
 }
 
+void *MPL_trcalloc(size_t nelem, size_t elsize, int lineno, const char fname[])
+{
+    void *retval;
+    TR_THREAD_CS_ENTER;
+    retval = trcalloc(nelem, elsize, lineno, fname);
+    TR_THREAD_CS_EXIT;
+    return retval;
+}
+
 /*+C
     MPL_trrealloc - Realloc with tracing
 
@@ -638,7 +733,7 @@ Input Parameters:
     available.  This implementation ALWAYS allocates new space and copies
     the contents into the new space.
  +*/
-void *MPL_trrealloc(void *p, size_t size, int lineno, const char fname[])
+static void *trrealloc(void *p, size_t size, int lineno, const char fname[])
 {
     void *pnew;
     size_t nsize;
@@ -665,18 +760,18 @@ void *MPL_trrealloc(void *p, size_t size, int lineno, const char fname[])
      * free().  We return NULL here because that is more likely to catch
      * programming errors at higher levels. */
     if (!size) {
-        MPL_trfree(p, lineno, fname);
+        trfree(p, lineno, fname);
         return NULL;
     }
 
-    pnew = MPL_trmalloc(size, lineno, fname);
+    pnew = trmalloc(size, lineno, fname);
 
     if (p && pnew) {
         nsize = size;
         if (head->size < nsize)
             nsize = head->size;
         memcpy(pnew, p, nsize);
-        MPL_trfree(p, lineno, fname);
+        trfree(p, lineno, fname);
     }
 
     /* Re-mark the head as NOACCESS before returning. */
@@ -690,6 +785,15 @@ void *MPL_trrealloc(void *p, size_t size, int lineno, const char fname[])
     return pnew;
 }
 
+void *MPL_trrealloc(void *p, size_t size, int lineno, const char fname[])
+{
+    void *retval;
+    TR_THREAD_CS_ENTER;
+    retval = trrealloc(p, size, lineno, fname);
+    TR_THREAD_CS_EXIT;
+    return retval;
+}
+
 /*+C
     MPL_trstrdup - Strdup with tracing
 
@@ -701,14 +805,23 @@ Input Parameters:
     Returns:
     Pointer to copy of the input string.
  +*/
-void *MPL_trstrdup(const char *str, int lineno, const char fname[])
+static void *trstrdup(const char *str, int lineno, const char fname[])
 {
     void *p;
     size_t len = strlen(str) + 1;
 
-    p = MPL_trmalloc(len, lineno, fname);
+    p = trmalloc(len, lineno, fname);
     if (p) {
         memcpy(p, str, len);
     }
     return p;
 }
+
+void *MPL_trstrdup(const char *str, int lineno, const char fname[])
+{
+    void *retval;
+    TR_THREAD_CS_ENTER;
+    retval = trstrdup(str, lineno, fname);
+    TR_THREAD_CS_EXIT;
+    return retval;
+}
diff --git a/src/pm/hydra/include/hydra.h b/src/pm/hydra/include/hydra.h
index c4bdfaf..e761f19 100644
--- a/src/pm/hydra/include/hydra.h
+++ b/src/pm/hydra/include/hydra.h
@@ -613,7 +613,7 @@ HYD_status HYDU_sock_cloexec(int fd);
 
 #if defined USE_MEMORY_TRACING
 
-#define HYDU_mem_init()  MPL_trinit(0)
+#define HYDU_mem_init()  MPL_trinit(0,0)
 
 #define HYDU_strdup(a) MPL_trstrdup(a,__LINE__,__FILE__)
 #ifdef strdup
diff --git a/src/util/mem/trmem.c b/src/util/mem/trmem.c
index 97520cb..f99e06f 100644
--- a/src/util/mem/trmem.c
+++ b/src/util/mem/trmem.c
@@ -10,66 +10,42 @@
  * have to be functions because we cannot portably wrap the calls as macros and
  * still use real (non-out-argument) return values. */
 
-void MPIU_trinit(int rank)
+void MPIU_trinit(int rank, int need_thread_safety)
 {
-    MPL_trinit(rank);
+    MPL_trinit(rank, need_thread_safety);
 }
 
 void MPIU_trdump(FILE *fp, int minid)
 {
-    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     MPL_trdump(fp, minid);
-    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
 }
 
 void *MPIU_trmalloc(size_t a, int lineno, const char fname[])
 {
-    void *retval;
-    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
-    retval = MPL_trmalloc(a, lineno, fname);
-    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
-    return retval;
+    return MPL_trmalloc(a, lineno, fname);
 }
 
 void MPIU_trfree(void *a_ptr, int line, const char fname[])
 {
-    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
     MPL_trfree(a_ptr, line, fname);
-    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
 }
 
 int MPIU_trvalid(const char str[])
 {
-    int retval;
-    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
-    retval = MPL_trvalid(str);
-    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
-    return retval;
+    return MPL_trvalid(str);
 }
 
 void *MPIU_trcalloc(size_t nelem, size_t elsize, int lineno, const char fname[])
 {
-    void *retval;
-    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
-    retval = MPL_trcalloc(nelem, elsize, lineno, fname);
-    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
-    return retval;
+    return MPL_trcalloc(nelem, elsize, lineno, fname);
 }
 
 void *MPIU_trrealloc(void *p, size_t size, int lineno, const char fname[])
 {
-    void *retval;
-    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
-    retval = MPL_trrealloc(p, size, lineno, fname);
-    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
-    return retval;
+    return MPL_trrealloc(p, size, lineno, fname);
 }
 
 void *MPIU_trstrdup(const char *str, int lineno, const char fname[])
 {
-    void *retval;
-    MPID_THREAD_CS_ENTER(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
-    retval = MPL_trstrdup(str, lineno, fname);
-    MPID_THREAD_CS_EXIT(ALLGRAN, MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX);
-    return retval;
+    return MPL_trstrdup(str, lineno, fname);
 }

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

commit e4335c2a117144d240b7e6dd559f6eebd00b47e3
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Jan 22 23:07:03 2016 -0600

    string: remove human readable token macros.
    
    These were added for smpd, which we no longer support.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/configure.ac b/configure.ac
index 5b82154..7a561e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,10 +54,6 @@ dnl    MPID_LIBTOOL_STATIC_FLAG - The static compilation flag to use
 dnl                               for the example executables within
 dnl                               mpich.  If not set, -static will be
 dnl                               used.
-dnl    PMI_REQUIRES_READABLE_TOKENS - if yes, define the C-preprocessor
-dnl                            value USE_HUMAN_READABLE_TOKENS, which is
-dnl                            used in src/include/mpimem.h to define token
-dnl                            separators used in src/util/mem/argstr.c
 dnl    PM_REQUIRES_PMI       - if set, provides the name of the PMI 
 dnl                            interface implementation.  If not set,
 dnl                            the "simple" PMI implementation is used.
@@ -1677,11 +1673,6 @@ fi
 pm_name=$first_pm_name
 AC_SUBST(pm_name)
 
-# Some versions of PM and PMI require a special definition
-if test "$PMI_REQUIRES_READABLE_TOKENS" = "yes" ; then
-    AC_DEFINE(USE_HUMAN_READABLE_TOKENS,1,[Define to use ='s and spaces in the string utilities.])
-fi
-
 # Step 2:
 # Once we've selected the process manager (or managers), we can
 # check that we have a compatible PMI implemenatation.
diff --git a/src/mpl/include/mpl_argstr.h b/src/mpl/include/mpl_argstr.h
index ed42210..78a4d60 100644
--- a/src/mpl/include/mpl_argstr.h
+++ b/src/mpl/include/mpl_argstr.h
@@ -23,19 +23,6 @@ extern MPL_DBG_Class MPIR_DBG_STRING;
 #define MPL_STR_NOMEM      2
 #define MPL_STR_TRUNCATED  3
 
-#ifdef MPL_USE_HUMAN_READABLE_TOKENS
-
-#define MPL_STR_QUOTE_CHAR     '\"'
-#define MPL_STR_QUOTE_STR      "\""
-#define MPL_STR_DELIM_CHAR     '='
-#define MPL_STR_DELIM_STR      "="
-#define MPL_STR_ESCAPE_CHAR    '\\'
-#define MPL_STR_HIDE_CHAR      '*'
-#define MPL_STR_SEPAR_CHAR     ' '
-#define MPL_STR_SEPAR_STR      " "
-
-#else
-
 #define MPL_STR_QUOTE_CHAR     '\"'
 #define MPL_STR_QUOTE_STR      "\""
 #define MPL_STR_DELIM_CHAR     '#'
@@ -45,8 +32,6 @@ extern MPL_DBG_Class MPIR_DBG_STRING;
 #define MPL_STR_SEPAR_CHAR     '$'
 #define MPL_STR_SEPAR_STR      "$"
 
-#endif
-
 int MPL_str_get_string_arg(const char *str, const char *key, char *val,
 			    int maxlen);
 int MPL_str_get_binary_arg(const char *str, const char *key, char *buffer,

http://git.mpich.org/mpich.git/commitdiff/29a65bf34a99fb21dc690f9d085b8392ef08f120

commit 29a65bf34a99fb21dc690f9d085b8392ef08f120
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Jan 22 21:06:07 2016 -0600

    string: move argstr to MPL.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/include/mpimem.h b/src/include/mpimem.h
index 2cc926e..5a67c18 100644
--- a/src/include/mpimem.h
+++ b/src/include/mpimem.h
@@ -80,54 +80,9 @@ extern MPL_DBG_Class MPIR_DBG_STRING;
 
 /* Define the string copy and duplication functions */
 /* ---------------------------------------------------------------------- */
-/* FIXME - The string routines do not belong in the memory header file  */
-/* FIXME - The string error code such be MPICH-usable error codes */
-#define MPIU_STR_SUCCESS    0
-#define MPIU_STR_FAIL      -1
-#define MPIU_STR_NOMEM      1
-
 /* FIXME: Global types like this need to be discussed and agreed to */
 typedef int MPIU_BOOL;
 
-/* FIXME: These should be scoped to only the routines that need them */
-#ifdef USE_HUMAN_READABLE_TOKENS
-
-#define MPIU_STR_QUOTE_CHAR     '\"'
-#define MPIU_STR_QUOTE_STR      "\""
-#define MPIU_STR_DELIM_CHAR     '='
-#define MPIU_STR_DELIM_STR      "="
-#define MPIU_STR_ESCAPE_CHAR    '\\'
-#define MPIU_STR_HIDE_CHAR      '*'
-#define MPIU_STR_SEPAR_CHAR     ' '
-#define MPIU_STR_SEPAR_STR      " "
-
-#else
-
-#define MPIU_STR_QUOTE_CHAR     '\"'
-#define MPIU_STR_QUOTE_STR      "\""
-#define MPIU_STR_DELIM_CHAR     '#'
-#define MPIU_STR_DELIM_STR      "#"
-#define MPIU_STR_ESCAPE_CHAR    '\\'
-#define MPIU_STR_HIDE_CHAR      '*'
-#define MPIU_STR_SEPAR_CHAR     '$'
-#define MPIU_STR_SEPAR_STR      "$"
-
-#endif
-
-int MPIU_Str_get_string_arg(const char *str, const char *key, char *val, 
-			    int maxlen);
-int MPIU_Str_get_binary_arg(const char *str, const char *key, char *buffer, 
-			    int maxlen, int *out_length);
-int MPIU_Str_get_int_arg(const char *str, const char *key, int *val_ptr);
-int MPIU_Str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *key, 
-			    const char *val);
-int MPIU_Str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *key, 
-			    const char *buffer, int length);
-int MPIU_Str_add_int_arg(char **str_ptr, int *maxlen_ptr, const char *key, 
-			 int val);
-int MPIU_Str_add_string(char **str_ptr, int *maxlen_ptr, const char *val);
-int MPIU_Str_get_string(char **str_ptr, char *val, int maxlen);
-
 /* ------------------------------------------------------------------------- */
 
 void MPIU_trinit(int);
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 313137e..e7fc2e1 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
@@ -223,15 +223,15 @@ int MPID_nem_mxm_finalize(void)
 int MPID_nem_mxm_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
 {
     int mpi_errno = MPI_SUCCESS;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
 
     MPIDI_STATE_DECL(MPID_STATE_MXM_GET_BUSINESS_CARD);
     MPIDI_FUNC_ENTER(MPID_STATE_MXM_GET_BUSINESS_CARD);
 
-    str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, MXM_MPICH_ENDPOINT_KEY,
+    str_errno = MPL_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) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
         MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
 
@@ -578,13 +578,13 @@ static int _mxm_connect(MPID_nem_mxm_ep_t * ep, const char *business_card,
                         MPID_nem_mxm_vc_area * vc_area)
 {
     int mpi_errno = MPI_SUCCESS;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
     mxm_error_t ret = MXM_OK;
     char mxm_ep_addr[MXM_MPICH_MAX_ADDR_SIZE];
     int len = 0;
 
     str_errno =
-        MPIU_Str_get_binary_arg(business_card, MXM_MPICH_ENDPOINT_KEY, mxm_ep_addr,
+        MPL_str_get_binary_arg(business_card, MXM_MPICH_ENDPOINT_KEY, mxm_ep_addr,
                                 sizeof(mxm_ep_addr), &len);
     MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**buscard");
 
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 86bd30f..e129a91 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
@@ -125,8 +125,8 @@ 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);
-    MPIR_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
+    ret = MPL_str_get_binary_arg(bc, "OFI", addr, gl_data.bound_addrlen, &len);
+    MPIR_ERR_CHKANDJUMP((ret != MPL_STR_SUCCESS && ret != MPL_STR_NOMEM) ||
                         (size_t) len != gl_data.bound_addrlen,
                         mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
@@ -409,8 +409,8 @@ 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);
-    MPIR_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
+    ret = MPL_str_get_binary_arg(bc, "OFI", addr, gl_data.bound_addrlen, &len);
+    MPIR_ERR_CHKANDJUMP((ret != MPL_STR_SUCCESS && ret != MPL_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);
@@ -538,14 +538,14 @@ int MPID_nem_ofi_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
         goto fn_fail;
     }
     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);
-    MPIR_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
+    ret = MPL_str_get_binary_arg(business_card, "OFI", addr, gl_data.bound_addrlen, &len);
+    MPIR_ERR_CHKANDJUMP((ret != MPL_STR_SUCCESS && ret != MPL_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);
+    str_errno = MPL_str_add_int_arg(&bc, &my_bc_len, "tag", new_vc->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;
@@ -594,14 +594,14 @@ int MPID_nem_ofi_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
 int MPID_nem_ofi_get_business_card(int my_rank ATTRIBUTE((unused)),
                                    char **bc_val_p, int *val_max_sz_p)
 {
-    int mpi_errno = MPI_SUCCESS, str_errno = MPIU_STR_SUCCESS;
+    int mpi_errno = MPI_SUCCESS, str_errno = MPL_STR_SUCCESS;
     BEGIN_FUNC(FCNAME);
-    str_errno = MPIU_Str_add_binary_arg(bc_val_p,
+    str_errno = MPL_str_add_binary_arg(bc_val_p,
                                         val_max_sz_p,
                                         "OFI",
                                         (char *) &gl_data.bound_addr, gl_data.bound_addrlen);
     if (str_errno) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_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_init.c b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c
index 7c445ac..058d134 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c
@@ -251,10 +251,10 @@ int MPID_nem_ofi_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
         sprintf(key, "OFI-%d", i);
 
         PMI_RC(PMI_KVS_Get(kvsname, key, bc, OFI_KVSAPPSTRLEN), pmi);
-        ret = MPIU_Str_get_binary_arg(bc, "OFI",
+        ret = MPL_str_get_binary_arg(bc, "OFI",
                                       (char *) &addrs[i * gl_data.bound_addrlen],
                                       gl_data.bound_addrlen, &len);
-        MPIR_ERR_CHKANDJUMP((ret != MPIU_STR_SUCCESS && ret != MPIU_STR_NOMEM) ||
+        MPIR_ERR_CHKANDJUMP((ret != MPL_STR_SUCCESS && ret != MPL_STR_NOMEM) ||
                             (size_t) len != gl_data.bound_addrlen,
                             mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
     }
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 114fbf6..3cbfbca 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
@@ -368,7 +368,7 @@ static int ptl_finalize(void)
 static int get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
 {
     int mpi_errno = MPI_SUCCESS;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
     int ret;
     ptl_process_t my_ptl_id;
     MPIDI_STATE_DECL(MPID_STATE_GET_BUSINESS_CARD);
@@ -380,49 +380,49 @@ static int get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
     MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_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));
+    str_errno = MPL_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) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_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));
+    str_errno = MPL_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) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_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));
+    str_errno = MPL_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) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_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,
+    str_errno = MPL_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) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_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,
+    str_errno = MPL_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) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_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,
+    str_errno = MPL_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) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_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,
+    str_errno = MPL_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) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_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,
+    str_errno = MPL_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) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
         MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
 
@@ -526,29 +526,29 @@ 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);
-    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(id->phys.nid), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    ret = MPL_str_get_binary_arg(business_card, NID_KEY, (char *)&id->phys.nid, sizeof(id->phys.nid), &len);
+    MPIR_ERR_CHKANDJUMP(ret != MPL_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);
-    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(id->phys.pid), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    ret = MPL_str_get_binary_arg(business_card, PID_KEY, (char *)&id->phys.pid, sizeof(id->phys.pid), &len);
+    MPIR_ERR_CHKANDJUMP(ret != MPL_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);
-    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*pt), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    ret = MPL_str_get_binary_arg(business_card, PTI_KEY, (char *)pt, sizeof(*pt), &len);
+    MPIR_ERR_CHKANDJUMP(ret != MPL_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);
-    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptg), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    ret = MPL_str_get_binary_arg(business_card, PTIG_KEY, (char *)ptg, sizeof(*ptg), &len);
+    MPIR_ERR_CHKANDJUMP(ret != MPL_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);
-    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptc), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    ret = MPL_str_get_binary_arg(business_card, PTIC_KEY, (char *)ptc, sizeof(*ptc), &len);
+    MPIR_ERR_CHKANDJUMP(ret != MPL_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);
-    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptr), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    ret = MPL_str_get_binary_arg(business_card, PTIR_KEY, (char *)ptr, sizeof(*ptr), &len);
+    MPIR_ERR_CHKANDJUMP(ret != MPL_STR_SUCCESS || len != sizeof(*ptr), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
-    ret = MPIU_Str_get_binary_arg(business_card, PTIRG_KEY, (char *)ptrg, sizeof(*ptrg), &len);
-    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptrg), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    ret = MPL_str_get_binary_arg(business_card, PTIRG_KEY, (char *)ptrg, sizeof(*ptrg), &len);
+    MPIR_ERR_CHKANDJUMP(ret != MPL_STR_SUCCESS || len != sizeof(*ptrg), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
 
-    ret = MPIU_Str_get_binary_arg(business_card, PTIRC_KEY, (char *)ptrc, sizeof(*ptrc), &len);
-    MPIR_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*ptrc), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
+    ret = MPL_str_get_binary_arg(business_card, PTIRC_KEY, (char *)ptrc, sizeof(*ptrc), &len);
+    MPIR_ERR_CHKANDJUMP(ret != MPL_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);
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 2d97aad..d3f5199 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
@@ -411,7 +411,7 @@ fn_fail:
 int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p)
 {
     int mpi_errno = MPI_SUCCESS;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
     MPIDU_Sock_ifaddr_t ifaddr;
     char ifname[MAX_HOST_DESCRIPTION_LEN];
     int ret;
@@ -425,9 +425,9 @@ int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_s
     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);
+    str_errno = MPL_str_add_string_arg(bc_val_p, val_max_sz_p, MPIDI_CH3I_HOST_DESCRIPTION_KEY, ifname);
     if (str_errno) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
         MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
 
@@ -435,9 +435,9 @@ int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_s
     ret = getsockname (MPID_nem_tcp_g_lstn_sc.fd, (struct sockaddr *)&sock_id, &len);
     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));
+    str_errno = MPL_str_add_int_arg (bc_val_p, val_max_sz_p, MPIDI_CH3I_PORT_KEY, ntohs(sock_id.sin_port));
     if (str_errno) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
         MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
     
@@ -447,9 +447,9 @@ int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_s
         p = (unsigned char *)(ifaddr.ifaddr);
         MPL_snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u", p[0], p[1], p[2], p[3] );
         MPL_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"ifname = %s",ifname );
-        str_errno = MPIU_Str_add_string_arg(bc_val_p, val_max_sz_p, MPIDI_CH3I_IFNAME_KEY, ifname);
+        str_errno = MPL_str_add_string_arg(bc_val_p, val_max_sz_p, MPIDI_CH3I_IFNAME_KEY, ifname);
         if (str_errno) {
-            MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+            MPIR_ERR_CHKANDJUMP(str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
             MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
         }
     }
@@ -582,21 +582,21 @@ 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));
-    MPIR_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missinghost");
+    ret = MPL_str_get_string_arg (business_card, MPIDI_CH3I_HOST_DESCRIPTION_KEY, desc_str, sizeof(desc_str));
+    MPIR_ERR_CHKANDJUMP (ret != MPL_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missinghost");
     */
 
     /* sizeof(in_port_t) != sizeof(int) on most platforms, so we need to use
-     * port_int as the arg to MPIU_Str_get_int_arg. */
-    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
+     * port_int as the arg to MPL_str_get_int_arg. */
+    ret = MPL_str_get_int_arg (business_card, MPIDI_CH3I_PORT_KEY, &port_int);
+    /* MPL_STR_FAIL is not a valid MPI error code so we store the result in ret
      * instead of mpi_errno. */
-    MPIR_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missingport");
+    MPIR_ERR_CHKANDJUMP (ret != MPL_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));
-    MPIR_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missingifname");
+    ret = MPL_str_get_string_arg(business_card, MPIDI_CH3I_IFNAME_KEY, ifname, sizeof(ifname));
+    MPIR_ERR_CHKANDJUMP (ret != MPL_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missingifname");
 
     ret = inet_pton (AF_INET, (const char *)ifname, addr);
     MPIR_ERR_CHKANDJUMP(ret == 0, mpi_errno,MPI_ERR_OTHER,"**ifnameinvalid");
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 876575e..4d83682 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
@@ -348,21 +348,21 @@ MPID_nem_mpich_serialize_win (void *buf, int buf_len, MPID_nem_mpich_win_t *win,
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MPICH_SERIALIZE_WIN);
 
     handle_len = strlen (win->handle);
-    str_errno = MPIU_Str_add_int_arg (&b, &bl, WIN_HANLEN_KEY, handle_len);
-    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);
-    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);
-    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));
-    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);
-    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 = MPL_str_add_int_arg (&b, &bl, WIN_HANLEN_KEY, handle_len);
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
+    str_errno = MPL_str_add_string_arg(&b, &bl, WIN_HANDLE_KEY, win->handle);
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
+    str_errno = MPL_str_add_int_arg (&b, &bl, WIN_PROC_KEY, win->proc);
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
+    str_errno = MPL_str_add_binary_arg (&b, &bl, WIN_HOME_ADDR_KEY, win->home_address, sizeof (win->home_address));
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
+    str_errno = MPL_str_add_int_arg (&b, &bl, WIN_LEN_KEY, win->len);
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**winserialize");
 
     *len = buf_len - bl;
 
@@ -392,23 +392,23 @@ 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);
-    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 = MPL_str_get_int_arg (b, WIN_HANLEN_KEY, &handle_len);
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_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);
-    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);
-    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);
-    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);
-    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 = MPL_str_get_string_arg(b, WIN_HANDLE_KEY, (*win)->handle, handle_len);
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**windeserialize");
+    str_errno = MPL_str_get_int_arg (b, WIN_PROC_KEY, &(*win)->proc);
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**windeserialize");
+    str_errno = MPL_str_get_binary_arg (b, WIN_HOME_ADDR_KEY, (char *)&(*win)->home_address, sizeof ((*win)->home_address), &ol);
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_FAIL || ol != sizeof ((*win)->home_address), mpi_errno, MPI_ERR_OTHER, "**windeserialize");
+    str_errno = MPL_str_get_int_arg (b, WIN_LEN_KEY, &(*win)->len);
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**nomem");
+    MPIR_ERR_CHKANDJUMP (str_errno == MPL_STR_FAIL, mpi_errno, MPI_ERR_OTHER, "**windeserialize");
 
     (*win)->local_address = 0;
 
diff --git a/src/mpid/ch3/src/ch3u_port.c b/src/mpid/ch3/src/ch3u_port.c
index c09daf8..003fea1 100644
--- a/src/mpid/ch3/src/ch3u_port.c
+++ b/src/mpid/ch3/src/ch3u_port.c
@@ -136,7 +136,7 @@ static int MPIDI_Create_inter_root_communicator_connect(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) {
+    if (mpi_errno != MPL_STR_SUCCESS) {
 	MPIR_ERR_POP(mpi_errno);
     }
 
@@ -177,7 +177,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) {
+    if (mpi_errno != MPL_STR_SUCCESS) {
 	MPIR_ERR_POP(mpi_errno);
     }
 
diff --git a/src/mpid/ch3/src/mpid_port.c b/src/mpid/ch3/src/mpid_port.c
index 9c4ea0f..9069996 100644
--- a/src/mpid/ch3/src/mpid_port.c
+++ b/src/mpid/ch3/src/mpid_port.c
@@ -284,7 +284,7 @@ static void free_port_name_tag(int tag)
 static int MPIDI_Open_port(MPID_Info *info_ptr, char *port_name)
 {
     int mpi_errno = MPI_SUCCESS;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
     int len;
     int port_name_tag = 0; /* this tag is added to the business card,
                               which is then returned as the port name */
@@ -297,11 +297,11 @@ static int MPIDI_Open_port(MPID_Info *info_ptr, char *port_name)
     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,
+    str_errno = MPL_str_add_int_arg(&port_name, &len,
                                      MPIDI_CH3I_PORT_NAME_TAG_KEY, 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 
+    /* This works because Get_business_card uses the same MPL_str_xxx
        functions as above to add the business card to the input string */
     /* FIXME: We should instead ask the mpid_pg routines to give us
        a connection string. There may need to be a separate step to 
@@ -353,9 +353,9 @@ fn_fail:
 int MPIDI_GetTagFromPort( const char *port_name, int *port_name_tag )
 {
     int mpi_errno = MPI_SUCCESS;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
 
-    str_errno = MPIU_Str_get_int_arg(port_name, MPIDI_CH3I_PORT_NAME_TAG_KEY,
+    str_errno = MPL_str_get_int_arg(port_name, MPIDI_CH3I_PORT_NAME_TAG_KEY,
                                      port_name_tag);
     MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**argstr_no_port_name_tag");
 
diff --git a/src/mpid/ch3/util/sock/ch3u_connect_sock.c b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
index 518a7c9..3eda03f 100644
--- a/src/mpid/ch3/util/sock/ch3u_connect_sock.c
+++ b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
@@ -243,7 +243,7 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
 	MPIR_ERR_POP(mpi_errno);
     }
     mpi_errno = MPIDI_GetTagFromPort(port_name, &port_name_tag);
-    if (mpi_errno != MPIU_STR_SUCCESS) {
+    if (mpi_errno != MPL_STR_SUCCESS) {
 	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_port_name_tag");
     }
 
@@ -346,27 +346,27 @@ int MPIDU_Sock_get_conninfo_from_bc( const char *bc,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDU_SOCK_GET_CONNINFO_FROM_BC);
 
-    str_errno = MPIU_Str_get_string_arg(bc, MPIDI_CH3I_HOST_DESCRIPTION_KEY, 
+    str_errno = MPL_str_get_string_arg(bc, MPIDI_CH3I_HOST_DESCRIPTION_KEY,
 				 host_description, maxlen);
-    if (str_errno != MPIU_STR_SUCCESS) {
+    if (str_errno != MPL_STR_SUCCESS) {
 	/* --BEGIN ERROR HANDLING */
-	if (str_errno == MPIU_STR_FAIL) {
+	if (str_errno == MPL_STR_FAIL) {
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**argstr_missinghost");
 	}
 	else {
-	    /* MPIU_STR_TRUNCATED or MPIU_STR_NONEM */
+	    /* MPL_STR_TRUNCATED or MPL_STR_NONEM */
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_hostd");
 	}
 	/* --END ERROR HANDLING-- */
     }
-    str_errno = MPIU_Str_get_int_arg(bc, MPIDI_CH3I_PORT_KEY, port);
-    if (str_errno != MPIU_STR_SUCCESS) {
+    str_errno = MPL_str_get_int_arg(bc, MPIDI_CH3I_PORT_KEY, port);
+    if (str_errno != MPL_STR_SUCCESS) {
 	/* --BEGIN ERROR HANDLING */
-	if (str_errno == MPIU_STR_FAIL) {
+	if (str_errno == MPL_STR_FAIL) {
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_missingport");
 	}
 	else {
-	    /* MPIU_STR_TRUNCATED or MPIU_STR_NONEM */
+	    /* MPL_STR_TRUNCATED or MPL_STR_NONEM */
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_port");
 	}
 	/* --END ERROR HANDLING-- */
@@ -381,9 +381,9 @@ int MPIDU_Sock_get_conninfo_from_bc( const char *bc,
        be identified or written.  See also channels/sock/ch3_progress.c */
     *hasIfaddr = 0;
 #if !defined(HAVE_WINDOWS_H) && defined(HAVE_INET_PTON)
-    str_errno = MPIU_Str_get_string_arg(bc, MPIDI_CH3I_IFNAME_KEY, 
+    str_errno = MPL_str_get_string_arg(bc, MPIDI_CH3I_IFNAME_KEY,
 					ifname, sizeof(ifname) );
-    if (str_errno == MPIU_STR_SUCCESS) {
+    if (str_errno == MPL_STR_SUCCESS) {
 	/* Convert ifname into 4-byte ip address */
 	/* Use AF_INET6 for IPv6 (inet_pton may still be used).
 	   An address with more than 3 :'s is an IPv6 address */
@@ -432,7 +432,7 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 				      char **bc_val_p, int *val_max_sz_p)
 {
     int mpi_errno = MPI_SUCCESS;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
     MPIDU_Sock_ifaddr_t ifaddr;
     char ifnamestr[MAX_HOST_DESCRIPTION_LEN];
     char *bc_orig = *bc_val_p;
@@ -442,17 +442,17 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 
     MPIDU_CH3U_GetSockInterfaceAddr( myRank, ifnamestr, sizeof(ifnamestr), &ifaddr );
 
-    str_errno = MPIU_Str_add_int_arg(bc_val_p, val_max_sz_p,
+    str_errno = MPL_str_add_int_arg(bc_val_p, val_max_sz_p,
                                      MPIDI_CH3I_PORT_KEY, MPIDI_CH3I_listener_port);
     if (str_errno) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_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,
+    str_errno = MPL_str_add_string_arg(bc_val_p, val_max_sz_p,
                                         MPIDI_CH3I_HOST_DESCRIPTION_KEY, ifnamestr );
     if (str_errno) {
-        MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIR_ERR_CHKANDJUMP(str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
         MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
     }
 
@@ -482,12 +482,12 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 	    MPL_snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u", 
 			   p[0], p[1], p[2], p[3] );
 	    MPL_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"ifname = %s",ifname );
-	    str_errno = MPIU_Str_add_string_arg( bc_val_p,
+	    str_errno = MPL_str_add_string_arg( bc_val_p,
 						 val_max_sz_p,
 						 MPIDI_CH3I_IFNAME_KEY,
 						 ifname );
             if (str_errno) {
-                MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+                MPIR_ERR_CHKANDJUMP(str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
                 MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
             }
 	}
@@ -503,12 +503,12 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 	    MPL_snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u", 
 			   p[0], p[1], p[2], p[3] );
 	    MPL_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"ifname = %s",ifname );
-	    str_errno = MPIU_Str_add_string_arg( bc_val_p,
+	    str_errno = MPL_str_add_string_arg( bc_val_p,
 						 val_max_sz_p,
 						 MPIDI_CH3I_IFNAME_KEY,
 						 ifname );
             if (str_errno) {
-                MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+                MPIR_ERR_CHKANDJUMP(str_errno == MPL_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
                 MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
             }
 	}
diff --git a/src/mpid/common/sock/iocp/sock.c b/src/mpid/common/sock/iocp/sock.c
index e25c914..4a86cc2 100644
--- a/src/mpid/common/sock/iocp/sock.c
+++ b/src/mpid/common/sock/iocp/sock.c
@@ -670,7 +670,7 @@ static int socki_get_host_list(char *hostname, socki_host_name_t **listp)
 int MPIDU_Sock_hostname_to_host_description(char *hostname, char *host_description, int len)
 {
     int mpi_errno = MPI_SUCCESS;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
     socki_host_name_t *iter, *list = NULL;
     MPIDI_STATE_DECL(MPID_STATE_MPIDU_SOCK_HOSTNAME_TO_HOST_DESCRIPTION);
 
@@ -693,7 +693,7 @@ int MPIDU_Sock_hostname_to_host_description(char *hostname, char *host_descripti
     while (iter)
     {
         MPL_DBG_MSG_S(MPIR_DBG_OTHER,TERSE,"adding host: %s\n", iter->host);
-        str_errno = MPIU_Str_add_string(&host_description, &len, iter->host);
+        str_errno = MPL_str_add_string(&host_description, &len, iter->host);
         MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPIDU_SOCK_ERR_NOMEM, "**desc_len");
 
         iter = iter->next;
@@ -1126,7 +1126,7 @@ static unsigned int GetMask(char *pszMask)
 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;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
     struct hostent *lphost;
     struct sockaddr_in sockAddr;
     sock_state_t *connect_state;
@@ -1193,11 +1193,11 @@ int MPIDU_Sock_post_connect(MPIDU_Sock_set_t set, void * user_ptr, char * host_d
     while (!connected)
     {
 	host[0] = '\0';
-	str_errno = MPIU_Str_get_string(&connect_state->cur_host, host, 100);
+	str_errno = MPL_str_get_string(&connect_state->cur_host, host, 100);
 	/*printf("got <%s> out of <%s>\n", host, connect_state->host_description);fflush(stdout);*/
-	if (str_errno != MPIU_STR_SUCCESS)
+	if (str_errno != MPL_STR_SUCCESS)
 	{
-	    if (str_errno == MPIU_STR_NOMEM)
+	    if (str_errno == MPL_STR_NOMEM)
 		mpi_errno = MPIR_Err_create_code(connect_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPIDU_SOCK_ERR_NOMEM, "**nomem", 0);
 	    else
 		mpi_errno = MPIR_Err_create_code(connect_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPIDU_SOCK_ERR_FAIL, "**fail", "**fail %d", mpi_errno);
diff --git a/src/mpid/pamid/src/dyntask/mpid_port.c b/src/mpid/pamid/src/dyntask/mpid_port.c
index e6f8810..27d6331 100644
--- a/src/mpid/pamid/src/dyntask/mpid_port.c
+++ b/src/mpid/pamid/src/dyntask/mpid_port.c
@@ -227,7 +227,7 @@ static void MPIDI_free_port_name_tag(int tag)
 static int MPIDI_Open_port(MPID_Info *info_ptr, char *port_name)
 {
     int mpi_errno = MPI_SUCCESS;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
     int len;
     int port_name_tag = 0; /* this tag is added to the business card,
                               which is then returned as the port name */
@@ -238,15 +238,15 @@ static int MPIDI_Open_port(MPID_Info *info_ptr, char *port_name)
     TRACE_ERR("MPIDI_get_port_name_tag - port_name_tag=%d mpi_errno=%d\n", port_name_tag, mpi_errno);
 
     len = MPI_MAX_PORT_NAME;
-    str_errno = MPIU_Str_add_int_arg(&port_name, &len,
+    str_errno = MPL_str_add_int_arg(&port_name, &len,
                                      MPIDI_PORT_NAME_TAG_KEY, port_name_tag);
     /*len = MPI_MAX_TASKID_NAME;*/
     taskid_tag = PAMIX_Client_query(MPIDI_Client, PAMI_CLIENT_TASK_ID  ).value.intval;
-    str_errno = MPIU_Str_add_int_arg(&port_name, &len,
+    str_errno = MPL_str_add_int_arg(&port_name, &len,
                                      MPIDI_TASKID_TAG_KEY, taskid_tag);
-    TRACE_ERR("MPIU_Str_add_int_arg - port_name=%s str_errno=%d\n", port_name, str_errno);
+    TRACE_ERR("MPL_str_add_int_arg - port_name=%s str_errno=%d\n", port_name, str_errno);
 
-    /* This works because Get_business_card uses the same MPIU_Str_xxx
+    /* This works because Get_business_card uses the same MPL_str_xxx
        functions as above to add the business card to the input string */
     /* FIXME: We should instead ask the mpid_pg routines to give us
        a connection string. There may need to be a separate step to
@@ -286,9 +286,9 @@ fn_fail:
 int MPIDI_GetTagFromPort( const char *port_name, int *port_name_tag )
 {
     int mpi_errno = MPI_SUCCESS;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
 
-    str_errno = MPIU_Str_get_int_arg(port_name, MPIDI_PORT_NAME_TAG_KEY,
+    str_errno = MPL_str_get_int_arg(port_name, MPIDI_PORT_NAME_TAG_KEY,
                                      port_name_tag);
 
  fn_exit:
@@ -304,9 +304,9 @@ int MPIDI_GetTagFromPort( const char *port_name, int *port_name_tag )
 int MPIDI_GetTaskidFromPort( const char *port_name, int *taskid_tag )
 {
     int mpi_errno = MPI_SUCCESS;
-    int str_errno = MPIU_STR_SUCCESS;
+    int str_errno = MPL_STR_SUCCESS;
 
-    str_errno = MPIU_Str_get_int_arg(port_name, MPIDI_TASKID_TAG_KEY,
+    str_errno = MPL_str_get_int_arg(port_name, MPIDI_TASKID_TAG_KEY,
                                      taskid_tag);
 
  fn_exit:
diff --git a/src/mpid/pamid/src/dyntask/mpidi_port.c b/src/mpid/pamid/src/dyntask/mpidi_port.c
index fe69aca..3e2a2b9 100644
--- a/src/mpid/pamid/src/dyntask/mpidi_port.c
+++ b/src/mpid/pamid/src/dyntask/mpidi_port.c
@@ -240,11 +240,11 @@ int MPIDI_Connect_to_root(const char * port_name,
     TRACE_ERR("MPIDI_Connect_to_root - vc->taskid=%d\n", vc->taskid);
 
     mpi_errno = MPIDI_GetTagFromPort(port_name, &port_name_tag);
-    if (mpi_errno != MPIU_STR_SUCCESS) {
+    if (mpi_errno != MPL_STR_SUCCESS) {
       TRACE_ERR("MPIDI_GetTagFromPort returned with mpi_errno=%d", mpi_errno);
     }
     mpi_errno = MPIDI_GetTaskidFromPort(port_name, &taskid_tag);
-    if (mpi_errno != MPIU_STR_SUCCESS) {
+    if (mpi_errno != MPL_STR_SUCCESS) {
       TRACE_ERR("MPIDI_GetTaskidFromPort returned with mpi_errno=%d", mpi_errno);
     }
 
@@ -289,12 +289,12 @@ static int MPIDI_Create_inter_root_communicator_connect(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) {
+    if (mpi_errno != MPL_STR_SUCCESS) {
 	TRACE_ERR("MPIDI_GetTagFromPort returned with mpi_errno=%d\n", mpi_errno);
     }
 
     mpi_errno = MPIDI_GetTaskidFromPort(port_name, &taskid_tag);
-    if (mpi_errno != MPIU_STR_SUCCESS) {
+    if (mpi_errno != MPL_STR_SUCCESS) {
 	TRACE_ERR("MPIDI_GetTaskidFromPort returned with mpi_errno=%d\n", mpi_errno);
     }
     connect_vc->taskid=taskid_tag;
@@ -328,7 +328,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) {
+    if (mpi_errno != MPL_STR_SUCCESS) {
 	TRACE_ERR("MPIDI_GetTagFromPort returned with mpi_errnp=%d\n", mpi_errno);
     }
 
diff --git a/src/mpl/include/mpl.h b/src/mpl/include/mpl.h
index 0dccfee..d53e033 100644
--- a/src/mpl/include/mpl.h
+++ b/src/mpl/include/mpl.h
@@ -10,6 +10,7 @@
 #include "mpl_base.h"
 /* must come before mpltrmem.h */
 #include "mpl_valgrind.h"
+#include "mpl_argstr.h"
 #include "mpl_str.h"
 #include "mpl_trmem.h"
 #include "mpl_env.h"
diff --git a/src/mpl/include/mpl_argstr.h b/src/mpl/include/mpl_argstr.h
new file mode 100644
index 0000000..ed42210
--- /dev/null
+++ b/src/mpl/include/mpl_argstr.h
@@ -0,0 +1,64 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#ifndef MPL_ARGSTR_H_INCLUDED
+#define MPL_ARGSTR_H_INCLUDED
+
+#include "mplconfig.h"
+
+/* Make sure that we have the definitions for the malloc routines and size_t */
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpl_dbg.h"
+
+#if defined (MPL_USE_DBG_LOGGING)
+extern MPL_DBG_Class MPIR_DBG_STRING;
+#endif /* MPL_USE_DBG_LOGGING */
+
+#define MPL_STR_SUCCESS    0
+#define MPL_STR_FAIL       1
+#define MPL_STR_NOMEM      2
+#define MPL_STR_TRUNCATED  3
+
+#ifdef MPL_USE_HUMAN_READABLE_TOKENS
+
+#define MPL_STR_QUOTE_CHAR     '\"'
+#define MPL_STR_QUOTE_STR      "\""
+#define MPL_STR_DELIM_CHAR     '='
+#define MPL_STR_DELIM_STR      "="
+#define MPL_STR_ESCAPE_CHAR    '\\'
+#define MPL_STR_HIDE_CHAR      '*'
+#define MPL_STR_SEPAR_CHAR     ' '
+#define MPL_STR_SEPAR_STR      " "
+
+#else
+
+#define MPL_STR_QUOTE_CHAR     '\"'
+#define MPL_STR_QUOTE_STR      "\""
+#define MPL_STR_DELIM_CHAR     '#'
+#define MPL_STR_DELIM_STR      "#"
+#define MPL_STR_ESCAPE_CHAR    '\\'
+#define MPL_STR_HIDE_CHAR      '*'
+#define MPL_STR_SEPAR_CHAR     '$'
+#define MPL_STR_SEPAR_STR      "$"
+
+#endif
+
+int MPL_str_get_string_arg(const char *str, const char *key, char *val,
+			    int maxlen);
+int MPL_str_get_binary_arg(const char *str, const char *key, char *buffer,
+			    int maxlen, int *out_length);
+int MPL_str_get_int_arg(const char *str, const char *key, int *val_ptr);
+int MPL_str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *key,
+			    const char *val);
+int MPL_str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *key,
+			    const char *buffer, int length);
+int MPL_str_add_int_arg(char **str_ptr, int *maxlen_ptr, const char *key,
+			 int val);
+int MPL_str_add_string(char **str_ptr, int *maxlen_ptr, const char *val);
+int MPL_str_get_string(char **str_ptr, char *val, int maxlen);
+
+#endif
diff --git a/src/mpl/src/str/Makefile.mk b/src/mpl/src/str/Makefile.mk
index c4177b8..84c652f 100644
--- a/src/mpl/src/str/Makefile.mk
+++ b/src/mpl/src/str/Makefile.mk
@@ -4,4 +4,4 @@
 #     See COPYRIGHT in top-level directory.
 #
 
-lib at MPLLIBNAME@_la_SOURCES += src/str/mpl_str.c
+lib at MPLLIBNAME@_la_SOURCES += src/str/mpl_str.c src/str/mpl_argstr.c
diff --git a/src/util/mem/argstr.c b/src/mpl/src/str/mpl_argstr.c
similarity index 70%
rename from src/util/mem/argstr.c
rename to src/mpl/src/str/mpl_argstr.c
index e8c63f4..96366fa 100644
--- a/src/util/mem/argstr.c
+++ b/src/mpl/src/str/mpl_argstr.c
@@ -4,28 +4,15 @@
  *   See COPYRIGHT notice in top-level directory.
  */
 
-#include "mpichconf.h"
-#include "mpimem.h"
 #include "mpl.h"
 
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_MATH_H
+#ifdef MPL_HAVE_MATH_H
 #include <math.h>
 #endif
 /* ctype is needed for isspace and isascii (isspace is only defined for 
    values on which isascii returns true). */
 #include <ctype.h>
 
-#define MPIU_STR_TRUNCATED MPIU_STR_NOMEM
-
 static int encode_buffer(char *dest, int dest_length, const char *src, 
 			 int src_length, int *num_encoded)
 {
@@ -35,17 +22,17 @@ static int encode_buffer(char *dest, int dest_length, const char *src,
     {
 	if (dest_length > 2)
 	{
-	    *dest = MPIU_STR_QUOTE_CHAR;
+	    *dest = MPL_STR_QUOTE_CHAR;
 	    dest++;
-	    *dest = MPIU_STR_QUOTE_CHAR;
+	    *dest = MPL_STR_QUOTE_CHAR;
 	    dest++;
 	    *dest = '\0';
 	    *num_encoded = 0;
-	    return MPIU_STR_SUCCESS;
+	    return MPL_STR_SUCCESS;
 	}
 	else
 	{
-	    return MPIU_STR_TRUNCATED;
+	    return MPL_STR_TRUNCATED;
 	}
     }
     while (src_length && dest_length)
@@ -55,7 +42,7 @@ static int encode_buffer(char *dest, int dest_length, const char *src,
 	if (num_used < 0)
 	{
 	    *num_encoded = n;
-	    return MPIU_STR_TRUNCATED;
+	    return MPL_STR_TRUNCATED;
 	}
 	/*MPL_DBG_MSG_FMT(STRING,VERBOSE,(MPL_DBG_FDEST," %c = %c%c",
 	  ch, dest[0], dest[1]));*/
@@ -66,7 +53,7 @@ static int encode_buffer(char *dest, int dest_length, const char *src,
 	src_length--;
     }
     *num_encoded = n;
-    return src_length ? MPIU_STR_TRUNCATED : MPIU_STR_SUCCESS;
+    return src_length ? MPL_STR_TRUNCATED : MPL_STR_SUCCESS;
 }
 
 static int decode_buffer(const char *str, char *dest, int length, 
@@ -77,20 +64,20 @@ static int decode_buffer(const char *str, char *dest, int length,
     int n = 0;
 
     if (str == NULL || dest == NULL || num_decoded == NULL)
-	return MPIU_STR_FAIL;
+	return MPL_STR_FAIL;
     if (length < 1)
     {
 	*num_decoded = 0;
 	if (*str == '\0')
-	    return MPIU_STR_SUCCESS;
-	return MPIU_STR_TRUNCATED;
+	    return MPL_STR_SUCCESS;
+	return MPL_STR_TRUNCATED;
     }
-    if (*str == MPIU_STR_QUOTE_CHAR)
+    if (*str == MPL_STR_QUOTE_CHAR)
 	str++;
     hex[2] = '\0';
     while (*str != '\0' &&
-	   *str != MPIU_STR_SEPAR_CHAR &&
-	   *str != MPIU_STR_QUOTE_CHAR &&
+	   *str != MPL_STR_SEPAR_CHAR &&
+	   *str != MPL_STR_QUOTE_CHAR &&
 	   length)
     {
 	hex[0] = *str;
@@ -109,11 +96,11 @@ static int decode_buffer(const char *str, char *dest, int length,
     if (length == 0)
     {
 	if (*str != '\0' &&
-	    *str != MPIU_STR_SEPAR_CHAR &&
-	    *str != MPIU_STR_QUOTE_CHAR)
-	    return MPIU_STR_TRUNCATED;
+	    *str != MPL_STR_SEPAR_CHAR &&
+	    *str != MPL_STR_QUOTE_CHAR)
+	    return MPL_STR_TRUNCATED;
     }
-    return MPIU_STR_SUCCESS;
+    return MPL_STR_SUCCESS;
 }
 
 static const char * first_token(const char *str)
@@ -121,7 +108,7 @@ static const char * first_token(const char *str)
     if (str == NULL)
 	return NULL;
     /* isspace is defined only if isascii is true */
-    while (/*isascii(*str) && isspace(*str)*/ *str == MPIU_STR_SEPAR_CHAR)
+    while (/*isascii(*str) && isspace(*str)*/ *str == MPL_STR_SEPAR_CHAR)
 	str++;
     if (*str == '\0')
 	return NULL;
@@ -135,19 +122,19 @@ static const char * next_token(const char *str)
     str = first_token(str);
     if (str == NULL)
 	return NULL;
-    if (*str == MPIU_STR_QUOTE_CHAR)
+    if (*str == MPL_STR_QUOTE_CHAR)
     {
 	/* move over string */
 	str++; /* move over the first quote */
 	if (*str == '\0')
 	    return NULL;
-	while (*str != MPIU_STR_QUOTE_CHAR)
+	while (*str != MPL_STR_QUOTE_CHAR)
 	{
 	    /* move until the last quote, ignoring escaped quotes */
-	    if (*str == MPIU_STR_ESCAPE_CHAR)
+	    if (*str == MPL_STR_ESCAPE_CHAR)
 	    {
 		str++;
-		if (*str == MPIU_STR_QUOTE_CHAR)
+		if (*str == MPL_STR_QUOTE_CHAR)
 		    str++;
 	    }
 	    else
@@ -161,7 +148,7 @@ static const char * next_token(const char *str)
     }
     else
     {
-	if (*str == MPIU_STR_DELIM_CHAR)
+	if (*str == MPL_STR_DELIM_CHAR)
 	{
 	    /* move over the DELIM token */
 	    str++;
@@ -171,8 +158,8 @@ static const char * next_token(const char *str)
 	    /* move over literal */
 	    while (/*(isascii(*str) &&
 		    !isspace(*str)) &&*/
-		    *str != MPIU_STR_SEPAR_CHAR &&
-		   *str != MPIU_STR_DELIM_CHAR &&
+		    *str != MPL_STR_SEPAR_CHAR &&
+		   *str != MPL_STR_DELIM_CHAR &&
 		   *str != '\0')
 		str++;
 	}
@@ -185,7 +172,7 @@ static int compare_token(const char *token, const char *str)
     if (token == NULL || str == NULL)
 	return -1;
 
-    if (*token == MPIU_STR_QUOTE_CHAR)
+    if (*token == MPL_STR_QUOTE_CHAR)
     {
 	/* compare quoted strings */
 	token++; /* move over the first quote */
@@ -193,9 +180,9 @@ static int compare_token(const char *token, const char *str)
 	   end quote character */
 	for(;;)
 	{
-	    if (*token == MPIU_STR_ESCAPE_CHAR)
+	    if (*token == MPL_STR_ESCAPE_CHAR)
 	    {
-		if (*(token+1) == MPIU_STR_QUOTE_CHAR)
+		if (*(token+1) == MPL_STR_QUOTE_CHAR)
 		{
 		    /* move over the escape character if the next character 
 		       is a quote character */
@@ -206,7 +193,7 @@ static int compare_token(const char *token, const char *str)
 	    }
 	    else
 	    {
-		if (*token != *str || *token == MPIU_STR_QUOTE_CHAR)
+		if (*token != *str || *token == MPL_STR_QUOTE_CHAR)
 		    break;
 	    }
 	    if (*str == '\0')
@@ -214,9 +201,9 @@ static int compare_token(const char *token, const char *str)
 	    token++;
 	    str++;
 	}
-	if (*str == '\0' && *token == MPIU_STR_QUOTE_CHAR)
+	if (*str == '\0' && *token == MPL_STR_QUOTE_CHAR)
 	    return 0;
-	if (*token == MPIU_STR_QUOTE_CHAR)
+	if (*token == MPL_STR_QUOTE_CHAR)
 	    return 1;
 	if (*str < *token)
 	    return -1;
@@ -224,9 +211,9 @@ static int compare_token(const char *token, const char *str)
     }
 
     /* compare DELIM token */
-    if (*token == MPIU_STR_DELIM_CHAR)
+    if (*token == MPL_STR_DELIM_CHAR)
     {
-	if (*str == MPIU_STR_DELIM_CHAR)
+	if (*str == MPL_STR_DELIM_CHAR)
 	{
 	    str++;
 	    if (*str == '\0')
@@ -241,18 +228,18 @@ static int compare_token(const char *token, const char *str)
     /* compare literals */
     while (*token == *str &&
 	   *str != '\0' &&
-	   *token != MPIU_STR_DELIM_CHAR && 
-	   (*token != MPIU_STR_SEPAR_CHAR) )
+	   *token != MPL_STR_DELIM_CHAR &&
+	   (*token != MPL_STR_SEPAR_CHAR) )
     {
 	token++;
 	str++;
     }
     if ( (*str == '\0') &&
-	 (*token == MPIU_STR_DELIM_CHAR ||
-	  (*token == MPIU_STR_SEPAR_CHAR) || *token == '\0') )
+	 (*token == MPL_STR_DELIM_CHAR ||
+	  (*token == MPL_STR_SEPAR_CHAR) || *token == '\0') )
 	return 0;
-    if (*token == MPIU_STR_DELIM_CHAR || 
-	(*token == MPIU_STR_SEPAR_CHAR) || *token < *str)
+    if (*token == MPL_STR_DELIM_CHAR ||
+	(*token == MPL_STR_SEPAR_CHAR) || *token < *str)
 	return -1;
     return 1;
 }
@@ -262,15 +249,15 @@ static int token_copy(const char *token, char *str, int maxlen)
 {
     /* check parameters */
     if (token == NULL || str == NULL)
-	return MPIU_STR_FAIL;
+	return MPL_STR_FAIL;
 
     /* check special buffer lengths */
     if (maxlen < 1)
-	return MPIU_STR_FAIL;
+	return MPL_STR_FAIL;
     if (maxlen == 1)
     {
 	*str = '\0';
-	return (str[0] == '\0') ? MPIU_STR_SUCCESS : MPIU_STR_TRUNCATED;
+	return (str[0] == '\0') ? MPL_STR_SUCCESS : MPL_STR_TRUNCATED;
     }
 
     /* cosy up to the token */
@@ -278,35 +265,35 @@ static int token_copy(const char *token, char *str, int maxlen)
     if (token == NULL)
     {
 	*str = '\0';
-	return MPIU_STR_SUCCESS;
+	return MPL_STR_SUCCESS;
     }
 
-    if (*token == MPIU_STR_DELIM_CHAR)
+    if (*token == MPL_STR_DELIM_CHAR)
     {
 	/* copy the special deliminator token */
-	str[0] = MPIU_STR_DELIM_CHAR;
+	str[0] = MPL_STR_DELIM_CHAR;
 	str[1] = '\0';
-	return MPIU_STR_SUCCESS;
+	return MPL_STR_SUCCESS;
     }
 
-    if (*token == MPIU_STR_QUOTE_CHAR)
+    if (*token == MPL_STR_QUOTE_CHAR)
     {
 	/* quoted copy */
 	token++; /* move over the first quote */
 	do
 	{
-	    if (*token == MPIU_STR_ESCAPE_CHAR)
+	    if (*token == MPL_STR_ESCAPE_CHAR)
 	    {
-		if (*(token+1) == MPIU_STR_QUOTE_CHAR)
+		if (*(token+1) == MPL_STR_QUOTE_CHAR)
 		    token++;
 		*str = *token;
 	    }
 	    else
 	    {
-		if (*token == MPIU_STR_QUOTE_CHAR)
+		if (*token == MPL_STR_QUOTE_CHAR)
 		{
 		    *str = '\0';
-		    return MPIU_STR_SUCCESS;
+		    return MPL_STR_SUCCESS;
 		}
 		*str = *token;
 	    }
@@ -318,12 +305,12 @@ static int token_copy(const char *token, char *str, int maxlen)
 	   terminate the string */
 	str--;
 	*str = '\0';
-	return MPIU_STR_TRUNCATED;
+	return MPL_STR_TRUNCATED;
     }
 
     /* literal copy */
-    while (*token != MPIU_STR_DELIM_CHAR && 
-	   (*token != MPIU_STR_SEPAR_CHAR) && *token != '\0' && maxlen)
+    while (*token != MPL_STR_DELIM_CHAR &&
+	   (*token != MPL_STR_SEPAR_CHAR) && *token != '\0' && maxlen)
     {
 	*str = *token;
 	str++;
@@ -333,14 +320,14 @@ static int token_copy(const char *token, char *str, int maxlen)
     if (maxlen)
     {
 	*str = '\0';
-	return MPIU_STR_SUCCESS;
+	return MPL_STR_SUCCESS;
     }
     str--;
     *str = '\0';
-    return MPIU_STR_TRUNCATED;
+    return MPL_STR_TRUNCATED;
 }
 
-/*@ MPIU_Str_get_string_arg - Extract an option from a string with a 
+/*@ MPL_str_get_string_arg - Extract an option from a string with a
   maximum length
   
 Input Parameters:
@@ -352,7 +339,7 @@ Output Parameters:
 .   val - output string
 
     Return value:
-    MPIU_STR_SUCCESS, MPIU_STR_NOMEM, MPIU_STR_FAIL
+    MPL_STR_SUCCESS, MPL_STR_NOMEM, MPL_STR_FAIL
 
     Notes:
     This routine searches for a "key = value" entry in a string
@@ -360,16 +347,16 @@ Output Parameters:
   Module:
   Utility
   @*/
-int MPIU_Str_get_string_arg(const char *str, const char *flag, char *val, 
+int MPL_str_get_string_arg(const char *str, const char *flag, char *val,
 			    int maxlen)
 {
     if (maxlen < 1)
-	return MPIU_STR_FAIL;
+	return MPL_STR_FAIL;
 
     /* line up with the first token */
     str = first_token(str);
     if (str == NULL)
-	return MPIU_STR_FAIL;
+	return MPL_STR_FAIL;
 
     /* This loop will match the first instance of "flag = value" in the string. */
     do
@@ -377,11 +364,11 @@ int MPIU_Str_get_string_arg(const char *str, const char *flag, char *val,
 	if (compare_token(str, flag) == 0)
 	{
 	    str = next_token(str);
-	    if (compare_token(str, MPIU_STR_DELIM_STR) == 0)
+	    if (compare_token(str, MPL_STR_DELIM_STR) == 0)
 	    {
 		str = next_token(str);
 		if (str == NULL)
-		    return MPIU_STR_FAIL;
+		    return MPL_STR_FAIL;
 		return token_copy(str, val, maxlen);
 	    }
 	}
@@ -390,10 +377,10 @@ int MPIU_Str_get_string_arg(const char *str, const char *flag, char *val,
 	    str = next_token(str);
 	}
     } while (str);
-    return MPIU_STR_FAIL;
+    return MPL_STR_FAIL;
 }
 
-/*@ MPIU_Str_get_binary_arg - Extract an option from a string with a maximum 
+/*@ MPL_str_get_binary_arg - Extract an option from a string with a maximum
   length
   
 Input Parameters:
@@ -406,27 +393,27 @@ Output Parameters:
 -   out_length - output length
 
     Return value:
-    MPIU_STR_SUCCESS, MPIU_STR_NOMEM, MPIU_STR_FAIL
+    MPL_STR_SUCCESS, MPL_STR_NOMEM, MPL_STR_FAIL
 
     Notes:
     This routine searches for a "key = value" entry in a string and decodes 
     the value
     back to binary data.  The data must have been encoded with 
-    MPIU_Str_add_binary_arg.
+    MPL_str_add_binary_arg.
 
   Module:
   Utility
   @*/
-int MPIU_Str_get_binary_arg(const char *str, const char *flag, char *buffer, 
+int MPL_str_get_binary_arg(const char *str, const char *flag, char *buffer,
 			    int maxlen, int *out_length)
 {
     if (maxlen < 1)
-	return MPIU_STR_FAIL;
+	return MPL_STR_FAIL;
 
     /* line up with the first token */
     str = first_token(str);
     if (str == NULL)
-	return MPIU_STR_FAIL;
+	return MPL_STR_FAIL;
 
     /* This loop will match the first instance of "flag = value" in the string. */
     do
@@ -434,11 +421,11 @@ int MPIU_Str_get_binary_arg(const char *str, const char *flag, char *buffer,
 	if (compare_token(str, flag) == 0)
 	{
 	    str = next_token(str);
-	    if (compare_token(str, MPIU_STR_DELIM_STR) == 0)
+	    if (compare_token(str, MPL_STR_DELIM_STR) == 0)
 	    {
 		str = next_token(str);
 		if (str == NULL)
-		    return MPIU_STR_FAIL;
+		    return MPL_STR_FAIL;
 		return decode_buffer(str, buffer, maxlen, out_length);
 	    }
 	}
@@ -447,10 +434,10 @@ int MPIU_Str_get_binary_arg(const char *str, const char *flag, char *buffer,
 	    str = next_token(str);
 	}
     } while (str);
-    return MPIU_STR_FAIL;
+    return MPL_STR_FAIL;
 }
 
-/*@ MPIU_Str_get_int_arg - Extract an option from a string
+/*@ MPL_str_get_int_arg - Extract an option from a string
   
 Input Parameters:
 +   str - Source string
@@ -460,7 +447,7 @@ Output Parameters:
 .   val_ptr - pointer to the output integer
 
     Return value:
-    MPIU_STR_SUCCESS, MPIU_STR_NOMEM, MPIU_STR_FAIL
+    MPL_STR_SUCCESS, MPL_STR_NOMEM, MPL_STR_FAIL
 
     Notes:
     This routine searches for a "key = value" entry in a string and decodes the value
@@ -469,16 +456,16 @@ Output Parameters:
   Module:
   Utility
   @*/
-int MPIU_Str_get_int_arg(const char *str, const char *flag, int *val_ptr)
+int MPL_str_get_int_arg(const char *str, const char *flag, int *val_ptr)
 {
     int result;
     char int_str[12];
 
-    result = MPIU_Str_get_string_arg(str, flag, int_str, 12);
-    if (result == MPIU_STR_SUCCESS)
+    result = MPL_str_get_string_arg(str, flag, int_str, 12);
+    if (result == MPL_STR_SUCCESS)
     {
 	*val_ptr = atoi(int_str);
-	return MPIU_STR_SUCCESS;
+	return MPL_STR_SUCCESS;
     }
     return result;
 }
@@ -489,7 +476,7 @@ static int quoted_printf(char *str, int maxlen, const char *val)
     int count = 0;
     if (maxlen < 1)
 	return 0;
-    *str = MPIU_STR_QUOTE_CHAR;
+    *str = MPL_STR_QUOTE_CHAR;
     str++;
     maxlen--;
     count++;
@@ -497,9 +484,9 @@ static int quoted_printf(char *str, int maxlen, const char *val)
     {
 	if (*val == '\0')
 	    break;
-	if (*val == MPIU_STR_QUOTE_CHAR)
+	if (*val == MPL_STR_QUOTE_CHAR)
 	{
-	    *str = MPIU_STR_ESCAPE_CHAR;
+	    *str = MPL_STR_ESCAPE_CHAR;
 	    str++;
 	    maxlen--;
 	    count++;
@@ -514,7 +501,7 @@ static int quoted_printf(char *str, int maxlen, const char *val)
     }
     if (maxlen)
     {
-	*str = MPIU_STR_QUOTE_CHAR;
+	*str = MPL_STR_QUOTE_CHAR;
 	str++;
 	maxlen--;
 	count++;
@@ -525,7 +512,7 @@ static int quoted_printf(char *str, int maxlen, const char *val)
     return count;
 }
 
-/*@ MPIU_Str_add_string - Add a string to a string
+/*@ MPL_str_add_string - Add a string to a string
   
 Input Parameters:
 +   str_ptr - pointer to the destination string
@@ -538,11 +525,11 @@ Output Parameters:
 -   maxlen_ptr - maxlen is decremented by the amount str_ptr is incremented
 
     Return value:
-    MPIU_STR_SUCCESS, MPIU_STR_NOMEM, MPIU_STR_FAIL
+    MPL_STR_SUCCESS, MPL_STR_NOMEM, MPL_STR_FAIL
 
     Notes:
     This routine adds a string to a string in such a way that 
-    MPIU_Str_get_string can
+    MPL_str_get_string can
     retreive the same string back.  It takes into account spaces and quote 
     characters.
     The string pointer is updated to the start of the next string in the 
@@ -551,7 +538,7 @@ Output Parameters:
   Module:
   Utility
   @*/
-int MPIU_Str_add_string(char **str_ptr, int *maxlen_ptr, const char *val)
+int MPL_str_add_string(char **str_ptr, int *maxlen_ptr, const char *val)
 {
     int num_chars;
     char *str;
@@ -560,9 +547,9 @@ int MPIU_Str_add_string(char **str_ptr, int *maxlen_ptr, const char *val)
     str = *str_ptr;
     maxlen = *maxlen_ptr;
 
-    if (strchr(val, MPIU_STR_SEPAR_CHAR) ||
-	strchr(val, MPIU_STR_QUOTE_CHAR) ||
-	strchr(val, MPIU_STR_DELIM_CHAR))
+    if (strchr(val, MPL_STR_SEPAR_CHAR) ||
+	strchr(val, MPL_STR_QUOTE_CHAR) ||
+	strchr(val, MPL_STR_DELIM_CHAR))
     {
 	num_chars = quoted_printf(str, maxlen, val);
 	if (num_chars == maxlen)
@@ -573,7 +560,7 @@ int MPIU_Str_add_string(char **str_ptr, int *maxlen_ptr, const char *val)
 	}
 	if (num_chars < maxlen - 1)
 	{
-	    str[num_chars] = MPIU_STR_SEPAR_CHAR;
+	    str[num_chars] = MPL_STR_SEPAR_CHAR;
 	    str[num_chars+1] = '\0';
 	    num_chars++;
 	}
@@ -587,12 +574,12 @@ int MPIU_Str_add_string(char **str_ptr, int *maxlen_ptr, const char *val)
 	if (*val == '\0')
 	{
 	    num_chars = MPL_snprintf(str, maxlen, 
-		      MPIU_STR_QUOTE_STR MPIU_STR_QUOTE_STR/*"\"\""*/);
+		      MPL_STR_QUOTE_STR MPL_STR_QUOTE_STR/*"\"\""*/);
 	}
 	else
 	{
 	    num_chars = MPL_snprintf(str, maxlen, "%s%c", val, 
-				      MPIU_STR_SEPAR_CHAR);
+				      MPL_STR_SEPAR_CHAR);
 	}
 	if (num_chars == maxlen)
 	{
@@ -605,7 +592,7 @@ int MPIU_Str_add_string(char **str_ptr, int *maxlen_ptr, const char *val)
     return 0;
 }
 
-/*@ MPIU_Str_get_string - Get the next string from a string
+/*@ MPL_str_get_string - Get the next string from a string
   
 Input Parameters:
 +   str_ptr - pointer to the destination string
@@ -616,7 +603,7 @@ Output Parameters:
 -   val - location to store the string
 
     Return value:
-    MPIU_STR_SUCCESS, MPIU_STR_NOMEM, MPIU_STR_FAIL
+    MPL_STR_SUCCESS, MPL_STR_NOMEM, MPL_STR_FAIL
 
     Return Value:
     The return value is 0 for success, -1 for insufficient buffer space, and 
@@ -624,14 +611,14 @@ Output Parameters:
 
     Notes:
     This routine gets a string that was previously added by 
-    MPIU_Str_add_string.
+    MPL_str_add_string.
     It takes into account spaces and quote characters. The string pointer is 
     updated to the start of the next string in the string.
 
   Module:
   Utility
   @*/
-int MPIU_Str_get_string(char **str_ptr, char *val, int maxlen)
+int MPL_str_get_string(char **str_ptr, char *val, int maxlen)
 {
     int result;
     char *str;
@@ -657,13 +644,13 @@ int MPIU_Str_get_string(char **str_ptr, char *val, int maxlen)
 
     /* copy the token */
     result = token_copy(str, val, maxlen);
-    if (result == MPIU_STR_SUCCESS)
+    if (result == MPL_STR_SUCCESS)
     {
 	str = (char*)next_token(str);
 	*str_ptr = str;
 	return 0;
     }
-    else if (result == MPIU_STR_TRUNCATED)
+    else if (result == MPL_STR_TRUNCATED)
     {
 	return -1;
     }
@@ -672,7 +659,7 @@ int MPIU_Str_get_string(char **str_ptr, char *val, int maxlen)
     return -2;
 }
 
-/*@ MPIU_Str_add_string_arg - Add an option to a string with a maximum length
+/*@ MPL_str_add_string_arg - Add an option to a string with a maximum length
   
 Input Parameters:
 +   str_ptr - Pointer to the destination string
@@ -686,7 +673,7 @@ Output Parameters:
 -   maxlen_ptr - maxlen is reduced by the number of characters written
 
     Return value:
-    MPIU_STR_SUCCESS, MPIU_STR_NOMEM, MPIU_STR_FAIL
+    MPL_STR_SUCCESS, MPL_STR_NOMEM, MPL_STR_FAIL
 
     Notes:
     This routine adds a string option to a string in the form "key = value".
@@ -694,23 +681,23 @@ Output Parameters:
   Module:
   Utility
   @*/
-int MPIU_Str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *flag, 
+int MPL_str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
 			    const char *val)
 {
     int num_chars;
     char **orig_str_ptr;
 
     if (maxlen_ptr == NULL)
-	return MPIU_STR_FAIL;
+	return MPL_STR_FAIL;
 
     orig_str_ptr = str_ptr;
 
     if (*maxlen_ptr < 1)
-	return MPIU_STR_FAIL;
+	return MPL_STR_FAIL;
 
     /* add the flag */
-    if (strstr(flag, MPIU_STR_SEPAR_STR) || strstr(flag, MPIU_STR_DELIM_STR) ||
-	flag[0] == MPIU_STR_QUOTE_CHAR)
+    if (strstr(flag, MPL_STR_SEPAR_STR) || strstr(flag, MPL_STR_DELIM_STR) ||
+	flag[0] == MPL_STR_QUOTE_CHAR)
     {
 	num_chars = quoted_printf(*str_ptr, *maxlen_ptr, flag);
     }
@@ -724,18 +711,18 @@ int MPIU_Str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
 	MPL_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
                   "partial argument added to string: '%s'", *str_ptr);
 	**str_ptr = '\0';
-	return MPIU_STR_NOMEM;
+	return MPL_STR_NOMEM;
     }
     *str_ptr = *str_ptr + num_chars;
 
     /* add the deliminator character */
-    **str_ptr = MPIU_STR_DELIM_CHAR;
+    **str_ptr = MPL_STR_DELIM_CHAR;
     *str_ptr = *str_ptr + 1;
     *maxlen_ptr = *maxlen_ptr - 1;
 
     /* add the value string */
-    if (strstr(val, MPIU_STR_SEPAR_STR) || strstr(val, MPIU_STR_DELIM_STR) ||
-	val[0] == MPIU_STR_QUOTE_CHAR)
+    if (strstr(val, MPL_STR_SEPAR_STR) || strstr(val, MPL_STR_DELIM_STR) ||
+	val[0] == MPL_STR_QUOTE_CHAR)
     {
 	num_chars = quoted_printf(*str_ptr, *maxlen_ptr, val);
     }
@@ -744,7 +731,7 @@ int MPIU_Str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
 	if (*val == '\0')
 	{
 	    num_chars = MPL_snprintf(*str_ptr, *maxlen_ptr, 
-			      MPIU_STR_QUOTE_STR MPIU_STR_QUOTE_STR/*"\"\""*/);
+			      MPL_STR_QUOTE_STR MPL_STR_QUOTE_STR/*"\"\""*/);
 	}
 	else
 	{
@@ -758,19 +745,19 @@ int MPIU_Str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
 	MPL_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**orig_str_ptr = '\0';
-	return MPIU_STR_NOMEM;
+	return MPL_STR_NOMEM;
     }
     
     /* add the trailing space */
-    **str_ptr = MPIU_STR_SEPAR_CHAR;
+    **str_ptr = MPL_STR_SEPAR_CHAR;
     *str_ptr = *str_ptr + 1;
     **str_ptr = '\0';
     *maxlen_ptr = *maxlen_ptr - 1;
 
-    return MPIU_STR_SUCCESS;
+    return MPL_STR_SUCCESS;
 }
 
-/*@ MPIU_Str_add_int_arg - Add an option to a string with a maximum length
+/*@ MPL_str_add_int_arg - Add an option to a string with a maximum length
   
 Input Parameters:
 +   str_ptr - Pointer to the destination string
@@ -784,7 +771,7 @@ Output Parameters:
 -   maxlen_ptr - maxlen is reduced by the number of characters written
 
     Return value:
-    MPIU_STR_SUCCESS, MPIU_STR_NOMEM, MPIU_STR_FAIL
+    MPL_STR_SUCCESS, MPL_STR_NOMEM, MPL_STR_FAIL
 
     Notes:
     This routine adds an integer option to a string in the form "key = value".
@@ -792,15 +779,15 @@ Output Parameters:
   Module:
   Utility
   @*/
-int MPIU_Str_add_int_arg(char **str_ptr, int *maxlen_ptr, const char *flag, 
+int MPL_str_add_int_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
 			 int val)
 {
     char val_str[12];
     MPL_snprintf(val_str, 12, "%d", val);
-    return MPIU_Str_add_string_arg(str_ptr, maxlen_ptr, flag, val_str);
+    return MPL_str_add_string_arg(str_ptr, maxlen_ptr, flag, val_str);
 }
 
-/*@ MPIU_Str_add_binary_arg - Add an option to a string with a maximum length
+/*@ MPL_str_add_binary_arg - Add an option to a string with a maximum length
   
 Input Parameters:
 +   str_ptr - Pointer to the destination string
@@ -815,7 +802,7 @@ Output Parameters:
 -   maxlen_ptr - maxlen is reduced by the number of characters written
 
     Return value:
-    MPIU_STR_SUCCESS, MPIU_STR_NOMEM, MPIU_STR_FAIL
+    MPL_STR_SUCCESS, MPL_STR_NOMEM, MPL_STR_FAIL
 
     Notes:
     This routine encodes binary data into a string option in the form 
@@ -824,7 +811,7 @@ Output Parameters:
   Module:
   Utility
   @*/
-int MPIU_Str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
+int MPL_str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
 			    const char *buffer, int length)
 {
     int result;
@@ -832,16 +819,16 @@ int MPIU_Str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     char **orig_str_ptr;
 
     if (maxlen_ptr == NULL)
-	return MPIU_STR_FAIL;
+	return MPL_STR_FAIL;
 
     orig_str_ptr = str_ptr;
 
     if (*maxlen_ptr < 1)
-	return MPIU_STR_FAIL;
+	return MPL_STR_FAIL;
 
     /* add the flag */
-    if (strstr(flag, MPIU_STR_SEPAR_STR) || strstr(flag, MPIU_STR_DELIM_STR) ||
-	flag[0] == MPIU_STR_QUOTE_CHAR)
+    if (strstr(flag, MPL_STR_SEPAR_STR) || strstr(flag, MPL_STR_DELIM_STR) ||
+	flag[0] == MPL_STR_QUOTE_CHAR)
     {
 	num_chars = quoted_printf(*str_ptr, *maxlen_ptr, flag);
     }
@@ -855,18 +842,18 @@ int MPIU_Str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
 	MPL_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**str_ptr = '\0';
-	return MPIU_STR_NOMEM;
+	return MPL_STR_NOMEM;
     }
     *str_ptr = *str_ptr + num_chars;
 
     /* add the deliminator character */
-    **str_ptr = MPIU_STR_DELIM_CHAR;
+    **str_ptr = MPL_STR_DELIM_CHAR;
     *str_ptr = *str_ptr + 1;
     *maxlen_ptr = *maxlen_ptr - 1;
 
     /* add the value string */
     result = encode_buffer(*str_ptr, *maxlen_ptr, buffer, length, &num_chars);
-    if (result != MPIU_STR_SUCCESS)
+    if (result != MPL_STR_SUCCESS)
     {
 	**orig_str_ptr = '\0';
 	return result;
@@ -880,14 +867,14 @@ int MPIU_Str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
 	MPL_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**orig_str_ptr = '\0';
-	return MPIU_STR_NOMEM;
+	return MPL_STR_NOMEM;
     }
     
     /* add the trailing space */
-    **str_ptr = MPIU_STR_SEPAR_CHAR;
+    **str_ptr = MPL_STR_SEPAR_CHAR;
     *str_ptr = *str_ptr + 1;
     **str_ptr = '\0';
     *maxlen_ptr = *maxlen_ptr - 1;
 
-    return MPIU_STR_SUCCESS;
+    return MPL_STR_SUCCESS;
 }
diff --git a/src/util/mem/Makefile.mk b/src/util/mem/Makefile.mk
index d8b4217..a503246 100644
--- a/src/util/mem/Makefile.mk
+++ b/src/util/mem/Makefile.mk
@@ -13,6 +13,5 @@ noinst_HEADERS +=                               \
 mpi_core_sources += \
     src/util/mem/trmem.c      \
     src/util/mem/handlemem.c  \
-    src/util/mem/argstr.c     \
     src/util/mem/strerror.c
 

http://git.mpich.org/mpich.git/commitdiff/2bea90555ef22d99df104152c627ca9fb61e0d10

commit 2bea90555ef22d99df104152c627ca9fb61e0d10
Author: Pavan Balaji <balaji at anl.gov>
Date:   Mon Jan 25 20:08:11 2016 -0600

    mpl: remove debug inline macros.
    
    These macros were assuming the existence of HAVE_ERROR_CHECKING, which
    is not available in MPL.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpl/include/mpl_msg.h b/src/mpl/include/mpl_msg.h
index 35265f8..598e153 100644
--- a/src/mpl/include/mpl_msg.h
+++ b/src/mpl/include/mpl_msg.h
@@ -9,16 +9,6 @@
 
 #include "mpl.h"
 
-/* These macros can be used to prevent inlining for utility functions
- * where it might make debugging easier. */
-#if defined(HAVE_ERROR_CHECKING)
-#define MPL_DBG_ATTRIBUTE_NOINLINE ATTRIBUTE((__noinline__))
-#define MPL_DBG_INLINE_KEYWORD
-#else
-#define MPL_DBG_ATTRIBUTE_NOINLINE
-#define MPL_DBG_INLINE_KEYWORD inline
-#endif
-
 #if defined(MPL_HAVE_MACRO_VA_ARGS)
 #define MPL_error_printf(...) fprintf(stderr,__VA_ARGS__)
 #else
diff --git a/src/util/refcount/mpir_refcount_pobj.h b/src/util/refcount/mpir_refcount_pobj.h
index 1631b7e..a9d500a 100644
--- a/src/util/refcount/mpir_refcount_pobj.h
+++ b/src/util/refcount/mpir_refcount_pobj.h
@@ -42,7 +42,7 @@ static inline void MPIR_cc_set(MPIR_cc_t * cc_ptr, int val)
 }
 
 ATTRIBUTE((unused))
-static MPL_DBG_INLINE_KEYWORD int MPIR_cc_is_complete(MPIR_cc_t * cc_ptr)
+static inline int MPIR_cc_is_complete(MPIR_cc_t * cc_ptr)
 {
     int complete;
 

http://git.mpich.org/mpich.git/commitdiff/06c3bf79045c2d606d08919659ee5a73317fa478

commit 06c3bf79045c2d606d08919659ee5a73317fa478
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Jan 22 14:41:57 2016 -0600

    mpl: several bug fixes with macro names.
    
    We had missed several configure checks for various macros in MPL.  Also,
    we forgot to prefix them with MPL_ in many cases.  It's a miracle that
    mpich was working without these changes (or maybe that shows how sparse
    our testing is).
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpl/configure.ac b/src/mpl/configure.ac
index 8dd8535..61ca76b 100644
--- a/src/mpl/configure.ac
+++ b/src/mpl/configure.ac
@@ -51,6 +51,7 @@ AC_C_RESTRICT
 AC_C_INLINE
 
 PAC_C_MACRO_VA_ARGS
+PAC_C_BUILTIN_EXPECT
 
 AC_ARG_ENABLE(embedded,
     AC_HELP_STRING([--enable-embedded], [Build MPL in embedded mode (default is no)]),
@@ -92,7 +93,7 @@ if test "$pac_cv_have___typeof" = "yes" ; then
 fi
 
 dnl Check if the necessary headers are available
-AC_CHECK_HEADERS(stdio.h stdlib.h string.h stdarg.h ctype.h sys/types.h sys/uio.h execinfo.h backtrace.h libunwind.h unistd.h errno.h)
+AC_CHECK_HEADERS(stdio.h stdlib.h string.h stdarg.h ctype.h sys/types.h sys/uio.h execinfo.h backtrace.h libunwind.h unistd.h errno.h windows.h)
 
 # A C99 compliant compiler should have inttypes.h for fixed-size int types
 AC_CHECK_HEADERS(inttypes.h stdint.h)
@@ -637,10 +638,10 @@ void f1(void *a) { return; }],
                        pac_cv_has_pthread_mutex_errorcheck=no)])
 
         if test "$pac_cv_has_pthread_mutex_errorcheck" = yes ; then
-            AC_DEFINE(MPL_PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK,
+            AC_DEFINE(PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK,
                       [Define to an expression that will result in an error checking mutex type.])
         elif test "$pac_cv_has_pthread_mutex_errorcheck_np" = yes ; then
-            AC_DEFINE(MPL_PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK_NP,
+            AC_DEFINE(PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK_NP,
                       [Define to an expression that will result in an error checking mutex type.])
         fi
 
diff --git a/src/mpl/include/mpl_base.h b/src/mpl/include/mpl_base.h
index 5ca0103..698da33 100644
--- a/src/mpl/include/mpl_base.h
+++ b/src/mpl/include/mpl_base.h
@@ -66,7 +66,7 @@
  *
  * These macros are not namespaced because the namespacing is cumbersome.
  */
-#ifdef HAVE_BUILTIN_EXPECT
+#ifdef MPL_HAVE_BUILTIN_EXPECT
 #  define unlikely(x_) __builtin_expect(!!(x_),0)
 #  define likely(x_)   __builtin_expect(!!(x_),1)
 #else
diff --git a/src/mpl/include/mpl_iov.h b/src/mpl/include/mpl_iov.h
index 88ee1da..ae25f6f 100644
--- a/src/mpl/include/mpl_iov.h
+++ b/src/mpl/include/mpl_iov.h
@@ -11,21 +11,21 @@
 
 /* IOVs */
 /* The basic channel interface uses IOVs */
-#ifdef HAVE_WINDOWS_H
+#ifdef MPL_HAVE_WINDOWS_H
     #define MPL_IOV_BUF_CAST char *
 #else
     #define MPL_IOV_BUF_CAST void *
 #endif
-#ifdef HAVE_WINDOWS_H
+#ifdef MPL_HAVE_WINDOWS_H
 #include <winsock2.h>
 #define MPL_IOV         WSABUF
 #define MPL_IOV_LEN     len
 #define MPL_IOV_BUF     buf
 #else
-#ifdef HAVE_SYS_TYPES_H
+#ifdef MPL_HAVE_SYS_TYPES_H
 #include <sys/types.h> /* macs need sys/types.h before uio.h can be included */
 #endif
-#ifdef HAVE_SYS_UIO_H
+#ifdef MPL_HAVE_SYS_UIO_H
 #include <sys/uio.h>
 #endif
 #define MPL_IOV         struct iovec
diff --git a/src/mpl/include/mpl_thread_posix.h b/src/mpl/include/mpl_thread_posix.h
index c1146e6..a073521 100644
--- a/src/mpl/include/mpl_thread_posix.h
+++ b/src/mpl/include/mpl_thread_posix.h
@@ -21,9 +21,9 @@ typedef pthread_cond_t MPL_thread_cond_t;
 typedef pthread_t MPL_thread_id_t;
 typedef pthread_key_t MPL_thread_tls_t;
 
-#if defined(NEEDS_PTHREAD_MUTEXATTR_SETTYPE_DECL)
+#if defined(MPL_NEEDS_PTHREAD_MUTEXATTR_SETTYPE_DECL)
 int pthread_mutexattr_settype(pthread_mutexattr_t * attr, int kind);
-#endif /* NEEDS_PTHREAD_MUTEXATTR_SETTYPE_DECL */
+#endif /* MPL_NEEDS_PTHREAD_MUTEXATTR_SETTYPE_DECL */
 
 typedef void (*MPL_thread_func_t) (void *data);
 void MPL_thread_create(MPL_thread_func_t func, void *data, MPL_thread_id_t * id, int *err);
diff --git a/src/mpl/include/mpl_timer_clock_gettime.h b/src/mpl/include/mpl_timer_clock_gettime.h
index 9ae7917..6e0aa79 100644
--- a/src/mpl/include/mpl_timer_clock_gettime.h
+++ b/src/mpl/include/mpl_timer_clock_gettime.h
@@ -10,7 +10,7 @@
 #define MPLI_WTIME_IS_A_FUNCTION
 
 #include <time.h>
-#ifdef NEEDS_SYS_TIME_H
+#ifdef MPL_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>
diff --git a/src/mpl/include/mpl_yield.h b/src/mpl/include/mpl_yield.h
index 308fd2d..925be66 100644
--- a/src/mpl/include/mpl_yield.h
+++ b/src/mpl/include/mpl_yield.h
@@ -28,22 +28,22 @@
     #include <windows.h>
     #define MPL_sched_yield() Sleep(0)
 #elif defined(MPL_USE_SCHED_YIELD_FOR_YIELD)
-    #ifdef HAVE_SCHED_H
+    #ifdef MPL_HAVE_SCHED_H
         #include <sched.h>
     #endif
     #define MPL_sched_yield() sched_yield()
 #elif defined(MPL_USE_YIELD_FOR_YIELD)
-    #ifdef HAVE_SCHED_H
+    #ifdef MPL_HAVE_SCHED_H
         #include <sched.h>
     #endif
     #define MPL_sched_yield() yield()
 #elif defined (MPL_USE_SELECT_FOR_YIELD)
-    #ifdef HAVE_SYS_SELECT_H
+    #ifdef MPL_HAVE_SYS_SELECT_H
         #include <sys/select.h>
     #endif
     #define MPL_sched_yield() do { struct timeval t; t.tv_sec = 0; t.tv_usec = 0; select(0,0,0,0,&t); } while (0)
 #elif defined (MPL_USE_USLEEP_FOR_YIELD)
-    #ifdef HAVE_UNISTD_H
+    #ifdef MPL_HAVE_UNISTD_H
         #include <unistd.h>
         #if defined (MPL_NEEDS_USLEEP_DECL)
         int usleep(useconds_t usec);
@@ -51,7 +51,7 @@
     #endif
     #define MPL_sched_yield() usleep(0)
 #elif defined (MPL_USE_SLEEP_FOR_YIELD)
-    #ifdef HAVE_UNISTD_H
+    #ifdef MPL_HAVE_UNISTD_H
         #include <unistd.h>
     #endif
     #define MPL_sched_yield() sleep(0)

http://git.mpich.org/mpich.git/commitdiff/63ce5c1c6ec5a04146baa8e08e1cce0b9a70e47c

commit 63ce5c1c6ec5a04146baa8e08e1cce0b9a70e47c
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 21 22:37:54 2016 -0600

    mpidbg: initial move to MPL.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/configure.ac b/configure.ac
index 4d6c460..5b82154 100644
--- a/configure.ac
+++ b/configure.ac
@@ -365,7 +365,6 @@ AC_ARG_ENABLE(g,
                    compiler flags, i.e. MPICHLIB_CFLAGS, MPICHLIB_CXXFLAGS,
                    MPICHLIB_FFLAGS, and MPICHLIB_FCFLAGS.
         debug    - Synonym for dbg
-        log      - Enable debug event logging
         mem      - Memory usage tracing
         meminit  - Preinitialize memory associated structures and unions to
                    eliminate access warnings from programs like valgrind
@@ -1446,9 +1445,6 @@ for option in $enable_g ; do
 	mem)
 	perform_memtracing=yes
 	;;
-	log)
-	perform_dbglog=yes
-	;;
 	mutex)
 	perform_dbgmutex=yes
 	;;
@@ -1457,7 +1453,6 @@ for option in $enable_g ; do
 	;;
         most|yes)
         perform_memtracing=yes
-        perform_dbglog=yes
         enable_append_g=yes
         perform_meminit=yes
         perform_dbgmutex=yes
@@ -1468,7 +1463,6 @@ for option in $enable_g ; do
 	all)
         perform_memarena=yes
 	perform_memtracing=yes
-	perform_dbglog=yes
 	enable_append_g=yes
 	perform_meminit=yes
 	perform_dbgmutex=yes
@@ -1511,17 +1505,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
-USE_DBG_LOGGING=0
-if test -n "$perform_dbglog" ; then
-   if test "$with_logging" != "none" ; then
-       AC_MSG_WARN([--with-logging overrides --enable-g=log])
-   else
-       AC_DEFINE(USE_DBG_LOGGING,1,[Define to enable logging macros])
-       USE_DBG_LOGGING=1
-   fi
-fi
-# allow @USE_DBG_LOGGING@ substitution in glue_romio.h
-AC_SUBST([USE_DBG_LOGGING])
 
 if test -n "$perform_dbgmutex" ; then 
    AC_DEFINE(MPICH_DEBUG_MUTEX,1,[Define to enable mutex debugging])
@@ -4670,11 +4653,6 @@ AC_HAVE_FUNCS(mkstemp)
 if test "$ac_cv_func_mkstemp" = "yes" ; then
     PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],mkstemp)
 fi
-# fdopen() converts from an fd to a FILE*
-AC_HAVE_FUNCS(fdopen)
-if test "$ac_cv_func_fdopen" = "yes" ; then
-    PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],fdopen)
-fi
 # putenv() sets environment variable
 AC_HAVE_FUNCS(putenv)
 if test "$ac_cv_func_putenv" = "yes" ; then
@@ -4875,8 +4853,6 @@ dnl autoconf did this in a way that caused problems, paritcularly with
 dnl errors reported as inconsistent cache files.  Instead, we simply
 dnl invoke the configure scripts (if present) directly.
 
-AC_CHECK_FUNCS(getpid)
-
 # Check for the Linux functions for controlling processor affinity.
 # LINUX: sched_setaffinity
 # AIX:   bindprocessor
diff --git a/src/glue/romio/glue_romio.c b/src/glue/romio/glue_romio.c
index e071d17..c3521c2 100644
--- a/src/glue/romio/glue_romio.c
+++ b/src/glue/romio/glue_romio.c
@@ -11,9 +11,9 @@
 #include "mpiimpl.h"
 #include "glue_romio.h"
 
-#if defined (USE_DBG_LOGGING)
-static MPIU_DBG_Class DBG_ROMIO;
-#endif /* USE_DBG_LOGGING */
+#if defined (MPL_USE_DBG_LOGGING)
+static MPL_DBG_Class DBG_ROMIO;
+#endif /* MPL_USE_DBG_LOGGING */
 
 int MPIR_Ext_dbg_romio_terse_enabled = 0;
 int MPIR_Ext_dbg_romio_typical_enabled = 0;
@@ -27,16 +27,16 @@ int MPIR_Ext_init(void)
     MPIR_Ext_dbg_romio_typical_enabled = 0;
     MPIR_Ext_dbg_romio_verbose_enabled = 0;
 
-#if defined (USE_DBG_LOGGING)
-    DBG_ROMIO = MPIU_DBG_Class_alloc("ROMIO", "romio");
+#if defined (MPL_USE_DBG_LOGGING)
+    DBG_ROMIO = MPL_DBG_Class_alloc("ROMIO", "romio");
 
-    if (MPIU_DBG_SELECTED(DBG_ROMIO,TERSE))
+    if (MPL_DBG_SELECTED(DBG_ROMIO,TERSE))
         MPIR_Ext_dbg_romio_terse_enabled = 1;
-    if (MPIU_DBG_SELECTED(DBG_ROMIO,TYPICAL))
+    if (MPL_DBG_SELECTED(DBG_ROMIO,TYPICAL))
         MPIR_Ext_dbg_romio_typical_enabled = 1;
-    if (MPIU_DBG_SELECTED(DBG_ROMIO,VERBOSE))
+    if (MPL_DBG_SELECTED(DBG_ROMIO,VERBOSE))
         MPIR_Ext_dbg_romio_verbose_enabled = 1;
-#endif /* USE_DBG_LOGGING */
+#endif /* MPL_USE_DBG_LOGGING */
 
     return MPI_SUCCESS;
 }
diff --git a/src/include/glue_romio.h.in b/src/include/glue_romio.h.in
index 9623833..b3a1f03 100644
--- a/src/include/glue_romio.h.in
+++ b/src/include/glue_romio.h.in
@@ -12,10 +12,6 @@
 #define MPIU_Pint @MPIU_PINT@
 #define MPIU_Upint unsigned @MPIU_PINT@
 
-#if @USE_DBG_LOGGING@
-#define USE_DBG_LOGGING 1
-#endif
-
 /* used by ROMIO, should be handled by a romio-private version of this macro
  * instead */
 #ifdef HAVE_WINDOWS_H
diff --git a/src/include/mpifunc.h b/src/include/mpifunc.h
index 397eadf..b42d7c5 100644
--- a/src/include/mpifunc.h
+++ b/src/include/mpifunc.h
@@ -8,7 +8,7 @@
 #define MPIFUNC_H_INCLUDED
 
 /* state declaration macros */
-#if defined(USE_DBG_LOGGING) || defined(MPICH_DEBUG_MEMARENA)
+#if defined(MPL_USE_DBG_LOGGING) || defined(MPICH_DEBUG_MEMARENA)
 #define MPIR_STATE_DECL(a)
 #define MPID_MPI_STATE_DECL(a)		MPIR_STATE_DECL(a)
 #define MPID_MPI_INIT_STATE_DECL(a)	MPIR_STATE_DECL(a)
@@ -20,17 +20,17 @@
 /* Tell the package to define the rest of the enter/exit macros in
    terms of these */
 #define NEEDS_FUNC_ENTER_EXIT_DEFS 1
-#endif /* USE_DBG_LOGGING || MPICH_DEBUG_MEMARENA */
+#endif /* MPL_USE_DBG_LOGGING || MPICH_DEBUG_MEMARENA */
 
 /* function enter and exit macros */
-#if defined(USE_DBG_LOGGING)
-#define MPIR_FUNC_ENTER(a) MPIU_DBG_MSG(MPIU_DBG_ROUTINE_ENTER,TYPICAL,"Entering "#a)
+#if defined(MPL_USE_DBG_LOGGING)
+#define MPIR_FUNC_ENTER(a) MPL_DBG_MSG(MPL_DBG_ROUTINE_ENTER,TYPICAL,"Entering "#a)
 #elif defined(MPICH_DEBUG_MEMARENA)
 #define MPIR_FUNC_ENTER(a) MPIU_trvalid("Entering " #a)
 #endif
 
-#if defined(USE_DBG_LOGGING)
-#define MPIR_FUNC_EXIT(a) MPIU_DBG_MSG(MPIU_DBG_ROUTINE_EXIT,TYPICAL,"Leaving "#a)
+#if defined(MPL_USE_DBG_LOGGING)
+#define MPIR_FUNC_EXIT(a) MPL_DBG_MSG(MPL_DBG_ROUTINE_EXIT,TYPICAL,"Leaving "#a)
 #elif defined(MPICH_DEBUG_MEMARENA)
 #define MPIR_FUNC_EXIT(a) MPIU_trvalid("Leaving " #a)
 #endif
diff --git a/src/include/mpihandlemem.h b/src/include/mpihandlemem.h
index bd912ee..02f30a7 100644
--- a/src/include/mpihandlemem.h
+++ b/src/include/mpihandlemem.h
@@ -118,9 +118,9 @@ const char *MPIU_Handle_get_kind_str(int kind);
 #define HANDLE_MASK 0x03FFFFFF
 #define HANDLE_INDEX(a) ((a)& HANDLE_MASK)
 
-#if defined (USE_DBG_LOGGING)
-extern MPIU_DBG_Class MPIR_DBG_HANDLE;
-#endif /* USE_DBG_LOGGING */
+#if defined (MPL_USE_DBG_LOGGING)
+extern MPL_DBG_Class MPIR_DBG_HANDLE;
+#endif /* MPL_USE_DBG_LOGGING */
 
 /* ------------------------------------------------------------------------- */
 /* reference counting macros */
@@ -136,7 +136,7 @@ extern MPIU_DBG_Class MPIR_DBG_HANDLE;
         int local_ref_count_ = MPIU_Object_get_ref(objptr_);                                        \
         if (local_ref_count_ > MPICH_DEBUG_MAX_REFCOUNT || local_ref_count_ < 0)                    \
         {                                                                                           \
-            MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                        \
+            MPL_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPL_DBG_FDEST,                                        \
                                              "Invalid refcount (%d) in %p (0x%08x) %s",             \
                                              local_ref_count_, (objptr_), (objptr_)->handle, op_)); \
         }                                                                                           \
@@ -148,7 +148,7 @@ extern MPIU_DBG_Class MPIR_DBG_HANDLE;
 #endif
 
 #define MPIU_HANDLE_LOG_REFCOUNT_CHANGE(objptr_, action_str_)                                          \
-    MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                                   \
+    MPL_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPL_DBG_FDEST,                                                   \
                                      "%s %p (0x%08x kind=%s) refcount to %d",                          \
                                      (action_str_),                                                    \
                                      (objptr_),                                                        \
@@ -305,7 +305,7 @@ typedef OPA_int_t MPIU_Handle_ref_count;
             MPIU_Object_add_ref_always((objptr_));             \
         }                                                      \
         else {                                                                                                 \
-            MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                                   \
+            MPL_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPL_DBG_FDEST,                                                   \
                                              "skipping add_ref on %p (0x%08x kind=%s) refcount=%d",            \
                                              (objptr_),                                                        \
                                              (objptr_)->handle,                                                \
@@ -321,7 +321,7 @@ typedef OPA_int_t MPIU_Handle_ref_count;
         }                                                            \
         else {                                                       \
             *(inuse_ptr_) = 1;                                       \
-            MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                                   \
+            MPL_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPL_DBG_FDEST,                                                   \
                                              "skipping release_ref on %p (0x%08x kind=%s) refcount=%d",        \
                                              (objptr_),                                                        \
                                              (objptr_)->handle,                                                \
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index c5e3e51..3ef16ac 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -140,30 +140,6 @@ int usleep(useconds_t usec);
     } while (0)
 #endif
 
-/* ------------------------------------------------------------------------- */
-/* mpidebug.h */
-/* ------------------------------------------------------------------------- */
-/* Debugging and printf control */
-/* Use these *only* for debugging output intended for the implementors
-   and maintainers of MPICH.  Do *not* use these for any output that
-   general users may normally see.  Use either the error code creation
-   routines for error messages or MPIU_msg_printf etc. for general messages 
-   (MPIU_msg_printf will go through gettext).  
-
-   FIXME: Document all of these macros
-
-   NOTE: These macros and values are deprecated.  See 
-   www.mcs.anl.gov/mpi/mpich/developer/design/debugmsg.htm for 
-   the new design (only partially implemented at this time).
-   
-   The implementation is in mpidbg.h
-*/
-#include "mpidbg.h"
-
-/* ------------------------------------------------------------------------- */
-/* end of mpidebug.h */
-/* ------------------------------------------------------------------------- */
-
 #if defined HAVE_LIBHCOLL
 #include "../mpid/common/hcoll/hcollpre.h"
 #endif
@@ -2194,18 +2170,18 @@ typedef struct MPICH_PerProcess_t {
 } MPICH_PerProcess_t;
 extern MPICH_PerProcess_t MPIR_Process;
 
-#if defined (USE_DBG_LOGGING)
-extern MPIU_DBG_Class MPIR_DBG_INIT;
-extern MPIU_DBG_Class MPIR_DBG_PT2PT;
-extern MPIU_DBG_Class MPIR_DBG_THREAD;
-extern MPIU_DBG_Class MPIR_DBG_DATATYPE;
-extern MPIU_DBG_Class MPIR_DBG_COMM;
-extern MPIU_DBG_Class MPIR_DBG_BSEND;
-extern MPIU_DBG_Class MPIR_DBG_ERRHAND;
-extern MPIU_DBG_Class MPIR_DBG_OTHER;
+#if defined (MPL_USE_DBG_LOGGING)
+extern MPL_DBG_Class MPIR_DBG_INIT;
+extern MPL_DBG_Class MPIR_DBG_PT2PT;
+extern MPL_DBG_Class MPIR_DBG_THREAD;
+extern MPL_DBG_Class MPIR_DBG_DATATYPE;
+extern MPL_DBG_Class MPIR_DBG_COMM;
+extern MPL_DBG_Class MPIR_DBG_BSEND;
+extern MPL_DBG_Class MPIR_DBG_ERRHAND;
+extern MPL_DBG_Class MPIR_DBG_OTHER;
 
-extern MPIU_DBG_Class MPIR_DBG_ASSERT;
-#endif /* USE_DBG_LOGGING */
+extern MPL_DBG_Class MPIR_DBG_ASSERT;
+#endif /* MPL_USE_DBG_LOGGING */
 
 /* ------------------------------------------------------------------------- */
 /* In MPICH, each function has an "enter" and "exit" macro.  These can be 
@@ -2217,7 +2193,7 @@ extern MPIU_DBG_Class MPIR_DBG_ASSERT;
  *    These collect data on when each function began and finished; the
  *    resulting data can be displayed using special programs
  * 2. Debug logging (selected with --enable-g=log)
- *    Invokes MPIU_DBG_MSG at the entry and exit for each routine            
+ *    Invokes MPL_DBG_MSG at the entry and exit for each routine
  * 3. Additional memory validation of the memory arena (--enable-g=memarena)
  */
 /* ------------------------------------------------------------------------- */
diff --git a/src/include/mpimem.h b/src/include/mpimem.h
index 4a65023..2cc926e 100644
--- a/src/include/mpimem.h
+++ b/src/include/mpimem.h
@@ -29,11 +29,9 @@ extern "C" {
 #define ATTRIBUTE(a)
 #endif
 
-#include "mpidbg.h"
-
-#if defined (USE_DBG_LOGGING)
-extern MPIU_DBG_Class MPIR_DBG_STRING;
-#endif /* USE_DBG_LOGGING */
+#if defined (MPL_USE_DBG_LOGGING)
+extern MPL_DBG_Class MPIR_DBG_STRING;
+#endif /* MPL_USE_DBG_LOGGING */
 
 /* ------------------------------------------------------------------------- */
 /* mpimem.h */
diff --git a/src/include/mpiutil.h b/src/include/mpiutil.h
index 7bff235..0609ff7 100644
--- a/src/include/mpiutil.h
+++ b/src/include/mpiutil.h
@@ -8,7 +8,6 @@
 
 #include "mpiu_strerror.h"
 #include "mpiu_type_defs.h"
-#include "mpidbg.h"
 #include "mpiassert.h"
 #include "mpiu_pointer.h"
 
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index 572e547..b797e86 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -210,7 +210,7 @@ int MPIC_Wait(MPID_Request * request_ptr, MPIR_Errflag_t *errflag)
 
     MPIDI_PT2PT_FUNC_ENTER(MPID_STATE_MPIC_WAIT);
 
-    MPIU_DBG_MSG_S(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
+    MPL_DBG_MSG_S(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
 
     if (request_ptr->kind == MPID_REQUEST_SEND)
         request_ptr->status.MPI_TAG = 0;
@@ -234,7 +234,7 @@ int MPIC_Wait(MPID_Request * request_ptr, MPIR_Errflag_t *errflag)
     MPIR_TAG_CLEAR_ERROR_BITS(request_ptr->status.MPI_TAG);
 
  fn_exit:
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_PT2PT_FUNC_EXIT(MPID_STATE_MPIC_WAIT);
     return mpi_errno;
  fn_fail:
@@ -278,7 +278,7 @@ int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SEND);
 
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
@@ -305,7 +305,7 @@ int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
     }
 
  fn_exit:
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SEND);
     return mpi_errno;
  fn_fail:
@@ -337,7 +337,7 @@ int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_RECV);
 
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
@@ -370,7 +370,7 @@ int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int
     }
 
  fn_exit:
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_RECV);
     return mpi_errno;
  fn_fail:
@@ -394,7 +394,7 @@ int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SSEND);
 
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
             "**countneg", "**countneg %d", count);
@@ -421,7 +421,7 @@ int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
     }
 
  fn_exit:
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SSEND);
     return mpi_errno;
  fn_fail:
@@ -455,7 +455,7 @@ int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SENDRECV);
 
-    MPIU_DBG_MSG_S(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
+    MPL_DBG_MSG_S(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
 
     MPIR_ERR_CHKANDJUMP1((sendcount < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", sendcount);
@@ -501,7 +501,7 @@ int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype
     MPID_Request_release(recv_req_ptr);
 
  fn_exit:
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SENDRECV);
     return mpi_errno;
@@ -542,7 +542,7 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SENDRECV_REPLACE);
 
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
@@ -603,7 +603,7 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
 
  fn_exit:
     MPIU_CHKLMEM_FREEALL();
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SENDRECV_REPLACE);
     return mpi_errno;
  fn_fail:
@@ -627,7 +627,7 @@ int MPIC_Isend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_ISEND);
 
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
@@ -668,7 +668,7 @@ int MPIC_Issend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_ISSEND);
 
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
@@ -744,7 +744,7 @@ int MPIC_Waitall(int numreq, MPID_Request *requests[], MPI_Status statuses[], MP
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_WAITALL);
 
-    MPIU_DBG_MSG_S(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
+    MPL_DBG_MSG_S(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
 
     if (statuses == MPI_STATUSES_IGNORE) {
         status_array = status_static_array;
@@ -781,7 +781,7 @@ int MPIC_Waitall(int numreq, MPID_Request *requests[], MPI_Status statuses[], MP
     if (numreq > MPIC_REQUEST_PTR_ARRAY_SIZE)
         MPIU_CHKLMEM_FREEALL();
 
-    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPL_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_WAITALL);
     return mpi_errno;
  fn_fail:
diff --git a/src/mpi/comm/comm_create.c b/src/mpi/comm/comm_create.c
index 9878bea..4cdb762 100644
--- a/src/mpi/comm/comm_create.c
+++ b/src/mpi/comm/comm_create.c
@@ -87,8 +87,8 @@ int MPIR_Comm_create_calculate_mapping(MPID_Group  *group_ptr,
             int g_lpid = group_ptr->lrank_to_lpid[i].lpid;
 
             /* This mapping is relative to comm world */
-            MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,
-                             (MPIU_DBG_FDEST,
+            MPL_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,
+                             (MPL_DBG_FDEST,
                               "comm-create - mapping into world[%d] = %d",
                               i, g_lpid ));
             if (g_lpid < wsize) {
@@ -100,7 +100,7 @@ int MPIR_Comm_create_calculate_mapping(MPID_Group  *group_ptr,
             }
         }
     }
-    MPIU_DBG_MSG_D(MPIR_DBG_COMM,VERBOSE, "subsetOfWorld=%d", subsetOfWorld );
+    MPL_DBG_MSG_D(MPIR_DBG_COMM,VERBOSE, "subsetOfWorld=%d", subsetOfWorld );
     if (subsetOfWorld) {
 #           ifdef HAVE_ERROR_CHECKING
         {
diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c
index 89c3105..47a508c 100644
--- a/src/mpi/comm/commutil.c
+++ b/src/mpi/comm/commutil.c
@@ -176,8 +176,8 @@ int MPIR_Setup_intercomm_localcomm(MPID_Comm * intercomm_ptr)
         MPID_CONTEXT_SET_FIELD(IS_LOCALCOMM, intercomm_ptr->recvcontext_id, 1);
     localcomm_ptr->context_id = localcomm_ptr->recvcontext_id;
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, TYPICAL,
-                     (MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_COMM, TYPICAL,
+                     (MPL_DBG_FDEST,
                       "setup_intercomm_localcomm ic=%p ic->context_id=%d ic->recvcontext_id=%d lc->recvcontext_id=%d",
                       intercomm_ptr, intercomm_ptr->context_id, intercomm_ptr->recvcontext_id,
                       localcomm_ptr->recvcontext_id));
@@ -562,7 +562,7 @@ int MPIR_Comm_commit(MPID_Comm * comm)
 
             /* Non-fatal errors simply mean that this communicator will not have
              * any node awareness.  Node-aware collectives are an optimization. */
-            MPIU_DBG_MSG_P(MPIR_DBG_COMM, VERBOSE, "MPIU_Find_local_and_external failed for comm_ptr=%p",
+            MPL_DBG_MSG_P(MPIR_DBG_COMM, VERBOSE, "MPIU_Find_local_and_external failed for comm_ptr=%p",
                            comm);
             if (comm->intranode_table)
                 MPIU_Free(comm->intranode_table);
@@ -598,7 +598,7 @@ int MPIR_Comm_commit(MPID_Comm * comm)
             comm->node_comm->comm_kind = MPID_INTRACOMM;
             comm->node_comm->hierarchy_kind = MPID_HIERARCHY_NODE;
             comm->node_comm->local_comm = NULL;
-            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Create node_comm=%p\n", comm->node_comm);
+            MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Create node_comm=%p\n", comm->node_comm);
 
             comm->node_comm->local_size = num_local;
             comm->node_comm->remote_size = num_local;
diff --git a/src/mpi/comm/contextid.c b/src/mpi/comm/contextid.c
index f8f77e8..777bff4 100644
--- a/src/mpi/comm/contextid.c
+++ b/src/mpi/comm/contextid.c
@@ -45,7 +45,7 @@ const int ALL_OWN_MASK_FLAG = MPIR_MAX_CONTEXT_MASK;
 
 /* utility function to pretty print a context ID for debugging purposes, see
  * mpiimpl.h for more info on the various fields */
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
 static void dump_context_id(MPIU_Context_id_t context_id, char *out_str, int len)
 {
     int subcomm_type = MPID_CONTEXT_READ_FIELD(SUBCOMM, context_id);
@@ -246,7 +246,7 @@ static int allocate_context_bit(uint32_t mask[], MPIU_Context_id_t id)
     /* clear the bit */
     mask[idx] &= ~(1 << bitpos);
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE, (MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE, (MPL_DBG_FDEST,
                                      "allocating contextid = %d, (mask=%p, mask[%d], bit %d)",
                                      id, mask, idx, bitpos));
     return id;
@@ -393,7 +393,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
 
     *context_id = 0;
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE, (MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE, (MPL_DBG_FDEST,
                                      "Entering; shared state is %d:%d, my ctx id is %d, tag=%d",
                                      mask_in_use, eager_in_use, comm_ptr->context_id, tag));
 
@@ -451,7 +451,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
             if (mask_in_use || &st != next_gcn) {
                 memset(st.local_mask, 0, MPIR_MAX_CONTEXT_MASK * sizeof(int));
                 st.own_mask = 0;
-                MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE, (MPIU_DBG_FDEST,
+                MPL_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE, (MPL_DBG_FDEST,
                                                  "Mask is in use, my context_id is %d, owner context id is %d",
                                                  st.comm_ptr->context_id,
                                                  next_gcn->comm_ptr->context_id));
@@ -466,7 +466,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
 
                 mask_in_use = 1;
                 st.own_mask = 1;
-                MPIU_DBG_MSG(MPIR_DBG_COMM, VERBOSE, "Copied local_mask");
+                MPL_DBG_MSG(MPIR_DBG_COMM, VERBOSE, "Copied local_mask");
             }
         }
         MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
@@ -513,7 +513,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
             /* There is a chance that we've found a context id */
             /* Find_and_allocate_context_id updates the context_mask if it finds a match */
             *context_id = find_and_allocate_context_id(st.local_mask);
-            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Context id is now %hd", *context_id);
+            MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Context id is now %hd", *context_id);
 
             st.own_eager_mask = 0;
             eager_in_use = 0;
@@ -533,7 +533,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
             /* There is a chance that we've found a context id */
             /* Find_and_allocate_context_id updates the context_mask if it finds a match */
             *context_id = find_and_allocate_context_id(st.local_mask);
-            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Context id is now %hd", *context_id);
+            MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Context id is now %hd", *context_id);
 
             mask_in_use = 0;
 
@@ -626,7 +626,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
   fn_exit:
     if (ignore_id)
         *context_id = MPIU_INVALID_CONTEXT_ID;
-    MPIU_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "Context mask = %s", context_mask_to_str());
+    MPL_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "Context mask = %s", context_mask_to_str());
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_GET_CONTEXTID);
     return mpi_errno;
 
@@ -1201,7 +1201,7 @@ void MPIR_Free_contextid(MPIU_Context_id_t context_id)
      * same way that low bits of non-dynamic ctx IDs do.  So we have to
      * check the dynamic case first. */
     if (MPID_CONTEXT_READ_FIELD(DYNAMIC_PROC, context_id)) {
-        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "skipping dynamic process ctx id, context_id=%d", context_id);
+        MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "skipping dynamic process ctx id, context_id=%d", context_id);
         goto fn_exit;
     }
     else {      /* non-dynamic context ID */
@@ -1210,15 +1210,15 @@ void MPIR_Free_contextid(MPIU_Context_id_t context_id)
          * don't free the context ID for localcomms and assume it will be cleaned up
          * when the parent intercomm is itself completely freed. */
         if (MPID_CONTEXT_READ_FIELD(IS_LOCALCOMM, context_id)) {
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
             char dump_str[1024];
             dump_context_id(context_id, dump_str, sizeof(dump_str));
-            MPIU_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "skipping localcomm id: %s", dump_str);
+            MPL_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "skipping localcomm id: %s", dump_str);
 #endif
             goto fn_exit;
         }
         else if (MPID_CONTEXT_READ_FIELD(SUBCOMM, context_id)) {
-            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "skipping non-parent communicator ctx id, context_id=%d",
+            MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "skipping non-parent communicator ctx id, context_id=%d",
                            context_id);
             goto fn_exit;
         }
@@ -1227,11 +1227,11 @@ void MPIR_Free_contextid(MPIU_Context_id_t context_id)
     /* --BEGIN ERROR HANDLING-- */
     /* Check that this context id has been allocated */
     if ((context_mask[idx] & (0x1 << bitpos)) != 0) {
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
         char dump_str[1024];
         dump_context_id(context_id, dump_str, sizeof(dump_str));
-        MPIU_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "context dump: %s", dump_str);
-        MPIU_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "context mask = %s", context_mask_to_str());
+        MPL_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "context dump: %s", dump_str);
+        MPL_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "context mask = %s", context_mask_to_str());
 #endif
         MPID_Abort(0, MPI_ERR_INTERN, 1, "In MPIR_Free_contextid, the context id is not in use");
     }
@@ -1244,8 +1244,8 @@ void MPIR_Free_contextid(MPIU_Context_id_t context_id)
     context_mask[idx] |= (0x1 << bitpos);
     MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
-                     (MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
+                     (MPL_DBG_FDEST,
                       "Freed context %d, mask[%d] bit %d (prefix=%#x)",
                       context_id, idx, bitpos, raw_prefix));
   fn_exit:
diff --git a/src/mpi/comm/intercomm_create.c b/src/mpi/comm/intercomm_create.c
index fcde213..436293d 100644
--- a/src/mpi/comm/intercomm_create.c
+++ b/src/mpi/comm/intercomm_create.c
@@ -164,7 +164,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
         local_size = local_comm_ptr->local_size;
 
         /* printf( "About to sendrecv in intercomm_create\n" );fflush(stdout);*/
-        MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPIU_DBG_FDEST,"rank %d sendrecv to rank %d", peer_comm_ptr->rank,
+        MPL_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPL_DBG_FDEST,"rank %d sendrecv to rank %d", peer_comm_ptr->rank,
                                        remote_leader));
         mpi_errno = MPIC_Sendrecv( &local_size,  1, MPI_INT,
                                       remote_leader, cts_tag,
@@ -173,7 +173,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
                                       peer_comm_ptr, MPI_STATUS_IGNORE, &errflag );
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-        MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPIU_DBG_FDEST, "local size = %d, remote size = %d", local_size,
+        MPL_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPL_DBG_FDEST, "local size = %d, remote size = %d", local_size,
                                        remote_size ));
         /* With this information, we can now send and receive the
            global process ids from the peer. */
@@ -231,7 +231,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
      * we know that the local and remote groups are disjoint, this
      * step will complete
      */
-    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPIU_DBG_FDEST,"About to get contextid (local_size=%d) on rank %d",
+    MPL_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPL_DBG_FDEST,"About to get contextid (local_size=%d) on rank %d",
                                     local_comm_ptr->local_size, local_comm_ptr->rank ));
     /* In the multi-threaded case, MPIR_Get_contextid_sparse assumes that the
        calling routine already holds the single criticial section */
@@ -239,7 +239,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
     mpi_errno = MPIR_Get_contextid_sparse( local_comm_ptr, &recvcontext_id, FALSE );
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIU_Assert(recvcontext_id != 0);
-    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPIU_DBG_FDEST,"Got contextid=%d", recvcontext_id));
+    MPL_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPL_DBG_FDEST,"Got contextid=%d", recvcontext_id));
 
     /* Leaders can now swap context ids and then broadcast the value
        to the local group of processes */
@@ -258,7 +258,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
         comm_info[0] = remote_size;
         comm_info[1] = final_context_id;
         comm_info[2] = is_low_group;
-        MPIU_DBG_MSG(MPIR_DBG_COMM,VERBOSE,"About to bcast on local_comm");
+        MPL_DBG_MSG(MPIR_DBG_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) MPIR_ERR_POP(mpi_errno);
         MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
@@ -266,13 +266,13 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
                                      local_comm_ptr, &errflag );
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
-        MPIU_DBG_MSG_D(MPIR_DBG_COMM,VERBOSE,"end of bcast on local_comm of size %d",
+        MPL_DBG_MSG_D(MPIR_DBG_COMM,VERBOSE,"end of bcast on local_comm of size %d",
                        local_comm_ptr->local_size );
     }
     else
     {
         /* we're the other processes */
-        MPIU_DBG_MSG(MPIR_DBG_COMM,VERBOSE,"About to receive bcast on local_comm");
+        MPL_DBG_MSG(MPIR_DBG_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) MPIR_ERR_POP(mpi_errno);
         MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
diff --git a/src/mpi/datatype/type_get_name.c b/src/mpi/datatype/type_get_name.c
index eff3446..507ab14 100644
--- a/src/mpi/datatype/type_get_name.c
+++ b/src/mpi/datatype/type_get_name.c
@@ -178,7 +178,7 @@ int MPIR_Datatype_init_names(void)
 			      "**typeinitfail", "**typeinitfail %d", i - 1);
 	    }
 
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,
 		   "mpi_names[%d].name = %p", i, mpi_names[i].name));
 
 	    MPL_strncpy(datatype_ptr->name, mpi_names[i].name,
diff --git a/src/mpi/debugger/dbginit.c b/src/mpi/debugger/dbginit.c
index 6027675..dc6fe9c 100644
--- a/src/mpi/debugger/dbginit.c
+++ b/src/mpi/debugger/dbginit.c
@@ -293,7 +293,7 @@ void MPIR_WaitForDebugger( void )
  */
 void * MPIR_Breakpoint( void )
 {
-    MPIU_DBG_MSG(MPIR_DBG_OTHER,VERBOSE,"In MPIR_Breakpoint");
+    MPL_DBG_MSG(MPIR_DBG_OTHER,VERBOSE,"In MPIR_Breakpoint");
     return 0;
 }
 #endif
@@ -452,9 +452,9 @@ MPIR_Comm_list MPIR_All_communicators = { 0, 0 };
 
 void MPIR_CommL_remember( MPID_Comm *comm_ptr )
 {   
-    MPIU_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
+    MPL_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
 		   "Adding communicator %p to remember list",comm_ptr);
-    MPIU_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
+    MPL_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
 		   "Remember list structure address is %p",&MPIR_All_communicators);
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_COMM_MUTEX(comm_ptr));
     if (comm_ptr == MPIR_All_communicators.head) {
@@ -464,7 +464,7 @@ void MPIR_CommL_remember( MPID_Comm *comm_ptr )
     comm_ptr->comm_next = MPIR_All_communicators.head;
     MPIR_All_communicators.head = comm_ptr;
     MPIR_All_communicators.sequence_number++;
-    MPIU_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
+    MPL_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
 		   "master head is %p", MPIR_All_communicators.head );
 
     MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_COMM_MUTEX(comm_ptr));
@@ -474,7 +474,7 @@ void MPIR_CommL_forget( MPID_Comm *comm_ptr )
 {
     MPID_Comm *p, *prev;
 
-    MPIU_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
+    MPL_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
 		   "Forgetting communicator %p from remember list",comm_ptr);
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_COMM_MUTEX(comm_ptr));
     p = MPIR_All_communicators.head;
diff --git a/src/mpi/errhan/errnames.txt b/src/mpi/errhan/errnames.txt
index 1f60dd1..e76d87c 100644
--- a/src/mpi/errhan/errnames.txt
+++ b/src/mpi/errhan/errnames.txt
@@ -839,8 +839,6 @@ is too big (> MPIU_SHMW_GHND_SZ)
 **mktemp_s %s:mktemp_s failed, %s
 **lseek:lseek failed
 **lseek %s:lseek failed - %s
-**fdopen:fdopen failed
-**fdopen %s:fdopen failed %s
 **tmpnam:tmpnam failed
 **tmpnam %s:tmpnam failed %s
 **fopen:fopen failed
diff --git a/src/mpi/errhan/errutil.c b/src/mpi/errhan/errutil.c
index 177fb6b..a9a0a52 100644
--- a/src/mpi/errhan/errutil.c
+++ b/src/mpi/errhan/errutil.c
@@ -253,7 +253,7 @@ int MPIR_Err_return_comm( MPID_Comm  *comm_ptr, const char fcname[],
     }
     /* --END ERROR HANDLING-- */
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TERSE, (MPIU_DBG_FDEST, "MPIR_Err_return_comm(comm_ptr=%p, fcname=%s, errcode=%d)", comm_ptr, fcname, errcode));
+    MPL_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TERSE, (MPL_DBG_FDEST, "MPIR_Err_return_comm(comm_ptr=%p, fcname=%s, errcode=%d)", comm_ptr, fcname, errcode));
 
     if (comm_ptr) {
         MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_COMM_MUTEX(comm_ptr));
@@ -357,7 +357,7 @@ int MPIR_Err_return_win( MPID_Win  *win_ptr, const char fcname[], int errcode )
 
     checkValidErrcode( error_class, fcname, &errcode );
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TERSE, (MPIU_DBG_FDEST, "MPIR_Err_return_win(win_ptr=%p, fcname=%s, errcode=%d)", win_ptr, fcname, errcode));
+    MPL_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TERSE, (MPL_DBG_FDEST, "MPIR_Err_return_win(win_ptr=%p, fcname=%s, errcode=%d)", win_ptr, fcname, errcode));
 
     /* --BEGIN ERROR HANDLING-- */
     if (MPIR_Err_is_fatal(errcode) ||
@@ -656,7 +656,7 @@ int MPIR_Err_create_code( int lastcode, int fatal, const char fcname[],
 			  int line, int error_class, const char generic_msg[],
 			  const char specific_msg[], ... )
 {
-    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
+    MPL_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPL_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
                                         fatal ? "Fatal " : "", lastcode, error_class, fcname, line, generic_msg));
     return (lastcode == MPI_SUCCESS) ? error_class : lastcode;
 }
@@ -686,7 +686,7 @@ int MPIR_Err_create_code( int lastcode, int fatal, const char fcname[],
 			  int line, int error_class, const char generic_msg[],
 			  const char specific_msg[], ... )
 {
-    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
+    MPL_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPL_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
                                         fatal ? "Fatal " : "", lastcode, error_class, fcname, line, generic_msg));
     return (lastcode == MPI_SUCCESS) ? error_class : lastcode;
 }
@@ -727,7 +727,7 @@ int MPIR_Err_create_code( int lastcode, int fatal, const char fcname[],
     int rc;
     va_list Argp;
     va_start(Argp, specific_msg);
-    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
+    MPL_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPL_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
                                         fatal ? "Fatal " : "", lastcode, error_class, fcname, line, generic_msg));
     rc = MPIR_Err_create_code_valist( lastcode, fatal, fcname, line,
 				      error_class, generic_msg, specific_msg,
@@ -869,7 +869,7 @@ int MPIR_Err_create_code( int lastcode, int fatal, const char fcname[],
     int rc;
     va_list Argp;
     va_start(Argp, specific_msg);
-    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
+    MPL_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPL_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
                                         fatal ? "Fatal " : "", lastcode, error_class, fcname, line, generic_msg));
     rc = MPIR_Err_create_code_valist( lastcode, fatal, fcname, line,
 				      error_class, generic_msg, specific_msg,
@@ -1084,10 +1084,10 @@ int MPIR_Err_create_code_valist( int lastcode, int fatal, const char fcname[],
 		ErrorRing[ring_idx].location[0] = '\0';
 	    }
             {
-                MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "New ErrorRing[%d]", ring_idx));
-                MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "    id         = %#010x", ErrorRing[ring_idx].id));
-                MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "    prev_error = %#010x", ErrorRing[ring_idx].prev_error));
-                MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "    user=%d", ErrorRing[ring_idx].use_user_error_code));
+                MPL_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPL_DBG_FDEST, "New ErrorRing[%d]", ring_idx));
+                MPL_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPL_DBG_FDEST, "    id         = %#010x", ErrorRing[ring_idx].id));
+                MPL_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPL_DBG_FDEST, "    prev_error = %#010x", ErrorRing[ring_idx].prev_error));
+                MPL_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPL_DBG_FDEST, "    user=%d", ErrorRing[ring_idx].use_user_error_code));
             }
 	}
 	error_ring_mutex_unlock();
@@ -1885,7 +1885,7 @@ static int checkErrcodeIsValid( int errcode )
     if (errcode <= MPIR_MAX_ERROR_CLASS_INDEX && errcode >= 0) return 0;
 
     convertErrcodeToIndexes( errcode, &ring_idx, &ring_id, &generic_idx );
-    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, VERBOSE, (MPIU_DBG_FDEST, "code=%#010x ring_idx=%d ring_id=%#010x generic_idx=%d",
+    MPL_DBG_MSG_FMT(MPIR_DBG_ERRHAND, VERBOSE, (MPL_DBG_FDEST, "code=%#010x ring_idx=%d ring_id=%#010x generic_idx=%d",
                                         errcode, ring_idx, ring_id, generic_idx));
 
     if (ring_idx < 0 || ring_idx >= MAX_ERROR_RING ||
diff --git a/src/mpi/group/group_translate_ranks.c b/src/mpi/group/group_translate_ranks.c
index 5307b65..a0ac503 100644
--- a/src/mpi/group/group_translate_ranks.c
+++ b/src/mpi/group/group_translate_ranks.c
@@ -37,7 +37,7 @@ int MPIR_Group_translate_ranks_impl(MPID_Group *gp1, int n, const int ranks1[],
     int mpi_errno = MPI_SUCCESS;
     int i, g2_idx, l1_pid, l2_pid;
 
-    MPIU_DBG_MSG_S(MPIR_DBG_OTHER,VERBOSE,"gp2->is_local_dense_monotonic=%s", (gp2->is_local_dense_monotonic ? "TRUE" : "FALSE"));
+    MPL_DBG_MSG_S(MPIR_DBG_OTHER,VERBOSE,"gp2->is_local_dense_monotonic=%s", (gp2->is_local_dense_monotonic ? "TRUE" : "FALSE"));
 
     /* Initialize the output ranks */
     for (i=0; i<n; i++)
diff --git a/src/mpi/group/grouputil.c b/src/mpi/group/grouputil.c
index 89ab9e8..34c9d9c 100644
--- a/src/mpi/group/grouputil.c
+++ b/src/mpi/group/grouputil.c
@@ -396,12 +396,12 @@ int MPIR_Group_check_subset( MPID_Group *group_ptr, MPID_Comm *comm_ptr )
     MPIR_Group_setup_lpid_list( group_ptr );
     g1_idx = group_ptr->idx_of_first_lpid;
     g2_idx = mergesort_lpidarray( vmap, vsize );
-    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPL_DBG_FDEST,
 			   "initial indices: %d %d\n", g1_idx, g2_idx ));
     while (g1_idx >= 0 && g2_idx >= 0) {
 	l1_pid = group_ptr->lrank_to_lpid[g1_idx].lpid;
 	l2_pid = vmap[g2_idx].lpid;
-	MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPL_DBG_FDEST,
 				       "Lpids are %d, %d\n", l1_pid, l2_pid ));
 	if (l1_pid < l2_pid) {
 	    /* If we have to advance g1, we didn't find a match, so
@@ -416,7 +416,7 @@ int MPIR_Group_check_subset( MPID_Group *group_ptr, MPID_Comm *comm_ptr )
 	    g1_idx = group_ptr->lrank_to_lpid[g1_idx].next_lpid;
 	    g2_idx = vmap[g2_idx].next_lpid;
 	}
-	MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPL_DBG_FDEST,
 				       "g1 = %d, g2 = %d\n", g1_idx, g2_idx ));
     }
 
diff --git a/src/mpi/init/init.c b/src/mpi/init/init.c
index d5e01dc..5a43852 100644
--- a/src/mpi/init/init.c
+++ b/src/mpi/init/init.c
@@ -123,8 +123,8 @@ int MPI_Init( int *argc, char ***argv )
     MPID_MPI_INIT_STATE_DECL(MPID_STATE_MPI_INIT);
 
     rc = MPID_Wtime_init();
-#ifdef USE_DBG_LOGGING
-    MPIU_DBG_PreInit( argc, argv, rc );
+#ifdef MPL_USE_DBG_LOGGING
+    MPL_DBG_PreInit( argc, argv, rc );
 #endif
 
     MPID_MPI_INIT_FUNC_ENTER(MPID_STATE_MPI_INIT);
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 1007c8d..2baea92 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -227,7 +227,7 @@ static int thread_cs_init( void )
 
     MPID_THREADPRIV_KEY_CREATE;
 
-    MPIU_DBG_MSG(MPIR_DBG_INIT,TYPICAL,"Created global mutex and private storage");
+    MPL_DBG_MSG(MPIR_DBG_INIT,TYPICAL,"Created global mutex and private storage");
     return MPI_SUCCESS;
 }
 
@@ -239,7 +239,7 @@ int MPIR_Thread_CS_Finalize( void )
 {
     int err;
 
-    MPIU_DBG_MSG(MPIR_DBG_INIT,TYPICAL,"Freeing global mutex and private storage");
+    MPL_DBG_MSG(MPIR_DBG_INIT,TYPICAL,"Freeing global mutex and private storage");
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL
 /* There is a single, global lock, held for the duration of an MPI call */
     MPID_Thread_mutex_destroy(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
@@ -299,21 +299,21 @@ MPI_F08_Status *MPI_F08_STATUS_IGNORE = &MPIR_F08_MPI_STATUS_IGNORE_OBJ;
 MPI_F08_Status *MPI_F08_STATUSES_IGNORE = &MPIR_F08_MPI_STATUSES_IGNORE_OBJ[0];
 #endif
 
-#if defined (USE_DBG_LOGGING)
-MPIU_DBG_Class MPIR_DBG_INIT;
-MPIU_DBG_Class MPIR_DBG_PT2PT;
-MPIU_DBG_Class MPIR_DBG_THREAD;
-MPIU_DBG_Class MPIR_DBG_DATATYPE;
-MPIU_DBG_Class MPIR_DBG_HANDLE;
-MPIU_DBG_Class MPIR_DBG_COMM;
-MPIU_DBG_Class MPIR_DBG_BSEND;
-MPIU_DBG_Class MPIR_DBG_ERRHAND;
-MPIU_DBG_Class MPIR_DBG_OTHER;
+#if defined (MPL_USE_DBG_LOGGING)
+MPL_DBG_Class MPIR_DBG_INIT;
+MPL_DBG_Class MPIR_DBG_PT2PT;
+MPL_DBG_Class MPIR_DBG_THREAD;
+MPL_DBG_Class MPIR_DBG_DATATYPE;
+MPL_DBG_Class MPIR_DBG_HANDLE;
+MPL_DBG_Class MPIR_DBG_COMM;
+MPL_DBG_Class MPIR_DBG_BSEND;
+MPL_DBG_Class MPIR_DBG_ERRHAND;
+MPL_DBG_Class MPIR_DBG_OTHER;
 
 /* these classes might need to move out later */
-MPIU_DBG_Class MPIR_DBG_ASSERT;
-MPIU_DBG_Class MPIR_DBG_STRING;
-#endif /* USE_DBG_LOGGING */
+MPL_DBG_Class MPIR_DBG_ASSERT;
+MPL_DBG_Class MPIR_DBG_STRING;
+#endif /* MPL_USE_DBG_LOGGING */
 
 #undef FUNCNAME
 #define FUNCNAME MPIR_Init_thread
@@ -538,26 +538,26 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
        separate memory leaks in the initialization code from 
        leaks in the "active" code */
 #endif
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
     /* FIXME: This is a hack to handle the common case of two worlds.
      * If the parent comm is not NULL, we always give the world number
      * as "1" (false). */
-    MPIU_DBG_Init( argc, argv, has_args, has_env, 
+    MPL_DBG_Init( argc, argv, has_args, has_env,
 		   MPIR_Process.comm_parent != NULL, MPIR_Process.comm_world->rank,
                    MPIR_ThreadInfo.isThreaded );
 
-    MPIR_DBG_INIT = MPIU_DBG_Class_alloc("INIT", "init");
-    MPIR_DBG_PT2PT = MPIU_DBG_Class_alloc("PT2PT", "pt2pt");
-    MPIR_DBG_THREAD = MPIU_DBG_Class_alloc("THREAD", "thread");
-    MPIR_DBG_DATATYPE = MPIU_DBG_Class_alloc("DATATYPE", "datatype");
-    MPIR_DBG_HANDLE = MPIU_DBG_Class_alloc("HANDLE", "handle");
-    MPIR_DBG_COMM = MPIU_DBG_Class_alloc("COMM", "comm");
-    MPIR_DBG_BSEND = MPIU_DBG_Class_alloc("BSEND", "bsend");
-    MPIR_DBG_ERRHAND = MPIU_DBG_Class_alloc("ERRHAND", "errhand");
-    MPIR_DBG_OTHER = MPIU_DBG_Class_alloc("OTHER", "other");
-
-    MPIR_DBG_ASSERT = MPIU_DBG_Class_alloc("ASSERT", "assert");
-    MPIR_DBG_STRING = MPIU_DBG_Class_alloc("STRING", "string");
+    MPIR_DBG_INIT = MPL_DBG_Class_alloc("INIT", "init");
+    MPIR_DBG_PT2PT = MPL_DBG_Class_alloc("PT2PT", "pt2pt");
+    MPIR_DBG_THREAD = MPL_DBG_Class_alloc("THREAD", "thread");
+    MPIR_DBG_DATATYPE = MPL_DBG_Class_alloc("DATATYPE", "datatype");
+    MPIR_DBG_HANDLE = MPL_DBG_Class_alloc("HANDLE", "handle");
+    MPIR_DBG_COMM = MPL_DBG_Class_alloc("COMM", "comm");
+    MPIR_DBG_BSEND = MPL_DBG_Class_alloc("BSEND", "bsend");
+    MPIR_DBG_ERRHAND = MPL_DBG_Class_alloc("ERRHAND", "errhand");
+    MPIR_DBG_OTHER = MPL_DBG_Class_alloc("OTHER", "other");
+
+    MPIR_DBG_ASSERT = MPL_DBG_Class_alloc("ASSERT", "assert");
+    MPIR_DBG_STRING = MPL_DBG_Class_alloc("STRING", "string");
 #endif
 
     /* Initialize the C versions of the Fortran link-time constants.
@@ -656,8 +656,8 @@ int MPI_Init_thread( int *argc, char ***argv, int required, int *provided )
     MPID_MPI_INIT_STATE_DECL(MPID_STATE_MPI_INIT_THREAD);
 
     rc = MPID_Wtime_init();
-#ifdef USE_DBG_LOGGING
-    MPIU_DBG_PreInit( argc, argv, rc );
+#ifdef MPL_USE_DBG_LOGGING
+    MPL_DBG_PreInit( argc, argv, rc );
 #endif
 
     MPID_MPI_INIT_FUNC_ENTER(MPID_STATE_MPI_INIT_THREAD);
diff --git a/src/mpi/pt2pt/bsendutil.c b/src/mpi/pt2pt/bsendutil.c
index 060f62b..66df682 100644
--- a/src/mpi/pt2pt/bsendutil.c
+++ b/src/mpi/pt2pt/bsendutil.c
@@ -39,7 +39,7 @@
  *                information in the bsend buffer (the MPIR_Bsend_data_t entries)
  */
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
 static void MPIR_Bsend_dump( void );
 #endif
 
@@ -236,7 +236,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
     else
         packsize = count;
 
-    MPIU_DBG_MSG_D(MPIR_DBG_BSEND,TYPICAL,"looking for buffer of size " MPI_AINT_FMT_DEC_SPEC, packsize);
+    MPL_DBG_MSG_D(MPIR_DBG_BSEND,TYPICAL,"looking for buffer of size " MPI_AINT_FMT_DEC_SPEC, packsize);
     /*
      * Use two passes.  Each pass is the same; between the two passes,
      * attempt to complete any active requests, and start any pending
@@ -247,7 +247,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
 	
 	p = MPIR_Bsend_find_buffer( packsize );
 	if (p) {
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPIU_DBG_FDEST,
+	    MPL_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPL_DBG_FDEST,
                      "found buffer of size " MPI_AINT_FMT_DEC_SPEC " with address %p",packsize,p));
 	    /* Found a segment */
 
@@ -279,8 +279,8 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
                how we signal failure to send. */
 
 	    if (p->request) {
-		MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,
-		    (MPIU_DBG_FDEST,"saving request %p in %p",p->request,p));
+		MPL_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,
+		    (MPL_DBG_FDEST,"saving request %p in %p",p->request,p));
 		/* An optimization is to check to see if the 
 		   data has already been sent.  The original code
 		   to do this was commented out and probably did not match
@@ -295,7 +295,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
 	    Note that the test on phere is redundant, as the code breaks 
 	    out of the loop in the test above if a block p is found. */
 	if (p || pass == 1) break;
-	MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Could not find storage, checking active");
+	MPL_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Could not find storage, checking active");
 	/* Try to complete some pending bsends */
 	MPIR_Bsend_check_active( );
 	/* Give priority to any pending operations */
@@ -306,8 +306,8 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
 	/* Return error for no buffer space found */
 	/* Generate a traceback of the allocated space, explaining why
 	   packsize could not be found */
-	MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Could not find space; dumping arena" );
-	MPIU_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
+	MPL_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Could not find space; dumping arena" );
+	MPL_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
         MPIR_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_BUFFER, "**bufbsend", "**bufbsend %d %d", packsize, BsendBuffer.buffer_size);
     }
     
@@ -331,7 +331,7 @@ int MPIR_Bsend_free_req_seg( MPID_Request* req )
     int mpi_errno = MPI_ERR_INTERN;
     MPIR_Bsend_data_t *active = BsendBuffer.active;
 
-    MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Checking active starting at %p", active);
+    MPL_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Checking active starting at %p", active);
     while (active) {
 
 	if (active->request == req) {
@@ -341,7 +341,7 @@ int MPIR_Bsend_free_req_seg( MPID_Request* req )
 
 	active = active->next;;
 
-	MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Next active is %p",active);
+	MPL_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Next active is %p",active);
     }
 
  fn_exit:
@@ -368,23 +368,23 @@ static void MPIR_Bsend_free_segment( MPIR_Bsend_data_t *p )
 {
     MPIR_Bsend_data_t *prev = p->prev, *avail = BsendBuffer.avail, *avail_prev;
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPL_DBG_FDEST,
                  "Freeing bsend segment at %p of size %llu, next at %p",
                  p, (unsigned long long) p->size, ((char *)p)+p->total_size));
 
-    MPIU_DBG_MSG_D(MPIR_DBG_BSEND,TYPICAL,
+    MPL_DBG_MSG_D(MPIR_DBG_BSEND,TYPICAL,
                    "At the begining of free_segment with size %llu:",
                    (unsigned long long) p->total_size );
-    MPIU_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
+    MPL_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
 
     /* Remove the segment from the active list */
     if (prev) {
-	MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"free segment is within active list");
+	MPL_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"free segment is within active list");
 	prev->next = p->next;
     }
     else {
 	/* p was at the head of the active list */
-	MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"free segment is head of active list");
+	MPL_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"free segment is head of active list");
 	BsendBuffer.active = p->next;
 	/* The next test sets the prev pointer to null */
     }
@@ -392,7 +392,7 @@ static void MPIR_Bsend_free_segment( MPIR_Bsend_data_t *p )
 	p->next->prev = prev;
     }
 
-    MPIU_DBG_STMT(MPIR_DBG_BSEND,VERBOSE,MPIR_Bsend_dump());
+    MPL_DBG_STMT(MPIR_DBG_BSEND,VERBOSE,MPIR_Bsend_dump());
 
     /* Merge into the avail list */
     /* Find avail_prev, avail, such that p is between them.
@@ -442,8 +442,8 @@ static void MPIR_Bsend_free_segment( MPIR_Bsend_data_t *p )
 	p->prev           = 0;
     }
 
-    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"At the end of free_segment:" );
-    MPIU_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
+    MPL_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"At the end of free_segment:" );
+    MPL_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
 }
 
 /* 
@@ -463,7 +463,7 @@ static int MPIR_Bsend_check_active( void )
     int mpi_errno = MPI_SUCCESS;
     MPIR_Bsend_data_t *active = BsendBuffer.active, *next_active;
 
-    MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Checking active starting at %p", active);
+    MPL_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Checking active starting at %p", active);
     while (active) {
 	MPI_Request r = active->request->handle;
 	int         flag;
@@ -497,11 +497,11 @@ static int MPIR_Bsend_check_active( void )
 	}
 	if (flag) {
 	    /* We're done.  Remove this segment */
-	    MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Removing segment %p", active);
+	    MPL_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Removing segment %p", active);
 	    MPIR_Bsend_free_segment( active );
 	}
 	active = next_active;
-	MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Next active is %p",active);
+	MPL_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Next active is %p",active);
     }
 
  fn_exit:
@@ -565,7 +565,7 @@ static void MPIR_Bsend_take_buffer( MPIR_Bsend_data_t *p, int size  )
     /* alloc_size is the amount of space (out of size) that we will 
        allocate for this buffer. */
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPL_DBG_FDEST,
                                     "Taking %d bytes from a block with %llu bytes\n",
                                     alloc_size, (unsigned long long) p->total_size ));
 
@@ -575,7 +575,7 @@ static void MPIR_Bsend_take_buffer( MPIR_Bsend_data_t *p, int size  )
 	   carve out a new block */
 	MPIR_Bsend_data_t *newp;
 	
-	MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Breaking block into used and allocated at %p", p );
+	MPL_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Breaking block into used and allocated at %p", p );
 	newp = (MPIR_Bsend_data_t *)( (char *)p + BSENDDATA_HEADER_TRUE_SIZE + 
 				alloc_size );
 	newp->total_size = p->total_size - alloc_size - 
@@ -594,7 +594,7 @@ static void MPIR_Bsend_take_buffer( MPIR_Bsend_data_t *p, int size  )
 	p->total_size = (char *)newp - (char*)p;
 	p->size       = p->total_size - BSENDDATA_HEADER_TRUE_SIZE;
 
-	MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPL_DBG_FDEST,
                                         "broken blocks p (%llu) and new (%llu)\n",
                                         (unsigned long long) p->total_size,
                                         (unsigned long long) newp->total_size ));
@@ -620,9 +620,9 @@ static void MPIR_Bsend_take_buffer( MPIR_Bsend_data_t *p, int size  )
     p->prev	       = 0;
     BsendBuffer.active = p;
 
-    MPIU_DBG_MSG_P(MPIR_DBG_BSEND,VERBOSE,"segment %p now head of active",p);
-    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"At end of take buffer" );
-    MPIU_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
+    MPL_DBG_MSG_P(MPIR_DBG_BSEND,VERBOSE,"segment %p now head of active",p);
+    MPL_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"At end of take buffer" );
+    MPL_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
 }
 
 static int MPIR_Bsend_finalize( void *p ATTRIBUTE((unused)) )
@@ -642,39 +642,39 @@ static int MPIR_Bsend_finalize( void *p ATTRIBUTE((unused)) )
 /* 
  * These routines are defined only if debug logging is enabled
  */
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
 static void MPIR_Bsend_dump( void )
 {
     MPIR_Bsend_data_t *a = BsendBuffer.avail;
 
-    MPIU_DBG_MSG_D(MPIR_DBG_BSEND, TYPICAL, "Total size is %llu",
+    MPL_DBG_MSG_D(MPIR_DBG_BSEND, TYPICAL, "Total size is %llu",
                    (unsigned long long) BsendBuffer.buffer_size);
-    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Avail list is:" );
+    MPL_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Avail list is:" );
     while (a) {
-        MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND, TYPICAL, (MPIU_DBG_FDEST, "[%p] totalsize = %llu(%llx)",
+        MPL_DBG_MSG_FMT(MPIR_DBG_BSEND, TYPICAL, (MPL_DBG_FDEST, "[%p] totalsize = %llu(%llx)",
                                           a, (unsigned long long) a->total_size,
                                           (unsigned long long) a->total_size));
 	if (a == a->next) {
-	    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,
+	    MPL_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,
 			 "@@@Corrupt list; avail block points at itself" );
 	    break;
 	}
 	a = a->next;
     }
     
-    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Active list is:" );
+    MPL_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Active list is:" );
     a = BsendBuffer.active;
     while (a) {
-        MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND, TYPICAL, (MPIU_DBG_FDEST, "[%p] totalsize = %llu(%llx)",
+        MPL_DBG_MSG_FMT(MPIR_DBG_BSEND, TYPICAL, (MPL_DBG_FDEST, "[%p] totalsize = %llu(%llx)",
                                           a, (unsigned long long) a->total_size,
                                           (unsigned long long) a->total_size));
 	if (a == a->next) {
-	    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,
+	    MPL_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,
 			 "@@@Corrupt list; active block points at itself" );
 	    break;
 	}
 	a = a->next;
     }
-    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"end of list" );
+    MPL_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"end of list" );
 }
 #endif
diff --git a/src/mpi/romio/adio/ad_gpfs/ad_gpfs_aggrs.c b/src/mpi/romio/adio/ad_gpfs/ad_gpfs_aggrs.c
index 77f148c..7d82fa2 100644
--- a/src/mpi/romio/adio/ad_gpfs/ad_gpfs_aggrs.c
+++ b/src/mpi/romio/adio/ad_gpfs/ad_gpfs_aggrs.c
@@ -23,7 +23,7 @@
 #endif
 
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
   #define AGG_DEBUG 1
 #endif
 
diff --git a/src/mpi/romio/adio/ad_gpfs/ad_gpfs_rdcoll.c b/src/mpi/romio/adio/ad_gpfs/ad_gpfs_rdcoll.c
index 81587b9..c8db75d 100644
--- a/src/mpi/romio/adio/ad_gpfs/ad_gpfs_rdcoll.c
+++ b/src/mpi/romio/adio/ad_gpfs/ad_gpfs_rdcoll.c
@@ -22,7 +22,7 @@
 #include "mpe.h"
 #endif
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
   #define RDCOLL_DEBUG 1
 #endif
 #ifdef AGGREGATION_PROFILE
diff --git a/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c b/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c
index 240c013..d578b67 100644
--- a/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c
+++ b/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c
@@ -28,7 +28,7 @@
 #endif
 
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
   #define AGG_DEBUG 1
 #endif
 
diff --git a/src/mpi/romio/adio/ad_gpfs/pe/ad_pe_aggrs.c b/src/mpi/romio/adio/ad_gpfs/pe/ad_pe_aggrs.c
index 8453238..7785eb8 100644
--- a/src/mpi/romio/adio/ad_gpfs/pe/ad_pe_aggrs.c
+++ b/src/mpi/romio/adio/ad_gpfs/pe/ad_pe_aggrs.c
@@ -24,7 +24,7 @@
 #include "mpe.h"
 #endif
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
   #define AGG_DEBUG 1
 #endif
 
diff --git a/src/mpi/romio/adio/common/ad_iread_coll.c b/src/mpi/romio/adio/common/ad_iread_coll.c
index 3255106..e0f92c4 100644
--- a/src/mpi/romio/adio/common/ad_iread_coll.c
+++ b/src/mpi/romio/adio/common/ad_iread_coll.c
@@ -9,7 +9,7 @@
 #include "mpiu_greq.h"
 #include "mpioimpl.h"
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
   #define RDCOLL_DEBUG 1
 #endif
 #ifdef AGGREGATION_PROFILE
diff --git a/src/mpi/romio/adio/common/ad_read_coll.c b/src/mpi/romio/adio/common/ad_read_coll.c
index 93d22ed..6cd5d93 100644
--- a/src/mpi/romio/adio/common/ad_read_coll.c
+++ b/src/mpi/romio/adio/common/ad_read_coll.c
@@ -8,7 +8,7 @@
 #include "adio.h"
 #include "adio_extern.h"
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
   #define RDCOLL_DEBUG 1
 #endif
 #ifdef AGGREGATION_PROFILE
diff --git a/src/mpi/romio/adio/common/flatten.c b/src/mpi/romio/adio/common/flatten.c
index d51f63d..c948f95 100644
--- a/src/mpi/romio/adio/common/flatten.c
+++ b/src/mpi/romio/adio/common/flatten.c
@@ -7,7 +7,7 @@
 #include "adio.h"
 #include "adio_extern.h"
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
   #define FLATTEN_DEBUG 1
 #endif
 
diff --git a/src/mpi/romio/adio/common/lock.c b/src/mpi/romio/adio/common/lock.c
index 2590d77..e428f63 100644
--- a/src/mpi/romio/adio/common/lock.c
+++ b/src/mpi/romio/adio/common/lock.c
@@ -124,8 +124,8 @@ int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence,
     errno = 0;
     do {
 	err = fcntl(fd, cmd, &lock);
-#ifdef USE_DBG_LOGGING
-/*      if (MPIU_DBG_SELECTED(ROMIO,TERSE)) */
+#ifdef MPL_USE_DBG_LOGGING
+/*      if (MPL_DBG_SELECTED(ROMIO,TERSE)) */
       {
         if (err && ((errno == EINTR) || (errno == EINPROGRESS)))
         {
diff --git a/src/mpi/romio/adio/include/adioi.h b/src/mpi/romio/adio/include/adioi.h
index b49648c..26116f9 100644
--- a/src/mpi/romio/adio/include/adioi.h
+++ b/src/mpi/romio/adio/include/adioi.h
@@ -1022,7 +1022,7 @@ int  ADIOI_MPE_iwrite_b;
   #define MPIU_Upint unsigned long
 #endif
 
-#ifdef USE_DBG_LOGGING    /*todo fix dependency on mpich?*/
+#ifdef MPL_USE_DBG_LOGGING    /*todo fix dependency on mpich?*/
 /* DBGT_FPRINTF terse level printing */
 #define DBGT_FPRINTF if (MPIR_Ext_dbg_romio_verbose_enabled) fprintf(stderr,"%s:%d:",__FILE__,__LINE__); \
 if (MPIR_Ext_dbg_romio_terse_enabled) fprintf
diff --git a/src/mpi/topo/topoutil.c b/src/mpi/topo/topoutil.c
index 5cf2089..6f446c6 100644
--- a/src/mpi/topo/topoutil.c
+++ b/src/mpi/topo/topoutil.c
@@ -355,15 +355,15 @@ int MPIR_Topo_canon_nhb(MPID_Comm *comm_ptr,
         MPIU_Assert(FALSE);
     }
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
     {
         int i;
-        MPIU_DBG_MSG_FMT(MPIR_DBG_PT2PT, VERBOSE, (MPIU_DBG_FDEST, "canonical neighbors for comm=0x%x comm_ptr=%p", comm_ptr->handle, comm_ptr));
+        MPL_DBG_MSG_FMT(MPIR_DBG_PT2PT, VERBOSE, (MPL_DBG_FDEST, "canonical neighbors for comm=0x%x comm_ptr=%p", comm_ptr->handle, comm_ptr));
         for (i = 0; i < outdegree; ++i) {
-            MPIU_DBG_MSG_FMT(MPIR_DBG_PT2PT, VERBOSE, (MPIU_DBG_FDEST, "%d/%d: to   %d", i, outdegree, dests[i]));
+            MPL_DBG_MSG_FMT(MPIR_DBG_PT2PT, VERBOSE, (MPL_DBG_FDEST, "%d/%d: to   %d", i, outdegree, dests[i]));
         }
         for (i = 0; i < indegree; ++i) {
-            MPIU_DBG_MSG_FMT(MPIR_DBG_PT2PT, VERBOSE, (MPIU_DBG_FDEST, "%d/%d: from %d", i, indegree, sources[i]));
+            MPL_DBG_MSG_FMT(MPIR_DBG_PT2PT, VERBOSE, (MPL_DBG_FDEST, "%d/%d: from %d", i, indegree, sources[i]));
         }
     }
 #endif
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 f81221b..2e8f862 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_impl.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_impl.h
@@ -141,7 +141,7 @@ typedef union MPIDI_CH3_nem_pkt
         MPID_Request *_rts_req;                                                                         \
         MPL_IOV _iov[2];                                                                               \
                                                                                                         \
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv RTS packet");                                      \
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv RTS packet");                                      \
         (rts_pkt)->cookie_len = (s_cookie_len);                                                         \
                                                                                                         \
         _iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST)(rts_pkt);                                            \
@@ -149,7 +149,7 @@ typedef union MPIDI_CH3_nem_pkt
         _iov[1].MPL_IOV_BUF = (MPL_IOV_BUF_CAST)(s_cookie_buf);                                       \
         _iov[1].MPL_IOV_LEN = (s_cookie_len);                                                          \
                                                                                                         \
-        MPIU_DBG_MSGPKT((vc), (rts_pkt)->match.parts.tag, (rts_pkt)->match.parts.context_id, (rts_pkt)->match.parts.rank, \
+        MPL_DBG_MSGPKT((vc), (rts_pkt)->match.parts.tag, (rts_pkt)->match.parts.context_id, (rts_pkt)->match.parts.rank, \
                         (rts_pkt)->data_sz, "Rndv");                                                    \
                                                                                                         \
         mpi_errno = MPIDI_CH3_iStartMsgv((vc), _iov, ((s_cookie_len)) ? 2 : 1, &_rts_req);              \
@@ -185,7 +185,7 @@ typedef union MPIDI_CH3_nem_pkt
         MPID_Request *_cts_req;                                                                         \
         MPL_IOV _iov[2];                                                                               \
                                                                                                         \
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv CTS packet");                                      \
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv CTS packet");                                      \
         MPIDI_Pkt_init(_cts_pkt, MPIDI_NEM_PKT_LMT_CTS);                                                \
         _cts_pkt->sender_req_id = (rreq)->ch.lmt_req_id;                                                \
         _cts_pkt->receiver_req_id = (rreq)->handle;                                                     \
@@ -218,7 +218,7 @@ static inline int MPID_nem_lmt_send_COOKIE(MPIDI_VC_t *vc, MPID_Request *req,
     MPID_Request *cookie_req;
     MPL_IOV iov[2];
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv COOKIE packet");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv COOKIE packet");
     MPIDI_Pkt_init(cookie_pkt, MPIDI_NEM_PKT_LMT_COOKIE);
     cookie_pkt->cookie_len = (cookie_len);
 
@@ -264,7 +264,7 @@ fn_fail:
         MPID_PKT_DECL_CAST(_upkt, MPID_nem_pkt_lmt_done_t, _done_pkt);                                          \
         MPID_Request *_done_req;                                                                                \
                                                                                                                 \
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv DONE packet");                                             \
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv DONE packet");                                             \
         MPIDI_Pkt_init(_done_pkt, MPIDI_NEM_PKT_LMT_DONE);                                                      \
         _done_pkt->req_id = (rreq)->ch.lmt_req_id;                                                              \
                                                                                                                 \
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 b7450a4..71eda22 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
@@ -123,14 +123,14 @@ MPID_nem_mpich_send_header (void* buf, int size, MPIDI_VC_t *vc, int *again)
         pbox->cell.pkt.mpich.datalen = size;
         pbox->cell.pkt.mpich.seqno   = vc_ch->send_seqno++;
         
-        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+        MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
         
         MPIU_Memcpy((void *)pbox->cell.pkt.mpich.p.payload, buf, size);
 
         OPA_store_release_int(&pbox->flag.value, 1);
 
-        MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent fbox ");
-        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
+        MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent fbox ");
+        MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
         
         goto return_success;
     }
@@ -169,13 +169,13 @@ MPID_nem_mpich_send_header (void* buf, int size, MPIDI_VC_t *vc, int *again)
     el->pkt.mpich.dest    = vc->lpid;
     el->pkt.mpich.datalen = size;
     el->pkt.mpich.seqno   = vc_ch->send_seqno++;
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
     
     MPIU_Memcpy((void *)el->pkt.mpich.p.payload, buf, size);
     DO_PAPI (PAPI_accum_var (PAPI_EventSet, PAPI_vvalues11));
 
-    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
+    MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
 
     DO_PAPI (PAPI_reset (PAPI_EventSet));
     MPID_nem_queue_enqueue (vc_ch->recv_queue, el);
@@ -288,10 +288,10 @@ MPID_nem_mpich_sendv (MPL_IOV **iov, int *n_iov, MPIDI_VC_t *vc, int *again)
     el->pkt.mpich.dest    = vc->lpid;
     el->pkt.mpich.datalen = MPID_NEM_MPICH_DATA_LEN - payload_len;
     el->pkt.mpich.seqno   = vc_ch->send_seqno++;
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH);
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH);
 
-    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
+    MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
 
     MPID_nem_queue_enqueue (vc_ch->recv_queue, el);
     /*MPID_nem_rel_dump_queue( vc_ch->recv_queue ); */
@@ -357,7 +357,7 @@ MPID_nem_mpich_sendv_header (MPL_IOV **iov, int *n_iov,
         pbox->cell.pkt.mpich.source  = MPID_nem_mem_region.local_rank;
         pbox->cell.pkt.mpich.datalen = (*iov)[1].MPL_IOV_LEN + sizeof(MPIDI_CH3_Pkt_t);
         pbox->cell.pkt.mpich.seqno   = vc_ch->send_seqno++;
-        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+        MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
         
         MPIU_Memcpy((void *)pbox->cell.pkt.mpich.p.payload, (*iov)[0].MPL_IOV_BUF, (*iov)[0].MPL_IOV_LEN);
         MPIU_Memcpy ((char *)pbox->cell.pkt.mpich.p.payload + (*iov)[0].MPL_IOV_LEN, (*iov)[1].MPL_IOV_BUF, (*iov)[1].MPL_IOV_LEN);
@@ -365,8 +365,8 @@ MPID_nem_mpich_sendv_header (MPL_IOV **iov, int *n_iov,
         OPA_store_release_int(&pbox->flag.value, 1);
         *n_iov = 0;
 
-        MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent fbox ");
-        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
+        MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent fbox ");
+        MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
         
         goto return_success;
     }
@@ -437,10 +437,10 @@ MPID_nem_mpich_sendv_header (MPL_IOV **iov, int *n_iov,
     el->pkt.mpich.dest    = vc->lpid;
     el->pkt.mpich.datalen = MPID_NEM_MPICH_DATA_LEN - payload_len;
     el->pkt.mpich.seqno   = vc_ch->send_seqno++;
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
 
-    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
+    MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
 
     MPID_nem_queue_enqueue (vc_ch->recv_queue, el);	
     /*MPID_nem_rel_dump_queue( vc_ch->recv_queue ); */
@@ -525,7 +525,7 @@ MPID_nem_mpich_send_seg_header (MPID_Segment *segment, MPIDI_msg_sz_t *segment_f
 	    pbox->cell.pkt.mpich.source  = MPID_nem_mem_region.local_rank;
 	    pbox->cell.pkt.mpich.datalen = sizeof(MPIDI_CH3_Pkt_t) + segment_size;
 	    pbox->cell.pkt.mpich.seqno   = vc_ch->send_seqno++;
-            MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+            MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
 
             /* copy header */
             MPIU_Memcpy((void *)pbox->cell.pkt.mpich.p.payload, header, header_sz);
@@ -539,8 +539,8 @@ MPID_nem_mpich_send_seg_header (MPID_Segment *segment, MPIDI_msg_sz_t *segment_f
 
             *segment_first = last;
 
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent fbox ");
-	    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent fbox ");
+	    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
 
             goto return_success;
 	}
@@ -598,10 +598,10 @@ MPID_nem_mpich_send_seg_header (MPID_Segment *segment, MPIDI_msg_sz_t *segment_f
     el->pkt.mpich.dest    = vc->lpid;
     el->pkt.mpich.datalen = datalen;
     el->pkt.mpich.seqno   = vc_ch->send_seqno++;
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
 
-    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
+    MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
 
     MPID_nem_queue_enqueue (vc_ch->recv_queue, el);	
 
@@ -681,10 +681,10 @@ MPID_nem_mpich_send_seg (MPID_Segment *segment, MPIDI_msg_sz_t *segment_first, M
     el->pkt.mpich.dest    = vc->lpid;
     el->pkt.mpich.datalen = datalen;
     el->pkt.mpich.seqno   = vc_ch->send_seqno++;
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
 
-    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
+    MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
 
     MPID_nem_queue_enqueue (vc_ch->recv_queue, el);	
 
@@ -867,11 +867,11 @@ MPID_nem_mpich_test_recv(MPID_nem_cell_ptr_t *cell, int *in_fbox, int in_blockin
  fn_exit:
     DO_PAPI (PAPI_accum_var (PAPI_EventSet, PAPI_vvalues6));
     
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
 	if (*cell)
 	{
-	    MPIU_DBG_MSG_S (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
-	    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (*cell));
+	    MPL_DBG_MSG_S (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
+	    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (*cell));
 	}
     });
 
@@ -926,11 +926,11 @@ MPID_nem_mpich_test_recv_wait (MPID_nem_cell_ptr_t *cell, int *in_fbox, int time
     *in_fbox = 0;
  exit_l:
     
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
             if (*cell)
             {
-                MPIU_DBG_MSG_S (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
-                MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (*cell));
+                MPL_DBG_MSG_S (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
+                MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (*cell));
             }
         });
 
@@ -1014,11 +1014,11 @@ MPID_nem_mpich_blocking_recv(MPID_nem_cell_ptr_t *cell, int *in_fbox, int comple
 
     DO_PAPI (PAPI_accum_var (PAPI_EventSet,PAPI_vvalues8));
     
-    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
+    MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
             if (*cell)
             {
-                MPIU_DBG_MSG_S (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
-                MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell(*cell));
+                MPL_DBG_MSG_S (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
+                MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell(*cell));
             }
         });
 
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 3d3afe6..37a4920 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
@@ -30,14 +30,14 @@ extern struct MPID_Request *MPIDI_CH3I_shm_active_send;
 #define MPIDI_CH3I_Sendq_enqueue(qp, ep) do {                                           \
         /* add refcount so req doesn't get freed before it's dequeued */                \
         MPIR_Request_add_ref(ep);                                                       \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST,                         \
                           "MPIDI_CH3I_Sendq_enqueue req=%p (handle=%#x), queue=%p",     \
                           ep, (ep)->handle, qp));                                       \
         GENERIC_Q_ENQUEUE (qp, ep, dev.next);                                           \
     } while (0)
 #define MPIDI_CH3I_Sendq_dequeue(qp, ep)  do {                                          \
         GENERIC_Q_DEQUEUE (qp, ep, dev.next);                                           \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST,                         \
                           "MPIDI_CH3I_Sendq_dequeuereq=%p (handle=%#x), queue=%p",      \
                           *(ep), *(ep) ? (*(ep))->handle : -1, qp));                    \
         MPID_Request_release(*(ep));                                                    \
diff --git a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h
index 1686232..c1fb527 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h
@@ -53,21 +53,21 @@ typedef GENERIC_Q_DECL(struct MPID_Request) MPID_nem_lmt_rts_queue_t;
 #define MPID_nem_lmt_rtsq_empty(q) GENERIC_Q_EMPTY (q)
 #define MPID_nem_lmt_rtsq_head(q) GENERIC_Q_HEAD (q)
 #define MPID_nem_lmt_rtsq_enqueue(qp, ep) do {                                          \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST,                         \
                           "MPID_nem_lmt_rtsq_enqueue req=%p (handle=%#x), queue=%p",    \
                           ep, (ep)->handle, qp));                                       \
         GENERIC_Q_ENQUEUE (qp, ep, dev.next);                                           \
     } while (0)
 #define MPID_nem_lmt_rtsq_dequeue(qp, epp)  do {                                        \
         GENERIC_Q_DEQUEUE (qp, epp, dev.next);                                          \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST,                         \
                           "MPID_nem_lmt_rtsq_dequeue req=%p (handle=%#x), queue=%p",    \
                           *(epp), *(epp) ? (*(epp))->handle : -1, qp));                 \
     } while (0)
 #define MPID_nem_lmt_rtsq_search_remove(qp, req_id, epp) do {                           \
         GENERIC_Q_SEARCH_REMOVE(qp, _e->handle == (req_id), epp,                        \
                 struct MPID_Request, dev.next);                                         \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST,                         \
                     "MPID_nem_lmt_rtsq_search_remove req=%p (handle=%#x), queue=%p",    \
                     *(epp), req_id, qp));                                               \
 } while (0)
@@ -192,18 +192,18 @@ struct MPIDI_CH3I_Request
 #if 0
 #define DUMP_REQUEST(req) do {                                          \
         int i;                                                          \
-        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER, TERSE, "request %p\n", (req));        \
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  handle = %d\n", (req)->handle); \
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  ref_count = %d\n", (req)->ref_count); \
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  cc = %d\n", (req)->cc);     \
+        MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER, TERSE, "request %p\n", (req));        \
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  handle = %d\n", (req)->handle); \
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  ref_count = %d\n", (req)->ref_count); \
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  cc = %d\n", (req)->cc);     \
         for (i = 0; i < (req)->iov_count; ++i)                          \
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPIU_DBG_FDEST, "  dev.iov[%d] = (%p, %d)\n", i, \
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPL_DBG_FDEST, "  dev.iov[%d] = (%p, %d)\n", i, \
                                                 (req)->dev.iov[i+(req)->dev.iov_offset].MPL_IOV_BUF, \
                                                 (req)->dev.iov[i+(req)->dev.iov_offset].MPL_IOV_LEN)); \
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  dev.iov_count = %d\n",      \
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  dev.iov_count = %d\n",      \
                        (req)->dev.iov_count);                           \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPIU_DBG_FDEST, "  dev.state = 0x%x\n", (req)->dev.state)); \
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "    type = %d\n",             \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPL_DBG_FDEST, "  dev.state = 0x%x\n", (req)->dev.state)); \
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "    type = %d\n",             \
                        MPIDI_Request_get_type(req));                    \
     } while (0)
 #else
@@ -232,7 +232,7 @@ extern OPA_int_t MPIDI_CH3I_progress_completion_count;
 #define MPIDI_CH3I_INCR_PROGRESS_COMPLETION_COUNT do {                                  \
         OPA_write_barrier();                                                            \
         OPA_incr_int(&MPIDI_CH3I_progress_completion_count);                            \
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_PROGRESS,VERBOSE,                                            \
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_PROGRESS,VERBOSE,                                            \
                        "just incremented MPIDI_CH3I_progress_completion_count=%d",      \
                        OPA_load_int(&MPIDI_CH3I_progress_completion_count));            \
     } while(0)
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 8017816..12d31b1 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
@@ -61,7 +61,7 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
 
     /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_SEND_HANDLER); */
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_send_handler");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_send_handler");
 
     MPIU_Assert(sreq != NULL);
 
@@ -76,8 +76,8 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
         MPID_nem_llc_send_queued(vc, &vc_llc->send_queue);
 
         p_reqid[0] = !MPIDI_CH3I_Sendq_empty(vc_llc->send_queue);
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_send_handler");
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "send queue %d", (unsigned int) p_reqid[0]);
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_send_handler");
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "send queue %d", (unsigned int) p_reqid[0]);
 
         goto fn_exit;
     }
@@ -138,7 +138,7 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
                     if (r_mpi_errno != MPI_SUCCESS) {
                         MPIR_ERR_POP(r_mpi_errno);
                     }
-                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+                    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                 }
                 else {
                     complete = 0;
@@ -148,7 +148,7 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
                     if (complete == 0) {
                         MPIU_Assert(complete == TRUE);
                     }
-                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete2");
+                    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete2");
                 }
 
                 /* push queued messages */
@@ -185,7 +185,7 @@ static void MPID_nem_llc_recv_handler(void *vp_vc, uint64_t raddr, void *buf, si
 
     /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_RECV_HANDLER); */
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_recv_handler");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_recv_handler");
 
     {
         int pg_rank = (int) raddr;
@@ -201,13 +201,13 @@ static void MPID_nem_llc_recv_handler(void *vp_vc, uint64_t raddr, void *buf, si
             MPIDI_PG_Get_vc_set_active(pg, pg_rank, &vc_from_pg);
         }
         else {
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad vc %p or", pg);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad pg_rank %d", pg_rank);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad pg_rank < %d", MPIDI_PG_Get_size(pg));
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad vc %p or", pg);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad pg_rank %d", pg_rank);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad pg_rank < %d", MPIDI_PG_Get_size(pg));
             vc_from_pg = vc;    /* XXX */
         }
         if (vc != vc_from_pg) {
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad vc for pg_rank %d", pg_rank);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad vc for pg_rank %d", pg_rank);
         }
         if (vc == 0) {
             vc = vc_from_pg;
@@ -216,7 +216,7 @@ static void MPID_nem_llc_recv_handler(void *vp_vc, uint64_t raddr, void *buf, si
     if (vc != 0) {
         mpi_errno = MPID_nem_handle_pkt(vc, buf, bsz);
         if (mpi_errno != 0) {
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPID_nem_handle_pkt() = %d", mpi_errno);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPID_nem_handle_pkt() = %d", mpi_errno);
         }
     }
 
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 f17797d..3f2893f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
@@ -177,13 +177,13 @@ int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
             MPIDI_Process.my_pg_rank, vc->pg_rank, hdr, hdr_sz, data, data_sz);
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_iStartContigMsg");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_iStartContigMsg");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc.pg_rank = %d", vc->pg_rank);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "my_pg_rank = %d", MPIDI_Process.my_pg_rank);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "hdr_sz     = %d", (int) hdr_sz);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "data_sz    = %d", (int) data_sz);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "hdr type   = %d", ((MPIDI_CH3_Pkt_t *) hdr)->type);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc.pg_rank = %d", vc->pg_rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "my_pg_rank = %d", MPIDI_Process.my_pg_rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "hdr_sz     = %d", (int) hdr_sz);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "data_sz    = %d", (int) data_sz);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "hdr type   = %d", ((MPIDI_CH3_Pkt_t *) hdr)->type);
 
     /* create a request */
     sreq = MPID_Request_create();
@@ -202,12 +202,12 @@ int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
     sreq->dev.iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) & sreq->dev.pending_pkt;
     sreq->dev.iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
     sreq->dev.iov_count = 1;
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
     if (data_sz > 0) {
         sreq->dev.iov[1].MPL_IOV_BUF = data;
         sreq->dev.iov[1].MPL_IOV_LEN = data_sz;
         sreq->dev.iov_count = 2;
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
     }
 
@@ -227,17 +227,17 @@ int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
             mpi_errno = MPI_ERR_OTHER;
             MPIR_ERR_POP(mpi_errno);
         }
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
         if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
             need_to_queue = 2;  /* YYY */
         }
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
     }
 
   queue_it:
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "need_to_que  %d", need_to_queue);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "need_to_que  %d", need_to_queue);
     if (need_to_queue > 0) {
         MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
     }
@@ -271,17 +271,17 @@ int MPID_nem_llc_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
             sreq, hdr, hdr_sz, data, data_sz);
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_iSendContig");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_iSendContig");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
-    MPIU_DBG_PKT(vc, hdr, "isendcontig");
+    MPL_DBG_PKT(vc, hdr, "isendcontig");
     {
         MPIDI_CH3_Pkt_t *pkt = (MPIDI_CH3_Pkt_t *) hdr;
 
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "pkt->type  = %d", pkt->type);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "pkt->type  = %d", pkt->type);
     }
 
     MPIU_Assert(sreq != NULL);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "OnDataAvail= %p", sreq->dev.OnDataAvail);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "OnDataAvail= %p", sreq->dev.OnDataAvail);
     sreq->ch.vc = vc;
     sreq->dev.iov_offset = 0;
 
@@ -290,12 +290,12 @@ int MPID_nem_llc_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
     sreq->dev.iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) & sreq->dev.pending_pkt;
     sreq->dev.iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
     sreq->dev.iov_count = 1;
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
     if (data_sz > 0) {
         sreq->dev.iov[1].MPL_IOV_BUF = data;
         sreq->dev.iov[1].MPL_IOV_LEN = data_sz;
         sreq->dev.iov_count = 2;
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "IOV_LEN    = %d", (int) sreq->dev.iov[1].MPL_IOV_LEN);
     }
 
@@ -315,14 +315,14 @@ int MPID_nem_llc_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
             mpi_errno = MPI_ERR_OTHER;
             MPIR_ERR_POP(mpi_errno);
         }
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "WRITEV()   = %d", ret);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "WRITEV()   = %d", ret);
         if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
             need_to_queue = 2;  /* YYY */
         }
     }
 
   queue_it:
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "need_to_que  %d", need_to_queue);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "need_to_que  %d", need_to_queue);
     if (need_to_queue > 0) {
         MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
     }
@@ -344,7 +344,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_SENDNONCONTIG);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_SENDNONCONTIG);
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_SendNoncontig");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_SendNoncontig");
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
 
@@ -359,7 +359,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     sreq->dev.iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) & sreq->dev.pending_pkt;
     sreq->dev.iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
     sreq->dev.iov_count = 1;
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
 
     data_sz = sreq->dev.segment_size;
     if (data_sz > 0) {
@@ -371,7 +371,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
         sreq->dev.iov[1].MPL_IOV_BUF = REQ_FIELD(sreq, rma_buf);
         sreq->dev.iov[1].MPL_IOV_LEN = data_sz;
         sreq->dev.iov_count = 2;
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[1].MPL_IOV_LEN);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[1].MPL_IOV_LEN);
     }
 
     sreq->ch.vc = vc;
@@ -398,7 +398,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     }
 
   queue_it:
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "need_to_que %d", need_to_queue);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "need_to_que %d", need_to_queue);
     if (need_to_queue > 0) {
         MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
     }
@@ -434,7 +434,7 @@ int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t * send_queue)
         int niov;
 
         sreq = MPIDI_CH3I_Sendq_head(*send_queue);
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "sreq %p", sreq);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "sreq %p", sreq);
 
         if (mpi_errno == MPI_SUCCESS) {
             iovs = &sreq->dev.iov[sreq->dev.iov_offset];
@@ -450,12 +450,12 @@ int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t * send_queue)
             MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
             sreq->status.MPI_ERROR = mpi_errno;
 
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "OnDataAvail = %p", sreq->dev.OnDataAvail);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "OnDataAvail = %p", sreq->dev.OnDataAvail);
             MPID_Request_complete(sreq);
             continue;
         }
         if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "skip %p", sreq);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "skip %p", sreq);
             break;
         }
         MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
@@ -483,16 +483,16 @@ int MPIDI_nem_llc_Rqst_iov_update(MPID_Request * mreq, MPIDI_msg_sz_t consume)
 
     MPIU_Assert(consume >= 0);
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : consume    %d", (int) consume);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : iov_count  %d", mreq->dev.iov_count);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : consume    %d", (int) consume);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : iov_count  %d", mreq->dev.iov_count);
 
     nv = mreq->dev.iov_count;
     for (iv = mreq->dev.iov_offset; iv < nv; iv++) {
         MPL_IOV *iov = &mreq->dev.iov[iv];
 
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : iov[iv]    %d", iv);
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : consume b  %d", (int) consume);
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : iov[iv]    %d", iv);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : consume b  %d", (int) consume);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "iov_update() : iov_len b  %d", (int) iov->MPL_IOV_LEN);
         if (iov->MPL_IOV_LEN > consume) {
             iov->MPL_IOV_BUF = ((char *) iov->MPL_IOV_BUF) + consume;
@@ -504,13 +504,13 @@ int MPIDI_nem_llc_Rqst_iov_update(MPID_Request * mreq, MPIDI_msg_sz_t consume)
         consume -= iov->MPL_IOV_LEN;
         iov->MPL_IOV_LEN = 0;
     }
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : consume %d", (int) consume);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : consume %d", (int) consume);
 
     mreq->dev.iov_count = nv - iv;
     mreq->dev.iov_offset = iv;
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : iov_offset %ld", mreq->dev.iov_offset);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() = %d", ret);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : iov_offset %ld", mreq->dev.iov_offset);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() = %d", ret);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_NEM_LLC_RQST_IOV_UPDATE);
     return ret;
@@ -527,7 +527,7 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
 
     dprintf("writev,raddr=%ld,niov=%d,sreq=%p", raddr, niov, cbarg);
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev(%d)", (int) raddr);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev(%d)", (int) raddr);
     {
         uint8_t *buff = 0;
 #ifdef	notdef_hsiz_hack
@@ -599,7 +599,7 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
         char *bp;
         size_t bz;
 
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev() : nv %d", nv);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev() : nv %d", nv);
         bp = (void *) lcmd->iov_local[0].addr;
         bz = lcmd->iov_local[0].length;
 
@@ -627,13 +627,13 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
             }
             bp += len;
         }
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev() : iv %d", iv);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev() : iv %d", iv);
         {
             void *bb = (void *) lcmd->iov_local[0].addr;
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "wptr       = %d", (int) (bp - (char *) bb));
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "wptr       = %d", (int) (bp - (char *) bb));
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                            "blocklengt = %d", (int) lcmd->iov_local[0].length);
-            MPIU_DBG_PKT(endpt, bb, "writev");
+            MPL_DBG_PKT(endpt, bb, "writev");
         }
     }
     {
@@ -666,7 +666,7 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
     }
 
   bad:
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev() : nw %d", (int) nw);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev() : nw %d", (int) nw);
     return nw;
 }
 
@@ -788,8 +788,8 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
 #endif
 #endif /* notdef_hsiz_hack */
                 {
-                    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "LLC_leng   = %d", (int) bsiz);
-                    MPIU_DBG_PKT(vp_vc, buff, "poll");
+                    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "LLC_leng   = %d", (int) bsiz);
+                    MPL_DBG_PKT(vp_vc, buff, "poll");
                 }
                 dprintf("llc_poll,EVENT_UNSOLICITED_ARRIVED,%d<-%d\n",
                         MPIDI_Process.my_pg_rank,
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 e3af2f3..57b39bf 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
@@ -130,11 +130,11 @@ static int llc_vc_init(MPIDI_VC_t * vc)
 
 
     {
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "MPIDI_NEM_VC_NETMOD_AREA_LEN = %d\n", MPIDI_NEM_VC_NETMOD_AREA_LEN);
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "MPIDI_NEM_REQ_NETMOD_AREA_LEN = %d", MPIDI_NEM_REQ_NETMOD_AREA_LEN);
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "MPID_nem_llc_vc_area = %d\n", (int) sizeof(MPID_nem_llc_vc_area));
     }
 
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
index 5c2d999..6e6bece 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
@@ -190,14 +190,14 @@ typedef GENERIC_Q_DECL(struct MPID_Request) MPID_nem_mxm_reqq_t;
 #define MPID_nem_mxm_queue_enqueue(qp, ep) do {                                           \
         /* add refcount so req doesn't get freed before it's dequeued */                \
         MPIR_Request_add_ref(ep);                                                       \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST,                         \
                           "MPID_nem_mxm_queue_enqueue req=%p (handle=%#x), queue=%p",     \
                           ep, (ep)->handle, qp));                                       \
         GENERIC_Q_ENQUEUE (qp, ep, dev.next);                                           \
     } while (0)
 #define MPID_nem_mxm_queue_dequeue(qp, ep)  do {                                          \
         GENERIC_Q_DEQUEUE (qp, ep, dev.next);                                           \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST,                         \
                           "MPID_nem_mxm_queue_dequeuereq=%p (handle=%#x), queue=%p",      \
                           *(ep), *(ep) ? (*(ep))->handle : -1, qp));                    \
         MPID_Request_release(*(ep));                                                    \
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 7408f8b..313137e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
@@ -277,8 +277,8 @@ int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc)
 
     /* local connection is used for any source communication */
     MPIU_Assert(MPID_nem_mem_region.rank != vc->lpid);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
-                     (MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+                     (MPL_DBG_FDEST,
                       "[%i]=== connecting  to  %i  \n", MPID_nem_mem_region.rank, vc->lpid));
     {
         char *business_card;
@@ -410,8 +410,8 @@ static int _mxm_conf(void)
 
     cur_ver = mxm_get_version();
     if (cur_ver != MXM_API) {
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
-                         (MPIU_DBG_FDEST,
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+                         (MPL_DBG_FDEST,
                           "WARNING: MPICH was compiled with MXM version %d.%d but version %ld.%ld detected.",
                           MXM_VERNO_MAJOR,
                           MXM_VERNO_MINOR,
@@ -436,8 +436,8 @@ static int _mxm_conf(void)
         (_mxm_obj.conf.bulk_connect || _mxm_obj.conf.bulk_disconnect)) {
         _mxm_obj.conf.bulk_connect = 0;
         _mxm_obj.conf.bulk_disconnect = 0;
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
-                         (MPIU_DBG_FDEST,
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
+                         (MPL_DBG_FDEST,
                           "WARNING: MPICH runs with %s version of MXM that is less than 3.2, "
                           "so bulk connect/disconnect cannot work properly and will be turn off.",
                           _mxm_obj.runtime_version));
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 c6a0298..c69c5bb 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
@@ -77,7 +77,7 @@ void MPID_nem_mxm_get_adi_msg(mxm_conn_h conn, mxm_imm_t imm, void *data,
 {
     MPIDI_VC_t *vc = NULL;
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPID_nem_mxm_get_adi_msg");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPID_nem_mxm_get_adi_msg");
 
     vc = mxm_conn_ctx_get(conn);
 
@@ -273,7 +273,7 @@ static int _mxm_handle_rreq(MPID_Request * req)
     else {
         data_sz = userbuf_sz;
         MPIR_STATUS_SET_COUNT(req->status, userbuf_sz);
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPIU_DBG_FDEST,
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPL_DBG_FDEST,
                                               "receive buffer too small; message truncated, msg_sz="
                                               MPIDI_MSG_SZ_FMT ", userbuf_sz="
                                               MPIDI_MSG_SZ_FMT, req->dev.recv_data_sz, userbuf_sz));
@@ -395,7 +395,7 @@ static int _mxm_irecv(MPID_nem_mxm_ep_t * ep, MPID_nem_mxm_req_area * req, int i
         list_grow_mxm_req(free_queue);
         req->mxm_req = list_dequeue_mxm_req(free_queue);
         if (!req->mxm_req) {
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "empty free queue");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "empty free queue");
             mpi_errno = MPI_ERR_OTHER;
             goto fn_fail;
         }
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 c4006bc..7359225 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
@@ -43,7 +43,7 @@ int MPID_nem_mxm_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISENDCONTIGMSG);
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "mxm_iSendContig");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "mxm_iSendContig");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
 
     MPIU_Memcpy(&(sreq->dev.pending_pkt), (char *) hdr, sizeof(MPIDI_CH3_Pkt_t));
@@ -109,7 +109,7 @@ int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISTARTCONTIGMSG);
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "mxm_iStartContigMsg");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "mxm_iStartContigMsg");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
 
     /* create a request */
@@ -174,7 +174,7 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_SENDNONCONTIGMSG);
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPID_nem_mxm_iSendNoncontig");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPID_nem_mxm_iSendNoncontig");
 
     MPIU_Memcpy(&(sreq->dev.pending_pkt), (char *) hdr, sizeof(MPIDI_CH3_Pkt_t));
 
@@ -723,7 +723,7 @@ static int _mxm_isend(MPID_nem_mxm_ep_t * ep, MPID_nem_mxm_req_area * req,
         list_grow_mxm_req(free_queue);
         req->mxm_req = list_dequeue_mxm_req(free_queue);
         if (!req->mxm_req) {
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "empty free queue");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "empty free queue");
             mpi_errno = MPI_ERR_OTHER;
             goto fn_fail;
         }
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
index 6d32684..d37fc99 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
@@ -221,10 +221,10 @@ const char *MPID_nem_ptl_strnifail(ptl_ni_fail_t ni_fail);
 const char *MPID_nem_ptl_strlist(ptl_list_t list);
 
 #define DBG_MSG_PUT(md_, data_sz_, pg_rank_, match_, header_) do {                                                                          \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "MPID_nem_ptl_rptl_put: md=%s data_sz=%lu pg_rank=%d", md_, data_sz_, pg_rank_));          \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        tag=%#lx ctx=%#lx rank=%ld match=%#lx",                            \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "MPID_nem_ptl_rptl_put: md=%s data_sz=%lu pg_rank=%d", md_, data_sz_, pg_rank_));          \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "        tag=%#lx ctx=%#lx rank=%ld match=%#lx",                            \
                                                 NPTL_MATCH_GET_TAG(match_), NPTL_MATCH_GET_CTX(match_), NPTL_MATCH_GET_RANK(match_), match_)); \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        flags=%c%c%c data_sz=%ld header=%#lx",                             \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "        flags=%c%c%c data_sz=%ld header=%#lx",                             \
                                                 header_ & NPTL_SSEND ? 'S':' ',                                                             \
                                                 header_ & NPTL_LARGE ? 'L':' ',                                                             \
                                                 header_ & NPTL_MULTIPLE ? 'M':' ',                                                          \
@@ -232,22 +232,22 @@ const char *MPID_nem_ptl_strlist(ptl_list_t list);
     } while(0)
 
 #define DBG_MSG_GET(md_, data_sz_, pg_rank_, match_) do {                                                                                   \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlGet: md=%s data_sz=%lu pg_rank=%d", md_, data_sz_, pg_rank_));          \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        tag=%#lx ctx=%#lx rank=%ld match=%#lx",                            \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "PtlGet: md=%s data_sz=%lu pg_rank=%d", md_, data_sz_, pg_rank_));          \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "        tag=%#lx ctx=%#lx rank=%ld match=%#lx",                            \
                                                 NPTL_MATCH_GET_TAG(match_), NPTL_MATCH_GET_CTX(match_), NPTL_MATCH_GET_RANK(match_), match_)); \
     } while(0)
 
 #define DBG_MSG_MEAPPEND(pt_, pg_rank_, me_, usr_ptr_) do {                                                                                 \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMEAppend: pt=%s pg_rank=%d me.start=%p me.length=%lu is_IOV=%d usr_ptr=%p", \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "PtlMEAppend: pt=%s pg_rank=%d me.start=%p me.length=%lu is_IOV=%d usr_ptr=%p", \
                                                 pt_, pg_rank_, me_.start, me_.length, me_.options & PTL_IOVEC, usr_ptr_));                  \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "             tag=%#lx ctx=%#lx rank=%ld match=%#lx ignore=%#lx",           \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "             tag=%#lx ctx=%#lx rank=%ld match=%#lx ignore=%#lx",           \
                                                 NPTL_MATCH_GET_TAG(me_.match_bits), NPTL_MATCH_GET_CTX(me_.match_bits),                     \
                                                 NPTL_MATCH_GET_RANK(me_.match_bits), me_.match_bits, me_.ignore_bits));                     \
     } while(0)
     
 #define DBG_MSG_MESearch(pt_, pg_rank_, me_, usr_ptr_) do {                                                                             \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMESearch: pt=%s pg_rank=%d usr_ptr=%p", pt_, pg_rank_, usr_ptr_));  \
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "             tag=%#lx ctx=%#lx rank=%ld match=%#lx ignore=%#lx",       \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "PtlMESearch: pt=%s pg_rank=%d usr_ptr=%p", pt_, pg_rank_, usr_ptr_));  \
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "             tag=%#lx ctx=%#lx rank=%ld match=%#lx ignore=%#lx",       \
                                                 NPTL_MATCH_GET_TAG(me_.match_bits), NPTL_MATCH_GET_CTX(me_.match_bits),                 \
                                                 NPTL_MATCH_GET_RANK(me_.match_bits), me_.match_bits, me_.ignore_bits));                 \
     } while(0)
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 1c12f81..114fbf6 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
@@ -377,7 +377,7 @@ static int get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
 
     ret = PtlGetId(MPIDI_nem_ptl_ni, &my_ptl_id);
     MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlgetid", "**ptlgetid %s", MPID_nem_ptl_strerror(ret));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "Allocated NI and PT id=(%#x,%#x) pt=%#x",
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_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));
@@ -613,7 +613,7 @@ int MPID_nem_ptl_vc_terminated(MPIDI_VC_t *vc)
     MPIDI_FUNC_EXIT(MPID_NEM_PTL_VC_TERMINATED);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
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 9b7ebc3..6fbeae2 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -241,7 +241,7 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
                                 vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, NPTL_HEADER(0, remaining));
     MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
                          MPID_nem_ptl_strerror(ret));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
                                             sendbuf_sz, vc_ptl->id.phys.nid,
                                             vc_ptl->id.phys.pid, vc_ptl->ptc));
 
@@ -315,7 +315,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
                                 vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, NPTL_HEADER(0, remaining));
     MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
                          MPID_nem_ptl_strerror(ret));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
                                             sendbuf_sz, vc_ptl->id.phys.nid,
                                             vc_ptl->id.phys.pid, vc_ptl->ptc));
 
@@ -427,7 +427,7 @@ static inline int on_data_avail(MPID_Request * req)
             MPIR_ERR_POP(mpi_errno);
         }
 
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
     }
     else {
         int complete;
@@ -521,7 +521,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                                                 size, vc_ptl->id, vc_ptl->ptc, NPTL_MATCH(sender_req_id, GET_TAG, MPIDI_Process.my_pg_rank), target_offset, req);
                     MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s",
                                          MPID_nem_ptl_strerror(ret));
-                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,
+                    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST,
                                                             "PtlGet(size=%lu id=(%#x,%#x) pt=%#x tag=%d)", size,
                                                             vc_ptl->id.phys.nid,
                                                             vc_ptl->id.phys.pid, vc_ptl->ptc, sender_req_id));
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 85bea90..b90c8cb 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
@@ -162,7 +162,7 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
             }
         }
         MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqget", "**ptleqget %s", MPID_nem_ptl_strerror(ret));
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_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",
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_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));
         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));
@@ -184,8 +184,8 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
         case PTL_EVENT_REPLY:
         case PTL_EVENT_SEARCH: {
             MPID_Request * const req = event.user_ptr;
-            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "req = %p", req);
-            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "REQ_PTL(req)->event_handler = %p", REQ_PTL(req)->event_handler);
+            MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "req = %p", req);
+            MPL_DBG_MSG_P(MPIDI_CH3_DBG_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) MPIR_ERR_POP(mpi_errno);
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 22d1e59..a02f036 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
@@ -316,7 +316,7 @@ int MPID_nem_ptl_pkt_cancel_send_req_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pk
     ptl_me_t me;
     MPID_nem_ptl_vc_area *const vc_ptl = VC_PTL(vc);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
       "received cancel send req pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d",
                       req_pkt->sender_req_id, req_pkt->match.parts.rank,
                       req_pkt->match.parts.tag, req_pkt->match.parts.context_id));
@@ -407,10 +407,10 @@ int MPID_nem_ptl_pkt_cancel_send_resp_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *p
         if (REQ_PTL(sreq)->get_me_p)
             MPIU_Free(REQ_PTL(sreq)->get_me_p);
 
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"message cancelled");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"message cancelled");
     } else {
         MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"unable to cancel message");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"unable to cancel message");
     }
 
     mpi_errno = MPID_Request_complete(sreq);
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 9945a06..6b67920 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
@@ -108,7 +108,7 @@ static int handler_recv_dequeue_complete(const ptl_event_t *e)
 
     if (e->type == PTL_EVENT_PUT_OVERFLOW) {
         /* unpack the data from unexpected buffer */
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "is_contig = %d", is_contig);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "is_contig = %d", is_contig);
 
         if (is_contig) {
             MPIU_Memcpy((char *)rreq->dev.user_buf + dt_true_lb, e->start, e->mlength);
@@ -197,7 +197,7 @@ static void big_get(void *buf, ptl_size_t left_to_get, MPIDI_VC_t *vc, ptl_match
 
         ret = MPID_nem_ptl_rptl_get(MPIDI_nem_ptl_global_md, start, get_sz, vc_ptl->id, vc_ptl->ptg, match_bits, 0, rreq);
         DBG_MSG_GET("global", get_sz, vc->pg_rank, match_bits);
-        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   buf=%p", (char *)start);
+        MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   buf=%p", (char *)start);
         MPIU_Assert(ret == 0);
 
         /* account for what has been sent */
@@ -461,7 +461,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
         me.match_id = vc_ptl->id;
     }
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "tag=%#x ctx=%#x rank=%#x", rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id, rreq->dev.match.parts.rank));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "tag=%#x ctx=%#x rank=%#x", rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id, rreq->dev.match.parts.rank));
     me.match_bits = NPTL_MATCH(rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id,
                                rreq->dev.match.parts.rank);
     if (rreq->dev.match.parts.tag == MPI_ANY_TAG)
@@ -472,13 +472,13 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
     me.min_free = 0;
 
     MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "count="MPI_AINT_FMT_DEC_SPEC" datatype=%#x contig=%d data_sz=%lu", rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "count="MPI_AINT_FMT_DEC_SPEC" datatype=%#x contig=%d data_sz=%lu", rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz));
 
     if (data_sz <= PTL_LARGE_THRESHOLD) {
         if (dt_contig) {
             /* small contig message */
             void *start = (char *)rreq->dev.user_buf + dt_true_lb;
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small contig message");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small contig message");
             if (start == NULL)
                 me.start = &dummy;
             else
@@ -487,7 +487,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
             REQ_PTL(rreq)->event_handler = handler_recv_dequeue_complete;
         } else {
             /* small noncontig */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small noncontig message");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small noncontig message");
             rreq->dev.segment_ptr = 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);
@@ -500,7 +500,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
 
             if (last == rreq->dev.segment_size) {
                 /* entire message fits in IOV */
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    entire message fits in IOV");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    entire message fits in IOV");
                 me.start = rreq->dev.iov;
                 me.length = rreq->dev.iov_count;
                 me.options |= PTL_IOVEC;
@@ -508,7 +508,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
             } else {
                 /* IOV is not long enough to describe entire message: recv into
                    buffer and unpack later */
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer");
                 MPIU_CHKPMEM_MALLOC(REQ_PTL(rreq)->chunk_buffer[0], void *, data_sz, mpi_errno, "chunk_buffer");
                 me.start = REQ_PTL(rreq)->chunk_buffer[0];
                 me.length = data_sz;
@@ -519,13 +519,13 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
         /* Large message: Create an ME for the first chunk of data, then do a GET for the rest */
         if (dt_contig) {
             /* large contig message */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large contig message");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large contig message");
             me.start = (char *)rreq->dev.user_buf + dt_true_lb;
             me.length = PTL_LARGE_THRESHOLD;
             REQ_PTL(rreq)->event_handler = handler_recv_dequeue_large;
         } else {
             /* large noncontig */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large noncontig message");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large noncontig message");
             rreq->dev.segment_ptr = 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);
@@ -538,7 +538,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
 
             if (last == PTL_LARGE_THRESHOLD) {
                 /* first chunk fits in IOV */
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    first chunk fits in IOV");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    first chunk fits in IOV");
                 rreq->dev.segment_first = last;
                 me.start = rreq->dev.iov;
                 me.length = rreq->dev.iov_count;
@@ -547,7 +547,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
             } else {
                 /* IOV is not long enough to describe the first chunk: recv into
                    buffer and unpack later */
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer for first chunk");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer for first chunk");
                 MPIU_CHKPMEM_MALLOC(REQ_PTL(rreq)->chunk_buffer[0], void *, PTL_LARGE_THRESHOLD, mpi_errno, "chunk_buffer");
                 me.start = REQ_PTL(rreq)->chunk_buffer[0];
                 me.length = PTL_LARGE_THRESHOLD;
@@ -560,8 +560,8 @@ 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);
     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(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    buf=%p", me.start);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPIDI_nem_ptl_pt = %d", MPIDI_nem_ptl_pt);
+    MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    buf=%p", me.start);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPIDI_nem_ptl_pt = %d", MPIDI_nem_ptl_pt);
 
  fn_exit:
     MPIU_CHKPMEM_COMMIT();
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 849d079..abb5c76 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
@@ -132,15 +132,15 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
     }
 
     MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "count="MPI_AINT_FMT_DEC_SPEC" datatype=%#x contig=%d data_sz=%lu", count, datatype, dt_contig, data_sz));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "count="MPI_AINT_FMT_DEC_SPEC" datatype=%#x contig=%d data_sz=%lu", count, datatype, dt_contig, data_sz));
 
     if (data_sz <= PTL_LARGE_THRESHOLD) {
         /* Small message.  Send all data eagerly */
         if (dt_contig) {
             void *start = (char *)buf + dt_true_lb;
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small contig message");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small contig message");
             REQ_PTL(sreq)->event_handler = handler_send;
-            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "&REQ_PTL(sreq)->event_handler = %p", &(REQ_PTL(sreq)->event_handler));
+            MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "&REQ_PTL(sreq)->event_handler = %p", &(REQ_PTL(sreq)->event_handler));
             if (start == NULL)
                 ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)&dummy, data_sz, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt,
                                             NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
@@ -151,16 +151,16 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
                                             NPTL_HEADER(ssend_flag, data_sz));
             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(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "id.nid = %#x", vc_ptl->id.phys.nid);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "id.pid = %#x", vc_ptl->id.phys.pid);
-            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "sreq = %p", sreq);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc_ptl->pt = %d", vc_ptl->pt);
-            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "REQ_PTL(sreq)->event_handler = %p", REQ_PTL(sreq)->event_handler);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "id.nid = %#x", vc_ptl->id.phys.nid);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "id.pid = %#x", vc_ptl->id.phys.pid);
+            MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "sreq = %p", sreq);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc_ptl->pt = %d", vc_ptl->pt);
+            MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "REQ_PTL(sreq)->event_handler = %p", REQ_PTL(sreq)->event_handler);
            goto fn_exit;
         }
         
         /* noncontig data */
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small noncontig message");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small noncontig message");
         sreq->dev.segment_ptr = 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);
@@ -173,7 +173,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
 
         if (last == sreq->dev.segment_size) {
             /* IOV is able to describe entire message */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    entire message fits in IOV");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    entire message fits in IOV");
             md.start = sreq->dev.iov;
             md.length = sreq->dev.iov_count;
             md.options = PTL_IOVEC;
@@ -192,7 +192,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
         }
         
         /* IOV is not long enough to describe entire message */
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer");
         MPIU_CHKPMEM_MALLOC(REQ_PTL(sreq)->chunk_buffer[0], void *, data_sz, mpi_errno, "chunk_buffer");
         MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
         sreq->dev.segment_first = 0;
@@ -211,7 +211,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
     /* Large message.  Send first chunk of data and let receiver get the rest */
     if (dt_contig) {
         /* create ME for buffer so receiver can issue a GET for the data */
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large contig message");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large contig message");
         big_meappend((char *)buf + dt_true_lb + PTL_LARGE_THRESHOLD, data_sz - PTL_LARGE_THRESHOLD, vc,
                      NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), sreq);
 
@@ -225,7 +225,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
     }
     
     /* Large noncontig data */
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large noncontig message");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large noncontig message");
     sreq->dev.segment_ptr = 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);
@@ -241,7 +241,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
 
     if (last == PTL_LARGE_THRESHOLD) {
         /* first chunk of message fits into IOV */
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    first chunk fits in IOV");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    first chunk fits in IOV");
         if (initial_iov_count < MPL_IOV_LIMIT) {
             /* There may be space for the rest of the message in this IOV */
             sreq->dev.iov_count = MPL_IOV_LIMIT - sreq->dev.iov_count;
@@ -255,7 +255,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
                 /* Entire message fit in one IOV */
                 int was_incomplete;
 
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    rest of message fits in one IOV");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    rest of message fits in one IOV");
                 /* Create ME for remaining data */
                 me.start = &sreq->dev.iov[initial_iov_count];
                 me.length = remaining_iov_count;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
index b4c8846..daa6193 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
@@ -189,7 +189,7 @@ static int alloc_sc_plfd_tbls (void)
     return mpi_errno;
  fn_fail:
     MPIU_CHKPMEM_REAP();
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -225,8 +225,8 @@ static int expand_sc_plfd_tbls (void)
     int new_capacity = g_tbl_capacity + CONN_PLFD_TBL_GROW_SIZE, i;
     MPIU_CHKPMEM_DECL (2);
 
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls Entry"));
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls b4 g_sc_tbl[0].fd=%d", g_sc_tbl[0].fd));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "expand_sc_plfd_tbls Entry"));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "expand_sc_plfd_tbls b4 g_sc_tbl[0].fd=%d", g_sc_tbl[0].fd));
     MPIU_CHKPMEM_MALLOC (new_sc_tbl, sockconn_t *, new_capacity * sizeof(sockconn_t), 
                          mpi_errno, "expanded connection table");
     MPIU_CHKPMEM_MALLOC (new_plfd_tbl, struct pollfd *, new_capacity * sizeof(struct pollfd), 
@@ -263,7 +263,7 @@ static int expand_sc_plfd_tbls (void)
     }
     g_tbl_capacity = new_capacity;
 
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls af g_sc_tbl[0].fd=%d", g_sc_tbl[0].fd));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "expand_sc_plfd_tbls af g_sc_tbl[0].fd=%d", g_sc_tbl[0].fd));
     for (i = 0; i < g_tbl_capacity; ++i)
     {
         sockconn_t *sc = &g_sc_tbl[i];
@@ -281,11 +281,11 @@ static int expand_sc_plfd_tbls (void)
     
     MPIU_CHKPMEM_COMMIT();
  fn_exit:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls Exit"));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "expand_sc_plfd_tbls Exit"));
     return mpi_errno;
  fn_fail:
     MPIU_CHKPMEM_REAP();
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -334,7 +334,7 @@ static int find_free_entry(int *idx)
     INIT_POLLFD_ENTRY(&MPID_nem_tcp_plfd_tbl[*idx]);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -405,20 +405,20 @@ static int found_better_sc(sockconn_t *sc, sockconn_t **fnd_sc)
 fn_exit:
     if (found) {
         if (fnd_sc) {
-            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
-                             (MPIU_DBG_FDEST, "found_better_sc(sc=%p (%s), *fnd_sc=%p (%s)) found=TRUE",
+            MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
+                             (MPL_DBG_FDEST, "found_better_sc(sc=%p (%s), *fnd_sc=%p (%s)) found=TRUE",
                               sc, CONN_STATE_STR[sc->state.cstate],
                               *fnd_sc, (*fnd_sc ? CONN_STATE_STR[(*fnd_sc)->state.cstate] : "N/A")));
         }
         else {
-            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
-                             (MPIU_DBG_FDEST, "found_better_sc(sc=%p (%s), fnd_sc=(nil)) found=TRUE",
+            MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
+                             (MPL_DBG_FDEST, "found_better_sc(sc=%p (%s), fnd_sc=(nil)) found=TRUE",
                               sc, CONN_STATE_STR[sc->state.cstate]));
         }
     }
     else {
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
-                         (MPIU_DBG_FDEST, "found_better_sc(sc=%p (%s), *fnd_sc=N/A) found=FALSE",
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
+                         (MPL_DBG_FDEST, "found_better_sc(sc=%p (%s), *fnd_sc=N/A) found=FALSE",
                           sc, CONN_STATE_STR[sc->state.cstate]));
     }
     MPIDI_FUNC_EXIT(MPID_STATE_FOUND_BETTER_SC);
@@ -445,7 +445,7 @@ static int vc_is_in_shutdown(MPIDI_VC_t *vc)
         retval = TRUE;
     }
 
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "vc_is_in_shutdown(%p)=%s", vc, (retval ? "TRUE" : "FALSE")));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "vc_is_in_shutdown(%p)=%s", vc, (retval ? "TRUE" : "FALSE")));
     return retval;
 }
 
@@ -466,7 +466,7 @@ static int send_id_info(const sockconn_t *const sc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_SEND_ID_INFO);
 
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "my_pg->id=%s my_pg->rank=%d, sc->pg_rank=%d sc->is_same_pg=%s",
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "my_pg->id=%s my_pg->rank=%d, sc->pg_rank=%d sc->is_same_pg=%s",
                                              (char *)MPIDI_Process.my_pg->id, MPIDI_Process.my_pg_rank, sc->pg_rank,
                                              (sc->is_same_pg ? "TRUE" : "FALSE")));
     if (!sc->is_same_pg)
@@ -505,7 +505,7 @@ static int send_id_info(const sockconn_t *const sc)
     MPIDI_FUNC_EXIT(MPID_STATE_SEND_ID_INFO);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d, offset=%lld, errno=%d %s", mpi_errno, (long long)offset, errno, MPIU_Strerror(errno)));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d, offset=%lld, errno=%d %s", mpi_errno, (long long)offset, errno, MPIU_Strerror(errno)));
     goto fn_exit;    
 }
 
@@ -526,7 +526,7 @@ static int send_tmpvc_info(const sockconn_t *const sc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_SEND_TMPVC_INFO);
 
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "my->pg_rank=%d, sc->pg_rank=%d"
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "my->pg_rank=%d, sc->pg_rank=%d"
                                              , MPIDI_Process.my_pg_rank, sc->pg_rank));
 
 /*     store ending NULL also */
@@ -555,7 +555,7 @@ static int send_tmpvc_info(const sockconn_t *const sc)
     MPIDI_FUNC_EXIT(MPID_STATE_SEND_TMPVC_INFO);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d, offset=%lld, errno=%d %s", mpi_errno, (long long)offset, errno, MPIU_Strerror(errno)));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d, offset=%lld, errno=%d %s", mpi_errno, (long long)offset, errno, MPIU_Strerror(errno)));
     goto fn_exit;    
 }
 
@@ -628,7 +628,7 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
             MPID_nem_tcp_vc_area *sc_vc_tcp = VC_TCP(sc_vc);
 
             MPIU_Assert(sc_vc != NULL);
-            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc_vc, sc_vc_tcp->sc_ref_count));
+            MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc_vc, sc_vc_tcp->sc_ref_count));
             ++sc_vc_tcp->sc_ref_count;
         }
         
@@ -636,13 +636,13 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
         sc->pg_is_set = TRUE;
         MPIU_Assert(!sc->is_tmpvc);
         
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PKT_ID_INFO: sc->pg_rank=%d sc->is_same_pg=%d sc->fd=%d, sc->vc=%p, sc=%p", sc->pg_rank, sc->is_same_pg, sc->fd, sc->vc, sc));
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "PKT_ID_INFO: sc->pg_rank=%d sc->is_same_pg=%d sc->fd=%d, sc->vc=%p, sc=%p", sc->pg_rank, sc->is_same_pg, sc->fd, sc->vc, sc));
     }
     else if (hdr.pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_TMPVC_INFO) {
         MPIDI_VC_t *vc;
         MPID_nem_tcp_vc_area *vc_tcp;
 
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "PKT_TMPVC_INFO: sc->fd=%d", sc->fd));
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "PKT_TMPVC_INFO: sc->fd=%d", sc->fd));
         /* create a new VC */
         MPIU_CHKPMEM_MALLOC (vc, MPIDI_VC_t *, sizeof(MPIDI_VC_t), mpi_errno, "real vc from tmp vc");
         /* --BEGIN ERROR HANDLING-- */
@@ -657,7 +657,7 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
         MPIDI_VC_Init(vc, NULL, 0);
         vc_tcp->state = MPID_NEM_TCP_VC_STATE_CONNECTED; /* FIXME: is it needed ? */
         sc->vc = vc;
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc->vc, vc_tcp->sc_ref_count));
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc->vc, vc_tcp->sc_ref_count));
         ++vc_tcp->sc_ref_count;
 
         ASSIGN_SC_TO_VC(vc_tcp, sc);
@@ -673,7 +673,7 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
         sc->pg_id = NULL;
         sc->is_tmpvc = TRUE;
 
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "enqueuing on acceptq vc=%p, sc->fd=%d, tag=%d", vc, sc->fd, sc->vc->port_name_tag));
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "enqueuing on acceptq vc=%p, sc->fd=%d, tag=%d", vc, sc->fd, sc->vc->port_name_tag));
         MPIDI_CH3I_Acceptq_enqueue(vc, sc->vc->port_name_tag);
 
         MPIU_Assert(!sc->pg_is_set);
@@ -686,7 +686,7 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
     return mpi_errno;
  fn_fail:
     MPIU_CHKPMEM_REAP();
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -720,7 +720,7 @@ static int send_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t pkt_type)
  fn_exit:
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -758,7 +758,7 @@ static int recv_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t *pkt_type)
     MPIDI_FUNC_EXIT(MPID_STATE_RECV_CMD_PKT);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -802,7 +802,7 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
         int rc = 0;
 
         if (vc_tcp->connect_retry_count > MPIDI_NEM_TCP_MAX_CONNECT_RETRIES) {
-            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "exceeded retries, closing sc");
+            MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "exceeded retries, closing sc");
             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);
             MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
@@ -857,11 +857,11 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
         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(MPIDI_NEM_TCP_DBG_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));
+	MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_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) MPIR_ERR_POP (mpi_errno);
 
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "connecting to 0x%08X:%d", sock_addr->sin_addr.s_addr, sock_addr->sin_port));
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_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 */
         MPIR_ERR_CHKANDJUMP2(rc < 0 && errno != EINPROGRESS, mpi_errno, MPI_ERR_OTHER, "**sock_connect", "**sock_connect %d %s", errno, MPIU_Strerror(errno));
@@ -895,7 +895,7 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
 
         ASSIGN_SC_TO_VC(vc_tcp, sc);
         sc->vc = vc;
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc->vc, vc_tcp->sc_ref_count));
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc->vc, vc_tcp->sc_ref_count));
         ++vc_tcp->sc_ref_count;
     }
     else if (vc_tcp->state == MPID_NEM_TCP_VC_STATE_CONNECTED) {
@@ -919,7 +919,7 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
  fn_fail:
     if (idx != -1)
         close_cleanup_and_free_sc_plfd(&g_sc_tbl[idx]); /* ignore error return */
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -944,7 +944,7 @@ static int cleanup_and_free_sc_plfd(sockconn_t *const sc)
         goto fn_exit;
 
     if (sc_vc) {
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "about to decr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc_vc, sc_vc_tcp->sc_ref_count));
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "about to decr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc_vc, sc_vc_tcp->sc_ref_count));
         MPIU_Assert(sc_vc_tcp->sc_ref_count > 0);
         --sc_vc_tcp->sc_ref_count;
     }
@@ -970,7 +970,7 @@ static int cleanup_and_free_sc_plfd(sockconn_t *const sc)
     return mpi_errno;
  fn_fail:
     MPIU_CHKPMEM_REAP();
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -991,7 +991,7 @@ int close_cleanup_and_free_sc_plfd(sockconn_t *const sc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_CLOSE_CLEANUP_AND_FREE_SC_PLFD);
 
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "vc=%p, sc=%p, closing fd=%d", sc->vc, sc, sc->fd));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "vc=%p, sc=%p, closing fd=%d", sc->vc, sc, sc->fd));
 
     if (sc == NULL)
         goto fn_exit;
@@ -1055,7 +1055,7 @@ int MPID_nem_tcp_cleanup (struct MPIDI_VC *const vc)
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_CLEANUP);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -1119,7 +1119,7 @@ static int state_tc_c_cnting_handler(struct pollfd *const plfd, sockconn_t *cons
         CHANGE_STATE(sc, CONN_STATE_TC_C_CNTD);
     }
     else if (status == MPID_NEM_TCP_SOCK_ERROR_EOF) {
-        MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "state_tc_c_cnting_handler(): closing sc");
+        MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "state_tc_c_cnting_handler(): closing sc");
         mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
     }
     else { /* status == MPID_NEM_TCP_SOCK_NOEVENT */
@@ -1151,17 +1151,17 @@ static int state_tc_c_cntd_handler(struct pollfd *const plfd, sockconn_t *const
     MPIDI_FUNC_ENTER(MPID_STATE_STATE_TC_C_CNTD_HANDLER);
 
     if (found_better_sc(sc, NULL)) {
-        MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "state_tc_c_cntd_handler(): closing sc");
+        MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "state_tc_c_cntd_handler(): closing sc");
         mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         goto fn_exit;
     }
     
     if (IS_WRITEABLE(plfd)) {
-        MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "inside if (IS_WRITEABLE(plfd))");
+        MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "inside if (IS_WRITEABLE(plfd))");
         if (!sc->is_tmpvc) { /* normal connection */
             mpi_errno = send_id_info(sc);
             if (mpi_errno) {
-                MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "state_tc_c_cntd_handler(): closing sc");
+                MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "state_tc_c_cntd_handler(): closing sc");
                 mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
                 mpi_errno = MPI_SUCCESS; /* don't return an error if we fail in the connect protocol, just retry. */
                 goto fn_exit;
@@ -1183,7 +1183,7 @@ static int state_tc_c_cntd_handler(struct pollfd *const plfd, sockconn_t *const
     MPIDI_FUNC_EXIT(MPID_STATE_STATE_TC_C_CNTD_HANDLER);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
     goto fn_exit;
 }
@@ -1217,14 +1217,14 @@ static int state_c_ranksent_handler(struct pollfd *const plfd, sockconn_t *const
 
             MPID_nem_tcp_conn_est (sc_vc);
             sc_vc_tcp->connect_retry_count = 0; /* successfully connected, reset connection retry count */
-            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "c_ranksent_handler(): connection established (sc=%p, sc->vc=%p, fd=%d)", sc, sc->vc, sc->fd));
+            MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "c_ranksent_handler(): connection established (sc=%p, sc->vc=%p, fd=%d)", sc, sc->vc, sc->fd));
             break;
         case MPIDI_NEM_TCP_SOCKSM_PKT_ID_NAK:
-            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "received NAK, closing sc");
+            MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "received NAK, closing sc");
             mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
             break;
         case MPIDI_NEM_TCP_SOCKSM_PKT_CLOSED:
-            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "received CLOSED, closing sc");
+            MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "received CLOSED, closing sc");
             mpi_errno = MPIDI_CH3U_Handle_connection(sc_vc, MPIDI_VC_EVENT_TERMINATED);
             if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
@@ -1238,7 +1238,7 @@ fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_STATE_C_RANKSENT_HANDLER);
     return mpi_errno;
 fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
     mpi_errno = MPI_SUCCESS; /* don't return an error if we fail in the connect protocol, just retry. */
     goto fn_exit;
@@ -1262,7 +1262,7 @@ static int state_c_tmpvcsent_handler(struct pollfd *const plfd, sockconn_t *cons
         mpi_errno = recv_cmd_pkt(sc->fd, &pkt_type);
         if (mpi_errno) {
             int mpi_errno2 = MPI_SUCCESS;
-            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "error sending cmd pkt, closing sc");
+            MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "error sending cmd pkt, closing sc");
             mpi_errno2 = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
             if (mpi_errno2) {
                 MPIR_ERR_SET(mpi_errno2, MPI_ERR_OTHER, "**tcp_cleanup_fail");
@@ -1281,11 +1281,11 @@ static int state_c_tmpvcsent_handler(struct pollfd *const plfd, sockconn_t *cons
                 ASSIGN_SC_TO_VC(sc_vc_tcp, sc);
                 MPID_nem_tcp_conn_est (sc_vc);
                 sc_vc_tcp->connect_retry_count = 0; /* successfully connected, reset connection retry count */
-                MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "c_tmpvcsent_handler(): connection established (fd=%d, sc=%p, sc->vc=%p)", sc->fd, sc, sc_vc));
+                MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "c_tmpvcsent_handler(): connection established (fd=%d, sc=%p, sc->vc=%p)", sc->fd, sc, sc_vc));
             }
             else { /* pkt_type must be MPIDI_NEM_TCP_SOCKSM_PKT_ID_NAK */
-                MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "state_c_tmpvcsent_handler() 2: closing sc"));
-                MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "received NAK, closing sc");
+                MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "state_c_tmpvcsent_handler() 2: closing sc"));
+                MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "received NAK, closing sc");
                 mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
             }
         }
@@ -1310,7 +1310,7 @@ static int state_l_cntd_handler(struct pollfd *const plfd, sockconn_t *const sc)
 
     status = MPID_nem_tcp_check_sock_status(plfd);
     if (status == MPID_NEM_TCP_SOCK_ERROR_EOF) {
-        MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "Received EOF, closing sc");
+        MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "Received EOF, closing sc");
         mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         goto fn_exit;
     }
@@ -1323,7 +1323,7 @@ static int state_l_cntd_handler(struct pollfd *const plfd, sockconn_t *const sc)
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (got_sc_eof) {
-            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "got eof, closing sc");
+            MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "got eof, closing sc");
             mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
             goto fn_exit;
         }
@@ -1337,14 +1337,14 @@ static int state_l_cntd_handler(struct pollfd *const plfd, sockconn_t *const sc)
     }
     else {
         /* remain in same state */
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "!IS_READABLE(plfd) fd=%d events=%#x revents=%#x", plfd->fd, plfd->events, plfd->revents));
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "!IS_READABLE(plfd) fd=%d events=%#x revents=%#x", plfd->fd, plfd->events, plfd->revents));
     }
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_STATE_L_CNTD_HANDLER);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
     mpi_errno = MPI_SUCCESS; /* don't return an error if we fail in the connect protocol, just retry. */
     goto fn_exit;
@@ -1376,8 +1376,8 @@ static int do_i_win(sockconn_t *rmt_sc)
             win = TRUE;
     }
 
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
-                     (MPIU_DBG_FDEST, "do_i_win(rmt_sc=%p (%s)) win=%s is_same_pg=%s my_pg_rank=%d rmt_pg_rank=%d",
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
+                     (MPL_DBG_FDEST, "do_i_win(rmt_sc=%p (%s)) win=%s is_same_pg=%s my_pg_rank=%d rmt_pg_rank=%d",
                       rmt_sc, CONN_STATE_STR[rmt_sc->state.cstate],
                       (win ? "TRUE" : "FALSE"),(rmt_sc->is_same_pg ? "TRUE" : "FALSE"), MPIDI_Process.my_pg_rank,
                       rmt_sc->pg_rank));
@@ -1423,7 +1423,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) MPIR_ERR_POP(mpi_errno);
-            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "lost head-to-head, closing sc");
+            MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "lost head-to-head, closing sc");
             mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         } else {
             /* The following line is _crucial_ to correct operation.  We need to
@@ -1440,7 +1440,7 @@ static int state_l_rankrcvd_handler(struct pollfd *const plfd, sockconn_t *const
             
             CHANGE_STATE(sc, CONN_STATE_TS_COMMRDY);
             ASSIGN_SC_TO_VC(sc_vc_tcp, sc);
-            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "connection established: sc=%p, sc->vc=%p, sc->fd=%d, is_same_pg=%s, pg_rank=%d", sc, sc_vc, sc->fd, (sc->is_same_pg ? "TRUE" : "FALSE"), sc->pg_rank));
+            MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "connection established: sc=%p, sc->vc=%p, sc->fd=%d, is_same_pg=%s, pg_rank=%d", sc, sc_vc, sc->fd, (sc->is_same_pg ? "TRUE" : "FALSE"), sc->pg_rank));
             MPID_nem_tcp_conn_est (sc_vc);
             sc_vc_tcp->connect_retry_count = 0; /* successfully connected, reset connection retry count */
         }
@@ -1450,7 +1450,7 @@ fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_STATE_L_RANKRCVD_HANDLER);
     return mpi_errno;
 fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
     mpi_errno = MPI_SUCCESS; /* don't return an error if we fail in the connect protocol, just retry. */
     goto fn_exit;
@@ -1472,7 +1472,7 @@ static int state_l_tmpvcrcvd_handler(struct pollfd *const plfd, sockconn_t *cons
 
     status = MPID_nem_tcp_check_sock_status(plfd);
     if (status == MPID_NEM_TCP_SOCK_ERROR_EOF) {
-        MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "Received EOF, closing sc");
+        MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "Received EOF, closing sc");
         mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         goto fn_exit;
     }
@@ -1485,7 +1485,7 @@ static int state_l_tmpvcrcvd_handler(struct pollfd *const plfd, sockconn_t *cons
         ASSIGN_SC_TO_VC(sc_vc_tcp, sc);
         MPID_nem_tcp_conn_est(sc_vc);
         sc_vc_tcp->connect_retry_count = 0; /* successfully connected, reset connection retry count */
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "fd=%d: TMPVC_ACK sent, connection established!", sc->fd));
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "fd=%d: TMPVC_ACK sent, connection established!", sc->fd));
     }
 
 fn_exit:
@@ -1494,7 +1494,7 @@ fn_exit:
  fn_fail:
     {
         int cleanup_errno = MPI_SUCCESS;
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
         mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         if (cleanup_errno) {
             MPIR_ERR_SET(cleanup_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
@@ -1547,7 +1547,7 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
                        disconnecting, then we end up with a potential race where
                        the other side performs a tcp close() before we do and we
                        blow up here. */
-                    MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "other side closed, but we're shutting down, closing sc");
+                    MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "other side closed, but we're shutting down, closing sc");
                     /* it's really not an error, but we're calling
                        cleanup_on_error because it does what we want it to */
                     mpi_errno = MPID_nem_tcp_cleanup_on_error(sc_vc, MPI_SUCCESS);
@@ -1555,7 +1555,7 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
                 }
                 else
                 {
-                    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "ERROR: sock (fd=%d) is closed: bytes_recvd == 0", sc->fd );
+                    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "ERROR: sock (fd=%d) is closed: bytes_recvd == 0", sc->fd );
                     MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
                 }
             }
@@ -1565,7 +1565,7 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
             }
         }
     
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "New recv " MPIDI_MSG_SZ_FMT " (fd=%d, vc=%p, sc=%p)", bytes_recvd, sc_fd, sc_vc, sc));
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_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) MPIR_ERR_POP_LABEL(mpi_errno, fn_noncomm_fail);
@@ -1594,7 +1594,7 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
             }
         }
 
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Cont recv %ld", (long int)bytes_recvd);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Cont recv %ld", (long int)bytes_recvd);
 
         /* update the iov */
         for (iov = &rreq->dev.iov[rreq->dev.iov_offset]; iov < &rreq->dev.iov[rreq->dev.iov_offset + rreq->dev.iov_count]; ++iov)
@@ -1605,9 +1605,9 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
                 iov->MPL_IOV_LEN -= bytes_recvd;
                 rreq->dev.iov_count = (int)(&rreq->dev.iov[rreq->dev.iov_offset + rreq->dev.iov_count] - iov);
                 rreq->dev.iov_offset = iov - rreq->dev.iov;
-                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bytes_recvd = %ld", (long int)bytes_recvd);
-                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov len = %ld", (long int)iov->MPL_IOV_LEN);
-                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_offset = %lld", (long long)rreq->dev.iov_offset);
+                MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bytes_recvd = %ld", (long int)bytes_recvd);
+                MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov len = %ld", (long int)iov->MPL_IOV_LEN);
+                MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_offset = %lld", (long long)rreq->dev.iov_offset);
                 goto fn_exit;
             }
             bytes_recvd -= iov->MPL_IOV_LEN;
@@ -1623,7 +1623,7 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
             if (mpi_errno != MPI_SUCCESS) {
                 MPIR_ERR_POP(mpi_errno);
             }
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...complete");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...complete");
             sc_vc_ch->recv_active = NULL;
         }
         else
@@ -1635,12 +1635,12 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
 
             if (complete)
             {
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...complete");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...complete");
                 sc_vc_ch->recv_active = NULL;
             }
             else
             {
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...not complete");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...not complete");
             }
         }
     }
@@ -1678,7 +1678,7 @@ static int state_commrdy_handler(struct pollfd *const plfd, sockconn_t *const sc
 
     MPIDI_FUNC_ENTER(MPID_STATE_STATE_COMMRDY_HANDLER);
 
-    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc = %p", sc->vc);
+    MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc = %p", sc->vc);
     if (IS_READABLE(plfd))
     {
         mpi_errno = MPID_nem_tcp_recv_handler(sc);
@@ -1808,7 +1808,7 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
 
     CHECK_EINTR(n, poll(MPID_nem_tcp_plfd_tbl, num_polled, 0));
     MPIR_ERR_CHKANDJUMP1(n == -1, mpi_errno, MPI_ERR_OTHER, "**poll", "**poll %s", MPIU_Strerror(errno));
-    /* MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "some sc fd poll event")); */
+    /* MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "some sc fd poll event")); */
     for(i = 0; i < num_polled; i++)
     {
         struct pollfd *it_plfd = &MPID_nem_tcp_plfd_tbl[i];
@@ -1830,7 +1830,7 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
                 if (rc < 0)
                     err_str = MPIU_Strerror(errno);
                 
-                MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "error polling fd, closing sc");
+                MPL_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "error polling fd, closing sc");
                 if (it_sc->vc) {
                     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);
@@ -1854,7 +1854,7 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
  fn_exit:
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -1903,9 +1903,9 @@ int MPID_nem_tcp_state_listening_handler(struct pollfd *const unused_1, sockconn
     while (1) {
         l_sc = &g_sc_tbl[0];  /* N3 Important */
         len = sizeof(SA_IN);
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "before accept"));
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "before accept"));
         if ((connfd = accept(l_sc->fd, (SA *) &rmt_addr, &len)) < 0) {
-            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "after accept, l_sc=%p lstnfd=%d connfd=%d, errno=%d:%s ", l_sc, l_sc->fd, connfd, errno, MPIU_Strerror(errno)));
+            MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "after accept, l_sc=%p lstnfd=%d connfd=%d, errno=%d:%s ", l_sc, l_sc->fd, connfd, errno, MPIU_Strerror(errno)));
             if (errno == EINTR) 
                 continue;
             else if (errno == EWOULDBLOCK || errno == EAGAIN)
@@ -1931,7 +1931,7 @@ int MPID_nem_tcp_state_listening_handler(struct pollfd *const unused_1, sockconn
 
             CHANGE_STATE(sc, CONN_STATE_TA_C_CNTD);
 
-            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "accept success, added to table, connfd=%d, sc->vc=%p, sc=%p plfd->events=%#x", connfd, sc->vc, sc, plfd->events)); /* sc->vc should be NULL at this point */
+            MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "accept success, added to table, connfd=%d, sc->vc=%p, sc=%p plfd->events=%#x", connfd, sc->vc, sc, plfd->events)); /* sc->vc should be NULL at this point */
         }
     }
 
@@ -1939,7 +1939,7 @@ int MPID_nem_tcp_state_listening_handler(struct pollfd *const unused_1, sockconn
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_STATE_LISTENING_HANDLER);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h
index a517ac4..c36f0c0 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h
@@ -96,19 +96,19 @@ extern const char *const CONN_STATE_STR[];
 #endif
 #undef M_
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
 #define CONN_STATE_TO_STRING(_cstate) \
     (( (_cstate) >= CONN_STATE_TS_CLOSED && (_cstate) < CONN_STATE_SIZE ) ? CONN_STATE_STR[_cstate] : "out_of_range")
 
 #define DBG_CHANGE_STATE(_sc, _cstate) do { \
     const char *state_str = NULL; \
     const char *old_state_str = NULL; \
-    if (MPIU_DBG_SELECTED(MPIDI_NEM_TCP_DBG_DET,VERBOSE)) { \
+    if (MPL_DBG_SELECTED(MPIDI_NEM_TCP_DBG_DET,VERBOSE)) { \
         if ((_sc)) { \
             old_state_str = CONN_STATE_TO_STRING((_sc)->state.cstate); \
             state_str     = CONN_STATE_TO_STRING(_cstate); \
         } \
-        MPIU_DBG_OUT_FMT(MPIDI_NEM_TCP_DBG_DET, (MPIU_DBG_FDEST, "CHANGE_STATE(_sc=%p, _cstate=%d (%s)) - old_state=%s sc->vc=%p", _sc, _cstate, state_str, old_state_str, (_sc)->vc)); \
+        MPL_DBG_OUT_FMT(MPIDI_NEM_TCP_DBG_DET, (MPL_DBG_FDEST, "CHANGE_STATE(_sc=%p, _cstate=%d (%s)) - old_state=%s sc->vc=%p", _sc, _cstate, state_str, old_state_str, (_sc)->vc)); \
     } \
 } while (0)
 #else
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_impl.h
index 4139b4b..5d84bb3 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_impl.h
@@ -21,7 +21,7 @@ extern struct pollfd *MPID_nem_tcp_plfd_tbl;
 extern sockconn_t MPID_nem_tcp_g_lstn_sc;
 extern struct pollfd MPID_nem_tcp_g_lstn_plfd;
 
-extern MPIU_DBG_Class MPIDI_NEM_TCP_DBG_DET;
+extern MPL_DBG_Class MPIDI_NEM_TCP_DBG_DET;
 
 typedef enum{MPID_NEM_TCP_VC_STATE_DISCONNECTED,
              MPID_NEM_TCP_VC_STATE_CONNECTED,
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 ecc87b4..2d97aad 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
@@ -112,7 +112,7 @@ MPID_nem_netmod_funcs_t MPIDI_nem_tcp_funcs = {
 /* in case there are no packet types defined (e.g., they're ifdef'ed out) make sure the array is not zero length */
 static MPIDI_CH3_PktHandler_Fcn *pkt_handlers[MPIDI_NEM_TCP_PKT_NUM_TYPES ? MPIDI_NEM_TCP_PKT_NUM_TYPES : 1];
 
-MPIU_DBG_Class MPIDI_NEM_TCP_DBG_DET;
+MPL_DBG_Class MPIDI_NEM_TCP_DBG_DET;
 
 #undef FUNCNAME
 #define FUNCNAME set_up_listener
@@ -165,9 +165,9 @@ int MPID_nem_tcp_init (MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_
     /* first make sure that our private fields in the vc fit into the area provided  */
     MPIU_Assert(sizeof(MPID_nem_tcp_vc_area) <= MPIDI_NEM_VC_NETMOD_AREA_LEN);
 
-#if defined (USE_DBG_LOGGING)
-    MPIDI_NEM_TCP_DBG_DET = MPIU_DBG_Class_alloc("MPIDI_NEM_TCP_DBG_DET", "nem_sock_det");
-#endif /* USE_DBG_LOGGING */
+#if defined (MPL_USE_DBG_LOGGING)
+    MPIDI_NEM_TCP_DBG_DET = MPL_DBG_Class_alloc("MPIDI_NEM_TCP_DBG_DET", "nem_sock_det");
+#endif /* MPL_USE_DBG_LOGGING */
 
     /* set up listener socket */
     mpi_errno = set_up_listener();
@@ -315,7 +315,7 @@ static int GetSockInterfaceAddr(int myRank, char *ifname, int maxIfname,
         mpi_errno = MPIDI_Get_IP_for_iface(MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE, ifaddr, &ifaddrFound);
         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(MPIDI_CH3_DBG_CONNECT, VERBOSE, (MPIU_DBG_FDEST,
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT, VERBOSE, (MPL_DBG_FDEST,
                                                 "ifaddrFound=TRUE ifaddr->type=%d ifaddr->len=%d ifaddr->ifaddr[0-3]=%d.%d.%d.%d",
                                                 ifaddr->type, ifaddr->len, ifaddr->ifaddr[0], ifaddr->ifaddr[1], ifaddr->ifaddr[2],
                                                 ifaddr->ifaddr[3]));
@@ -446,7 +446,7 @@ int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_s
         unsigned char *p;
         p = (unsigned char *)(ifaddr.ifaddr);
         MPL_snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u", p[0], p[1], p[2], p[3] );
-        MPIU_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"ifname = %s",ifname );
+        MPL_DBG_MSG_S(MPIDI_CH3_DBG_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) {
             MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
@@ -608,7 +608,7 @@ int MPID_nem_tcp_get_addr_port_from_bc(const char *business_card, struct in_addr
     return mpi_errno;
  fn_fail:
 /*     fprintf(stdout, "failure. mpi_errno = %d\n", mpi_errno); */
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -658,7 +658,7 @@ int MPID_nem_tcp_bind (int sockfd)
     return mpi_errno;
  fn_fail:
 /*     fprintf(stdout, "failure. mpi_errno = %d\n", mpi_errno); */
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -729,7 +729,7 @@ int MPID_nem_tcp_vc_terminated(MPIDI_VC_t *vc)
     MPIDI_FUNC_EXIT(MPID_NEM_TCP_VC_TERMINATED);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
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 227bbf7..4be687e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
@@ -79,7 +79,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_SEND_QUEUED);
 
-    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc = %p", vc);
+    MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc = %p", vc);
     MPIU_Assert(vc != NULL);
 
     if (MPIDI_CH3I_Sendq_empty(*send_queue))
@@ -88,7 +88,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
     while (!MPIDI_CH3I_Sendq_empty(*send_queue))
     {
         sreq = MPIDI_CH3I_Sendq_head(*send_queue);
-        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Sending %p", sreq);
+        MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Sending %p", sreq);
 
         iov = &sreq->dev.iov[sreq->dev.iov_offset];
         
@@ -107,7 +107,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
             if (errno == EAGAIN)
             {
                 offset = 0;
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "EAGAIN");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "EAGAIN");
                 break;
             } else {
                 int req_errno = MPI_SUCCESS;
@@ -118,7 +118,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
                 goto fn_exit; /* this vc is closed now, just bail out */
             }
         }
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
 
         complete = 1;
         for (iov = &sreq->dev.iov[sreq->dev.iov_offset]; iov < &sreq->dev.iov[sreq->dev.iov_offset + sreq->dev.iov_count]; ++iov)
@@ -153,7 +153,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
                 if (mpi_errno != MPI_SUCCESS) {
                     MPIR_ERR_POP(mpi_errno);
                 }
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                 MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
                 continue;
             }
@@ -164,7 +164,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
             
             if (complete)
             {
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                 MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
                 continue;
             }
@@ -245,7 +245,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
     
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
     
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_iStartContigMsg");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_iStartContigMsg");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
 
     if (!MPID_nem_tcp_vc_send_paused(vc_tcp)) {
@@ -283,7 +283,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
                         goto fn_fail;
                     }
                 }
-                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
+                MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
                 
                 if (offset == sizeof(MPIDI_CH3_Pkt_t) + data_sz)
                 {
@@ -303,7 +303,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
     }
 
     /* create and enqueue request */
-    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
+    MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
 
     /* create a request */
     sreq = MPID_Request_create();
@@ -385,7 +385,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
     
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
     
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_iStartContigMsg");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_iStartContigMsg");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
 
     if (MPID_nem_tcp_vc_is_connected(vc_tcp))
@@ -423,7 +423,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
                     goto fn_fail;
                 }
             }
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
                 
             if (offset == sizeof(MPIDI_CH3_Pkt_t) + data_sz)
             {
@@ -442,7 +442,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
     }
 
     /* create and enqueue request */
-    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
+    MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
 
     /* create a request */
     sreq = MPID_Request_create();
@@ -518,7 +518,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
     
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
     
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_iSendContig");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_iSendContig");
 
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
 
@@ -567,7 +567,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
                         goto fn_fail;
                     }
                 }
-                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
+                MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
                 
                 if (offset == sizeof(MPIDI_CH3_Pkt_t) + sreq->dev.ext_hdr_sz + data_sz)
                 {
@@ -582,7 +582,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
                         if (mpi_errno != MPI_SUCCESS) {
                             MPIR_ERR_POP(mpi_errno);
                         }
-                        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+                        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                         goto fn_exit;
                     }
                     else
@@ -594,7 +594,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
                         
                         if (complete)
                         {
-                            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+                            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                             goto fn_exit;
                         }
                         
@@ -658,7 +658,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
 
 enqueue_request:
     /* enqueue request */
-    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
+    MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
     MPIU_Assert(sreq->dev.iov_count >= 1 && sreq->dev.iov[0].MPL_IOV_LEN > 0);
 
     sreq->ch.vc = vc;
@@ -708,7 +708,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_SENDNONCONTIG);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_SENDNONCONTIG);
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_SendNoncontig");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_SendNoncontig");
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
 
     iov_n = 0;
@@ -760,7 +760,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
                     }
                 }
                 
-                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write noncontig " MPIDI_MSG_SZ_FMT, offset);
+                MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write noncontig " MPIDI_MSG_SZ_FMT, offset);
             }
         }
         else
@@ -809,7 +809,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
             if (mpi_errno != MPI_SUCCESS) {
                 MPIR_ERR_POP(mpi_errno);
             }
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
             goto fn_exit;
         }
 
@@ -819,13 +819,13 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
             
         if (complete)
         {
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
             goto fn_exit;
         }
     }
         
     /* enqueue request */
-    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
+    MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
     MPIU_Assert(sreq->dev.iov_count >= 1 && sreq->dev.iov[0].MPL_IOV_LEN > 0);
         
     sreq->ch.vc = vc;
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 584cc61..90f685a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c
@@ -41,7 +41,7 @@ int MPID_nem_tcp_get_vc_from_conninfo (char *pg_id, int pg_rank, struct MPIDI_VC
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_GET_VC_FROM_CONNINFO);
 
-    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "pg_id=%s pg_rank=%d", pg_id, pg_rank));
+    MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "pg_id=%s pg_rank=%d", pg_id, pg_rank));
     
     mpi_errno = MPIDI_PG_Find (pg_id, &pg);
     if (mpi_errno) MPIR_ERR_POP (mpi_errno);
@@ -148,7 +148,7 @@ MPID_nem_tcp_check_sock_status(const struct pollfd *const plfd)
     if (plfd->revents & POLLERR) 
     {
         rc = MPID_NEM_TCP_SOCK_ERROR_EOF;
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "POLLERR on socket"));
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "POLLERR on socket"));
         goto fn_exit;
     }
     if (plfd->revents & POLLIN || plfd->revents & POLLOUT) 
@@ -160,7 +160,7 @@ MPID_nem_tcp_check_sock_status(const struct pollfd *const plfd)
         if (getsockopt(plfd->fd, SOL_SOCKET, SO_ERROR, &error, &n) < 0 || error != 0) 
         {
             rc = MPID_NEM_TCP_SOCK_ERROR_EOF; /*  (N1) */
-            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "getsockopt failure. error=%d:%s", error, MPIU_Strerror(error)));
+            MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "getsockopt failure. error=%d:%s", error, MPIU_Strerror(error)));
             goto fn_exit;
         }
         rc = MPID_NEM_TCP_SOCK_CONNECTED;
@@ -186,7 +186,7 @@ int MPID_nem_tcp_is_sock_connected(int fd)
     n = sizeof(error);
     if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &n) < 0 || error != 0) 
     {
-        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "getsockopt failure. error=%d:%s", error, MPIU_Strerror(error)));
+        MPL_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPL_DBG_FDEST, "getsockopt failure. error=%d:%s", error, MPIU_Strerror(error)));
         rc = FALSE; /*  error */
         goto fn_exit;
     }
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_init.c b/src/mpid/ch3/channels/nemesis/src/ch3_init.c
index cdafb39..7a51a40 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_init.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_init.c
@@ -208,7 +208,7 @@ int MPIDI_CH3_VC_Destroy(MPIDI_VC_t *vc )
     /* no need to destroy vc to self, this corresponds to the optimization above
      * in MPIDI_CH3_VC_Init */
     if (vc->pg == MPIDI_CH3I_my_pg && vc->pg_rank == MPIDI_CH3I_my_rank) {
-        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_VC, VERBOSE, "skipping self vc=%p", vc);
+        MPL_DBG_MSG_P(MPIDI_CH3_DBG_VC, VERBOSE, "skipping self vc=%p", vc);
         goto fn_exit;
     }
 
@@ -267,7 +267,7 @@ int MPIDI_CH3_Connect_to_root (const char *port_name, MPIDI_VC_t **new_vc)
 }
 
 #ifndef MPIDI_CH3_HAS_NO_DYNAMIC_PROCESS
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
 const char * MPIDI_CH3_VC_GetStateString( struct MPIDI_VC *vc )
 {
     /* Nemesis doesn't have connection state associated with the VC */
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_isend.c b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
index d08bdc7..b9194bb 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
@@ -52,7 +52,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
     if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
     {
         MPIU_Assert(hdr_sz <= INT_MAX);
-	MPIU_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iSend %d", (int) hdr_sz);
+	MPL_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iSend %d", (int) hdr_sz);
 	mpi_errno = MPID_nem_mpich_send_header (hdr, (int)hdr_sz, vc, &again);
         if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	if (again)
@@ -97,7 +97,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
     goto fn_exit;
 
  enqueue_it:
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
 
     sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *) hdr;
     sreq->dev.iov[0].MPL_IOV_BUF = (char *) &sreq->dev.pending_pkt;
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
index f146a65..432d2f5 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
@@ -71,7 +71,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
 	MPL_IOV *remaining_iov = iov;
 	int remaining_n_iov = n_iov;
 
-        MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iSendv");
+        MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iSendv");
 	mpi_errno = MPID_nem_mpich_sendv_header (&remaining_iov, &remaining_n_iov,
 	                                         sreq->dev.ext_hdr_ptr, sreq->dev.ext_hdr_sz,
 	                                         vc, &again);
@@ -96,13 +96,13 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
 	    {
 		sreq->dev.iov[0] = remaining_iov[0];
 	    }
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "  out of cells. remaining iov:");
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    %ld", (long int)sreq->dev.iov[0].MPL_IOV_LEN);
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "  out of cells. remaining iov:");
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    %ld", (long int)sreq->dev.iov[0].MPL_IOV_LEN);
 
 	    for (j = 1; j < remaining_n_iov; ++j)
 	    {
 		sreq->dev.iov[j] = remaining_iov[j];
-                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    %ld", (long int)remaining_iov[j].MPL_IOV_LEN);
+                MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    %ld", (long int)remaining_iov[j].MPL_IOV_LEN);
 	    }
 	    sreq->dev.iov_offset = 0;
 	    sreq->dev.iov_count = remaining_n_iov;
@@ -116,7 +116,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
                 MPIDI_CH3I_shm_active_send = sreq;
             }
 
-            MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "  enqueued");
+            MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "  enqueued");
 	}
 	else
 	{
@@ -130,7 +130,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
                 if (mpi_errno != MPI_SUCCESS) {
                     MPIR_ERR_POP(mpi_errno);
                 }
-                MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+                MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
             }
             else
             {
@@ -147,11 +147,11 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
                     MPIDI_CH3I_Sendq_enqueue(&MPIDI_CH3I_shm_sendq, sreq);
                     MPIU_Assert (MPIDI_CH3I_shm_active_send == NULL);
                     MPIDI_CH3I_shm_active_send = sreq;
-                    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... reloaded and enqueued");
+                    MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... reloaded and enqueued");
                 }
                 else
                 {
-                    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+                    MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                 }
             }
         }
@@ -160,7 +160,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
     {
 	int i;
 	
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
 	
 	sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *) iov[0].MPL_IOV_BUF;
 	sreq->dev.iov[0].MPL_IOV_BUF = (char *) &sreq->dev.pending_pkt;
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
index 4056364..481eeea 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
@@ -56,7 +56,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
        /* MT */
     {
         MPIU_Assert(hdr_sz <= INT_MAX);
-	MPIU_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iStartMsg %d", (int) hdr_sz);
+	MPL_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iStartMsg %d", (int) hdr_sz);
 	mpi_errno = MPID_nem_mpich_send_header (hdr, (int)hdr_sz, vc, &again);
         if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	if (again)
@@ -86,7 +86,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
     {
 	MPID_Request * sreq = NULL;
 	
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
 
 	/* create a request */
 	sreq = MPID_Request_create();
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
index fa6517b..7fd6309 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
@@ -80,37 +80,37 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
 	MPL_IOV *remaining_iov = iov;
 	int remaining_n_iov = n_iov;
 
-        MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iStartMsgv");
-        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
+        MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iStartMsgv");
+        MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
                 int total = 0;
                 int i;
                 for (i = 0; i < n_iov; ++i)
                     total += iov[i].MPL_IOV_LEN;
 
-                MPIU_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   + len=%d ", total);
+                MPL_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   + len=%d ", total);
             });
 	mpi_errno = MPID_nem_mpich_sendv_header (&remaining_iov, &remaining_n_iov,
 	                                         NULL, 0, vc, &again);
         if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	while (!again && (remaining_n_iov > 0))
 	{
-            MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
+            MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
                     int total = 0;
                     int i;
                     for (i = 0; i < remaining_n_iov; ++i)
                         total += remaining_iov[i].MPL_IOV_LEN;
-                    MPIU_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   + len=%d ", total);
+                    MPL_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   + len=%d ", total);
                 });
 
 	    mpi_errno = MPID_nem_mpich_sendv (&remaining_iov, &remaining_n_iov, vc, &again);
             if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	}
-        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
+        MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
                 int total = 0;
                 int i;
                 for (i = 0; i < remaining_n_iov; ++i)
                     total += remaining_iov[i].MPL_IOV_LEN;
-                MPIU_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   - len=%d ", total);
+                MPL_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   - len=%d ", total);
             });
 
 	if (again)
@@ -146,7 +146,7 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
     {
 	int i;
 	
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "request enqueued");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "request enqueued");
 	/* create a request */
 	sreq = MPID_Request_create();
 	MPIU_Assert(sreq != NULL);
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
index 7c15b97..a8ca2b4 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
@@ -153,7 +153,7 @@ int MPIDI_CH3I_Shm_send_progress(void)
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SHM_SEND_PROGRESS);
 
     sreq = MPIDI_CH3I_shm_active_send;
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, {if (sreq) MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Send: cont sreq");});
+    MPL_DBG_STMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, {if (sreq) MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Send: cont sreq");});
     if (sreq)
     {
         if (!sreq->ch.noncontig)
@@ -195,7 +195,7 @@ int MPIDI_CH3I_Shm_send_progress(void)
     else
     {
         sreq = MPIDI_CH3I_Sendq_head(MPIDI_CH3I_shm_sendq);
-        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {if (sreq) MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Send: new sreq ");});
+        MPL_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {if (sreq) MPL_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Send: new sreq ");});
 
         if (!sreq->ch.noncontig)
         {
@@ -265,7 +265,7 @@ int MPIDI_CH3I_Shm_send_progress(void)
         /* MT - clear the current active send before dequeuing/destroying the current request */
         MPIDI_CH3I_shm_active_send = NULL;
         MPIDI_CH3I_Sendq_dequeue(&MPIDI_CH3I_shm_sendq, &sreq);
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
         mpi_errno = check_terminating_vcs();
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
@@ -279,7 +279,7 @@ int MPIDI_CH3I_Shm_send_progress(void)
         {
             MPIDI_CH3I_shm_active_send = NULL;
             MPIDI_CH3I_Sendq_dequeue(&MPIDI_CH3I_shm_sendq, &sreq);
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
             mpi_errno = check_terminating_vcs();
             if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
@@ -526,7 +526,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
                     MPIDI_msg_sz_t buflen = payload_len;
 
                     /* This packet must be the first packet of a new message */
-                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Recv pkt from fbox");
+                    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Recv pkt from fbox");
                     MPIU_Assert(payload_len >= sizeof (MPIDI_CH3_Pkt_t));
 
                     MPIDI_PG_Get_vc_set_active(MPIDI_Process.my_pg, MPID_NEM_FBOX_SOURCE(cell), &vc);
@@ -563,7 +563,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
                 }
 
 
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Recv pkt from queue");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Recv pkt from queue");
 
                 MPIDI_PG_Get_vc_set_active(MPIDI_Process.my_pg, MPID_NEM_CELL_SOURCE(cell), &vc);
 
@@ -752,7 +752,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                 MPIDI_msg_sz_t len = buflen;
                 MPIDI_CH3_Pkt_t *pkt = (MPIDI_CH3_Pkt_t *)buf;
 
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "received new message");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "received new message");
 
                 /* invalid pkt data will result in unpredictable behavior */
                 MPIU_Assert(pkt->type >= 0 && pkt->type < MPIDI_CH3_PKT_END_ALL);
@@ -761,7 +761,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                 if (mpi_errno) MPIR_ERR_POP(mpi_errno);
                 buflen -= len;
                 buf    += len;
-                MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, if (!rreq) MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...completed immediately"));
+                MPL_DBG_STMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, if (!rreq) MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...completed immediately"));
             }
             while (!rreq && buflen >= sizeof(MPIDI_CH3_Pkt_t));
 
@@ -775,7 +775,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
         else if (vc_ch->recv_active)
         {
             MPIU_Assert(vc_ch->pending_pkt_len == 0);
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "continuing recv");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "continuing recv");
             rreq = vc_ch->recv_active;
         }
         else
@@ -785,7 +785,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
             MPIDI_msg_sz_t pktlen;
             MPIDI_CH3_Pkt_t *pkt = (MPIDI_CH3_Pkt_t *)vc_ch->pending_pkt;
 
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "received header fragment");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "received header fragment");
 
             copylen = ((vc_ch->pending_pkt_len + buflen <= sizeof(MPIDI_CH3_Pkt_t))
                        ? buflen
@@ -796,7 +796,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                 goto fn_exit;
 
             /* we have a whole header */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    completed header");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    completed header");
             MPIU_Assert(vc_ch->pending_pkt_len == sizeof(MPIDI_CH3_Pkt_t));
 
             buflen -= copylen;
@@ -814,7 +814,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
 
             if (!rreq)
             {
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...completed immediately");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...completed immediately");
                 continue;
             }
             /* Channel fields don't get initialized on request creation, init them here */
@@ -825,7 +825,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
         MPIU_Assert(rreq);
         MPIU_Assert(rreq->dev.iov_count > 0 && rreq->dev.iov[rreq->dev.iov_offset].MPL_IOV_LEN > 0);
 
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    copying into user buffer from IOV");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    copying into user buffer from IOV");
 
         if (buflen == 0)
         {
@@ -846,7 +846,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
             while (n_iov && buflen >= iov->MPL_IOV_LEN)
             {
                 size_t iov_len = iov->MPL_IOV_LEN;
-		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "        %d", (int)iov_len);
+		MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "        %d", (int)iov_len);
                 if (rreq->dev.drop_data == FALSE) {
                     MPIU_Memcpy (iov->MPL_IOV_BUF, buf, iov_len);
                 }
@@ -861,7 +861,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
             {
                 if (buflen > 0)
                 {
-		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "        " MPIDI_MSG_SZ_FMT, buflen);
+		    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "        " MPIDI_MSG_SZ_FMT, buflen);
                     if (rreq->dev.drop_data == FALSE) {
                         MPIU_Memcpy (iov->MPL_IOV_BUF, buf, buflen);
                     }
@@ -873,7 +873,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                 rreq->dev.iov_offset = iov - rreq->dev.iov;
                 rreq->dev.iov_count = n_iov;
                 vc_ch->recv_active = rreq;
-		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        remaining: " MPIDI_MSG_SZ_FMT " bytes + %d iov entries", iov->MPL_IOV_LEN, n_iov));
+		MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "        remaining: " MPIDI_MSG_SZ_FMT " bytes + %d iov entries", iov->MPL_IOV_LEN, n_iov));
             }
             else
             {
@@ -904,11 +904,11 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                     rreq->dev.iov_offset = 0;
                     MPIU_Assert(rreq->dev.iov_count > 0 && rreq->dev.iov[rreq->dev.iov_offset].MPL_IOV_LEN > 0);
                     vc_ch->recv_active = rreq;
-                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...not complete");
+                    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...not complete");
                 }
                 else
                 {
-                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...complete");
+                    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...complete");
                     vc_ch->recv_active = NULL;
                 }
             }
@@ -1053,7 +1053,7 @@ static int shm_connection_terminated(MPIDI_VC_t * vc)
     mpi_errno = MPIDI_CH3U_Handle_connection(vc, MPIDI_VC_EVENT_TERMINATED);
     if(mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Terminated VC %d", vc->pg_rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Terminated VC %d", vc->pg_rank);
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_SHM_CONNECTION_TERMINATED);
     return mpi_errno;
@@ -1074,7 +1074,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_CONNECTION_TERMINATE);
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Terminating VC %d", vc->pg_rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Terminating VC %d", vc->pg_rank);
 
     /* if this is already closed, exit */
     if (vc->state == MPIDI_VC_STATE_MORIBUND ||
@@ -1082,13 +1082,13 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
         goto fn_exit;
 
     if (vc->ch.is_local) {
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "VC is local");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "VC is local");
 
         if (vc->state != MPIDI_VC_STATE_CLOSED) {
             /* VC is terminated as a result of a fault.  Complete
                outstanding sends with an error and terminate
                connection immediately. */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "VC terminated due to fault");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "VC terminated due to fault");
             mpi_errno = MPIDI_CH3I_Complete_sendq_with_error(vc);
             if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
@@ -1101,7 +1101,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
             if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq)) {
                 /* The sendq is empty, so we can immediately terminate
                    the connection. */
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Shm send queue empty, terminating immediately");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Shm send queue empty, terminating immediately");
                 mpi_errno = shm_connection_terminated(vc);
                 if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             } else {
@@ -1114,7 +1114,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
                    VC anymore) we know that all sends on this VC must
                    have completed.  */
                 vc_term_element_t *ep;
-                MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Shm send queue not empty, waiting to terminate");
+                MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Shm send queue not empty, waiting to terminate");
                 MPIU_CHKPMEM_MALLOC(ep, vc_term_element_t *, sizeof(vc_term_element_t), mpi_errno, "vc_term_element");
                 ep->vc = vc;
                 ep->req = MPIDI_CH3I_shm_sendq.tail;
@@ -1124,7 +1124,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
         }
     
     } else {
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "VC is remote");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "VC is remote");
         mpi_errno = MPID_nem_netmod_func->vc_terminate(vc);
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c b/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
index eb8539f..1909c8b 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
@@ -36,7 +36,7 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
         /* send queue is not empty, enqueue the request then check to
            see if we can send any now */
 
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
 
 	sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *)header;
         sreq->ch.noncontig    = TRUE;
@@ -83,7 +83,7 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
         if (mpi_errno != MPI_SUCCESS) {
             MPIR_ERR_POP(mpi_errno);
         }
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete %d bytes", (int) (sreq->dev.segment_size));
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete %d bytes", (int) (sreq->dev.segment_size));
     }
     else
     {
@@ -92,7 +92,7 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         MPIU_Assert(complete); /* all data has been sent, we should always complete */
 
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete %d bytes", (int) (sreq->dev.segment_size));
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete %d bytes", (int) (sreq->dev.segment_size));
     }
 
  fn_exit:
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 eb96008..fafce67 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c
@@ -18,11 +18,11 @@ void MPID_nem_dbg_dump_cell (volatile struct MPID_nem_cell *cell)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_DBG_DUMP_CELL);
 
-    MPIU_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  src = %6d", cell->pkt.mpich.source);
-    MPIU_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  dst = %6d", cell->pkt.mpich.dest);
-    MPIU_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  len = %6d", (int)cell->pkt.mpich.datalen);
-    MPIU_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  sqn = %6d", cell->pkt.mpich.seqno);
-    MPIU_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  typ = %6d", cell->pkt.mpich.type);
+    MPL_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  src = %6d", cell->pkt.mpich.source);
+    MPL_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  dst = %6d", cell->pkt.mpich.dest);
+    MPL_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  len = %6d", (int)cell->pkt.mpich.datalen);
+    MPL_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  sqn = %6d", cell->pkt.mpich.seqno);
+    MPL_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  typ = %6d", cell->pkt.mpich.type);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_DBG_DUMP_CELL);
 }
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 40a0bff..7452c04 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
@@ -549,7 +549,7 @@ MPID_nem_vc_init (MPIDI_VC_t *vc)
         else
             vc->ready_eager_max_msg_sz = MPIR_CVAR_NEMESIS_SHM_READY_EAGER_MAX_SZ;
 
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_VC, VERBOSE, "vc using shared memory");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_VC, VERBOSE, "vc using shared memory");
     }
     else
     {
@@ -569,7 +569,7 @@ MPID_nem_vc_init (MPIDI_VC_t *vc)
         vc_ch->iStartContigMsg = NULL;
         vc_ch->iSendContig     = NULL;
 
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_VC, VERBOSE, (MPIU_DBG_FDEST, "vc using %s netmod for rank %d pg %s",
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_VC, VERBOSE, (MPL_DBG_FDEST, "vc using %s netmod for rank %d pg %s",
                                        MPID_nem_netmod_strings[MPID_nem_netmod_id], vc->pg_rank,
                                        ((vc->pg == MPIDI_Process.my_pg) 
                                         ? "my_pg" 
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 7990533..c0525f6 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
@@ -105,7 +105,7 @@ int MPID_nem_lmt_RndvSend(MPID_Request **sreq_p, const void * buf, MPI_Aint coun
         goto fn_exit;
     }
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		   "sending lmt RTS, data_sz=" MPIDI_MSG_SZ_FMT, data_sz);
     sreq->partner_request = NULL;
     sreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = 0;
@@ -162,7 +162,7 @@ int MPID_nem_lmt_RndvRecv(MPIDI_VC_t *vc, MPID_Request *rreq)
         goto fn_exit;
     }
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE, "lmt RTS in the request");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE, "lmt RTS in the request");
 
     mpi_errno = do_cts(vc, rreq, &complete);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
@@ -195,7 +195,7 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
 
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST, "received LMT RTS pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d, data_sz=" MPIDI_MSG_SZ_FMT,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_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));
 
@@ -223,7 +223,7 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
     if (data_len < rts_pkt->cookie_len)
     {
         /* set for the cookie to be received into the tmp_cookie in the request */
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"haven't received entire cookie");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"haven't received entire cookie");
         MPIU_CHKPMEM_MALLOC(rreq->ch.lmt_tmp_cookie.MPL_IOV_BUF, char *, rts_pkt->cookie_len, mpi_errno, "tmp cookie buf");
         rreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = rts_pkt->cookie_len;
 
@@ -235,13 +235,13 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
         if (found)
         {
             /* set do_cts() to be called once we've received the entire cookie */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
             rreq->dev.OnDataAvail = do_cts;
         }
         else
         {
             /* receive the rest of the cookie and wait for a match */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
             rreq->dev.OnDataAvail = 0;
             MPIDI_CH3_Progress_signal_completion();
         }
@@ -259,7 +259,7 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
         else
         {
             /* receive cookie into tmp_cookie in the request */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received entire cookie");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received entire cookie");
             MPIU_CHKPMEM_MALLOC(rreq->ch.lmt_tmp_cookie.MPL_IOV_BUF, char *, rts_pkt->cookie_len, mpi_errno, "tmp cookie buf");
             rreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = rts_pkt->cookie_len;
         
@@ -272,14 +272,14 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
         {
             /* have a matching request and the entire cookie (if any), call do_cts() */
             int complete;
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
             mpi_errno = do_cts(vc, rreq, &complete);
             if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPIU_Assert(complete);
         }
         else
         {
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
             rreq->dev.OnDataAvail = 0;
             MPIDI_CH3_Progress_signal_completion();
         }
@@ -314,7 +314,7 @@ static int pkt_CTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
 
     MPIDI_FUNC_ENTER(MPID_STATE_PKT_CTS_HANDLER);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received rndv CTS pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received rndv CTS pkt");
 
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
     data_buf = (char *)pkt + sizeof(MPIDI_CH3_Pkt_t);
@@ -544,7 +544,7 @@ static int do_cts(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 
     MPIDI_FUNC_ENTER(MPID_STATE_DO_CTS);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
 
     /* determine amount of data to be transfered and check for truncation */
     MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
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 f6eb19a..b3dee42 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
@@ -430,7 +430,7 @@ int MPID_nem_lmt_dma_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV s_co
         if (complete) {
             /* request was completed by the OnDataAvail fn */
             MPID_nem_lmt_send_DONE(vc, rreq); /* tell the other side to complete its request */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
 
         }
         else {
@@ -485,7 +485,7 @@ int MPID_nem_lmt_dma_done_send(MPIDI_VC_t *vc, MPID_Request *sreq)
         if (mpi_errno != MPI_SUCCESS) {
             MPIR_ERR_POP(mpi_errno);
         }
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
         goto fn_exit;
     }
 
@@ -495,7 +495,7 @@ int MPID_nem_lmt_dma_done_send(MPIDI_VC_t *vc, MPID_Request *sreq)
         
     if (complete) {
         /* request was completed by the OnDataAvail fn */
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
         goto fn_exit;
     }
     else {
@@ -584,7 +584,7 @@ int MPID_nem_lmt_dma_progress(void)
                     if (complete) {
                         /* request was completed by the OnDataAvail fn */
                         MPID_nem_lmt_send_DONE(cur->vc, cur->req); /* tell the other side to complete its request */
-                        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+                        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
 
                     }
                     else {
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 69c42fc..d1d91e1 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
@@ -9,7 +9,7 @@
 #include "mpid_nem_datatypes.h"
 
 #include "mpiu_os_wrappers.h"
-#if defined(USE_DBG_LOGGING) && 0
+#if defined(MPL_USE_DBG_LOGGING) && 0
 #define DBG_LMT(x) x
 #else
 #define DBG_LMT(x)
@@ -216,7 +216,7 @@ int MPID_nem_lmt_shm_start_recv(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV s_coo
         /* lmt send didn't finish, enqueue it to be completed later */
         lmt_shm_prog_element_t *pe;
 
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "lmt recv not finished:  enqueue");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "lmt recv not finished:  enqueue");
 
         MPIU_CHKPMEM_MALLOC (pe, lmt_shm_prog_element_t *, sizeof (lmt_shm_prog_element_t), mpi_errno, "lmt progress queue element");
         pe->vc = vc;
@@ -259,7 +259,7 @@ int MPID_nem_lmt_shm_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_coo
 
         mpi_errno = MPID_nem_attach_shm_region(&vc_ch->lmt_copy_buf, vc_ch->lmt_copy_buf_handle);
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "attached to remote copy_buf");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "attached to remote copy_buf");
     }
     else{
         char *ser_lmt_copy_buf_handle=NULL;
@@ -286,7 +286,7 @@ int MPID_nem_lmt_shm_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_coo
             vc_ch->lmt_active_lmt = NULL;
         }
 
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "deleted my copy_buf and attached to remote");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "deleted my copy_buf and attached to remote");
     }
 
     queue_initially_empty = LMT_SHM_Q_EMPTY(vc_ch->lmt_queue) && vc_ch->lmt_active_lmt == NULL;
@@ -314,7 +314,7 @@ int MPID_nem_lmt_shm_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_coo
         MPID_nem_local_lmt_pending = TRUE;
         MPIU_Assert(!vc_ch->lmt_enqueued);
         vc_ch->lmt_enqueued = TRUE;
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "lmt send not finished:  enqueue");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "lmt send not finished:  enqueue");
    }
 
     MPIU_Assert(LMT_SHM_Q_EMPTY(vc_ch->lmt_queue) || !LMT_SHM_L_EMPTY());
@@ -348,8 +348,8 @@ static int get_next_req(MPIDI_VC_t *vc)
     if (prev_owner_rank == IN_USE || prev_owner_rank == MPIDI_Process.my_pg_rank)
     {
         /* last lmt is not complete (receiver still receiving */
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "waiting for receiver");
-        DBG_LMT(MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "waiting for receiver");
+        DBG_LMT(MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
         goto fn_exit;
     }
 
@@ -367,8 +367,8 @@ static int get_next_req(MPIDI_VC_t *vc)
 
         LMT_SHM_Q_DEQUEUE(&vc_ch->lmt_queue, &vc_ch->lmt_active_lmt);
         copy_buf->owner_info.val.remote_req_id = vc_ch->lmt_active_lmt->req->ch.lmt_req_id;
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "grabbed idle buf.  remote_req=%d local_req=%d", copy_buf->owner_info.val.remote_req_id, vc_ch->lmt_active_lmt->req->handle));
-        DBG_LMT(MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "grabbed idle buf.  remote_req=%d local_req=%d", copy_buf->owner_info.val.remote_req_id, vc_ch->lmt_active_lmt->req->handle));
+        DBG_LMT(MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
     }
     else
     {
@@ -377,8 +377,8 @@ static int get_next_req(MPIDI_VC_t *vc)
 
         OPA_read_barrier();
         
-        MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, if (copy_buf->owner_info.val.remote_req_id == MPI_REQUEST_NULL)
-                                                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "waiting for owner rank=%d", vc->pg_rank));
+        MPL_DBG_STMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, if (copy_buf->owner_info.val.remote_req_id == MPI_REQUEST_NULL)
+                                                MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "waiting for owner rank=%d", vc->pg_rank));
             
         while (copy_buf->owner_info.val.remote_req_id == MPI_REQUEST_NULL) {
             int p = 0;
@@ -392,13 +392,13 @@ static int get_next_req(MPIDI_VC_t *vc)
         OPA_read_barrier();
         LMT_SHM_Q_SEARCH_REMOVE(&vc_ch->lmt_queue, copy_buf->owner_info.val.remote_req_id, &vc_ch->lmt_active_lmt);
 
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "remote side owns buf.  local_req=%d", copy_buf->owner_info.val.remote_req_id);
-        DBG_LMT(MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "remote side owns buf.  local_req=%d", copy_buf->owner_info.val.remote_req_id);
+        DBG_LMT(MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
 
         if (vc_ch->lmt_active_lmt == NULL)
         {
             /* request not found  */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "request not found in lmt queue");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "request not found in lmt queue");
             goto fn_exit;
         }
 
@@ -453,7 +453,7 @@ static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
 
     MPIDI_FUNC_ENTER(MPID_STATE_LMT_SHM_SEND_PROGRESS);
 
-    DBG_LMT(MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
+    DBG_LMT(MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
 
     copy_buf->sender_present.val = TRUE;
 
@@ -476,8 +476,8 @@ static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
                 req->dev.segment_first = first;
                 vc_ch->lmt_buf_num = buf_num;
                 *done = FALSE;
-                MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "first=" MPIDI_MSG_SZ_FMT " data_sz="MPIDI_MSG_SZ_FMT, first, data_sz));
-                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Waiting on full buffer %d", buf_num);
+                MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "first=" MPIDI_MSG_SZ_FMT " data_sz="MPIDI_MSG_SZ_FMT, first, data_sz));
+                MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Waiting on full buffer %d", buf_num);
                 goto fn_exit;
             }
             ++p;
@@ -500,7 +500,7 @@ static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
         first = last;
         buf_num = (buf_num+1) % NUM_BUFS;
 
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "sent data.  last=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, last, data_sz));
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "sent data.  last=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, last, data_sz));
     }
     while (last < data_sz);
 
@@ -509,7 +509,7 @@ static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
     if (mpi_errno != MPI_SUCCESS) {
         MPIR_ERR_POP(mpi_errno);
     }
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "completed req local_req=%d", req->handle);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "completed req local_req=%d", req->handle);
 
 
  fn_exit:
@@ -549,7 +549,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
 
     MPIDI_FUNC_ENTER(MPID_STATE_LMT_SHM_RECV_PROGRESS);
 
-    DBG_LMT(MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
+    DBG_LMT(MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
 
     copy_buf->receiver_present.val = TRUE;
 
@@ -571,8 +571,8 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
                 vc_ch->lmt_buf_num = buf_num;
                 vc_ch->lmt_surfeit = surfeit;
                 *done = FALSE;
-                MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "first=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, first, data_sz));
-                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Waiting on empty buffer %d", buf_num);
+                MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "first=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, first, data_sz));
+                MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Waiting on empty buffer %d", buf_num);
                 goto fn_exit;
             }
             ++p;
@@ -587,7 +587,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
 
 	MPID_Segment_unpack(req->dev.segment_ptr, first, &last, src_buf);
 
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "recvd data.  last=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, last, data_sz));
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPL_DBG_FDEST, "recvd data.  last=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, last, data_sz));
 
         if (surfeit && buf_num > 0)
         {
@@ -599,7 +599,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
             /* Make sure we copied at least the leftover data from last time */
             MPIU_Assert(last - first > surfeit);
 
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "freed previous buffer");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "freed previous buffer");
         }
 
         if (last < expected_last)
@@ -625,7 +625,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
                 MPIU_Memcpy(((char *)copy_buf->buf[buf_num+1]) - surfeit, tmpbuf, surfeit);
             }
 
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "copied leftover data");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "copied leftover data");
         }
         else
         {
@@ -644,7 +644,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
     for (i = 0; i < NUM_BUFS; ++i)
         copy_buf->len[i].val = 0;
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "completed request local_req=%d", req->handle);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "completed request local_req=%d", req->handle);
     OPA_write_barrier();
     OPA_store_int(&copy_buf->owner_info.val.rank, NO_OWNER);
 
@@ -839,7 +839,7 @@ int MPID_nem_lmt_shm_vc_terminated(MPIDI_VC_t *vc)
        calls lmt_shm_progress_vc() and it finds an empty queue. */
 
     if (vc_ch->lmt_active_lmt) {
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Clearing active LMT");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Clearing active LMT");
         vc_ch->lmt_active_lmt->req->status.MPI_ERROR = req_errno;
         MPID_Request_complete(vc_ch->lmt_active_lmt->req);
         MPIU_Free(vc_ch->lmt_active_lmt);
@@ -847,7 +847,7 @@ int MPID_nem_lmt_shm_vc_terminated(MPIDI_VC_t *vc)
     }
 
     if (!LMT_SHM_Q_EMPTY(vc_ch->lmt_queue)) {
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Empty LMT queue");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Empty LMT queue");
     }
 
     while (!LMT_SHM_Q_EMPTY(vc_ch->lmt_queue)) {
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 c7b42a3..70b07e7 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
@@ -162,7 +162,7 @@ static int do_vmsplice(MPID_Request *sreq, int pipe_fd, MPL_IOV iov[],
         if (*complete) {
             err = close(pipe_fd);
             MPIR_ERR_CHKANDJUMP(err < 0, mpi_errno, MPI_ERR_OTHER, "**close");
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
         }
     }
 
@@ -241,7 +241,7 @@ static int do_readv(MPID_Request *rreq, int pipe_fd, MPL_IOV iov[],
         if (*complete) {
             nread = close(pipe_fd);
             MPIR_ERR_CHKANDJUMP(nread < 0, mpi_errno, MPI_ERR_OTHER, "**close");
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
         }
     }
 
@@ -340,7 +340,7 @@ int MPID_nem_lmt_vmsplice_progress(void)
         }
 
         if (complete) {
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
 
             /* remove the node from the list */
             if (cur == outstanding_head) {
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 5e681dd..e84e90f 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich.c
@@ -114,7 +114,7 @@ int MPID_nem_send_iov(MPIDI_VC_t *vc, MPID_Request **sreq_ptr, MPL_IOV *iov, int
         /* --BEGIN ERROR HANDLING-- */
         if (sreq->dev.tmpbuf_sz == 0)
         {
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"SRBuf allocation failure");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"SRBuf allocation failure");
             mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL,
                                              FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem", 0);
             sreq->status.MPI_ERROR = mpi_errno;
diff --git a/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h b/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h
index 8cb4c7d..2cbc297 100644
--- a/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h
+++ b/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h
@@ -20,7 +20,7 @@
 
 #define MPIDI_CH3I_SendQ_enqueue(vcch, req)				\
 {									\
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_MSG,TYPICAL,"Enqueuing this request");\
+    MPL_DBG_MSG(MPIDI_CH3_DBG_MSG,TYPICAL,"Enqueuing this request");\
     MPIR_Request_add_ref(req);                                          \
     req->dev.next = NULL;						\
     if (vcch->sendq_tail != NULL)					\
@@ -37,7 +37,7 @@
     /* MT - not thread safe! */
 #define MPIDI_CH3I_SendQ_enqueue_head(vcch, req)			\
 {									\
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_MSG,TYPICAL,"Enqueuing this request at head");\
+    MPL_DBG_MSG(MPIDI_CH3_DBG_MSG,TYPICAL,"Enqueuing this request at head");\
     MPIR_Request_add_ref(req);                                          \
     req->dev.next = vcch->sendq_head;					\
     if (vcch->sendq_tail == NULL)					\
@@ -51,7 +51,7 @@
 #define MPIDI_CH3I_SendQ_dequeue(vcch)					\
 {									\
     MPID_Request *req_ = vcch->sendq_head;                              \
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_MSG,TYPICAL,"Dequeuing this request");\
+    MPL_DBG_MSG(MPIDI_CH3_DBG_MSG,TYPICAL,"Dequeuing this request");\
     vcch->sendq_head = vcch->sendq_head->dev.next;			\
     if (vcch->sendq_head == NULL)					\
     {									\
diff --git a/src/mpid/ch3/channels/sock/src/ch3_init.c b/src/mpid/ch3/channels/sock/src/ch3_init.c
index 24be7b0..e03bf0f 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_init.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_init.c
@@ -78,13 +78,13 @@ int MPIDI_CH3_VC_Init( MPIDI_VC_t *vc ) {
     vcch->sendq_tail         = NULL;
     vcch->state              = MPIDI_CH3I_VC_STATE_UNCONNECTED;
     MPIDI_VC_InitSock( vc );
-    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"vc=%p: Setting state (ch) to VC_STATE_UNCONNECTED (Initialization)", vc );
+    MPL_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"vc=%p: Setting state (ch) to VC_STATE_UNCONNECTED (Initialization)", vc );
     return 0;
 }
 
 const char * MPIDI_CH3_VC_GetStateString( struct MPIDI_VC *vc )
 {
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
     return MPIDI_CH3_VC_SockGetStateString( vc );
 #else
     return "unknown";
diff --git a/src/mpid/ch3/channels/sock/src/ch3_isend.c b/src/mpid/ch3/channels/sock/src/ch3_isend.c
index 9fbeb9a..34e8116 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_isend.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_isend.c
@@ -43,7 +43,7 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
     /* The sock channel uses a fixed length header, the size of which is the 
        maximum of all possible packet headers */
     hdr_sz = sizeof(MPIDI_CH3_Pkt_t);
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+    MPL_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 		  MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)hdr));
 
     if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTED) /* MT */
@@ -55,21 +55,21 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 	    MPIU_Size_t nb;
 	    int rc;
 
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send queue empty, attempting to write");
-	    MPIU_DBG_PKT(vcch->conn,hdr,"isend");
+	    MPL_DBG_PKT(vcch->conn,hdr,"isend");
 	    /* MT: need some signalling to lock down our right to use the 
 	       channel, thus insuring that the progress engine does
                also try to write */
 	    rc = MPIDU_Sock_write(vcch->sock, hdr, hdr_sz, &nb);
 	    if (rc == MPI_SUCCESS)
 	    {
-		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			       "wrote %ld bytes", (unsigned long) nb);
 		
 		if (nb == hdr_sz)
 		{
-		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
                      "write complete " MPIDI_MSG_SZ_FMT " bytes, calling OnDataAvail fcn", nb);
 		    reqFn = sreq->dev.OnDataAvail;
 		    if (!reqFn) {
@@ -85,8 +85,8 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 			if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 			if (!complete) {
 			    MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-			    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
-					     (MPIU_DBG_FDEST,
+			    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+					     (MPL_DBG_FDEST,
                     "posting writev, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 			    vcch->conn->send_active = sreq;
 			    mpi_errno = MPIDU_Sock_post_writev(
@@ -105,12 +105,12 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 		}
 		else
 		{
-		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
                      "partial write of " MPIDI_MSG_SZ_FMT " bytes, request enqueued at head", nb);
 		    update_request(sreq, hdr, hdr_sz, nb);
 		    MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-		    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
-     (MPIU_DBG_FDEST,"posting write, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
+		    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+     (MPL_DBG_FDEST,"posting write, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 		    vcch->conn->send_active = sreq;
 		    mpi_errno = MPIDU_Sock_post_write(vcch->conn->sock, 
 					  sreq->dev.iov[0].MPL_IOV_BUF,
@@ -129,17 +129,17 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 	    /* --BEGIN ERROR HANDLING-- */
 	    else if (MPIR_ERR_GET_CLASS(rc) == MPIDU_SOCK_ERR_NOMEM)
 	    {
-		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
+		MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			     "MPIDU_Sock_write failed, out of memory");
 		sreq->status.MPI_ERROR = MPIR_ERR_MEMALLOCFAILED;
 	    }
 	    else
 	    {
-		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
+		MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			       "MPIDU_Sock_write failed, rc=%d", rc);
 		/* Connection just failed. Mark the request complete and 
 		   return an error. */
-		MPIU_DBG_VCCHSTATECHANGE(vc,VC_STATE_FAILED);
+		MPL_DBG_VCCHSTATECHANGE(vc,VC_STATE_FAILED);
 		/* FIXME: Shouldn't the vc->state also change? */
 		vcch->state = MPIDI_CH3I_VC_STATE_FAILED;
 		sreq->status.MPI_ERROR = MPIR_Err_create_code( rc,
@@ -155,7 +155,7 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 	}
 	else
 	{
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"send queue not empty, enqueuing");
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"send queue not empty, enqueuing");
 	    update_request(sreq, hdr, hdr_sz, 0);
 	    MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 	}
@@ -163,14 +163,14 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
     else if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTING) /* MT */
     {
 	/* queuing the data so it can be sent later. */
-	MPIU_DBG_VCUSE(vc,"connecting.  enqueuing request");
+	MPL_DBG_VCUSE(vc,"connecting.  enqueuing request");
 	update_request(sreq, hdr, hdr_sz, 0);
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
     }
     else if (vcch->state == MPIDI_CH3I_VC_STATE_UNCONNECTED) /* MT */
     {
 	/* Form a new connection, queuing the data so it can be sent later. */
-	MPIU_DBG_VCUSE(vc,"unconnected.  enqueuing request");
+	MPL_DBG_VCUSE(vc,"unconnected.  enqueuing request");
 	update_request(sreq, hdr, hdr_sz, 0);
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 	mpi_errno = MPIDI_CH3I_VC_post_connect(vc);
@@ -181,7 +181,7 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
     else if (vcch->state != MPIDI_CH3I_VC_STATE_FAILED)
     {
 	/* Unable to send data at the moment, so queue it for later */
-	MPIU_DBG_VCUSE(vc,"still connecting. Enqueuing request");
+	MPL_DBG_VCUSE(vc,"still connecting. Enqueuing request");
 	update_request(sreq, hdr, hdr_sz, 0);
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
     }
diff --git a/src/mpid/ch3/channels/sock/src/ch3_isendv.c b/src/mpid/ch3/channels/sock/src/ch3_isendv.c
index c8d2ea0..090991d 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_isendv.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_isendv.c
@@ -67,7 +67,7 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
     /* The sock channel uses a fixed length header, the size of which is the 
        maximum of all possible packet headers */
     iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+    MPL_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 	 MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)iov[0].MPL_IOV_BUF));
 
     if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTED) /* MT */
@@ -79,10 +79,10 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 	    MPIU_Size_t nb;
 	    int rc;
 
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send queue empty, attempting to write");
 	    
-	    MPIU_DBG_PKT(vcch->conn,(MPIDI_CH3_Pkt_t*)iov[0].MPL_IOV_BUF,
+	    MPL_DBG_PKT(vcch->conn,(MPIDI_CH3_Pkt_t*)iov[0].MPL_IOV_BUF,
 			 "isendv");
 	    /* MT - need some signalling to lock down our right to use the 
 	       channel, thus insuring that the progress engine does
@@ -97,7 +97,7 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 	    {
 		int offset = 0;
 
-		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			       "wrote %ld bytes", (unsigned long) nb);
 		
 		while (offset < n_iov)
@@ -109,12 +109,12 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 		    }
 		    else
 		    {
-			MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+			MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			     "partial write, request enqueued at head");
 			update_request(sreq, iov, n_iov, offset, nb);
 			MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-			MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
-    (MPIU_DBG_FDEST,"posting writev, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
+			MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+    (MPL_DBG_FDEST,"posting writev, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 			vcch->conn->send_active = sreq;
 			mpi_errno = MPIDU_Sock_post_writev(vcch->conn->sock, 
 					   sreq->dev.iov + offset,
@@ -134,7 +134,7 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 		}
 		if (offset == n_iov)
 		{
-		    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 				 "write complete, calling OnDataAvail fcn");
 		    reqFn = sreq->dev.OnDataAvail;
 		    if (!reqFn) {
@@ -150,8 +150,8 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 			if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 			if (!complete) {
 			    MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-			    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
-    (MPIU_DBG_FDEST,"posting writev, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
+			    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+    (MPL_DBG_FDEST,"posting writev, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 			    vcch->conn->send_active = sreq;
 			    mpi_errno = MPIDU_Sock_post_writev(
 				vcch->conn->sock, sreq->dev.iov, 
@@ -171,17 +171,17 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 	    /* --BEGIN ERROR HANDLING-- */
 	    else if (MPIR_ERR_GET_CLASS(rc) == MPIDU_SOCK_ERR_NOMEM)
 	    {
-		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
+		MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			     "MPIDU_Sock_writev failed, out of memory");
 		sreq->status.MPI_ERROR = MPIR_ERR_MEMALLOCFAILED;
 	    }
 	    else
 	    {
-		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
+		MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			       "MPIDU_Sock_writev failed, rc=%d", rc);
 		/* Connection just failed.  Mark the request complete and 
 		   return an error. */
-		MPIU_DBG_VCCHSTATECHANGE(vc,VC_STATE_FAILED);
+		MPL_DBG_VCCHSTATECHANGE(vc,VC_STATE_FAILED);
 		/* FIXME: Shouldn't the vc->state also change? */
 
 		vcch->state = MPIDI_CH3I_VC_STATE_FAILED;
@@ -198,7 +198,7 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 	}
 	else
 	{
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"send queue not empty, enqueuing");
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"send queue not empty, enqueuing");
 	    update_request(sreq, iov, n_iov, 0, 0);
 	    MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 	}
@@ -206,14 +206,14 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
     else if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTING)
     {
 	/* queuing the data so it can be sent later. */
-	MPIU_DBG_VCUSE(vc,"connecting.  Enqueuing request");
+	MPL_DBG_VCUSE(vc,"connecting.  Enqueuing request");
 	update_request(sreq, iov, n_iov, 0, 0);
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
     }
     else if (vcch->state == MPIDI_CH3I_VC_STATE_UNCONNECTED)
     {
 	/* Form a new connection, queuing the data so it can be sent later. */
-	MPIU_DBG_VCUSE(vc,"unconnected.  Enqueuing request");
+	MPL_DBG_VCUSE(vc,"unconnected.  Enqueuing request");
 	update_request(sreq, iov, n_iov, 0, 0);
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 	mpi_errno = MPIDI_CH3I_VC_post_connect(vc);
@@ -224,14 +224,14 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
     else if (vcch->state != MPIDI_CH3I_VC_STATE_FAILED)
     {
 	/* Unable to send data at the moment, so queue it for later */
-	MPIU_DBG_VCUSE(vc,"still connecting.  enqueuing request");
+	MPL_DBG_VCUSE(vc,"still connecting.  enqueuing request");
 	update_request(sreq, iov, n_iov, 0, 0);
 	MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
     }
     /* --BEGIN ERROR HANDLING-- */
     else
     {
-	MPIU_DBG_VCUSE(vc,"connection failed");
+	MPL_DBG_VCUSE(vc,"connection failed");
 	/* Connection failed.  Mark the request complete and return an error. */
 	/* TODO: Create an appropriate error message */
 	sreq->status.MPI_ERROR = MPI_ERR_INTERN;
diff --git a/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c b/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
index ed3eb29..6c21874 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
@@ -64,7 +64,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
     /* The SOCK channel uses a fixed length header, the size of which is the 
        maximum of all possible packet headers */
     hdr_sz = sizeof(MPIDI_CH3_Pkt_t);
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+    MPL_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 		  MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)hdr));
 
     if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTED) /* MT */
@@ -76,28 +76,28 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	    MPIU_Size_t nb;
 	    int rc;
 
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send queue empty, attempting to write");
 	    
-	    MPIU_DBG_PKT(vcch->conn,hdr,"istartmsg");
+	    MPL_DBG_PKT(vcch->conn,hdr,"istartmsg");
 	    /* MT: need some signalling to lock down our right to use the 
 	       channel, thus insuring that the progress engine does
                not also try to write */
 	    rc = MPIDU_Sock_write(vcch->sock, hdr, hdr_sz, &nb);
 	    if (rc == MPI_SUCCESS)
 	    {
-		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			       "wrote %ld bytes", (unsigned long) nb);
 		
 		if (nb == hdr_sz)
 		{ 
-		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 				   "entire write complete, " MPIDI_MSG_SZ_FMT " bytes", nb);
 		    /* done.  get us out of here as quickly as possible. */
 		}
 		else
 		{
-		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
                     "partial write of " MPIDI_MSG_SZ_FMT " bytes, request enqueued at head", nb);
 		    sreq = create_request(hdr, hdr_sz, nb);
 		    if (!sreq) {
@@ -105,8 +105,8 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 		    }
 
 		    MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-		    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
-     (MPIU_DBG_FDEST,"posting write, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
+		    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+     (MPL_DBG_FDEST,"posting write, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 		    vcch->conn->send_active = sreq;
 		    mpi_errno = MPIDU_Sock_post_write(vcch->conn->sock, sreq->dev.iov[0].MPL_IOV_BUF,
 						      sreq->dev.iov[0].MPL_IOV_LEN, sreq->dev.iov[0].MPL_IOV_LEN, NULL);
@@ -124,7 +124,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	    /* --BEGIN ERROR HANDLING-- */
 	    else
 	    {
-		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
+		MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			       "ERROR - MPIDU_Sock_write failed, rc=%d", rc);
 		sreq = MPID_Request_create();
 		if (!sreq) {
@@ -143,7 +143,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	}
 	else
 	{
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send in progress, request enqueued");
 	    sreq = create_request(hdr, hdr_sz, 0);
 	    if (!sreq) {
@@ -154,7 +154,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
     }
     else if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTING) /* MT */
     {
-	MPIU_DBG_VCUSE(vc,
+	MPL_DBG_VCUSE(vc,
 		       "connecteding. enqueuing request");
 	
 	/* queue the data so it can be sent after the connection is formed */
@@ -166,7 +166,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
     }
     else if (vcch->state == MPIDI_CH3I_VC_STATE_UNCONNECTED) /* MT */
     {
-	MPIU_DBG_VCUSE(vc,
+	MPL_DBG_VCUSE(vc,
 		       "unconnected.  posting connect and enqueuing request");
 	
 	/* queue the data so it can be sent after the connection is formed */
@@ -182,7 +182,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
     else if (vcch->state != MPIDI_CH3I_VC_STATE_FAILED)
     {
 	/* Unable to send data at the moment, so queue it for later */
-	MPIU_DBG_VCUSE(vc,"forming connection, request enqueued");
+	MPL_DBG_VCUSE(vc,"forming connection, request enqueued");
 	sreq = create_request(hdr, hdr_sz, 0);
 	if (!sreq) {
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
@@ -193,7 +193,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
     else
     {
 	/* Connection failed, so allocate a request and return an error. */
-	MPIU_DBG_VCUSE(vc,"ERROR - connection failed");
+	MPL_DBG_VCUSE(vc,"ERROR - connection failed");
 	sreq = MPID_Request_create();
 	if (!sreq) {
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
diff --git a/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c b/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
index a5b39a1..7218cdf 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
@@ -88,7 +88,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
     /* The SOCK channel uses a fixed length header, the size of which is the 
        maximum of all possible packet headers */
     iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+    MPL_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 	   MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)iov[0].MPL_IOV_BUF));
     
     if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTED) /* MT */
@@ -100,9 +100,9 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 	    int rc;
 	    MPIU_Size_t nb;
 
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send queue empty, attempting to write");
-	    MPIU_DBG_PKT(vcch->conn,(MPIDI_CH3_Pkt_t*)iov[0].MPL_IOV_BUF,"isend");
+	    MPL_DBG_PKT(vcch->conn,(MPIDI_CH3_Pkt_t*)iov[0].MPL_IOV_BUF,"isend");
 	    
 	    /* MT - need some signalling to lock down our right to use the 
 	       channel, thus insuring that the progress engine does
@@ -112,7 +112,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 	    {
 		int offset = 0;
     
-		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			       "wrote %ld bytes", (unsigned long) nb);
 		
 		while (offset < n_iov)
@@ -124,15 +124,15 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 		    }
 		    else
 		    {
-			MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+			MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			     "partial write, request enqueued at head");
 			sreq = create_request(iov, n_iov, offset, nb);
 			if (sreq == NULL) {
 			    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 			}
 			MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-			MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
-					 (MPIU_DBG_FDEST,"posting writev, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
+			MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+					 (MPL_DBG_FDEST,"posting writev, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 			vcch->conn->send_active = sreq;
 			mpi_errno = MPIDU_Sock_post_writev(vcch->conn->sock, sreq->dev.iov + offset,
 							   sreq->dev.iov_count - offset, NULL);
@@ -150,13 +150,13 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 
 		if (offset == n_iov)
 		{
-		    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"entire write complete");
+		    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"entire write complete");
 		}
 	    }
 	    /* --BEGIN ERROR HANDLING-- */
 	    else
 	    {
-		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
+		MPL_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			       "ERROR - MPIDU_Sock_writev failed, rc=%d", rc);
 		sreq = MPID_Request_create();
 		if (sreq == NULL) {
@@ -175,7 +175,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 	}
 	else
 	{
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send in progress, request enqueued");
 	    sreq = create_request(iov, n_iov, 0, 0);
 	    if (sreq == NULL) {
@@ -186,7 +186,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
     }
     else if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTING)
     {
-	MPIU_DBG_VCUSE(vc,
+	MPL_DBG_VCUSE(vc,
 		       "connecting.  enqueuing request");
 	
 	/* queue the data so it can be sent after the connection is formed */
@@ -198,7 +198,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
     }
     else if (vcch->state == MPIDI_CH3I_VC_STATE_UNCONNECTED)
     {
-	MPIU_DBG_VCUSE(vc,
+	MPL_DBG_VCUSE(vc,
 		       "unconnected.  posting connect and enqueuing request");
 	
 	/* queue the data so it can be sent after the connection is formed */
@@ -214,7 +214,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
     else if (vcch->state != MPIDI_CH3I_VC_STATE_FAILED)
     {
 	/* Unable to send data at the moment, so queue it for later */
-	MPIU_DBG_VCUSE(vc,"forming connection, request enqueued");
+	MPL_DBG_VCUSE(vc,"forming connection, request enqueued");
 	sreq = create_request(iov, n_iov, 0, 0);
 	if (sreq == NULL) {
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
@@ -225,7 +225,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
     else
     {
 	/* Connection failed, so allocate a request and return an error. */
-	MPIU_DBG_VCUSE(vc,"ERROR - connection failed");
+	MPL_DBG_VCUSE(vc,"ERROR - connection failed");
 	sreq = MPID_Request_create();
 	if (sreq == NULL) {
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
diff --git a/src/mpid/ch3/channels/sock/src/ch3_progress.c b/src/mpid/ch3/channels/sock/src/ch3_progress.c
index be8f228..08a5dfd 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_progress.c
@@ -285,9 +285,9 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
     int mpi_errno = MPI_SUCCESS;
     MPIDI_CH3I_VC *vcch = &vc->ch;
 
-    MPIU_DBG_CONNSTATECHANGE(vc,vcch->conn,CONN_STATE_CLOSING);
+    MPL_DBG_CONNSTATECHANGE(vc,vcch->conn,CONN_STATE_CLOSING);
     vcch->conn->state = CONN_STATE_CLOSING;
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"Closing sock (Post_close)");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"Closing sock (Post_close)");
     mpi_errno = MPIDU_Sock_post_close(vcch->sock);
     if (mpi_errno != MPI_SUCCESS) {
 	MPIR_ERR_POP(mpi_errno);
@@ -424,7 +424,7 @@ int MPIDI_CH3I_Progress_finalize(void)
 #define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDI_CH3I_Progress_wakeup(void)
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"progress_wakeup called");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"progress_wakeup called");
     MPIDU_Sock_wakeup(MPIDI_CH3I_sock_set);
 }
 #endif
@@ -450,7 +450,7 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_HANDLE_SOCK_EVENT);
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"Socket event of type %d", event->op_type );
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"Socket event of type %d", event->op_type );
 
     switch (event->op_type)
     {
@@ -623,8 +623,8 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 			}
 			/* --END ERROR HANDLING-- */
 
-			MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
-       (MPIU_DBG_FDEST,"immediate writev, vc=%p, sreq=0x%08x, nb=" MPIDI_MSG_SZ_FMT,
+			MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+       (MPL_DBG_FDEST,"immediate writev, vc=%p, sreq=0x%08x, nb=" MPIDI_MSG_SZ_FMT,
 	conn->vc, sreq->handle, nb));
 			    
 			if (nb > 0 && adjust_iov(&iovp, &sreq->dev.iov_count, nb))
@@ -653,8 +653,8 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 			}
 			else
 			{
-			    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
-       (MPIU_DBG_FDEST,"posting writev, vc=%p, conn=%p, sreq=0x%08x", 
+			    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+       (MPL_DBG_FDEST,"posting writev, vc=%p, conn=%p, sreq=0x%08x",
 	conn->vc, conn, sreq->handle));
 			    mpi_errno = MPIDU_Sock_post_writev(conn->sock, iovp, sreq->dev.iov_count, NULL);
 			    /* --BEGIN ERROR HANDLING-- */
@@ -808,7 +808,7 @@ static inline int connection_pop_sendq_req(MPIDI_CH3I_Connection_t * conn)
     conn->send_active = MPIDI_CH3I_SendQ_head(vcch); /* MT */
     if (conn->send_active != NULL)
     {
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"conn=%p: Posting message from connection send queue", conn );
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_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) {
 	    MPIR_ERR_POP(mpi_errno);
@@ -898,8 +898,8 @@ static int ReadMoreData( MPIDI_CH3I_Connection_t * conn, MPID_Request *rreq )
 	}
 	/* --END ERROR HANDLING-- */
 
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
-		 (MPIU_DBG_FDEST,"immediate readv, vc=%p nb=" MPIDI_MSG_SZ_FMT ", rreq=0x%08x",
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		 (MPL_DBG_FDEST,"immediate readv, vc=%p nb=" MPIDI_MSG_SZ_FMT ", rreq=0x%08x",
 		  conn->vc, nb, rreq->handle));
 				
 	if (nb > 0 && adjust_iov(&iovp, &rreq->dev.iov_count, nb)) {
@@ -931,8 +931,8 @@ static int ReadMoreData( MPIDI_CH3I_Connection_t * conn, MPID_Request *rreq )
 	    }
 	}
 	else {
-	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
-        (MPIU_DBG_FDEST,"posting readv, vc=%p, rreq=0x%08x", 
+	    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+        (MPL_DBG_FDEST,"posting readv, vc=%p, rreq=0x%08x",
 	 conn->vc, rreq->handle));
 	    conn->recv_active = rreq;
 	    mpi_errno = MPIDU_Sock_post_readv(conn->sock, iovp, rreq->dev.iov_count, NULL);
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index 503a84e..8efd2ba 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -51,19 +51,19 @@ extern char *MPIDI_failed_procs_string;
 
 extern int MPIDI_Use_pmi2_api;
 
-#if defined(USE_DBG_LOGGING)
-extern MPIU_DBG_Class MPIDI_CH3_DBG_CONNECT;
-extern MPIU_DBG_Class MPIDI_CH3_DBG_DISCONNECT;
-extern MPIU_DBG_Class MPIDI_CH3_DBG_PROGRESS;
-extern MPIU_DBG_Class MPIDI_CH3_DBG_CHANNEL;
-extern MPIU_DBG_Class MPIDI_CH3_DBG_OTHER;
-extern MPIU_DBG_Class MPIDI_CH3_DBG_MSG;
-extern MPIU_DBG_Class MPIDI_CH3_DBG_VC;
-extern MPIU_DBG_Class MPIDI_CH3_DBG_REFCOUNT;
-#endif /* USE_DBG_LOGGING */
+#if defined(MPL_USE_DBG_LOGGING)
+extern MPL_DBG_Class MPIDI_CH3_DBG_CONNECT;
+extern MPL_DBG_Class MPIDI_CH3_DBG_DISCONNECT;
+extern MPL_DBG_Class MPIDI_CH3_DBG_PROGRESS;
+extern MPL_DBG_Class MPIDI_CH3_DBG_CHANNEL;
+extern MPL_DBG_Class MPIDI_CH3_DBG_OTHER;
+extern MPL_DBG_Class MPIDI_CH3_DBG_MSG;
+extern MPL_DBG_Class MPIDI_CH3_DBG_VC;
+extern MPL_DBG_Class MPIDI_CH3_DBG_REFCOUNT;
+#endif /* MPL_USE_DBG_LOGGING */
 
 #define MPIDI_CHANGE_VC_STATE(vc, new_state) do {               \
-        MPIU_DBG_VCSTATECHANGE(vc, VC_STATE_##new_state);       \
+        MPL_DBG_VCSTATECHANGE(vc, VC_STATE_##new_state);       \
         (vc)->state = MPIDI_VC_STATE_##new_state;               \
     } while (0)
 
@@ -174,7 +174,7 @@ extern MPIDI_Process_t MPIDI_Process;
 	(dt_contig_out_) = TRUE;					\
         (dt_true_lb_)    = 0;                                           \
 	(data_sz_out_) = (MPIDI_msg_sz_t) (count_) * MPID_Datatype_get_basic_size(datatype_); \
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPIU_DBG_FDEST,"basic datatype: dt_contig=%d, dt_sz=%d, data_sz=" MPIDI_MSG_SZ_FMT, \
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPL_DBG_FDEST,"basic datatype: dt_contig=%d, dt_sz=%d, data_sz=" MPIDI_MSG_SZ_FMT, \
 			  (dt_contig_out_), MPID_Datatype_get_basic_size(datatype_), (data_sz_out_)));\
     }									\
     else								\
@@ -183,7 +183,7 @@ extern MPIDI_Process_t MPIDI_Process;
 	(dt_contig_out_) = (dt_ptr_)->is_contig;			\
 	(data_sz_out_) = (MPIDI_msg_sz_t) (count_) * (dt_ptr_)->size;	\
         (dt_true_lb_)    = (dt_ptr_)->true_lb;                          \
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPIU_DBG_FDEST, "user defined datatype: dt_contig=%d, dt_sz=" MPI_AINT_FMT_DEC_SPEC ", data_sz=" MPIDI_MSG_SZ_FMT, \
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPL_DBG_FDEST, "user defined datatype: dt_contig=%d, dt_sz=" MPI_AINT_FMT_DEC_SPEC ", data_sz=" MPIDI_MSG_SZ_FMT, \
 			  (dt_contig_out_), (dt_ptr_)->size, (data_sz_out_)));\
     }									\
 }
@@ -259,7 +259,7 @@ extern MPIDI_Process_t MPIDI_Process;
 #  define MPIDI_Request_tls_alloc(req_) \
     do { \
 	(req_) = MPIU_Handle_obj_alloc(&MPID_Request_mem); \
-        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL,VERBOSE,		\
+        MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL,VERBOSE,		\
 	       "allocated request, handle=0x%08x", req_);\
     } while (0)
 
@@ -329,7 +329,7 @@ extern MPIDI_Process_t MPIDI_Process;
             MPIR_Status_set_procnull(&(rreq_)->status);                    \
         }                                                                  \
         else {                                                             \
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"unable to allocate a request");\
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"unable to allocate a request");\
             (mpi_errno_) = MPIR_ERR_MEMALLOCFAILED;                        \
             FAIL_;                                                         \
         }                                                                  \
@@ -880,7 +880,7 @@ extern MPIDI_CH3U_SRBuf_element_t * MPIDI_CH3U_SRBuf_pool;
 
 /* If there is no support for dynamic processes, there will be no
    channel-specific connection state */
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
 
 #ifdef MPIDI_CH3_HAS_NO_DYNAMIC_PROCESS
 #define MPIDI_CH3_VC_GetStateString( _c ) "none"
@@ -901,62 +901,62 @@ int MPIDI_PrintConnStrToFile( FILE *fd, const char *file, int line,
 /* These macros simplify and unify the debugging of changes in the
    connection state 
 
-   MPIU_DBG_VCSTATECHANGE(vc,newstate) - use when changing the state
+   MPL_DBG_VCSTATECHANGE(vc,newstate) - use when changing the state
    of a VC
 
-   MPIU_DBG_VCCHSTATECHANGE(vc,newstate) - use when changing the state
+   MPL_DBG_VCCHSTATECHANGE(vc,newstate) - use when changing the state
    of the channel-specific part of the vc (e.g., vc->ch.state)
 
-   MPIU_DBG_CONNSTATECHANGE(vc,conn,newstate ) - use when changing the
+   MPL_DBG_CONNSTATECHANGE(vc,conn,newstate ) - use when changing the
    state of a conn.  vc may be null
 
-   MPIU_DBG_CONNSTATECHANGEMSG(vc,conn,newstate,msg ) - use when changing the
+   MPL_DBG_CONNSTATECHANGEMSG(vc,conn,newstate,msg ) - use when changing the
    state of a conn.  vc may be null.  Like CONNSTATECHANGE, but allows
    an additional message
 
-   MPIU_DBG_PKT(conn,pkt,msg) - print out a short description of an
+   MPL_DBG_PKT(conn,pkt,msg) - print out a short description of an
    packet being sent/received on the designated connection, prefixed with
    msg.
 
 */
-#define MPIU_DBG_VCSTATECHANGE(_vc,_newstate) do { \
-     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
+#define MPL_DBG_VCSTATECHANGE(_vc,_newstate) do { \
+     MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPL_DBG_FDEST, \
      "vc=%p: Setting state (vc) from %s to %s, vcchstate is %s", \
                  _vc, MPIDI_VC_GetStateString((_vc)->state), \
                  #_newstate, MPIDI_CH3_VC_GetStateString( (_vc) ))); \
 } while (0)
 
-#define MPIU_DBG_VCCHSTATECHANGE(_vc,_newstate) \
-     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
+#define MPL_DBG_VCCHSTATECHANGE(_vc,_newstate) \
+     MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPL_DBG_FDEST, \
      "vc=%p: Setting state (ch) from %s to %s, vc state is %s", \
            _vc, MPIDI_CH3_VC_GetStateString((_vc)), \
            #_newstate, MPIDI_VC_GetStateString( (_vc)->state )) )
 
-#define MPIU_DBG_CONNSTATECHANGE(_vc,_conn,_newstate) \
-     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
+#define MPL_DBG_CONNSTATECHANGE(_vc,_conn,_newstate) \
+     MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPL_DBG_FDEST, \
      "vc=%p,conn=%p: Setting state (conn) from %s to %s, vcstate = %s", \
              _vc, _conn, \
              MPIDI_Conn_GetStateString((_conn)->state), #_newstate, \
              _vc ? MPIDI_VC_GetStateString((_vc)->state) : "<no vc>" ))
 
-#define MPIU_DBG_CONNSTATECHANGE_MSG(_vc,_conn,_newstate,_msg) \
-     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
+#define MPL_DBG_CONNSTATECHANGE_MSG(_vc,_conn,_newstate,_msg) \
+     MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPL_DBG_FDEST, \
      "vc=%p,conn=%p: Setting conn state from %s to %s, vcstate = %s %s", \
              _vc, _conn, \
              MPIDI_Conn_GetStateString((_conn)->state), #_newstate, \
              _vc ? MPIDI_VC_GetStateString((_vc)->state) : "<no vc>", _msg ))
-#define MPIU_DBG_VCUSE(_vc,_msg) \
-     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,\
+#define MPL_DBG_VCUSE(_vc,_msg) \
+     MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPL_DBG_FDEST,\
       "vc=%p: Using vc for %s", _vc, _msg ))
-#define MPIU_DBG_PKT(_conn,_pkt,_msg) \
-     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TYPICAL,(MPIU_DBG_FDEST,\
+#define MPL_DBG_PKT(_conn,_pkt,_msg) \
+     MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TYPICAL,(MPL_DBG_FDEST,\
      "conn=%p: %s %s", _conn, _msg, MPIDI_Pkt_GetDescString( _pkt ) ))
 
 const char *MPIDI_Pkt_GetDescString( MPIDI_CH3_Pkt_t *pkt );
 
 /* These macros help trace communication headers */
-#define MPIU_DBG_MSGPKT(_vc,_tag,_contextid,_dest,_size,_kind)	\
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_MSG,TYPICAL,(MPIU_DBG_FDEST,\
+#define MPL_DBG_MSGPKT(_vc,_tag,_contextid,_dest,_size,_kind)	\
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_MSG,TYPICAL,(MPL_DBG_FDEST,\
 		      "%s: vc=%p, tag=%d, context=%d, dest=%d, datasz=" MPIDI_MSG_SZ_FMT,\
 		      _kind,_vc,_tag,_contextid,_dest,_size) )
 
@@ -1184,7 +1184,7 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
     do {                                                                         \
         MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_COMPLETION_MUTEX);                                       \
         ++MPIDI_CH3I_progress_completion_count;                                  \
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_PROGRESS,VERBOSE,                                     \
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_PROGRESS,VERBOSE,                                     \
                      "just incremented MPIDI_CH3I_progress_completion_count=%d", \
                      MPIDI_CH3I_progress_completion_count);                      \
         MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_COMPLETION_MUTEX);                                        \
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 29990fe..38cd5e8 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -130,8 +130,8 @@ static inline int MPIDI_CH3I_Send_lock_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_p
     lock_ack_pkt->target_rank = win_ptr->comm_ptr->rank;
     lock_ack_pkt->flags = flags;
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
-                     (MPIU_DBG_FDEST, "sending lock ack pkt on vc=%p, source_win_handle=%#08x",
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
+                     (MPL_DBG_FDEST, "sending lock ack pkt on vc=%p, source_win_handle=%#08x",
                       vc, lock_ack_pkt->source_win_handle));
 
     MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
@@ -177,8 +177,8 @@ static inline int MPIDI_CH3I_Send_lock_op_ack_pkt(MPIDI_VC_t * vc, MPID_Win * wi
     lock_op_ack_pkt->target_rank = win_ptr->comm_ptr->rank;
     lock_op_ack_pkt->flags = flags;
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
-                     (MPIU_DBG_FDEST, "sending lock op ack pkt on vc=%p, source_win_handle=%#08x",
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
+                     (MPL_DBG_FDEST, "sending lock op ack pkt on vc=%p, source_win_handle=%#08x",
                       vc, lock_op_ack_pkt->source_win_handle));
 
     MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
diff --git a/src/mpid/ch3/src/ch3u_buffer.c b/src/mpid/ch3/src/ch3u_buffer.c
index 4a792d2..b7b7596 100644
--- a/src/mpid/ch3/src/ch3u_buffer.c
+++ b/src/mpid/ch3/src/ch3u_buffer.c
@@ -57,7 +57,7 @@ void MPIDI_CH3U_Buffer_copy(
     /* --BEGIN ERROR HANDLING-- */
     if (sdata_sz > rdata_sz)
     {
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TYPICAL,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TYPICAL,(MPL_DBG_FDEST,
 	    "message truncated, sdata_sz=" MPIDI_MSG_SZ_FMT " rdata_sz=" MPIDI_MSG_SZ_FMT,
 			  sdata_sz, rdata_sz));
 	sdata_sz = rdata_sz;
@@ -85,10 +85,10 @@ void MPIDI_CH3U_Buffer_copy(
 
 	MPID_Segment_init(rbuf, rcount, rdt, &seg, 0);
 	last = sdata_sz;
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                           "pre-unpack last=" MPIDI_MSG_SZ_FMT, last ));
 	MPID_Segment_unpack(&seg, 0, &last, (char*)sbuf + sdt_true_lb);
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 			 "pre-unpack last=" MPIDI_MSG_SZ_FMT, last ));
 	/* --BEGIN ERROR HANDLING-- */
 	if (last != sdata_sz)
@@ -106,10 +106,10 @@ void MPIDI_CH3U_Buffer_copy(
 
 	MPID_Segment_init(sbuf, scount, sdt, &seg, 0);
 	last = sdata_sz;
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 			       "pre-pack last=" MPIDI_MSG_SZ_FMT, last ));
 	MPID_Segment_pack(&seg, 0, &last, (char*)rbuf + rdt_true_lb);
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 			    "post-pack last=" MPIDI_MSG_SZ_FMT, last ));
 	/* --BEGIN ERROR HANDLING-- */
 	if (last != sdata_sz)
@@ -133,7 +133,7 @@ void MPIDI_CH3U_Buffer_copy(
 	/* --BEGIN ERROR HANDLING-- */
 	if (buf == NULL)
 	{
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"SRBuf allocation failure");
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"SRBuf allocation failure");
 	    *smpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem", 0);
 	    *rmpi_errno = *smpi_errno;
 	    *rsz = 0;
@@ -162,11 +162,11 @@ void MPIDI_CH3U_Buffer_copy(
 		last = sdata_sz;
 	    }
 	    
-	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                "pre-pack first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 
 						sfirst, last ));
 	    MPID_Segment_pack(&sseg, sfirst, &last, buf + buf_off);
-	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                "post-pack first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 
                sfirst, last ));
 	    /* --BEGIN ERROR HANDLING-- */
@@ -176,11 +176,11 @@ void MPIDI_CH3U_Buffer_copy(
 	    buf_end = buf + buf_off + (last - sfirst);
 	    sfirst = last;
 	    
-	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
              "pre-unpack first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 
 						rfirst, last ));
 	    MPID_Segment_unpack(&rseg, rfirst, &last, buf);
-	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
              "post-unpack first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 
 						rfirst, last ));
 	    /* --BEGIN ERROR HANDLING-- */
@@ -207,7 +207,7 @@ void MPIDI_CH3U_Buffer_copy(
 	    buf_off = sfirst - rfirst;
 	    if (buf_off > 0)
 	    {
-		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPIU_DBG_FDEST,
+		MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPL_DBG_FDEST,
                   "moved " MPIDI_MSG_SZ_FMT " bytes to the beginning of the tmp buffer", buf_off));
 		memmove(buf, buf_end - buf_off, buf_off);
 	    }
diff --git a/src/mpid/ch3/src/ch3u_comm.c b/src/mpid/ch3/src/ch3u_comm.c
index c1b9bca..595efd4 100644
--- a/src/mpid/ch3/src/ch3u_comm.c
+++ b/src/mpid/ch3/src/ch3u_comm.c
@@ -500,7 +500,7 @@ static int nonempty_intersection(MPID_Comm *comm, MPID_Group *group, int *flag)
     /* handle common case fast */
     if (comm == MPIR_Process.comm_world || comm == MPIR_Process.icomm_world) {
         *flag = TRUE;
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "comm is comm_world or icomm_world");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "comm is comm_world or icomm_world");
         goto fn_exit;
     }
     *flag = FALSE;
@@ -554,8 +554,8 @@ int MPIDI_CH3I_Comm_handle_failed_procs(MPID_Group *new_failed_procs)
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (flag) {
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
-                             (MPIU_DBG_FDEST, "disabling AS on communicator %p (%#08x)",
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
+                             (MPL_DBG_FDEST, "disabling AS on communicator %p (%#08x)",
                               comm, comm->handle));
             comm->dev.anysource_enabled = FALSE;
         }
@@ -581,7 +581,7 @@ void MPIDI_CH3I_Comm_find(MPIU_Context_id_t context_id, MPID_Comm **comm)
         if ((*comm)->context_id == context_id || ((*comm)->context_id + MPID_CONTEXT_INTRA_COLL) == context_id ||
             ((*comm)->node_comm && ((*comm)->node_comm->context_id == context_id || ((*comm)->node_comm->context_id + MPID_CONTEXT_INTRA_COLL) == context_id)) ||
             ((*comm)->node_roots_comm && ((*comm)->node_roots_comm->context_id == context_id || ((*comm)->node_roots_comm->context_id + MPID_CONTEXT_INTRA_COLL) == context_id)) ) {
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"Found matching context id: %d", (*comm)->context_id);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"Found matching context id: %d", (*comm)->context_id);
             break;
         }
     }
diff --git a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
index 5750439..d57e62c 100644
--- a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
+++ b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
@@ -65,7 +65,7 @@ static int  mpi_to_pmi_keyvals( MPID_Info *info_ptr, PMI_keyval_t **kv_ptr,
 	}
 	MPIR_Info_get_impl( info_ptr, key, vallen+1, kv[i].val, &flag );
         MPIR_ERR_CHKANDJUMP1(!flag, mpi_errno, MPI_ERR_OTHER,"**infonokey", "**infonokey %s", key);
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"key: <%s>, value: <%s>\n", kv[i].key, kv[i].val));
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"key: <%s>, value: <%s>\n", kv[i].key, kv[i].val));
     }
 
  fn_fail:
diff --git a/src/mpid/ch3/src/ch3u_eager.c b/src/mpid/ch3/src/ch3u_eager.c
index 5115bf4..c25f2fe 100644
--- a/src/mpid/ch3/src/ch3u_eager.c
+++ b/src/mpid/ch3/src/ch3u_eager.c
@@ -99,7 +99,7 @@ int MPIDI_CH3_EagerNoncontigSend( MPID_Request **sreq_p,
     MPIDI_CH3_Pkt_t upkt;
     MPIDI_CH3_Pkt_eager_send_t * const eager_pkt = &upkt.eager_send;
     
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                      "sending non-contiguous eager message, data_sz=" MPIDI_MSG_SZ_FMT,
 					data_sz));
     sreq->dev.OnDataAvail = 0;
@@ -118,7 +118,7 @@ int MPIDI_CH3_EagerNoncontigSend( MPID_Request **sreq_p,
     MPIDI_Pkt_set_seqnum(eager_pkt, seqnum);
     MPIDI_Request_set_seqnum(sreq, seqnum);
 
-    MPIU_DBG_MSGPKT(vc,tag,eager_pkt->match.parts.context_id,rank,data_sz,
+    MPL_DBG_MSGPKT(vc,tag,eager_pkt->match.parts.context_id,rank,data_sz,
                     "Eager");
 	    
     sreq->dev.segment_ptr = MPID_Segment_alloc( );
@@ -173,7 +173,7 @@ int MPIDI_CH3_EagerContigSend( MPID_Request **sreq_p,
     iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST)eager_pkt;
     iov[0].MPL_IOV_LEN = sizeof(*eager_pkt);
     
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 	       "sending contiguous eager message, data_sz=" MPIDI_MSG_SZ_FMT,
 					data_sz));
 	    
@@ -184,7 +184,7 @@ int MPIDI_CH3_EagerContigSend( MPID_Request **sreq_p,
     MPIDI_VC_FAI_send_seqnum(vc, seqnum);
     MPIDI_Pkt_set_seqnum(eager_pkt, seqnum);
     
-    MPIU_DBG_MSGPKT(vc,tag,eager_pkt->match.parts.context_id,rank,data_sz,"EagerContig");
+    MPL_DBG_MSGPKT(vc,tag,eager_pkt->match.parts.context_id,rank,data_sz,"EagerContig");
     MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsgv(vc, iov, 2, sreq_p);
     MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
@@ -237,7 +237,7 @@ int MPIDI_CH3_EagerContigShortSend( MPID_Request **sreq_p,
     eagershort_pkt->match.parts.context_id = comm->context_id + context_offset;
     eagershort_pkt->data_sz	     = data_sz;
     
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
        "sending contiguous short eager message, data_sz=" MPIDI_MSG_SZ_FMT,
 					data_sz));
 	    
@@ -258,7 +258,7 @@ int MPIDI_CH3_EagerContigShortSend( MPID_Request **sreq_p,
 	}
     }
 
-    MPIU_DBG_MSGPKT(vc,tag,eagershort_pkt->match.parts.context_id,rank,data_sz,
+    MPL_DBG_MSGPKT(vc,tag,eagershort_pkt->match.parts.context_id,rank,data_sz,
 		    "EagerShort");
     MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, eagershort_pkt, sizeof(*eagershort_pkt), sreq_p);
@@ -299,13 +299,13 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
     /* printf( "Receiving short eager!\n" ); fflush(stdout); */
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 	"received eagershort send pkt, rank=%d, tag=%d, context=%d",
 	eagershort_pkt->match.parts.rank, 
 	eagershort_pkt->match.parts.tag, 
 	eagershort_pkt->match.parts.context_id));
 	    
-    MPIU_DBG_MSGPKT(vc,eagershort_pkt->match.parts.tag,
+    MPL_DBG_MSGPKT(vc,eagershort_pkt->match.parts.tag,
 		    eagershort_pkt->match.parts.context_id,
 		    eagershort_pkt->match.parts.rank,eagershort_pkt->data_sz,
 		    "ReceivedEagerShort");
@@ -354,7 +354,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 		data_sz = rreq->dev.recv_data_sz;
 	    }
 	    else {
-		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+		MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 		    "receive buffer too small; message truncated, msg_sz=" 
 					  MPIDI_MSG_SZ_FMT ", userbuf_sz="
 				          MPIDI_MSG_SZ_FMT,
@@ -537,7 +537,7 @@ int MPIDI_CH3_EagerContigIsend( MPID_Request **sreq_p,
     MPID_Request *sreq = *sreq_p;
     MPL_IOV iov[MPL_IOV_LIMIT];
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 	       "sending contiguous eager message, data_sz=" MPIDI_MSG_SZ_FMT,
 					data_sz));
 	    
@@ -561,7 +561,7 @@ int MPIDI_CH3_EagerContigIsend( MPID_Request **sreq_p,
     MPIDI_Pkt_set_seqnum(eager_pkt, seqnum);
     MPIDI_Request_set_seqnum(sreq, seqnum);
     
-    MPIU_DBG_MSGPKT(vc,tag,eager_pkt->match.parts.context_id,rank,data_sz,"EagerIsend");
+    MPL_DBG_MSGPKT(vc,tag,eager_pkt->match.parts.context_id,rank,data_sz,"EagerIsend");
     MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iSendv(vc, sreq, iov, 2);
     MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
@@ -617,11 +617,11 @@ int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 	"received eager send pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d",
 	eager_pkt->sender_req_id, eager_pkt->match.parts.rank, 
 	eager_pkt->match.parts.tag, eager_pkt->match.parts.context_id));
-    MPIU_DBG_MSGPKT(vc,eager_pkt->match.parts.tag,
+    MPL_DBG_MSGPKT(vc,eager_pkt->match.parts.tag,
 		    eager_pkt->match.parts.context_id,
 		    eager_pkt->match.parts.rank,eager_pkt->data_sz,
 		    "ReceivedEager");
@@ -705,13 +705,13 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPIDI_msg_sz_t data_len;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 	"received ready send pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d",
 			ready_pkt->sender_req_id, 
 			ready_pkt->match.parts.rank, 
                         ready_pkt->match.parts.tag, 
 			ready_pkt->match.parts.context_id));
-    MPIU_DBG_MSGPKT(vc,ready_pkt->match.parts.tag,
+    MPL_DBG_MSGPKT(vc,ready_pkt->match.parts.tag,
 		    ready_pkt->match.parts.context_id,
 		    ready_pkt->match.parts.rank,ready_pkt->data_sz,
 		    "ReceivedReady");
@@ -824,14 +824,14 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_EagerSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGER_SEND\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_send.sender_req_id));
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->eager_send.match.parts.context_id);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->eager_send.match.parts.tag);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->eager_send.match.parts.rank);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->eager_send.data_sz);
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGER_SEND\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_send.sender_req_id));
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->eager_send.match.parts.context_id);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->eager_send.match.parts.tag);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->eager_send.match.parts.rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->eager_send.data_sz);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->eager_send.seqnum);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->eager_send.seqnum);
 #endif
 }
 
@@ -840,13 +840,13 @@ int MPIDI_CH3_PktPrint_EagerShortSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
     int datalen;
     unsigned char *p = (unsigned char *)pkt->eagershort_send.data;
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGERSHORT_SEND\n");
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->eagershort_send.match.parts.context_id);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->eagershort_send.match.parts.tag);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->eagershort_send.match.parts.rank);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->eagershort_send.data_sz);
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGERSHORT_SEND\n");
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->eagershort_send.match.parts.context_id);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->eagershort_send.match.parts.tag);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->eagershort_send.match.parts.rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->eagershort_send.data_sz);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->eagershort_send.seqnum);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->eagershort_send.seqnum);
 #endif
     datalen = pkt->eagershort_send.data_sz;
     if (datalen > 0) {
@@ -856,21 +856,21 @@ int MPIDI_CH3_PktPrint_EagerShortSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 	for (i=0; i<datalen; i++) {
 	    MPL_snprintf( &databytes[2*i], 64 - 2*i, "%2x", p[i] );
 	}
-	MPIU_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,TERSE," data ......... %s\n", databytes);
+	MPL_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,TERSE," data ......... %s\n", databytes);
     }
 }
 #endif /* defined(USE_EAGER_SHORT) */
 
 int MPIDI_CH3_PktPrint_ReadySend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... READY_SEND\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->ready_send.sender_req_id));
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->ready_send.match.parts.context_id);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->ready_send.match.parts.tag);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->ready_send.match.parts.rank);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->ready_send.data_sz);
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... READY_SEND\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->ready_send.sender_req_id));
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->ready_send.match.parts.context_id);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->ready_send.match.parts.tag);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->ready_send.match.parts.rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->ready_send.data_sz);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->ready_send.seqnum);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->ready_send.seqnum);
 #endif
 }
 
diff --git a/src/mpid/ch3/src/ch3u_eagersync.c b/src/mpid/ch3/src/ch3u_eagersync.c
index ae6d87c..e1c635e 100644
--- a/src/mpid/ch3/src/ch3u_eagersync.c
+++ b/src/mpid/ch3/src/ch3u_eagersync.c
@@ -59,12 +59,12 @@ int MPIDI_CH3_EagerSyncNoncontigSend( MPID_Request **sreq_p,
     MPIDI_Pkt_set_seqnum(es_pkt, seqnum);
     MPIDI_Request_set_seqnum(sreq, seqnum);
     
-    MPIU_DBG_MSGPKT(vc,tag,es_pkt->match.parts.context_id,rank,data_sz,"EagerSync");
+    MPL_DBG_MSGPKT(vc,tag,es_pkt->match.parts.context_id,rank,data_sz,"EagerSync");
 
     if (dt_contig)
     {
         MPL_IOV iov[2];
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                                             "sending contiguous sync eager message, data_sz=" MPIDI_MSG_SZ_FMT, 
 					    data_sz));
 	
@@ -89,7 +89,7 @@ int MPIDI_CH3_EagerSyncNoncontigSend( MPID_Request **sreq_p,
     }
     else
     {
-	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,
+	MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		       "sending non-contiguous sync eager message, data_sz=" MPIDI_MSG_SZ_FMT, 
 		       data_sz);
 	
@@ -125,7 +125,7 @@ int MPIDI_CH3_EagerSyncZero(MPID_Request **sreq_p, int rank, int tag,
     MPIDI_VC_t * vc;
     MPID_Request *sreq = *sreq_p;
     
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
     
     /* MT FIXME what are the two operations we are waiting for?  the send and
      * the sync response? */
@@ -145,7 +145,7 @@ int MPIDI_CH3_EagerSyncZero(MPID_Request **sreq_p, int rank, int tag,
     MPIDI_Pkt_set_seqnum(es_pkt, seqnum);
     MPIDI_Request_set_seqnum(sreq, seqnum);
     
-    MPIU_DBG_MSGPKT(vc,tag,es_pkt->match.parts.context_id,rank,(MPIDI_msg_sz_t)0,"EagerSync0");
+    MPL_DBG_MSGPKT(vc,tag,es_pkt->match.parts.context_id,rank,(MPIDI_msg_sz_t)0,"EagerSync0");
     MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iSend(vc, sreq, es_pkt, sizeof(*es_pkt));
     MPID_THREAD_CS_EXIT(POBJ, vc->pobj_mutex);
@@ -174,7 +174,7 @@ int MPIDI_CH3_EagerSyncAck( MPIDI_VC_t *vc, MPID_Request *rreq )
     MPIDI_CH3_Pkt_eager_sync_ack_t * const esa_pkt = &upkt.eager_sync_ack;
     MPID_Request * esa_req;
     
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending eager sync ack");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_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;
     MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
@@ -223,12 +223,12 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPIDI_msg_sz_t data_len;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
      "received eager sync send pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d",
 	      es_pkt->sender_req_id, es_pkt->match.parts.rank, 
 	      es_pkt->match.parts.tag, 
               es_pkt->match.parts.context_id));
-    MPIU_DBG_MSGPKT(vc,es_pkt->match.parts.tag,es_pkt->match.parts.context_id,
+    MPL_DBG_MSGPKT(vc,es_pkt->match.parts.tag,es_pkt->match.parts.context_id,
 		    es_pkt->match.parts.rank,es_pkt->data_sz,
 		    "ReceivedEagerSync");
 	    
@@ -286,7 +286,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
                 *rreqp = rreq;
             }
 	}
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending eager sync ack");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_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;
@@ -352,7 +352,7 @@ int MPIDI_CH3_PktHandler_EagerSyncAck( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPID_Request * sreq;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
+    MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 	   "received eager sync ack pkt, sreq=0x%08x", esa_pkt->sender_req_id);
 	    
     MPID_Request_get_ptr(esa_pkt->sender_req_id, sreq);
@@ -377,22 +377,22 @@ int MPIDI_CH3_PktHandler_EagerSyncAck( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_EagerSyncSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGER_SYNC_SEND\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_sync_send.sender_req_id));
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->eager_sync_send.match.parts.context_id);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->eager_sync_send.match.parts.tag);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->eager_sync_send.match.parts.rank);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->eager_sync_send.data_sz);
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGER_SYNC_SEND\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_sync_send.sender_req_id));
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->eager_sync_send.match.parts.context_id);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->eager_sync_send.match.parts.tag);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->eager_sync_send.match.parts.rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->eager_sync_send.data_sz);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->eager_sync_send.seqnum);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->eager_sync_send.seqnum);
 #endif
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_EagerSyncAck( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGER_SYNC_ACK\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_sync_ack.sender_req_id));
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGER_SYNC_ACK\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_sync_ack.sender_req_id));
     return MPI_SUCCESS;
 }
 #endif
diff --git a/src/mpid/ch3/src/ch3u_handle_connection.c b/src/mpid/ch3/src/ch3u_handle_connection.c
index fc1e822..1d32a3b 100644
--- a/src/mpid/ch3/src/ch3u_handle_connection.c
+++ b/src/mpid/ch3/src/ch3u_handle_connection.c
@@ -65,7 +65,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
 
 		    /* MT: this is not thread safe */
 		    MPIDI_Outstanding_close_ops -= 1;
-		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
+		    MPL_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
              "outstanding close operations = %d", MPIDI_Outstanding_close_ops);
 	    
 		    if (MPIDI_Outstanding_close_ops == 0)
@@ -81,7 +81,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
                     /* VC was terminated before it was activated.
                        This can happen if a failed process was
                        detected before the process used the VC. */
-                    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "VC terminated before it was activated.  We probably got a failed"
+                    MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "VC terminated before it was activated.  We probably got a failed"
                                  " process notification.");
                     MPIDI_CH3U_Complete_posted_with_error(vc);
                     ++MPIDI_Failed_vc_count;
@@ -97,7 +97,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
                        be outstanding sends or receives on the local
                        side, remote side or both. */
                     
-                    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "Connection closed prematurely.");
+                    MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "Connection closed prematurely.");
 
                     MPIDI_CH3U_Complete_posted_with_error(vc);
                     ++MPIDI_Failed_vc_count;
@@ -124,7 +124,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
                        outstanding sends or receives on either
                        side. */
 
-                    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "Connection closed prematurely during close protocol.  "
+                    MPL_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "Connection closed prematurely during close protocol.  "
                                    "Outstanding close operations = %d", MPIDI_Outstanding_close_ops);
 
                     MPIDI_CH3U_Complete_posted_with_error(vc);
@@ -146,7 +146,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
 
 		default:
 		{
-		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "Unhandled connection state %d when closing connection",vc->state);
+		    MPL_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "Unhandled connection state %d when closing connection",vc->state);
 		    mpi_errno = MPIR_Err_create_code(
 			MPI_SUCCESS, MPIR_ERR_FATAL, FCNAME, __LINE__, 
                         MPI_ERR_INTERN, "**ch3|unhandled_connection_state",
@@ -233,7 +233,7 @@ int MPIDI_CH3U_VC_SendClose( MPIDI_VC_t *vc, int rank )
     /* 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(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,(MPL_DBG_FDEST,
 		  "sending close(%s) on vc (pg=%p) %p to rank %d, ops = %d", 
 		  close_pkt->ack ? "TRUE" : "FALSE", vc->pg, vc, 
 		  rank, MPIDI_Outstanding_close_ops));
@@ -291,7 +291,7 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	MPIDI_Pkt_init(resp_pkt, MPIDI_CH3_PKT_CLOSE);
 	resp_pkt->ack = TRUE;
 	
-	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"sending close(TRUE) to %d",
+	MPL_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"sending close(TRUE) to %d",
 		       vc->pg_rank);
 	mpi_errno = MPIDI_CH3_iStartMsg(vc, resp_pkt, sizeof(*resp_pkt), &resp_sreq);
         MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|send_close_ack");
@@ -308,7 +308,7 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     {
 	if (vc->state == MPIDI_VC_STATE_LOCAL_CLOSE)
 	{
-	    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
+	    MPL_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
 		   "received close(FALSE) from %d, moving to CLOSE_ACKED.",
 		   vc->pg_rank);
             MPIDI_CHANGE_VC_STATE(vc, CLOSE_ACKED);
@@ -317,8 +317,8 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         {
 	    if (vc->state != MPIDI_VC_STATE_ACTIVE)
             {
-		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, (MPIU_DBG_FDEST, "Unexpected state %s in vc %p (rank=%d) (expecting MPIDI_VC_STATE_ACTIVE)\n", MPIDI_VC_GetStateString(vc->state), vc, vc->pg_rank ));
-	    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
+		MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, (MPL_DBG_FDEST, "Unexpected state %s in vc %p (rank=%d) (expecting MPIDI_VC_STATE_ACTIVE)\n", MPIDI_VC_GetStateString(vc->state), vc, vc->pg_rank ));
+	    MPL_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
                      "received close(FALSE) from %d, moving to REMOTE_CLOSE.",
 				   vc->pg_rank);
             }
@@ -328,7 +328,7 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     }
     else /* (close_pkt->ack == TRUE) */
     {
-	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
+	MPL_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
                        "received close(TRUE) from %d, moving to CLOSED.", 
 			       vc->pg_rank);
 	MPIU_Assert (vc->state == MPIDI_VC_STATE_LOCAL_CLOSE || 
@@ -349,8 +349,8 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_Close( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_CLOSE\n");
-    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,TERSE," ack ......... %s\n", pkt->close.ack ? "TRUE" : "FALSE");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_CLOSE\n");
+    MPL_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,TERSE," ack ......... %s\n", pkt->close.ack ? "TRUE" : "FALSE");
     return MPI_SUCCESS;
 }
 #endif
@@ -377,7 +377,7 @@ int MPIDI_CH3U_VC_WaitForClose( void )
 
     MPID_Progress_start(&progress_state);
     while(MPIDI_Outstanding_close_ops > 0) {
-	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
+	MPL_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
 		       "Waiting for %d close operations",
 		       MPIDI_Outstanding_close_ops);
 	mpi_errno = MPID_Progress_wait(&progress_state);
@@ -453,16 +453,16 @@ int MPIDI_CH3U_Get_failed_group(int last_rank, MPID_Group **failed_group)
 
     MPIDI_FUNC_ENTER(MPID_STATE_GET_FAILED_GROUP);
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, VERBOSE, "Getting failed group with %d as last acknowledged\n", last_rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, VERBOSE, "Getting failed group with %d as last acknowledged\n", last_rank);
 
     if (-1 == last_rank) {
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "No failure acknowledged");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "No failure acknowledged");
         *failed_group = MPID_Group_empty;
         goto fn_exit;
     }
 
     if (*MPIDI_failed_procs_string == '\0') {
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "Found no failed ranks");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "Found no failed ranks");
         *failed_group = MPID_Group_empty;
         goto fn_exit;
     }
@@ -476,7 +476,7 @@ int MPIDI_CH3U_Get_failed_group(int last_rank, MPID_Group **failed_group)
     while(1) {
         parse_rank(&rank);
         ++i;
-        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, VERBOSE, "Found failed rank: %d", rank);
+        MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, VERBOSE, "Found failed rank: %d", rank);
         utarray_push_back(failed_procs, &rank);
         MPIDI_last_known_failed = rank;
         MPIR_ERR_CHKINTERNAL(*c != ',' && *c != '\0', mpi_errno, "error parsing failed process list");
@@ -547,7 +547,7 @@ int MPIDI_CH3U_Check_for_failed_procs(void)
         goto fn_exit;
     }
 
-    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_OTHER, TYPICAL, "Received proc fail notification: %s", MPIDI_failed_procs_string);
+    MPL_DBG_MSG_S(MPIDI_CH3_DBG_OTHER, TYPICAL, "Received proc fail notification: %s", MPIDI_failed_procs_string);
 
     /* save reference to previous group so we can identify new failures */
     prev_failed_group = MPIDI_Failed_procs_group;
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
index 23d43fa..9338eb9 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
@@ -62,7 +62,7 @@ int MPIDI_CH3U_Handle_ordered_recv_pkt(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_HANDLE_ORDERED_RECV_PKT);
 
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,MPIDI_DBG_Print_packet(pkt));
+    MPL_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,MPIDI_DBG_Print_packet(pkt));
 
     /* FIXME: We can turn this into something like
 
@@ -114,7 +114,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_RECEIVE_DATA_FOUND);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
 	
     MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, 
 			    dt_contig, userbuf_sz, dt_ptr, dt_true_lb);
@@ -123,7 +123,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
 	data_sz = rreq->dev.recv_data_sz;
     }
     else {
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                "receive buffer too small; message truncated, msg_sz=" MPIDI_MSG_SZ_FMT ", userbuf_sz="
 					    MPIDI_MSG_SZ_FMT,
 				 rreq->dev.recv_data_sz, userbuf_sz));
@@ -146,7 +146,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
            now, otherwise build an iov and let the channel unpack */
         if (*buflen >= data_sz)
         {
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Copying contiguous data to user buffer");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Copying contiguous data to user buffer");
             /* copy data out of the receive buffer */
             if (rreq->dev.drop_data == FALSE) {
                 MPIU_Memcpy((char*)(rreq->dev.user_buf) + dt_true_lb, buf, data_sz);
@@ -156,7 +156,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
         }
         else
         {
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for contiguous read");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for contiguous read");
             
             rreq->dev.iov[0].MPL_IOV_BUF = 
                 (MPL_IOV_BUF_CAST)((char*)(rreq->dev.user_buf) + dt_true_lb);
@@ -187,7 +187,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
         if (data_sz == rreq->dev.recv_data_sz && *buflen >= data_sz)
         {
             MPIDI_msg_sz_t last;
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Copying noncontiguous data to user buffer");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Copying noncontiguous data to user buffer");
             last = data_sz;
             MPID_Segment_unpack(rreq->dev.segment_ptr, rreq->dev.segment_first, 
 				&last, buf);
@@ -212,7 +212,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
         }
         else
         {   
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for non-contiguous read");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for non-contiguous read");
 
             mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
             if (mpi_errno != MPI_SUCCESS) {
@@ -246,7 +246,7 @@ int MPIDI_CH3U_Receive_data_unexpected(MPID_Request * rreq, char *buf, MPIDI_msg
        specialized buffer pool. */
     /* FIXME: to avoid memory exhaustion, integrate buffer pool management
        with flow control */
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
     
     rreq->dev.tmpbuf = MPIU_Malloc(rreq->dev.recv_data_sz);
     if (!rreq->dev.tmpbuf) {
@@ -305,7 +305,7 @@ int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_POST_DATA_RECEIVE_FOUND);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
 	
     MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, 
 			    dt_contig, userbuf_sz, dt_ptr, dt_true_lb);
@@ -314,7 +314,7 @@ int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
 	data_sz = rreq->dev.recv_data_sz;
     }
     else {
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                "receive buffer too small; message truncated, msg_sz=" MPIDI_MSG_SZ_FMT ", userbuf_sz="
 					    MPIDI_MSG_SZ_FMT,
 				 rreq->dev.recv_data_sz, userbuf_sz));
@@ -332,7 +332,7 @@ int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
 	/* user buffer is contiguous and large enough to store the
 	   entire message.  However, we haven't yet *read* the data 
 	   (this code describes how to read the data into the destination) */
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for contiguous read");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for contiguous read");
 	rreq->dev.iov[0].MPL_IOV_BUF = 
 	    (MPL_IOV_BUF_CAST)((char*)(rreq->dev.user_buf) + dt_true_lb);
 	rreq->dev.iov[0].MPL_IOV_LEN = data_sz;
@@ -345,7 +345,7 @@ int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
     else {
 	/* user buffer is not contiguous or is too small to hold
 	   the entire message */
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for non-contiguous read");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for non-contiguous read");
 	rreq->dev.segment_ptr = 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, 
@@ -381,7 +381,7 @@ int MPIDI_CH3U_Post_data_receive_unexpected(MPID_Request * rreq)
        specialized buffer pool. */
     /* FIXME: to avoid memory exhaustion, integrate buffer pool management
        with flow control */
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
     
     rreq->dev.tmpbuf = MPIU_Malloc(rreq->dev.recv_data_sz);
     if (!rreq->dev.tmpbuf) {
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_req.c b/src/mpid/ch3/src/ch3u_handle_recv_req.c
index fd421fa..7dfa2eb 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_req.c
@@ -677,7 +677,7 @@ int MPIDI_CH3_ReqHandler_AccumMetadataRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((un
     MPIDI_CH3U_SRBuf_alloc(rreq, MPIDI_CH3U_SRBuf_size);
     /* --BEGIN ERROR HANDLING-- */
     if (rreq->dev.tmpbuf_sz == 0) {
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
         mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL,
                                          FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem",
                                          "**nomem %d", MPIDI_CH3U_SRBuf_size);
@@ -807,7 +807,7 @@ int MPIDI_CH3_ReqHandler_GaccumMetadataRecvComplete(MPIDI_VC_t * vc,
         MPIDI_CH3U_SRBuf_alloc(rreq, MPIDI_CH3U_SRBuf_size);
         /* --BEGIN ERROR HANDLING-- */
         if (rreq->dev.tmpbuf_sz == 0) {
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
             mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL,
                                              FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem",
                                              "**nomem %d", MPIDI_CH3U_SRBuf_size);
diff --git a/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c b/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
index d6e6a22..3d247fd 100644
--- a/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
+++ b/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
@@ -17,7 +17,7 @@ int MPIDI_CH3_PktHandler_Revoke(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     int mpi_errno = MPI_SUCCESS;
     MPID_Comm *comm_ptr = NULL;
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, VERBOSE, "Received revoke pkt from %d", vc->pg_rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, VERBOSE, "Received revoke pkt from %d", vc->pg_rank);
 
     /* Search through all of the communicators to find the right context_id */
     MPIDI_CH3I_Comm_find(revoke_pkt->revoked_comm, &comm_ptr);
diff --git a/src/mpid/ch3/src/ch3u_port.c b/src/mpid/ch3/src/ch3u_port.c
index 45ff76c..c09daf8 100644
--- a/src/mpid/ch3/src/ch3u_port.c
+++ b/src/mpid/ch3/src/ch3u_port.c
@@ -216,7 +216,7 @@ static int MPIDI_Create_inter_root_communicator_accept(const char *port_name,
     *comm_pptr = tmp_comm;
     *vc_pptr = new_vc;
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPL_DBG_FDEST,
 		  "new_vc=%p", new_vc));
 
 fn_exit:
@@ -389,7 +389,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
         send_ints[1] = local_comm_size;
         send_ints[2] = recvcontext_id;
 
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPL_DBG_FDEST,
 		  "sending 3 ints, %d, %d and %d, and receiving 3 ints", 
                   send_ints[0], send_ints[1], send_ints[2]));
         mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0,
@@ -404,7 +404,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     }
 
     /* broadcast the received info to local processes */
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"broadcasting the received 3 ints");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"broadcasting the received 3 ints");
     mpi_errno = MPIR_Bcast_intra(recv_ints, 3, MPI_INT, root, comm_ptr, &errflag);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
@@ -422,7 +422,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     MPIU_CHKLMEM_MALLOC(remote_translation,pg_translation*,
 			remote_comm_size * sizeof(pg_translation),
 			mpi_errno,"remote_translation");
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"allocated remote process groups");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"allocated remote process groups");
 
     /* Exchange the process groups and their corresponding KVSes */
     if (rank == root)
@@ -432,7 +432,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 					n_remote_pgs, remote_pg );
 	/* Receive the translations from remote process rank to process group 
 	   index */
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPL_DBG_FDEST,
                "sending %d ints, receiving %d ints", 
 	      local_comm_size * 2, remote_comm_size * 2));
 	mpi_errno = MPIC_Sendrecv(local_translation, local_comm_size * 2,
@@ -445,10 +445,10 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 	}
 
 #ifdef MPICH_DBG_OUTPUT
-	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]connect:Received remote_translation:\n", rank);
+	MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]connect:Received remote_translation:\n", rank);
 	for (i=0; i<remote_comm_size; i++)
 	{
-	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
+	    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
 		i, remote_translation[i].pg_index, i, remote_translation[i].pg_rank));
 	}
 #endif
@@ -460,17 +460,17 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     }
 
     /* Broadcast out the remote rank translation array */
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Broadcasting remote translation");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_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) MPIR_ERR_POP(mpi_errno);
     MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
 #ifdef MPICH_DBG_OUTPUT
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]connect:Received remote_translation after broadcast:\n", rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]connect:Received remote_translation after broadcast:\n", rank);
     for (i=0; i<remote_comm_size; i++)
     {
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
 	    i, remote_translation[i].pg_index, i, remote_translation[i].pg_rank));
     }
 #endif
@@ -491,7 +491,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     /* synchronize with remote root */
     if (rank == root)
     {
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"sync with peer");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"sync with peer");
         mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0,
                                      sendtag++, &j, 0, MPI_INT,
                                      0, recvtag++, tmp_comm,
@@ -516,7 +516,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     }
 
  fn_exit: 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Exiting ch3u_comm_connect");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Exiting ch3u_comm_connect");
     MPIU_CHKLMEM_FREEALL();
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_COMM_CONNECT);
     return mpi_errno;
@@ -547,7 +547,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
         MPIR_ERR_SET1(mpi_errno, MPI_ERR_PORT, "**portexist", "**portexist %s", port_name);
 
         /* notify other processes to return an error */
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"broadcasting 3 ints: error case");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"broadcasting 3 ints: error case");
         mpi_errno2 = MPIR_Bcast_intra(recv_ints, 3, MPI_INT, root, comm_ptr, &errflag);
         if (mpi_errno2) MPIR_ERR_ADD(mpi_errno, mpi_errno2);
         if (errflag) {
@@ -611,7 +611,7 @@ static int ExtractLocalPGInfo( MPID_Comm *comm_p,
     if (mpi_errno != MPI_SUCCESS) {
 	MPIR_ERR_POP(mpi_errno);
     }
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,MPIDI_PrintConnStr(__FILE__,__LINE__,"PG as string is", pg_list->str ));
+    MPL_DBG_STMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,MPIDI_PrintConnStr(__FILE__,__LINE__,"PG as string is", pg_list->str ));
     local_translation[0].pg_index = 0;
     local_translation[0].pg_rank = comm_p->dev.vcrt->vcr_table[0]->pg_rank;
     pg_iter = pg_list;
@@ -658,7 +658,7 @@ static int ExtractLocalPGInfo( MPID_Comm *comm_p,
 #ifdef MPICH_DBG_OUTPUT
     pg_iter = pg_list;
     while (pg_iter != NULL) {
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"connect:PG: '%s'\n<%s>\n", pg_iter->pg_id, pg_iter->str));
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"connect:PG: '%s'\n<%s>\n", pg_iter->pg_id, pg_iter->str));
 	pg_iter = pg_iter->next;
     }
 #endif
@@ -737,7 +737,7 @@ static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr,
 	/* Then reconstruct the received process group.  This step
 	   also initializes the created process group */
 
-	MPIU_DBG_STMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,MPIDI_PrintConnStr(__FILE__,__LINE__,"Creating pg from string", pg_str ));
+	MPL_DBG_STMT(MPIDI_CH3_DBG_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) {
 	    MPIR_ERR_POP(mpi_errno);
@@ -1015,7 +1015,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     MPIU_CHKLMEM_MALLOC(remote_translation,pg_translation*,
 			remote_comm_size * sizeof(pg_translation),
 			mpi_errno, "remote_translation");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"[%d]accept:remote process groups: %d\nremote comm size: %d\n", rank, n_remote_pgs, remote_comm_size));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"[%d]accept:remote process groups: %d\nremote comm size: %d\n", rank, n_remote_pgs, remote_comm_size));
 
     /* Exchange the process groups and their corresponding KVSes */
     if (rank == root)
@@ -1035,10 +1035,10 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
 				  MPI_INT, 0, recvtag++, tmp_comm,
 				  MPI_STATUS_IGNORE, &errflag);
 #ifdef MPICH_DBG_OUTPUT
-	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]accept:Received remote_translation:\n", rank);
+	MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]accept:Received remote_translation:\n", rank);
 	for (i=0; i<remote_comm_size; i++)
 	{
-	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
+	    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
 		i, remote_translation[i].pg_index, i, remote_translation[i].pg_rank));
 	}
 #endif
@@ -1051,16 +1051,16 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     }
 
     /* Broadcast out the remote rank translation array */
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Broadcast remote_translation");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_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) MPIR_ERR_POP(mpi_errno);
     MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 #ifdef MPICH_DBG_OUTPUT
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]accept:Received remote_translation after broadcast:\n", rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]accept:Received remote_translation after broadcast:\n", rank);
     for (i=0; i<remote_comm_size; i++)
     {
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
 	    i, remote_translation[i].pg_index, i, remote_translation[i].pg_rank));
     }
 #endif
@@ -1080,7 +1080,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     /* synchronize with remote root */
     if (rank == root)
     {
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"sync with peer");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"sync with peer");
         mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0,
                                      sendtag++, &j, 0, MPI_INT,
                                      0, recvtag++, tmp_comm,
@@ -1093,7 +1093,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
         MPIR_Comm_release(tmp_comm);
     }
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Barrier");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Barrier");
     mpi_errno = MPIR_Barrier_intra(comm_ptr, &errflag);
     if (mpi_errno != MPI_SUCCESS) {
 	MPIR_ERR_POP(mpi_errno);
@@ -1181,7 +1181,7 @@ static int SetupNewIntercomm( MPID_Comm *comm_ptr, int remote_comm_size,
     mpi_errno = MPIR_Comm_commit(intercomm);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Barrier");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Barrier");
     mpi_errno = MPIR_Barrier_intra(comm_ptr, &errflag);
     if (mpi_errno != MPI_SUCCESS) {
 	MPIR_ERR_POP(mpi_errno);
@@ -1290,7 +1290,7 @@ int MPIDI_CH3I_Acceptq_enqueue(MPIDI_VC_t * vc, int port_name_tag )
 	maxAcceptQueueSize = AcceptQueueSize;
 
     /* FIXME: Stack or queue? */
-    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"vc=%p:Enqueuing accept connection",vc);
+    MPL_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"vc=%p:Enqueuing accept connection",vc);
     q_item->next = acceptq_head;
     acceptq_head = q_item;
     
@@ -1342,8 +1342,8 @@ int MPIDI_CH3I_Acceptq_dequeue(MPIDI_VC_t ** vc, int port_name_tag)
     
     mpi_errno = MPIDI_CH3_Complete_Acceptq_dequeue(*vc);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,
-	      (MPIU_DBG_FDEST,"vc=%p:Dequeuing accept connection with tag %d",
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,
+	      (MPL_DBG_FDEST,"vc=%p:Dequeuing accept connection with tag %d",
 	       *vc,port_name_tag));
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_ACCEPTQ_DEQUEUE);
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index 9269f3f..2dbe272 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -817,8 +817,8 @@ MPID_Request * MPIDI_CH3U_Recvq_FDP_or_AEU(MPIDI_Message_match * match,
             MPIDI_Request_create_null_rreq( rreq, mpi_errno, found=FALSE;goto lock_exit );
             MPIU_Assert(mpi_errno == MPI_SUCCESS);
 
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
-                (MPIU_DBG_FDEST, "RECEIVED MESSAGE FOR REVOKED COMM (tag=%d,src=%d,cid=%d)\n", MPIR_TAG_MASK_ERROR_BITS(match->parts.tag), match->parts.rank, comm_ptr->context_id));
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
+                (MPL_DBG_FDEST, "RECEIVED MESSAGE FOR REVOKED COMM (tag=%d,src=%d,cid=%d)\n", MPIR_TAG_MASK_ERROR_BITS(match->parts.tag), match->parts.rank, comm_ptr->context_id));
             return rreq;
         }
     }
@@ -893,8 +893,8 @@ static inline void dequeue_and_set_error(MPID_Request **req,  MPID_Request *prev
     /* set error and complete */
     (*req)->status.MPI_ERROR = *error;
     MPID_Request_complete(*req);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
-                     (MPIU_DBG_FDEST, "set error of req %p (%#08x) to %#x and completing.",
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
+                     (MPL_DBG_FDEST, "set error of req %p (%#08x) to %#x and completing.",
                       *req, (*req)->handle, *error));
     *req = next;
 }
@@ -939,7 +939,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
         match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_PT2PT;
 
         if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                         "cleaning up unexpected pt2pt pkt rank=%d tag=%d contextid=%d",
                         rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
             dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -951,7 +951,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
         if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
             if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                 MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                             "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
                             rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                 dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -967,7 +967,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                                 "cleaning up unexpected pt2pt pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -981,7 +981,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                                 "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -995,7 +995,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                                 "cleaning up unexpected pt2pt pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -1009,7 +1009,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                                 "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -1031,7 +1031,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
         match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_PT2PT;
 
         if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                         "cleaning up posted pt2pt pkt rank=%d tag=%d contextid=%d",
                         rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
             dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
@@ -1043,7 +1043,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
         if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
             if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                 MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                             "cleaning up posted collective pkt rank=%d tag=%d contextid=%d",
                             rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                 dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
@@ -1059,7 +1059,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                                 "cleaning up posted pt2pt pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
@@ -1073,7 +1073,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                                 "cleaning up posted collective pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
@@ -1087,7 +1087,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                                 "cleaning up posted pt2pt pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
@@ -1101,7 +1101,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                                 "cleaning up posted collective pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
diff --git a/src/mpid/ch3/src/ch3u_request.c b/src/mpid/ch3/src/ch3u_request.c
index bee9aa7..9ab3b01 100644
--- a/src/mpid/ch3/src/ch3u_request.c
+++ b/src/mpid/ch3/src/ch3u_request.c
@@ -45,7 +45,7 @@ MPID_Request * MPID_Request_create(void)
     req = MPIU_Handle_obj_alloc(&MPID_Request_mem);
     if (req != NULL)
     {
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 		       "allocated request, handle=0x%08x", req->handle);
 #ifdef MPICH_DBG_OUTPUT
 	/*MPIU_Assert(HANDLE_GET_MPI_KIND(req->handle) == MPID_REQUEST);*/
@@ -109,7 +109,7 @@ MPID_Request * MPID_Request_create(void)
     else
     {
 	/* FIXME: This fails to fail if debugging is turned off */
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"unable to allocate a request");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"unable to allocate a request");
     }
     
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_REQUEST_CREATE);
@@ -147,7 +147,7 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_REQUEST_LOAD_SEND_IOV);
     MPIU_Assert(sreq->dev.segment_ptr != NULL);
     last = sreq->dev.segment_size;
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPL_DBG_FDEST,
      "pre-pv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d",
 		      sreq->dev.segment_first, last, *iov_n));
     MPIU_Assert(sreq->dev.segment_first < last);
@@ -155,19 +155,19 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
     MPIU_Assert(*iov_n > 0 && *iov_n <= MPL_IOV_LIMIT);
     MPID_Segment_pack_vector(sreq->dev.segment_ptr, sreq->dev.segment_first, 
 			     &last, iov, iov_n);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPL_DBG_FDEST,
     "post-pv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d",
 		      sreq->dev.segment_first, last, *iov_n));
     MPIU_Assert(*iov_n > 0 && *iov_n <= MPL_IOV_LIMIT);
     
     if (last == sreq->dev.segment_size)
     {
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"remaining data loaded into IOV");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"remaining data loaded into IOV");
 	sreq->dev.OnDataAvail = sreq->dev.OnFinal;
     }
     else if ((last - sreq->dev.segment_first) / *iov_n >= MPIDI_IOV_DENSITY_MIN)
     {
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"more data loaded into IOV");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"more data loaded into IOV");
 	sreq->dev.segment_first = last;
 	sreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_SendReloadIOV;
     }
@@ -176,7 +176,7 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
 	MPIDI_msg_sz_t data_sz;
 	int i, iov_data_copied;
 	
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"low density.  using SRBuf.");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"low density.  using SRBuf.");
 	    
 	data_sz = sreq->dev.segment_size - sreq->dev.segment_first;
 	if (!MPIDI_Request_get_srbuf_flag(sreq))
@@ -185,7 +185,7 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
 	    /* --BEGIN ERROR HANDLING-- */
 	    if (sreq->dev.tmpbuf_sz == 0)
 	    {
-		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"SRBuf allocation failure");
+		MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"SRBuf allocation failure");
 		mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, 
                                 FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem", 
 						 "**nomem %d", data_sz);
@@ -206,12 +206,12 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
 	last = (data_sz <= sreq->dev.tmpbuf_sz - iov_data_copied) ? 
 	    sreq->dev.segment_size :
 	    sreq->dev.segment_first + sreq->dev.tmpbuf_sz - iov_data_copied;
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPL_DBG_FDEST,
                "pre-pack: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT,
 			  sreq->dev.segment_first, last));
 	MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, 
 			  &last, (char*) sreq->dev.tmpbuf + iov_data_copied);
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPL_DBG_FDEST,
               "post-pack: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT,
 			   sreq->dev.segment_first, last));
 	iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST)sreq->dev.tmpbuf;
@@ -219,12 +219,12 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
 	*iov_n = 1;
 	if (last == sreq->dev.segment_size)
 	{
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"remaining data packed into SRBuf");
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"remaining data packed into SRBuf");
 	    sreq->dev.OnDataAvail = sreq->dev.OnFinal;
 	}
 	else 
 	{
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"more data packed into SRBuf");
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"more data packed into SRBuf");
 	    sreq->dev.segment_first = last;
 	    sreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_SendReloadIOV;
 	}
@@ -299,14 +299,14 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 	    if (rreq->dev.segment_first - orig_segment_first + data_sz + rreq->dev.tmpbuf_off ==
 		rreq->dev.recv_data_sz)
 	    {
-		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 		  "updating rreq to read the remaining data into the SRBuf");
 		rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_UnpackSRBufComplete;
                 orig_segment_first = MPIDI_LOAD_RECV_IOV_ORIG_SEGMENT_FIRST_UNSET;
 	    }
 	    else
 	    {
-		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+		MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 		       "updating rreq to read more data into the SRBuf");
 		rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_UnpackSRBufReloadIOV;
 	    }
@@ -316,7 +316,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 	last = rreq->dev.segment_size;
 	rreq->dev.iov_count = MPL_IOV_LIMIT;
 	rreq->dev.iov_offset = 0;
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPL_DBG_FDEST,
    "pre-upv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d",
 			  rreq->dev.segment_first, last, rreq->dev.iov_count));
 	MPIU_Assert(rreq->dev.segment_first < last);
@@ -324,7 +324,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 	MPID_Segment_unpack_vector(rreq->dev.segment_ptr, 
 				   rreq->dev.segment_first,
 				   &last, &rreq->dev.iov[0], &rreq->dev.iov_count);
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPL_DBG_FDEST,
    "post-upv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d, iov_offset=%lld",
 			  rreq->dev.segment_first, last, rreq->dev.iov_count, (long long)rreq->dev.iov_offset));
 	MPIU_Assert(rreq->dev.iov_count >= 0 && rreq->dev.iov_count <= 
@@ -353,7 +353,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 
 	if (last == rreq->dev.recv_data_sz + orig_segment_first)
 	{
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
      "updating rreq to read the remaining data directly into the user buffer");
 	    /* Eventually, use OnFinal for this instead */
 	    rreq->dev.OnDataAvail = rreq->dev.OnFinal;
@@ -364,7 +364,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
                  (last == rreq->dev.segment_size ||
                   (last - rreq->dev.segment_first) / rreq->dev.iov_count >= MPIDI_IOV_DENSITY_MIN))
 	{
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 	     "updating rreq to read more data directly into the user buffer");
 	    rreq->dev.segment_first = last;
 	    rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_ReloadIOV;
@@ -385,7 +385,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 		/* FIXME - we should drain the data off the pipe here, but we 
 		   don't have a buffer to drain it into.  should this be
 		   a fatal error? */
-		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"SRBuf allocation failure");
+		MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"SRBuf allocation failure");
 		mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, 
 			      FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem", 
 			 "**nomem %d", 
@@ -412,7 +412,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 	    /* --BEGIN ERROR HANDLING-- */
 	    if (rreq->dev.tmpbuf_sz == 0)
 	    {
-		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"SRBuf allocation failure");
+		MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"SRBuf allocation failure");
 		mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, 
 			       FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem", 0);
 		rreq->status.MPI_ERROR = mpi_errno;
@@ -423,7 +423,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 
 	if (data_sz <= rreq->dev.tmpbuf_sz)
 	{
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 	    "updating rreq to read overflow data into the SRBuf and complete");
 	    rreq->dev.iov[0].MPL_IOV_LEN = data_sz;
 	    MPIU_Assert(MPIDI_Request_get_type(rreq) == MPIDI_REQUEST_TYPE_RECV);
@@ -433,7 +433,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 	}
 	else
 	{
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 	  "updating rreq to read overflow data into the SRBuf and reload IOV");
 	    rreq->dev.iov[0].MPL_IOV_LEN = rreq->dev.tmpbuf_sz;
 	    rreq->dev.segment_first += rreq->dev.tmpbuf_sz;
@@ -558,7 +558,7 @@ int MPIDI_CH3U_Request_unpack_uebuf(MPID_Request * rreq)
     else
     {
 	/* --BEGIN ERROR HANDLING-- */
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPL_DBG_FDEST,
       "receive buffer overflow; message truncated, msg_sz=" MPIDI_MSG_SZ_FMT 
 	      ", buf_sz=" MPIDI_MSG_SZ_FMT, 
                 rreq->dev.recv_data_sz, userbuf_sz));
@@ -648,7 +648,7 @@ void MPID_Request_release(MPID_Request *req)
 
     MPIR_Request_release_ref(req, &inuse);
     if (inuse == 0) {
-        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
+        MPL_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
                        "freeing request, handle=0x%08x", req->handle);
 
 #ifdef MPICH_DBG_OUTPUT
diff --git a/src/mpid/ch3/src/ch3u_rma_pkthandler.c b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
index 5466d15..1d23568 100644
--- a/src/mpid/ch3/src/ch3u_rma_pkthandler.c
+++ b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
@@ -272,7 +272,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_PUT);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received put pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received put pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_put);
 
@@ -448,7 +448,7 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received get pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received get pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_get);
 
@@ -662,7 +662,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACCUMULATE);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received accumulate pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received accumulate pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_acc);
 
@@ -755,7 +755,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                 MPIDI_CH3U_SRBuf_alloc(req, MPIDI_CH3U_SRBuf_size);
                 /* --BEGIN ERROR HANDLING-- */
                 if (req->dev.tmpbuf_sz == 0) {
-                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
+                    MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
                     mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL,
                                                      FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem",
                                                      "**nomem %d", MPIDI_CH3U_SRBuf_size);
@@ -873,7 +873,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GETACCUMULATE);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received accumulate pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received accumulate pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_get_accum);
 
@@ -1042,7 +1042,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                     MPIDI_CH3U_SRBuf_alloc(req, MPIDI_CH3U_SRBuf_size);
                     /* --BEGIN ERROR HANDLING-- */
                     if (req->dev.tmpbuf_sz == 0) {
-                        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
+                        MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
                         mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL,
                                                          FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem",
                                                          "**nomem %d", MPIDI_CH3U_SRBuf_size);
@@ -1160,7 +1160,7 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_CAS);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received CAS pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received CAS pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_cas);
 
@@ -1270,7 +1270,7 @@ int MPIDI_CH3_PktHandler_CASResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_CASRESP);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received CAS response pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received CAS response pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_cas_resp);
 
@@ -1334,7 +1334,7 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_FOP);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received FOP pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received FOP pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_fop);
 
@@ -1523,7 +1523,7 @@ int MPIDI_CH3_PktHandler_FOPResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_FOPRESP);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received FOP response pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received FOP response pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_fop_resp);
 
@@ -1612,7 +1612,7 @@ int MPIDI_CH3_PktHandler_Get_AccumResp(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET_ACCUM_RESP);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received Get-Accumulate response pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received Get-Accumulate response pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_get_accum_resp);
 
@@ -1745,7 +1745,7 @@ int MPIDI_CH3_PktHandler_Lock(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCK);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received lock pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received lock pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_lock);
 
@@ -1806,7 +1806,7 @@ int MPIDI_CH3_PktHandler_GetResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GETRESP);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received get response pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received get response pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_get_resp);
 
@@ -1887,7 +1887,7 @@ int MPIDI_CH3_PktHandler_LockAck(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKACK);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received lock ack pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received lock ack pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_lock_ack);
 
@@ -1990,7 +1990,7 @@ int MPIDI_CH3_PktHandler_Ack(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACK);
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received shared lock ops done pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received shared lock ops done pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_ack);
 
@@ -2071,7 +2071,7 @@ int MPIDI_CH3_PktHandler_Unlock(MPIDI_VC_t * vc ATTRIBUTE((unused)),
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_UNLOCK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_UNLOCK);
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received unlock pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received unlock pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_unlock);
 
@@ -2114,7 +2114,7 @@ int MPIDI_CH3_PktHandler_Flush(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_FLUSH);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_FLUSH);
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received flush pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received flush pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_flush);
 
@@ -2147,76 +2147,76 @@ int MPIDI_CH3_PktHandler_Flush(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_Put(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_PUT\n");
-    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,TERSE," addr ......... %p\n", pkt->put.addr);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," count ........ %d\n", pkt->put.count);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," datatype ..... 0x%08X\n", pkt->put.datatype));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," dataloop_size. 0x%08X\n", pkt->put.info.dataloop_size));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->put.target_win_handle));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->put.source_win_handle));
-    /*MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->put.win_ptr)); */
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_PUT\n");
+    MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,TERSE," addr ......... %p\n", pkt->put.addr);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," count ........ %d\n", pkt->put.count);
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," datatype ..... 0x%08X\n", pkt->put.datatype));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," dataloop_size. 0x%08X\n", pkt->put.info.dataloop_size));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," target ....... 0x%08X\n", pkt->put.target_win_handle));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," source ....... 0x%08X\n", pkt->put.source_win_handle));
+    /*MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->put.win_ptr)); */
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_Get(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_GET\n");
-    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,TERSE," addr ......... %p\n", pkt->get.addr);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," count ........ %d\n", pkt->get.count);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," datatype ..... 0x%08X\n", pkt->get.datatype));
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," dataloop_size. %d\n", pkt->get.info.dataloop_size);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get.request_handle));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->get.target_win_handle));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->get.source_win_handle));
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_GET\n");
+    MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,TERSE," addr ......... %p\n", pkt->get.addr);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," count ........ %d\n", pkt->get.count);
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," datatype ..... 0x%08X\n", pkt->get.datatype));
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," dataloop_size. %d\n", pkt->get.info.dataloop_size);
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," request ...... 0x%08X\n", pkt->get.request_handle));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," target ....... 0x%08X\n", pkt->get.target_win_handle));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," source ....... 0x%08X\n", pkt->get.source_win_handle));
     /*
-     * MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get.request));
-     * MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->get.win_ptr));
+     * MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," request ...... 0x%08X\n", pkt->get.request));
+     * MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->get.win_ptr));
      */
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_GetResp(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_GET_RESP\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get_resp.request_handle));
-    /*MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get_resp.request)); */
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_GET_RESP\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," request ...... 0x%08X\n", pkt->get_resp.request_handle));
+    /*MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," request ...... 0x%08X\n", pkt->get_resp.request)); */
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_Accumulate(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_ACCUMULATE\n");
-    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,TERSE," addr ......... %p\n", pkt->accum.addr);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," count ........ %d\n", pkt->accum.count);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," datatype ..... 0x%08X\n", pkt->accum.datatype));
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," dataloop_size. %d\n", pkt->accum.info.dataloop_size);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," op ........... 0x%08X\n", pkt->accum.op));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->accum.target_win_handle));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->accum.source_win_handle));
-    /*MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->accum.win_ptr)); */
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_ACCUMULATE\n");
+    MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,TERSE," addr ......... %p\n", pkt->accum.addr);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," count ........ %d\n", pkt->accum.count);
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," datatype ..... 0x%08X\n", pkt->accum.datatype));
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," dataloop_size. %d\n", pkt->accum.info.dataloop_size);
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," op ........... 0x%08X\n", pkt->accum.op));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," target ....... 0x%08X\n", pkt->accum.target_win_handle));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," source ....... 0x%08X\n", pkt->accum.source_win_handle));
+    /*MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->accum.win_ptr)); */
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_Lock(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_LOCK\n");
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," lock_type .... %d\n", pkt->lock.lock_type);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->lock.target_win_handle));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->lock.source_win_handle));
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_LOCK\n");
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," lock_type .... %d\n", pkt->lock.lock_type);
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," target ....... 0x%08X\n", pkt->lock.target_win_handle));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," source ....... 0x%08X\n", pkt->lock.source_win_handle));
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_Ack(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_ACK\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->ack.source_win_handle));
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_ACK\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," source ....... 0x%08X\n", pkt->ack.source_win_handle));
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_LockAck(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_LOCK_ACK\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->lock_ack.source_win_handle));
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_LOCK_ACK\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," source ....... 0x%08X\n", pkt->lock_ack.source_win_handle));
     return MPI_SUCCESS;
 }
 #endif
diff --git a/src/mpid/ch3/src/ch3u_rndv.c b/src/mpid/ch3/src/ch3u_rndv.c
index 142fa65..0410368 100644
--- a/src/mpid/ch3/src/ch3u_rndv.c
+++ b/src/mpid/ch3/src/ch3u_rndv.c
@@ -29,7 +29,7 @@ int MPIDI_CH3_RndvSend( MPID_Request **sreq_p, const void * buf, MPI_Aint count,
     MPID_Request *sreq =*sreq_p;
     int          mpi_errno = MPI_SUCCESS;
 	
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		   "sending rndv RTS, data_sz=" MPIDI_MSG_SZ_FMT, data_sz);
 
     sreq->dev.OnDataAvail = 0;
@@ -48,7 +48,7 @@ int MPIDI_CH3_RndvSend( MPID_Request **sreq_p, const void * buf, MPI_Aint count,
     MPIDI_Pkt_set_seqnum(rts_pkt, seqnum);
     MPIDI_Request_set_seqnum(sreq, seqnum);
 
-    MPIU_DBG_MSGPKT(vc,tag,rts_pkt->match.parts.context_id,rank,data_sz,"Rndv");
+    MPL_DBG_MSGPKT(vc,tag,rts_pkt->match.parts.context_id,rank,data_sz,"Rndv");
 
     MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, rts_pkt, sizeof(*rts_pkt), &rts_sreq);
@@ -115,12 +115,12 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPIDI_CH3_Pkt_rndv_req_to_send_t * rts_pkt = &pkt->rndv_req_to_send;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
  "received rndv 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));
-    MPIU_DBG_MSGPKT(vc,rts_pkt->match.parts.tag,rts_pkt->match.parts.context_id,
+    MPL_DBG_MSGPKT(vc,rts_pkt->match.parts.tag,rts_pkt->match.parts.context_id,
 		    rts_pkt->match.parts.rank,rts_pkt->data_sz,
 		    "ReceivedRndv");
 
@@ -148,12 +148,12 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	MPIDI_CH3_Pkt_t upkt;
 	MPIDI_CH3_Pkt_rndv_clr_to_send_t * cts_pkt = &upkt.rndv_clr_to_send;
 	
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
 	
 	/* FIXME: What if the receive user buffer is not big enough to
 	   hold the data about to be cleared for sending? */
 	
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv CTS packet");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv CTS packet");
 	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;
@@ -170,7 +170,7 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     }
     else
     {
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
 	
 	/*
 	 * A MPID_Probe() may be waiting for the request we just 
@@ -209,10 +209,10 @@ int MPIDI_CH3_PktHandler_RndvClrToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPID_Datatype * dt_ptr;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received rndv CTS pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received rndv CTS pkt");
     
     MPID_Request_get_ptr(cts_pkt->sender_req_id, sreq);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"received cts, count=" MPI_AINT_FMT_DEC_SPEC "\n", sreq->dev.user_count));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"received cts, count=" MPI_AINT_FMT_DEC_SPEC "\n", sreq->dev.user_count));
 
     sreq->dev.OnDataAvail = 0;
     sreq->dev.OnFinal = 0;
@@ -241,7 +241,7 @@ int MPIDI_CH3_PktHandler_RndvClrToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     {
 	MPL_IOV iov[MPL_IOV_LIMIT];
 
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 		    "sending contiguous rndv data, data_sz=" MPIDI_MSG_SZ_FMT, 
 					    data_sz));
 	
@@ -290,7 +290,7 @@ int MPIDI_CH3_PktHandler_RndvSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPIDI_msg_sz_t data_len;
     MPID_Request *req;
     
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received rndv send (data) pkt");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received rndv send (data) pkt");
 
     MPID_Request_get_ptr(rs_pkt->receiver_req_id, req);
 
@@ -352,7 +352,7 @@ int MPIDI_CH3_RecvRndv( MPIDI_VC_t * vc, MPID_Request *rreq )
     MPIDI_CH3_Pkt_t upkt;
     MPIDI_CH3_Pkt_rndv_clr_to_send_t * cts_pkt = &upkt.rndv_clr_to_send;
     
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		 "rndv RTS in the request, sending rndv CTS");
     
     MPIDI_Pkt_init(cts_pkt, MPIDI_CH3_PKT_RNDV_CLR_TO_SEND);
@@ -383,28 +383,28 @@ int MPIDI_CH3_RecvRndv( MPIDI_VC_t * vc, MPID_Request *rreq )
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_RndvReqToSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... REQ_TO_SEND\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->rndv_req_to_send.sender_req_id));
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->rndv_req_to_send.match.parts.context_id);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->rndv_req_to_send.match.parts.tag);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->rndv_req_to_send.match.parts.rank);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->rndv_req_to_send.data_sz);
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... REQ_TO_SEND\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->rndv_req_to_send.sender_req_id));
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->rndv_req_to_send.match.parts.context_id);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->rndv_req_to_send.match.parts.tag);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->rndv_req_to_send.match.parts.rank);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->rndv_req_to_send.data_sz);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->rndv_req_to_send.seqnum);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->rndv_req_to_send.seqnum);
 #endif
     return MPI_SUCCESS;
 }
 int MPIDI_CH3_PktPrint_RndvClrToSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... CLR_TO_SEND\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->rndv_clr_to_send.sender_req_id));
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," recvr_reqid .. 0x%08X\n", pkt->rndv_clr_to_send.receiver_req_id));
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... CLR_TO_SEND\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->rndv_clr_to_send.sender_req_id));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," recvr_reqid .. 0x%08X\n", pkt->rndv_clr_to_send.receiver_req_id));
     return MPI_SUCCESS;
 }
 int MPIDI_CH3_PktPrint_RndvSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... RNDV_SEND\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," recvr_reqid .. 0x%08X\n", pkt->rndv_send.receiver_req_id));
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... RNDV_SEND\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," recvr_reqid .. 0x%08X\n", pkt->rndv_send.receiver_req_id));
     return MPI_SUCCESS;
 }
 #endif
diff --git a/src/mpid/ch3/src/mpid_cancel_recv.c b/src/mpid/ch3/src/mpid_cancel_recv.c
index 11477af..35cf541 100644
--- a/src/mpid/ch3/src/mpid_cancel_recv.c
+++ b/src/mpid/ch3/src/mpid_cancel_recv.c
@@ -36,7 +36,7 @@ int MPID_Cancel_recv(MPID_Request * rreq)
 
     if (netmod_cancelled && MPIDI_CH3U_Recvq_DP(rreq))
     {
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		       "request 0x%08x cancelled", rreq->handle);
         MPIR_STATUS_SET_CANCEL_BIT(rreq->status, TRUE);
         MPIR_STATUS_SET_COUNT(rreq->status, 0);
@@ -47,7 +47,7 @@ int MPID_Cancel_recv(MPID_Request * rreq)
     }
     else
     {
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 	    "request 0x%08x already matched, unable to cancel", rreq->handle);
     }
 
diff --git a/src/mpid/ch3/src/mpid_cancel_send.c b/src/mpid/ch3/src/mpid_cancel_send.c
index 4fa2b22..e70a605 100644
--- a/src/mpid/ch3/src/mpid_cancel_send.c
+++ b/src/mpid/ch3/src/mpid_cancel_send.c
@@ -53,7 +53,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
     {
 	MPID_Request * rreq;
 	
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		     "attempting to cancel message sent to self");
 	
 	MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
@@ -63,7 +63,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
 	{
 	    MPIU_Assert(rreq->partner_request == sreq);
 	    
-	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
              "send-to-self cancellation successful, sreq=0x%08x, rreq=0x%08x",
 						sreq->handle, rreq->handle));
 
@@ -84,7 +84,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
 	else
 	{
 	    MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
-	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                "send-to-self cancellation failed, sreq=0x%08x, rreq=0x%08x",
 						sreq->handle, rreq->handle));
 	}
@@ -174,7 +174,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
 	MPIDI_CH3_Pkt_cancel_send_req_t * const csr_pkt = &upkt.cancel_send_req;
 	MPID_Request * csr_sreq;
 	
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
               "sending cancel request to %d for 0x%08x", 
 	      sreq->dev.match.parts.rank, sreq->handle));
 	
@@ -237,7 +237,7 @@ int MPIDI_CH3_PktHandler_CancelSendReq( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPID_Request * resp_sreq;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
       "received cancel send req pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d",
 		      req_pkt->sender_req_id, req_pkt->match.parts.rank, 
 		      req_pkt->match.parts.tag, req_pkt->match.parts.context_id));
@@ -249,7 +249,7 @@ int MPIDI_CH3_PktHandler_CancelSendReq( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     rreq = MPIDI_CH3U_Recvq_FDU(req_pkt->sender_req_id, &req_pkt->match);
     if (rreq != NULL)
     {
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"message cancelled");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"message cancelled");
 	if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_EAGER_MSG && rreq->dev.recv_data_sz > 0)
 	{
 	    MPIU_Free(rreq->dev.tmpbuf);
@@ -263,7 +263,7 @@ int MPIDI_CH3_PktHandler_CancelSendReq( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     }
     else
     {
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"unable to cancel message");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"unable to cancel message");
 	ack = FALSE;
     }
     
@@ -297,7 +297,7 @@ int MPIDI_CH3_PktHandler_CancelSendResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
     MPID_Request * sreq;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 			"received cancel send resp pkt, sreq=0x%08x, ack=%d",
 			resp_pkt->sender_req_id, resp_pkt->ack));
 	    
@@ -319,12 +319,12 @@ int MPIDI_CH3_PktHandler_CancelSendResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
 	    MPIDI_CH3U_Request_decrement_cc(sreq, &cc);
 	}
 		
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"message cancelled");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"message cancelled");
     }
     else
     {
 	MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"unable to cancel message");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"unable to cancel message");
     }
     
     mpi_errno = MPID_Request_complete(sreq);
@@ -347,20 +347,20 @@ int MPIDI_CH3_PktHandler_CancelSendResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_CancelSendReq( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... CANCEL_SEND\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->cancel_send_req.sender_req_id));
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->cancel_send_req.match.parts.context_id);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->cancel_send_req.match.parts.tag);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->cancel_send_req.match.parts.rank);
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... CANCEL_SEND\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->cancel_send_req.sender_req_id));
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->cancel_send_req.match.parts.context_id);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->cancel_send_req.match.parts.tag);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->cancel_send_req.match.parts.rank);
 
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_CancelSendResp( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... CANCEL_SEND_RESP\n");
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->cancel_send_resp.sender_req_id));
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," ack .......... %d\n", pkt->cancel_send_resp.ack);
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... CANCEL_SEND_RESP\n");
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->cancel_send_resp.sender_req_id));
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," ack .......... %d\n", pkt->cancel_send_resp.ack);
     
     return MPI_SUCCESS;
 }
diff --git a/src/mpid/ch3/src/mpid_comm_revoke.c b/src/mpid/ch3/src/mpid_comm_revoke.c
index 6e9738a..ee7fdc6 100644
--- a/src/mpid/ch3/src/mpid_comm_revoke.c
+++ b/src/mpid/ch3/src/mpid_comm_revoke.c
@@ -41,7 +41,7 @@ int MPID_Comm_revoke(MPID_Comm *comm_ptr, int is_remote)
         /* Start a counter to track how many revoke messages we've received from
          * other ranks */
         comm_ptr->dev.waiting_for_revoke = comm_ptr->local_size - 1 - is_remote; /* Subtract the processes who already know about the revoke */
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPIU_DBG_FDEST, "Comm %08x waiting_for_revoke: %d", comm_ptr->handle, comm_ptr->dev.waiting_for_revoke));
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPL_DBG_FDEST, "Comm %08x waiting_for_revoke: %d", comm_ptr->handle, comm_ptr->dev.waiting_for_revoke));
 
         /* Keep a reference to this comm so it doesn't get destroyed while
          * it's being revoked */
@@ -90,7 +90,7 @@ int MPID_Comm_revoke(MPID_Comm *comm_ptr, int is_remote)
     } 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--;
-        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPIU_DBG_FDEST, "Comm %08x waiting_for_revoke: %d", comm_ptr->handle, comm_ptr->dev.waiting_for_revoke));
+        MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPL_DBG_FDEST, "Comm %08x waiting_for_revoke: %d", comm_ptr->handle, comm_ptr->dev.waiting_for_revoke));
 
         /* Check to see if we are done revoking */
         if (comm_ptr->dev.waiting_for_revoke == 0) {
diff --git a/src/mpid/ch3/src/mpid_imrecv.c b/src/mpid/ch3/src/mpid_imrecv.c
index eca5cba..78e36d9 100644
--- a/src/mpid/ch3/src/mpid_imrecv.c
+++ b/src/mpid/ch3/src/mpid_imrecv.c
@@ -48,7 +48,7 @@ int MPID_Imrecv(void *buf, int count, MPI_Datatype datatype,
         int recv_pending;
 
         /* This is an eager message */
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"eager message in the request");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"eager message in the request");
 
         /* If this is an eager synchronous message, then we need to send an
            acknowledgement back to the sender. */
diff --git a/src/mpid/ch3/src/mpid_init.c b/src/mpid/ch3/src/mpid_init.c
index 942aaaa..58f3afd 100644
--- a/src/mpid/ch3/src/mpid_init.c
+++ b/src/mpid/ch3/src/mpid_init.c
@@ -43,16 +43,16 @@ MPIDI_CH3U_Win_fns_t MPIDI_CH3U_Win_fns = { NULL };
 MPIDI_CH3U_Win_hooks_t MPIDI_CH3U_Win_hooks = { NULL };
 MPIDI_CH3U_Win_pkt_ordering_t MPIDI_CH3U_Win_pkt_orderings = { 0 };
 
-#if defined(USE_DBG_LOGGING)
-MPIU_DBG_Class MPIDI_CH3_DBG_CONNECT;
-MPIU_DBG_Class MPIDI_CH3_DBG_DISCONNECT;
-MPIU_DBG_Class MPIDI_CH3_DBG_PROGRESS;
-MPIU_DBG_Class MPIDI_CH3_DBG_CHANNEL;
-MPIU_DBG_Class MPIDI_CH3_DBG_OTHER;
-MPIU_DBG_Class MPIDI_CH3_DBG_MSG;
-MPIU_DBG_Class MPIDI_CH3_DBG_VC;
-MPIU_DBG_Class MPIDI_CH3_DBG_REFCOUNT;
-#endif /* USE_DBG_LOGGING */
+#if defined(MPL_USE_DBG_LOGGING)
+MPL_DBG_Class MPIDI_CH3_DBG_CONNECT;
+MPL_DBG_Class MPIDI_CH3_DBG_DISCONNECT;
+MPL_DBG_Class MPIDI_CH3_DBG_PROGRESS;
+MPL_DBG_Class MPIDI_CH3_DBG_CHANNEL;
+MPL_DBG_Class MPIDI_CH3_DBG_OTHER;
+MPL_DBG_Class MPIDI_CH3_DBG_MSG;
+MPL_DBG_Class MPIDI_CH3_DBG_VC;
+MPL_DBG_Class MPIDI_CH3_DBG_REFCOUNT;
+#endif /* MPL_USE_DBG_LOGGING */
 
 #undef FUNCNAME
 #define FUNCNAME finalize_failed_procs_group
@@ -189,16 +189,16 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
     MPIDI_CH3_Win_fns_init(&MPIDI_CH3U_Win_fns);
     MPIDI_CH3_Win_hooks_init(&MPIDI_CH3U_Win_hooks);
 
-#ifdef USE_DBG_LOGGING
-    MPIDI_CH3_DBG_CONNECT = MPIU_DBG_Class_alloc("CH3_CONNECT", "ch3_connect");;
-    MPIDI_CH3_DBG_DISCONNECT = MPIU_DBG_Class_alloc("CH3_DISCONNECT", "ch3_disconnect");
-    MPIDI_CH3_DBG_PROGRESS = MPIU_DBG_Class_alloc("CH3_PROGRESS", "ch3_progress");
-    MPIDI_CH3_DBG_CHANNEL = MPIU_DBG_Class_alloc("CH3_CHANNEL", "ch3_channel");
-    MPIDI_CH3_DBG_OTHER = MPIU_DBG_Class_alloc("CH3_OTHER", "ch3_other");
-    MPIDI_CH3_DBG_MSG = MPIU_DBG_Class_alloc("CH3_MSG", "ch3_msg");
-    MPIDI_CH3_DBG_VC = MPIU_DBG_Class_alloc("VC", "vc");
-    MPIDI_CH3_DBG_REFCOUNT = MPIU_DBG_Class_alloc("REFCOUNT", "refcount");
-#endif /* USE_DBG_LOGGING */
+#ifdef MPL_USE_DBG_LOGGING
+    MPIDI_CH3_DBG_CONNECT = MPL_DBG_Class_alloc("CH3_CONNECT", "ch3_connect");;
+    MPIDI_CH3_DBG_DISCONNECT = MPL_DBG_Class_alloc("CH3_DISCONNECT", "ch3_disconnect");
+    MPIDI_CH3_DBG_PROGRESS = MPL_DBG_Class_alloc("CH3_PROGRESS", "ch3_progress");
+    MPIDI_CH3_DBG_CHANNEL = MPL_DBG_Class_alloc("CH3_CHANNEL", "ch3_channel");
+    MPIDI_CH3_DBG_OTHER = MPL_DBG_Class_alloc("CH3_OTHER", "ch3_other");
+    MPIDI_CH3_DBG_MSG = MPL_DBG_Class_alloc("CH3_MSG", "ch3_msg");
+    MPIDI_CH3_DBG_VC = MPL_DBG_Class_alloc("VC", "vc");
+    MPIDI_CH3_DBG_REFCOUNT = MPL_DBG_Class_alloc("REFCOUNT", "refcount");
+#endif /* MPL_USE_DBG_LOGGING */
 
     /*
      * Let the channel perform any necessary initialization
@@ -315,7 +315,7 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, 
 				"**ch3|get_parent_port");
 	}
-	MPIU_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Parent port is %s", parent_port);
+	MPL_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Parent port is %s", parent_port);
 	    
 	mpi_errno = MPID_Comm_connect(parent_port, NULL, 0, 
 				      MPIR_Process.comm_world, &comm);
diff --git a/src/mpid/ch3/src/mpid_irecv.c b/src/mpid/ch3/src/mpid_irecv.c
index 0681eea..0404663 100644
--- a/src/mpid/ch3/src/mpid_irecv.c
+++ b/src/mpid/ch3/src/mpid_irecv.c
@@ -21,7 +21,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_IRECV);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 			"rank=%d, tag=%d, context=%d", 
 			rank, tag, comm->recvcontext_id + context_offset));
 
@@ -35,7 +35,7 @@ int MPID_Irecv(void * buf, MPI_Aint 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_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Comm has been revoked. Returning from MPID_IRECV.");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Comm has been revoked. Returning from MPID_IRECV.");
         MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
@@ -54,7 +54,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 	MPIDI_VC_t * vc;
 	
 	/* Message was found in the unexepected queue */
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request found in unexpected queue");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request found in unexpected queue");
 
 	/* Release the message queue - we've removed this request from 
 	   the queue already */
@@ -65,7 +65,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 	    int recv_pending;
 	    
 	    /* This is an eager message */
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"eager message in the request");
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"eager message in the request");
 	    
 	    /* If this is a eager synchronous message, then we need to send an 
 	       acknowledgement back to the sender. */
@@ -147,7 +147,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 	/* Message has yet to arrived.  The request has been placed on the 
 	   list of posted receive requests and populated with
            information supplied in the arguments. */
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated in posted queue");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated in posted queue");
 	
 	if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN)
 	{
@@ -165,12 +165,12 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 
   fn_exit:
     *request = rreq;
-    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x",
+    MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x",
 		   rreq->handle);
 
  fn_fail:
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"IRECV errno: 0x%08x", mpi_errno);
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"(class: %d)", MPIR_ERR_GET_CLASS(mpi_errno));
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"IRECV errno: 0x%08x", mpi_errno);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"(class: %d)", MPIR_ERR_GET_CLASS(mpi_errno));
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_IRECV);
     return mpi_errno;
 }
diff --git a/src/mpid/ch3/src/mpid_irsend.c b/src/mpid/ch3/src/mpid_irsend.c
index 84eb4ad..aafe788 100644
--- a/src/mpid/ch3/src/mpid_irsend.c
+++ b/src/mpid/ch3/src/mpid_irsend.c
@@ -34,7 +34,7 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_IRSEND);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                 "rank=%d, tag=%d, context=%d", 
                 rank, tag, comm->context_id + context_offset));
 
@@ -86,7 +86,7 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
 
     if (data_sz == 0)
     {
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
 
 	sreq->dev.OnDataAvail = 0;
 	
@@ -147,10 +147,10 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
   fn_exit:
     *request = sreq;
 
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,{
+    MPL_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,{
 	if (sreq != NULL)
 	{
-	    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
+	    MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
 	}
     }
 		  );
diff --git a/src/mpid/ch3/src/mpid_isend.c b/src/mpid/ch3/src/mpid_isend.c
index 6833f2f..12b7a31 100644
--- a/src/mpid/ch3/src/mpid_isend.c
+++ b/src/mpid/ch3/src/mpid_isend.c
@@ -46,7 +46,7 @@ int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_ISEND);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                   "rank=%d, tag=%d, context=%d", 
                   rank, tag, comm->context_id + context_offset));
 
@@ -54,7 +54,7 @@ int MPID_Isend(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_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Communicator revoked. MPID_ISEND returning");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Communicator revoked. MPID_ISEND returning");
         MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
     
@@ -99,7 +99,7 @@ int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
 	MPIDI_Request_set_msg_type(sreq, MPIDI_REQUEST_EAGER_MSG);
 	sreq->dev.OnDataAvail = 0;
 	    
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
 	MPIDI_Pkt_init(eager_pkt, MPIDI_CH3_PKT_EAGER_SEND);
 	eager_pkt->match.parts.rank = comm->rank;
 	eager_pkt->match.parts.tag = tag;
@@ -178,11 +178,11 @@ int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
   fn_exit:
     *request = sreq;
 
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
+    MPL_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
     {
 	if (sreq != NULL)
 	{
-	    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
+	    MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
 	}
     }
 		  );
diff --git a/src/mpid/ch3/src/mpid_issend.c b/src/mpid/ch3/src/mpid_issend.c
index a96d0b6..0bb336f 100644
--- a/src/mpid/ch3/src/mpid_issend.c
+++ b/src/mpid/ch3/src/mpid_issend.c
@@ -33,7 +33,7 @@ int MPID_Issend(const void * buf, int count, MPI_Datatype datatype, int rank, in
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_ISSEND);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                  "rank=%d, tag=%d, context=%d", 
                  rank, tag, comm->context_id + context_offset));
 
@@ -122,10 +122,10 @@ int MPID_Issend(const void * buf, int count, MPI_Datatype datatype, int rank, in
   fn_exit:
     *request = sreq;
     
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
+    MPL_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
     {
 	if (sreq != NULL) {
-	    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
+	    MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 			   "request allocated, handle=0x%08x", sreq->handle);
 	}
     }
diff --git a/src/mpid/ch3/src/mpid_port.c b/src/mpid/ch3/src/mpid_port.c
index e5fa8a0..9c4ea0f 100644
--- a/src/mpid/ch3/src/mpid_port.c
+++ b/src/mpid/ch3/src/mpid_port.c
@@ -310,7 +310,7 @@ static int MPIDI_Open_port(MPID_Info *info_ptr, char *port_name)
        may not use shared memory).  We may need a channel-specific 
        function to create an exportable connection string.  */
     mpi_errno = MPIDI_CH3_Get_business_card(myRank, port_name, len);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPIU_DBG_FDEST, "port_name = %s", port_name));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPL_DBG_FDEST, "port_name = %s", port_name));
 
 fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_OPEN_PORT);
diff --git a/src/mpid/ch3/src/mpid_recv.c b/src/mpid/ch3/src/mpid_recv.c
index 193bb7f..6b3d56b 100644
--- a/src/mpid/ch3/src/mpid_recv.c
+++ b/src/mpid/ch3/src/mpid_recv.c
@@ -28,7 +28,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_RECV);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                       "rank=%d, tag=%d, context=%d", rank, tag,
 		      comm->recvcontext_id + context_offset));
     
@@ -60,7 +60,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 	MPIDI_VC_t * vc;
 
 	/* Message was found in the unexepected queue */
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request found in unexpected queue");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request found in unexpected queue");
 
 	/* Release the message queue - we've removed this request from 
 	   the queue already */
@@ -70,7 +70,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 	    int recv_pending;
 	    
 	    /* This is an eager message. */
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"eager message in the request");
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"eager message in the request");
 
 	    if (MPIDI_Request_get_sync_send_flag(rreq))
 	    {
@@ -163,7 +163,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 	/* Message has yet to arrived.  The request has been placed on the 
 	   list of posted receive requests and populated with
            information supplied in the arguments. */
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated in posted queue");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated in posted queue");
 
 	/* FIXME: We do not need to add a datatype reference if
 	   the request is blocking.  This is currently added because
@@ -185,15 +185,15 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 
   fn_exit:
     *request = rreq;
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
+    MPL_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
     if (rreq)
     {
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		       "request allocated, handle=0x%08x", rreq->handle);
     }
     else
     {
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		     "operation complete, no requests allocated");
     });
 
diff --git a/src/mpid/ch3/src/mpid_rsend.c b/src/mpid/ch3/src/mpid_rsend.c
index cb171a9..933b15a 100644
--- a/src/mpid/ch3/src/mpid_rsend.c
+++ b/src/mpid/ch3/src/mpid_rsend.c
@@ -36,7 +36,7 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_RSEND);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 					"rank=%d, tag=%d, context=%d", 
                               rank, tag, comm->context_id + context_offset));
 
@@ -75,7 +75,7 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
 	MPIDI_CH3_Pkt_t upkt;
 	MPIDI_CH3_Pkt_ready_send_t * const ready_pkt = &upkt.ready_send;
 
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
     
 	MPIDI_Pkt_init(ready_pkt, MPIDI_CH3_PKT_READY_SEND);
 	ready_pkt->match.parts.rank = comm->rank;
@@ -144,15 +144,15 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
   fn_exit:
     *request = sreq;
 
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
+    MPL_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
     {
 	if (mpi_errno == MPI_SUCCESS) {
 	    if (sreq) {
-		MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
+		MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
 	    }
 	    else
 	    {
-		MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"operation complete, no requests allocated");
+		MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"operation complete, no requests allocated");
 	    }
 	}
     }
diff --git a/src/mpid/ch3/src/mpid_send.c b/src/mpid/ch3/src/mpid_send.c
index a693275..a540c01 100644
--- a/src/mpid/ch3/src/mpid_send.c
+++ b/src/mpid/ch3/src/mpid_send.c
@@ -34,7 +34,7 @@ int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEND);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                 "rank=%d, tag=%d, context=%d", 
 		rank, tag, comm->context_id + context_offset));
 
@@ -91,7 +91,7 @@ int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
 	MPIDI_CH3_Pkt_t upkt;
 	MPIDI_CH3_Pkt_eager_send_t * const eager_pkt = &upkt.eager_send;
 
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
 	MPIDI_Pkt_init(eager_pkt, MPIDI_CH3_PKT_EAGER_SEND);
 	eager_pkt->match.parts.rank = comm->rank;
 	eager_pkt->match.parts.tag = tag;
@@ -174,16 +174,16 @@ int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
  fn_exit:
     *request = sreq;
 
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
+    MPL_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
     {
 	if (mpi_errno == MPI_SUCCESS) {
 	    if (sreq) {
-		MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
+		MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 			 "request allocated, handle=0x%08x", sreq->handle);
 	    }
 	    else
 	    {
-		MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
+		MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 			     "operation complete, no requests allocated");
 	    }
 	}
diff --git a/src/mpid/ch3/src/mpid_ssend.c b/src/mpid/ch3/src/mpid_ssend.c
index dded70d..3dd144b 100644
--- a/src/mpid/ch3/src/mpid_ssend.c
+++ b/src/mpid/ch3/src/mpid_ssend.c
@@ -33,7 +33,7 @@ int MPID_Ssend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_SSEND);
 
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
               "rank=%d, tag=%d, context=%d", 
               rank, tag, comm->context_id + context_offset));
 
@@ -120,8 +120,8 @@ int MPID_Ssend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
   fn_exit:
     *request = sreq;
     
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,{if (sreq!=NULL) {
-            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
+    MPL_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,{if (sreq!=NULL) {
+            MPL_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 			   "request allocated, handle=0x%08x", sreq->handle);}});
     
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_SSEND);
diff --git a/src/mpid/ch3/src/mpid_startall.c b/src/mpid/ch3/src/mpid_startall.c
index 12ce84e..b726f6d 100644
--- a/src/mpid/ch3/src/mpid_startall.c
+++ b/src/mpid/ch3/src/mpid_startall.c
@@ -25,7 +25,7 @@
     (sreq_) = MPID_Request_create();				\
     if ((sreq_) == NULL)						\
     {									\
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"send request allocation failed");\
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"send request allocation failed");\
 	(mpi_errno_) = MPIR_ERR_MEMALLOCFAILED;				\
 	FAIL_;								\
     }									\
diff --git a/src/mpid/ch3/src/mpid_vc.c b/src/mpid/ch3/src/mpid_vc.c
index a4092fb..bdb4a28 100644
--- a/src/mpid/ch3/src/mpid_vc.c
+++ b/src/mpid/ch3/src/mpid_vc.c
@@ -135,7 +135,7 @@ int MPIDI_VCRT_Add_ref(struct MPIDI_VCRT *vcrt)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_VCRT_ADD_REF);
     MPIU_Object_add_ref(vcrt);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_REFCOUNT,TYPICAL,(MPIU_DBG_FDEST, "Incr VCRT %p ref count",vcrt));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_REFCOUNT,TYPICAL,(MPL_DBG_FDEST, "Incr VCRT %p ref count",vcrt));
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_VCRT_ADD_REF);
     return MPI_SUCCESS;
 }
@@ -161,7 +161,7 @@ int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt, int isDisconnect )
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_VCRT_RELEASE);
 
     MPIU_Object_release_ref(vcrt, &in_use);
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_REFCOUNT,TYPICAL,(MPIU_DBG_FDEST, "Decr VCRT %p ref count",vcrt));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_REFCOUNT,TYPICAL,(MPL_DBG_FDEST, "Decr VCRT %p ref count",vcrt));
     
     /* If this VC reference table is no longer in use, we can
        decrement the reference count of each of the VCs.  If the
@@ -227,7 +227,7 @@ int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt, int isDisconnect )
                         MPIDI_PG_Destroy(vc->pg);
                     }
 
-		    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+		    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
                             "vc=%p: not sending a close to %d, vc in state %s",
 			     vc, i, MPIDI_VC_GetStateString(vc->state)));
 		}
@@ -287,7 +287,7 @@ int MPIDI_VCR_Dup(MPIDI_VCR orig_vcr, MPIDI_VCR * new_vcr)
     else {
 	MPIDI_VC_add_ref(orig_vcr);
     }
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_REFCOUNT,TYPICAL,(MPIU_DBG_FDEST,"Incr VCR %p ref count",orig_vcr));
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_REFCOUNT,TYPICAL,(MPL_DBG_FDEST,"Incr VCR %p ref count",orig_vcr));
     *new_vcr = orig_vcr;
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_VCR_DUP);
     return MPI_SUCCESS;
@@ -356,7 +356,7 @@ int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
 	}
 	*gpid++ = vc->pg_rank;
 
-        MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPIU_DBG_FDEST,
+        MPL_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPL_DBG_FDEST,
                          "pgid=%d vc->pg_rank=%d",
                          pgid, vc->pg_rank));
     }
@@ -784,7 +784,7 @@ static int parse_mapping(char *map_str, mapping_type_t *type, map_block_t **map,
          Y - number of nodes with size Z
          Z - number of processes assigned to each node
      */
-    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,VERBOSE,"parsing mapping string '%s'", map_str);
+    MPL_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,VERBOSE,"parsing mapping string '%s'", map_str);
 
     if (!strlen(map_str)) {
         /* An empty-string indicates an inability to determine or express the
@@ -1117,12 +1117,12 @@ int MPIDI_Populate_vc_node_ids(MPIDI_PG_t *pg, int our_pg_rank)
                 goto odd_even_cliques;
             }
             else {
-                MPIU_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,TERSE,"did_map==0, unable to populate node ids from mapping=%s",value);
+                MPL_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,TERSE,"did_map==0, unable to populate node ids from mapping=%s",value);
             }
             /* else fall through to O(N^2) PMI_KVS_Gets version */
         }
         else {
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"unable to obtain the 'PMI_process_mapping' PMI key");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"unable to obtain the 'PMI_process_mapping' PMI key");
         }
     }
 
diff --git a/src/mpid/ch3/src/mpidi_isend_self.c b/src/mpid/ch3/src/mpidi_isend_self.c
index 2a13390..5336fa9 100644
--- a/src/mpid/ch3/src/mpidi_isend_self.c
+++ b/src/mpid/ch3/src/mpidi_isend_self.c
@@ -29,7 +29,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
     int found;
     int mpi_errno = MPI_SUCCESS;
 	
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending message to self");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending message to self");
 	
     MPIDI_Request_create_sreq(sreq, mpi_errno, goto fn_exit);
     MPIDI_Request_set_type(sreq, type);
@@ -87,7 +87,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
         /* we found a posted req, which we now own, so we can release the CS */
         MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
+	MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		     "found posted receive request; copying data");
 	    
 	MPIDI_CH3U_Buffer_copy(buf, count, datatype, &sreq->status.MPI_ERROR,
@@ -111,7 +111,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
 	
 	    /* FIXME: Insert code here to buffer small sends in a temporary buffer? */
 
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
           "added receive request to unexpected queue; attaching send request");
 	    if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN)
 	    {
@@ -126,7 +126,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
 	else
 	{
 	    /* --BEGIN ERROR HANDLING-- */
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,
 			 "ready send unable to find matching recv req");
 	    sreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER,
 							  "**rsendnomatch", "**rsendnomatch %d %d", rank, tag);
diff --git a/src/mpid/ch3/src/mpidi_pg.c b/src/mpid/ch3/src/mpidi_pg.c
index 0a00f56..568c4df 100644
--- a/src/mpid/ch3/src/mpidi_pg.c
+++ b/src/mpid/ch3/src/mpidi_pg.c
@@ -291,7 +291,7 @@ int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
             else
                 pg_prev->next = pg->next;
 
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT, VERBOSE, (MPIU_DBG_FDEST, "destroying pg=%p pg->id=%s", pg, (char *)pg->id));
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT, VERBOSE, (MPL_DBG_FDEST, "destroying pg=%p pg->id=%s", pg, (char *)pg->id));
 
             for (i = 0; i < pg->size; ++i) {
                 /* FIXME it would be good if we could make this assertion.
@@ -306,7 +306,7 @@ int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
                       just haven't hit it in the tests yet.  */
                 /*MPIU_Assert(MPIU_Object_get_ref(pg->vct[i]) == 0);*/
 
-                MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT, VERBOSE, (MPIU_DBG_FDEST, "about to free pg->vct=%p which contains vc=%p", pg->vct, &pg->vct[i]));
+                MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT, VERBOSE, (MPL_DBG_FDEST, "about to free pg->vct=%p which contains vc=%p", pg->vct, &pg->vct[i]));
 
                 /* This used to be handled in MPIDI_VCRT_Release, but that was
                    not the right place to do this.  The VC should only be freed
@@ -1021,7 +1021,7 @@ static int connFree( MPIDI_PG_t *pg )
     return MPI_SUCCESS;
 }
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
 /* This is a temporary routine that is used to print out the pg string.
    A better approach may be to convert it into a single (long) string
    with no nulls. */
@@ -1030,8 +1030,8 @@ int MPIDI_PrintConnStr( const char *file, int line,
 {
     int pg_size, i;
 
-    MPIU_DBG_Outevent( file, line, MPIDI_CH3_DBG_CONNECT, 0, "%s", label );
-    MPIU_DBG_Outevent( file, line, MPIDI_CH3_DBG_CONNECT, 0, "%s", str );
+    MPL_DBG_Outevent( file, line, MPIDI_CH3_DBG_CONNECT, 0, "%s", label );
+    MPL_DBG_Outevent( file, line, MPIDI_CH3_DBG_CONNECT, 0, "%s", str );
     
     /* Skip the pg id */
     while (*str) str++; str++;
@@ -1041,7 +1041,7 @@ int MPIDI_PrintConnStr( const char *file, int line,
     while (*str) str++; str++;
 
     for (i=0; i<pg_size; i++) {
-	MPIU_DBG_Outevent( file, line, MPIDI_CH3_DBG_CONNECT, 0, "%s", str );
+	MPL_DBG_Outevent( file, line, MPIDI_CH3_DBG_CONNECT, 0, "%s", str );
 	while (*str) str++;
 	str++;
     }
@@ -1171,7 +1171,7 @@ int MPIDI_PG_Close_VCs( void )
     while (pg) {
 	int i, inuse, n, i_start;
 
-	MPIU_DBG_MSG_S(MPIDI_CH3_DBG_DISCONNECT,VERBOSE,"Closing vcs for pg %s",
+	MPL_DBG_MSG_S(MPIDI_CH3_DBG_DISCONNECT,VERBOSE,"Closing vcs for pg %s",
 		       (char *)pg->id );
 
         /* We want to reduce the chance of having all processes send
@@ -1212,7 +1212,7 @@ int MPIDI_PG_Close_VCs( void )
                 if (vc->state == MPIDI_VC_STATE_INACTIVE)
                     MPIDI_CHANGE_VC_STATE(vc, INACTIVE_CLOSED);
             } else {
-		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT,VERBOSE,(MPIU_DBG_FDEST,
+		MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT,VERBOSE,(MPL_DBG_FDEST,
 		     "vc=%p: not sending a close to %d, vc in state %s", vc,i,
 		     MPIDI_VC_GetStateString(vc->state)));
 	    }
diff --git a/src/mpid/ch3/src/mpidi_printf.c b/src/mpid/ch3/src/mpidi_printf.c
index 9cd2899..99476ef 100644
--- a/src/mpid/ch3/src/mpidi_printf.c
+++ b/src/mpid/ch3/src/mpidi_printf.c
@@ -49,7 +49,7 @@ void MPIDI_err_printf(char *func, char *fmt, ...)
    of packet types (and allowing channels to customize the printing
    of packets). For example, an array of function pointers, indexed by
    packet type, could be used.
-   Also, these routines should not use MPIU_DBG_MSG_* functions, instead they should
+   Also, these routines should not use MPL_DBG_MSG_* functions, instead they should
    us a simple fprintf with a style allowance (so that the style checker
    won't flag the use as a possible problem).
 
@@ -63,7 +63,7 @@ void MPIDI_err_printf(char *func, char *fmt, ...)
 void MPIDI_DBG_Print_packet(MPIDI_CH3_Pkt_t * pkt)
 {
     {
-        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"MPIDI_CH3_Pkt_t:\n");
+        MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"MPIDI_CH3_Pkt_t:\n");
         switch (pkt->type) {
         case MPIDI_CH3_PKT_EAGER_SEND:
             MPIDI_CH3_PktPrint_EagerSend(stdout, pkt);
@@ -120,12 +120,12 @@ void MPIDI_DBG_Print_packet(MPIDI_CH3_Pkt_t * pkt)
             break;
             /*
              * case MPIDI_CH3_PKT_SHARED_LOCK_OPS_DONE:
-             * MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_SHARED_LOCK_OPS_DONE\n");
-             * MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->shared_lock_ops_done.source_win_handle));
+             * MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_SHARED_LOCK_OPS_DONE\n");
+             * MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST," source ....... 0x%08X\n", pkt->shared_lock_ops_done.source_win_handle));
              * break;
              */
         case MPIDI_CH3_PKT_FLOW_CNTL_UPDATE:
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," FLOW_CNTRL_UPDATE\n");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," FLOW_CNTRL_UPDATE\n");
             break;
 
         case MPIDI_CH3_PKT_CLOSE:
@@ -133,41 +133,41 @@ void MPIDI_DBG_Print_packet(MPIDI_CH3_Pkt_t * pkt)
             break;
 
         default:
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," INVALID PACKET\n");
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," unknown type ... %d\n", pkt->type);
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... EAGER_SEND\n");
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->eager_send.sender_req_id));
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   context_id ... %d\n", pkt->eager_send.match.parts.context_id);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   data_sz ...... %d\n", pkt->eager_send.data_sz);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   tag .......... %d\n", pkt->eager_send.match.parts.tag);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   rank ......... %d\n", pkt->eager_send.match.parts.rank);
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," INVALID PACKET\n");
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," unknown type ... %d\n", pkt->type);
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... EAGER_SEND\n");
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->eager_send.sender_req_id));
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   context_id ... %d\n", pkt->eager_send.match.parts.context_id);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   data_sz ...... %d\n", pkt->eager_send.data_sz);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   tag .......... %d\n", pkt->eager_send.match.parts.tag);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   rank ......... %d\n", pkt->eager_send.match.parts.rank);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   seqnum ....... %d\n", pkt->eager_send.seqnum);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   seqnum ....... %d\n", pkt->eager_send.seqnum);
 #endif
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... REQ_TO_SEND\n");
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->rndv_req_to_send.sender_req_id));
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   context_id ... %d\n",
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... REQ_TO_SEND\n");
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->rndv_req_to_send.sender_req_id));
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   context_id ... %d\n",
                            pkt->rndv_req_to_send.match.parts.context_id);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   data_sz ...... %d\n", pkt->rndv_req_to_send.data_sz);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   tag .......... %d\n", pkt->rndv_req_to_send.match.parts.tag);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   rank ......... %d\n", pkt->rndv_req_to_send.match.parts.rank);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   data_sz ...... %d\n", pkt->rndv_req_to_send.data_sz);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   tag .......... %d\n", pkt->rndv_req_to_send.match.parts.tag);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   rank ......... %d\n", pkt->rndv_req_to_send.match.parts.rank);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   seqnum ....... %d\n", pkt->rndv_req_to_send.seqnum);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   seqnum ....... %d\n", pkt->rndv_req_to_send.seqnum);
 #endif
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... CLR_TO_SEND\n");
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->rndv_clr_to_send.sender_req_id));
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   recvr_reqid .. 0x%08X\n", pkt->rndv_clr_to_send.receiver_req_id));
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... RNDV_SEND\n");
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   recvr_reqid .. 0x%08X\n", pkt->rndv_send.receiver_req_id));
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... CANCEL_SEND\n");
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   context_id ... %d\n",
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... CLR_TO_SEND\n");
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->rndv_clr_to_send.sender_req_id));
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"   recvr_reqid .. 0x%08X\n", pkt->rndv_clr_to_send.receiver_req_id));
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... RNDV_SEND\n");
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"   recvr_reqid .. 0x%08X\n", pkt->rndv_send.receiver_req_id));
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... CANCEL_SEND\n");
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   context_id ... %d\n",
                            pkt->cancel_send_req.match.parts.context_id);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   tag .......... %d\n", pkt->cancel_send_req.match.parts.tag);
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   rank ......... %d\n", pkt->cancel_send_req.match.parts.rank);
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->cancel_send_req.sender_req_id));
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... CANCEL_SEND_RESP\n");
-            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->cancel_send_resp.sender_req_id));
-            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   ack .......... %d\n", pkt->cancel_send_resp.ack);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   tag .......... %d\n", pkt->cancel_send_req.match.parts.tag);
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   rank ......... %d\n", pkt->cancel_send_req.match.parts.rank);
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->cancel_send_req.sender_req_id));
+            MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... CANCEL_SEND_RESP\n");
+            MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->cancel_send_resp.sender_req_id));
+            MPL_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   ack .......... %d\n", pkt->cancel_send_resp.ack);
             break;
         }
     }
diff --git a/src/mpid/ch3/util/sock/ch3u_connect_sock.c b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
index a7376e5..518a7c9 100644
--- a/src/mpid/ch3/util/sock/ch3u_connect_sock.c
+++ b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
@@ -104,7 +104,7 @@ int MPIDU_CH3I_SetupListener( MPIDU_Sock_set_t sock_set )
 	return mpi_errno;
     }
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,TYPICAL,
+    MPL_DBG_MSG(MPIDI_CH3_DBG_CONNECT,TYPICAL,
 		 "Setting listener connect state to CONN_STATE_LISTENING");
     MPIDI_CH3I_listener_conn->sock	  = NULL;
     MPIDI_CH3I_listener_conn->vc	  = NULL;
@@ -116,7 +116,7 @@ int MPIDU_CH3I_SetupListener( MPIDU_Sock_set_t sock_set )
 				  &MPIDI_CH3I_listener_port, &sock);
     if (mpi_errno) return mpi_errno;
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Listener port %d",
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Listener port %d",
 		   MPIDI_CH3I_listener_port );
 
     MPIDI_CH3I_listener_conn->sock = sock;
@@ -133,7 +133,7 @@ int MPIDU_CH3I_ShutdownListener( void )
     int mpi_errno;
     MPID_Progress_state progress_state;
 
-    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"Closing listener sock (Post_close)");
+    MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"Closing listener sock (Post_close)");
     mpi_errno = MPIDU_Sock_post_close(MPIDI_CH3I_listener_conn->sock);
     if (mpi_errno != MPI_SUCCESS) {
 	return mpi_errno;
@@ -233,7 +233,7 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
        and the remote process to which the vc will connect). */
     MPIDI_VC_Init(vc, NULL, 0);
 
-    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Connect to root with portstring %s",
+    MPL_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Connect to root with portstring %s",
 		   port_name );
 
     mpi_errno = MPIDU_Sock_get_conninfo_from_bc( port_name, host_description,
@@ -247,7 +247,7 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
 	MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**argstr_port_name_tag");
     }
 
-    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CONNECT,VERBOSE,"port tag %d",port_name_tag);
+    MPL_DBG_MSG_D(MPIDI_CH3_DBG_CONNECT,VERBOSE,"port tag %d",port_name_tag);
 
     mpi_errno = MPIDI_CH3I_Connection_alloc(&conn);
     if (mpi_errno != MPI_SUCCESS) {
@@ -262,7 +262,7 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
        socket for a connection and return the connection.  That will
        keep the socket set out of the general ch3 code, even if this
        is the socket utility functions. */
-    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPL_DBG_FDEST,
 	  "posting connect to host %s, port %d", host_description, port ));
     mpi_errno = MPIDU_Sock_post_connect(MPIDI_CH3I_sock_set, conn, 
 					host_description, port, &conn->sock);
@@ -275,7 +275,7 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
         vcch->conn = conn;
         vcch->state = MPIDI_CH3I_VC_STATE_CONNECTING;
         conn->vc = vc;
-	MPIU_DBG_CONNSTATECHANGE(vc,conn,CONN_STATE_CONNECT_ACCEPT);
+	MPL_DBG_CONNSTATECHANGE(vc,conn,CONN_STATE_CONNECT_ACCEPT);
         conn->state = CONN_STATE_CONNECT_ACCEPT;
         conn->send_active = NULL;
         conn->recv_active = NULL;
@@ -481,7 +481,7 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 	    p = (unsigned char *)(info->h_addr_list[0]);
 	    MPL_snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u", 
 			   p[0], p[1], p[2], p[3] );
-	    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"ifname = %s",ifname );
+	    MPL_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"ifname = %s",ifname );
 	    str_errno = MPIU_Str_add_string_arg( bc_val_p,
 						 val_max_sz_p,
 						 MPIDI_CH3I_IFNAME_KEY,
@@ -502,7 +502,7 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 	    p = (unsigned char *)(ifaddr.ifaddr);
 	    MPL_snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u", 
 			   p[0], p[1], p[2], p[3] );
-	    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"ifname = %s",ifname );
+	    MPL_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"ifname = %s",ifname );
 	    str_errno = MPIU_Str_add_string_arg( bc_val_p,
 						 val_max_sz_p,
 						 MPIDI_CH3I_IFNAME_KEY,
@@ -514,7 +514,7 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 	}
     }
 
-    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,TYPICAL,"business card is %s", bc_orig );
+    MPL_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,TYPICAL,"business card is %s", bc_orig );
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3U_GET_BUSINESS_CARD_SOCK);
@@ -559,7 +559,7 @@ int MPIDI_CH3_Sockconn_handle_accept_event( void )
     }
     
     conn->vc = NULL;
-    MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_LRECV_PKT);
+    MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_LRECV_PKT);
     conn->state = CONN_STATE_OPEN_LRECV_PKT;
     conn->send_active = NULL;
     conn->recv_active = NULL;
@@ -602,7 +602,7 @@ int MPIDI_CH3_Sockconn_handle_connect_event( MPIDI_CH3I_Connection_t *conn,
 	MPIDI_CH3I_Pkt_sc_open_req_t *openpkt = 
 	    (MPIDI_CH3I_Pkt_sc_open_req_t *)&conn->pkt.type;
         if(conn->state == CONN_STATE_CONNECTING){
-	    MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_CSEND);
+	    MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_CSEND);
 	    conn->state = CONN_STATE_OPEN_CSEND;
         }
 	MPIDI_Pkt_init(openpkt, MPIDI_CH3I_PKT_SC_OPEN_REQ);
@@ -619,7 +619,7 @@ int MPIDI_CH3_Sockconn_handle_connect_event( MPIDI_CH3I_Connection_t *conn,
 	    (MPIDI_CH3I_Pkt_sc_conn_accept_t *)&conn->pkt.type;
 
 	MPIU_Assert(conn->state == CONN_STATE_CONNECT_ACCEPT);
-	MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_CSEND);
+	MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_CSEND);
 	conn->state = CONN_STATE_OPEN_CSEND;
 	
 	/* pkt contains port name tag. In memory debugging mode, 
@@ -664,13 +664,13 @@ int MPIDI_CH3_Sockconn_handle_close_event( MPIDI_CH3I_Connection_t * conn )
 		MPIDI_CH3I_VC *vcch = &conn->vc->ch;
 
                 conn->sock = MPIDU_SOCK_INVALID_SOCK;
-                MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_CLOSED);
+                MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_CLOSED);
                 conn->state = CONN_STATE_CLOSED;
 
                 /* Only manipulate vcch if conn was not the loser in a
                    head-to-head resolution.  */
                 if (vcch && vcch->conn == conn) {
-                    MPIU_DBG_VCCHSTATECHANGE(conn->vc,VC_STATE_UNCONNECTED);
+                    MPL_DBG_VCCHSTATECHANGE(conn->vc,VC_STATE_UNCONNECTED);
                     vcch->state = MPIDI_CH3I_VC_STATE_UNCONNECTED;
                     vcch->sock  = MPIDU_SOCK_INVALID_SOCK;
 
@@ -692,7 +692,7 @@ int MPIDI_CH3_Sockconn_handle_close_event( MPIDI_CH3I_Connection_t * conn )
 	}
         else if(conn->state == CONN_STATE_DISCARD) {
         /* post close, so the socket is closed and memmory leaks are avoided */
-            MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"CLosing sock (Post_close)");
+            MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"CLosing sock (Post_close)");
             conn->state = CONN_STATE_CLOSING;
             mpi_errno = MPIDU_Sock_post_close(conn->sock);
             if (mpi_errno != MPI_SUCCESS) {
@@ -739,7 +739,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 	/* Answer to fixme: it appears from the control flow that this is
 	   the required state) */
 	MPIU_Assert( conn->state == CONN_STATE_OPEN_LRECV_PKT);
-	MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_LRECV_DATA);
+	MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_LRECV_DATA);
 	conn->state = CONN_STATE_OPEN_LRECV_DATA;
 	mpi_errno = MPIDU_Sock_post_read(conn->sock, conn->pg_id, 
 					 openpkt->pg_id_len, 
@@ -770,7 +770,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 	MPIDI_VC_Init(vc, NULL, 0);
 
 	vcch = &vc->ch;
-	MPIU_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
+	MPL_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
 	vcch->state = MPIDI_CH3I_VC_STATE_CONNECTING;
 	vcch->sock = conn->sock;
 	vcch->conn = conn;
@@ -781,7 +781,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 	openresp->ack = TRUE;
 	
 	/* FIXME: Possible ambiguous state (two ways to get to OPEN_LSEND) */
-	MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_LSEND);
+	MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_LSEND);
 	conn->state = CONN_STATE_OPEN_LSEND;
 	mpi_errno = connection_post_send_pkt(conn);
 	if (mpi_errno != MPI_SUCCESS) {
@@ -801,7 +801,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 	if (openpkt->ack && conn->state != CONN_STATE_DISCARD) {
 	    MPIU_Assert( conn->state == CONN_STATE_OPEN_CRECV );
 	    MPIDI_CH3I_VC *vcch = &conn->vc->ch;
-	    MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_CONNECTED);
+	    MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_CONNECTED);
 	    conn->state = CONN_STATE_CONNECTED;
 	    vcch->state = MPIDI_CH3I_VC_STATE_CONNECTED;
 	    MPIU_Assert(vcch->conn == conn);
@@ -837,7 +837,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
 	       connection is being rejected in favor of the connection
 	       from the other side. */
 	    if (vcch->conn == conn) vcch->conn = NULL;
-	    MPIU_DBG_CONNSTATECHANGE_MSG(conn->vc,conn,CONN_STATE_CLOSING,
+	    MPL_DBG_CONNSTATECHANGE_MSG(conn->vc,conn,CONN_STATE_CLOSING,
 					"because ack on OPEN_CRECV was false");
 	    conn->vc = NULL;
 	    conn->state = CONN_STATE_CLOSING;
@@ -847,7 +847,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
                no longer needed and should be closed. This is initiated with the post
                close command. This also caused that the socket is removed from the
                socket set, so no more polling on this socket*/
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"CLosing sock (Post_close)");
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"CLosing sock (Post_close)");
 	    mpi_errno = MPIDU_Sock_post_close(conn->sock);
 	    if (mpi_errno != MPI_SUCCESS) {
 		MPIR_ERR_POP(mpi_errno);
@@ -856,7 +856,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
     }
     /* --BEGIN ERROR HANDLING-- */
     else {
-	MPIU_DBG_STMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,MPIDI_DBG_Print_packet(&conn->pkt));
+	MPL_DBG_STMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,MPIDI_DBG_Print_packet(&conn->pkt));
 	mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, FCNAME, __LINE__, MPI_ERR_INTERN,
 					 "**ch3|sock|badpacket", "**ch3|sock|badpacket %d", conn->pkt.type);
 	goto fn_fail;
@@ -907,7 +907,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
     if(pg->finalize == 1) {
         MPIDI_Pkt_init(openresp, MPIDI_CH3I_PKT_SC_OPEN_RESP);
         openresp->ack = FALSE;
-        MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_LSEND);
+        MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_LSEND);
         conn->state = CONN_STATE_OPEN_LSEND;
         mpi_errno = connection_post_send_pkt(conn);
         if (mpi_errno != MPI_SUCCESS) {
@@ -919,7 +919,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
     vcch = &vc->ch;
     if (vcch->conn == NULL) {
 	/* no head-to-head connects, accept the connection */
-	MPIU_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
+	MPL_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
 	vcch->state = MPIDI_CH3I_VC_STATE_CONNECTING;
 	vcch->sock = conn->sock;
 	vcch->conn = conn;
@@ -934,16 +934,16 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
 	    /* the other process is in the same comm_world; just compare the 
 	       ranks */
 	    if (MPIR_Process.comm_world->rank < pg_rank) {
-		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
+		MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPL_DBG_FDEST,
                 "vc=%p,conn=%p:Accept head-to-head connection (my process group), discarding vcch->conn=%p",vc,conn, vcch->conn));
 
                 /* mark old connection */
                 MPIDI_CH3I_Connection_t *old_conn = vcch->conn;
-                MPIU_DBG_CONNSTATECHANGE(old_conn,old_conn,CONN_STATE_DISCARD);
+                MPL_DBG_CONNSTATECHANGE(old_conn,old_conn,CONN_STATE_DISCARD);
                 old_conn->state = CONN_STATE_DISCARD;
 
 		/* accept connection */
-		MPIU_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
+		MPL_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
 		vcch->state = MPIDI_CH3I_VC_STATE_CONNECTING;
 		vcch->sock = conn->sock;
 		vcch->conn = conn;
@@ -954,7 +954,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
 	    }
 	    else {
 		/* refuse connection */
-		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
+		MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPL_DBG_FDEST,
                 "vc=%p,conn=%p:Refuse head-to-head connection (my process group)",vc,conn));
 		MPIDI_Pkt_init(openresp, MPIDI_CH3I_PKT_SC_OPEN_RESP);
 		openresp->ack = FALSE;
@@ -964,14 +964,14 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
 	    /* the two processes are in different comm_worlds; compare their 
 	       unique pg_ids. */
 	    if (strcmp(MPIDI_Process.my_pg->id, pg->id) < 0) {
-		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
+		MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPL_DBG_FDEST,
                 "vc=%p,conn=%p:Accept head-to-head connection (two process groups), discarding vcch->conn=%p",vc,conn, vcch->conn));
                 /* mark old connection */
                 MPIDI_CH3I_Connection_t *old_conn = vcch->conn;
-                MPIU_DBG_CONNSTATECHANGE(old_conn,old_conn,CONN_STATE_DISCARD);
+                MPL_DBG_CONNSTATECHANGE(old_conn,old_conn,CONN_STATE_DISCARD);
                 old_conn->state = CONN_STATE_DISCARD;
 		/* accept connection */
-		MPIU_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
+		MPL_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
 		vcch->state = MPIDI_CH3I_VC_STATE_CONNECTING;
 		vcch->sock = conn->sock;
 		vcch->conn = conn;
@@ -982,7 +982,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
 	    }
 	    else {
 		/* refuse connection */
-		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
+		MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPL_DBG_FDEST,
 			"vc=%p,conn=%p:Refuse head-to-head connection (two process groups)",vc,conn));
 		MPIDI_Pkt_init(openresp, MPIDI_CH3I_PKT_SC_OPEN_RESP);
 		openresp->ack = FALSE;
@@ -990,7 +990,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
 	}
     }
     
-    MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_LSEND);
+    MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_LSEND);
     conn->state = CONN_STATE_OPEN_LSEND;
     mpi_errno = connection_post_send_pkt(conn);
     if (mpi_errno != MPI_SUCCESS) {
@@ -1021,7 +1021,7 @@ int MPIDI_CH3_Sockconn_handle_connwrite( MPIDI_CH3I_Connection_t * conn )
 	/* finished sending open request packet */
 	/* post receive for open response packet */
         if(conn->state == CONN_STATE_OPEN_CSEND){
-            MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_CRECV);
+            MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_CRECV);
             conn->state = CONN_STATE_OPEN_CRECV;
         }
 	mpi_errno = connection_post_recv_pkt(conn);
@@ -1036,9 +1036,9 @@ int MPIDI_CH3_Sockconn_handle_connwrite( MPIDI_CH3I_Connection_t * conn )
 	if (openresp->ack == TRUE) {
 	    MPIDI_CH3I_VC *vcch = &conn->vc->ch;
 	    /* post receive for packet header */
-	    MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_CONNECTED);
+	    MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_CONNECTED);
 	    conn->state = CONN_STATE_CONNECTED;
-	    MPIU_DBG_VCCHSTATECHANGE(conn->vc,VC_STATE_CONNECTED);
+	    MPL_DBG_VCCHSTATECHANGE(conn->vc,VC_STATE_CONNECTED);
 	    vcch->state = MPIDI_CH3I_VC_STATE_CONNECTED;
 	    mpi_errno = connection_post_recv_pkt(conn);
 	    if (mpi_errno != MPI_SUCCESS) {
@@ -1053,7 +1053,7 @@ int MPIDI_CH3_Sockconn_handle_connwrite( MPIDI_CH3I_Connection_t * conn )
 	}
 	else {
 	    /* head-to-head connections - close this connection */
-	    MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_CLOSING);
+	    MPL_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_CLOSING);
 	    /* FIXME: the connect side of this sets conn->vc to NULL. Why is
 	       this different? The code that checks CONN_STATE_CLOSING uses
 	       conn == NULL to identify intentional close, which this 
@@ -1063,7 +1063,7 @@ int MPIDI_CH3_Sockconn_handle_connwrite( MPIDI_CH3I_Connection_t * conn )
             /* zero out the vc to prevent trouble in _handle_close_event */
             conn->vc = NULL;
 
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"Closing sock2 (Post_close)");
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"Closing sock2 (Post_close)");
 	    mpi_errno = MPIDU_Sock_post_close(conn->sock);
 	    if (mpi_errno != MPI_SUCCESS) {
 		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
@@ -1099,12 +1099,12 @@ int MPIDI_CH3I_VC_post_sockconnect(MPIDI_VC_t * vc)
      * obtain the ConnString by setting the VC to *CONNECTING.
      */
     if(vcch->state == MPIDI_CH3I_VC_STATE_UNCONNECTED){ 
-    	MPIU_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
+        MPL_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
     	vcch->state = MPIDI_CH3I_VC_STATE_CONNECTING;
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"vc=(%p) Going ahead to obtain connstring", vc);
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"vc=(%p) Going ahead to obtain connstring", vc);
     }else{
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"MT: vc=(%p) is already connecting/ed", vc);
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Aborting posting a connect");
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"MT: vc=(%p) is already connecting/ed", vc);
+	MPL_DBG_MSG(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Aborting posting a connect");
 	/*************** MT *****************/
 	/* There are 3 cases here,
          * 1) Another thread posted a connect while the current thread
@@ -1168,10 +1168,10 @@ int MPIDI_CH3I_Sock_connect( MPIDI_VC_t *vc, const char val[], int vallen )
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SOCK_CONNECT);
     
     if(vcch->state == MPIDI_CH3I_VC_STATE_CONNECTING){ 
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Posting a connect for vc=(%p)", vc);
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Posting a connect for vc=(%p)", vc);
     }else{
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"MT: vc=(%p) is already connected", vc);
-	MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Aborting posting a connect");
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"MT: vc=(%p) is already connected", vc);
+	MPL_DBG_MSG(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Aborting posting a connect");
 	/*************** MT *****************/
         /* 1) Another thread received a connect from the same proc
          *    the current thread is connecting to and opened a 
@@ -1218,7 +1218,7 @@ int MPIDI_CH3I_Sock_connect( MPIDI_VC_t *vc, const char val[], int vallen )
 	}
 	if (mpi_errno == MPI_SUCCESS)
 	{
-	    MPIU_DBG_CONNSTATECHANGE(vc,conn,CONN_STATE_CONNECTING);
+	    MPL_DBG_CONNSTATECHANGE(vc,conn,CONN_STATE_CONNECTING);
 	    vcch->sock = conn->sock;
 	    vcch->conn = conn;
 	    conn->vc = vc;
@@ -1229,7 +1229,7 @@ int MPIDI_CH3I_Sock_connect( MPIDI_VC_t *vc, const char val[], int vallen )
 	/* --BEGIN ERROR HANDLING-- */
 	else
 	{
-	    MPIU_DBG_VCCHSTATECHANGE(vc,VC_STATE_FAILED);
+	    MPL_DBG_VCCHSTATECHANGE(vc,VC_STATE_FAILED);
 	    vcch->state = MPIDI_CH3I_VC_STATE_FAILED;
 	    mpi_errno = MPIR_Err_create_code(mpi_errno, MPIR_ERR_FATAL, FCNAME, __LINE__, MPI_ERR_OTHER, "**ch3|sock|postconnect",
 		"**ch3|sock|postconnect %d %d %s", MPIR_Process.comm_world->rank, vc->pg_rank, val);
@@ -1292,7 +1292,7 @@ static int connection_post_send_pkt(MPIDI_CH3I_Connection_t * conn)
 
     MPIDI_FUNC_ENTER(MPID_STATE_CONNECTION_POST_SEND_PKT);
  
-    MPIU_DBG_PKT(conn,&conn->pkt,"connect");
+    MPL_DBG_PKT(conn,&conn->pkt,"connect");
     mpi_errno = MPIDU_Sock_post_write(conn->sock, &conn->pkt, sizeof(conn->pkt),
 				      sizeof(conn->pkt), NULL);
     if (mpi_errno != MPI_SUCCESS) {
@@ -1321,7 +1321,7 @@ static int connection_post_send_pkt_and_pgid(MPIDI_CH3I_Connection_t * conn)
     conn->iov[1].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) MPIDI_Process.my_pg->id;
     conn->iov[1].MPL_IOV_LEN = (int) strlen(MPIDI_Process.my_pg->id) + 1;
 
-    MPIU_DBG_PKT(conn,&conn->pkt,"connect-pgid");
+    MPL_DBG_PKT(conn,&conn->pkt,"connect-pgid");
     mpi_errno = MPIDU_Sock_post_writev(conn->sock, conn->iov, 2, NULL);
     if (mpi_errno != MPI_SUCCESS) {
 	MPIR_ERR_POP(mpi_errno);
@@ -1349,7 +1349,7 @@ static int connection_post_sendq_req(MPIDI_CH3I_Connection_t * conn)
     conn->send_active = MPIDI_CH3I_SendQ_head(vcch); /* MT */
     if (conn->send_active != NULL)
     {
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"conn=%p: Posting message from connection send queue", conn );
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_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, 
@@ -1386,7 +1386,7 @@ static void connection_destroy(MPIDI_CH3I_Connection_t * conn)
 }
 
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
 const char * MPIDI_CH3_VC_SockGetStateString( struct MPIDI_VC *vc )
 {
     const char *name = "unknown";
diff --git a/src/mpid/ch3/util/sock/ch3u_init_sock.c b/src/mpid/ch3/util/sock/ch3u_init_sock.c
index f0bbbc1..85e39ef 100644
--- a/src/mpid/ch3/util/sock/ch3u_init_sock.c
+++ b/src/mpid/ch3/util/sock/ch3u_init_sock.c
@@ -101,7 +101,7 @@ int MPIDI_VC_InitSock( MPIDI_VC_t *vc )
     return 0;
 }
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
 const char * MPIDI_Conn_GetStateString(int state) 
 {
     const char *name = "unknown";
diff --git a/src/mpid/ch3/util/sock/ch3usock.h b/src/mpid/ch3/util/sock/ch3usock.h
index e29bb2f..edc1c26 100644
--- a/src/mpid/ch3/util/sock/ch3usock.h
+++ b/src/mpid/ch3/util/sock/ch3usock.h
@@ -61,7 +61,7 @@ void MPIDI_CH3I_Connection_free(MPIDI_CH3I_Connection_t *);
 int MPIDU_CH3U_GetSockInterfaceAddr( int, char *, int, MPIDU_Sock_ifaddr_t * );
 
 /* Return a string for the connection state */
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
 const char * MPIDI_Conn_GetStateString(int);
 const char * MPIDI_CH3_VC_GetStateString( struct MPIDI_VC * );
 #endif
diff --git a/src/mpid/ch3/util/sock/findinterfaces.c b/src/mpid/ch3/util/sock/findinterfaces.c
index 1f7a4e8..a4ace46 100644
--- a/src/mpid/ch3/util/sock/findinterfaces.c
+++ b/src/mpid/ch3/util/sock/findinterfaces.c
@@ -37,7 +37,7 @@ static int GetLocalIPs(int32_t *pIP, int max)
 	b = ((unsigned char *)(&pIP[n]))[1];
 	c = ((unsigned char *)(&pIP[n]))[2];
 	d = ((unsigned char *)(&pIP[n]))[3];
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"ip: %u.%u.%u.%u\n", a, b, c, d));
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"ip: %u.%u.%u.%u\n", a, b, c, d));
 	}*/
 
 	hlist++;
diff --git a/src/mpid/ch3/util/unordered/unordered.c b/src/mpid/ch3/util/unordered/unordered.c
index d915a55..d42ab0a 100644
--- a/src/mpid/ch3/util/unordered/unordered.c
+++ b/src/mpid/ch3/util/unordered/unordered.c
@@ -47,13 +47,13 @@ int MPIDI_CH3U_Handle_unordered_recv_pkt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t * pkt,
 	    MPIDI_CH3_Pkt_send_container_t * pc_cur;
 	    MPIDI_CH3_Pkt_send_container_t * pc_last;
 	    
-	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
+	    MPL_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 			 "received (potentially) out-of-order send pkt");
-	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
 	          "rank=%d, tag=%d, context=%d seqnum=%d",
 		  send_pkt->match.rank, send_pkt->match.tag, 
 		  send_pkt->match.context_id, send_pkt->seqnum));
-	    MPIU_DBG_MSG_FMAT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPL_DBG_MSG_FMAT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPL_DBG_FDEST,
               "vc - seqnum_send=%d seqnum_recv=%d reorder_msg_queue=0x%08lx",
 	      vc->seqnum_send, vc->seqnum_recv, 
 	      (unsigned long) vc->msg_reorder_queue));
diff --git a/src/mpid/common/datatype/dataloop/dataloop.c b/src/mpid/common/datatype/dataloop/dataloop.c
index 8e0f9c0..420c0f5 100644
--- a/src/mpid/common/datatype/dataloop/dataloop.c
+++ b/src/mpid/common/datatype/dataloop/dataloop.c
@@ -63,7 +63,7 @@ void PREPEND_PREFIX(Dataloop_free)(DLOOP_Dataloop **dataloop)
     if (*dataloop == NULL) return;
 
 #ifdef DLOOP_DEBUG_MEMORY
-    MPIU_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE,"DLOOP_Dataloop_free: freeing loop @ %x.\n",
+    MPL_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE,"DLOOP_Dataloop_free: freeing loop @ %x.\n",
                    (int) *dataloop);
 #endif
 
@@ -102,7 +102,7 @@ void PREPEND_PREFIX(Dataloop_copy)(void *dest,
     DLOOP_Offset ptrdiff;
 
 #ifdef DLOOP_DEBUG_MEMORY
-    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Dataloop_copy: copying from %x to %x (%z bytes).\n",
+    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"DLOOP_Dataloop_copy: copying from %x to %x (%z bytes).\n",
                                        (int) src, (int) dest, (size_t)size));
 #endif
 
@@ -386,7 +386,7 @@ void PREPEND_PREFIX(Dataloop_alloc_and_copy)(int kind,
     }
 
 #ifdef DLOOP_DEBUG_MEMORY
-    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Dataloop_alloc_and_copy: new loop @ %x (tot sz = %z, loop = %z, off = %z, blk = %z, ptr = %z, extent = %z, old = %z)\n",
+    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"DLOOP_Dataloop_alloc_and_copy: new loop @ %x (tot sz = %z, loop = %z, off = %z, blk = %z, ptr = %z, extent = %z, old = %z)\n",
 		     (int) new_loop,
 		     new_loop_sz,
 		     loop_sz,
@@ -567,7 +567,7 @@ void PREPEND_PREFIX(Dataloop_struct_alloc)(DLOOP_Count count,
     }
 
 #ifdef DLOOP_DEBUG_MEMORY
-    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Dataloop_struct_alloc: new loop @ %x (tot sz = %z, loop = %z, off = %z, blk = %z, ptr = %z, extent = %z, basics = %z, old = %z)\n",
+    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"DLOOP_Dataloop_struct_alloc: new loop @ %x (tot sz = %z, loop = %z, off = %z, blk = %z, ptr = %z, extent = %z, basics = %z, old = %z)\n",
 		     (int) new_loop,
 		     new_loop_sz,
 		     loop_sz,
@@ -656,7 +656,7 @@ PREPEND_PREFIX(Dataloop_stream_size)(struct DLOOP_Dataloop *dl_p,
         case DLOOP_KIND_CONTIG:
             tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.c_t.count);
 #ifdef DLOOP_DEBUG_SIZE
-            MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: contig: ct = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+            MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"stream_size: contig: ct = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                                                (int) dl_p->loop_params.c_t.count, (DLOOP_Offset) tmp_ct));
 #endif
             break;
@@ -664,7 +664,7 @@ PREPEND_PREFIX(Dataloop_stream_size)(struct DLOOP_Dataloop *dl_p,
             tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.v_t.count) *
 		      (DLOOP_Offset)(dl_p->loop_params.v_t.blocksize);
 #ifdef DLOOP_DEBUG_SIZE
-            MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: vector: ct = %d; blk = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+            MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"stream_size: vector: ct = %d; blk = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                              (int) dl_p->loop_params.v_t.count,
                              (int) dl_p->loop_params.v_t.blocksize,
                              (DLOOP_Offset) tmp_ct));
@@ -674,7 +674,7 @@ PREPEND_PREFIX(Dataloop_stream_size)(struct DLOOP_Dataloop *dl_p,
             tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.bi_t.count) *
 		      (DLOOP_Offset)(dl_p->loop_params.bi_t.blocksize);
 #ifdef DLOOP_DEBUG_SIZE
-            MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: blkindexed: blks = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+            MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"stream_size: blkindexed: blks = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                              (int) dl_p->loop_params.bi_t.count *
                              (int) dl_p->loop_params.bi_t.blocksize,
                              (DLOOP_Offset) tmp_ct));
@@ -683,7 +683,7 @@ PREPEND_PREFIX(Dataloop_stream_size)(struct DLOOP_Dataloop *dl_p,
         case DLOOP_KIND_INDEXED:
             tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.i_t.total_blocks);
 #ifdef DLOOP_DEBUG_SIZE
-            MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: contig: blks = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+            MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"stream_size: contig: blks = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                              (int) dl_p->loop_params.i_t.total_blocks,
                              (DLOOP_Offset) tmp_ct));
 #endif
@@ -724,22 +724,22 @@ void PREPEND_PREFIX(Dataloop_print)(struct DLOOP_Dataloop *dataloop,
 
     if (dataloop == NULL)
     {
-        MPIU_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"dataloop is NULL (probably basic type)\n");
+        MPL_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"dataloop is NULL (probably basic type)\n");
         return;
     }
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"loc=%p, treedepth=%d, kind=%d, el_extent=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"loc=%p, treedepth=%d, kind=%d, el_extent=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                                        dataloop, (int) depth, (int) dataloop->kind, (DLOOP_Offset) dataloop->el_extent));
     switch(dataloop->kind & DLOOP_KIND_MASK) {
 	case DLOOP_KIND_CONTIG:
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tCONTIG: count=%d, datatype=%p\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\tCONTIG: count=%d, datatype=%p\n",
 			     (int) dataloop->loop_params.c_t.count,
                              dataloop->loop_params.c_t.dataloop));
 	    if (!(dataloop->kind & DLOOP_FINAL_MASK))
 		PREPEND_PREFIX(Dataloop_print)(dataloop->loop_params.c_t.dataloop, depth+1);
 	    break;
 	case DLOOP_KIND_VECTOR:
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tVECTOR: count=%d, blksz=%d, stride=" DLOOP_OFFSET_FMT_DEC_SPEC ", datatype=%p\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\tVECTOR: count=%d, blksz=%d, stride=" DLOOP_OFFSET_FMT_DEC_SPEC ", datatype=%p\n",
 			     (int) dataloop->loop_params.v_t.count,
 			     (int) dataloop->loop_params.v_t.blocksize,
 			     (DLOOP_Offset) dataloop->loop_params.v_t.stride,
@@ -748,7 +748,7 @@ void PREPEND_PREFIX(Dataloop_print)(struct DLOOP_Dataloop *dataloop,
 		PREPEND_PREFIX(Dataloop_print)(dataloop->loop_params.v_t.dataloop, depth+1);
 	    break;
 	case DLOOP_KIND_BLOCKINDEXED:
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tBLOCKINDEXED: count=%d, blksz=%d, datatype=%p\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\tBLOCKINDEXED: count=%d, blksz=%d, datatype=%p\n",
 			     (int) dataloop->loop_params.bi_t.count,
 			     (int) dataloop->loop_params.bi_t.blocksize,
                              dataloop->loop_params.bi_t.dataloop));
@@ -757,7 +757,7 @@ void PREPEND_PREFIX(Dataloop_print)(struct DLOOP_Dataloop *dataloop,
 		PREPEND_PREFIX(Dataloop_print)(dataloop->loop_params.bi_t.dataloop, depth+1);
 	    break;
 	case DLOOP_KIND_INDEXED:
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tINDEXED: count=%d, datatype=%p\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\tINDEXED: count=%d, datatype=%p\n",
 			     (int) dataloop->loop_params.i_t.count,
                              dataloop->loop_params.i_t.dataloop));
 	    /* print out blocksizes and offsets later */
@@ -765,16 +765,16 @@ void PREPEND_PREFIX(Dataloop_print)(struct DLOOP_Dataloop *dataloop,
 		PREPEND_PREFIX(Dataloop_print)(dataloop->loop_params.i_t.dataloop, depth+1);
 	    break;
 	case DLOOP_KIND_STRUCT:
-	    MPIU_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE,"\tSTRUCT: count=%d\n", (int) dataloop->loop_params.s_t.count);
-	    MPIU_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"\tblocksizes:\n");
+	    MPL_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE,"\tSTRUCT: count=%d\n", (int) dataloop->loop_params.s_t.count);
+	    MPL_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"\tblocksizes:\n");
 	    for (i=0; i < dataloop->loop_params.s_t.count; i++)
-		MPIU_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE,"\t\t%d\n", (int) dataloop->loop_params.s_t.blocksize_array[i]);
-	    MPIU_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"\toffsets:\n");
+		MPL_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE,"\t\t%d\n", (int) dataloop->loop_params.s_t.blocksize_array[i]);
+	    MPL_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"\toffsets:\n");
 	    for (i=0; i < dataloop->loop_params.s_t.count; i++)
-		MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t\t" DLOOP_OFFSET_FMT_DEC_SPEC "\n", (DLOOP_Offset) dataloop->loop_params.s_t.offset_array[i]));
-	    MPIU_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"\tdatatypes:\n");
+		MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\t\t" DLOOP_OFFSET_FMT_DEC_SPEC "\n", (DLOOP_Offset) dataloop->loop_params.s_t.offset_array[i]));
+	    MPL_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"\tdatatypes:\n");
 	    for (i=0; i < dataloop->loop_params.s_t.count; i++)
-		MPIU_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"\t\t%p\n", dataloop->loop_params.s_t.dataloop_array[i]);
+		MPL_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"\t\t%p\n", dataloop->loop_params.s_t.dataloop_array[i]);
 	    if (dataloop->kind & DLOOP_FINAL_MASK) break;
 
 	    for (i=0; i < dataloop->loop_params.s_t.count; i++) {
diff --git a/src/mpid/common/datatype/dataloop/dataloop_create_struct.c b/src/mpid/common/datatype/dataloop/dataloop_create_struct.c
index d240f11..b0bc1aa 100644
--- a/src/mpid/common/datatype/dataloop/dataloop_create_struct.c
+++ b/src/mpid/common/datatype/dataloop/dataloop_create_struct.c
@@ -684,14 +684,14 @@ static int DLOOP_Dataloop_create_flattened_struct(DLOOP_Count count,
     nr_blks = first_ind;
 
 #if 0
-    if (MPIU_DBG_SELECTED(MPIR_DBG_DATATYPE,VERBOSE)) {
-	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"--- start of flattened type ---");
+    if (MPL_DBG_SELECTED(MPIR_DBG_DATATYPE,VERBOSE)) {
+	MPL_DBG_OUT(MPIR_DBG_DATATYPE,"--- start of flattened type ---");
         for (i=0; i < nr_blks; i++) {
-	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 				   "a[%d] = (%d, " DLOOP_OFFSET_FMT_DEC_SPEC ")", i,
 				   tmp_blklens[i], tmp_disps[i]));
 	}
-	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"--- end of flattened type ---");
+	MPL_DBG_OUT(MPIR_DBG_DATATYPE,"--- end of flattened type ---");
     }
 #endif
 
diff --git a/src/mpid/common/datatype/dataloop/segment.c b/src/mpid/common/datatype/dataloop/segment.c
index 2f804e7..bb93f24 100644
--- a/src/mpid/common/datatype/dataloop/segment.c
+++ b/src/mpid/common/datatype/dataloop/segment.c
@@ -64,7 +64,7 @@ int PREPEND_PREFIX(Segment_init)(const DLOOP_Buffer buf,
 		 flag == DLOOP_DATALOOP_ALL_BYTES);
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Segment_init: count = %d, buf = %x\n",
+    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"DLOOP_Segment_init: count = %d, buf = %x\n",
 		    count, buf));
 #endif
 
@@ -371,14 +371,14 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 
     if (first == *lastp) {
 	/* nothing to do */
-	MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"dloop_segment_manipulate: warning: first == last (" DLOOP_OFFSET_FMT_DEC_SPEC ")\n", first));
+	MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"dloop_segment_manipulate: warning: first == last (" DLOOP_OFFSET_FMT_DEC_SPEC ")\n", first));
 	return;
     }
 
     /* first we ensure that stream_off and first are in the same spot */
     if (first != stream_off) {
 #ifdef DLOOP_DEBUG_MANIPULATE
-	MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"first=" DLOOP_OFFSET_FMT_DEC_SPEC "; stream_off=" DLOOP_OFFSET_FMT_DEC_SPEC "; resetting.\n", first, stream_off));
+	MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"first=" DLOOP_OFFSET_FMT_DEC_SPEC "; stream_off=" DLOOP_OFFSET_FMT_DEC_SPEC "; resetting.\n", first, stream_off));
 #endif
 
 	if (first < stream_off) {
@@ -411,7 +411,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	DLOOP_SEGMENT_LOAD_LOCAL_VALUES;
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-	MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"done repositioning stream_off; first=" DLOOP_OFFSET_FMT_DEC_SPEC ", stream_off=" DLOOP_OFFSET_FMT_DEC_SPEC ", last=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+	MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"done repositioning stream_off; first=" DLOOP_OFFSET_FMT_DEC_SPEC ", stream_off=" DLOOP_OFFSET_FMT_DEC_SPEC ", last=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                                            first, stream_off, last));
 #endif
     }
@@ -419,7 +419,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
     for (;;) {
 #ifdef DLOOP_DEBUG_MANIPULATE
 #if 0
-        MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"looptop; cur_sp=%d, cur_elmp=%x\n",
+        MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"looptop; cur_sp=%d, cur_elmp=%x\n",
                                            cur_sp, (unsigned) cur_elmp));
 #endif
 #endif
@@ -496,7 +496,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	    }
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\thit leaf; cur_sp=%d, elmp=%x, piece_sz=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\thit leaf; cur_sp=%d, elmp=%x, piece_sz=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
 			     cur_sp,
                              (unsigned) cur_elmp, myblocks * local_el_size));
 #endif
@@ -507,7 +507,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	    {
 		myblocks = ((last - stream_off) / stream_el_size);
 #ifdef DLOOP_DEBUG_MANIPULATE
-		MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tpartial block count=" DLOOP_OFFSET_FMT_DEC_SPEC " (" DLOOP_OFFSET_FMT_DEC_SPEC " bytes)\n",
+		MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\tpartial block count=" DLOOP_OFFSET_FMT_DEC_SPEC " (" DLOOP_OFFSET_FMT_DEC_SPEC " bytes)\n",
 				 myblocks,
                                  myblocks * stream_el_size));
 #endif
@@ -522,7 +522,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 		case PF_NULL:
 		    piecefn_indicated_exit = 0;
 #ifdef DLOOP_DEBUG_MANIPULATE
-		    MPIU_DBG_MSG("\tNULL piecefn for this piece\n");
+		    MPL_DBG_MSG("\tNULL piecefn for this piece\n");
 #endif
 		    break;
 		case PF_CONTIG:
@@ -695,7 +695,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	} /* end of if leaf */
 	else if (cur_elmp->curblock == 0) {
 #ifdef DLOOP_DEBUG_MANIPULATE
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\thit end of block; elmp=%x [%d]\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\thit end of block; elmp=%x [%d]\n",
                                                (unsigned) cur_elmp, cur_sp));
 #endif
 	    cur_elmp->curcount--;
@@ -726,7 +726,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 
 	    if (cur_elmp->curcount == 0) {
 #ifdef DLOOP_DEBUG_MANIPULATE
-		MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\talso hit end of count; elmp=%x [%d]\n",
+		MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\talso hit end of count; elmp=%x [%d]\n",
                                                    (unsigned) cur_elmp, cur_sp));
 #endif
 		DLOOP_SEGMENT_POP_AND_MAYBE_EXIT;
@@ -762,7 +762,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 		}
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-		MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tloading dlp=%x, elmp=%x [%d]\n",
+		MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\tloading dlp=%x, elmp=%x [%d]\n",
 				 (unsigned) load_dlp,
 				 (unsigned) next_elmp,
                                  cur_sp+1));
@@ -774,7 +774,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	    }
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tpushing type, elmp=%x [%d], count=%d, block=%d\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\tpushing type, elmp=%x [%d], count=%d, block=%d\n",
 			    (unsigned) cur_elmp, cur_sp, count_index,
                             block_index));
 #endif
@@ -817,7 +817,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	    }
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tstep 1: next orig_offset = " DLOOP_OFFSET_FMT_DEC_SPEC " (0x" DLOOP_OFFSET_FMT_HEX_SPEC ")\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\tstep 1: next orig_offset = " DLOOP_OFFSET_FMT_DEC_SPEC " (0x" DLOOP_OFFSET_FMT_HEX_SPEC ")\n",
 			     next_elmp->orig_offset,
                              next_elmp->orig_offset));
 #endif
@@ -857,7 +857,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	    }
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tstep 2: next curoffset = " DLOOP_OFFSET_FMT_DEC_SPEC " (0x" DLOOP_OFFSET_FMT_HEX_SPEC ")\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\tstep 2: next curoffset = " DLOOP_OFFSET_FMT_DEC_SPEC " (0x" DLOOP_OFFSET_FMT_HEX_SPEC ")\n",
 			     next_elmp->curoffset,
                              next_elmp->curoffset));
 #endif
@@ -868,7 +868,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
     } /* end of for (;;) */
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-    MPIU_DBG_MSG("hit end of datatype\n");
+    MPL_DBG_MSG("hit end of datatype\n");
 #endif
 
     DLOOP_SEGMENT_SAVE_LOCAL_VALUES;
diff --git a/src/mpid/common/datatype/dataloop/segment_count.c b/src/mpid/common/datatype/dataloop/segment_count.c
index fa0b398..9318d7e 100644
--- a/src/mpid/common/datatype/dataloop/segment_count.c
+++ b/src/mpid/common/datatype/dataloop/segment_count.c
@@ -103,7 +103,7 @@ static int DLOOP_Leaf_contig_count_block(DLOOP_Offset *blocks_p,
     size = *blocks_p * el_size;
 
 #ifdef MPID_SP_VERBOSE
-    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"contig count block: count = %d, buf+off = %d, lastloc = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"contig count block: count = %d, buf+off = %d, lastloc = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
 		    (int) paramp->count,
 		    (int) ((char *) bufp + rel_off),
                     paramp->last_loc));
diff --git a/src/mpid/common/datatype/dataloop/segment_flatten.c b/src/mpid/common/datatype/dataloop/segment_flatten.c
index 0c230a6..e38ca97 100644
--- a/src/mpid/common/datatype/dataloop/segment_flatten.c
+++ b/src/mpid/common/datatype/dataloop/segment_flatten.c
@@ -236,7 +236,7 @@ static int DLOOP_Leaf_vector_mpi_flatten(DLOOP_Offset *blocks_p,
 	     */
 	    *blocks_p -= (blocks_left + (size / el_size));
 #ifdef MPID_SP_VERBOSE
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (1): next ind = %d, " DLOOP_OFFSET_FMT_DEC_SPEC " blocks processed.\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\t[vector to vec exiting (1): next ind = %d, " DLOOP_OFFSET_FMT_DEC_SPEC " blocks processed.\n",
 			    paramp->u.pack_vector.index,
                             *blocks_p));
 #endif
@@ -261,7 +261,7 @@ static int DLOOP_Leaf_vector_mpi_flatten(DLOOP_Offset *blocks_p,
     }
 
 #ifdef MPID_SP_VERBOSE
-    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (2): next ind = %d, " DLOOP_OFFSET_FMT_DEC_SPEC " blocks processed.\n",
+    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\t[vector to vec exiting (2): next ind = %d, " DLOOP_OFFSET_FMT_DEC_SPEC " blocks processed.\n",
 		    paramp->u.pack_vector.index,
                     *blocks_p));
 #endif
diff --git a/src/mpid/common/datatype/mpid_datatype_free.c b/src/mpid/common/datatype/mpid_datatype_free.c
index dc34cfa..2d8e585 100644
--- a/src/mpid/common/datatype/mpid_datatype_free.c
+++ b/src/mpid/common/datatype/mpid_datatype_free.c
@@ -35,7 +35,7 @@ Output Parameters:
   @*/
 void MPID_Datatype_free(MPID_Datatype *ptr)
 {
-    MPIU_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"type %x freed.", ptr->handle);
+    MPL_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"type %x freed.", ptr->handle);
 
 #ifdef MPID_Dev_datatype_destroy_hook
        MPID_Dev_datatype_destroy_hook(ptr);
diff --git a/src/mpid/common/datatype/mpid_segment.c b/src/mpid/common/datatype/mpid_segment.c
index 93cdc2b..810940a 100644
--- a/src/mpid/common/datatype/mpid_segment.c
+++ b/src/mpid/common/datatype/mpid_segment.c
@@ -234,7 +234,7 @@ static int MPID_Segment_contig_pack_to_iov(DLOOP_Offset *blocks_p,
     el_size = MPID_Datatype_get_basic_size(el_type);
     size = *blocks_p * (DLOOP_Offset) el_size;
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,
              "    contig to vec: do=" MPI_AINT_FMT_DEC_SPEC ", dp=%p, ind=%d, sz=%d, blksz=" MPI_AINT_FMT_DEC_SPEC,
 		    (MPI_Aint) rel_off,
 		    bufp,
@@ -310,7 +310,7 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
     basic_size = (DLOOP_Offset) MPID_Datatype_get_basic_size(el_type);
     blocks_left = *blocks_p;
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,
              "    vector to vec: do=" MPI_AINT_FMT_DEC_SPEC
              ", dp=%p"
              ", len=" MPI_AINT_FMT_DEC_SPEC
@@ -357,7 +357,7 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
 	     */
 	    *blocks_p -= (blocks_left + (size / basic_size));
 #ifdef MPID_SP_VERBOSE
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (1): next ind = %d, " MPI_AINT_FMT_DEC_SPEC " blocks processed.\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\t[vector to vec exiting (1): next ind = %d, " MPI_AINT_FMT_DEC_SPEC " blocks processed.\n",
 			    paramp->u.pack_vector.index,
                             (MPI_Aint) *blocks_p));
 #endif
@@ -381,7 +381,7 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
     }
 
 #ifdef MPID_SP_VERBOSE
-    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (2): next ind = %d, " MPI_AINT_FMT_DEC_SPEC " blocks processed.\n",
+    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\t[vector to vec exiting (2): next ind = %d, " MPI_AINT_FMT_DEC_SPEC " blocks processed.\n",
 		    paramp->u.pack_vector.index,
                     (MPI_Aint) *blocks_p));
 #endif
@@ -420,7 +420,7 @@ static int MPID_Segment_contig_flatten(DLOOP_Offset *blocks_p,
     idx = paramp->u.flatten.index;
 
 #ifdef MPID_SP_VERBOSE
-    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\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",
+    MPL_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPL_DBG_FDEST,"\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,
 		    MPIU_VOID_PTR_CAST_TO_MPI_AINT bufp,
 		    (MPI_Aint) rel_off,
diff --git a/src/mpid/common/datatype/mpid_type_commit.c b/src/mpid/common/datatype/mpid_type_commit.c
index b592353..08dc22e 100644
--- a/src/mpid/common/datatype/mpid_type_commit.c
+++ b/src/mpid/common/datatype/mpid_type_commit.c
@@ -55,7 +55,7 @@ int MPID_Type_commit(MPI_Datatype *datatype_p)
 			     &datatype_ptr->hetero_dloop_depth,
 			     MPID_DATALOOP_HETEROGENEOUS);
 
-	MPIU_DBG_MSG_D(MPIR_DBG_DATATYPE,TERSE,"# contig blocks = %d\n",
+	MPL_DBG_MSG_D(MPIR_DBG_DATATYPE,TERSE,"# contig blocks = %d\n",
                        (int) datatype_ptr->max_contig_blocks);
 
 #if 0
diff --git a/src/mpid/common/datatype/mpid_type_contiguous.c b/src/mpid/common/datatype/mpid_type_contiguous.c
index 06f18a4..6b0d901 100644
--- a/src/mpid/common/datatype/mpid_type_contiguous.c
+++ b/src/mpid/common/datatype/mpid_type_contiguous.c
@@ -130,7 +130,7 @@ int MPID_Type_contiguous(int count,
 
     *newtype = new_dtp->handle;
 
-    MPIU_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"contig type %x created.",
+    MPL_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"contig type %x created.",
 		   new_dtp->handle);
 
     return mpi_errno;
diff --git a/src/mpid/common/datatype/mpid_type_create_resized.c b/src/mpid/common/datatype/mpid_type_create_resized.c
index cd35132..7e89257 100644
--- a/src/mpid/common/datatype/mpid_type_create_resized.c
+++ b/src/mpid/common/datatype/mpid_type_create_resized.c
@@ -90,7 +90,7 @@ int MPID_Type_create_resized(MPI_Datatype oldtype,
 
     *newtype_p = new_dtp->handle;
 
-    MPIU_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"resized type %x created.",
+    MPL_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"resized type %x created.",
 		   new_dtp->handle);
 
     return MPI_SUCCESS;
diff --git a/src/mpid/common/datatype/mpid_type_debug.c b/src/mpid/common/datatype/mpid_type_debug.c
index 95dbc23..cef21b1 100644
--- a/src/mpid/common/datatype/mpid_type_debug.c
+++ b/src/mpid/common/datatype/mpid_type_debug.c
@@ -39,7 +39,7 @@ void MPIDI_Datatype_dot_printf(MPI_Datatype type,
 			       int header)
 {
     if (HANDLE_GET_KIND(type) == HANDLE_KIND_BUILTIN) {
-	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,
+	MPL_DBG_OUT(MPIR_DBG_DATATYPE,
 			 "MPIDI_Datatype_dot_printf: type is a basic");
 	return;
     }
@@ -62,19 +62,19 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
     int i;
 
     if (loop_p == NULL) {
-	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"<null dataloop>\n"));
+	MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"<null dataloop>\n"));
 	return;
     }
 
     if (header) {
-	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 		    /* graphviz does not like the 0xNNN format */
 				   "digraph %lld {   {", (long long int)loop_p));
     }
 
     switch (loop_p->kind & DLOOP_KIND_MASK) {
 	case DLOOP_KIND_CONTIG:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 	    "      dl%d [shape = record, label = \"contig |{ ct = %d; el_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext = " MPI_AINT_FMT_DEC_SPEC " }\"];",
 			    depth,
 			    (int) loop_p->loop_params.c_t.count,
@@ -82,7 +82,7 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 			    (MPI_Aint) loop_p->el_extent));
 	    break;
 	case DLOOP_KIND_VECTOR:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 	    "      dl%d [shape = record, label = \"vector |{ ct = %d; blk = %d; str = " MPI_AINT_FMT_DEC_SPEC "; el_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext =  "MPI_AINT_FMT_DEC_SPEC " }\"];",
 			    depth,
 			    (int) loop_p->loop_params.v_t.count,
@@ -92,7 +92,7 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 			    (MPI_Aint) loop_p->el_extent));
 	    break;
 	case DLOOP_KIND_INDEXED:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 	    "      dl%d [shape = record, label = \"indexed |{ ct = %d; tot_blks = %d; regions = ",
 			    depth,
 			    (int) loop_p->loop_params.i_t.count,
@@ -101,29 +101,29 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 	    for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.i_t.count; i++) {
 		if (i + 1 < loop_p->loop_params.i_t.count) {
 		    /* more regions after this one */
-		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+		    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 		    "\\n(" MPI_AINT_FMT_DEC_SPEC ", %d), ",
 			  (MPI_Aint) loop_p->loop_params.i_t.offset_array[i],
 		          (int) loop_p->loop_params.i_t.blocksize_array[i]));
 		}
 		else {
-		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+		    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 		           "\\n(" MPI_AINT_FMT_DEC_SPEC ", %d); ",
 		           (MPI_Aint) loop_p->loop_params.i_t.offset_array[i],
 			   (int) loop_p->loop_params.i_t.blocksize_array[i]));
 		}
 	    }
 	    if (i < loop_p->loop_params.i_t.count) {
-		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"\\n...; ");
+		MPL_DBG_OUT(MPIR_DBG_DATATYPE,"\\n...; ");
 	    }
 
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 				       "\\nel_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext = " MPI_AINT_FMT_DEC_SPEC " }\"];\n",
 				       (MPI_Aint) loop_p->el_size,
 				       (MPI_Aint) loop_p->el_extent));
 	    break;
 	case DLOOP_KIND_BLOCKINDEXED:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 	    "      dl%d [shape = record, label = \"blockindexed |{ ct = %d; blk = %d; disps = ",
 			    depth,
 			    (int) loop_p->loop_params.bi_t.count,
@@ -132,62 +132,62 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 	    for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.bi_t.count; i++) {
 		if (i + 1 < loop_p->loop_params.bi_t.count) {
 		    /* more regions after this one */
-		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+		    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 		        MPI_AINT_FMT_DEC_SPEC ",\\n ",
 			(MPI_Aint) loop_p->loop_params.bi_t.offset_array[i]));
 		}
 		else {
-		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+		    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 		         MPI_AINT_FMT_DEC_SPEC "; ",
 		         (MPI_Aint) loop_p->loop_params.bi_t.offset_array[i]));
 		}
 	    }
 	    if (i < loop_p->loop_params.bi_t.count) {
-		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"...; ");
+		MPL_DBG_OUT(MPIR_DBG_DATATYPE,"...; ");
 	    }
 
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 				      "\\nel_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext = " MPI_AINT_FMT_DEC_SPEC " }\"];",
 				       (MPI_Aint) loop_p->el_size,
 				       (MPI_Aint) loop_p->el_extent));
 	    break;
 	case DLOOP_KIND_STRUCT:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 	    "      dl%d [shape = record, label = \"struct | {ct = %d; blks = ",
 			    depth,
 			    (int) loop_p->loop_params.s_t.count));
 	    for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.s_t.count; i++) {
 		if (i + 1 < loop_p->loop_params.s_t.count) {
-		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"%d, ",
+		    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"%d, ",
 			    (int) loop_p->loop_params.s_t.blocksize_array[i]));
 		}
 		else {
-		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"%d; ",
+		    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"%d; ",
 			    (int) loop_p->loop_params.s_t.blocksize_array[i]));
 		}
 	    }
 	    if (i < loop_p->loop_params.s_t.count) {
-		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"...; disps = ");
+		MPL_DBG_OUT(MPIR_DBG_DATATYPE,"...; disps = ");
 	    }
 	    else {
-		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"disps = ");
+		MPL_DBG_OUT(MPIR_DBG_DATATYPE,"disps = ");
 	    }
 
 	    for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.s_t.count; i++) {
 		if (i + 1 < loop_p->loop_params.s_t.count) {
-		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,MPI_AINT_FMT_DEC_SPEC ", ",
+		    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,MPI_AINT_FMT_DEC_SPEC ", ",
 			    (MPI_Aint) loop_p->loop_params.s_t.offset_array[i]));
 		}
 		else {
-		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,MPI_AINT_FMT_DEC_SPEC "; ",
+		    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,MPI_AINT_FMT_DEC_SPEC "; ",
 			    (MPI_Aint) loop_p->loop_params.s_t.offset_array[i]));
 		}
 	    }
 	    if (i < loop_p->loop_params.s_t.count) {
-		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"... }\"];");
+		MPL_DBG_OUT(MPIR_DBG_DATATYPE,"... }\"];");
 	    }
 	    else {
-		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"}\"];");
+		MPL_DBG_OUT(MPIR_DBG_DATATYPE,"}\"];");
 	    }
 	    break;
 	default:
@@ -196,7 +196,7 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 
     if (!(loop_p->kind & DLOOP_FINAL_MASK)) {
 	/* more loops to go; recurse */
-	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 				   "      dl%d -> dl%d;\n", depth, depth + 1));
 	switch (loop_p->kind & DLOOP_KIND_MASK) {
 	    case DLOOP_KIND_CONTIG:
@@ -218,13 +218,13 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 		}
 		break;
 	    default:
-		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"      < unsupported type >");
+		MPL_DBG_OUT(MPIR_DBG_DATATYPE,"      < unsupported type >");
 	}
     }
 
 
     if (header) {
-	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"   }\n}");
+	MPL_DBG_OUT(MPIR_DBG_DATATYPE,"   }\n}");
     }
     return;
 }
@@ -235,7 +235,7 @@ void MPIDI_Datatype_printf(MPI_Datatype type,
 			   int blocklength,
 			   int header)
 {
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
     char *string;
     MPI_Aint size;
     MPI_Aint extent, true_lb, true_ub, lb, ub, sticky_lb, sticky_ub;
@@ -264,11 +264,11 @@ void MPIDI_Datatype_printf(MPI_Datatype type,
 
     if (header == 1) {
 	/*               012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 */
-	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"------------------------------------------------------------------------------------------------------------------------------------------\n");
-	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"depth                   type         size       extent      true_lb      true_ub           lb(s)           ub(s)         disp       blklen\n");
-	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"------------------------------------------------------------------------------------------------------------------------------------------\n");
+	MPL_DBG_OUT(MPIR_DBG_DATATYPE,"------------------------------------------------------------------------------------------------------------------------------------------\n");
+	MPL_DBG_OUT(MPIR_DBG_DATATYPE,"depth                   type         size       extent      true_lb      true_ub           lb(s)           ub(s)         disp       blklen\n");
+	MPL_DBG_OUT(MPIR_DBG_DATATYPE,"------------------------------------------------------------------------------------------------------------------------------------------\n");
     }
-    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"%5d  %21s  %11d  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "(" MPI_AINT_FMT_DEC_SPEC ")  " MPI_AINT_FMT_DEC_SPEC "(" MPI_AINT_FMT_DEC_SPEC ")  " MPI_AINT_FMT_DEC_SPEC "  %11d",
+    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"%5d  %21s  %11d  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "(" MPI_AINT_FMT_DEC_SPEC ")  " MPI_AINT_FMT_DEC_SPEC "(" MPI_AINT_FMT_DEC_SPEC ")  " MPI_AINT_FMT_DEC_SPEC "  %11d",
 		    depth,
 		    string,
 		    (int) size,
@@ -449,13 +449,13 @@ void MPIDU_Datatype_debug(MPI_Datatype type,
      * fortran support included.
      */
     if (type == MPI_DATATYPE_NULL) {
-	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,
-			 (MPIU_DBG_FDEST,
+	MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,
+			 (MPL_DBG_FDEST,
 			  "# MPIU_Datatype_debug: MPI_Datatype = MPI_DATATYPE_NULL"));
 	return;
     }
 
-    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 	       "# MPIU_Datatype_debug: MPI_Datatype = 0x%0x (%s)", type,
 	       (is_builtin) ? MPIDU_Datatype_builtin_to_string(type) :
 	        "derived"));
@@ -465,7 +465,7 @@ void MPIDU_Datatype_debug(MPI_Datatype type,
     MPID_Datatype_get_ptr(type, dtp);
     MPIU_Assert(dtp != NULL);
 
-    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
       "# Size = " MPI_AINT_FMT_DEC_SPEC ", Extent = " MPI_AINT_FMT_DEC_SPEC ", LB = " MPI_AINT_FMT_DEC_SPEC "%s, UB = " MPI_AINT_FMT_DEC_SPEC "%s, Extent = " MPI_AINT_FMT_DEC_SPEC ", Element Size = " MPI_AINT_FMT_DEC_SPEC " (%s), %s",
 		    (MPI_Aint) dtp->size,
 		    (MPI_Aint) dtp->extent,
@@ -479,10 +479,10 @@ void MPIDU_Datatype_debug(MPI_Datatype type,
 		    MPIDU_Datatype_builtin_to_string(dtp->basic_type),
 		    dtp->is_contig ? "is N contig" : "is not N contig"));
 
-    MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"# Contents:");
+    MPL_DBG_OUT(MPIR_DBG_DATATYPE,"# Contents:");
     MPIDI_Datatype_contents_printf(type, 0, array_ct);
 
-    MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"# Dataloop:");
+    MPL_DBG_OUT(MPIR_DBG_DATATYPE,"# Dataloop:");
     MPIDI_Datatype_dot_printf(type, 0, 1);
 }
 
@@ -524,7 +524,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
     int *ints = NULL;
 
     if (HANDLE_GET_KIND(type) == HANDLE_KIND_BUILTIN) {
-	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %stype: %s\n",
+	MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"# %stype: %s\n",
 			MPIDI_Datatype_depth_spacing(depth),
 			MPIDU_Datatype_builtin_to_string(type)));
 	return;
@@ -534,7 +534,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
     cp = dtp->contents;
 
     if (cp == NULL) {
-	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# <NULL>\n"));
+	MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"# <NULL>\n"));
 	return;
     }
 
@@ -555,7 +555,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
     }
 
 
-    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %scombiner: %s",
+    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"# %scombiner: %s",
 		    MPIDI_Datatype_depth_spacing(depth),
 		    MPIDU_Datatype_combiner_to_string(cp->combiner)));
 
@@ -567,7 +567,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 	    /* not done */
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_CONTIGUOUS:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %scontig ct = %d\n",
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"# %scontig ct = %d\n",
 			    MPIDI_Datatype_depth_spacing(depth),
 				       *ints));
 	    MPIDI_Datatype_contents_printf(*types,
@@ -575,7 +575,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 					   acount);
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_VECTOR:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 	                "# %svector ct = %d, blk = %d, str = %d\n",
 			MPIDI_Datatype_depth_spacing(depth),
 			    ints[0],
@@ -586,7 +586,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 					   acount);
 	    __mpidi_datatype_free_and_return;
         case MPI_COMBINER_HVECTOR:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 	                  "# %shvector ct = %d, blk = %d, str = " MPI_AINT_FMT_DEC_SPEC "\n",
 			    MPIDI_Datatype_depth_spacing(depth),
 			    ints[0],
@@ -597,11 +597,11 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 					   acount);
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_INDEXED:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %sindexed ct = %d:",
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"# %sindexed ct = %d:",
 			    MPIDI_Datatype_depth_spacing(depth),
 			    ints[0]));
 	    for (i=0; i < acount && i < ints[0]; i++) {
-		MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+		MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 		         "# %s  indexed [%d]: blk = %d, disp = %d\n",
 				MPIDI_Datatype_depth_spacing(depth),
 				i,
@@ -613,11 +613,11 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 	    }
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_HINDEXED:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %shindexed ct = %d:",
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"# %shindexed ct = %d:",
 			    MPIDI_Datatype_depth_spacing(depth),
 			    ints[0]));
 	    for (i=0; i < acount && i < ints[0]; i++) {
-		MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+		MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 		            "# %s  hindexed [%d]: blk = %d, disp = " MPI_AINT_FMT_DEC_SPEC "\n",
 				MPIDI_Datatype_depth_spacing(depth),
 				i,
@@ -629,11 +629,11 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 	    }
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_STRUCT:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %sstruct ct = %d:",
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"# %sstruct ct = %d:",
 			    MPIDI_Datatype_depth_spacing(depth),
 			    (int) ints[0]));
 	    for (i=0; i < acount && i < ints[0]; i++) {
-		MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+		MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 		           "# %s  struct[%d]: blk = %d, disp = " MPI_AINT_FMT_DEC_SPEC "\n",
 				MPIDI_Datatype_depth_spacing(depth),
 				i,
@@ -645,11 +645,11 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 	    }
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_SUBARRAY:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE, (MPIU_DBG_FDEST,"# %ssubarray ct = %d:",
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE, (MPL_DBG_FDEST,"# %ssubarray ct = %d:",
 			MPIDI_Datatype_depth_spacing(depth),
 			(int) ints[0]));
 	    for (i=0; i< acount && i < ints[0]; i++) {
-		MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
+		MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,
 			    "# %s  sizes[%d] = %d subsizes[%d] = %d starts[%d] = %d\n",
 			    MPIDI_Datatype_depth_spacing(depth),
 			    i, (int)ints[i+1],
@@ -662,7 +662,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 	    __mpidi_datatype_free_and_return;
 
 	default:
-	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %sunhandled combiner",
+	    MPL_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPL_DBG_FDEST,"# %sunhandled combiner",
 			MPIDI_Datatype_depth_spacing(depth)));
 	    __mpidi_datatype_free_and_return;
     }
diff --git a/src/mpid/common/datatype/mpid_type_dup.c b/src/mpid/common/datatype/mpid_type_dup.c
index 0de2a00..d6328fd 100644
--- a/src/mpid/common/datatype/mpid_type_dup.c
+++ b/src/mpid/common/datatype/mpid_type_dup.c
@@ -104,7 +104,7 @@ int MPID_Type_dup(MPI_Datatype oldtype,
       }
     }
 
-    MPIU_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE, "dup type %x created.", *newtype);
+    MPL_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE, "dup type %x created.", *newtype);
 
  fn_fail:
     return mpi_errno;
diff --git a/src/mpid/common/datatype/mpid_type_vector.c b/src/mpid/common/datatype/mpid_type_vector.c
index 4ef8462..390db33 100644
--- a/src/mpid/common/datatype/mpid_type_vector.c
+++ b/src/mpid/common/datatype/mpid_type_vector.c
@@ -159,7 +159,7 @@ int MPID_Type_vector(int count,
 
     *newtype = new_dtp->handle;
 
-    MPIU_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"vector type %x created.",
+    MPL_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"vector type %x created.",
 		   new_dtp->handle);
 
     return mpi_errno;
diff --git a/src/mpid/common/hcoll/hcoll.h b/src/mpid/common/hcoll/hcoll.h
index 0399c36..601359e 100644
--- a/src/mpid/common/hcoll/hcoll.h
+++ b/src/mpid/common/hcoll/hcoll.h
@@ -13,9 +13,9 @@
 
 extern int world_comm_destroying;
 
-#if defined(USE_DBG_LOGGING)
-extern MPIU_DBG_Class MPIR_DBG_HCOLL;
-#endif /* USE_DBG_LOGGING */
+#if defined(MPL_USE_DBG_LOGGING)
+extern MPL_DBG_Class MPIR_DBG_HCOLL;
+#endif /* MPL_USE_DBG_LOGGING */
 
 int hcoll_comm_create(MPID_Comm * comm, void *param);
 int hcoll_comm_destroy(MPID_Comm * comm, void *param);
diff --git a/src/mpid/common/hcoll/hcoll_init.c b/src/mpid/common/hcoll/hcoll_init.c
index 84512a3..200c919 100644
--- a/src/mpid/common/hcoll/hcoll_init.c
+++ b/src/mpid/common/hcoll/hcoll_init.c
@@ -22,9 +22,9 @@ int hcoll_enable_iallreduce = 1;
 int hcoll_comm_attr_keyval = MPI_KEYVAL_INVALID;
 int world_comm_destroying = 0;
 
-#if defined(USE_DBG_LOGGING)
-MPIU_DBG_Class MPIR_DBG_HCOLL;
-#endif /* USE_DBG_LOGGING */
+#if defined(MPL_USE_DBG_LOGGING)
+MPL_DBG_Class MPIR_DBG_HCOLL;
+#endif /* MPL_USE_DBG_LOGGING */
 
 #undef FUNCNAME
 #define FUNCNAME hcoll_destroy
@@ -57,7 +57,7 @@ static int hcoll_comm_attr_del_fn(MPI_Comm comm, int keyval, void *attr_val, voi
         envar = getenv("HCOLL_ENABLE_" #nameEnv); \
         if (NULL != envar) { \
             hcoll_enable_##name = atoi(envar); \
-            MPIU_DBG_MSG_D(MPIR_DBG_HCOLL, VERBOSE, "HCOLL_ENABLE_" #nameEnv " = %d\n", hcoll_enable_##name); \
+            MPL_DBG_MSG_D(MPIR_DBG_HCOLL, VERBOSE, "HCOLL_ENABLE_" #nameEnv " = %d\n", hcoll_enable_##name); \
         } \
     } while (0)
 
@@ -78,9 +78,9 @@ int hcoll_initialize(void)
         goto fn_exit;
     }
 
-#if defined(USE_DBG_LOGGING)
-    MPIR_DBG_HCOLL = MPIU_DBG_Class_alloc("HCOLL", "hcoll");
-#endif /* USE_DBG_LOGGING */
+#if defined(MPL_USE_DBG_LOGGING)
+    MPIR_DBG_HCOLL = MPL_DBG_Class_alloc("HCOLL", "hcoll");
+#endif /* MPL_USE_DBG_LOGGING */
 
     hcoll_rte_fns_setup();
     /*set INT_MAX/2 as tag_base here by the moment.
@@ -132,7 +132,7 @@ int hcoll_initialize(void)
 #define INSTALL_COLL_WRAPPER(check_name, name) \
     if (hcoll_enable_##check_name && (NULL != hcoll_collectives.coll_##check_name)) { \
         comm_ptr->coll_fns->name      = hcoll_##name; \
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL,VERBOSE, #name " wrapper installed"); \
+        MPL_DBG_MSG(MPIR_DBG_HCOLL,VERBOSE, #name " wrapper installed"); \
     }
 
 #undef FUNCNAME
@@ -167,7 +167,7 @@ int hcoll_comm_create(MPID_Comm * comm_ptr, void *param)
     }
     comm_ptr->hcoll_priv.hcoll_context = hcoll_create_context((rte_grp_handle_t) comm_ptr);
     if (NULL == comm_ptr->hcoll_priv.hcoll_context) {
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "Couldn't create hcoll context.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "Couldn't create hcoll context.");
         goto fn_fail;
     }
     mpi_errno =
diff --git a/src/mpid/common/hcoll/hcoll_ops.c b/src/mpid/common/hcoll/hcoll_ops.c
index f308597..d2d345f 100644
--- a/src/mpid/common/hcoll/hcoll_ops.c
+++ b/src/mpid/common/hcoll/hcoll_ops.c
@@ -15,17 +15,17 @@ int hcoll_Barrier(MPID_Comm * comm_ptr, MPIR_Errflag_t *err)
 {
     int rc;
     MPI_Comm comm = comm_ptr->handle;
-    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL BARRIER.");
+    MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL BARRIER.");
     rc = hcoll_collectives.coll_barrier(comm_ptr->hcoll_priv.hcoll_context);
     if (HCOLL_SUCCESS != rc) {
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BARRIER.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BARRIER.");
         void *ptr = comm_ptr->coll_fns->Barrier;
         comm_ptr->coll_fns->Barrier =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Barrier : NULL;
         rc = MPI_Barrier(comm);
         comm_ptr->coll_fns->Barrier = ptr;
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BARRIER - done.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BARRIER - done.");
     }
     return rc;
 }
@@ -39,7 +39,7 @@ int hcoll_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
 {
     dte_data_representation_t dtype;
     int rc;
-    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL BCAST.");
+    MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL BCAST.");
     dtype = mpi_dtype_2_dte_dtype(datatype);
     int is_homogeneous = 1, use_fallback = 0;
     MPI_Comm comm = comm_ptr->handle;
@@ -51,7 +51,7 @@ int hcoll_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
         /*If we are here then datatype is not simple predefined datatype */
         /*In future we need to add more complex mapping to the dte_data_representation_t */
         /* Now use fallback */
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback bcast.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback bcast.");
         use_fallback = 1;
     }
     else {
@@ -62,14 +62,14 @@ int hcoll_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
         }
     }
     if (1 == use_fallback) {
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BCAST - done.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BCAST - done.");
         void *ptr = comm_ptr->coll_fns->Bcast;
         comm_ptr->coll_fns->Bcast =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Bcast : NULL;
         rc = MPI_Bcast(buffer, count, datatype, root, comm);
         comm_ptr->coll_fns->Bcast = ptr;
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BCAST - done.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BCAST - done.");
     }
     return rc;
 }
@@ -91,7 +91,7 @@ int hcoll_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL ALLREDUCE.");
+    MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL ALLREDUCE.");
     Dtype = mpi_dtype_2_dte_dtype(datatype);
     Op = mpi_op_2_dte_op(op);
     if (MPI_IN_PLACE == sendbuf) {
@@ -99,7 +99,7 @@ int hcoll_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
     }
     if (HCOL_DTE_IS_COMPLEX(Dtype) || HCOL_DTE_IS_ZERO(Dtype) || (0 == is_homogeneous) ||
         (HCOL_DTE_OP_NULL == Op->id)) {
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback allreduce.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback allreduce.");
         use_fallback = 1;
     }
     else {
@@ -113,14 +113,14 @@ int hcoll_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
         if (HCOLL_IN_PLACE == sendbuf) {
             sendbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLREDUCE.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLREDUCE.");
         void *ptr = comm_ptr->coll_fns->Allreduce;
         comm_ptr->coll_fns->Allreduce =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Allreduce : NULL;
         rc = MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm);
         comm_ptr->coll_fns->Allreduce = ptr;
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLREDUCE done.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLREDUCE done.");
     }
     return rc;
 }
@@ -143,7 +143,7 @@ int hcoll_Allgather(const void *sbuf, int scount, MPI_Datatype sdtype,
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL ALLGATHER.");
+    MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL ALLGATHER.");
     stype = mpi_dtype_2_dte_dtype(sdtype);
     rtype = mpi_dtype_2_dte_dtype(rdtype);
     if (MPI_IN_PLACE == sbuf) {
@@ -151,7 +151,7 @@ int hcoll_Allgather(const void *sbuf, int scount, MPI_Datatype sdtype,
     }
     if (HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) ||
         HCOL_DTE_IS_COMPLEX(rtype) || is_homogeneous == 0) {
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout; calling fallback allgather.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout; calling fallback allgather.");
         use_fallback = 1;
     }
     else {
@@ -165,14 +165,14 @@ int hcoll_Allgather(const void *sbuf, int scount, MPI_Datatype sdtype,
         if (HCOLL_IN_PLACE == sbuf) {
             sbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLGATHER.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLGATHER.");
         void *ptr = comm_ptr->coll_fns->Allgather;
         comm_ptr->coll_fns->Allgather =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Allgather : NULL;
         rc = MPI_Allgather(sbuf, scount, sdtype, rbuf, rcount, rdtype, comm);
         comm_ptr->coll_fns->Allgather = ptr;
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLGATHER - done.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLGATHER - done.");
     }
     return rc;
 }
@@ -188,11 +188,11 @@ int hcoll_Ibarrier_req(MPID_Comm * comm_ptr, MPID_Request ** request)
     MPI_Comm comm;
     MPI_Request req;
     comm = comm_ptr->handle;
-    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL IBARRIER.");
+    MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL IBARRIER.");
     rt_handle = (void **) request;
     rc = hcoll_collectives.coll_ibarrier(comm_ptr->hcoll_priv.hcoll_context, rt_handle);
     if (HCOLL_SUCCESS != rc) {
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBARRIER.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBARRIER.");
         void *ptr = comm_ptr->coll_fns->Ibarrier_req;
         comm_ptr->coll_fns->Ibarrier_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -200,7 +200,7 @@ int hcoll_Ibarrier_req(MPID_Comm * comm_ptr, MPID_Request ** request)
         rc = MPI_Ibarrier(comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Ibarrier_req = ptr;
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBARRIER - done.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBARRIER - done.");
     }
     return rc;
 }
@@ -215,7 +215,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
     int rc;
     void **rt_handle;
     dte_data_representation_t dtype;
-    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL IBCAST.");
+    MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL IBCAST.");
     dtype = mpi_dtype_2_dte_dtype(datatype);
     int is_homogeneous = 1, use_fallback = 0;
     MPI_Comm comm = comm_ptr->handle;
@@ -229,7 +229,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
         /*If we are here then datatype is not simple predefined datatype */
         /*In future we need to add more complex mapping to the dte_data_representation_t */
         /* Now use fallback */
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback ibcast.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback ibcast.");
         use_fallback = 1;
     }
     else {
@@ -240,7 +240,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
         }
     }
     if (1 == use_fallback) {
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
         void *ptr = comm_ptr->coll_fns->Ibcast_req;
         comm_ptr->coll_fns->Ibcast_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -248,7 +248,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
         rc = MPI_Ibcast(buffer, count, datatype, root, comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Ibcast_req = ptr;
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
     }
     return rc;
 }
@@ -276,7 +276,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL IALLGATHER.");
+    MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL IALLGATHER.");
     stype = mpi_dtype_2_dte_dtype(sendtype);
     rtype = mpi_dtype_2_dte_dtype(recvtype);
     if (MPI_IN_PLACE == sendbuf) {
@@ -284,7 +284,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
     }
     if (HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) ||
         HCOL_DTE_IS_COMPLEX(rtype) || is_homogeneous == 0) {
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout; calling fallback iallgather.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout; calling fallback iallgather.");
         use_fallback = 1;
     }
     else {
@@ -298,7 +298,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
         if (HCOLL_IN_PLACE == sendbuf) {
             sendbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLGATHER.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLGATHER.");
         void *ptr = comm_ptr->coll_fns->Iallgather_req;
         comm_ptr->coll_fns->Iallgather_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -306,7 +306,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
         rc = MPI_Iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Iallgather_req = ptr;
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLGATHER - done.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLGATHER - done.");
     }
     return rc;
 }
@@ -331,7 +331,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL IALLREDUCE.");
+    MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL IALLREDUCE.");
     Dtype = mpi_dtype_2_dte_dtype(datatype);
     Op = mpi_op_2_dte_op(op);
     if (MPI_IN_PLACE == sendbuf) {
@@ -339,7 +339,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
     }
     if (HCOL_DTE_IS_COMPLEX(Dtype) || HCOL_DTE_IS_ZERO(Dtype) || (0 == is_homogeneous) ||
         (HCOL_DTE_OP_NULL == Op->id)) {
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback iallreduce.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback iallreduce.");
         use_fallback = 1;
     }
     else {
@@ -353,7 +353,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
         if (HCOLL_IN_PLACE == sendbuf) {
             sendbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLREDUCE.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLREDUCE.");
         void *ptr = comm_ptr->coll_fns->Iallreduce_req;
         comm_ptr->coll_fns->Iallreduce_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -361,7 +361,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
         rc = MPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Iallreduce_req = ptr;
-        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLREDUCE done.");
+        MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLREDUCE done.");
     }
     return rc;
 }
diff --git a/src/mpid/common/hcoll/hcoll_rte.c b/src/mpid/common/hcoll/hcoll_rte.c
index 3b24abf..80badc0 100644
--- a/src/mpid/common/hcoll/hcoll_rte.c
+++ b/src/mpid/common/hcoll/hcoll_rte.c
@@ -160,7 +160,7 @@ static int recv_nb(struct dte_data_representation_t data,
             /* We have a full data description & buffer pointer simultaneously.
              * It is ambiguous. Throw a warning since the user might have made a
              * mistake with data reps */
-            MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
+            MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
                          "representation: buffer_pointer is ignored");
         }
         total_entries_number = count_total_dte_repeat_entries(&data);
@@ -227,7 +227,7 @@ static int send_nb(dte_data_representation_t data,
             /* We have a full data description & buffer pointer simultaneously.
              * It is ambiguous. Throw a warning since the user might have made a
              * mistake with data reps */
-            MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
+            MPL_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
                          "representation: buffer_pointer is ignored");
         }
         total_entries_number = count_total_dte_repeat_entries(&data);
diff --git a/src/mpid/common/sched/mpidu_sched.c b/src/mpid/common/sched/mpidu_sched.c
index 4344a34..0836d30 100644
--- a/src/mpid/common/sched/mpidu_sched.c
+++ b/src/mpid/common/sched/mpidu_sched.c
@@ -135,7 +135,7 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
     switch (e->type) {
     case MPIDU_SCHED_ENTRY_SEND:
         comm = e->u.send.comm;
-        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting SEND entry %d\n", (int) idx);
+        MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting SEND entry %d\n", (int) idx);
         if (e->u.send.count_p) {
             /* deferred send */
             /* originally there was no branch and send.count_p was set to
@@ -165,14 +165,14 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
                 }
             }
             e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
-            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Sched SEND failed. Errflag: %d\n", (int) r->errflag);
+            MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Sched SEND failed. Errflag: %d\n", (int) r->errflag);
         }
         else {
             e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
         }
         break;
     case MPIDU_SCHED_ENTRY_RECV:
-        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting RECV entry %d\n", (int) idx);
+        MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting RECV entry %d\n", (int) idx);
         comm = e->u.recv.comm;
         ret_errno = MPIC_Irecv(e->u.recv.buf, e->u.recv.count, e->u.recv.datatype,
                                e->u.recv.src, s->tag, comm, &e->u.recv.rreq);
@@ -189,14 +189,14 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
             /* We should set the status to failed here - since the request is not freed. this
              * will be handled later in MPIDU_Sched_progress_state, so set to started here */
             e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
-            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Sched RECV failed. Errflag: %d\n", (int) r->errflag);
+            MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Sched RECV failed. Errflag: %d\n", (int) r->errflag);
         }
         else {
             e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
         }
         break;
     case MPIDU_SCHED_ENTRY_REDUCE:
-        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting REDUCE entry %d\n", (int) idx);
+        MPL_DBG_MSG_D(MPIR_DBG_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);
@@ -211,7 +211,7 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
         e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
         break;
     case MPIDU_SCHED_ENTRY_COPY:
-        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting COPY entry %d\n", (int) idx);
+        MPL_DBG_MSG_D(MPIR_DBG_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)
@@ -221,11 +221,11 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
         e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
         break;
     case MPIDU_SCHED_ENTRY_NOP:
-        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting NOOP entry %d\n", (int) idx);
+        MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting NOOP entry %d\n", (int) idx);
         /* nothing to be done */
         break;
     case MPIDU_SCHED_ENTRY_CB:
-        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting CB entry %d\n", (int) idx);
+        MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting CB entry %d\n", (int) idx);
         if (e->u.cb.cb_type == MPIDU_SCHED_CB_TYPE_1) {
             ret_errno = e->u.cb.u.cb_p(r->comm, s->tag, e->u.cb.cb_state);
             /* Sched entries list can be reallocated inside callback */
@@ -265,14 +265,14 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
             }
         }
         else {
-            MPIU_DBG_MSG_D(MPIR_DBG_COMM, TYPICAL, "unknown callback type, e->u.cb.cb_type=%d",
+            MPL_DBG_MSG_D(MPIR_DBG_COMM, TYPICAL, "unknown callback type, e->u.cb.cb_type=%d",
                            e->u.cb.cb_type);
             e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
         }
 
         break;
     default:
-        MPIU_DBG_MSG_D(MPIR_DBG_COMM, TYPICAL, "unknown entry type, e->type=%d", e->type);
+        MPL_DBG_MSG_D(MPIR_DBG_COMM, TYPICAL, "unknown entry type, e->type=%d", e->type);
         break;
     }
 
@@ -441,7 +441,7 @@ int MPIDU_Sched_start(MPID_Sched_t * sp, MPID_Comm * comm, int tag, MPID_Request
     }
     MPL_DL_APPEND(all_schedules.head, s);
 
-    MPIU_DBG_MSG_P(MPIR_DBG_COMM, TYPICAL, "started schedule s=%p\n", s);
+    MPL_DBG_MSG_P(MPIR_DBG_COMM, TYPICAL, "started schedule s=%p\n", s);
     MPIDU_Sched_dump(s);
 
   fn_exit:
@@ -888,8 +888,8 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
             switch (e->type) {
             case MPIDU_SCHED_ENTRY_SEND:
                 if (e->u.send.sreq != NULL && MPID_Request_is_complete(e->u.send.sreq)) {
-                    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
-                                     (MPIU_DBG_FDEST, "completed SEND entry %d, sreq=%p\n", (int) i,
+                    MPL_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
+                                     (MPL_DBG_FDEST, "completed SEND entry %d, sreq=%p\n", (int) i,
                                       e->u.send.sreq));
                     if (s->req->errflag != MPIR_ERR_NONE)
                         e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
@@ -903,8 +903,8 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
                 break;
             case MPIDU_SCHED_ENTRY_RECV:
                 if (e->u.recv.rreq != NULL && MPID_Request_is_complete(e->u.recv.rreq)) {
-                    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
-                                     (MPIU_DBG_FDEST, "completed RECV entry %d, rreq=%p\n", (int) i,
+                    MPL_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
+                                     (MPL_DBG_FDEST, "completed RECV entry %d, rreq=%p\n", (int) i,
                                       e->u.recv.rreq));
                     MPIR_Process_status(&e->u.recv.rreq->status, &s->req->errflag);
                     if (e->u.recv.status != MPI_STATUS_IGNORE) {
@@ -931,7 +931,7 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
 
             if (i == s->idx && e->status >= MPIDU_SCHED_ENTRY_STATUS_COMPLETE) {
                 ++s->idx;
-                MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "completed OTHER entry %d\n", (int) i);
+                MPL_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "completed OTHER entry %d\n", (int) i);
                 if (e->is_barrier) {
                     /* post/perform the next round of operations */
                     mpi_errno = MPIDU_Sched_continue(s);
@@ -946,8 +946,8 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
         }
 
         if (s->idx == s->num_entries) {
-            MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
-                             (MPIU_DBG_FDEST, "completing and dequeuing s=%p r=%p\n", s, s->req));
+            MPL_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
+                             (MPL_DBG_FDEST, "completing and dequeuing s=%p r=%p\n", s, s->req));
 
             /* dequeue this schedule from the state, it's complete */
             MPL_DL_DELETE(state->head, s);
diff --git a/src/mpid/common/sock/iocp/sock.c b/src/mpid/common/sock/iocp/sock.c
index d699481..e25c914 100644
--- a/src/mpid/common/sock/iocp/sock.c
+++ b/src/mpid/common/sock/iocp/sock.c
@@ -692,7 +692,7 @@ int MPIDU_Sock_hostname_to_host_description(char *hostname, char *host_descripti
     iter = list;
     while (iter)
     {
-        MPIU_DBG_MSG_S(MPIR_DBG_OTHER,TERSE,"adding host: %s\n", iter->host);
+        MPL_DBG_MSG_S(MPIR_DBG_OTHER,TERSE,"adding host: %s\n", iter->host);
         str_errno = MPIU_Str_add_string(&host_description, &len, iter->host);
         MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPIDU_SOCK_ERR_NOMEM, "**desc_len");
 
@@ -1412,13 +1412,13 @@ int MPIDU_Sock_post_close(MPIDU_Sock_t sock)
 	/*MPIU_Assert(sock->state != 0);*/ /* The state can be 0 if the operation was aborted */
 #ifdef MPICH_DBG_OUTPUT
 	if (sock->state & SOCKI_CONNECTING)
-	    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_post_close(%d) called while sock is connecting.\n", MPIDU_Sock_get_sock_id(sock));
+	    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_post_close(%d) called while sock is connecting.\n", MPIDU_Sock_get_sock_id(sock));
 	if (sock->state & SOCKI_READING)
 	{
 	    int i, n = 0;
 	    for (i=0; i<sock->read.iovlen; i++)
 		n += sock->read.iov[i].MPL_IOV_LEN;
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_close(%d) called while sock is reading: %d bytes out of %d, index %d, iovlen %d.\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"sock_post_close(%d) called while sock is reading: %d bytes out of %d, index %d, iovlen %d.\n",
 		MPIDU_Sock_get_sock_id(sock), sock->read.total, n, sock->read.index, sock->read.iovlen));
 	}
 	if (sock->state & SOCKI_WRITING)
@@ -1426,7 +1426,7 @@ int MPIDU_Sock_post_close(MPIDU_Sock_t sock)
 	    int i, n = 0;
 	    for (i=0; i<sock->write.iovlen; i++)
 		n += sock->write.iov[i].MPL_IOV_LEN;
-	    MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_close(%d) called while sock is writing: %d bytes out of %d, index %d, iovlen %d.\n",
+	    MPL_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"sock_post_close(%d) called while sock is writing: %d bytes out of %d, index %d, iovlen %d.\n",
 		MPIDU_Sock_get_sock_id(sock), sock->write.total, n, sock->write.index, sock->write.iovlen));
 	}
 	fflush(stdout);
@@ -1584,7 +1584,7 @@ int MPIDU_Sock_post_readv(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIDU_Soc
 #ifdef MPICH_DBG_OUTPUT
     for (i=0; i<iov_n; i++)
     {
-	MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_readv - iov[%d].len = %d\n", i, iov[i].MPL_IOV_LEN));
+	MPL_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"sock_post_readv - iov[%d].len = %d\n", i, iov[i].MPL_IOV_LEN));
     }
 #endif
     for (iter=0; iter<10; iter++)
@@ -1698,7 +1698,7 @@ int MPIDU_Sock_post_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIDU_So
 #ifdef MPICH_DBG_OUTPUT
     for (i=0; i<iov_n; i++)
     {
-	MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_writev - iov[%d].len = %d\n", i, iov[i].MPL_IOV_LEN));
+	MPL_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"sock_post_writev - iov[%d].len = %d\n", i, iov[i].MPL_IOV_LEN));
     }
 #endif
     for (iter=0; iter<10; iter++)
@@ -1784,7 +1784,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	{
             int err;
 	    /* Release the lock so that other threads may make progress while this thread waits for something to do */
-	    MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Exit global critical section");
+	    MPL_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Exit global critical section");
 	    MPIR_THREAD_CHECK_BEGIN;
 	    MPID_Thread_mutex_unlock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
 	    MPIR_THREAD_CHECK_END;
@@ -1809,7 +1809,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	    {
                 int err;
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
-		MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Enter global critical section");
+		MPL_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Enter global critical section");
 		MPIR_THREAD_CHECK_BEGIN;
 		MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
 		MPIR_THREAD_CHECK_END;
@@ -1855,7 +1855,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			/*sock->rt2 = PMPI_Wtime();*/
 			/*printf("[%d] time from post_read  to op_read : %.3f - sock %d\n", getpid(), sock->rt2 - sock->rt1, sock->sock);*/
 			/* socket closed */
-			MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait readv returning %d bytes and EOF\n", sock->read.total);
+			MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait readv returning %d bytes and EOF\n", sock->read.total);
 			/*printf("sock_wait readv returning %d bytes and EOF\n", sock->read.total);*/
 			out->op_type = MPIDU_SOCK_OP_READ;
 			out->num_bytes = sock->read.total;
@@ -1865,7 +1865,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			sock->state &= ~SOCKI_READING; /* remove the SOCKI_READING bit */
 			if (sock->closing && sock->pending_operations == 0)
 			{
-			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+			    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 			    FlushFileBuffers((HANDLE)sock->sock);
 			    if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 			    {
@@ -1887,7 +1887,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WAIT);
 			return MPI_SUCCESS;
 		    }
-		    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait readv update: %d bytes\n", num_bytes);
+		    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait readv update: %d bytes\n", num_bytes);
 		    sock->read.total += num_bytes;
 		    while (num_bytes)
 		    {
@@ -1909,7 +1909,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 		    {
 			/*sock->rt2 = PMPI_Wtime();*/
 			/*printf("[%d] time from post_read  to op_read : %.3f - sock %d\n", getpid(), sock->rt2 - sock->rt1, sock->sock);*/
-			MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait readv %d bytes\n", sock->read.total);
+			MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait readv %d bytes\n", sock->read.total);
 			out->op_type = MPIDU_SOCK_OP_READ;
 			out->num_bytes = sock->read.total;
 			out->error = MPI_SUCCESS;
@@ -1918,7 +1918,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			sock->state &= ~SOCKI_READING; /* remove the SOCKI_READING bit */
 			if (sock->closing && sock->pending_operations == 0)
 			{
-			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+			    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 			    FlushFileBuffers((HANDLE)sock->sock);
 			    if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 			    {
@@ -1961,7 +1961,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    sock->state &= ~SOCKI_READING;
 			    if (sock->closing && sock->pending_operations == 0)
 			    {
-				MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+				MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 				FlushFileBuffers((HANDLE)sock->sock);
 				if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				{
@@ -2021,7 +2021,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    sock->state &= ~SOCKI_READING;
 			    if (sock->closing && sock->pending_operations == 0)
 			    {
-				MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+				MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 				FlushFileBuffers((HANDLE)sock->sock);
 				if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				{
@@ -2059,7 +2059,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			sock->state ^= SOCKI_CONNECTING; /* remove the SOCKI_CONNECTING bit */
 			if (sock->closing && sock->pending_operations == 0)
 			{
-			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after connect completed.\n", MPIDU_Sock_get_sock_id(sock));
+			    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after connect completed.\n", MPIDU_Sock_get_sock_id(sock));
 			    FlushFileBuffers((HANDLE)sock->sock);
 			    if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 			    {
@@ -2088,7 +2088,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    /*sock->wt2 = PMPI_Wtime();*/
 			    /*printf("[%d] time from post_write to op_write: %.3f - sock %d\n", getpid(), sock->wt2 - sock->wt1, sock->sock);*/
 			    /* socket closed */
-			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait writev returning %d bytes and EOF\n", sock->write.total);
+			    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait writev returning %d bytes and EOF\n", sock->write.total);
 			    out->op_type = MPIDU_SOCK_OP_WRITE;
 			    out->num_bytes = sock->write.total;
 			    /*printf("sock_wait writev returning %d bytes and EOF\n", sock->write.total);*/
@@ -2098,7 +2098,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    sock->state &= ~SOCKI_WRITING; /* remove the SOCKI_WRITING bit */
 			    if (sock->closing && sock->pending_operations == 0)
 			    {
-				MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov write completed.\n", MPIDU_Sock_get_sock_id(sock));
+				MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov write completed.\n", MPIDU_Sock_get_sock_id(sock));
 				FlushFileBuffers((HANDLE)sock->sock);
 				if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				{
@@ -2120,13 +2120,13 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WAIT);
 			    return MPI_SUCCESS;
 			}
-			MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_wait: write update, total = %d + %d = %d\n", sock->write.total, num_bytes, sock->write.total + num_bytes));
+			MPL_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"sock_wait: write update, total = %d + %d = %d\n", sock->write.total, num_bytes, sock->write.total + num_bytes));
 			sock->write.total += num_bytes;
 			while (num_bytes)
 			{
 			    if (sock->write.iov[sock->write.index].MPL_IOV_LEN <= num_bytes)
 			    {
-				/*MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_wait: write.index %d, len %d\n", sock->write.index,
+				/*MPL_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"sock_wait: write.index %d, len %d\n", sock->write.index,
 				sock->write.iov[sock->write.index].MPL_IOV_LEN));*/
 				num_bytes -= sock->write.iov[sock->write.index].MPL_IOV_LEN;
 				sock->write.index++;
@@ -2134,7 +2134,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    }
 			    else
 			    {
-				/*MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_wait: partial data written [%d].len = %d, num_bytes = %d\n", sock->write.index,
+				/*MPL_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"sock_wait: partial data written [%d].len = %d, num_bytes = %d\n", sock->write.index,
 				sock->write.iov[sock->write.index].MPL_IOV_LEN, num_bytes));*/
 				sock->write.iov[sock->write.index].MPL_IOV_LEN -= num_bytes;
 				sock->write.iov[sock->write.index].MPL_IOV_BUF = (MPL_IOV_BUF_CAST)(
@@ -2148,7 +2148,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    /*printf("[%d] time from post_write to op_write: %.3f - sock %d\n", getpid(), sock->wt2 - sock->wt1, sock->sock);*/
 			    if (sock->write.total > 0)
 			    {
-				MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait wrotev %d bytes\n", sock->write.total);
+				MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait wrotev %d bytes\n", sock->write.total);
 			    }
 			    out->op_type = MPIDU_SOCK_OP_WRITE;
 			    out->num_bytes = sock->write.total;
@@ -2158,7 +2158,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    sock->state &= ~SOCKI_WRITING; /* remove the SOCKI_WRITING bit */
 			    if (sock->closing && sock->pending_operations == 0)
 			    {
-				MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov write completed.\n", MPIDU_Sock_get_sock_id(sock));
+				MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov write completed.\n", MPIDU_Sock_get_sock_id(sock));
 				FlushFileBuffers((HANDLE)sock->sock);
 				if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				{
@@ -2184,7 +2184,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			if (sock->write.progress_update != NULL)
 			    sock->write.progress_update(num_bytes, sock->user_ptr);
 			/* post a write of the remaining data */
-			MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: posting write of the remaining data, vec size %d\n", sock->write.iovlen);
+			MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: posting write of the remaining data, vec size %d\n", sock->write.iovlen);
 			if (WSASend(sock->sock, sock->write.iov, sock->write.iovlen, &sock->write.num_bytes, 0, &sock->write.ovl, NULL) == SOCKET_ERROR)
 			{
 			    mpi_errno = WSAGetLastError();
@@ -2201,7 +2201,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 				sock->state &= ~SOCKI_WRITING;
 				if (sock->closing && sock->pending_operations == 0)
 				{
-				    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+				    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 				    FlushFileBuffers((HANDLE)sock->sock);
 				    if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				    {
@@ -2258,7 +2258,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 				sock->state &= ~SOCKI_WRITING;
 				if (sock->closing && sock->pending_operations == 0)
 				{
-				    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+				    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 				    FlushFileBuffers((HANDLE)sock->sock);
 				    if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				    {
@@ -2291,7 +2291,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			{
 			    /*sock->rt2 = PMPI_Wtime();*/
 			    /*printf("[%d] time from post_read  to op_read : %.3f - sock %d\n", getpid(), sock->rt2 - sock->rt1, sock->sock);*/
-			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"EOF with posted read on sock %d\n", sock->sock);
+			    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"EOF with posted read on sock %d\n", sock->sock);
 			    out->op_type = MPIDU_SOCK_OP_READ;
 			    out->num_bytes = sock->read.total;
 			    /*printf("sock_wait returning %d bytes and EOF\n", sock->read.total);*/
@@ -2306,7 +2306,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			{
 			    /*sock->wt2 = PMPI_Wtime();*/
 			    /*printf("[%d] time from post_write to op_write: %.3f - sock %d\n", getpid(), sock->wt2 - sock->wt1, sock->sock);*/
-			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"EOF with posted write on sock %d\n", sock->sock);
+			    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"EOF with posted write on sock %d\n", sock->sock);
 			    out->op_type = MPIDU_SOCK_OP_WRITE;
 			    out->num_bytes = sock->write.total;
 			    /*printf("sock_wait returning %d bytes and EOF\n", sock->write.total);*/
@@ -2317,12 +2317,12 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WAIT);
 			    return MPI_SUCCESS;
 			}
-			MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"ignoring EOF notification on unknown sock %d.\n", MPIDU_Sock_get_sock_id(sock));
+			MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"ignoring EOF notification on unknown sock %d.\n", MPIDU_Sock_get_sock_id(sock));
 		    }
 
 		    if (sock->sock != INVALID_SOCKET)
 		    {
-			MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"unmatched ovl: pending: %d, state = %d\n", sock->pending_operations, sock->state));
+			MPL_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPL_DBG_FDEST,"unmatched ovl: pending: %d, state = %d\n", sock->pending_operations, sock->state));
 			/*MPL_error_printf("In sock_wait(), returned overlapped structure does not match the current read or write ovl: 0x%x\n", ovl);*/
 			MPL_snprintf(error_msg, 1024, "In sock_wait(), returned overlapped structure does not match the current read or write ovl: 0x%p\n", ovl);
 			MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WAIT);
@@ -2330,7 +2330,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 		    }
 		    else
 		    {
-			MPIU_DBG_MSG(MPIR_DBG_OTHER,TERSE,"ignoring notification on invalid sock.\n");
+			MPL_DBG_MSG(MPIR_DBG_OTHER,TERSE,"ignoring notification on invalid sock.\n");
 		    }
 		}
 	    }
@@ -2402,7 +2402,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	    {
                 int err;
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
-		MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Enter global critical section");
+		MPL_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Enter global critical section");
 		MPIR_THREAD_CHECK_BEGIN;
 		MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
 		MPIR_THREAD_CHECK_END;
@@ -2528,13 +2528,13 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 		    continue;
 		}
 	    }
-	    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, GetLastError: %d\n", mpi_errno);
+	    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, GetLastError: %d\n", mpi_errno);
 	    if (sock != NULL)
 	    {
-		MPIU_DBG_MSG(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, sock != null\n");
+		MPL_DBG_MSG(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, sock != null\n");
 		if (sock->type == SOCKI_SOCKET)
 		{
-		    MPIU_DBG_MSG(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, sock == SOCKI_SOCKET \n");
+		    MPL_DBG_MSG(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, sock == SOCKI_SOCKET \n");
 		    if (sock->closing)
 		    {
 			/*sock->ct2 = PMPI_Wtime();*/
@@ -2585,7 +2585,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 		}
 		if (sock->type == SOCKI_LISTENER)
 		{
-		    MPIU_DBG_MSG(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, sock == SOCKI_LISTENER \n");
+		    MPL_DBG_MSG(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, sock == SOCKI_LISTENER \n");
 		    /* this only works if the aborted operation is reported before the close is reported
 		       because the close will free the sock structure causing these dereferences bogus.
 		       I need to reference count the sock */
@@ -2730,7 +2730,7 @@ int MPIDU_Sock_readv(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t *
     {
 	*num_read = num_read_local;
     }
-    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_readv %d bytes\n", *num_read);
+    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_readv %d bytes\n", *num_read);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_READV);
     return mpi_errno;
 }
@@ -2794,7 +2794,7 @@ int MPIDU_Sock_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t *
 	}
 	if (mpi_errno && (mpi_errno != WSAEWOULDBLOCK))
 	{
-	    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"WSASend failed: error %d\n", mpi_errno);
+	    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"WSASend failed: error %d\n", mpi_errno);
 	    mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPIDU_SOCK_ERR_FAIL, "**fail", "**fail %s %d", get_error_string(mpi_errno), mpi_errno);
 	    MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WRITEV);
 	    return mpi_errno;
@@ -2804,7 +2804,7 @@ int MPIDU_Sock_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t *
     {
 	*num_written = num_written_local;
     }
-    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_writev %d bytes\n", *num_written);
+    MPL_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_writev %d bytes\n", *num_written);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WRITEV);
     return MPI_SUCCESS;
diff --git a/src/mpid/common/sock/poll/sock_post.i b/src/mpid/common/sock/poll/sock_post.i
index be0a932..ea510b2 100644
--- a/src/mpid/common/sock/poll/sock_post.i
+++ b/src/mpid/common/sock/poll/sock_post.i
@@ -125,10 +125,10 @@ int MPIDU_Sock_post_connect_ifaddr( struct MPIDU_Sock_set * sock_set,
     /*
      * Attempt to establish the connection
      */
-    MPIU_DBG_STMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,{
+    MPL_DBG_STMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,{
 	char addrString[64];
 	MPIDU_Sock_AddrToStr( ifaddr, addrString, sizeof(addrString) );
-	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
+	MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPL_DBG_FDEST,
 			      "Connecting to %s:%d", addrString, port )); 
 	})
 
@@ -141,7 +141,7 @@ int MPIDU_Sock_post_connect_ifaddr( struct MPIDU_Sock_set * sock_set,
     if (rc == 0)
     {
 	/* connection succeeded */
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_CONNECTED_RW for sock %p",sock);
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_CONNECTED_RW for sock %p",sock);
 	pollinfo->state = MPIDU_SOCKI_STATE_CONNECTED_RW;
 	MPIDU_SOCKI_EVENT_ENQUEUE(pollinfo, MPIDU_SOCK_OP_CONNECT, 0, user_ptr, MPI_SUCCESS, mpi_errno, fn_fail);
     }
@@ -149,13 +149,13 @@ int MPIDU_Sock_post_connect_ifaddr( struct MPIDU_Sock_set * sock_set,
     else if (errno == EINPROGRESS)
     {
 	/* connection pending */
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_CONNECTING for sock %p",sock);
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_CONNECTING for sock %p",sock);
 	pollinfo->state = MPIDU_SOCKI_STATE_CONNECTING;
 	MPIDU_SOCKI_POLLFD_OP_SET(pollfd, pollinfo, POLLOUT);
     }
     else
     {
-	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_DISCONNECTED (failure in connect) for sock %p",sock);
+	MPL_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_DISCONNECTED (failure in connect) for sock %p",sock);
 	pollinfo->os_errno = errno;
 	pollinfo->state = MPIDU_SOCKI_STATE_DISCONNECTED;
 
diff --git a/src/mpid/common/sock/poll/sock_wait.i b/src/mpid/common/sock/poll/sock_wait.i
index 5583d97..a9cb59d 100644
--- a/src/mpid/common/sock/poll/sock_wait.i
+++ b/src/mpid/common/sock/poll/sock_wait.i
@@ -155,7 +155,7 @@ int MPIDU_Sock_wait(struct MPIDU_Sock_set * sock_set, int millisecond_timeout,
 		    /* Release the lock so that other threads may make 
 		       progress while this thread waits for something to 
 		       do */
-		    MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Exit global critical section (sock_wait)");
+		    MPL_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Exit global critical section (sock_wait)");
 		    /* 		    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
 				    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX); */
 		    MPID_Thread_mutex_unlock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
@@ -167,7 +167,7 @@ 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(MPIR_DBG_OTHER,TYPICAL,"Enter global critical section (sock_wait)");
+		    MPL_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Enter global critical section (sock_wait)");
 		    /* 		    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
 				    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX); */
 		    MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
diff --git a/src/mpid/common/sock/poll/socki_util.i b/src/mpid/common/sock/poll/socki_util.i
index d52249b..594b0cc 100644
--- a/src/mpid/common/sock/poll/socki_util.i
+++ b/src/mpid/common/sock/poll/socki_util.i
@@ -988,7 +988,7 @@ int MPIDU_Sock_SetSockBufferSize( int fd, int firm )
 	if (rc <= 0) {
 	    sockBufSize = 0;
 	}
-	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Sock buf size = %d",sockBufSize);
+	MPL_DBG_MSG_D(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Sock buf size = %d",sockBufSize);
     }
 
     if (sockBufSize > 0) {
diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index 3aa7f7d..2af0330 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -88,7 +88,7 @@ M*/
             int rec_err_ = 0;                                           \
             MPIR_Per_thread_t *per_thread = NULL;                              \
                                                                         \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive locking GLOBAL mutex"); \
+            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive locking GLOBAL mutex"); \
             MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key, \
                                          MPIR_Per_thread, per_thread, &rec_err_); \
             MPIU_Assert(rec_err_ == 0);                                 \
@@ -105,10 +105,10 @@ M*/
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking ALLGRAN mutex"); \
-            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_mutex_lock %p", &mutex); \
+            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking ALLGRAN mutex"); \
+            MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_mutex_lock %p", &mutex); \
             MPIDU_Thread_mutex_lock(&mutex, &err_);                     \
-            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_mutex_lock %p", &mutex); \
+            MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_mutex_lock %p", &mutex); \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -120,10 +120,10 @@ M*/
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking POBJ mutex"); \
-            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_mutex_lock %p", &mutex); \
+            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking POBJ mutex"); \
+            MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_mutex_lock %p", &mutex); \
             MPIDU_Thread_mutex_lock(&mutex, &err_);                     \
-            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_mutex_lock %p", &mutex); \
+            MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_mutex_lock %p", &mutex); \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -160,7 +160,7 @@ M*/
             int rec_err_ = 0;                                           \
             MPIR_Per_thread_t *per_thread = NULL;                              \
                                                                         \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive unlocking GLOBAL mutex"); \
+            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive unlocking GLOBAL mutex"); \
             MPIU_Assert(rec_err_ == 0);                                 \
             MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key, \
                                          MPIR_Per_thread, per_thread, &rec_err_); \
@@ -168,7 +168,7 @@ M*/
                                                                         \
             if (per_thread->lock_depth == 1) {                          \
                 int err_ = 0;                                           \
-                MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIDU_Thread_mutex_unlock %p", &mutex); \
+                MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIDU_Thread_mutex_unlock %p", &mutex); \
                 MPIDU_Thread_mutex_unlock(&mutex, &err_);               \
                 MPIU_Assert(err_ == 0);                                 \
             }                                                           \
@@ -180,8 +180,8 @@ M*/
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking ALLGRAN mutex"); \
-            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIDU_Thread_mutex_unlock %p", &mutex); \
+            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking ALLGRAN mutex"); \
+            MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIDU_Thread_mutex_unlock %p", &mutex); \
             MPIDU_Thread_mutex_unlock(&mutex, &err_);                   \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
@@ -194,8 +194,8 @@ M*/
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking POBJ mutex"); \
-            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIDU_Thread_mutex_unlock %p", &mutex); \
+            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking POBJ mutex"); \
+            MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIDU_Thread_mutex_unlock %p", &mutex); \
             MPIDU_Thread_mutex_unlock(&mutex, &err_);                   \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
@@ -232,10 +232,10 @@ M*/
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding GLOBAL mutex"); \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_yield"); \
+            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding GLOBAL mutex"); \
+            MPL_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_yield"); \
             MPIDU_Thread_yield(&mutex, &err_);                          \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_yield"); \
+            MPL_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_yield"); \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -243,7 +243,7 @@ M*/
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding ALLGRAN mutex"); \
+            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding ALLGRAN mutex"); \
             MPIDU_Thread_yield(&mutex, &err_);                          \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
@@ -256,7 +256,7 @@ M*/
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding POBJ mutex"); \
+            MPL_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding POBJ mutex"); \
             MPIDU_Thread_yield(&mutex, &err_);                          \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
@@ -353,7 +353,7 @@ M*/
         OPA_store_int(&(mutex_ptr_)->num_queued_threads, 0);            \
         MPL_thread_mutex_create(&(mutex_ptr_)->mutex, err_ptr_);        \
         MPIU_Assert(*err_ptr_ == 0);                                    \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPL_thread_mutex %p", (mutex_ptr_)); \
+        MPL_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPL_thread_mutex %p", (mutex_ptr_)); \
     } while (0)
 
 /*@
@@ -367,7 +367,7 @@ M*/
 @*/
 #define MPIDU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)                \
     do {                                                                \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPL_thread_mutex %p", (mutex_ptr_)); \
+        MPL_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPL_thread_mutex %p", (mutex_ptr_)); \
         MPL_thread_mutex_destroy(&(mutex_ptr_)->mutex, err_ptr_);       \
         MPIU_Assert(*err_ptr_ == 0);                                    \
     } while (0)
@@ -381,10 +381,10 @@ M*/
 #define MPIDU_Thread_mutex_lock(mutex_ptr_, err_ptr_)                   \
     do {                                                                \
         OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPL_thread_mutex_lock %p", &(mutex_ptr_)->mutex); \
+        MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPL_thread_mutex_lock %p", &(mutex_ptr_)->mutex); \
         MPL_thread_mutex_lock(&(mutex_ptr_)->mutex, err_ptr_);          \
         MPIU_Assert(*err_ptr_ == 0);                                    \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPL_thread_mutex_lock %p", &(mutex_ptr_)->mutex); \
+        MPL_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPL_thread_mutex_lock %p", &(mutex_ptr_)->mutex); \
         OPA_decr_int(&(mutex_ptr_)->num_queued_threads);                \
     } while (0)
 
@@ -415,7 +415,7 @@ M*/
     do {                                                                \
         MPL_thread_cond_create(cond_ptr_, err_ptr_);                    \
         MPIU_Assert(*err_ptr_ == 0);                                    \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPL_thread_cond %p", (cond_ptr_)); \
+        MPL_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPL_thread_cond %p", (cond_ptr_)); \
     } while (0)
 
 /*@
@@ -430,7 +430,7 @@ M*/
 @*/
 #define MPIDU_Thread_cond_destroy(cond_ptr_, err_ptr_)                  \
     do {                                                                \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPL_thread_cond %p", (cond_ptr_)); \
+        MPL_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPL_thread_cond %p", (cond_ptr_)); \
         MPL_thread_cond_destroy(cond_ptr_, err_ptr_);                   \
         MPIU_Assert(*err_ptr_ == 0);                                    \
     } while (0)
@@ -452,11 +452,11 @@ M*/
 #define MPIDU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_)         \
     do {                                                                \
         OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                \
-        MPIU_DBG_MSG_FMT(MPIR_DBG_THREAD,TYPICAL,(MPIU_DBG_FDEST,"Enter cond_wait on cond=%p mutex=%p",(cond_ptr_),&(mutex_ptr_)->mutex)); \
+        MPL_DBG_MSG_FMT(MPIR_DBG_THREAD,TYPICAL,(MPL_DBG_FDEST,"Enter cond_wait on cond=%p mutex=%p",(cond_ptr_),&(mutex_ptr_)->mutex)); \
         MPL_thread_cond_wait(cond_ptr_, &(mutex_ptr_)->mutex, err_ptr_); \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("cond_wait failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
-        MPIU_DBG_MSG_FMT(MPIR_DBG_THREAD,TYPICAL,(MPIU_DBG_FDEST,"Exit cond_wait on cond=%p mutex=%p",(cond_ptr_),&(mutex_ptr_)->mutex)); \
+        MPL_DBG_MSG_FMT(MPIR_DBG_THREAD,TYPICAL,(MPL_DBG_FDEST,"Exit cond_wait on cond=%p mutex=%p",(cond_ptr_),&(mutex_ptr_)->mutex)); \
         OPA_decr_int(&(mutex_ptr_)->num_queued_threads);                \
     } while (0)
 
@@ -468,7 +468,7 @@ M*/
 @*/
 #define MPIDU_Thread_cond_broadcast(cond_ptr_, err_ptr_)                \
     do {                                                                \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_broadcast on MPL_thread_cond %p", (cond_ptr_)); \
+        MPL_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_broadcast on MPL_thread_cond %p", (cond_ptr_)); \
         MPL_thread_cond_broadcast(cond_ptr_, err_ptr_);                 \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("cond_broadcast failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
@@ -482,7 +482,7 @@ M*/
 @*/
 #define MPIDU_Thread_cond_signal(cond_ptr_, err_ptr_)                   \
     do {                                                                \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_signal on MPL_thread_cond %p", (cond_ptr_)); \
+        MPL_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_signal on MPL_thread_cond %p", (cond_ptr_)); \
         MPL_thread_cond_signal(cond_ptr_, err_ptr_);                    \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("cond_signal failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
diff --git a/src/mpid/pamid/src/mpid_vc.c b/src/mpid/pamid/src/mpid_vc.c
index 29b0f27..6179941 100644
--- a/src/mpid/pamid/src/mpid_vc.c
+++ b/src/mpid/pamid/src/mpid_vc.c
@@ -333,7 +333,7 @@ int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
 	  }
 	  *gpid++ = vc->pg_rank;
 
-          MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPIU_DBG_FDEST,
+          MPL_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPL_DBG_FDEST,
                            "pgid=%d vc->pg_rank=%d",
                            pgid, vc->pg_rank));
       }
diff --git a/src/mpl/configure.ac b/src/mpl/configure.ac
index 60b850c..8dd8535 100644
--- a/src/mpl/configure.ac
+++ b/src/mpl/configure.ac
@@ -58,6 +58,25 @@ AC_ARG_ENABLE(embedded,
     [embedded=no])
 AM_CONDITIONAL([MPL_EMBEDDED_MODE],[test "x${embedded}" = "xyes"])
 
+AC_ARG_ENABLE(g,
+    AC_HELP_STRING([--enable-g=option],
+	[
+		Control the level of debugging support in MPL.
+		"option" is a list of comma separated names.  Default
+		is "all".
+
+	    none|no   - No debugging
+	    log       - Enable debug event logging
+	    yes|all   - All of the above choices (except "none", obviously)
+	]),,[enable_g=none])
+
+if test "$enable_g" = "no" -o "$enable_g" = "none" ; then
+   :
+elif test "$enable_g" = "log" -o "$enable_g" = "yes" -o "$enable_g" = "all" ; then
+   AC_DEFINE([USE_DBG_LOGGING],[1],[Define to enable logging macros])
+fi
+
+
 # support gcov test coverage information
 PAC_ENABLE_COVERAGE
 
@@ -73,7 +92,7 @@ if test "$pac_cv_have___typeof" = "yes" ; then
 fi
 
 dnl Check if the necessary headers are available
-AC_CHECK_HEADERS(stdio.h stdlib.h string.h stdarg.h ctype.h sys/types.h sys/uio.h execinfo.h backtrace.h libunwind.h)
+AC_CHECK_HEADERS(stdio.h stdlib.h string.h stdarg.h ctype.h sys/types.h sys/uio.h execinfo.h backtrace.h libunwind.h unistd.h errno.h)
 
 # A C99 compliant compiler should have inttypes.h for fixed-size int types
 AC_CHECK_HEADERS(inttypes.h stdint.h)
@@ -665,6 +684,28 @@ AX_TLS
 #######################################################################
 
 
+#######################################################################
+## START OF DBG CODE
+#######################################################################
+
+# mkstemp() is a better replacement for mktemp()
+AC_HAVE_FUNCS(mkstemp)
+if test "$ac_cv_func_mkstemp" = "yes" ; then
+    PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],mkstemp)
+fi
+# fdopen() converts from an fd to a FILE*
+AC_HAVE_FUNCS(fdopen)
+if test "$ac_cv_func_fdopen" = "yes" ; then
+    PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],fdopen)
+fi
+
+AC_CHECK_FUNCS(getpid)
+
+#######################################################################
+## END OF DBG CODE
+#######################################################################
+
+
 ## Enable creation of libtool-style versioning or no versioning
 AC_ARG_ENABLE(versioning,
         [AC_HELP_STRING([--enable-versioning],[Enable library versioning])],,
diff --git a/src/mpl/include/mpl.h b/src/mpl/include/mpl.h
index 50d4789..0dccfee 100644
--- a/src/mpl/include/mpl.h
+++ b/src/mpl/include/mpl.h
@@ -20,5 +20,6 @@
 #include "mpl_thread.h"
 #include "mpl_timer.h"
 #include "mpl_yield.h"
+#include "mpl_dbg.h"
 
 #endif /* !defined(MPL_H_INCLUDED) */
diff --git a/src/mpl/include/mpl_dbg.h b/src/mpl/include/mpl_dbg.h
new file mode 100644
index 0000000..6587f90
--- /dev/null
+++ b/src/mpl/include/mpl_dbg.h
@@ -0,0 +1,148 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2005 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#ifndef MPL_DBG_H_INCLUDED
+#define MPL_DBG_H_INCLUDED
+
+#include "mplconfig.h"
+
+/*
+ * Multilevel debugging and tracing macros.
+ * The design is discussed at
+ * http://wiki.mpich.org/mpich/index.php/Debug_Event_Logging
+ *
+ * Basically, this provide a way to place debugging messages into
+ * groups (called *classes*), with levels of detail, and arbitrary
+ * messages.  The messages can be turned on and off using environment
+ * variables and/or command-line options.
+ */
+
+#ifdef MPL_USE_DBG_LOGGING
+
+#define MPL_DBG_SELECTED(_class, _level)                                \
+    ((_class & MPL_DBG_ActiveClasses) && MPL_DBG_##_level <= MPL_DBG_MaxLevel)
+
+#define MPL_DBG_MSG(_class, _level, _string)                            \
+    {                                                                   \
+        if ((_class & MPL_DBG_ActiveClasses) && MPL_DBG_##_level <= MPL_DBG_MaxLevel) { \
+            MPL_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _string); \
+        }                                                               \
+    }
+
+#define MPL_DBG_MSG_S(_class, _level, _fmat, _string)                   \
+    {                                                                   \
+        if ((_class & MPL_DBG_ActiveClasses) && MPL_DBG_##_level <= MPL_DBG_MaxLevel) { \
+            MPL_DBG_Outevent(__FILE__, __LINE__, _class, 1, _fmat, _string); \
+        }                                                               \
+    }
+
+#define MPL_DBG_MSG_D(_class, _level, _fmat, _int)                      \
+    {                                                                   \
+        if ((_class & MPL_DBG_ActiveClasses) && MPL_DBG_##_level <= MPL_DBG_MaxLevel) { \
+            MPL_DBG_Outevent(__FILE__, __LINE__, _class, 2, _fmat, _int); \
+        }                                                               \
+    }
+
+#define MPL_DBG_MSG_P(_class, _level, _fmat, _pointer)                  \
+    {                                                                   \
+        if ((_class & MPL_DBG_ActiveClasses) && MPL_DBG_##_level <= MPL_DBG_MaxLevel) { \
+            MPL_DBG_Outevent(__FILE__, __LINE__, _class, 3, _fmat, _pointer); \
+        }                                                               \
+    }
+
+#define MPL_DBG_MAXLINE 256
+#define MPL_DBG_FDEST _s,(size_t)MPL_DBG_MAXLINE
+/*M
+  MPL_DBG_MSG_FMT - General debugging output macro
+
+  Notes:
+  To use this macro, the third argument should be an "sprintf" - style
+  argument, using MPL_DBG_FDEST as the buffer argument.  For example,
+.vb
+    MPL_DBG_MSG_FMT(CMM,VERBOSE,(MPL_DBG_FDEST,"fmat",args...));
+.ve
+  M*/
+
+#define MPL_DBG_MSG_FMT(_class, _level, _fmatargs)                      \
+    {                                                                   \
+        if ((_class & MPL_DBG_ActiveClasses) && MPL_DBG_##_level <= MPL_DBG_MaxLevel) { \
+            char _s[MPL_DBG_MAXLINE];                                   \
+            MPL_snprintf _fmatargs ;                                    \
+            MPL_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _s);  \
+        }                                                               \
+    }
+
+#define MPL_DBG_STMT(_class, _level, _stmt)                             \
+    {                                                                   \
+        if ((_class & MPL_DBG_ActiveClasses) && MPL_DBG_##_level <= MPL_DBG_MaxLevel) { \
+            _stmt;                                                      \
+        }                                                               \
+    }
+
+#define MPL_DBG_OUT(_class, _msg)                               \
+    MPL_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _msg)
+
+#define MPL_DBG_OUT_FMT(_class,_fmatargs)                               \
+    {                                                                   \
+        char _s[MPL_DBG_MAXLINE];                                       \
+        MPL_snprintf _fmatargs ;                                        \
+        MPL_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _s);      \
+    }
+
+#else
+#define MPL_DBG_SELECTED(_class,_level) 0
+#define MPL_DBG_MSG(_class,_level,_string)
+#define MPL_DBG_MSG_S(_class,_level,_fmat,_string)
+#define MPL_DBG_MSG_D(_class,_level,_fmat,_int)
+#define MPL_DBG_MSG_P(_class,_level,_fmat,_int)
+#define MPL_DBG_MSG_FMT(_class,_level,_fmatargs)
+#define MPL_DBG_STMT(_class,_level,_stmt)
+#define MPL_DBG_OUT(_class,_msg)
+#define MPL_DBG_OUT_FMT(_class,_fmtargs)
+#endif
+
+#define MPL_DBG_SUCCESS       0
+#define MPL_DBG_ERR_INTERN    1
+#define MPL_DBG_ERR_OTHER     2
+
+typedef unsigned int MPL_DBG_Class;
+
+/* Special constants */
+enum MPL_DBG_LEVEL {
+    MPL_DBG_TERSE = 0,
+    MPL_DBG_TYPICAL = 50,
+    MPL_DBG_VERBOSE = 99
+};
+
+extern int MPL_DBG_ActiveClasses;
+extern int MPL_DBG_MaxLevel;
+
+extern MPL_DBG_Class MPL_DBG_ROUTINE_ENTER;
+extern MPL_DBG_Class MPL_DBG_ROUTINE_EXIT;
+extern MPL_DBG_Class MPL_DBG_ROUTINE;
+extern MPL_DBG_Class MPL_DBG_ALL;
+
+MPL_DBG_Class MPL_DBG_Class_alloc(const char *ucname, const char *lcname);
+void MPL_DBG_Class_register(MPL_DBG_Class class, const char *ucname, const char *lcname);
+
+#define MPL_DBG_CLASS_CLR(class)                \
+    do {                                        \
+        (class) = 0;                            \
+    } while (0)
+
+#define MPL_DBG_CLASS_APPEND(out_class, in_class)       \
+    do {                                                \
+        (out_class) |= (in_class);                      \
+    } while (0)
+
+/* *INDENT-OFF* */
+int MPL_DBG_Outevent(const char *, int, int, int, const char *, ...) ATTRIBUTE((format(printf, 5, 6)));
+/* *INDENT-ON* */
+
+int MPL_DBG_Init(int *, char ***, int, int, int, int, int);
+int MPL_DBG_PreInit(int *, char ***, int);
+
+#endif
diff --git a/src/mpl/src/Makefile.mk b/src/mpl/src/Makefile.mk
index 0c23984..4ae620e 100644
--- a/src/mpl/src/Makefile.mk
+++ b/src/mpl/src/Makefile.mk
@@ -5,6 +5,7 @@
 #
 
 include src/bt/Makefile.mk
+include src/dbg/Makefile.mk
 include src/env/Makefile.mk
 include src/mem/Makefile.mk
 include src/msg/Makefile.mk
diff --git a/src/util/dbg/Makefile.mk b/src/mpl/src/dbg/Makefile.mk
similarity index 51%
rename from src/util/dbg/Makefile.mk
rename to src/mpl/src/dbg/Makefile.mk
index babd837..427ac75 100644
--- a/src/util/dbg/Makefile.mk
+++ b/src/mpl/src/dbg/Makefile.mk
@@ -5,9 +5,4 @@
 ##     See COPYRIGHT in top-level directory.
 ##
 
-AM_CPPFLAGS += -I$(top_srcdir)/src/util/dbg
-
-noinst_HEADERS += src/util/dbg/mpidbg.h
-
-mpi_core_sources += \
-    src/util/dbg/dbg_printf.c
+lib at MPLLIBNAME@_la_SOURCES += src/dbg/mpl_dbg.c
diff --git a/src/util/dbg/dbg_printf.c b/src/mpl/src/dbg/mpl_dbg.c
similarity index 86%
rename from src/util/dbg/dbg_printf.c
rename to src/mpl/src/dbg/mpl_dbg.c
index 6901f3d..1df23e4 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/mpl/src/dbg/mpl_dbg.c
@@ -10,42 +10,31 @@
  * this can be used to record debug messages without printing them.
  */
 
-#include "mpiimpl.h"
 #include "mpl.h"
 
-#include <stdio.h>
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_UNISTD_H
+#ifdef MPL_HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#ifdef HAVE_ERRNO_H
+#ifdef MPL_HAVE_ERRNO_H
 #include <errno.h>
 #endif
 
-#if defined(HAVE_MKSTEMP) && defined(NEEDS_MKSTEMP_DECL)
+#if defined(MPL_HAVE_MKSTEMP) && defined(MPL_NEEDS_MKSTEMP_DECL)
 extern int mkstemp(char *t);
 #endif
 
-#if defined(HAVE_FDOPEN) && defined(NEEDS_FDOPEN_DECL)
+#if defined(MPL_HAVE_FDOPEN) && defined(MPL_NEEDS_FDOPEN_DECL)
 extern FILE *fdopen(int fd, const char *mode);
 #endif
 
-#ifdef USE_DBG_LOGGING
+#ifdef MPL_USE_DBG_LOGGING
 
 #ifndef MAXPATHLEN
 #define MAXPATHLEN 1024
 #endif
 
-int MPIU_DBG_ActiveClasses = 0;
-int MPIU_DBG_MaxLevel = MPIU_DBG_TYPICAL;
+int MPL_DBG_ActiveClasses = 0;
+int MPL_DBG_MaxLevel = MPL_DBG_TYPICAL;
 
 static enum {
     DBG_UNINIT,
@@ -88,6 +77,7 @@ static FILE *dbg_static_fp = 0;
  * More formally: This function sets basename to the character just
  * after the last '/' in path.
 */
+static void find_basename(char *path, char **basename) ATTRIBUTE((unused));
 static void find_basename(char *path, char **basename)
 {
     char *c;
@@ -146,11 +136,11 @@ static void set_fp(FILE * fp)
     dbg_static_fp = fp;
 }
 
-int MPIU_DBG_Outevent(const char *file, int line, int class, int kind, const char *fmat, ...)
+int MPL_DBG_Outevent(const char *file, int line, int class, int kind, const char *fmat, ...)
 {
-    int mpi_errno = MPI_SUCCESS;
+    int mpl_errno = MPL_DBG_SUCCESS;
     va_list list;
-    char *str, stmp[MPIU_DBG_MAXLINE];
+    char *str, stmp[MPL_DBG_MAXLINE];
     int i;
     void *p;
     MPL_time_t t;
@@ -174,13 +164,13 @@ int MPIU_DBG_Outevent(const char *file, int line, int class, int kind, const cha
         threadID = (unsigned long long int) tid;
     }
 #endif
-#if defined(HAVE_GETPID)
+#if defined(MPL_HAVE_GETPID)
     pid = (int) getpid();
-#endif /* HAVE_GETPID */
+#endif /* MPL_HAVE_GETPID */
 
     if (!dbg_fp) {
-        mpi_errno = dbg_openfile(&dbg_fp);
-        if (mpi_errno)
+        mpl_errno = dbg_openfile(&dbg_fp);
+        if (mpl_errno)
             goto fn_fail;
         set_fp(dbg_fp);
     }
@@ -233,8 +223,8 @@ int MPIU_DBG_Outevent(const char *file, int line, int class, int kind, const cha
 
 /* These are used to simplify the handling of options.
    To add a new name, add an dbg_classname element to the array
-   classnames.  The "classbits" values are defined by MPIU_DBG_CLASS
-   in src/include/mpidbg.h
+   classnames.  The "classbits" values are defined by MPL_DBG_CLASS
+   in mpl_dbg.h
  */
 
 typedef struct dbg_classname {
@@ -253,15 +243,15 @@ static int num_unregistered_classes = 0;
 /* Because the level values are simpler and are rarely changed, these
  * use a simple set of parallel arrays */
 static const int level_values[] = {
-    MPIU_DBG_TERSE,
-    MPIU_DBG_TYPICAL,
-    MPIU_DBG_VERBOSE,
+    MPL_DBG_TERSE,
+    MPL_DBG_TYPICAL,
+    MPL_DBG_VERBOSE,
     100
 };
 static const char *level_name[] = { "TERSE", "TYPICAL", "VERBOSE", 0 };
 static const char *lc_level_name[] = { "terse", "typical", "verbose", 0 };
 
-void MPIU_DBG_Class_register(MPIU_DBG_Class class, const char *ucname, const char *lcname)
+void MPL_DBG_Class_register(MPL_DBG_Class class, const char *ucname, const char *lcname)
 {
     int i, j;
 
@@ -280,7 +270,7 @@ void MPIU_DBG_Class_register(MPIU_DBG_Class class, const char *ucname, const cha
             if (len == slen && (strncmp(unregistered_classes[i], lcname, len) ||
                                 strncmp(unregistered_classes[i], ucname, len))) {
                 /* got a match */
-                MPIU_DBG_ActiveClasses |= class;
+                MPL_DBG_ActiveClasses |= class;
                 for (j = i; j < num_unregistered_classes - 1; j++)
                     unregistered_classes[j] = unregistered_classes[j + 1];
                 num_unregistered_classes--;
@@ -290,12 +280,12 @@ void MPIU_DBG_Class_register(MPIU_DBG_Class class, const char *ucname, const cha
     }
 }
 
-MPIU_DBG_Class MPIU_DBG_Class_alloc(const char *ucname, const char *lcname)
+MPL_DBG_Class MPL_DBG_Class_alloc(const char *ucname, const char *lcname)
 {
     static unsigned int class = 1;
 
     /* create a user handle for this class */
-    MPIU_DBG_Class_register(class, ucname, lcname);
+    MPL_DBG_Class_register(class, ucname, lcname);
 
     class <<= 1;
 
@@ -324,13 +314,13 @@ static int dbg_process_args(int *argc_p, char ***argv_p)
                 /* Found a command */
                 if (*s == 0) {
                     /* Just -mpich-dbg */
-                    MPIU_DBG_MaxLevel = MPIU_DBG_TYPICAL;
-                    MPIU_DBG_ActiveClasses = MPIU_DBG_ALL;
+                    MPL_DBG_MaxLevel = MPL_DBG_TYPICAL;
+                    MPL_DBG_ActiveClasses = MPL_DBG_ALL;
                 }
                 else if (*s == '=') {
                     /* look for file */
-                    MPIU_DBG_MaxLevel = MPIU_DBG_TYPICAL;
-                    MPIU_DBG_ActiveClasses = MPIU_DBG_ALL;
+                    MPL_DBG_MaxLevel = MPL_DBG_TYPICAL;
+                    MPL_DBG_ActiveClasses = MPL_DBG_ALL;
                     s++;
                     if (strncmp(s, "file", 4) == 0) {
                         file_pattern = default_file_pattern;
@@ -389,7 +379,7 @@ static int dbg_process_args(int *argc_p, char ***argv_p)
             }
         }
     }
-    return MPI_SUCCESS;
+    return MPL_DBG_SUCCESS;
 }
 
 static int dbg_process_env(void)
@@ -400,8 +390,8 @@ static int dbg_process_env(void)
     s = getenv("MPICH_DBG");
     if (s) {
         /* Set the defaults */
-        MPIU_DBG_MaxLevel = MPIU_DBG_TYPICAL;
-        MPIU_DBG_ActiveClasses = MPIU_DBG_ALL;
+        MPL_DBG_MaxLevel = MPL_DBG_TYPICAL;
+        MPL_DBG_ActiveClasses = MPL_DBG_ALL;
         if (strncmp(s, "FILE", 4) == 0) {
             file_pattern = default_file_pattern;
         }
@@ -435,30 +425,30 @@ static int dbg_process_env(void)
             which_rank = -1;
         }
     }
-    return MPI_SUCCESS;
+    return MPL_DBG_SUCCESS;
 }
 
-MPIU_DBG_Class MPIU_DBG_ROUTINE_ENTER;
-MPIU_DBG_Class MPIU_DBG_ROUTINE_EXIT;
-MPIU_DBG_Class MPIU_DBG_ROUTINE;
-MPIU_DBG_Class MPIU_DBG_ALL = ~(0);     /* pre-initialize the ALL class */
+MPL_DBG_Class MPL_DBG_ROUTINE_ENTER;
+MPL_DBG_Class MPL_DBG_ROUTINE_EXIT;
+MPL_DBG_Class MPL_DBG_ROUTINE;
+MPL_DBG_Class MPL_DBG_ALL = ~(0);       /* pre-initialize the ALL class */
 
 /*
  * Attempt to initialize the logging system.  This works only if the
  * full initialization is not required for updating the environment
  * and/or command-line arguments.
  */
-int MPIU_DBG_PreInit(int *argc_p, char ***argv_p, int wtimeNotReady)
+int MPL_DBG_PreInit(int *argc_p, char ***argv_p, int wtimeNotReady)
 {
     MPL_time_t t;
 
     /* if the DBG_MSG system was already initialized, say by the
      * device, then return immediately */
     if (dbg_initialized != DBG_UNINIT)
-        return MPI_SUCCESS;
+        return MPL_DBG_SUCCESS;
 
     if (dbg_init_tls())
-        return MPIU_DBG_ERROR;
+        return MPL_DBG_ERR_OTHER;
 
     /* Check to see if any debugging was selected.  The order of these
      * tests is important, as they allow general defaults to be set,
@@ -475,23 +465,23 @@ int MPIU_DBG_PreInit(int *argc_p, char ***argv_p, int wtimeNotReady)
     }
 
     /* Allocate the predefined classes */
-    MPIU_DBG_ROUTINE_ENTER = MPIU_DBG_Class_alloc("ROUTINE_ENTER", "routine_enter");
-    MPIU_DBG_ROUTINE_EXIT = MPIU_DBG_Class_alloc("ROUTINE_EXIT", "routine_exit");
+    MPL_DBG_ROUTINE_ENTER = MPL_DBG_Class_alloc("ROUTINE_ENTER", "routine_enter");
+    MPL_DBG_ROUTINE_EXIT = MPL_DBG_Class_alloc("ROUTINE_EXIT", "routine_exit");
 
-    MPIU_DBG_CLASS_CLR(MPIU_DBG_ROUTINE);
-    MPIU_DBG_CLASS_APPEND(MPIU_DBG_ROUTINE, MPIU_DBG_ROUTINE_ENTER);
-    MPIU_DBG_CLASS_APPEND(MPIU_DBG_ROUTINE, MPIU_DBG_ROUTINE_EXIT);
-    MPIU_DBG_Class_register(MPIU_DBG_ROUTINE, "ROUTINE", "routine");
+    MPL_DBG_CLASS_CLR(MPL_DBG_ROUTINE);
+    MPL_DBG_CLASS_APPEND(MPL_DBG_ROUTINE, MPL_DBG_ROUTINE_ENTER);
+    MPL_DBG_CLASS_APPEND(MPL_DBG_ROUTINE, MPL_DBG_ROUTINE_EXIT);
+    MPL_DBG_Class_register(MPL_DBG_ROUTINE, "ROUTINE", "routine");
 
-    MPIU_DBG_Class_register(MPIU_DBG_ALL, "ALL", "all");
+    MPL_DBG_Class_register(MPL_DBG_ALL, "ALL", "all");
 
     dbg_initialized = DBG_PREINIT;
 
-    return MPIU_DBG_SUCCESS;
+    return MPL_DBG_SUCCESS;
 }
 
-int MPIU_DBG_Init(int *argc_p, char ***argv_p, int has_args, int has_env,
-                  int wnum, int wrank, int threaded)
+int MPL_DBG_Init(int *argc_p, char ***argv_p, int has_args, int has_env,
+                 int wnum, int wrank, int threaded)
 {
     int ret;
     FILE *dbg_fp = NULL;
@@ -501,11 +491,11 @@ int MPIU_DBG_Init(int *argc_p, char ***argv_p, int has_args, int has_env,
      * responsible for handling the file mode (e.g., reopen when the
      * rank become available) */
     if (dbg_initialized == DBG_INITIALIZED || dbg_initialized == DBG_ERROR)
-        return MPI_SUCCESS;
+        return MPL_DBG_SUCCESS;
 
     if (dbg_initialized != DBG_PREINIT) {
         if (dbg_init_tls())
-            return MPIU_DBG_ERROR;
+            return MPL_DBG_ERR_OTHER;
     }
 
     dbg_fp = get_fp();
@@ -538,7 +528,7 @@ int MPIU_DBG_Init(int *argc_p, char ***argv_p, int has_args, int has_env,
 
     if (which_rank >= 0 && which_rank != wrank) {
         /* Turn off logging on this process */
-        MPIU_DBG_ActiveClasses = 0;
+        MPL_DBG_ActiveClasses = 0;
     }
 
     /* If the file has already been opened with a temp filename,
@@ -570,7 +560,7 @@ int MPIU_DBG_Init(int *argc_p, char ***argv_p, int has_args, int has_env,
     dbg_initialized = DBG_INITIALIZED;
 
   fn_exit:
-    return MPI_SUCCESS;
+    return MPL_DBG_SUCCESS;
   fn_fail:
     dbg_initialized = DBG_ERROR;
     goto fn_exit;
@@ -604,7 +594,7 @@ Environment variables\n\
     return 0;
 }
 
-#if defined (HAVE_MKSTEMP) && defined (HAVE_FDOPEN)
+#if defined (MPL_HAVE_MKSTEMP) && defined (MPL_HAVE_FDOPEN)
 
 /* creates a temporary file in the same directory the user specified
  * for the log file */
@@ -614,7 +604,7 @@ Environment variables\n\
 #define FCNAME MPL_QUOTE(FUNCNAME)
 static int dbg_open_tmpfile(FILE ** dbg_fp)
 {
-    int mpi_errno = MPI_SUCCESS;
+    int mpl_errno = MPL_DBG_SUCCESS;
     const char temp_pattern[] = "templogXXXXXX";
     int fd;
     char *basename;
@@ -641,15 +631,15 @@ static int dbg_open_tmpfile(FILE ** dbg_fp)
         goto fn_fail;
 
   fn_exit:
-    return mpi_errno;
+    return mpl_errno;
   fn_fail:
     MPL_error_printf("Could not open log file %s\n", temp_filename);
     dbg_initialized = DBG_ERROR;
-    mpi_errno = MPI_ERR_INTERN;
+    mpl_errno = MPL_DBG_ERR_INTERN;
     goto fn_exit;
 }
 
-#elif defined(HAVE__MKTEMP_S) && defined(HAVE_FOPEN_S)
+#elif defined(MPL_HAVE__MKTEMP_S) && defined(MPL_HAVE_FOPEN_S)
 
 /* creates a temporary file in the same directory the user specified
  * for the log file */
@@ -659,7 +649,7 @@ static int dbg_open_tmpfile(FILE ** dbg_fp)
 #define FCNAME MPL_QUOTE(FUNCNAME)
 static int dbg_open_tmpfile(FILE ** dbg_fp)
 {
-    int mpi_errno = MPI_SUCCESS;
+    int mpl_errno = MPL_DBG_SUCCESS;
     const char temp_pattern[] = "templogXXXXXX";
     int fd;
     char *basename;
@@ -687,11 +677,11 @@ static int dbg_open_tmpfile(FILE ** dbg_fp)
         goto fn_fail;
 
   fn_exit:
-    return mpi_errno;
+    return mpl_errno;
   fn_fail:
     MPL_error_printf("Could not open log file %s\n", temp_filename);
     dbg_initialized = DBG_ERROR;
-    mpi_errno = MPI_ERR_INTERN;
+    mpl_errno = MPL_DBG_ERR_INTERN;
     goto fn_exit;
 }
 
@@ -710,11 +700,7 @@ static int dbg_open_tmpfile(FILE ** dbg_fp)
 #define FCNAME MPL_QUOTE(FUNCNAME)
 static int dbg_open_tmpfile(FILE ** dbg_fp)
 {
-    int mpi_errno = MPI_SUCCESS;
-    const char temp_pattern[] = "templogXXXXXX";
-    int fd;
-    char *basename;
-    int ret;
+    int mpl_errno = MPL_DBG_SUCCESS;
     char *cret;
 
     cret = tmpnam(temp_filename);
@@ -726,11 +712,11 @@ static int dbg_open_tmpfile(FILE ** dbg_fp)
         goto fn_fail;
 
   fn_exit:
-    return mpi_errno;
+    return mpl_errno;
   fn_fail:
     MPL_error_printf("Could not open log file %s\n", temp_filename);
     dbg_initialized = DBG_ERROR;
-    mpi_errno = MPI_ERR_INTERN;
+    mpl_errno = MPL_DBG_ERR_INTERN;
     goto fn_exit;
 }
 
@@ -742,7 +728,7 @@ static int dbg_get_filename(char *filename, int len)
 {
     int withinMworld = 0,       /* True if within an @W...@ */
         withinMthread = 0;      /* True if within an @T...@ */
-    /* FIXME: Need to know how many MPI_COMM_WORLDs are known */
+    /* FIXME: Need to know how many process groups are known */
 #if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
     unsigned long long int threadID = 0;
     int nThread = 2;
@@ -765,7 +751,7 @@ static int dbg_get_filename(char *filename, int len)
         /* There are two special cases that allow text to
          * be optionally included.  Those patterns are
          * @T...@ (only if multi-threaded) and
-         * @W...@ (only if more than one MPI_COMM_WORLD)
+         * @W...@ (only if more than one process group)
          * UNIMPLEMENTED/UNTESTED */
         if (*p == '@') {
             /* Escaped @? */
@@ -837,11 +823,11 @@ static int dbg_get_filename(char *filename, int len)
             else if (*p == 'p') {
                 /* Appends the pid of the proceess to the file name. */
                 char pidAsChar[20];
-#if defined(HAVE_GETPID)
+#if defined(MPL_HAVE_GETPID)
                 pid_t pid = getpid();
 #else
                 int pid = -1;
-#endif /* HAVE_GETPID */
+#endif /* MPL_HAVE_GETPID */
                 MPL_snprintf(pidAsChar, sizeof(pidAsChar), "%d", (int) pid);
                 *pDest = 0;
                 MPL_strnapp(filename, pidAsChar, len);
@@ -866,7 +852,7 @@ static int dbg_get_filename(char *filename, int len)
  * calls. */
 static int dbg_openfile(FILE ** dbg_fp)
 {
-    int mpi_errno = MPI_SUCCESS;
+    int mpl_errno = MPL_DBG_SUCCESS;
     if (!file_pattern || *file_pattern == 0 || strcmp(file_pattern, "-stdout-") == 0) {
         *dbg_fp = stdout;
     }
@@ -879,33 +865,33 @@ static int dbg_openfile(FILE ** dbg_fp)
         /* if we're not at DBG_INITIALIZED, we don't know our
          * rank yet, so we create a temp file, to be renamed later */
         if (dbg_initialized != DBG_INITIALIZED) {
-            mpi_errno = dbg_open_tmpfile(dbg_fp);
-            if (mpi_errno)
+            mpl_errno = dbg_open_tmpfile(dbg_fp);
+            if (mpl_errno)
                 goto fn_fail;
         }
         else {
-            mpi_errno = dbg_get_filename(filename, MAXPATHLEN);
-            if (mpi_errno)
+            mpl_errno = dbg_get_filename(filename, MAXPATHLEN);
+            if (mpl_errno)
                 goto fn_fail;
 
             *dbg_fp = fopen(filename, "w");
             if (!*dbg_fp) {
                 MPL_error_printf("Could not open log file %s\n", filename);
-                if (mpi_errno)
+                if (mpl_errno)
                     goto fn_fail;
             }
         }
     }
   fn_exit:
-    return mpi_errno;
+    return mpl_errno;
   fn_fail:
     dbg_initialized = DBG_ERROR;
-    mpi_errno = MPI_ERR_INTERN;
+    mpl_errno = MPL_DBG_ERR_INTERN;
     goto fn_exit;
 }
 
 /* Support routines for processing mpich-dbg values */
-/* Update the GLOBAL variable MPIU_DBG_ActiveClasses with the bits
+/* Update the GLOBAL variable MPL_DBG_ActiveClasses with the bits
  * corresponding to this name */
 static int dbg_set_class(const char *s)
 {
@@ -925,7 +911,7 @@ static int dbg_set_class(const char *s)
             if (slen == len && (strncmp(str, classnames[i].lcname, len) ||
                                 strncmp(str, classnames[i].ucname, len))) {
                 /* we have a match */
-                MPIU_DBG_ActiveClasses |= classnames[i].classbits;
+                MPL_DBG_ActiveClasses |= classnames[i].classbits;
                 found_match = 1;
                 break;
             }
@@ -945,7 +931,7 @@ static int dbg_set_class(const char *s)
     return 0;
 }
 
-/* Set the global MPIU_DBG_MaxLevel if there is a match with the known
+/* Set the global MPL_DBG_MaxLevel if there is a match with the known
  * level names */
 static int dbg_set_level(const char *s, const char *(names[]))
 {
@@ -953,10 +939,10 @@ static int dbg_set_level(const char *s, const char *(names[]))
 
     for (i = 0; names[i]; i++) {
         if (strcmp(names[i], s) == 0) {
-            MPIU_DBG_MaxLevel = level_values[i];
+            MPL_DBG_MaxLevel = level_values[i];
             return 0;
         }
     }
     return 1;
 }
-#endif /* USE_DBG_LOGGING */
+#endif /* MPL_USE_DBG_LOGGING */
diff --git a/src/util/Makefile.mk b/src/util/Makefile.mk
index 890a796..a6b3e1c 100644
--- a/src/util/Makefile.mk
+++ b/src/util/Makefile.mk
@@ -5,7 +5,6 @@
 ##     See COPYRIGHT in top-level directory.
 ##
 
-include $(top_srcdir)/src/util/dbg/Makefile.mk
 include $(top_srcdir)/src/util/logging/Makefile.mk
 include $(top_srcdir)/src/util/mem/Makefile.mk
 include $(top_srcdir)/src/util/cvar/Makefile.mk
diff --git a/src/util/assert/assert.c b/src/util/assert/assert.c
index 2e29b2f..4f3d9d3 100644
--- a/src/util/assert/assert.c
+++ b/src/util/assert/assert.c
@@ -23,8 +23,8 @@ int MPIR_Assert_fail(const char *cond, const char *file_name, int line_num)
                             file_name, line_num, cond);
     MPL_internal_error_printf("Assertion failed in file %s at line %d: %s\n",
                                file_name, line_num, cond);
-    MPIU_DBG_MSG_FMT(MPIR_DBG_ASSERT, TERSE,
-                     (MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_ASSERT, TERSE,
+                     (MPL_DBG_FDEST,
                       "Assertion failed in file %s at line %d: %s",
                       file_name, line_num, cond));
     MPL_backtrace_show(stderr);
@@ -48,11 +48,11 @@ int MPIR_Assert_fail_fmt(const char *cond, const char *file_name, int line_num,
                                file_name, line_num, cond);
     MPL_internal_error_printf("%s\n", msg);
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_ASSERT, TERSE,
-                     (MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_ASSERT, TERSE,
+                     (MPL_DBG_FDEST,
                       "Assertion failed in file %s at line %d: %s",
                       file_name, line_num, cond));
-    MPIU_DBG_MSG_FMT(MPIR_DBG_ASSERT, TERSE, (MPIU_DBG_FDEST,"%s",msg));
+    MPL_DBG_MSG_FMT(MPIR_DBG_ASSERT, TERSE, (MPL_DBG_FDEST,"%s",msg));
 
     MPID_Abort(NULL, MPI_SUCCESS, 1, NULL);
     return MPI_ERR_INTERN; /* never get here, abort should kill us */
diff --git a/src/util/assert/mpiassert.h b/src/util/assert/mpiassert.h
index 63d2747..23f2300 100644
--- a/src/util/assert/mpiassert.h
+++ b/src/util/assert/mpiassert.h
@@ -83,7 +83,7 @@ int MPIR_Assert_fail_fmt(const char *cond, const char *file_name, int line_num,
  * 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.
+ *    to the debug log, if enabled, via MPL_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
diff --git a/src/util/dbg/mpidbg.h b/src/util/dbg/mpidbg.h
deleted file mode 100644
index 9d3f237..0000000
--- a/src/util/dbg/mpidbg.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2005 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#ifndef MPIDBG_H_INCLUDED
-#define MPIDBG_H_INCLUDED
-
-#include <stdio.h>
-#include <stdarg.h>
-#include "mpl.h"
-
-/*
- * Multilevel debugging and tracing macros.
- * The design is discussed at
- * http://wiki.mpich.org/mpich/index.php/Debug_Event_Logging
- *
- * Basically, this provide a way to place debugging messages into
- * groups (called *classes*), with levels of detail, and arbitrary
- * messages.  The messages can be turned on and off using environment
- * variables and/or command-line options.
- */
-
-#ifdef USE_DBG_LOGGING
-
-#define MPIU_DBG_SELECTED(_class, _level)       \
-    ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel)
-
-#define MPIU_DBG_MSG(_class, _level, _string)                           \
-    {                                                                   \
-        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
-            MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _string); \
-        }                                                               \
-    }
-
-#define MPIU_DBG_MSG_S(_class, _level, _fmat, _string)                  \
-    {                                                                   \
-        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
-            MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 1, _fmat, _string); \
-        }                                                               \
-    }
-
-#define MPIU_DBG_MSG_D(_class, _level, _fmat, _int)                     \
-    {                                                                   \
-        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
-            MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 2, _fmat, _int); \
-        }                                                               \
-    }
-
-#define MPIU_DBG_MSG_P(_class, _level, _fmat, _pointer)                 \
-    {                                                                   \
-        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
-            MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 3, _fmat, _pointer); \
-        }                                                               \
-    }
-
-#define MPIU_DBG_MAXLINE 256
-#define MPIU_DBG_FDEST _s,(size_t)MPIU_DBG_MAXLINE
-/*M
-  MPIU_DBG_MSG_FMT - General debugging output macro
-
-  Notes:
-  To use this macro, the third argument should be an "sprintf" - style
-  argument, using MPIU_DBG_FDEST as the buffer argument.  For example,
-.vb
-    MPIU_DBG_MSG_FMT(CMM,VERBOSE,(MPIU_DBG_FDEST,"fmat",args...));
-.ve
-  M*/
-
-#define MPIU_DBG_MSG_FMT(_class, _level, _fmatargs)                     \
-    {                                                                   \
-        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
-            char _s[MPIU_DBG_MAXLINE];                                  \
-            MPL_snprintf _fmatargs ;                                    \
-            MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _s); \
-        }                                                               \
-    }
-
-#define MPIU_DBG_STMT(_class, _level, _stmt)                            \
-    {                                                                   \
-        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
-            _stmt;                                                      \
-        }                                                               \
-    }
-
-#define MPIU_DBG_OUT(_class, _msg)                                      \
-    MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _msg)
-
-#define MPIU_DBG_OUT_FMT(_class,_fmatargs)                              \
-    {                                                                   \
-        char _s[MPIU_DBG_MAXLINE];                                      \
-        MPL_snprintf _fmatargs ;                                        \
-        MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _s);     \
-    }
-
-#else
-#define MPIU_DBG_SELECTED(_class,_level) 0
-#define MPIU_DBG_MSG(_class,_level,_string)
-#define MPIU_DBG_MSG_S(_class,_level,_fmat,_string)
-#define MPIU_DBG_MSG_D(_class,_level,_fmat,_int)
-#define MPIU_DBG_MSG_P(_class,_level,_fmat,_int)
-#define MPIU_DBG_MSG_FMT(_class,_level,_fmatargs)
-#define MPIU_DBG_STMT(_class,_level,_stmt)
-#define MPIU_DBG_OUT(_class,_msg)
-#define MPIU_DBG_OUT_FMT(_class,_fmtargs)
-#endif
-
-#define MPIU_DBG_SUCCESS  0
-#define MPIU_DBG_ERROR    1
-
-typedef unsigned int MPIU_DBG_Class;
-
-/* Special constants */
-enum MPIU_DBG_LEVEL {
-    MPIU_DBG_TERSE = 0,
-    MPIU_DBG_TYPICAL = 50,
-    MPIU_DBG_VERBOSE = 99
-};
-
-extern int MPIU_DBG_ActiveClasses;
-extern int MPIU_DBG_MaxLevel;
-
-extern MPIU_DBG_Class MPIU_DBG_ROUTINE_ENTER;
-extern MPIU_DBG_Class MPIU_DBG_ROUTINE_EXIT;
-extern MPIU_DBG_Class MPIU_DBG_ROUTINE;
-extern MPIU_DBG_Class MPIU_DBG_ALL;
-
-MPIU_DBG_Class MPIU_DBG_Class_alloc(const char *ucname, const char *lcname);
-void MPIU_DBG_Class_register(MPIU_DBG_Class class, const char *ucname, const char *lcname);
-
-#define MPIU_DBG_CLASS_CLR(class)               \
-    do {                                        \
-        (class) = 0;                            \
-    } while (0)
-
-#define MPIU_DBG_CLASS_APPEND(out_class, in_class)      \
-    do {                                                \
-        (out_class) |= (in_class);                      \
-    } while (0)
-
-/* *INDENT-OFF* */
-int MPIU_DBG_Outevent(const char *, int, int, int, const char *, ...) ATTRIBUTE((format(printf, 5, 6)));
-/* *INDENT-ON* */
-
-int MPIU_DBG_Init(int *, char ***, int, int, int, int, int);
-int MPIU_DBG_PreInit(int *, char ***, int);
-
-#endif
diff --git a/src/util/mem/argstr.c b/src/util/mem/argstr.c
index 9d06289..e8c63f4 100644
--- a/src/util/mem/argstr.c
+++ b/src/util/mem/argstr.c
@@ -6,7 +6,7 @@
 
 #include "mpichconf.h"
 #include "mpimem.h"
-#include "mpidbg.h"
+#include "mpl.h"
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -57,7 +57,7 @@ static int encode_buffer(char *dest, int dest_length, const char *src,
 	    *num_encoded = n;
 	    return MPIU_STR_TRUNCATED;
 	}
-	/*MPIU_DBG_MSG_FMT(STRING,VERBOSE,(MPIU_DBG_FDEST," %c = %c%c",
+	/*MPL_DBG_MSG_FMT(STRING,VERBOSE,(MPL_DBG_FDEST," %c = %c%c",
 	  ch, dest[0], dest[1]));*/
 	dest += num_used;
 	dest_length -= num_used;
@@ -99,7 +99,7 @@ static int decode_buffer(const char *str, char *dest, int length,
 	str++;
 	sscanf(hex, "%X", &value);
 	*dest = (char)value;
-	/*MPIU_DBG_MSG_FMT(STRING,VERBOSE,(MPIU_DBG_FDEST," %s = %c",
+	/*MPL_DBG_MSG_FMT(STRING,VERBOSE,(MPL_DBG_FDEST," %s = %c",
 	  hex, *dest));*/
 	dest++;
 	n++;
@@ -721,7 +721,7 @@ int MPIU_Str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 1)
     {
-	MPIU_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
+	MPL_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
                   "partial argument added to string: '%s'", *str_ptr);
 	**str_ptr = '\0';
 	return MPIU_STR_NOMEM;
@@ -755,7 +755,7 @@ int MPIU_Str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 2)
     {
-	MPIU_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
+	MPL_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**orig_str_ptr = '\0';
 	return MPIU_STR_NOMEM;
@@ -852,7 +852,7 @@ int MPIU_Str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 1)
     {
-	MPIU_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
+	MPL_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**str_ptr = '\0';
 	return MPIU_STR_NOMEM;
@@ -877,7 +877,7 @@ int MPIU_Str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 2)
     {
-	MPIU_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
+	MPL_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**orig_str_ptr = '\0';
 	return MPIU_STR_NOMEM;
diff --git a/src/util/mem/handlemem.c b/src/util/mem/handlemem.c
index b620610..1917796 100644
--- a/src/util/mem/handlemem.c
+++ b/src/util/mem/handlemem.c
@@ -382,7 +382,7 @@ void *MPIU_Handle_obj_alloc_unsafe(MPIU_Object_alloc_t *objmem)
          * annotations instead. */
         MPL_VG_ANNOTATE_NEW_MEMORY(ptr, objmem->size);
 
-        MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,
+        MPL_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPL_DBG_FDEST,
                                          "Allocating object ptr %p (handle val 0x%08x)",
                                          ptr, ptr->handle));
     }
@@ -407,7 +407,7 @@ void MPIU_Handle_obj_free( MPIU_Object_alloc_t *objmem, void *object )
 
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_HANDLE_MUTEX);
 
-    MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,
+    MPL_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPL_DBG_FDEST,
                                      "Freeing object ptr %p (0x%08x kind=%s) refcount=%d",
                                      (obj),
                                      (obj)->handle,
diff --git a/src/util/pointer/mpiu_pointer.h b/src/util/pointer/mpiu_pointer.h
index e19d22b..0dd23a6 100644
--- a/src/util/pointer/mpiu_pointer.h
+++ b/src/util/pointer/mpiu_pointer.h
@@ -10,8 +10,8 @@
 #include "mpi.h"
 #include "mpichconf.h"
 #include "mpichconfconst.h"
-#include "mpidbg.h"
 #include "mpiassert.h"
+#include "mpl.h"
 
 /* Assigns (src_) to (dst_), checking that (src_) fits in (dst_) without
  * truncation.
diff --git a/src/util/wrappers/mpiu_sock_wrappers.h b/src/util/wrappers/mpiu_sock_wrappers.h
index ac08af0..17e116d 100644
--- a/src/util/wrappers/mpiu_sock_wrappers.h
+++ b/src/util/wrappers/mpiu_sock_wrappers.h
@@ -22,7 +22,6 @@
 #include "mpierror.h"
 #include "mpierrs.h"
 #include "mpimem.h"
-#include "mpidbg.h"
 #include "mpiutil.h"
 
 #ifdef USE_NT_SOCK

http://git.mpich.org/mpich.git/commitdiff/033799edbde9e4e24854d67cbb02c02a8b2b93f3

commit 033799edbde9e4e24854d67cbb02c02a8b2b93f3
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 21 22:02:50 2016 -0600

    mpidbg: white space cleanup.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index 5e0d413..6901f3d 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -24,17 +24,17 @@
 #include <stdlib.h>
 #endif
 #ifdef HAVE_UNISTD_H
-#  include <unistd.h>
+#include <unistd.h>
 #endif
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
 
-#if defined( HAVE_MKSTEMP ) && defined( NEEDS_MKSTEMP_DECL )
+#if defined(HAVE_MKSTEMP) && defined(NEEDS_MKSTEMP_DECL)
 extern int mkstemp(char *t);
 #endif
 
-#if defined( HAVE_FDOPEN ) && defined( NEEDS_FDOPEN_DECL )
+#if defined(HAVE_FDOPEN) && defined(NEEDS_FDOPEN_DECL)
 extern FILE *fdopen(int fd, const char *mode);
 #endif
 
@@ -45,17 +45,23 @@ extern FILE *fdopen(int fd, const char *mode);
 #endif
 
 int MPIU_DBG_ActiveClasses = 0;
-int MPIU_DBG_MaxLevel      = MPIU_DBG_TYPICAL;
-static enum {DBG_UNINIT, DBG_PREINIT, DBG_INITIALIZED, DBG_ERROR}
-    dbg_initialized = DBG_UNINIT;
+int MPIU_DBG_MaxLevel = MPIU_DBG_TYPICAL;
+
+static enum {
+    DBG_UNINIT,
+    DBG_PREINIT,
+    DBG_INITIALIZED,
+    DBG_ERROR
+} dbg_initialized = DBG_UNINIT;
+
 static char file_pattern_buf[MAXPATHLEN] = "";
-static const char *file_pattern = "-stdout-"; /* "log%d.log"; */
+static const char *file_pattern = "-stdout-";   /* "log%d.log"; */
 static const char *default_file_pattern = "dbg at W%w-@%d at T-%t at .log";
 static char temp_filename[MAXPATHLEN] = "";
-static int world_num  = 0;
+static int world_num = 0;
 static int world_rank = -1;
-static int which_rank = -1;             /* all ranks */
-static int    reset_time_origin = 1;
+static int which_rank = -1;     /* all ranks */
+static int reset_time_origin = 1;
 static double time_origin = 0.0;
 
 /* This variable is initialized to the appropriate threading level in
@@ -64,10 +70,10 @@ static double time_origin = 0.0;
  * here. */
 static int is_threaded = 0;
 
-static int dbg_usage( const char *, const char * );
-static int dbg_openfile(FILE **dbg_fp);
-static int dbg_set_class( const char * );
-static int dbg_set_level( const char *, const char *(names[]) );
+static int dbg_usage(const char *, const char *);
+static int dbg_openfile(FILE ** dbg_fp);
+static int dbg_set_class(const char *);
+static int dbg_set_level(const char *, const char *(names[]));
 static int dbg_get_filename(char *filename, int len);
 
 #if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
@@ -77,21 +83,21 @@ static MPL_thread_tls_t dbg_tls_key;
 static FILE *dbg_static_fp = 0;
 
 /*
-   This function finds the basename in a path (ala "man 1 basename").
-   *basename will point to an element in path.
-   More formally: This function sets basename to the character just after the last '/' in path.
+ * This function finds the basename in a path (ala "man 1 basename").
+ * *basename will point to an element in path.
+ * More formally: This function sets basename to the character just
+ * after the last '/' in path.
 */
 static void find_basename(char *path, char **basename)
 {
     char *c;
 
     c = *basename = path;
-    while (*c)
-    {
+    while (*c) {
         if (*c == '/')
-            *basename = c+1;
+            *basename = c + 1;
         ++c;
-    } 
+    }
 }
 
 static int dbg_init_tls(void)
@@ -123,7 +129,7 @@ static FILE *get_fp(void)
     return dbg_static_fp;
 }
 
-static void set_fp(FILE *fp)
+static void set_fp(FILE * fp)
 {
 #if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
     int err;
@@ -131,7 +137,7 @@ static void set_fp(FILE *fp)
      * only be one thread in here until then */
     if (is_threaded) {
         if (dbg_initialized == DBG_INITIALIZED) {
-            MPL_thread_tls_set(&dbg_tls_key, (void *)fp, &err);
+            MPL_thread_tls_set(&dbg_tls_key, (void *) fp, &err);
             return;
         }
     }
@@ -140,21 +146,21 @@ static void set_fp(FILE *fp)
     dbg_static_fp = fp;
 }
 
-int MPIU_DBG_Outevent( const char *file, int line, int class, int kind, 
-		       const char *fmat, ... )
+int MPIU_DBG_Outevent(const char *file, int line, int class, int kind, const char *fmat, ...)
 {
     int mpi_errno = MPI_SUCCESS;
     va_list list;
     char *str, stmp[MPIU_DBG_MAXLINE];
-    int  i;
+    int i;
     void *p;
     MPL_time_t t;
-    double  curtime;
-    unsigned long long int threadID  = 0;
+    double curtime;
+    unsigned long long int threadID = 0;
     int pid = -1;
     FILE *dbg_fp = NULL;
 
-    if (dbg_initialized == DBG_UNINIT || dbg_initialized == DBG_ERROR) goto fn_exit;
+    if (dbg_initialized == DBG_UNINIT || dbg_initialized == DBG_ERROR)
+        goto fn_exit;
 
     dbg_fp = get_fp();
 
@@ -163,80 +169,77 @@ int MPIU_DBG_Outevent( const char *file, int line, int class, int kind,
         /* the thread ID is not necessarily unique between processes, so a
          * (pid,tid) pair should be used to uniquely identify output from
          * particular threads on a system */
-	MPL_thread_id_t tid;
-	MPL_thread_self(&tid);
-	threadID = (unsigned long long int)tid;
+        MPL_thread_id_t tid;
+        MPL_thread_self(&tid);
+        threadID = (unsigned long long int) tid;
     }
 #endif
 #if defined(HAVE_GETPID)
-    pid = (int)getpid();
+    pid = (int) getpid();
 #endif /* HAVE_GETPID */
 
     if (!dbg_fp) {
-	mpi_errno = dbg_openfile(&dbg_fp);
-        if (mpi_errno) goto fn_fail;
+        mpi_errno = dbg_openfile(&dbg_fp);
+        if (mpi_errno)
+            goto fn_fail;
         set_fp(dbg_fp);
     }
 
-    MPL_wtime( &t );
-    MPL_wtime_todouble( &t, &curtime );
+    MPL_wtime(&t);
+    MPL_wtime_todouble(&t, &curtime);
     curtime = curtime - time_origin;
 
     /* The kind values are used with the macros to simplify these cases */
     switch (kind) {
-	case 0:
-	    va_start(list,fmat);
-	    str = va_arg(list,char *);
-	    fprintf( dbg_fp, "%d\t%d\t%llx[%d]\t%d\t%f\t%s\t%d\t%s\n",
-		     world_num, world_rank, threadID, pid, class, curtime, 
-		     file, line, str );
-	    break;
-	case 1:
-	    va_start(list,fmat);
-	    str = va_arg(list,char *);
-	    MPL_snprintf( stmp, sizeof(stmp), fmat, str );
-	    va_end(list);
-	    fprintf( dbg_fp, "%d\t%d\t%llx[%d]\t%d\t%f\t%s\t%d\t%s\n",
-		     world_num, world_rank, threadID, pid, class, curtime, 
-		     file, line, stmp );
-	    break;
-	case 2: 
-	    va_start(list,fmat);
-	    i = va_arg(list,int);
-	    MPL_snprintf( stmp, sizeof(stmp), fmat, i);
-	    va_end(list);
-	    fprintf( dbg_fp, "%d\t%d\t%llx[%d]\t%d\t%f\t%s\t%d\t%s\n",
-		     world_num, world_rank, threadID, pid, class, curtime, 
-		     file, line, stmp );
-	    break;
-	case 3: 
-	    va_start(list,fmat);
-	    p = va_arg(list,void *);
-	    MPL_snprintf( stmp, sizeof(stmp), fmat, p);
-	    va_end(list);
-	    fprintf( dbg_fp, "%d\t%d\t%llx[%d]\t%d\t%f\t%s\t%d\t%s\n",
-		     world_num, world_rank, threadID, pid, class, curtime, 
-		     file, line, stmp );
-	    break;
-        default:
-	    break;
+    case 0:
+        va_start(list, fmat);
+        str = va_arg(list, char *);
+        fprintf(dbg_fp, "%d\t%d\t%llx[%d]\t%d\t%f\t%s\t%d\t%s\n",
+                world_num, world_rank, threadID, pid, class, curtime, file, line, str);
+        break;
+    case 1:
+        va_start(list, fmat);
+        str = va_arg(list, char *);
+        MPL_snprintf(stmp, sizeof(stmp), fmat, str);
+        va_end(list);
+        fprintf(dbg_fp, "%d\t%d\t%llx[%d]\t%d\t%f\t%s\t%d\t%s\n",
+                world_num, world_rank, threadID, pid, class, curtime, file, line, stmp);
+        break;
+    case 2:
+        va_start(list, fmat);
+        i = va_arg(list, int);
+        MPL_snprintf(stmp, sizeof(stmp), fmat, i);
+        va_end(list);
+        fprintf(dbg_fp, "%d\t%d\t%llx[%d]\t%d\t%f\t%s\t%d\t%s\n",
+                world_num, world_rank, threadID, pid, class, curtime, file, line, stmp);
+        break;
+    case 3:
+        va_start(list, fmat);
+        p = va_arg(list, void *);
+        MPL_snprintf(stmp, sizeof(stmp), fmat, p);
+        va_end(list);
+        fprintf(dbg_fp, "%d\t%d\t%llx[%d]\t%d\t%f\t%s\t%d\t%s\n",
+                world_num, world_rank, threadID, pid, class, curtime, file, line, stmp);
+        break;
+    default:
+        break;
     }
     fflush(dbg_fp);
 
- fn_exit:
- fn_fail:
+  fn_exit:
+  fn_fail:
     return 0;
 }
 
-/* These are used to simplify the handling of options.  
+/* These are used to simplify the handling of options.
    To add a new name, add an dbg_classname element to the array
    classnames.  The "classbits" values are defined by MPIU_DBG_CLASS
-   in src/include/mpidbg.h 
+   in src/include/mpidbg.h
  */
 
 typedef struct dbg_classname {
-    int        classbits;
-    const char *ucname, *lcname; 
+    int classbits;
+    const char *ucname, *lcname;
 } dbg_classname;
 
 #define MAX_DBG_CLASSNAMES (sizeof(unsigned int) * 8)
@@ -248,10 +251,13 @@ static const char *unregistered_classes[MAX_DBG_CLASSNAMES];
 static int num_unregistered_classes = 0;
 
 /* Because the level values are simpler and are rarely changed, these
-   use a simple set of parallel arrays */
-static const int  level_values[] = { MPIU_DBG_TERSE,
-					 MPIU_DBG_TYPICAL,
-					 MPIU_DBG_VERBOSE, 100 };
+ * use a simple set of parallel arrays */
+static const int level_values[] = {
+    MPIU_DBG_TERSE,
+    MPIU_DBG_TYPICAL,
+    MPIU_DBG_VERBOSE,
+    100
+};
 static const char *level_name[] = { "TERSE", "TYPICAL", "VERBOSE", 0 };
 static const char *lc_level_name[] = { "terse", "typical", "verbose", 0 };
 
@@ -296,136 +302,138 @@ MPIU_DBG_Class MPIU_DBG_Class_alloc(const char *ucname, const char *lcname)
     return (class >> 1);
 }
 
-/* 
- * Initialize the DBG_MSG system.  This is called during the job initialization to process
- * command-line arguments as well as checking the MPICH_DBG environment
- * variables.  The initialization is split into two steps: a preinit and an 
- * init. This makes it possible to enable most of the features before
- * the full initialization, where a significant amount of the initialization takes place.
+/*
+ * Initialize the DBG_MSG system.  This is called during the job
+ * initialization to process command-line arguments as well as
+ * checking the MPICH_DBG environment variables.  The initialization
+ * is split into two steps: a preinit and an init. This makes it
+ * possible to enable most of the features before the full
+ * initialization, where a significant amount of the initialization
+ * takes place.
  */
 
-static int dbg_process_args( int *argc_p, char ***argv_p )
+static int dbg_process_args(int *argc_p, char ***argv_p)
 {
     int i, rc;
 
     /* Here's where we do the same thing with the command-line options */
     if (argc_p) {
-	for (i=1; i<*argc_p; i++) {
-	    if (strncmp((*argv_p)[i],"-mpich-dbg", 10) == 0) {
-		char *s = (*argv_p)[i] + 10;
-		/* Found a command */
-		if (*s == 0) {
-		    /* Just -mpich-dbg */
-		    MPIU_DBG_MaxLevel      = MPIU_DBG_TYPICAL;
-		    MPIU_DBG_ActiveClasses = MPIU_DBG_ALL;
-		}
-		else if (*s == '=') {
-		    /* look for file */
-		    MPIU_DBG_MaxLevel      = MPIU_DBG_TYPICAL;
-		    MPIU_DBG_ActiveClasses = MPIU_DBG_ALL;
-		    s++;
-		    if (strncmp( s, "file", 4 ) == 0) {
-			file_pattern = default_file_pattern;
-		    }
-		}
-		else if (strncmp(s,"-level",6) == 0) {
-		    char *p = s + 6;
-		    if (*p == '=') {
-			p++;
-			rc = dbg_set_level( p, lc_level_name );
-			if (rc) 
-			    dbg_usage( "-mpich-dbg-level", "terse, typical, verbose" );
-		    }
-		}
-		else if (strncmp(s,"-class",6) == 0) {
-		    char *p = s + 6;
-		    if (*p == '=') {
-			p++;
-			rc = dbg_set_class( p );
-			if (rc)
-			    dbg_usage( "-mpich-dbg-class", 0 );
-		    }
-		}
-		else if (strncmp( s, "-filename", 9 ) == 0) {
-		    char *p = s + 9;
-		    if (*p == '=') {
-			p++;
-			/* A special case for a filepattern of "-default",
-			   use the predefined default pattern */
-			if (strcmp( p, "-default" ) == 0) {
-			    file_pattern = default_file_pattern;
-			}
-			else {
+        for (i = 1; i < *argc_p; i++) {
+            if (strncmp((*argv_p)[i], "-mpich-dbg", 10) == 0) {
+                char *s = (*argv_p)[i] + 10;
+                /* Found a command */
+                if (*s == 0) {
+                    /* Just -mpich-dbg */
+                    MPIU_DBG_MaxLevel = MPIU_DBG_TYPICAL;
+                    MPIU_DBG_ActiveClasses = MPIU_DBG_ALL;
+                }
+                else if (*s == '=') {
+                    /* look for file */
+                    MPIU_DBG_MaxLevel = MPIU_DBG_TYPICAL;
+                    MPIU_DBG_ActiveClasses = MPIU_DBG_ALL;
+                    s++;
+                    if (strncmp(s, "file", 4) == 0) {
+                        file_pattern = default_file_pattern;
+                    }
+                }
+                else if (strncmp(s, "-level", 6) == 0) {
+                    char *p = s + 6;
+                    if (*p == '=') {
+                        p++;
+                        rc = dbg_set_level(p, lc_level_name);
+                        if (rc)
+                            dbg_usage("-mpich-dbg-level", "terse, typical, verbose");
+                    }
+                }
+                else if (strncmp(s, "-class", 6) == 0) {
+                    char *p = s + 6;
+                    if (*p == '=') {
+                        p++;
+                        rc = dbg_set_class(p);
+                        if (rc)
+                            dbg_usage("-mpich-dbg-class", 0);
+                    }
+                }
+                else if (strncmp(s, "-filename", 9) == 0) {
+                    char *p = s + 9;
+                    if (*p == '=') {
+                        p++;
+                        /* A special case for a filepattern of "-default",
+                         * use the predefined default pattern */
+                        if (strcmp(p, "-default") == 0) {
+                            file_pattern = default_file_pattern;
+                        }
+                        else {
                             strncpy(file_pattern_buf, p, sizeof(file_pattern_buf));
-			    file_pattern = file_pattern_buf;
-			}
-		    }
-		}
-		else if (strncmp( s, "-rank", 5 ) == 0) {
-		    char *p = s + 5;
-		    if (*p == '=' && p[1] != 0) {
-			char *sOut;
-			p++;
-			which_rank = (int)strtol( p, &sOut, 10 );
-			if (p == sOut) {
-			    dbg_usage( "-mpich-dbg-rank", 0 );
-			    which_rank = -1;
-			}
-		    }
-		}
-		else {
-		    dbg_usage( (*argv_p)[i], 0 );
-		}
-		
-		/* Eventually, should null it out and reduce argc value */
-	    }
-	}
+                            file_pattern = file_pattern_buf;
+                        }
+                    }
+                }
+                else if (strncmp(s, "-rank", 5) == 0) {
+                    char *p = s + 5;
+                    if (*p == '=' && p[1] != 0) {
+                        char *sOut;
+                        p++;
+                        which_rank = (int) strtol(p, &sOut, 10);
+                        if (p == sOut) {
+                            dbg_usage("-mpich-dbg-rank", 0);
+                            which_rank = -1;
+                        }
+                    }
+                }
+                else {
+                    dbg_usage((*argv_p)[i], 0);
+                }
+
+                /* Eventually, should null it out and reduce argc value */
+            }
+        }
     }
     return MPI_SUCCESS;
 }
 
-static int dbg_process_env( void )
+static int dbg_process_env(void)
 {
     char *s;
     int rc;
 
-    s = getenv( "MPICH_DBG" );
+    s = getenv("MPICH_DBG");
     if (s) {
-	/* Set the defaults */
-	MPIU_DBG_MaxLevel = MPIU_DBG_TYPICAL;
-	MPIU_DBG_ActiveClasses = MPIU_DBG_ALL;
-	if (strncmp(s,"FILE",4) == 0) {
-	    file_pattern = default_file_pattern;
-	}
+        /* Set the defaults */
+        MPIU_DBG_MaxLevel = MPIU_DBG_TYPICAL;
+        MPIU_DBG_ActiveClasses = MPIU_DBG_ALL;
+        if (strncmp(s, "FILE", 4) == 0) {
+            file_pattern = default_file_pattern;
+        }
     }
-    s = getenv( "MPICH_DBG_LEVEL" );
+    s = getenv("MPICH_DBG_LEVEL");
     if (s) {
-	rc = dbg_set_level( s, level_name );
-	if (rc) 
-	    dbg_usage( "MPICH_DBG_LEVEL", "TERSE, TYPICAL, VERBOSE" );
+        rc = dbg_set_level(s, level_name);
+        if (rc)
+            dbg_usage("MPICH_DBG_LEVEL", "TERSE, TYPICAL, VERBOSE");
     }
 
-    s = getenv( "MPICH_DBG_CLASS" );
+    s = getenv("MPICH_DBG_CLASS");
     if (s) {
-        rc = dbg_set_class( s );
+        rc = dbg_set_class(s);
         if (rc)
-            dbg_usage( "MPICH_DBG_CLASS", 0 );
+            dbg_usage("MPICH_DBG_CLASS", 0);
     }
 
-    s = getenv( "MPICH_DBG_FILENAME" );
+    s = getenv("MPICH_DBG_FILENAME");
     if (s) {
         strncpy(file_pattern_buf, s, sizeof(file_pattern_buf));
         file_pattern = file_pattern_buf;
     }
 
-    s = getenv( "MPICH_DBG_RANK" );
+    s = getenv("MPICH_DBG_RANK");
     if (s) {
-	char *sOut;
-	which_rank = (int)strtol( s, &sOut, 10 );
-	if (s == sOut) {
-	    dbg_usage( "MPICH_DBG_RANK", 0 );
-	    which_rank = -1;
-	}
+        char *sOut;
+        which_rank = (int) strtol(s, &sOut, 10);
+        if (s == sOut) {
+            dbg_usage("MPICH_DBG_RANK", 0);
+            which_rank = -1;
+        }
     }
     return MPI_SUCCESS;
 }
@@ -433,36 +441,37 @@ static int dbg_process_env( void )
 MPIU_DBG_Class MPIU_DBG_ROUTINE_ENTER;
 MPIU_DBG_Class MPIU_DBG_ROUTINE_EXIT;
 MPIU_DBG_Class MPIU_DBG_ROUTINE;
-MPIU_DBG_Class MPIU_DBG_ALL = ~(0);  /* pre-initialize the ALL class */
+MPIU_DBG_Class MPIU_DBG_ALL = ~(0);     /* pre-initialize the ALL class */
 
 /*
- * Attempt to initialize the logging system.  This works only if the full initialization
- * is not required for updating the environment and/or command-line
- * arguments. 
+ * Attempt to initialize the logging system.  This works only if the
+ * full initialization is not required for updating the environment
+ * and/or command-line arguments.
  */
-int MPIU_DBG_PreInit( int *argc_p, char ***argv_p, int wtimeNotReady )
+int MPIU_DBG_PreInit(int *argc_p, char ***argv_p, int wtimeNotReady)
 {
     MPL_time_t t;
 
-    /* if the DBG_MSG system was already initialized, say by the device, then
-       return immediately */
-    if (dbg_initialized != DBG_UNINIT) return MPI_SUCCESS;
+    /* if the DBG_MSG system was already initialized, say by the
+     * device, then return immediately */
+    if (dbg_initialized != DBG_UNINIT)
+        return MPI_SUCCESS;
 
     if (dbg_init_tls())
         return MPIU_DBG_ERROR;
 
     /* Check to see if any debugging was selected.  The order of these
-       tests is important, as they allow general defaults to be set,
-       followed by more specific modifications */
+     * tests is important, as they allow general defaults to be set,
+     * followed by more specific modifications */
     /* First, the environment variables */
     dbg_process_env();
 
-    dbg_process_args( argc_p, argv_p );
+    dbg_process_args(argc_p, argv_p);
 
     if (wtimeNotReady == 0) {
-	MPL_wtime( &t );
-	MPL_wtime_todouble( &t, &time_origin );
-	reset_time_origin = 0;
+        MPL_wtime(&t);
+        MPL_wtime_todouble(&t, &time_origin);
+        reset_time_origin = 0;
     }
 
     /* Allocate the predefined classes */
@@ -481,17 +490,18 @@ int MPIU_DBG_PreInit( int *argc_p, char ***argv_p, int wtimeNotReady )
     return MPIU_DBG_SUCCESS;
 }
 
-int MPIU_DBG_Init( int *argc_p, char ***argv_p, int has_args, int has_env, 
-		   int wnum, int wrank, int threaded )
+int MPIU_DBG_Init(int *argc_p, char ***argv_p, int has_args, int has_env,
+                  int wnum, int wrank, int threaded)
 {
     int ret;
     FILE *dbg_fp = NULL;
 
-    /* if the DBG_MSG system was already initialized, say by the device, then
-       return immediately.  Note that the device is then responsible
-       for handling the file mode (e.g., reopen when the rank become 
-       available) */
-    if (dbg_initialized == DBG_INITIALIZED || dbg_initialized == DBG_ERROR) return MPI_SUCCESS;
+    /* if the DBG_MSG system was already initialized, say by the
+     * device, then return immediately.  Note that the device is then
+     * responsible for handling the file mode (e.g., reopen when the
+     * rank become available) */
+    if (dbg_initialized == DBG_INITIALIZED || dbg_initialized == DBG_ERROR)
+        return MPI_SUCCESS;
 
     if (dbg_initialized != DBG_PREINIT) {
         if (dbg_init_tls())
@@ -500,56 +510,56 @@ int MPIU_DBG_Init( int *argc_p, char ***argv_p, int has_args, int has_env,
 
     dbg_fp = get_fp();
 
-    /* We may need to wait until the device is set up to initialize the timer */
+    /* We may need to wait until the device is set up to initialize
+     * the timer */
     if (reset_time_origin) {
-	MPL_time_t t;
-	MPL_wtime( &t );
-	MPL_wtime_todouble( &t, &time_origin );
-	reset_time_origin = 0;
+        MPL_time_t t;
+        MPL_wtime(&t);
+        MPL_wtime_todouble(&t, &time_origin);
+        reset_time_origin = 0;
     }
     /* Check to see if any debugging was selected.  The order of these
-       tests is important, as they allow general defaults to be set,
-       followed by more specific modifications. */
-    /* Both of these may have already been set in the PreInit call; 
-       if the command line and/or environment variables are set before
-       the full initialization, then don't call the routines to check those values
-       (as they were already handled in DBG_PreInit) */
+     * tests is important, as they allow general defaults to be set,
+     * followed by more specific modifications. */
+    /* Both of these may have already been set in the PreInit call; if
+     * the command line and/or environment variables are set before
+     * the full initialization, then don't call the routines to check
+     * those values (as they were already handled in DBG_PreInit) */
     /* First, the environment variables */
-    if (!has_env) 
-	dbg_process_env();
+    if (!has_env)
+        dbg_process_env();
     /* Now the command-line arguments */
-    if (!has_args) 
-	dbg_process_args( argc_p, argv_p );
+    if (!has_args)
+        dbg_process_args(argc_p, argv_p);
 
     world_num = wnum;
     world_rank = wrank;
     is_threaded = threaded;
 
     if (which_rank >= 0 && which_rank != wrank) {
-	/* Turn off logging on this process */
-	MPIU_DBG_ActiveClasses = 0;
+        /* Turn off logging on this process */
+        MPIU_DBG_ActiveClasses = 0;
     }
 
     /* If the file has already been opened with a temp filename,
-       rename it. */
-    if (dbg_fp && dbg_fp != stdout && dbg_fp != stderr)
-    {
+     * rename it. */
+    if (dbg_fp && dbg_fp != stdout && dbg_fp != stderr) {
         char filename[MAXPATHLEN] = "";
-        
+
         dbg_get_filename(filename, MAXPATHLEN);
         ret = rename(temp_filename, filename);
-        if (ret){
+        if (ret) {
             /* Retry renaming file after closing it */
             fclose(dbg_fp);
             ret = rename(temp_filename, filename);
-            if(ret){
-                MPL_error_printf("Could not rename temp log file to %s\n", filename );
+            if (ret) {
+                MPL_error_printf("Could not rename temp log file to %s\n", filename);
                 goto fn_fail;
             }
-            else{
+            else {
                 dbg_fp = fopen(filename, "a+");
                 set_fp(dbg_fp);
-                if(dbg_fp == NULL){
+                if (dbg_fp == NULL) {
                     MPL_error_printf("Error re-opening log file, %s\n", filename);
                     goto fn_fail;
                 }
@@ -558,25 +568,24 @@ int MPIU_DBG_Init( int *argc_p, char ***argv_p, int has_args, int has_env,
     }
 
     dbg_initialized = DBG_INITIALIZED;
- fn_exit:
+
+  fn_exit:
     return MPI_SUCCESS;
- fn_fail:
+  fn_fail:
     dbg_initialized = DBG_ERROR;
     goto fn_exit;
 }
 
 /* Print the usage statement to stderr */
-static int dbg_usage( const char *cmd, const char *vals )
+static int dbg_usage(const char *cmd, const char *vals)
 {
     if (vals) {
-	fprintf( stderr, "Incorrect value for %s, should be one of %s\n",
-		 cmd, vals );
+        fprintf(stderr, "Incorrect value for %s, should be one of %s\n", cmd, vals);
     }
     else {
-	fprintf( stderr, "Incorrect value for %s\n", cmd );
+        fprintf(stderr, "Incorrect value for %s\n", cmd);
     }
-    fprintf( stderr, 
-"Command line for debug switches\n\
+    fprintf(stderr, "Command line for debug switches\n\
     -mpich-dbg-class=name[,name,...]\n\
     -mpich-dbg-level=name   (one of terse, typical, verbose)\n\
     -mpich-dbg-filename=pattern (includes %%d for world rank, %%t for thread id\n\
@@ -588,7 +597,7 @@ Environment variables\n\
     MPICH_DBG_LEVEL=NAME\n\
     MPICH_DBG_FILENAME=pattern\n\
     MPICH_DBG_RANK=val\n\
-    MPICH_DBG=YES or FILE\n", default_file_pattern );
+    MPICH_DBG=YES or FILE\n", default_file_pattern);
 
     fflush(stderr);
 
@@ -596,52 +605,59 @@ Environment variables\n\
 }
 
 #if defined (HAVE_MKSTEMP) && defined (HAVE_FDOPEN)
-/* creates a temporary file in the same directory the
-   user specified for the log file */
+
+/* creates a temporary file in the same directory the user specified
+ * for the log file */
 #undef FUNCNAME
 #define FUNCNAME dbg_open_tmpfile
 #undef FCNAME
 #define FCNAME MPL_QUOTE(FUNCNAME)
-static int dbg_open_tmpfile(FILE **dbg_fp)
+static int dbg_open_tmpfile(FILE ** dbg_fp)
 {
     int mpi_errno = MPI_SUCCESS;
     const char temp_pattern[] = "templogXXXXXX";
     int fd;
     char *basename;
     int ret;
-    
+
     ret = MPL_strncpy(temp_filename, file_pattern, MAXPATHLEN);
-    if (ret) goto fn_fail;
-    
+    if (ret)
+        goto fn_fail;
+
     find_basename(temp_filename, &basename);
 
     /* make sure there's enough room in temp_filename to store temp_pattern */
-    if (basename - temp_filename > MAXPATHLEN - sizeof(temp_pattern)) goto fn_fail;
-    
+    if (basename - temp_filename > MAXPATHLEN - sizeof(temp_pattern))
+        goto fn_fail;
+
     MPL_strncpy(basename, temp_pattern, sizeof(temp_pattern));
-    
+
     fd = mkstemp(temp_filename);
-    if (fd == -1) goto fn_fail;
+    if (fd == -1)
+        goto fn_fail;
 
     *dbg_fp = fdopen(fd, "a+");
-    if (*dbg_fp == NULL) goto fn_fail;
-    
- fn_exit:
+    if (*dbg_fp == NULL)
+        goto fn_fail;
+
+  fn_exit:
     return mpi_errno;
- fn_fail:
-    MPL_error_printf( "Could not open log file %s\n", temp_filename );
+  fn_fail:
+    MPL_error_printf("Could not open log file %s\n", temp_filename);
     dbg_initialized = DBG_ERROR;
     mpi_errno = MPI_ERR_INTERN;
     goto fn_exit;
 }
+
 #elif defined(HAVE__MKTEMP_S) && defined(HAVE_FOPEN_S)
-/* creates a temporary file in the same directory the
-   user specified for the log file */
+
+/* creates a temporary file in the same directory the user specified
+ * for the log file */
 #undef FUNCNAME
 #define FUNCNAME dbg_open_tmpfile
 #undef FCNAME
 #define FCNAME MPL_QUOTE(FUNCNAME)
-static int dbg_open_tmpfile(FILE **dbg_fp)
+static int dbg_open_tmpfile(FILE ** dbg_fp)
 {
     int mpi_errno = MPI_SUCCESS;
     const char temp_pattern[] = "templogXXXXXX";
@@ -649,44 +665,50 @@ static int dbg_open_tmpfile(FILE **dbg_fp)
     char *basename;
     int ret;
     errno_t ret_errno;
-    
+
     ret = MPL_strncpy(temp_filename, file_pattern, MAXPATHLEN);
-    if (ret) goto fn_fail;
+    if (ret)
+        goto fn_fail;
 
     find_basename(temp_filename, &basename);
 
     /* make sure there's enough room in temp_filename to store temp_pattern */
-    if (basename - temp_filename > MAXPATHLEN - sizeof(temp_pattern)) goto fn_fail;
+    if (basename - temp_filename > MAXPATHLEN - sizeof(temp_pattern))
+        goto fn_fail;
 
     MPL_strncpy(basename, temp_pattern, sizeof(temp_pattern));
-    
+
     ret_errno = _mktemp_s(temp_filename, MAXPATHLEN);
-    if (ret_errno != 0) goto fn_fail;
+    if (ret_errno != 0)
+        goto fn_fail;
 
     ret_errno = fopen_s(dbg_fp, temp_filename, "a+");
-    if (ret_errno != 0) goto fn_fail;
-    
- fn_exit:
+    if (ret_errno != 0)
+        goto fn_fail;
+
+  fn_exit:
     return mpi_errno;
- fn_fail:
-    MPL_error_printf( "Could not open log file %s\n", temp_filename );
+  fn_fail:
+    MPL_error_printf("Could not open log file %s\n", temp_filename);
     dbg_initialized = DBG_ERROR;
     mpi_errno = MPI_ERR_INTERN;
     goto fn_exit;
 }
+
 #else
-/* creates a temporary file in some directory, which may not be where
-   the user wants the log file.  When the file is renamed later, it
-   may require a copy.
 
-   Note that this is not safe: By the time we call fopen(), another
-   file with the same name may exist.  That file would get clobbered.
+/* creates a temporary file in some directory, which may not be where
+ * the user wants the log file.  When the file is renamed later, it
+ * may require a copy.
+ *
+ * Note that this is not safe: By the time we call fopen(), another
+ * file with the same name may exist.  That file would get clobbered.
 */
 #undef FUNCNAME
 #define FUNCNAME dbg_open_tmpfile
 #undef FCNAME
 #define FCNAME MPL_QUOTE(FUNCNAME)
-static int dbg_open_tmpfile(FILE **dbg_fp)
+static int dbg_open_tmpfile(FILE ** dbg_fp)
 {
     int mpi_errno = MPI_SUCCESS;
     const char temp_pattern[] = "templogXXXXXX";
@@ -696,15 +718,17 @@ static int dbg_open_tmpfile(FILE **dbg_fp)
     char *cret;
 
     cret = tmpnam(temp_filename);
-    if (cret == NULL) goto fn_fail;
+    if (cret == NULL)
+        goto fn_fail;
 
     *dbg_fp = fopen(temp_filename, "w");
-    if (*dbg_fp == NULL) goto fn_fail;
-    
- fn_exit:
+    if (*dbg_fp == NULL)
+        goto fn_fail;
+
+  fn_exit:
     return mpi_errno;
- fn_fail:
-    MPL_error_printf( "Could not open log file %s\n", temp_filename );
+  fn_fail:
+    MPL_error_printf("Could not open log file %s\n", temp_filename);
     dbg_initialized = DBG_ERROR;
     mpi_errno = MPI_ERR_INTERN;
     goto fn_exit;
@@ -713,11 +737,11 @@ static int dbg_open_tmpfile(FILE **dbg_fp)
 #endif
 
 /* This routine can make no MPI calls, since it may be logging those
-   calls. */
+ * calls. */
 static int dbg_get_filename(char *filename, int len)
 {
-    int withinMworld = 0,         /* True if within an @W...@ */
-	withinMthread = 0;        /* True if within an @T...@ */
+    int withinMworld = 0,       /* True if within an @W...@ */
+        withinMthread = 0;      /* True if within an @T...@ */
     /* FIXME: Need to know how many MPI_COMM_WORLDs are known */
 #if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
     unsigned long long int threadID = 0;
@@ -730,19 +754,19 @@ static int dbg_get_filename(char *filename, int len)
     const char *p;
 
     if (world_num == 1) {
-	world_numAsChar[0] = '1';
-	world_numAsChar[1] = '\0';
+        world_numAsChar[0] = '1';
+        world_numAsChar[1] = '\0';
     }
 
-    p     = file_pattern;
+    p = file_pattern;
     pDest = filename;
     *filename = 0;
-    while (*p && (pDest-filename) < len-1) {
+    while (*p && (pDest - filename) < len - 1) {
         /* There are two special cases that allow text to
-           be optionally included.  Those patterns are
-           @T...@ (only if multi-threaded) and
-           @W...@ (only if more than one MPI_COMM_WORLD) 
-           UNIMPLEMENTED/UNTESTED */
+         * be optionally included.  Those patterns are
+         * @T...@ (only if multi-threaded) and
+         * @W...@ (only if more than one MPI_COMM_WORLD)
+         * UNIMPLEMENTED/UNTESTED */
         if (*p == '@') {
             /* Escaped @? */
             if (p[1] == '@') {
@@ -775,20 +799,18 @@ static int dbg_get_filename(char *filename, int len)
                 }
             }
         }
-        else if ( (withinMworld && world_num == 0) ||
-                  (withinMthread && nThread == 1) ) {
+        else if ((withinMworld && world_num == 0) || (withinMthread && nThread == 1)) {
             /* Simply skip this character since we're not showing
-               this string */
+             * this string */
             p++;
         }
         else if (*p == '%') {
             p++;
             if (*p == 'd') {
                 char rankAsChar[20];
-                MPL_snprintf( rankAsChar, sizeof(rankAsChar), "%d", 
-                               world_rank );
+                MPL_snprintf(rankAsChar, sizeof(rankAsChar), "%d", world_rank);
                 *pDest = 0;
-                MPL_strnapp( filename, rankAsChar, len );
+                MPL_strnapp(filename, rankAsChar, len);
                 pDest += strlen(rankAsChar);
             }
             else if (*p == 't') {
@@ -796,12 +818,11 @@ static int dbg_get_filename(char *filename, int len)
                 char threadIDAsChar[30];
                 MPL_thread_id_t tid;
                 MPL_thread_self(&tid);
-                threadID = (unsigned long long int)tid;
+                threadID = (unsigned long long int) tid;
 
-                MPL_snprintf( threadIDAsChar, sizeof(threadIDAsChar), 
-                               "%llx", threadID );
+                MPL_snprintf(threadIDAsChar, sizeof(threadIDAsChar), "%llx", threadID);
                 *pDest = 0;
-                MPL_strnapp( filename, threadIDAsChar, len );
+                MPL_strnapp(filename, threadIDAsChar, len);
                 pDest += strlen(threadIDAsChar);
 #else
                 *pDest++ = '0';
@@ -810,7 +831,7 @@ static int dbg_get_filename(char *filename, int len)
             else if (*p == 'w') {
                 /* *pDest++ = '0'; */
                 *pDest = 0;
-                MPL_strnapp( filename, world_numAsChar, len );
+                MPL_strnapp(filename, world_numAsChar, len);
                 pDest += strlen(world_numAsChar);
             }
             else if (*p == 'p') {
@@ -821,9 +842,9 @@ static int dbg_get_filename(char *filename, int len)
 #else
                 int pid = -1;
 #endif /* HAVE_GETPID */
-                MPL_snprintf( pidAsChar, sizeof(pidAsChar), "%d", (int)pid );
+                MPL_snprintf(pidAsChar, sizeof(pidAsChar), "%d", (int) pid);
                 *pDest = 0;
-                MPL_strnapp( filename, pidAsChar, len );
+                MPL_strnapp(filename, pidAsChar, len);
                 pDest += strlen(pidAsChar);
             }
             else {
@@ -837,62 +858,63 @@ static int dbg_get_filename(char *filename, int len)
         }
     }
     *pDest = 0;
-    
+
     return 0;
 }
 
 /* This routine can make no MPI calls, since it may be logging those
-   calls. */
-static int dbg_openfile(FILE **dbg_fp)
+ * calls. */
+static int dbg_openfile(FILE ** dbg_fp)
 {
     int mpi_errno = MPI_SUCCESS;
-    if (!file_pattern || *file_pattern == 0 ||
-	strcmp(file_pattern, "-stdout-" ) == 0) {
-	*dbg_fp = stdout;
+    if (!file_pattern || *file_pattern == 0 || strcmp(file_pattern, "-stdout-") == 0) {
+        *dbg_fp = stdout;
     }
-    else if (strcmp( file_pattern, "-stderr-" ) == 0) {
-	*dbg_fp = stderr;
+    else if (strcmp(file_pattern, "-stderr-") == 0) {
+        *dbg_fp = stderr;
     }
     else {
-	char filename[MAXPATHLEN];
+        char filename[MAXPATHLEN];
 
         /* if we're not at DBG_INITIALIZED, we don't know our
-           rank yet, so we create a temp file, to be renamed later */
-        if (dbg_initialized != DBG_INITIALIZED) 
-        {
+         * rank yet, so we create a temp file, to be renamed later */
+        if (dbg_initialized != DBG_INITIALIZED) {
             mpi_errno = dbg_open_tmpfile(dbg_fp);
-            if (mpi_errno) goto fn_fail;
+            if (mpi_errno)
+                goto fn_fail;
         }
-        else 
-        {
+        else {
             mpi_errno = dbg_get_filename(filename, MAXPATHLEN);
-            if (mpi_errno) goto fn_fail;
+            if (mpi_errno)
+                goto fn_fail;
 
-            *dbg_fp = fopen( filename, "w" );
+            *dbg_fp = fopen(filename, "w");
             if (!*dbg_fp) {
-                MPL_error_printf( "Could not open log file %s\n", filename );
-                if (mpi_errno) goto fn_fail;
+                MPL_error_printf("Could not open log file %s\n", filename);
+                if (mpi_errno)
+                    goto fn_fail;
             }
         }
     }
- fn_exit:
+  fn_exit:
     return mpi_errno;
- fn_fail:
+  fn_fail:
     dbg_initialized = DBG_ERROR;
     mpi_errno = MPI_ERR_INTERN;
     goto fn_exit;
 }
 
 /* Support routines for processing mpich-dbg values */
-/* Update the GLOBAL variable MPIU_DBG_ActiveClasses with
-   the bits corresponding to this name */
-static int dbg_set_class( const char *s )
+/* Update the GLOBAL variable MPIU_DBG_ActiveClasses with the bits
+ * corresponding to this name */
+static int dbg_set_class(const char *s)
 {
     int i, found_match;
     size_t slen = 0;
     char *str;
 
-    if (s && *s) slen = strlen(s);
+    if (s && *s)
+        slen = strlen(s);
 
     str = strtok((char *) s, ",");
     while (str) {
@@ -923,18 +945,17 @@ static int dbg_set_class( const char *s )
     return 0;
 }
 
-/* Set the global MPIU_DBG_MaxLevel if there is a match with the known level
-   names 
-*/
-static int dbg_set_level( const char *s, const char *(names[]) )
+/* Set the global MPIU_DBG_MaxLevel if there is a match with the known
+ * level names */
+static int dbg_set_level(const char *s, const char *(names[]))
 {
     int i;
 
-    for (i=0; names[i]; i++) {
-	if (strcmp( names[i], s ) == 0) {
-	    MPIU_DBG_MaxLevel = level_values[i];
-	    return 0;
-	}
+    for (i = 0; names[i]; i++) {
+        if (strcmp(names[i], s) == 0) {
+            MPIU_DBG_MaxLevel = level_values[i];
+            return 0;
+        }
     }
     return 1;
 }
diff --git a/src/util/dbg/mpidbg.h b/src/util/dbg/mpidbg.h
index 280b92c..9d3f237 100644
--- a/src/util/dbg/mpidbg.h
+++ b/src/util/dbg/mpidbg.h
@@ -1,10 +1,12 @@
 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*  
+/*
  *  (C) 2005 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
  */
+
 #ifndef MPIDBG_H_INCLUDED
 #define MPIDBG_H_INCLUDED
+
 #include <stdio.h>
 #include <stdarg.h>
 #include "mpl.h"
@@ -21,25 +23,37 @@
  */
 
 #ifdef USE_DBG_LOGGING
-#define MPIU_DBG_SELECTED(_class,_level) \
-   ((_class & MPIU_DBG_ActiveClasses) && \
-          MPIU_DBG_##_level <= MPIU_DBG_MaxLevel)
-#define MPIU_DBG_MSG(_class,_level,_string)  \
-   {if ( (_class & MPIU_DBG_ActiveClasses) && \
-          MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) {\
-     MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 0, "%s", _string ); }}
-#define MPIU_DBG_MSG_S(_class,_level,_fmat,_string) \
-   {if ( (_class & MPIU_DBG_ActiveClasses) && \
-          MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) {\
-     MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 1, _fmat, _string ); }}
-#define MPIU_DBG_MSG_D(_class,_level,_fmat,_int) \
-   {if ( (_class & MPIU_DBG_ActiveClasses) && \
-          MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) {\
-     MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 2, _fmat, _int ); }}
-#define MPIU_DBG_MSG_P(_class,_level,_fmat,_pointer) \
-   {if ( (_class & MPIU_DBG_ActiveClasses) && \
-          MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) {\
-     MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 3, _fmat, _pointer ); }}
+
+#define MPIU_DBG_SELECTED(_class, _level)       \
+    ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel)
+
+#define MPIU_DBG_MSG(_class, _level, _string)                           \
+    {                                                                   \
+        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
+            MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _string); \
+        }                                                               \
+    }
+
+#define MPIU_DBG_MSG_S(_class, _level, _fmat, _string)                  \
+    {                                                                   \
+        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
+            MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 1, _fmat, _string); \
+        }                                                               \
+    }
+
+#define MPIU_DBG_MSG_D(_class, _level, _fmat, _int)                     \
+    {                                                                   \
+        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
+            MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 2, _fmat, _int); \
+        }                                                               \
+    }
+
+#define MPIU_DBG_MSG_P(_class, _level, _fmat, _pointer)                 \
+    {                                                                   \
+        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
+            MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 3, _fmat, _pointer); \
+        }                                                               \
+    }
 
 #define MPIU_DBG_MAXLINE 256
 #define MPIU_DBG_FDEST _s,(size_t)MPIU_DBG_MAXLINE
@@ -47,32 +61,42 @@
   MPIU_DBG_MSG_FMT - General debugging output macro
 
   Notes:
-  To use this macro, the third argument should be an "sprintf" - style 
+  To use this macro, the third argument should be an "sprintf" - style
   argument, using MPIU_DBG_FDEST as the buffer argument.  For example,
 .vb
     MPIU_DBG_MSG_FMT(CMM,VERBOSE,(MPIU_DBG_FDEST,"fmat",args...));
-.ve  
+.ve
   M*/
-#define MPIU_DBG_MSG_FMT(_class,_level,_fmatargs) \
-   {if ( (_class & MPIU_DBG_ActiveClasses) && \
-          MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) {\
-          char _s[MPIU_DBG_MAXLINE]; \
-          MPL_snprintf _fmatargs ; \
-     MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 0, "%s", _s ); }}
-#define MPIU_DBG_STMT(_class,_level,_stmt) \
-   {if ( (_class & MPIU_DBG_ActiveClasses) && \
-          MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) { _stmt; }}
-
-#define MPIU_DBG_OUT(_class,_msg) \
-    MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 0, "%s", _msg )
-#define MPIU_DBG_OUT_FMT(_class,_fmatargs) \
-    {     char _s[MPIU_DBG_MAXLINE]; \
-          MPL_snprintf _fmatargs ; \
-    MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 0, "%s", _s );}
+
+#define MPIU_DBG_MSG_FMT(_class, _level, _fmatargs)                     \
+    {                                                                   \
+        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
+            char _s[MPIU_DBG_MAXLINE];                                  \
+            MPL_snprintf _fmatargs ;                                    \
+            MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _s); \
+        }                                                               \
+    }
+
+#define MPIU_DBG_STMT(_class, _level, _stmt)                            \
+    {                                                                   \
+        if ((_class & MPIU_DBG_ActiveClasses) && MPIU_DBG_##_level <= MPIU_DBG_MaxLevel) { \
+            _stmt;                                                      \
+        }                                                               \
+    }
+
+#define MPIU_DBG_OUT(_class, _msg)                                      \
+    MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _msg)
+
+#define MPIU_DBG_OUT_FMT(_class,_fmatargs)                              \
+    {                                                                   \
+        char _s[MPIU_DBG_MAXLINE];                                      \
+        MPL_snprintf _fmatargs ;                                        \
+        MPIU_DBG_Outevent(__FILE__, __LINE__, _class, 0, "%s", _s);     \
+    }
 
 #else
 #define MPIU_DBG_SELECTED(_class,_level) 0
-#define MPIU_DBG_MSG(_class,_level,_string) 
+#define MPIU_DBG_MSG(_class,_level,_string)
 #define MPIU_DBG_MSG_S(_class,_level,_fmat,_string)
 #define MPIU_DBG_MSG_D(_class,_level,_fmat,_int)
 #define MPIU_DBG_MSG_P(_class,_level,_fmat,_int)
@@ -88,9 +112,11 @@
 typedef unsigned int MPIU_DBG_Class;
 
 /* Special constants */
-enum MPIU_DBG_LEVEL { MPIU_DBG_TERSE   = 0, 
-		      MPIU_DBG_TYPICAL = 50,
-		      MPIU_DBG_VERBOSE = 99 };
+enum MPIU_DBG_LEVEL {
+    MPIU_DBG_TERSE = 0,
+    MPIU_DBG_TYPICAL = 50,
+    MPIU_DBG_VERBOSE = 99
+};
 
 extern int MPIU_DBG_ActiveClasses;
 extern int MPIU_DBG_MaxLevel;
@@ -107,14 +133,17 @@ void MPIU_DBG_Class_register(MPIU_DBG_Class class, const char *ucname, const cha
     do {                                        \
         (class) = 0;                            \
     } while (0)
+
 #define MPIU_DBG_CLASS_APPEND(out_class, in_class)      \
     do {                                                \
         (out_class) |= (in_class);                      \
     } while (0)
 
-int MPIU_DBG_Outevent(const char *, int, int, int, const char *, ...) 
-                                        ATTRIBUTE((format(printf,5,6)));
-int MPIU_DBG_Init( int *, char ***, int, int, int, int, int );
-int MPIU_DBG_PreInit( int *, char ***, int );
+/* *INDENT-OFF* */
+int MPIU_DBG_Outevent(const char *, int, int, int, const char *, ...) ATTRIBUTE((format(printf, 5, 6)));
+/* *INDENT-ON* */
+
+int MPIU_DBG_Init(int *, char ***, int, int, int, int, int);
+int MPIU_DBG_PreInit(int *, char ***, int);
 
 #endif

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

commit f45a7cadf8f9637b87a45d2a6deffb83d46f6d01
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 21 22:02:11 2016 -0600

    mpidbg: return errors upstream.
    
    Don't simply abort on an error.  Let the upper layer deal with it.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index be3b838..5e0d413 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -94,14 +94,15 @@ static void find_basename(char *path, char **basename)
     } 
 }
 
-static void dbg_init_tls(void)
+static int dbg_init_tls(void)
 {
-#if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
-    int err;
+    int err = 0;
 
+#if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
     MPL_thread_tls_create(NULL, &dbg_tls_key, &err);
-    MPIU_Assert(err == 0);
 #endif
+
+    return err;
 }
 
 static FILE *get_fp(void)
@@ -447,7 +448,8 @@ int MPIU_DBG_PreInit( int *argc_p, char ***argv_p, int wtimeNotReady )
        return immediately */
     if (dbg_initialized != DBG_UNINIT) return MPI_SUCCESS;
 
-    dbg_init_tls();
+    if (dbg_init_tls())
+        return MPIU_DBG_ERROR;
 
     /* Check to see if any debugging was selected.  The order of these
        tests is important, as they allow general defaults to be set,
@@ -476,7 +478,7 @@ int MPIU_DBG_PreInit( int *argc_p, char ***argv_p, int wtimeNotReady )
 
     dbg_initialized = DBG_PREINIT;
 
-    return MPI_SUCCESS;
+    return MPIU_DBG_SUCCESS;
 }
 
 int MPIU_DBG_Init( int *argc_p, char ***argv_p, int has_args, int has_env, 
@@ -491,8 +493,10 @@ int MPIU_DBG_Init( int *argc_p, char ***argv_p, int has_args, int has_env,
        available) */
     if (dbg_initialized == DBG_INITIALIZED || dbg_initialized == DBG_ERROR) return MPI_SUCCESS;
 
-    if (dbg_initialized != DBG_PREINIT)
-        dbg_init_tls();
+    if (dbg_initialized != DBG_PREINIT) {
+        if (dbg_init_tls())
+            return MPIU_DBG_ERROR;
+    }
 
     dbg_fp = get_fp();
 
diff --git a/src/util/dbg/mpidbg.h b/src/util/dbg/mpidbg.h
index 8f42849..280b92c 100644
--- a/src/util/dbg/mpidbg.h
+++ b/src/util/dbg/mpidbg.h
@@ -82,6 +82,9 @@
 #define MPIU_DBG_OUT_FMT(_class,_fmtargs)
 #endif
 
+#define MPIU_DBG_SUCCESS  0
+#define MPIU_DBG_ERROR    1
+
 typedef unsigned int MPIU_DBG_Class;
 
 /* Special constants */

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

commit f155a7a191d8594c3d70c93fb1e87fa0b72a4bb4
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 21 18:43:19 2016 -0600

    mpidbg: move getfuncstack to a maint utility.
    
    The getfuncstack script is for parsing debug output to be presented in a
    pretty format.  It relies on the MPID function states for this parsing
    making it mpich-specific.  Move it outside the MPIU layer.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/.gitignore b/.gitignore
index 04b565a..97a978d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -109,6 +109,7 @@ apply-xfail.sh
 
 # the hooks dir shouldn't be accidentally committed
 /maint/hooks
+/maint/getfuncstack
 
 # directories copied by autogen.sh from other directories and (generally) should
 # not have any contents added directly to them
@@ -563,9 +564,6 @@ Makefile.am-stamp
 /src/pm/util/test/argstest
 /src/pm/util/test/forktest
 
-# /src/util/dbg/
-/src/util/dbg/getfuncstack
-
 # /src/util/logging/common/
 /src/util/logging/common/describe_states.c
 /src/util/logging/common/state_names.h
diff --git a/configure.ac b/configure.ac
index dc4b796..4d6c460 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5386,8 +5386,6 @@ dnl a build aborts due to an error (this is intended to help developers)
 AC_OUTPUT_COMMANDS([if [ ! -d lib ] ; then mkdir lib ; fi 
 date > lib/newconfig])
 
-AC_OUTPUT_COMMANDS([chmod a+x src/util/dbg/getfuncstack])
-
 AC_OUTPUT_COMMANDS([chmod a+x test/commands/cmdtests])
 
 
@@ -5661,7 +5659,6 @@ AC_OUTPUT(Makefile \
 	  src/env/mpifort.sh \
 	  src/env/mpifort.bash \
           src/env/parkill \
-	  src/util/dbg/getfuncstack \
           src/include/mpi.h \
           doc/design/Makefile \
           doc/installguide/Makefile \
diff --git a/maint/configure.ac b/maint/configure.ac
index ba71a63..8767c80 100644
--- a/maint/configure.ac
+++ b/maint/configure.ac
@@ -27,7 +27,7 @@ if test "$xargs_out" != "0" ; then
 fi
 AC_SUBST(XARGS_NODATA_OPT)
 
-AC_OUTPUT_COMMANDS([chmod a+x checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractcvars extractstates extractfixme createcoverage gcovmerge createhtmlindex])
+AC_OUTPUT_COMMANDS([chmod a+x checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractcvars extractstates extractfixme createcoverage gcovmerge createhtmlindex getfuncstack])
 # We have to redefine the variables that autoconf always substitutes and that
 # are used in simplemake
 CFLAGS='@CFLAGS@'
@@ -38,4 +38,4 @@ CXXFLAGS='@CXXFLAGS@'
 # autoconf replacement.
 # Note that top_srcdir and srcdir are special cases (they must not
 # be changed in configure.ac because configure uses them to find other files)
-AC_OUTPUT(checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractcvars extractstates extractfixme createcoverage gcovmerge createhtmlindex cvardirs)
+AC_OUTPUT(checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractcvars extractstates extractfixme createcoverage gcovmerge createhtmlindex cvardirs getfuncstack)
diff --git a/src/util/dbg/getfuncstack.in b/maint/getfuncstack.in
similarity index 100%
rename from src/util/dbg/getfuncstack.in
rename to maint/getfuncstack.in

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

commit 8ede598279eade2e26430d93e7febcfc6bbd180e
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 21 18:30:49 2016 -0600

    mpidbg: use MPL threads instead of MPID threads.
    
    Move from MPID thread routines to MPL thread routines to facilitate
    moving the debug code to MPL.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index f228370..be3b838 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -71,7 +71,7 @@ static int dbg_set_level( const char *, const char *(names[]) );
 static int dbg_get_filename(char *filename, int len);
 
 #if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
-static MPID_Thread_tls_t dbg_tls_key;
+static MPL_thread_tls_t dbg_tls_key;
 #endif
 
 static FILE *dbg_static_fp = 0;
@@ -99,7 +99,7 @@ static void dbg_init_tls(void)
 #if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
     int err;
 
-    MPID_Thread_tls_create(NULL, &dbg_tls_key, &err);
+    MPL_thread_tls_create(NULL, &dbg_tls_key, &err);
     MPIU_Assert(err == 0);
 #endif
 }
@@ -113,7 +113,7 @@ static FILE *get_fp(void)
     if (is_threaded) {
         if (dbg_initialized == DBG_INITIALIZED) {
             FILE *fp;
-            MPID_Thread_tls_get(&dbg_tls_key, (void **) &fp, &err);
+            MPL_thread_tls_get(&dbg_tls_key, (void **) &fp, &err);
             return fp;
         }
     }
@@ -130,7 +130,7 @@ static void set_fp(FILE *fp)
      * only be one thread in here until then */
     if (is_threaded) {
         if (dbg_initialized == DBG_INITIALIZED) {
-            MPID_Thread_tls_set(&dbg_tls_key, (void *)fp, &err);
+            MPL_thread_tls_set(&dbg_tls_key, (void *)fp, &err);
             return;
         }
     }
@@ -296,11 +296,11 @@ MPIU_DBG_Class MPIU_DBG_Class_alloc(const char *ucname, const char *lcname)
 }
 
 /* 
- * Initialize the DBG_MSG system.  This is called during MPI_Init to process
+ * Initialize the DBG_MSG system.  This is called during the job initialization to process
  * command-line arguments as well as checking the MPICH_DBG environment
  * variables.  The initialization is split into two steps: a preinit and an 
- * init. This makes it possible to enable most of the features before calling 
- * MPID_Init, where a significant amount of the initialization takes place.
+ * init. This makes it possible to enable most of the features before
+ * the full initialization, where a significant amount of the initialization takes place.
  */
 
 static int dbg_process_args( int *argc_p, char ***argv_p )
@@ -435,8 +435,8 @@ MPIU_DBG_Class MPIU_DBG_ROUTINE;
 MPIU_DBG_Class MPIU_DBG_ALL = ~(0);  /* pre-initialize the ALL class */
 
 /*
- * Attempt to initialize the logging system.  This works only if MPID_Init
- * is not responsible for updating the environment and/or command-line
+ * Attempt to initialize the logging system.  This works only if the full initialization
+ * is not required for updating the environment and/or command-line
  * arguments. 
  */
 int MPIU_DBG_PreInit( int *argc_p, char ***argv_p, int wtimeNotReady )
@@ -508,7 +508,7 @@ int MPIU_DBG_Init( int *argc_p, char ***argv_p, int has_args, int has_env,
        followed by more specific modifications. */
     /* Both of these may have already been set in the PreInit call; 
        if the command line and/or environment variables are set before
-       MPID_Init, then don't call the routines to check those values 
+       the full initialization, then don't call the routines to check those values
        (as they were already handled in DBG_PreInit) */
     /* First, the environment variables */
     if (!has_env) 

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

commit f12183882384d2a703af40d11b5b5b84f9d581c1
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 21 17:41:39 2016 -0600

    mpidbg: pass thread check in as a parameter.
    
    This is one step in making the debug code fully independent of the core
    mpich code.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index be89c41..1007c8d 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -543,7 +543,8 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
      * If the parent comm is not NULL, we always give the world number
      * as "1" (false). */
     MPIU_DBG_Init( argc, argv, has_args, has_env, 
-		   MPIR_Process.comm_parent != NULL, MPIR_Process.comm_world->rank );
+		   MPIR_Process.comm_parent != NULL, MPIR_Process.comm_world->rank,
+                   MPIR_ThreadInfo.isThreaded );
 
     MPIR_DBG_INIT = MPIU_DBG_Class_alloc("INIT", "init");
     MPIR_DBG_PT2PT = MPIU_DBG_Class_alloc("PT2PT", "pt2pt");
diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index c65fded..f228370 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -58,6 +58,12 @@ static int which_rank = -1;             /* all ranks */
 static int    reset_time_origin = 1;
 static double time_origin = 0.0;
 
+/* This variable is initialized to the appropriate threading level in
+ * the DBG_Init call.  Before the debug init, the application cannot
+ * be threaded, anyway.  So it is safe to statically set it to "0"
+ * here. */
+static int is_threaded = 0;
+
 static int dbg_usage( const char *, const char * );
 static int dbg_openfile(FILE **dbg_fp);
 static int dbg_set_class( const char * );
@@ -104,13 +110,13 @@ static FILE *get_fp(void)
     int err;
     /* if we're not initialized, use the static fp, since there should
      * only be one thread in here until then */
-    MPIR_THREAD_CHECK_BEGIN;
-    if (dbg_initialized == DBG_INITIALIZED) {
-        FILE *fp;
-        MPID_Thread_tls_get(&dbg_tls_key, (void **) &fp, &err);
-        return fp;
+    if (is_threaded) {
+        if (dbg_initialized == DBG_INITIALIZED) {
+            FILE *fp;
+            MPID_Thread_tls_get(&dbg_tls_key, (void **) &fp, &err);
+            return fp;
+        }
     }
-    MPIR_THREAD_CHECK_END;
 #endif
 
     return dbg_static_fp;
@@ -122,12 +128,12 @@ static void set_fp(FILE *fp)
     int err;
     /* if we're not initialized, use the static fp, since there should
      * only be one thread in here until then */
-    MPIR_THREAD_CHECK_BEGIN;
-    if (dbg_initialized == DBG_INITIALIZED) {
-        MPID_Thread_tls_set(&dbg_tls_key, (void *)fp, &err);
-        return;
+    if (is_threaded) {
+        if (dbg_initialized == DBG_INITIALIZED) {
+            MPID_Thread_tls_set(&dbg_tls_key, (void *)fp, &err);
+            return;
+        }
     }
-    MPIR_THREAD_CHECK_END;
 #endif
 
     dbg_static_fp = fp;
@@ -474,7 +480,7 @@ int MPIU_DBG_PreInit( int *argc_p, char ***argv_p, int wtimeNotReady )
 }
 
 int MPIU_DBG_Init( int *argc_p, char ***argv_p, int has_args, int has_env, 
-		   int wnum, int wrank )
+		   int wnum, int wrank, int threaded )
 {
     int ret;
     FILE *dbg_fp = NULL;
@@ -513,6 +519,7 @@ int MPIU_DBG_Init( int *argc_p, char ***argv_p, int has_args, int has_env,
 
     world_num = wnum;
     world_rank = wrank;
+    is_threaded = threaded;
 
     if (which_rank >= 0 && which_rank != wrank) {
 	/* Turn off logging on this process */
diff --git a/src/util/dbg/mpidbg.h b/src/util/dbg/mpidbg.h
index 0bcdbe2..8f42849 100644
--- a/src/util/dbg/mpidbg.h
+++ b/src/util/dbg/mpidbg.h
@@ -111,7 +111,7 @@ void MPIU_DBG_Class_register(MPIU_DBG_Class class, const char *ucname, const cha
 
 int MPIU_DBG_Outevent(const char *, int, int, int, const char *, ...) 
                                         ATTRIBUTE((format(printf,5,6)));
-int MPIU_DBG_Init( int *, char ***, int, int, int, int );
+int MPIU_DBG_Init( int *, char ***, int, int, int, int, int );
 int MPIU_DBG_PreInit( int *, char ***, int );
 
 #endif

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

commit aef5988e0db730679f8de5958587ff77dfbc7bdc
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 21 17:36:30 2016 -0600

    mpidbg: use MPL check instead of MPICH check.
    
    This is one step in moving dbg out of the core mpich stack.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index d24cc52..c65fded 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -11,6 +11,7 @@
  */
 
 #include "mpiimpl.h"
+#include "mpl.h"
 
 #include <stdio.h>
 #ifdef HAVE_STDARG_H
@@ -63,7 +64,7 @@ static int dbg_set_class( const char * );
 static int dbg_set_level( const char *, const char *(names[]) );
 static int dbg_get_filename(char *filename, int len);
 
-#ifdef MPICH_IS_THREADED
+#if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
 static MPID_Thread_tls_t dbg_tls_key;
 #endif
 
@@ -89,7 +90,7 @@ static void find_basename(char *path, char **basename)
 
 static void dbg_init_tls(void)
 {
-#ifdef MPICH_IS_THREADED
+#if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
     int err;
 
     MPID_Thread_tls_create(NULL, &dbg_tls_key, &err);
@@ -99,7 +100,7 @@ static void dbg_init_tls(void)
 
 static FILE *get_fp(void)
 {
-#ifdef MPICH_IS_THREADED
+#if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
     int err;
     /* if we're not initialized, use the static fp, since there should
      * only be one thread in here until then */
@@ -117,7 +118,7 @@ static FILE *get_fp(void)
 
 static void set_fp(FILE *fp)
 {
-#ifdef MPICH_IS_THREADED
+#if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
     int err;
     /* if we're not initialized, use the static fp, since there should
      * only be one thread in here until then */
@@ -150,7 +151,7 @@ int MPIU_DBG_Outevent( const char *file, int line, int class, int kind,
 
     dbg_fp = get_fp();
 
-#ifdef MPICH_IS_THREADED
+#if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
     {
         /* the thread ID is not necessarily unique between processes, so a
          * (pid,tid) pair should be used to uniquely identify output from
@@ -707,7 +708,7 @@ static int dbg_get_filename(char *filename, int len)
     int withinMworld = 0,         /* True if within an @W...@ */
 	withinMthread = 0;        /* True if within an @T...@ */
     /* FIXME: Need to know how many MPI_COMM_WORLDs are known */
-#ifdef MPICH_IS_THREADED
+#if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
     unsigned long long int threadID = 0;
     int nThread = 2;
 #else
@@ -780,7 +781,7 @@ static int dbg_get_filename(char *filename, int len)
                 pDest += strlen(rankAsChar);
             }
             else if (*p == 't') {
-#ifdef MPICH_IS_THREADED
+#if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE)
                 char threadIDAsChar[30];
                 MPL_thread_id_t tid;
                 MPL_thread_self(&tid);
@@ -793,7 +794,7 @@ static int dbg_get_filename(char *filename, int len)
                 pDest += strlen(threadIDAsChar);
 #else
                 *pDest++ = '0';
-#endif /* MPICH_IS_THREADED */
+#endif /* MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE */
             }
             else if (*p == 'w') {
                 /* *pDest++ = '0'; */

http://git.mpich.org/mpich.git/commitdiff/7537e6cf1c1d5959f7a60998488b415482e5c718

commit 7537e6cf1c1d5959f7a60998488b415482e5c718
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 21 14:24:22 2016 -0600

    mpidbg: pass world id as argument to the debug code.
    
    The debug code should not directly access the MPIR structures where
    possible.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 9e49d6e..be89c41 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -539,8 +539,11 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
        leaks in the "active" code */
 #endif
 #ifdef USE_DBG_LOGGING
+    /* FIXME: This is a hack to handle the common case of two worlds.
+     * If the parent comm is not NULL, we always give the world number
+     * as "1" (false). */
     MPIU_DBG_Init( argc, argv, has_args, has_env, 
-		   MPIR_Process.comm_world->rank );
+		   MPIR_Process.comm_parent != NULL, MPIR_Process.comm_world->rank );
 
     MPIR_DBG_INIT = MPIU_DBG_Class_alloc("INIT", "init");
     MPIR_DBG_PT2PT = MPIU_DBG_Class_alloc("PT2PT", "pt2pt");
diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index 1d0f12a..d24cc52 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -473,7 +473,7 @@ int MPIU_DBG_PreInit( int *argc_p, char ***argv_p, int wtimeNotReady )
 }
 
 int MPIU_DBG_Init( int *argc_p, char ***argv_p, int has_args, int has_env, 
-		   int wrank )
+		   int wnum, int wrank )
 {
     int ret;
     FILE *dbg_fp = NULL;
@@ -510,6 +510,7 @@ int MPIU_DBG_Init( int *argc_p, char ***argv_p, int has_args, int has_env,
     if (!has_args) 
 	dbg_process_args( argc_p, argv_p );
 
+    world_num = wnum;
     world_rank = wrank;
 
     if (which_rank >= 0 && which_rank != wrank) {
@@ -706,7 +707,6 @@ static int dbg_get_filename(char *filename, int len)
     int withinMworld = 0,         /* True if within an @W...@ */
 	withinMthread = 0;        /* True if within an @T...@ */
     /* FIXME: Need to know how many MPI_COMM_WORLDs are known */
-    int nWorld = 1;
 #ifdef MPICH_IS_THREADED
     unsigned long long int threadID = 0;
     int nThread = 2;
@@ -717,9 +717,7 @@ static int dbg_get_filename(char *filename, int len)
     char *pDest;
     const char *p;
 
-    /* FIXME: This is a hack to handle the common case of two worlds */
-    if (MPIR_Process.comm_parent != NULL) {
-	nWorld = 2;
+    if (world_num == 1) {
 	world_numAsChar[0] = '1';
 	world_numAsChar[1] = '\0';
     }
@@ -765,7 +763,7 @@ static int dbg_get_filename(char *filename, int len)
                 }
             }
         }
-        else if ( (withinMworld && nWorld == 1) ||
+        else if ( (withinMworld && world_num == 0) ||
                   (withinMthread && nThread == 1) ) {
             /* Simply skip this character since we're not showing
                this string */
@@ -798,7 +796,6 @@ static int dbg_get_filename(char *filename, int len)
 #endif /* MPICH_IS_THREADED */
             }
             else if (*p == 'w') {
-                /* FIXME: Get world number */
                 /* *pDest++ = '0'; */
                 *pDest = 0;
                 MPL_strnapp( filename, world_numAsChar, len );
diff --git a/src/util/dbg/mpidbg.h b/src/util/dbg/mpidbg.h
index e5f08b8..0bcdbe2 100644
--- a/src/util/dbg/mpidbg.h
+++ b/src/util/dbg/mpidbg.h
@@ -111,7 +111,7 @@ void MPIU_DBG_Class_register(MPIU_DBG_Class class, const char *ucname, const cha
 
 int MPIU_DBG_Outevent(const char *, int, int, int, const char *, ...) 
                                         ATTRIBUTE((format(printf,5,6)));
-int MPIU_DBG_Init( int *, char ***, int, int, int );
+int MPIU_DBG_Init( int *, char ***, int, int, int, int );
 int MPIU_DBG_PreInit( int *, char ***, int );
 
 #endif

http://git.mpich.org/mpich.git/commitdiff/3226d099d87dd9f651f36aa616809446c92d206d

commit 3226d099d87dd9f651f36aa616809446c92d206d
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Jan 8 00:49:31 2016 -0600

    threads: initial move to MPL.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/confdb/ax_tls.m4 b/confdb/ax_tls.m4
index ef0f4d9..60657fa 100644
--- a/confdb/ax_tls.m4
+++ b/confdb/ax_tls.m4
@@ -85,10 +85,7 @@ AC_DEFUN([AX_TLS], [
 ])
 
   if test "$ac_cv_tls" != "none"; then
-    # MPICH modification: this was "TLS" before instead of
-    # "MPICH_TLS_SPECIFIER", but TLS had a reasonably high chance of conflicting
-    # with a system library.
-    AC_DEFINE_UNQUOTED([MPICH_TLS_SPECIFIER], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
+    AC_DEFINE_UNQUOTED([TLS_SPECIFIER], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
   fi
   AC_MSG_RESULT($ac_cv_tls)
 ])
diff --git a/configure.ac b/configure.ac
index 5326611..dc4b796 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4875,137 +4875,6 @@ dnl autoconf did this in a way that caused problems, paritcularly with
 dnl errors reported as inconsistent cache files.  Instead, we simply
 dnl invoke the configure scripts (if present) directly.
 
-#
-# -----------------------------------------------------------------------------
-# Configure threads first.  This is necessary to obtain all required
-# definitions, flags, and libraries that the other subsystems will need
-#
-# 
-# -----------------------------------------------------------------------------
-AC_ARG_WITH([thread-package],
-[  --with-thread-package=package     Thread package to use. Supported thread packages include:
-        posix or pthreads - POSIX threads (default, if required)
-        solaris - Solaris threads (Solaris OS only)
-        win - windows threads
-        none - no threads
-],,with_thread_package=posix)
-
-if test "${thread_pkg_required}" = "no" -o "${with_thread_package}" = "no" ; then
-   with_thread_package=none
-fi
-
-if test "${with_thread_package}" = "yes" ; then
-   with_thread_package=posix
-fi
-
-if test "${thread_pkg_required}" = "yes" -a "${with_thread_package}" = "none" ; then
-   AC_ERROR([if no thread package is available, use --enable-threads=single or funneled])
-fi
-
-MPICH_THREAD_PACKAGE_NAME=MPICH_THREAD_PACKAGE_INVALID
-case $with_thread_package in 
-    posix|pthreads)
-	with_thread_package=posix
-	AC_CHECK_HEADERS(pthread.h)
-
-        # If pthreads library is found, just include it on the link line. We don't try
-        # to test if the C compiler needs it or not, since the C++ or Fortran
-        # compilers might need it even if the C compiler doesn't
-        # (nvcc with gfortran, for example).
-        #
-        # OSF1 has __pthread_create but not pthread_create (because of
-        # inconsistencies in the pthread spec).  Thus, we look for pthread_key_create
-        AC_CHECK_LIB([pthread],[pthread_key_create],have_pthreads=yes)
-	if test "$have_pthreads" = "yes" ; then
-	   PAC_PREPEND_FLAG([-lpthread],[LIBS])
-	fi
-
-        AC_CHECK_FUNCS(pthread_yield)
-
-        # this check should come after the AC_CHECK_LIB for -lpthread
-        AC_CHECK_FUNC([pthread_key_create],[],[AC_MSG_ERROR([unable to find pthreads library])])
-
-	# Check for a routine that specify a routine to call on 
-	# thread exit.  We can use this to release memory that may
-	# be allocated by the MPICH library in the thread.  
-	# A complication: pthread_cleanup_push may be a macro; in that
-	# case, check_funcs will fail to find it.
-	# Under OSX, pthread_cleanup_push and pop are macros that must
-	# appear together in the same lexical scope, and hence are
-	# really useless in libraries that may allocate data within 
-	# a user-managed thread.
-	AC_CHECK_FUNCS(pthread_cleanup_push)
-	if test "$ac_cv_func_pthread_cleanup_push" = "no" ; then
-            AC_CACHE_CHECK([whether pthread_cleanup_push is available (may be a macro in pthread.h)],pac_cv_func_pthread_cleanup_push,[
-	    AC_TRY_LINK([
-#include <pthread.h>
-void f1(void *a) { return; }],
-[pthread_cleanup_push( f1, (void *)0 );],
-            pac_cv_func_pthread_cleanup_push=yes,
-            pac_cv_func_pthread_cleanup_push=no)])
-            if test "$pac_cv_func_pthread_cleanup_push" = yes ; then
-	        AC_DEFINE(HAVE_PTHREAD_CLEANUP_PUSH_MACRO,1,[Define if pthread_cleanup_push is available, even as a macro])
-            fi
-    
-        fi
-
-        # Check for PTHREAD_MUTEX_ERRORCHECK_NP and PTHREAD_MUTEX_ERRORCHECK
-        AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_ERRORCHECK_NP],
-        pac_cv_has_pthread_mutex_errorcheck_np,[
-        AC_TRY_COMPILE([#include <pthread.h>],
-                       [int a=PTHREAD_MUTEX_ERRORCHECK_NP;],
-                       pac_cv_has_pthread_mutex_errorcheck_np=yes,
-                       pac_cv_has_pthread_mutex_errorcheck_np=no)])
-        AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_ERRORCHECK],
-        pac_cv_has_pthread_mutex_errorcheck,[
-        AC_TRY_COMPILE([#include <pthread.h>],
-                       [int a=PTHREAD_MUTEX_ERRORCHECK;],
-                       pac_cv_has_pthread_mutex_errorcheck=yes,
-                       pac_cv_has_pthread_mutex_errorcheck=no)])
-
-        if test "$pac_cv_has_pthread_mutex_errorcheck" = yes ; then
-            AC_DEFINE(MPICH_PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK,
-                      [Define to an expression that will result in an error checking mutex type.])
-        elif test "$pac_cv_has_pthread_mutex_errorcheck_np" = yes ; then
-            AC_DEFINE(MPICH_PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK_NP,
-                      [Define to an expression that will result in an error checking mutex type.])
-        fi
-
-	PAC_FUNC_NEEDS_DECL([#include <pthread.h>],pthread_mutexattr_settype)
-
-        MPICH_THREAD_PACKAGE_NAME=MPICH_THREAD_PACKAGE_POSIX
-	;;
-    solaris)
-	AC_CHECK_HEADERS(thread.h)
-	AC_CHECK_FUNCS(thr_yield)
-	AC_SEARCH_LIBS(thr_create,thread,found=yes,found=no)
-	if test "$found" != "yes" ; then
-	   AC_MSG_ERROR([unable to find Solaris threads library])
-	fi
-	# FIXME: need to add -mt if using solaris compilers
-        MPICH_THREAD_PACKAGE_NAME=MPICH_THREAD_PACKAGE_SOLARIS
-	;;
-    win|windows)
-        with_thread_package=win
-        MPICH_THREAD_PACKAGE_NAME=MPICH_THREAD_PACKAGE_WIN
-        AC_MSG_ERROR([The 'win' thread package is not supported via autoconf builds at this time.])
-        ;;
-    no|none)
-	with_thread_package=none
-        MPICH_THREAD_PACKAGE_NAME=MPICH_THREAD_PACKAGE_NONE
-	;;
-    *)
-	AC_MSG_ERROR([The specified thread package, $with_thread_package, is not supported.]) 
-	;;
-esac
-
-# Define and export the selected thread library so that other packages
-# know what's used in MPICH
-AC_DEFINE_UNQUOTED([MPICH_THREAD_PACKAGE_NAME],[$MPICH_THREAD_PACKAGE_NAME],[set to the name of the thread package])
-
-# check for compiler-support for thread-local storage (MPICH_TLS_SPECIFIER)
-AX_TLS
-
 AC_CHECK_FUNCS(getpid)
 
 # Check for the Linux functions for controlling processor affinity.
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 56c2083..c5e3e51 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -238,8 +238,8 @@ typedef struct {
 #endif
 } MPIR_Per_thread_t;
 
-#if defined(MPICH_IS_THREADED) && defined(MPICH_TLS_SPECIFIER)
-extern MPICH_TLS_SPECIFIER MPIR_Per_thread_t MPIR_Per_thread;
+#if defined(MPICH_IS_THREADED) && defined(MPL_TLS_SPECIFIER)
+extern MPL_TLS_SPECIFIER MPIR_Per_thread_t MPIR_Per_thread;
 #else
 extern MPIR_Per_thread_t MPIR_Per_thread;
 #endif
diff --git a/src/include/mpiutil.h b/src/include/mpiutil.h
index 94de015..7bff235 100644
--- a/src/include/mpiutil.h
+++ b/src/include/mpiutil.h
@@ -7,7 +7,6 @@
 #define MPIUTIL_H_INCLUDED
 
 #include "mpiu_strerror.h"
-#include "mpiu_thread.h"
 #include "mpiu_type_defs.h"
 #include "mpidbg.h"
 #include "mpiassert.h"
diff --git a/src/mpi/init/async.c b/src/mpi/init/async.c
index 72bfe52..2f92942 100644
--- a/src/mpi/init/async.c
+++ b/src/mpi/init/async.c
@@ -6,7 +6,6 @@
 
 #include "mpiimpl.h"
 #include "mpi_init.h"
-#include "mpiu_thread.h"
 
 #ifndef MPICH_MPI_FROM_PMPI
 
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 0761690..9e49d6e 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -86,8 +86,8 @@ MPICH_PerProcess_t MPIR_Process = { OPA_INT_T_INITIALIZER(MPICH_PRE_INIT) };
      /* all other fields in MPIR_Process are irrelevant */
 MPIR_Thread_info_t MPIR_ThreadInfo = { 0 };
 
-#if defined(MPICH_IS_THREADED) && defined(MPICH_TLS_SPECIFIER)
-MPICH_TLS_SPECIFIER MPIR_Per_thread_t MPIR_Per_thread = { 0 };
+#if defined(MPICH_IS_THREADED) && defined(MPL_TLS_SPECIFIER)
+MPL_TLS_SPECIFIER MPIR_Per_thread_t MPIR_Per_thread = { 0 };
 #else
 MPIR_Per_thread_t MPIR_Per_thread = { 0 };
 #endif
diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index 6b08355..3aa7f7d 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -60,14 +60,14 @@ g * MPI_FINALIZED, MPI_GET_COUNT, MPI_GET_ELEMENTS, MPI_GRAPH_GET,
  */
 
 typedef struct {
-    MPIU_Thread_mutex_t mutex;
+    MPL_thread_mutex_t mutex;
     OPA_int_t num_queued_threads;
 } MPIDU_Thread_mutex_t;
 
-typedef MPIU_Thread_cond_t  MPIDU_Thread_cond_t;
-typedef MPIU_Thread_id_t    MPIDU_Thread_id_t;
-typedef MPIU_Thread_tls_t   MPIDU_Thread_tls_t;
-typedef MPIU_Thread_func_t  MPIDU_Thread_func_t;
+typedef MPL_thread_cond_t  MPIDU_Thread_cond_t;
+typedef MPL_thread_id_t    MPIDU_Thread_id_t;
+typedef MPL_thread_tls_t   MPIDU_Thread_tls_t;
+typedef MPL_thread_func_t  MPIDU_Thread_func_t;
 
 /*M MPIDU_THREAD_CS_ENTER - Enter a named critical section
 
@@ -294,14 +294,14 @@ M*/
 @*/
 #define MPIDU_Thread_create(func_, data_, id_, err_ptr_)        \
     do {                                                        \
-        MPIU_Thread_create(func_, data_, id_, err_ptr_);        \
+        MPL_thread_create(func_, data_, id_, err_ptr_);         \
         MPIU_Assert(*err_ptr_ == 0);                            \
     } while (0)
 
 /*@
   MPIDU_Thread_exit - exit from the current thread
 @*/
-#define MPIDU_Thread_exit         MPIU_Thread_exit
+#define MPIDU_Thread_exit         MPL_thread_exit
 
 /*@
   MPIDU_Thread_self - get the identifier of the current thread
@@ -309,7 +309,7 @@ M*/
   Output Parameter:
 . id - identifier of current thread
 @*/
-#define MPIDU_Thread_self         MPIU_Thread_self
+#define MPIDU_Thread_self         MPL_thread_self
 
 /*@
   MPIDU_Thread_same - compare two threads identifiers to see if refer to the same thread
@@ -321,7 +321,7 @@ M*/
   Output Parameter:
 . same - TRUE if the two threads identifiers refer to the same thread; FALSE otherwise
 @*/
-#define MPIDU_Thread_same       MPIU_Thread_same
+#define MPIDU_Thread_same       MPL_thread_same
 
 /*@
   MPIDU_Thread_yield - voluntarily relinquish the CPU, giving other threads an opportunity to run
@@ -332,7 +332,7 @@ M*/
             break;                                                      \
         MPIDU_Thread_mutex_unlock(mutex_ptr_, err_ptr_);                \
         MPIU_Assert(*err_ptr_ == 0);                                    \
-        MPIU_Thread_yield();                                            \
+        MPL_thread_yield();                                             \
         MPIDU_Thread_mutex_lock(mutex_ptr_, err_ptr_);                  \
         MPIU_Assert(*err_ptr_ == 0);                                    \
     } while (0)
@@ -351,9 +351,9 @@ M*/
 #define MPIDU_Thread_mutex_create(mutex_ptr_, err_ptr_)                 \
     do {                                                                \
         OPA_store_int(&(mutex_ptr_)->num_queued_threads, 0);            \
-        MPIU_Thread_mutex_create(&(mutex_ptr_)->mutex, err_ptr_);       \
+        MPL_thread_mutex_create(&(mutex_ptr_)->mutex, err_ptr_);        \
         MPIU_Assert(*err_ptr_ == 0);                                    \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPL_thread_mutex %p", (mutex_ptr_)); \
     } while (0)
 
 /*@
@@ -367,8 +367,8 @@ M*/
 @*/
 #define MPIDU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)                \
     do {                                                                \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPIU_Thread_mutex %p", (mutex_ptr_)); \
-        MPIU_Thread_mutex_destroy(&(mutex_ptr_)->mutex, err_ptr_);      \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPL_thread_mutex %p", (mutex_ptr_)); \
+        MPL_thread_mutex_destroy(&(mutex_ptr_)->mutex, err_ptr_);       \
         MPIU_Assert(*err_ptr_ == 0);                                    \
     } while (0)
 
@@ -381,10 +381,10 @@ M*/
 #define MPIDU_Thread_mutex_lock(mutex_ptr_, err_ptr_)                   \
     do {                                                                \
         OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIU_Thread_mutex_lock %p", &(mutex_ptr_)->mutex); \
-        MPIU_Thread_mutex_lock(&(mutex_ptr_)->mutex, err_ptr_);         \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPL_thread_mutex_lock %p", &(mutex_ptr_)->mutex); \
+        MPL_thread_mutex_lock(&(mutex_ptr_)->mutex, err_ptr_);          \
         MPIU_Assert(*err_ptr_ == 0);                                    \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIU_Thread_mutex_lock %p", &(mutex_ptr_)->mutex); \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPL_thread_mutex_lock %p", &(mutex_ptr_)->mutex); \
         OPA_decr_int(&(mutex_ptr_)->num_queued_threads);                \
     } while (0)
 
@@ -396,7 +396,7 @@ M*/
 @*/
 #define MPIDU_Thread_mutex_unlock(mutex_ptr_, err_ptr_)                 \
     do {                                                                \
-        MPIU_Thread_mutex_unlock(&(mutex_ptr_)->mutex, err_ptr_);       \
+        MPL_thread_mutex_unlock(&(mutex_ptr_)->mutex, err_ptr_);        \
         MPIU_Assert(*err_ptr_ == 0);                                    \
     } while (0)
 
@@ -411,11 +411,11 @@ M*/
 + 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 MPIDU_Thread_cond_create(cond_ptr_, err_ptr_)   \
-    do {                                                \
-        MPIU_Thread_cond_create(cond_ptr_, err_ptr_);   \
-        MPIU_Assert(*err_ptr_ == 0);                    \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPIU_Thread_cond %p", (cond_ptr_)); \
+#define MPIDU_Thread_cond_create(cond_ptr_, err_ptr_)                   \
+    do {                                                                \
+        MPL_thread_cond_create(cond_ptr_, err_ptr_);                    \
+        MPIU_Assert(*err_ptr_ == 0);                                    \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPL_thread_cond %p", (cond_ptr_)); \
     } while (0)
 
 /*@
@@ -428,11 +428,11 @@ M*/
 . err - location to store the error code; pointer may be NULL; error is zero
         for success, non-zero if a failure occurred
 @*/
-#define MPIDU_Thread_cond_destroy(cond_ptr_, err_ptr_)  \
-    do {                                                \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPIU_Thread_cond %p", (cond_ptr_)); \
-        MPIU_Thread_cond_destroy(cond_ptr_, err_ptr_);  \
-        MPIU_Assert(*err_ptr_ == 0);                    \
+#define MPIDU_Thread_cond_destroy(cond_ptr_, err_ptr_)                  \
+    do {                                                                \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPL_thread_cond %p", (cond_ptr_)); \
+        MPL_thread_cond_destroy(cond_ptr_, err_ptr_);                   \
+        MPIU_Assert(*err_ptr_ == 0);                                    \
     } while (0)
 
 /*@
@@ -453,7 +453,7 @@ M*/
     do {                                                                \
         OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                \
         MPIU_DBG_MSG_FMT(MPIR_DBG_THREAD,TYPICAL,(MPIU_DBG_FDEST,"Enter cond_wait on cond=%p mutex=%p",(cond_ptr_),&(mutex_ptr_)->mutex)); \
-        MPIU_Thread_cond_wait(cond_ptr_, &(mutex_ptr_)->mutex, err_ptr_); \
+        MPL_thread_cond_wait(cond_ptr_, &(mutex_ptr_)->mutex, err_ptr_); \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("cond_wait failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
         MPIU_DBG_MSG_FMT(MPIR_DBG_THREAD,TYPICAL,(MPIU_DBG_FDEST,"Exit cond_wait on cond=%p mutex=%p",(cond_ptr_),&(mutex_ptr_)->mutex)); \
@@ -468,8 +468,8 @@ M*/
 @*/
 #define MPIDU_Thread_cond_broadcast(cond_ptr_, err_ptr_)                \
     do {                                                                \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_broadcast on MPIU_Thread_cond %p", (cond_ptr_)); \
-        MPIU_Thread_cond_broadcast(cond_ptr_, err_ptr_);                \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_broadcast on MPL_thread_cond %p", (cond_ptr_)); \
+        MPL_thread_cond_broadcast(cond_ptr_, err_ptr_);                 \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("cond_broadcast failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
     } while (0)
@@ -482,8 +482,8 @@ M*/
 @*/
 #define MPIDU_Thread_cond_signal(cond_ptr_, err_ptr_)                   \
     do {                                                                \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_signal on MPIU_Thread_cond %p", (cond_ptr_)); \
-        MPIU_Thread_cond_signal(cond_ptr_, err_ptr_);                   \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_signal on MPL_thread_cond %p", (cond_ptr_)); \
+        MPL_thread_cond_signal(cond_ptr_, err_ptr_);                    \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("cond_signal failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
     } while (0)
@@ -505,7 +505,7 @@ M*/
 @*/
 #define MPIDU_Thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_)     \
     do {                                                                \
-        MPIU_Thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_);     \
+        MPL_thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_);      \
         MPIU_Assert(*(int *) err_ptr_ == 0);                            \
     } while (0)
 
@@ -525,7 +525,7 @@ M*/
 @*/
 #define MPIDU_Thread_tls_destroy(tls_ptr_, err_ptr_)    \
     do {                                                \
-        MPIU_Thread_tls_destroy(tls_ptr_, err_ptr_);    \
+        MPL_thread_tls_destroy(tls_ptr_, err_ptr_);     \
         MPIU_Assert(*(int *) err_ptr_ == 0);            \
     } while (0)
 
@@ -539,7 +539,7 @@ M*/
 @*/
 #define MPIDU_Thread_tls_set(tls_ptr_, value_, err_ptr_)                \
     do {                                                                \
-        MPIU_Thread_tls_set(tls_ptr_, value_, err_ptr_);                \
+        MPL_thread_tls_set(tls_ptr_, value_, err_ptr_);                 \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("tls_set failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
     } while (0)
@@ -556,7 +556,7 @@ M*/
 @*/
 #define MPIDU_Thread_tls_get(tls_ptr_, value_ptr_, err_ptr_)            \
     do {                                                                \
-        MPIU_Thread_tls_get(tls_ptr_, value_ptr_, err_ptr_);            \
+        MPL_thread_tls_get(tls_ptr_, value_ptr_, err_ptr_);             \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("tls_get failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
     } while (0)
@@ -565,16 +565,16 @@ M*/
 #define MPIDU_THREADPRIV_KEY_CREATE                                     \
     do {                                                                \
         int err_ = 0;                                                   \
-        MPIU_THREADPRIV_KEY_CREATE(MPIR_Per_thread_key, MPIR_Per_thread, &err_); \
+        MPL_THREADPRIV_KEY_CREATE(MPIR_Per_thread_key, MPIR_Per_thread, &err_); \
         MPIU_Assert(err_ == 0);                                         \
     } while (0)
 
-#define MPIDU_THREADPRIV_KEY_GET_ADDR  MPIU_THREADPRIV_KEY_GET_ADDR
+#define MPIDU_THREADPRIV_KEY_GET_ADDR  MPL_THREADPRIV_KEY_GET_ADDR
 
 #define MPIDU_THREADPRIV_KEY_DESTROY                            \
     do {                                                        \
         int err_ = 0;                                           \
-        MPIU_THREADPRIV_KEY_DESTROY(MPIR_Per_thread_key, &err_); \
+        MPL_THREADPRIV_KEY_DESTROY(MPIR_Per_thread_key, &err_);  \
         MPIU_Assert(err_ == 0);                                 \
     } while (0)
 
diff --git a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
index 8ef7b66..ff493c7 100644
--- a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
+++ b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
@@ -563,8 +563,8 @@ MPIDO_Allgather(const void *sendbuf,
       if(unlikely(verbose))
       {
          unsigned long long int threadID;
-         MPIU_Thread_id_t tid;
-         MPIU_Thread_self(&tid);
+         MPL_thread_id_t tid;
+         MPL_thread_self(&tid);
          threadID = (unsigned long long int)tid;
          fprintf(stderr,"<%llx> Using protocol %s for allgather on %u\n", 
                  threadID,
diff --git a/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c b/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
index c930edf..a870b69 100644
--- a/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
+++ b/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
@@ -599,8 +599,8 @@ MPIDO_Allgatherv(const void *sendbuf,
       if(unlikely(verbose))
       {
          unsigned long long int threadID;
-         MPIU_Thread_id_t tid;
-         MPIU_Thread_self(&tid);
+         MPL_thread_id_t tid;
+         MPL_thread_self(&tid);
          threadID = (unsigned long long int)tid;
          fprintf(stderr,"<%llx> Using protocol %s for allgatherv on %u\n", 
                  threadID,
diff --git a/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c b/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
index a569ba1..5396191 100644
--- a/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
+++ b/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
@@ -415,8 +415,8 @@ int MPIDO_Allreduce(const void *sendbuf,
   if(unlikely(verbose))
   {
     unsigned long long int threadID;
-    MPIU_Thread_id_t tid;
-    MPIU_Thread_self(&tid);
+    MPL_thread_id_t tid;
+    MPL_thread_self(&tid);
     threadID = (unsigned long long int)tid;
     fprintf(stderr,"<%llx> Using protocol %s for allreduce on %u\n", 
             threadID,
diff --git a/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c b/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
index ee25766..2eed145 100644
--- a/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
+++ b/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
@@ -246,8 +246,8 @@ int MPIDO_Alltoall(const void *sendbuf,
    if(unlikely(verbose))
    {
       unsigned long long int threadID;
-      MPIU_Thread_id_t tid;
-      MPIU_Thread_self(&tid);
+      MPL_thread_id_t tid;
+      MPL_thread_self(&tid);
       threadID = (unsigned long long int)tid;
       fprintf(stderr,"<%llx> Using protocol %s for alltoall on %u\n", 
               threadID,
diff --git a/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c b/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
index 9648dd2..7843798 100644
--- a/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
+++ b/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
@@ -343,8 +343,8 @@ int MPIDO_Alltoallv(const void *sendbuf,
    if(unlikely(verbose))
    {
       unsigned long long int threadID;
-      MPIU_Thread_id_t tid;
-      MPIU_Thread_self(&tid);
+      MPL_thread_id_t tid;
+      MPL_thread_self(&tid);
       threadID = (unsigned long long int)tid;
       fprintf(stderr,"<%llx> Using protocol %s for alltoallv on %u\n", 
               threadID,
diff --git a/src/mpid/pamid/src/coll/barrier/mpido_barrier.c b/src/mpid/pamid/src/coll/barrier/mpido_barrier.c
index e4df53d..b53a8fa 100644
--- a/src/mpid/pamid/src/coll/barrier/mpido_barrier.c
+++ b/src/mpid/pamid/src/coll/barrier/mpido_barrier.c
@@ -83,8 +83,8 @@ int MPIDO_Barrier(MPID_Comm *comm_ptr, int *mpierrno)
    if(unlikely(verbose))
    {
       unsigned long long int threadID;
-      MPIU_Thread_id_t tid;
-      MPIU_Thread_self(&tid);
+      MPL_thread_id_t tid;
+      MPL_thread_self(&tid);
       threadID = (unsigned long long int)tid;
      fprintf(stderr,"<%llx> Using protocol %s for barrier on %u\n", 
              threadID,
diff --git a/src/mpid/pamid/src/coll/bcast/mpido_bcast.c b/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
index 1e995ff..6ebf6eb 100644
--- a/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
+++ b/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
@@ -241,8 +241,8 @@ int MPIDO_Bcast(void *buffer,
    if(unlikely(verbose))
    {
       unsigned long long int threadID;
-      MPIU_Thread_id_t tid;
-      MPIU_Thread_self(&tid);
+      MPL_thread_id_t tid;
+      MPL_thread_self(&tid);
       threadID = (unsigned long long int)tid;
       fprintf(stderr,"<%llx> Using protocol %s for bcast on %u\n", 
               threadID,
diff --git a/src/mpid/pamid/src/coll/gather/mpido_gather.c b/src/mpid/pamid/src/coll/gather/mpido_gather.c
index 13d3332..abbfd3d 100644
--- a/src/mpid/pamid/src/coll/gather/mpido_gather.c
+++ b/src/mpid/pamid/src/coll/gather/mpido_gather.c
@@ -399,8 +399,8 @@ int MPIDO_Gather(const void *sendbuf,
    if(unlikely(verbose))
    {
       unsigned long long int threadID;
-      MPIU_Thread_id_t tid;
-      MPIU_Thread_self(&tid);
+      MPL_thread_id_t tid;
+      MPL_thread_self(&tid);
       threadID = (unsigned long long int)tid;
       fprintf(stderr,"<%llx> Using protocol %s for gather on %u\n", 
               threadID,
diff --git a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
index 4213e95..d0d6b95 100644
--- a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
+++ b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
@@ -272,8 +272,8 @@ int MPIDO_Gatherv(const void *sendbuf,
    if(unlikely(verbose))
    {
       unsigned long long int threadID;
-      MPIU_Thread_id_t tid;
-      MPIU_Thread_self(&tid);
+      MPL_thread_id_t tid;
+      MPL_thread_self(&tid);
       threadID = (unsigned long long int)tid;
       fprintf(stderr,"<%llx> Using protocol %s for gatherv on %u\n", 
               threadID,
diff --git a/src/mpid/pamid/src/coll/reduce/mpido_reduce.c b/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
index 1ef45fb..3668141 100644
--- a/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
+++ b/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
@@ -261,8 +261,8 @@ int MPIDO_Reduce(const void *sendbuf,
       if(unlikely(verbose))
       {
          unsigned long long int threadID;
-         MPIU_Thread_id_t tid;
-         MPIU_Thread_self(&tid);
+         MPL_thread_id_t tid;
+         MPL_thread_self(&tid);
          threadID = (unsigned long long int)tid;
          fprintf(stderr,"<%llx> Using protocol %s for reduce on %u\n", 
                  threadID,
diff --git a/src/mpid/pamid/src/coll/scan/mpido_scan.c b/src/mpid/pamid/src/coll/scan/mpido_scan.c
index 40c56ea..718d377 100644
--- a/src/mpid/pamid/src/coll/scan/mpido_scan.c
+++ b/src/mpid/pamid/src/coll/scan/mpido_scan.c
@@ -290,8 +290,8 @@ int MPIDO_Doscan(const void *sendbuf, void *recvbuf,
    if(unlikely(verbose))
    {
       unsigned long long int threadID;
-      MPIU_Thread_id_t tid;
-      MPIU_Thread_self(&tid);
+      MPL_thread_id_t tid;
+      MPL_thread_self(&tid);
       threadID = (unsigned long long int)tid;
       fprintf(stderr,"<%llx> Using protocol %s for scan on %u (exflag %d)\n",
               threadID,
diff --git a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
index e36ea27..806ac8d 100644
--- a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
+++ b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
@@ -328,8 +328,8 @@ int MPIDO_Scatter(const void *sendbuf,
    if(unlikely(verbose))
    {
       unsigned long long int threadID;
-      MPIU_Thread_id_t tid;
-      MPIU_Thread_self(&tid);
+      MPL_thread_id_t tid;
+      MPL_thread_self(&tid);
       threadID = (unsigned long long int)tid;
       fprintf(stderr,"<%llx> Using protocol %s for scatter on %u\n", 
               threadID,
diff --git a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
index 213b298..485f0a6 100644
--- a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
+++ b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
@@ -441,8 +441,8 @@ int MPIDO_Scatterv(const void *sendbuf,
    if(unlikely(verbose))
    {
       unsigned long long int threadID;
-      MPIU_Thread_id_t tid;
-      MPIU_Thread_self(&tid);
+      MPL_thread_id_t tid;
+      MPL_thread_self(&tid);
       threadID = (unsigned long long int)tid;
       fprintf(stderr,"<%llx> Using protocol %s for scatterv on %u\n", 
               threadID,
diff --git a/src/mpl/configure.ac b/src/mpl/configure.ac
index 98cad7d..60b850c 100644
--- a/src/mpl/configure.ac
+++ b/src/mpl/configure.ac
@@ -533,6 +533,138 @@ AS_CASE([$enable_yield],
 #######################################################################
 
 
+#######################################################################
+## START OF THREADS CODE
+#######################################################################
+AC_ARG_WITH([thread-package],
+[  --with-thread-package=package     Thread package to use. Supported thread packages include:
+        posix or pthreads - POSIX threads (default, if required)
+        solaris - Solaris threads (Solaris OS only)
+        win - windows threads
+        none - no threads
+],,with_thread_package=posix)
+
+if test "${thread_pkg_required}" = "no" -o "${with_thread_package}" = "no" ; then
+   with_thread_package=none
+fi
+
+if test "${with_thread_package}" = "yes" ; then
+   with_thread_package=posix
+fi
+
+if test "${thread_pkg_required}" = "yes" -a "${with_thread_package}" = "none" ; then
+   AC_ERROR([if no thread package is available, use --enable-threads=single or funneled])
+fi
+
+THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_INVALID
+case $with_thread_package in
+    posix|pthreads)
+	with_thread_package=posix
+	AC_CHECK_HEADERS(pthread.h)
+
+        # If pthreads library is found, just include it on the link line. We don't try
+        # to test if the C compiler needs it or not, since the C++ or Fortran
+        # compilers might need it even if the C compiler doesn't
+        # (nvcc with gfortran, for example).
+        #
+        # OSF1 has __pthread_create but not pthread_create (because of
+        # inconsistencies in the pthread spec).  Thus, we look for pthread_key_create
+        AC_CHECK_LIB([pthread],[pthread_key_create],have_pthreads=yes)
+	if test "$have_pthreads" = "yes" ; then
+	   PAC_PREPEND_FLAG([-lpthread],[LIBS])
+	fi
+
+        AC_CHECK_FUNCS(pthread_yield)
+
+        # this check should come after the AC_CHECK_LIB for -lpthread
+        AC_CHECK_FUNC([pthread_key_create],[],[AC_MSG_ERROR([unable to find pthreads library])])
+
+	# Check for a routine that specify a routine to call on
+	# thread exit.  We can use this to release memory that may
+	# be allocated by the MPL library in the thread.
+	# A complication: pthread_cleanup_push may be a macro; in that
+	# case, check_funcs will fail to find it.
+	# Under OSX, pthread_cleanup_push and pop are macros that must
+	# appear together in the same lexical scope, and hence are
+	# really useless in libraries that may allocate data within
+	# a user-managed thread.
+	AC_CHECK_FUNCS(pthread_cleanup_push)
+	if test "$ac_cv_func_pthread_cleanup_push" = "no" ; then
+            AC_CACHE_CHECK([whether pthread_cleanup_push is available (may be a macro in pthread.h)],pac_cv_func_pthread_cleanup_push,[
+	    AC_TRY_LINK([
+#include <pthread.h>
+void f1(void *a) { return; }],
+[pthread_cleanup_push( f1, (void *)0 );],
+            pac_cv_func_pthread_cleanup_push=yes,
+            pac_cv_func_pthread_cleanup_push=no)])
+            if test "$pac_cv_func_pthread_cleanup_push" = yes ; then
+	        AC_DEFINE(HAVE_PTHREAD_CLEANUP_PUSH_MACRO,1,[Define if pthread_cleanup_push is available, even as a macro])
+            fi
+
+        fi
+
+        # Check for PTHREAD_MUTEX_ERRORCHECK_NP and PTHREAD_MUTEX_ERRORCHECK
+        AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_ERRORCHECK_NP],
+        pac_cv_has_pthread_mutex_errorcheck_np,[
+        AC_TRY_COMPILE([#include <pthread.h>],
+                       [int a=PTHREAD_MUTEX_ERRORCHECK_NP;],
+                       pac_cv_has_pthread_mutex_errorcheck_np=yes,
+                       pac_cv_has_pthread_mutex_errorcheck_np=no)])
+        AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_ERRORCHECK],
+        pac_cv_has_pthread_mutex_errorcheck,[
+        AC_TRY_COMPILE([#include <pthread.h>],
+                       [int a=PTHREAD_MUTEX_ERRORCHECK;],
+                       pac_cv_has_pthread_mutex_errorcheck=yes,
+                       pac_cv_has_pthread_mutex_errorcheck=no)])
+
+        if test "$pac_cv_has_pthread_mutex_errorcheck" = yes ; then
+            AC_DEFINE(MPL_PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK,
+                      [Define to an expression that will result in an error checking mutex type.])
+        elif test "$pac_cv_has_pthread_mutex_errorcheck_np" = yes ; then
+            AC_DEFINE(MPL_PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK_NP,
+                      [Define to an expression that will result in an error checking mutex type.])
+        fi
+
+	PAC_FUNC_NEEDS_DECL([#include <pthread.h>],pthread_mutexattr_settype)
+
+        THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_POSIX
+	;;
+    solaris)
+	AC_CHECK_HEADERS(thread.h)
+	AC_CHECK_FUNCS(thr_yield)
+	AC_SEARCH_LIBS(thr_create,thread,found=yes,found=no)
+	if test "$found" != "yes" ; then
+	   AC_MSG_ERROR([unable to find Solaris threads library])
+	fi
+	# FIXME: need to add -mt if using solaris compilers
+        THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_SOLARIS
+	;;
+    win|windows)
+        with_thread_package=win
+        THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_WIN
+        AC_MSG_ERROR([The 'win' thread package is not supported via autoconf builds at this time.])
+        ;;
+    no|none)
+	with_thread_package=none
+        THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_NONE
+	;;
+    *)
+	AC_MSG_ERROR([The specified thread package, $with_thread_package, is not supported.])
+	;;
+esac
+
+# Define and export the selected thread library so that other packages
+# know what's used in MPL
+AC_DEFINE_UNQUOTED([THREAD_PACKAGE_NAME],[$THREAD_PACKAGE_NAME],[set to the name of the thread package])
+
+# check for compiler-support for thread-local storage (MPL_TLS_SPECIFIER)
+AX_TLS
+
+#######################################################################
+## END OF THREADS CODE
+#######################################################################
+
+
 ## Enable creation of libtool-style versioning or no versioning
 AC_ARG_ENABLE(versioning,
         [AC_HELP_STRING([--enable-versioning],[Enable library versioning])],,
diff --git a/src/mpl/include/mpl.h b/src/mpl/include/mpl.h
index d91bb94..50d4789 100644
--- a/src/mpl/include/mpl.h
+++ b/src/mpl/include/mpl.h
@@ -17,6 +17,7 @@
 #include "mpl_msg.h"
 #include "mpl_iov.h"
 #include "mpl_bt.h"
+#include "mpl_thread.h"
 #include "mpl_timer.h"
 #include "mpl_yield.h"
 
diff --git a/src/mpl/include/mpl_thread.h b/src/mpl/include/mpl_thread.h
new file mode 100644
index 0000000..8b0aad9
--- /dev/null
+++ b/src/mpl/include/mpl_thread.h
@@ -0,0 +1,44 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPL_THREAD_H_INCLUDED)
+#define MPL_THREAD_H_INCLUDED
+
+#include "mplconfig.h"
+
+/* _INVALID exists to avoid accidental macro evaluations to 0 */
+#define MPL_THREAD_PACKAGE_INVALID 0
+#define MPL_THREAD_PACKAGE_NONE    1
+#define MPL_THREAD_PACKAGE_POSIX   2
+#define MPL_THREAD_PACKAGE_SOLARIS 3
+#define MPL_THREAD_PACKAGE_WIN     4
+
+#if defined(MPL_THREAD_PACKAGE_NAME) && (MPL_THREAD_PACKAGE_NAME == MPL_THREAD_PACKAGE_POSIX)
+#  include "mpl_thread_posix.h"
+#elif defined(MPL_THREAD_PACKAGE_NAME) && (MPL_THREAD_PACKAGE_NAME == MPL_THREAD_PACKAGE_SOLARIS)
+#  include "mpl_thread_solaris.h"
+#elif defined(MPL_THREAD_PACKAGE_NAME) && (MPL_THREAD_PACKAGE_NAME == MPL_THREAD_PACKAGE_WIN)
+#  include "mpl_thread_win.h"
+#elif defined(MPL_THREAD_PACKAGE_NAME) && (MPL_THREAD_PACKAGE_NAME == MPL_THREAD_PACKAGE_NONE)
+typedef int MPL_thread_mutex_t;
+typedef int MPL_thread_cond_t;
+typedef int MPL_thread_id_t;
+typedef int MPL_thread_tls_t;
+typedef void (*MPL_thread_func_t) (void *data);
+#define MPL_thread_mutex_create(mutex_ptr_, err_ptr_)  { *((int*)err_ptr_) = 0;}
+#define MPL_thread_mutex_destroy(mutex_ptr_, err_ptr_) { *((int*)err_ptr_) = 0;}
+#else
+#  error "thread package not defined or unknown"
+#endif
+
+/* Error values */
+#define MPL_THREAD_SUCCESS 0
+#define MPL_THREAD_ERROR   1
+/* FIXME: Define other error codes.  For now, any non-zero value is an error. */
+
+#include "mpl_thread_priv.h"
+
+#endif /* !defined(MPL_THREAD_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_posix.h b/src/mpl/include/mpl_thread_posix.h
similarity index 83%
rename from src/util/thread/mpiu_thread_posix.h
rename to src/mpl/include/mpl_thread_posix.h
index 8c82f00..c1146e6 100644
--- a/src/util/thread/mpiu_thread_posix.h
+++ b/src/mpl/include/mpl_thread_posix.h
@@ -8,42 +8,42 @@
 /*
  * Threads
  */
-#ifndef MPIU_THREAD_POSIX_H_INCLUDED
-#define MPIU_THREAD_POSIX_H_INCLUDED
+#ifndef MPL_THREAD_POSIX_H_INCLUDED
+#define MPL_THREAD_POSIX_H_INCLUDED
 
 #include "mpl.h"      /* for MPL_sched_yield */
 
 #include <errno.h>
 #include <pthread.h>
 
-typedef pthread_mutex_t 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_mutex_t MPL_thread_mutex_t;
+typedef pthread_cond_t MPL_thread_cond_t;
+typedef pthread_t MPL_thread_id_t;
+typedef pthread_key_t MPL_thread_tls_t;
 
 #if defined(NEEDS_PTHREAD_MUTEXATTR_SETTYPE_DECL)
 int pthread_mutexattr_settype(pthread_mutexattr_t * attr, int kind);
 #endif /* NEEDS_PTHREAD_MUTEXATTR_SETTYPE_DECL */
 
-typedef void (*MPIU_Thread_func_t) (void *data);
-void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t * id, int *err);
+typedef void (*MPL_thread_func_t) (void *data);
+void MPL_thread_create(MPL_thread_func_t func, void *data, MPL_thread_id_t * id, int *err);
 
-#define MPIU_Thread_exit()			\
+#define MPL_thread_exit()                       \
     do {                                        \
         pthread_exit(NULL);                     \
     } while (0)
 
-#define MPIU_Thread_self(id_)			\
+#define MPL_thread_self(id_)                    \
     do {                                        \
         *(id_) = pthread_self();                \
     } while (0)
 
-#define MPIU_Thread_same(id1_, id2_, same_)                             \
+#define MPL_thread_same(id1_, id2_, same_)                              \
     do {                                                                \
         *(same_) = pthread_equal(*(id1_), *(id2_)) ? TRUE : FALSE;	\
     } while (0)
 
-#define MPIU_Thread_yield MPL_sched_yield
+#define MPL_thread_yield MPL_sched_yield
 
 
 /*
@@ -58,11 +58,11 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
 
 /* FIXME: using constant initializer if available */
 
-/* FIXME: convert errors to an MPIU_THREAD_ERR value */
+/* FIXME: convert errors to an MPL_THREAD_ERR value */
 
-#if !defined(MPICH_PTHREAD_MUTEX_ERRORCHECK_VALUE)
+#if !defined(MPL_PTHREAD_MUTEX_ERRORCHECK_VALUE)
 
-#define MPIU_Thread_mutex_create(mutex_ptr_, err_ptr_)                  \
+#define MPL_thread_mutex_create(mutex_ptr_, err_ptr_)                   \
     do {                                                                \
         int err__;                                                      \
                                                                         \
@@ -73,15 +73,15 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(int *)(err_ptr_) = err__;                                     \
     } while (0)
 
-#else /* defined(MPICH_PTHREAD_MUTEX_ERRORCHECK_VALUE) */
+#else /* defined(MPL_PTHREAD_MUTEX_ERRORCHECK_VALUE) */
 
-#define MPIU_Thread_mutex_create(mutex_ptr_, err_ptr_)                  \
+#define MPL_thread_mutex_create(mutex_ptr_, err_ptr_)                   \
     do {                                                                \
         int err__;                                                      \
         pthread_mutexattr_t attr__;                                     \
                                                                         \
         pthread_mutexattr_init(&attr__);                                \
-        pthread_mutexattr_settype(&attr__, MPICH_PTHREAD_MUTEX_ERRORCHECK_VALUE); \
+        pthread_mutexattr_settype(&attr__, MPL_PTHREAD_MUTEX_ERRORCHECK_VALUE); \
         err__ = pthread_mutex_init(mutex_ptr_, &attr__);                \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_mutex_init", err__,  \
@@ -89,9 +89,9 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(int *)(err_ptr_) = err__;                                     \
     } while (0)
 
-#endif /* defined(MPICH_PTHREAD_MUTEX_ERRORCHECK_VALUE) */
+#endif /* defined(MPL_PTHREAD_MUTEX_ERRORCHECK_VALUE) */
 
-#define MPIU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)                 \
+#define MPL_thread_mutex_destroy(mutex_ptr_, err_ptr_)                  \
     do {                                                                \
         int err__;							\
                                                                         \
@@ -103,7 +103,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     } while (0)
 
 
-#define MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_)                    \
+#define MPL_thread_mutex_lock(mutex_ptr_, err_ptr_)                     \
     do {                                                                \
         int err__;                                                      \
         err__ = pthread_mutex_lock(mutex_ptr_);                         \
@@ -115,7 +115,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     } while (0)
 
 
-#define MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_)                  \
+#define MPL_thread_mutex_unlock(mutex_ptr_, err_ptr_)                   \
     do {                                                                \
         int err__;                                                      \
                                                                         \
@@ -132,7 +132,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
  * Condition Variables
  */
 
-#define MPIU_Thread_cond_create(cond_ptr_, err_ptr_)                    \
+#define MPL_thread_cond_create(cond_ptr_, err_ptr_)                     \
     do {                                                                \
         int err__;							\
                                                                         \
@@ -143,7 +143,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(int *)(err_ptr_) = err__;                                     \
     } while (0)
 
-#define MPIU_Thread_cond_destroy(cond_ptr_, err_ptr_)                   \
+#define MPL_thread_cond_destroy(cond_ptr_, err_ptr_)                    \
     do {                                                                \
         int err__;							\
                                                                         \
@@ -154,7 +154,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(int *)(err_ptr_) = err__;                                     \
     } while (0)
 
-#define MPIU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_)		\
+#define MPL_thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_)		\
     do {                                                                \
         int err__;                                                      \
     									\
@@ -171,7 +171,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(int *)(err_ptr_) = err__;                                     \
     } while (0)
 
-#define MPIU_Thread_cond_broadcast(cond_ptr_, err_ptr_)                 \
+#define MPL_thread_cond_broadcast(cond_ptr_, err_ptr_)                 \
     do {                                                                \
         int err__;							\
                                                                         \
@@ -183,7 +183,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(int *)(err_ptr_) = err__;                                     \
     } while (0)
 
-#define MPIU_Thread_cond_signal(cond_ptr_, err_ptr_)                    \
+#define MPL_thread_cond_signal(cond_ptr_, err_ptr_)                    \
     do {                                                                \
         int err__;							\
                                                                         \
@@ -200,7 +200,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
  * Thread Local Storage
  */
 
-#define MPIU_Thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_)	\
+#define MPL_thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_)	\
     do {                                                                \
         int err__;                                                      \
     									\
@@ -212,7 +212,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(int *)(err_ptr_) = err__;                                     \
     } while (0)
 
-#define MPIU_Thread_tls_destroy(tls_ptr_, err_ptr_)     \
+#define MPL_thread_tls_destroy(tls_ptr_, err_ptr_)     \
     do {                                                \
         int err__;                                      \
                                                         \
@@ -224,7 +224,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(int *)(err_ptr_) = err__;                     \
     } while (0)
 
-#define MPIU_Thread_tls_set(tls_ptr_, value_, err_ptr_)                 \
+#define MPL_thread_tls_set(tls_ptr_, value_, err_ptr_)                 \
     do {                                                                \
         int err__;							\
                                                                         \
@@ -236,11 +236,11 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(int *)(err_ptr_) = err__;                                     \
     } while (0)
 
-#define MPIU_Thread_tls_get(tls_ptr_, value_ptr_, err_ptr_)	\
+#define MPL_thread_tls_get(tls_ptr_, value_ptr_, err_ptr_)	\
     do {                                                        \
         *(value_ptr_) = pthread_getspecific(*(tls_ptr_));       \
 								\
-        *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;               \
+        *(int *)(err_ptr_) = MPL_THREAD_SUCCESS;               \
     } while (0)
 
-#endif /* MPIU_THREAD_POSIX_H_INCLUDED */
+#endif /* MPL_THREAD_POSIX_H_INCLUDED */
diff --git a/src/mpl/include/mpl_thread_priv.h b/src/mpl/include/mpl_thread_priv.h
new file mode 100644
index 0000000..4ce9bf2
--- /dev/null
+++ b/src/mpl/include/mpl_thread_priv.h
@@ -0,0 +1,98 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPL_THREAD_PRIV_H_INCLUDED)
+#define MPL_THREAD_PRIV_H_INCLUDED
+
+#if MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE && !defined(MPL_TLS_SPECIFIER)
+/* We need to provide a function that will cleanup the storage attached
+ * to the key.  */
+void MPLI_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 MPLI_per_thread_t pointers.  One is local
+   (The MPL_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
+   MPLI_per_thread_t struct, as in the single threaded case.  Based on
+   whether MPL is initialized with thread safety, one or the other is used.
+ */
+
+#define MPL_THREADPRIV_KEY_CREATE(key, var, err_ptr_)                   \
+    do {                                                                \
+        void *thread_ptr;                                               \
+                                                                        \
+        MPL_thread_tls_create(MPLI_cleanup_tls, &(key) , err_ptr_);     \
+        if (unlikely(*((int *) err_ptr_)))                              \
+            break;                                                      \
+        thread_ptr = calloc(1, sizeof(var));                            \
+        if (unlikely(!thread_ptr)) {                                    \
+            *((int *) err_ptr_) = MPL_THREAD_ERROR;                     \
+            break;                                                      \
+        }                                                               \
+        MPL_thread_tls_set(&(key), thread_ptr, err_ptr_);               \
+    } while (0)
+
+#define MPL_THREADPRIV_KEY_GET_ADDR(is_threaded, key, var, addr, err_ptr_)  \
+    do {                                                                \
+        if (is_threaded) {                                              \
+            void *thread_ptr;                                           \
+            MPL_thread_tls_get(&(key), &thread_ptr, err_ptr_);          \
+            if (unlikely(*((int *) err_ptr_)))                          \
+                break;                                                  \
+            if (!thread_ptr) {                                          \
+                thread_ptr = calloc(1, sizeof(var));                    \
+                if (unlikely(!thread_ptr)) {                            \
+                    *((int *) err_ptr_) = MPL_THREAD_ERROR;             \
+                    break;                                              \
+                }                                                       \
+                MPL_thread_tls_set(&(key), thread_ptr, err_ptr_);       \
+                if (unlikely(*((int *) err_ptr_)))                      \
+                    break;                                              \
+            }                                                           \
+            addr = thread_ptr;                                          \
+        }                                                               \
+        else {                                                          \
+            addr = &(var);                                              \
+        }                                                               \
+    } while (0)
+
+#define MPL_THREADPRIV_KEY_DESTROY(key, err_ptr_)       \
+    do {                                                \
+        void *thread_ptr;                               \
+                                                        \
+        MPL_thread_tls_get(&(key), &thread_ptr, err_ptr_); \
+        if (unlikely(*((int *) err_ptr_)))                 \
+            break;                                      \
+                                                        \
+        if (thread_ptr)                                 \
+            free(thread_ptr);                           \
+                                                        \
+        MPL_thread_tls_set(&(key), NULL, err_ptr_);     \
+        if (unlikely(*((int *) err_ptr_)))              \
+            break;                                      \
+                                                        \
+        MPL_thread_tls_destroy(&(key), err_ptr_);       \
+    } while (0)
+
+#else /* MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE || defined(MPL_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. */
+#define MPL_THREADPRIV_KEY_CREATE(...)
+#define MPL_THREADPRIV_KEY_GET_ADDR(is_threaded, key, var, addr, err_ptr_) \
+    do {                                                                \
+        addr = &(var);                                                  \
+        *((int *) err_ptr_) = MPL_THREAD_SUCCESS;                       \
+    } while (0)
+#define MPL_THREADPRIV_KEY_DESTROY(...)
+
+#endif
+
+#endif /* !defined(MPL_THREAD_PRIV_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_solaris.h b/src/mpl/include/mpl_thread_solaris.h
similarity index 72%
rename from src/util/thread/mpiu_thread_solaris.h
rename to src/mpl/include/mpl_thread_solaris.h
index fffb85a..83fe099 100644
--- a/src/util/thread/mpiu_thread_solaris.h
+++ b/src/mpl/include/mpl_thread_solaris.h
@@ -4,83 +4,83 @@
  *  (C) 2001 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
  */
-#ifndef MPIU_THREAD_SOLARIS_H_INCLUDED
-#define MPIU_THREAD_SOLARIS_H_INCLUDED
+#ifndef MPL_THREAD_SOLARIS_H_INCLUDED
+#define MPL_THREAD_SOLARIS_H_INCLUDED
 
 #include <thread.h>
 #include <synch.h>
 
-typedef mutex_t MPIU_Thread_mutex_t;
-typedef cond_t MPIU_Thread_cond_t;
-typedef thread_t MPIU_Thread_id_t;
+typedef mutex_t MPL_thread_mutex_t;
+typedef cond_t MPL_thread_cond_t;
+typedef thread_t MPL_thread_id_t;
 
-typedef void (*MPIU_Thread_func_t) (void *data);
-void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t * id, int *err);
+typedef void (*MPL_thread_func_t) (void *data);
+void MPL_thread_create(MPL_thread_func_t func, void *data, MPL_thread_id_t * id, int *err);
 
 /*
  * Threads
  */
 
-#define MPIU_Thread_exit()			\
+#define MPL_thread_exit()			\
     do {                                        \
         thr_exit(NULL);				\
     } while (0)
 
-#define MPIU_Thread_self(id_ptr_)		\
+#define MPL_thread_self(id_ptr_)		\
     do {                                        \
         *(id_ptr_) = thr_self();                \
     } while (0)
 
-#define MPIU_Thread_same(id1_ptr_, id2_ptr_, same_ptr_)                 \
+#define MPL_thread_same(id1_ptr_, id2_ptr_, same_ptr_)                 \
     do {                                                                \
         *(same_ptr_) = (*(id1_ptr_) == *(id2_ptr_)) ? TRUE : FALSE;     \
     } while (0)
 
-#define MPIU_Thread_yield thr_yield
+#define MPL_thread_yield thr_yield
 
 
 /*
  *    Mutexes
  */
 
-#define MPIU_Thread_mutex_create(mutex_ptr_, err_ptr_)	\
+#define MPL_thread_mutex_create(mutex_ptr_, err_ptr_)	\
     do {                                                \
         *(mutex_ptr_) = DEFAULTMUTEX;			\
         if ((err_ptr_) == NULL) {                       \
-            *(err_ptr_) = MPIU_THREAD_SUCCESS;		\
+            *(err_ptr_) = MPL_THREAD_SUCCESS;		\
         }                                               \
     } while (0)
 
-#define MPIU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)                 \
+#define MPL_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 */	\
+            /* FIXME: convert error to an MPL_THREAD_ERR value */	\
         }								\
     } while (0)
 
-#define MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_)                    \
+#define MPL_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 */	\
+            /* FIXME: convert error to an MPL_THREAD_ERR value */	\
         }								\
     } while (0)
 
-#define MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_)                  \
+#define MPL_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 */	\
+            /* FIXME: convert error to an MPL_THREAD_ERR value */	\
         }								\
     } while (0)
 
@@ -89,55 +89,55 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
  * Condition Variables
  */
 
-#define MPIU_Thread_cond_create(cond_ptr_, err_ptr_)	\
+#define MPL_thread_cond_create(cond_ptr_, err_ptr_)	\
     do {                                                \
         *(cond_ptr_) = DEFAULTCV;                       \
         if ((err_ptr_) == NULL) {                       \
-            *(err_ptr_) = MPIU_THREAD_SUCCESS;		\
+            *(err_ptr_) = MPL_THREAD_SUCCESS;		\
         }                                               \
     } while (0)
 
-#define MPIU_Thread_cond_destroy(cond_ptr_, err_ptr_)                   \
+#define MPL_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 */	\
+            /* FIXME: convert error to a MPL_THREAD_ERR value */	\
         }								\
     } while (0)
 
-#define MPIU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_)          \
+#define MPL_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 */	\
+            /* FIXME: convert error to a MPL_THREAD_ERR value */	\
         }								\
     } while (0)
 
-#define MPIU_Thread_cond_broadcast(cond_ptr_, err_ptr_)                 \
+#define MPL_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 */	\
+            /* FIXME: convert error to a MPL_THREAD_ERR value */	\
         }								\
     } while (0)
 
-#define MPIU_Thread_cond_signal(cond_ptr_, err_ptr_)                    \
+#define MPL_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 */	\
+            /* FIXME: convert error to a MPL_THREAD_ERR value */	\
         }								\
     } while (0)
 
@@ -145,18 +145,18 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
 /*
  * Thread Local Storage
  */
-#define MPIU_Thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_)	\
+#define MPL_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 */       \
+            /* FIXME: convert error to a MPL_THREAD_ERR value */       \
         }                                                               \
     } while (0)
 
-#define MPIU_Thread_tls_destroy(tls_ptr_, err_ptr_)                     \
+#define MPL_thread_tls_destroy(tls_ptr_, err_ptr_)                     \
     do {                                                                \
         /*                                                              \
          * FIXME: Solaris threads does not have a key destroy.  We      \
@@ -166,30 +166,30 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
          * have shutdown from continuing to receive callbacks.          \
          */                                                             \
         if ((err_ptr_) != NULL) {                                       \
-            *(err_ptr) = MPIU_THREAD_SUCCESS;                           \
+            *(err_ptr) = MPL_THREAD_SUCCESS;                           \
         }                                                               \
     } while (0)
 
-#define MPIU_Thread_tls_set(tls_ptr, value_)                            \
+#define MPL_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 */	\
+            /* FIXME: convert error to a MPL_THREAD_ERR value */	\
         }								\
     } while (0)
 
-#define MPIU_Thread_tls_get(tls_ptr, value_ptr_)                        \
+#define MPL_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 */       \
+            /* FIXME: convert error to a MPL_THREAD_ERR value */       \
         }                                                               \
     } while (0)
 
-#endif /* MPIU_THREAD_SOLARIS_H_INCLUDED */
+#endif /* MPL_THREAD_SOLARIS_H_INCLUDED */
diff --git a/src/util/thread/mpiu_thread_win.h b/src/mpl/include/mpl_thread_win.h
similarity index 57%
rename from src/util/thread/mpiu_thread_win.h
rename to src/mpl/include/mpl_thread_win.h
index 6ec0003..3c6f9f9 100644
--- a/src/util/thread/mpiu_thread_win.h
+++ b/src/mpl/include/mpl_thread_win.h
@@ -5,51 +5,51 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-#ifndef MPIU_THREAD_WIN_H_INCLUDED
-#define MPIU_THREAD_WIN_H_INCLUDED
+#ifndef MPL_THREAD_WIN_H_INCLUDED
+#define MPL_THREAD_WIN_H_INCLUDED
 
 #define WIN32_LEAN_AND_MEAN
 
 #include <windows.h>
 
-typedef HANDLE MPIU_Thread_mutex_t;
-typedef HANDLE MPIU_Thread_id_t;
-typedef DWORD MPIU_Thread_tls_t;
+typedef HANDLE MPL_thread_mutex_t;
+typedef HANDLE MPL_thread_id_t;
+typedef DWORD MPL_thread_tls_t;
 
-typedef struct MPIUI_Win_thread_cond_fifo_t {
+typedef struct MPLI_win_thread_cond_fifo_t {
     HANDLE event;
-    struct MPIUI_Win_thread_cond_fifo_t *next;
-} MPIUI_Win_thread_cond_fifo_t;
-typedef struct MPIU_Thread_cond_t {
-    MPIU_Thread_tls_t tls;
-    MPIU_Thread_mutex_t fifo_mutex;
-    MPIUI_Win_thread_cond_fifo_t *fifo_head, *fifo_tail;
-} MPIU_Thread_cond_t;
+    struct MPLI_win_thread_cond_fifo_t *next;
+} MPLI_win_thread_cond_fifo_t;
+typedef struct MPL_thread_cond_t {
+    MPL_thread_tls_t tls;
+    MPL_thread_mutex_t fifo_mutex;
+    MPLI_win_thread_cond_fifo_t *fifo_head, *fifo_tail;
+} MPL_thread_cond_t;
 
-typedef void (*MPIU_Thread_func_t) (void *data);
+typedef void (*MPL_thread_func_t) (void *data);
 
-void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t * id, int *err);
-void MPIU_Thread_exit(void);
-void MPIU_Thread_self(MPIU_Thread_id_t * id);
-void MPIU_Thread_same(MPIU_Thread_id_t * id1, MPIU_Thread_id_t * id2, int *same);
-void MPIU_Thread_yield(void);
+void MPL_thread_create(MPL_thread_func_t func, void *data, MPL_thread_id_t * id, int *err);
+void MPL_thread_exit(void);
+void MPL_thread_self(MPL_thread_id_t * id);
+void MPL_thread_same(MPL_thread_id_t * id1, MPL_thread_id_t * id2, int *same);
+void MPL_thread_yield();
 
-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 MPL_thread_mutex_create(MPL_thread_mutex_t * mutex, int *err);
+void MPL_thread_mutex_destroy(MPL_thread_mutex_t * mutex, int *err);
+void MPL_thread_mutex_lock(MPL_thread_mutex_t * mutex, int *err);
+void MPL_thread_mutex_unlock(MPL_thread_mutex_t * mutex, 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);
+void MPL_thread_cond_create(MPL_thread_cond_t * cond, int *err);
+void MPL_thread_cond_destroy(MPL_thread_cond_t * cond, int *err);
+void MPL_thread_cond_wait(MPL_thread_cond_t * cond, MPL_thread_mutex_t * mutex, int *err);
+void MPL_thread_cond_broadcast(MPL_thread_cond_t * cond, int *err);
+void MPL_thread_cond_signal(MPL_thread_cond_t * cond, int *err);
 
 /*
  * Thread Local Storage
  */
 
-#define MPIU_Thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_)	\
+#define MPL_thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_)	\
     do {                                                                \
         *(tls_ptr_) = TlsAlloc();                                       \
         if ((err_ptr_) != NULL) {                                       \
@@ -57,18 +57,18 @@ void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int *err);
                 *(int *)(err_ptr_) = GetLastError();			\
             }								\
             else {                                                      \
-                *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;               \
+                *(int *)(err_ptr_) = MPL_THREAD_SUCCESS;               \
             }                                                           \
         }                                                               \
     } while (0)
 
-#define MPIU_Thread_tls_destroy(tls_ptr_, err_ptr_)		\
+#define MPL_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;       \
+                *(int *)(err_ptr_) = MPL_THREAD_SUCCESS;       \
             }                                                   \
             else {                                              \
                 *(int *)(err_ptr_) = GetLastError();		\
@@ -76,13 +76,13 @@ void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int *err);
         }                                                       \
     } while (0)
 
-#define MPIU_Thread_tls_set(tls_ptr_, value_, err_ptr_)		\
+#define MPL_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;       \
+                *(int *)(err_ptr_) = MPL_THREAD_SUCCESS;       \
             }                                                   \
             else {                                              \
                 *(int *)(err_ptr_) = GetLastError();		\
@@ -90,7 +90,7 @@ void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int *err);
         }                                                       \
     } while (0)
 
-#define MPIU_Thread_tls_get(tls_ptr_, value_ptr_, err_ptr_)             \
+#define MPL_thread_tls_get(tls_ptr_, value_ptr_, err_ptr_)             \
     do {								\
         *((void **)value_ptr_) = TlsGetValue(*(tls_ptr_));              \
         if ((err_ptr_) != NULL) {                                       \
@@ -98,9 +98,9 @@ void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int *err);
                 *(int *)(err_ptr_) = GetLastError();                    \
             }                                                           \
             else {                                                      \
-                *(int *)(err_ptr_) = MPIU_THREAD_SUCCESS;               \
+                *(int *)(err_ptr_) = MPL_THREAD_SUCCESS;               \
             }                                                           \
         }                                                               \
     } while (0)
 
-#endif /* MPIU_THREAD_WIN_H_INCLUDED */
+#endif /* MPL_THREAD_WIN_H_INCLUDED */
diff --git a/src/mpl/src/Makefile.mk b/src/mpl/src/Makefile.mk
index a5ba236..0c23984 100644
--- a/src/mpl/src/Makefile.mk
+++ b/src/mpl/src/Makefile.mk
@@ -10,4 +10,5 @@ include src/mem/Makefile.mk
 include src/msg/Makefile.mk
 include src/sock/Makefile.mk
 include src/str/Makefile.mk
+include src/thread/Makefile.mk
 include src/timer/Makefile.mk
diff --git a/src/mpl/src/thread/Makefile.mk b/src/mpl/src/thread/Makefile.mk
new file mode 100644
index 0000000..361d0e3
--- /dev/null
+++ b/src/mpl/src/thread/Makefile.mk
@@ -0,0 +1,12 @@
+## -*- Mode: Makefile; -*-
+## vim: set ft=automake :
+##
+## (C) 2011 by Argonne National Laboratory.
+##     See COPYRIGHT in top-level directory.
+##
+
+lib at MPLLIBNAME@_la_SOURCES +=		\
+	src/thread/mpl_thread.c		\
+	src/thread/mpl_thread_win.c	\
+	src/thread/mpl_thread_solaris.c	\
+	src/thread/mpl_thread_posix.c
diff --git a/src/util/thread/mpiu_thread.c b/src/mpl/src/thread/mpl_thread.c
similarity index 69%
rename from src/util/thread/mpiu_thread.c
rename to src/mpl/src/thread/mpl_thread.c
index b3cd5e8..23507f0 100644
--- a/src/util/thread/mpiu_thread.c
+++ b/src/mpl/src/thread/mpl_thread.c
@@ -4,16 +4,16 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-#include "mpiu_thread.h"
+#include "mpl.h"
 
 MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
-#if defined(MPICH_IS_THREADED) && !defined(MPICH_TLS_SPECIFIER)
+#if (MPL_THREAD_PACKAGE_NAME != MPL_THREAD_PACKAGE_NONE) && !defined(MPL_TLS_SPECIFIER)
 
 /* 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)
+ * allocated with MPL_calloc */
+void MPLI_cleanup_tls(void *a)
 {
     if (a)
         free(a);
diff --git a/src/util/thread/mpiu_thread_posix.c b/src/mpl/src/thread/mpl_thread_posix.c
similarity index 55%
rename from src/util/thread/mpiu_thread_posix.c
rename to src/mpl/src/thread/mpl_thread_posix.c
index 43d9c8f..36c8284 100644
--- a/src/util/thread/mpiu_thread_posix.c
+++ b/src/mpl/src/thread/mpl_thread_posix.c
@@ -4,12 +4,7 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-/* common header includes */
-#include <stdlib.h>
-#include "mpichconf.h"  /* defines MPICH_THREAD_PACKAGE_NAME */
 #include "mpl.h"
-#include "mpiutil.h"    /* for HAS_NO_SYMBOLS_WARNING */
-#include "mpiu_thread.h"
 
 MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
@@ -21,40 +16,34 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
  * header files and included as needed. [goodell@ 2009-06-24] */
 
 /* Implementation specific function definitions (usually in the form of macros) */
-#if defined(MPICH_THREAD_PACKAGE_NAME) && (MPICH_THREAD_PACKAGE_NAME == MPICH_THREAD_PACKAGE_POSIX)
-/* begin posix impl */
-
-/* stdio.h is needed for mpimem, which prototypes a few routines that
-   take FILE * arguments */
-#include <stdio.h>
-#include "mpimem.h"
+#if MPL_THREAD_PACKAGE_NAME == MPL_THREAD_PACKAGE_POSIX
 
 /*
- * struct MPIUI_Thread_info
+ * struct MPLI_thread_info
  *
  * Structure used to pass the user function and data to the intermediate
- * function, MPIUI_Thread_start.  See comment in
- * MPIUI_Thread_start() header for more information.
+ * function, MPLI_thread_start.  See comment in
+ * MPLI_thread_start() header for more information.
  */
-struct MPIUI_Thread_info {
-    MPIU_Thread_func_t func;
+struct MPLI_thread_info {
+    MPL_thread_func_t func;
     void *data;
 };
 
 
-void *MPIUI_Thread_start(void *arg);
+void *MPLI_thread_start(void *arg);
 
 
 /*
- * MPIU_Thread_create()
+ * MPL_thread_create()
  */
-void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t * idp, int *errp)
+void MPL_thread_create(MPL_thread_func_t func, void *data, MPL_thread_id_t * idp, int *errp)
 {
-    struct MPIUI_Thread_info *thread_info;
-    int err = MPIU_THREAD_SUCCESS;
+    struct MPLI_thread_info *thread_info;
+    int err = MPL_THREAD_SUCCESS;
 
     /* FIXME: faster allocation, or avoid it all together? */
-    thread_info = (struct MPIUI_Thread_info *) malloc(sizeof(struct MPIUI_Thread_info));
+    thread_info = (struct MPLI_thread_info *) malloc(sizeof(struct MPLI_thread_info));
     if (thread_info != NULL) {
         pthread_attr_t attr;
 
@@ -64,8 +53,8 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         pthread_attr_init(&attr);
         pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 
-        err = pthread_create(idp, &attr, MPIUI_Thread_start, thread_info);
-        /* FIXME: convert error to an MPIU_THREAD_ERR value */
+        err = pthread_create(idp, &attr, MPLI_thread_start, thread_info);
+        /* FIXME: convert error to an MPL_THREAD_ERR value */
 
         pthread_attr_destroy(&attr);
     }
@@ -80,17 +69,17 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
 
 
 /*
- * MPIUI_Thread_start()
+ * MPLI_thread_start()
  *
  * Start functions in pthreads are expected to return a void pointer.  Since
  * our start functions do not return a value we must
  * use an intermediate function to perform call to the user's start function
  * and then return a value of NULL.
  */
-void *MPIUI_Thread_start(void *arg)
+void *MPLI_thread_start(void *arg)
 {
-    struct MPIUI_Thread_info *thread_info = (struct MPIUI_Thread_info *) arg;
-    MPIU_Thread_func_t func = thread_info->func;
+    struct MPLI_thread_info *thread_info = (struct MPLI_thread_info *) arg;
+    MPL_thread_func_t func = thread_info->func;
     void *data = thread_info->data;
 
     free(arg);
@@ -100,5 +89,4 @@ void *MPIUI_Thread_start(void *arg)
     return NULL;
 }
 
-/* end posix impl */
 #endif
diff --git a/src/util/thread/mpiu_thread_solaris.c b/src/mpl/src/thread/mpl_thread_solaris.c
similarity index 54%
rename from src/util/thread/mpiu_thread_solaris.c
rename to src/mpl/src/thread/mpl_thread_solaris.c
index d187973..1e05f1f 100644
--- a/src/util/thread/mpiu_thread_solaris.c
+++ b/src/mpl/src/thread/mpl_thread_solaris.c
@@ -4,12 +4,7 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-/* common header includes */
-#include <stdlib.h>
-#include "mpichconf.h"  /* defines MPICH_THREAD_PACKAGE_NAME */
 #include "mpl.h"
-#include "mpiutil.h"    /* for HAS_NO_SYMBOLS_WARNING */
-#include "mpiu_thread.h"
 
 MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
@@ -22,40 +17,39 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 /* Implementation specific function definitions (usually in the form of macros) */
 
-#if defined(MPICH_THREAD_PACKAGE_NAME) && (MPICH_THREAD_PACKAGE_NAME == MPICH_THREAD_PACKAGE_SOLARIS)
-/* begin solaris impl */
+#if MPL_THREAD_PACKAGE_NAME == MPL_THREAD_PACKAGE_SOLARIS
 
 /*
- * struct MPIUI_Thread_info
+ * struct MPLI_thread_info
  *
- * Structure used to pass the user function and data to the intermediate function, MPIUI_Thread_start.  See comment in
- * MPIUI_Thread_start() header for more information.
+ * Structure used to pass the user function and data to the intermediate function, MPLI_thread_start.  See comment in
+ * MPLI_thread_start() header for more information.
  */
-struct MPIUI_Thread_info {
-    MPIU_Thread_func_t func;
+struct MPLI_thread_info {
+    MPL_thread_func_t func;
     void *data;
 };
 
 
-void *MPIUI_Thread_start(void *arg);
+void *MPLI_thread_start(void *arg);
 
 
 /*
- * MPIU_Thread_create()
+ * MPL_thread_create()
  */
-void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t * idp, int *errp)
+void MPL_thread_create(MPL_thread_func_t func, void *data, MPL_thread_id_t * idp, int *errp)
 {
-    struct MPIUI_Thread_info *thread_info;
-    int err = MPIU_THREAD_SUCCESS;
+    struct MPLI_thread_info *thread_info;
+    int err = MPL_THREAD_SUCCESS;
 
     /* FIXME: faster allocation, or avoid it all together? */
-    thread_info = (struct MPIUI_Thread_info *) malloc(sizeof(struct MPIUI_Thread_info));
+    thread_info = (struct MPLI_thread_info *) malloc(sizeof(struct MPLI_thread_info));
     if (thread_info != NULL) {
         thread_info->func = func;
         thread_info->data = data;
 
-        err = thr_create(NULL, 0, MPIUI_Thread_start, thread_info, THR_DETACHED, idp);
-        /* FIXME: convert error to an MPIU_THREAD_ERR value */
+        err = thr_create(NULL, 0, MPLI_thread_start, thread_info, THR_DETACHED, idp);
+        /* FIXME: convert error to an MPL_THREAD_ERR value */
     }
     else {
         err = 1000000000;
@@ -68,15 +62,15 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
 
 
 /*
- * MPIUI_Thread_start()
+ * MPLI_thread_start()
  *
  * Start functions in Solaris threads are expected to return a void pointer.  Since our start functions do not return a value we
  * must use an intermediate function to perform call to the user's start function and then return a value of NULL.
  */
-void *MPIUI_Thread_start(void *arg)
+void *MPLI_thread_start(void *arg)
 {
-    struct MPIUI_Thread_info *thread_info = (struct MPIUI_Thread_info *) arg;
-    MPIU_Thread_func_t func = thread_info->func;
+    struct MPLI_thread_info *thread_info = (struct MPLI_thread_info *) arg;
+    MPL_thread_func_t func = thread_info->func;
     void *data = thread_info->data;
 
     free(arg);
@@ -86,5 +80,4 @@ void *MPIUI_Thread_start(void *arg)
     return NULL;
 }
 
-/* end solaris impl */
 #endif
diff --git a/src/util/thread/mpiu_thread_win.c b/src/mpl/src/thread/mpl_thread_win.c
similarity index 56%
rename from src/util/thread/mpiu_thread_win.c
rename to src/mpl/src/thread/mpl_thread_win.c
index 3b177e9..133e439 100644
--- a/src/util/thread/mpiu_thread_win.c
+++ b/src/mpl/src/thread/mpl_thread_win.c
@@ -4,12 +4,7 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-/* common header includes */
-#include <stdlib.h>
-#include "mpichconf.h"  /* defines MPICH_THREAD_PACKAGE_NAME */
 #include "mpl.h"
-#include "mpiutil.h"    /* for HAS_NO_SYMBOLS_WARNING */
-#include "mpiu_thread.h"
 
 MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
@@ -22,38 +17,35 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 /* Implementation specific function definitions (usually in the form of macros) */
 
-#if defined(MPICH_THREAD_PACKAGE_NAME) && (MPICH_THREAD_PACKAGE_NAME == MPICH_THREAD_PACKAGE_WIN)
-/* begin win impl */
-
-#include "mpimem.h"
+#if MPL_THREAD_PACKAGE_NAME == MPL_THREAD_PACKAGE_WIN
 
 /*
- * struct MPIUI_Thread_info
+ * struct MPLI_thread_info
  *
- * Structure used to pass the user function and data to the intermediate function, MPIUI_Thread_start.  See comment in
- * MPIUI_Thread_start() header for more information.
+ * Structure used to pass the user function and data to the intermediate function, MPLI_thread_start.  See comment in
+ * MPLI_thread_start() header for more information.
  */
-struct MPIUI_Thread_info {
-    MPIU_Thread_func_t func;
+struct MPLI_thread_info {
+    MPL_thread_func_t func;
     void *data;
 };
 
 
-DWORD WINAPI MPIUI_Thread_start(LPVOID arg);
+DWORD WINAPI MPLI_thread_start(LPVOID arg);
 
 /*
- * MPIU_Thread_create()
+ * MPL_thread_create()
  */
-void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t * idp, int *errp)
+void MPL_thread_create(MPL_thread_func_t func, void *data, MPL_thread_id_t * idp, int *errp)
 {
-    struct MPIUI_Thread_info *thread_info;
-    int err = MPIU_THREAD_SUCCESS;
+    struct MPLI_thread_info *thread_info;
+    int err = MPL_THREAD_SUCCESS;
 
-    thread_info = (struct MPIUI_Thread_info *) malloc(sizeof(struct MPIUI_Thread_info));
+    thread_info = (struct MPLI_thread_info *) malloc(sizeof(struct MPLI_thread_info));
     if (thread_info != NULL) {
         thread_info->func = func;
         thread_info->data = data;
-        *idp = CreateThread(NULL, 0, MPIUI_Thread_start, thread_info, 0, NULL);
+        *idp = CreateThread(NULL, 0, MPLI_thread_start, thread_info, 0, NULL);
         if (*idp == NULL) {
             err = GetLastError();
         }
@@ -69,15 +61,15 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
 
 
 /*
- * MPIUI_Thread_start()
+ * MPLI_thread_start()
  *
  * Start functions in Windows are expected to return a DWORD.  Since our start functions do not return a value we must
  * use an intermediate function to perform the call to the user's start function and then return a value of 0.
  */
-DWORD WINAPI MPIUI_Thread_start(LPVOID arg)
+DWORD WINAPI MPLI_thread_start(LPVOID arg)
 {
-    struct MPIUI_Thread_info *thread_info = (struct MPIUI_Thread_info *) arg;
-    MPIU_Thread_func_t func = thread_info->func;
+    struct MPLI_thread_info *thread_info = (struct MPLI_thread_info *) arg;
+    MPL_thread_func_t func = thread_info->func;
     void *data = thread_info->data;
 
     free(arg);
@@ -87,22 +79,22 @@ DWORD WINAPI MPIUI_Thread_start(LPVOID arg)
     return 0;
 }
 
-void MPIU_Thread_exit()
+void MPL_thread_exit()
 {
     ExitThread(0);
 }
 
-void MPIU_Thread_self(MPIU_Thread_id_t * id)
+void MPL_thread_self(MPL_thread_id_t * id)
 {
     *id = GetCurrentThread();
 }
 
-void MPIU_Thread_same(MPIU_Thread_id_t * id1, MPIU_Thread_id_t * id2, int *same)
+void MPL_thread_same(MPL_thread_id_t * id1, MPL_thread_id_t * id2, int *same)
 {
     *same = (*id1 == *id2) ? TRUE : FALSE;
 }
 
-void MPIU_Thread_yield(void)
+void MPL_thread_yield(void)
 {
     Sleep(0);
 }
@@ -111,7 +103,7 @@ void MPIU_Thread_yield(void)
  *    Mutexes
  */
 
-void MPIU_Thread_mutex_create(MPIU_Thread_mutex_t * mutex, int *err)
+void MPL_thread_mutex_create(MPL_thread_mutex_t * mutex, int *err)
 {
     *mutex = CreateMutex(NULL, FALSE, NULL);
     if (err != NULL) {
@@ -119,19 +111,19 @@ void MPIU_Thread_mutex_create(MPIU_Thread_mutex_t * mutex, int *err)
             *err = GetLastError();
         }
         else {
-            *err = MPIU_THREAD_SUCCESS;
+            *err = MPL_THREAD_SUCCESS;
         }
     }
 }
 
-void MPIU_Thread_mutex_destroy(MPIU_Thread_mutex_t * mutex, int *err)
+void MPL_thread_mutex_destroy(MPL_thread_mutex_t * mutex, int *err)
 {
     BOOL result;
 
     result = CloseHandle(*mutex);
     if (err != NULL) {
         if (result) {
-            *err = MPIU_THREAD_SUCCESS;
+            *err = MPL_THREAD_SUCCESS;
         }
         else {
             *err = GetLastError();
@@ -139,14 +131,14 @@ 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 MPL_thread_mutex_lock(MPL_thread_mutex_t * mutex, int *err)
 {
     DWORD result;
 
     result = WaitForSingleObject(*mutex, INFINITE);
     if (err != NULL) {
         if (result == WAIT_OBJECT_0) {
-            *err = MPIU_THREAD_SUCCESS;
+            *err = MPL_THREAD_SUCCESS;
         }
         else {
             if (result == WAIT_FAILED) {
@@ -159,14 +151,14 @@ 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 MPL_thread_mutex_unlock(MPL_thread_mutex_t * mutex, int *err)
 {
     BOOL result;
 
     result = ReleaseMutex(*mutex);
     if (err != NULL) {
         if (result) {
-            *err = MPIU_THREAD_SUCCESS;
+            *err = MPL_THREAD_SUCCESS;
         }
         else {
             *err = GetLastError();
@@ -179,54 +171,54 @@ void MPIU_Thread_mutex_unlock(MPIU_Thread_mutex_t * mutex, int *err)
  * Condition Variables
  */
 
-void MPIU_Thread_cond_create(MPIU_Thread_cond_t * cond, int *err)
+void MPL_thread_cond_create(MPL_thread_cond_t * cond, int *err)
 {
     /* Create a tls slot to store the events used to wakeup each thread in cond_bcast or cond_signal */
-    MPIU_Thread_tls_create(NULL, &cond->tls, err);
-    if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+    MPL_thread_tls_create(NULL, &cond->tls, err);
+    if (err != NULL && *err != MPL_THREAD_SUCCESS) {
         return;
     }
     /* Create a mutex to protect the fifo queue.  This is required because the mutex passed in to the
      * cond functions need not be the same in each thread. */
-    MPIU_Thread_mutex_create(&cond->fifo_mutex, err);
-    if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+    MPL_thread_mutex_create(&cond->fifo_mutex, err);
+    if (err != NULL && *err != MPL_THREAD_SUCCESS) {
         return;
     }
     cond->fifo_head = NULL;
     cond->fifo_tail = NULL;
     if (err != NULL) {
-        *err = MPIU_THREAD_SUCCESS;
+        *err = MPL_THREAD_SUCCESS;
     }
 }
 
-void MPIU_Thread_cond_destroy(MPIU_Thread_cond_t * cond, int *err)
+void MPL_thread_cond_destroy(MPL_thread_cond_t * cond, int *err)
 {
-    MPIUI_Win_thread_cond_fifo_t *iter;
+    MPLI_win_thread_cond_fifo_t *iter;
 
     while (cond->fifo_head) {
         iter = cond->fifo_head;
         cond->fifo_head = cond->fifo_head->next;
         free(iter);
     }
-    MPIU_Thread_mutex_destroy(&cond->fifo_mutex, err);
-    if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+    MPL_thread_mutex_destroy(&cond->fifo_mutex, err);
+    if (err != NULL && *err != MPL_THREAD_SUCCESS) {
         return;
     }
-    MPIU_Thread_tls_destroy(&cond->tls, err);
+    MPL_thread_tls_destroy(&cond->tls, err);
     /*
      * if (err != NULL)
      * {
-     * *err = MPIU_THREAD_SUCCESS;
+     * *err = MPL_THREAD_SUCCESS;
      * }
      */
 }
 
-void MPIU_Thread_cond_wait(MPIU_Thread_cond_t * cond, MPIU_Thread_mutex_t * mutex, int *err)
+void MPL_thread_cond_wait(MPL_thread_cond_t * cond, MPL_thread_mutex_t * mutex, int *err)
 {
     HANDLE event;
     DWORD result;
-    MPIU_Thread_tls_get(&cond->tls, &event, err);
-    if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+    MPL_thread_tls_get(&cond->tls, &event, err);
+    if (err != NULL && *err != MPL_THREAD_SUCCESS) {
         return;
     }
     if (event == NULL) {
@@ -237,22 +229,22 @@ void MPIU_Thread_cond_wait(MPIU_Thread_cond_t * cond, MPIU_Thread_mutex_t * mute
             }
             return;
         }
-        MPIU_Thread_tls_set(&cond->tls, event, err);
-        if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+        MPL_thread_tls_set(&cond->tls, event, err);
+        if (err != NULL && *err != MPL_THREAD_SUCCESS) {
             return;
         }
     }
-    MPIU_Thread_mutex_lock(&cond->fifo_mutex, err);
-    if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+    MPL_thread_mutex_lock(&cond->fifo_mutex, err);
+    if (err != NULL && *err != MPL_THREAD_SUCCESS) {
         return;
     }
     if (cond->fifo_tail == NULL) {
-        cond->fifo_tail = (MPIUI_Win_thread_cond_fifo_t *) malloc(sizeof(MPIUI_Win_thread_cond_fifo_t));
+        cond->fifo_tail = (MPLI_win_thread_cond_fifo_t *) malloc(sizeof(MPLI_win_thread_cond_fifo_t));
         cond->fifo_head = cond->fifo_tail;
     }
     else {
         cond->fifo_tail->next =
-            (MPIUI_Win_thread_cond_fifo_t *) malloc(sizeof(MPIUI_Win_thread_cond_fifo_t));
+            (MPLI_win_thread_cond_fifo_t *) malloc(sizeof(MPLI_win_thread_cond_fifo_t));
         cond->fifo_tail = cond->fifo_tail->next;
     }
     if (cond->fifo_tail == NULL) {
@@ -263,12 +255,12 @@ void MPIU_Thread_cond_wait(MPIU_Thread_cond_t * cond, MPIU_Thread_mutex_t * mute
     }
     cond->fifo_tail->event = event;
     cond->fifo_tail->next = NULL;
-    MPIU_Thread_mutex_unlock(&cond->fifo_mutex, err);
-    if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+    MPL_thread_mutex_unlock(&cond->fifo_mutex, err);
+    if (err != NULL && *err != MPL_THREAD_SUCCESS) {
         return;
     }
-    MPIU_Thread_mutex_unlock(mutex, err);
-    if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+    MPL_thread_mutex_unlock(mutex, err);
+    if (err != NULL && *err != MPL_THREAD_SUCCESS) {
         return;
     }
     result = WaitForSingleObject(event, INFINITE);
@@ -288,27 +280,27 @@ void MPIU_Thread_cond_wait(MPIU_Thread_cond_t * cond, MPIU_Thread_mutex_t * mute
         *err = GetLastError();
         return;
     }
-    MPIU_Thread_mutex_lock(mutex, err);
+    MPL_thread_mutex_lock(mutex, err);
     /*
      * if (err != NULL)
      * {
-     * *err = MPIU_THREAD_SUCCESS;
+     * *err = MPL_THREAD_SUCCESS;
      * }
      */
 }
 
-void MPIU_Thread_cond_broadcast(MPIU_Thread_cond_t * cond, int *err)
+void MPL_thread_cond_broadcast(MPL_thread_cond_t * cond, int *err)
 {
-    MPIUI_Win_thread_cond_fifo_t *fifo, *temp;
-    MPIU_Thread_mutex_lock(&cond->fifo_mutex, err);
-    if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+    MPLI_win_thread_cond_fifo_t *fifo, *temp;
+    MPL_thread_mutex_lock(&cond->fifo_mutex, err);
+    if (err != NULL && *err != MPL_THREAD_SUCCESS) {
         return;
     }
     /* remove the fifo queue from the cond variable */
     fifo = cond->fifo_head;
     cond->fifo_head = cond->fifo_tail = NULL;
-    MPIU_Thread_mutex_unlock(&cond->fifo_mutex, err);
-    if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+    MPL_thread_mutex_unlock(&cond->fifo_mutex, err);
+    if (err != NULL && *err != MPL_THREAD_SUCCESS) {
         return;
     }
     /* signal each event in the fifo queue */
@@ -323,15 +315,15 @@ void MPIU_Thread_cond_broadcast(MPIU_Thread_cond_t * cond, int *err)
         free(temp);
     }
     if (err != NULL) {
-        *err = MPIU_THREAD_SUCCESS;
+        *err = MPL_THREAD_SUCCESS;
     }
 }
 
-void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int *err)
+void MPL_thread_cond_signal(MPL_thread_cond_t * cond, int *err)
 {
-    MPIUI_Win_thread_cond_fifo_t *fifo;
-    MPIU_Thread_mutex_lock(&cond->fifo_mutex, err);
-    if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+    MPLI_win_thread_cond_fifo_t *fifo;
+    MPL_thread_mutex_lock(&cond->fifo_mutex, err);
+    if (err != NULL && *err != MPL_THREAD_SUCCESS) {
         return;
     }
     fifo = cond->fifo_head;
@@ -340,8 +332,8 @@ void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int *err)
         if (cond->fifo_head == NULL)
             cond->fifo_tail = NULL;
     }
-    MPIU_Thread_mutex_unlock(&cond->fifo_mutex, err);
-    if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
+    MPL_thread_mutex_unlock(&cond->fifo_mutex, err);
+    if (err != NULL && *err != MPL_THREAD_SUCCESS) {
         return;
     }
     if (fifo) {
@@ -353,14 +345,8 @@ void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int *err)
         free(fifo);
     }
     if (err != NULL) {
-        *err = MPIU_THREAD_SUCCESS;
+        *err = MPL_THREAD_SUCCESS;
     }
 }
 
-
-/*
- * Thread Local Storage
- * - Defined in src/include/thread/mpiu_thread_win_funcs.h
- */
-/* end win impl */
 #endif
diff --git a/src/util/Makefile.mk b/src/util/Makefile.mk
index 7bde3f8..890a796 100644
--- a/src/util/Makefile.mk
+++ b/src/util/Makefile.mk
@@ -11,7 +11,6 @@ include $(top_srcdir)/src/util/mem/Makefile.mk
 include $(top_srcdir)/src/util/cvar/Makefile.mk
 include $(top_srcdir)/src/util/procmap/Makefile.mk
 include $(top_srcdir)/src/util/refcount/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
diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index ca213f1..1d0f12a 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -155,8 +155,8 @@ int MPIU_DBG_Outevent( const char *file, int line, int class, int kind,
         /* the thread ID is not necessarily unique between processes, so a
          * (pid,tid) pair should be used to uniquely identify output from
          * particular threads on a system */
-	MPIU_Thread_id_t tid;
-	MPIU_Thread_self(&tid);
+	MPL_thread_id_t tid;
+	MPL_thread_self(&tid);
 	threadID = (unsigned long long int)tid;
     }
 #endif
@@ -784,8 +784,8 @@ static int dbg_get_filename(char *filename, int len)
             else if (*p == 't') {
 #ifdef MPICH_IS_THREADED
                 char threadIDAsChar[30];
-                MPIU_Thread_id_t tid;
-                MPIU_Thread_self(&tid);
+                MPL_thread_id_t tid;
+                MPL_thread_self(&tid);
                 threadID = (unsigned long long int)tid;
 
                 MPL_snprintf( threadIDAsChar, sizeof(threadIDAsChar), 
diff --git a/src/util/thread/Makefile.mk b/src/util/thread/Makefile.mk
deleted file mode 100644
index fb26c00..0000000
--- a/src/util/thread/Makefile.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-## -*- 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/thread
-
-noinst_HEADERS +=                               \
-    src/util/thread/mpiu_thread.h               \
-    src/util/thread/mpiu_thread_priv.h	      	\
-    src/util/thread/mpiu_thread_posix.h   	\
-    src/util/thread/mpiu_thread_solaris.h 	\
-    src/util/thread/mpiu_thread_win.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.h b/src/util/thread/mpiu_thread.h
deleted file mode 100644
index eed76c5..0000000
--- a/src/util/thread/mpiu_thread.h
+++ /dev/null
@@ -1,58 +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(MPIU_THREAD_H_INCLUDED)
-#define MPIU_THREAD_H_INCLUDED
-
-#include "mpi.h"
-#include "mpichconf.h"  /* defines MPICH_THREAD_PACKAGE_NAME */
-#include "mpichconfconst.h"
-#include "mpidbg.h"
-#include "mpiu_strerror.h"
-
-/* FIXME: Adding mpimem.h here as a workaround for using MPIU_Calloc
- * functionality. */
-#include "mpimem.h"
-
-/* _INVALID exists to avoid accidental macro evaluations to 0 */
-#define MPICH_THREAD_PACKAGE_INVALID 0
-#define MPICH_THREAD_PACKAGE_NONE    1
-#define MPICH_THREAD_PACKAGE_POSIX   2
-#define MPICH_THREAD_PACKAGE_SOLARIS 3
-#define MPICH_THREAD_PACKAGE_WIN     4
-
-#if defined(MPICH_THREAD_PACKAGE_NAME) && (MPICH_THREAD_PACKAGE_NAME == MPICH_THREAD_PACKAGE_POSIX)
-#  include "mpiu_thread_posix.h"
-#elif defined(MPICH_THREAD_PACKAGE_NAME) && (MPICH_THREAD_PACKAGE_NAME == MPICH_THREAD_PACKAGE_SOLARIS)
-#  include "mpiu_thread_solaris.h"
-#elif defined(MPICH_THREAD_PACKAGE_NAME) && (MPICH_THREAD_PACKAGE_NAME == MPICH_THREAD_PACKAGE_WIN)
-#  include "mpiu_thread_win.h"
-#elif defined(MPICH_THREAD_PACKAGE_NAME) && (MPICH_THREAD_PACKAGE_NAME == MPICH_THREAD_PACKAGE_NONE)
-typedef int MPIU_Thread_mutex_t;
-typedef int MPIU_Thread_cond_t;
-typedef int MPIU_Thread_id_t;
-typedef int MPIU_Thread_tls_t;
-typedef void (*MPIU_Thread_func_t) (void *data);
-#define MPIU_Thread_mutex_create(mutex_ptr_, err_ptr_)  { *((int*)err_ptr_) = 0;}
-#define MPIU_Thread_mutex_destroy(mutex_ptr_, err_ptr_) { *((int*)err_ptr_) = 0;}
-#else
-#  error "thread package not defined or unknown"
-#endif
-
-/* Error values */
-#define MPIU_THREAD_SUCCESS 0
-#define MPIU_THREAD_ERROR   1
-/* FIXME: Define other error codes.  For now, any non-zero value is an error. */
-
-#if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_INVALID
-#  error Invalid thread granularity option specified (possibly none)
-#elif MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_LOCK_FREE
-#  error MPICH_THREAD_GRANULARITY_LOCK_FREE not implemented yet
-#endif
-
-#include "mpiu_thread_priv.h"
-
-#endif /* !defined(MPIU_THREAD_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_priv.h b/src/util/thread/mpiu_thread_priv.h
deleted file mode 100644
index 0bfec7f..0000000
--- a/src/util/thread/mpiu_thread_priv.h
+++ /dev/null
@@ -1,115 +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(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(MPICH_IS_THREADED) && !defined(MPICH_TLS_SPECIFIER)
-
-/* We need to provide a function that will cleanup the storage attached
- * to the key.  */
-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 MPIUI_Per_thread_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
-   MPIUI_Per_thread_t struct, as in the single threaded case.  Based on
-   whether MPICH is initialized with thread safety, one or the other is used.
-
- */
-
-#define MPIU_THREADPRIV_KEY_CREATE(key, var, err_ptr_)                  \
-    do {                                                                \
-        void *thread_ptr;                                               \
-                                                                        \
-        MPIU_Thread_tls_create(MPIUI_Cleanup_tls, &(key) , err_ptr_);   \
-        if (unlikely(*((int *) err_ptr_)))                              \
-            break;                                                      \
-        thread_ptr = calloc(1, sizeof(var));                            \
-        if (unlikely(!thread_ptr)) {                                    \
-            *((int *) err_ptr_) = MPIU_THREAD_ERROR;                    \
-            break;                                                      \
-        }                                                               \
-        MPIU_Thread_tls_set(&(key), thread_ptr, err_ptr_);              \
-    } while (0)
-
-#define MPIU_THREADPRIV_KEY_GET_ADDR(is_threaded, key, var, addr, err_ptr_) \
-    do {                                                                \
-        if (is_threaded) {                                              \
-            void *thread_ptr;                                           \
-            MPIU_Thread_tls_get(&(key), &thread_ptr, err_ptr_);         \
-            if (unlikely(*((int *) err_ptr_)))                          \
-                break;                                                  \
-            if (!thread_ptr) {                                          \
-                thread_ptr = calloc(1, sizeof(var));                    \
-                if (unlikely(!thread_ptr)) {                            \
-                    *((int *) err_ptr_) = MPIU_THREAD_ERROR;            \
-                    break;                                              \
-                }                                                       \
-                MPIU_Thread_tls_set(&(key), thread_ptr, err_ptr_);      \
-                if (unlikely(*((int *) err_ptr_)))                      \
-                    break;                                              \
-            }                                                           \
-            addr = thread_ptr;                                          \
-        }                                                               \
-        else {                                                          \
-            addr = &(var);                                              \
-        }                                                               \
-    } while (0)
-
-#define MPIU_THREADPRIV_KEY_DESTROY(key, err_ptr_)              \
-    do {                                                        \
-        void *thread_ptr;                                       \
-                                                                \
-        MPIU_Thread_tls_get(&(key), &thread_ptr, err_ptr_);     \
-        if (unlikely(*((int *) err_ptr_)))                      \
-            break;                                              \
-                                                                \
-        if (thread_ptr)                                         \
-            free(thread_ptr);                                   \
-                                                                \
-        MPIU_Thread_tls_set(&(key), NULL, err_ptr_);            \
-        if (unlikely(*((int *) err_ptr_)))                      \
-            break;                                              \
-                                                                \
-        MPIU_Thread_tls_destroy(&(key), err_ptr_);              \
-    } while (0)
-
-#else /* !defined(MPICH_IS_THREADED) || defined(MPICH_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. */
-#define MPIU_THREADPRIV_KEY_CREATE(...)
-#define MPIU_THREADPRIV_KEY_GET_ADDR(is_threaded, key, var, addr, err_ptr_) \
-    do {                                                                \
-        addr = &(var);                                                  \
-        *((int *) err_ptr_) = MPIU_THREAD_SUCCESS;                      \
-    } while (0)
-#define MPIU_THREADPRIV_KEY_DESTROY(...)
-
-#endif /* defined(MPICH_TLS_SPECIFIER) */
-
-#endif /* !defined(MPIU_THREAD_PRIV_H_INCLUDED) */

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

commit c473c9697d55004f1c26b57db96931873a7751fd
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Jan 8 14:10:47 2016 -0600

    threads: hack to use malloc/free directly.
    
    This is a temporary hack till we move the memory allocation code to
    MPL as well.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/include/mpimem.h b/src/include/mpimem.h
index 2cd68c1..4a65023 100644
--- a/src/include/mpimem.h
+++ b/src/include/mpimem.h
@@ -229,9 +229,11 @@ void MPIU_trdump(FILE *, int);
 #define MPIU_Realloc(a,b)    MPIU_trrealloc((a),(b),__LINE__,__FILE__)
 
 /* Define these as invalid C to catch their use in the code */
+#if 0
 #define malloc(a)         'Error use MPIU_Malloc' :::
 #define calloc(a,b)       'Error use MPIU_Calloc' :::
 #define free(a)           'Error use MPIU_Free'   :::
+#endif
 #define realloc(a)        'Error use MPIU_Realloc' :::
 #if defined(strdup) || defined(__strdup)
 #undef strdup
diff --git a/src/util/thread/mpiu_thread.c b/src/util/thread/mpiu_thread.c
index 863e937..b3cd5e8 100644
--- a/src/util/thread/mpiu_thread.c
+++ b/src/util/thread/mpiu_thread.c
@@ -16,7 +16,7 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 void MPIUI_Cleanup_tls(void *a)
 {
     if (a)
-        MPIU_Free(a);
+        free(a);
 }
 
 #endif
diff --git a/src/util/thread/mpiu_thread_posix.c b/src/util/thread/mpiu_thread_posix.c
index f2ec417..43d9c8f 100644
--- a/src/util/thread/mpiu_thread_posix.c
+++ b/src/util/thread/mpiu_thread_posix.c
@@ -54,7 +54,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     int err = MPIU_THREAD_SUCCESS;
 
     /* FIXME: faster allocation, or avoid it all together? */
-    thread_info = (struct MPIUI_Thread_info *) MPIU_Malloc(sizeof(struct MPIUI_Thread_info));
+    thread_info = (struct MPIUI_Thread_info *) malloc(sizeof(struct MPIUI_Thread_info));
     if (thread_info != NULL) {
         pthread_attr_t attr;
 
@@ -93,7 +93,7 @@ void *MPIUI_Thread_start(void *arg)
     MPIU_Thread_func_t func = thread_info->func;
     void *data = thread_info->data;
 
-    MPIU_Free(arg);
+    free(arg);
 
     func(data);
 
diff --git a/src/util/thread/mpiu_thread_priv.h b/src/util/thread/mpiu_thread_priv.h
index bb6d1ad..0bfec7f 100644
--- a/src/util/thread/mpiu_thread_priv.h
+++ b/src/util/thread/mpiu_thread_priv.h
@@ -49,7 +49,7 @@ void MPIUI_Cleanup_tls(void *a);
         MPIU_Thread_tls_create(MPIUI_Cleanup_tls, &(key) , err_ptr_);   \
         if (unlikely(*((int *) err_ptr_)))                              \
             break;                                                      \
-        thread_ptr = MPIU_Calloc(1, sizeof(var));                       \
+        thread_ptr = calloc(1, sizeof(var));                            \
         if (unlikely(!thread_ptr)) {                                    \
             *((int *) err_ptr_) = MPIU_THREAD_ERROR;                    \
             break;                                                      \
@@ -65,7 +65,7 @@ void MPIUI_Cleanup_tls(void *a);
             if (unlikely(*((int *) err_ptr_)))                          \
                 break;                                                  \
             if (!thread_ptr) {                                          \
-                thread_ptr = MPIU_Calloc(1, sizeof(var));               \
+                thread_ptr = calloc(1, sizeof(var));                    \
                 if (unlikely(!thread_ptr)) {                            \
                     *((int *) err_ptr_) = MPIU_THREAD_ERROR;            \
                     break;                                              \
@@ -90,7 +90,7 @@ void MPIUI_Cleanup_tls(void *a);
             break;                                              \
                                                                 \
         if (thread_ptr)                                         \
-            MPIU_Free(thread_ptr);                              \
+            free(thread_ptr);                                   \
                                                                 \
         MPIU_Thread_tls_set(&(key), NULL, err_ptr_);            \
         if (unlikely(*((int *) err_ptr_)))                      \
diff --git a/src/util/thread/mpiu_thread_solaris.c b/src/util/thread/mpiu_thread_solaris.c
index 3795f14..d187973 100644
--- a/src/util/thread/mpiu_thread_solaris.c
+++ b/src/util/thread/mpiu_thread_solaris.c
@@ -49,7 +49,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     int err = MPIU_THREAD_SUCCESS;
 
     /* FIXME: faster allocation, or avoid it all together? */
-    thread_info = (struct MPIUI_Thread_info *) MPIU_Malloc(sizeof(struct MPIUI_Thread_info));
+    thread_info = (struct MPIUI_Thread_info *) malloc(sizeof(struct MPIUI_Thread_info));
     if (thread_info != NULL) {
         thread_info->func = func;
         thread_info->data = data;
@@ -79,7 +79,7 @@ void *MPIUI_Thread_start(void *arg)
     MPIU_Thread_func_t func = thread_info->func;
     void *data = thread_info->data;
 
-    MPIU_Free(arg);
+    free(arg);
 
     func(data);
 
diff --git a/src/util/thread/mpiu_thread_win.c b/src/util/thread/mpiu_thread_win.c
index 4c8ca7f..3b177e9 100644
--- a/src/util/thread/mpiu_thread_win.c
+++ b/src/util/thread/mpiu_thread_win.c
@@ -49,7 +49,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     struct MPIUI_Thread_info *thread_info;
     int err = MPIU_THREAD_SUCCESS;
 
-    thread_info = (struct MPIUI_Thread_info *) MPIU_Malloc(sizeof(struct MPIUI_Thread_info));
+    thread_info = (struct MPIUI_Thread_info *) malloc(sizeof(struct MPIUI_Thread_info));
     if (thread_info != NULL) {
         thread_info->func = func;
         thread_info->data = data;
@@ -80,7 +80,7 @@ DWORD WINAPI MPIUI_Thread_start(LPVOID arg)
     MPIU_Thread_func_t func = thread_info->func;
     void *data = thread_info->data;
 
-    MPIU_Free(arg);
+    free(arg);
 
     func(data);
 
@@ -206,7 +206,7 @@ void MPIU_Thread_cond_destroy(MPIU_Thread_cond_t * cond, int *err)
     while (cond->fifo_head) {
         iter = cond->fifo_head;
         cond->fifo_head = cond->fifo_head->next;
-        MPIU_Free(iter);
+        free(iter);
     }
     MPIU_Thread_mutex_destroy(&cond->fifo_mutex, err);
     if (err != NULL && *err != MPIU_THREAD_SUCCESS) {
@@ -247,12 +247,12 @@ void MPIU_Thread_cond_wait(MPIU_Thread_cond_t * cond, MPIU_Thread_mutex_t * mute
         return;
     }
     if (cond->fifo_tail == NULL) {
-        cond->fifo_tail = (MPIUI_Win_thread_cond_fifo_t *) MPIU_Malloc(sizeof(MPIUI_Win_thread_cond_fifo_t));
+        cond->fifo_tail = (MPIUI_Win_thread_cond_fifo_t *) malloc(sizeof(MPIUI_Win_thread_cond_fifo_t));
         cond->fifo_head = cond->fifo_tail;
     }
     else {
         cond->fifo_tail->next =
-            (MPIUI_Win_thread_cond_fifo_t *) MPIU_Malloc(sizeof(MPIUI_Win_thread_cond_fifo_t));
+            (MPIUI_Win_thread_cond_fifo_t *) malloc(sizeof(MPIUI_Win_thread_cond_fifo_t));
         cond->fifo_tail = cond->fifo_tail->next;
     }
     if (cond->fifo_tail == NULL) {
@@ -320,7 +320,7 @@ void MPIU_Thread_cond_broadcast(MPIU_Thread_cond_t * cond, int *err)
         }
         temp = fifo;
         fifo = fifo->next;
-        MPIU_Free(temp);
+        free(temp);
     }
     if (err != NULL) {
         *err = MPIU_THREAD_SUCCESS;
@@ -347,10 +347,10 @@ void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int *err)
     if (fifo) {
         if (!SetEvent(fifo->event) && err != NULL) {
             *err = GetLastError();
-            MPIU_Free(fifo);
+            free(fifo);
             return;
         }
-        MPIU_Free(fifo);
+        free(fifo);
     }
     if (err != NULL) {
         *err = MPIU_THREAD_SUCCESS;

http://git.mpich.org/mpich.git/commitdiff/2b9dce854f17f484ffeaf2d542843efdd0c03a2f

commit 2b9dce854f17f484ffeaf2d542843efdd0c03a2f
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 7 02:07:52 2016 -0600

    threads: move TLS structures outside MPIU.
    
    This is a large change which moves the TLS structures outside of MPIU.
    It includes corresponding changes to the MPIU TLS API, as well as the
    usage of TLS throughout MPICH.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 33078a7..56c2083 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -215,6 +215,38 @@ typedef struct {
 extern MPIR_Thread_info_t MPIR_ThreadInfo;
 
 
+/* ------------------------------------------------------------------------- */
+/* thread-local storage macros */
+/* arbitrary, just needed to avoid cleaning up heap allocated memory at thread
+ * destruction time */
+#define MPIR_STRERROR_BUF_SIZE (1024)
+
+/* 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 {
+    int op_errno;               /* For errors in predefined MPI_Ops */
+
+    /* error string storage for MPIU_Strerror */
+    char strerrbuf[MPIR_STRERROR_BUF_SIZE];
+
+#if (MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE)
+    int lock_depth;
+#endif
+} MPIR_Per_thread_t;
+
+#if defined(MPICH_IS_THREADED) && defined(MPICH_TLS_SPECIFIER)
+extern MPICH_TLS_SPECIFIER MPIR_Per_thread_t MPIR_Per_thread;
+#else
+extern MPIR_Per_thread_t MPIR_Per_thread;
+#endif
+
+extern MPID_Thread_tls_t MPIR_Per_thread_key;
+
+
 /*TDSOverview.tex
   
   MPI has a number of data structures, most of which are represented by 
diff --git a/src/mpi/coll/exscan.c b/src/mpi/coll/exscan.c
index 038487d..b435ab1 100644
--- a/src/mpi/coll/exscan.c
+++ b/src/mpi/coll/exscan.c
@@ -102,17 +102,22 @@ int MPIR_Exscan (
     void *partial_scan, *tmp_buf;
     MPID_Op *op_ptr;
     MPIU_CHKLMEM_DECL(2);
-    MPID_THREADPRIV_DECL;
     
     if (count == 0) return MPI_SUCCESS;
 
-    MPID_THREADPRIV_GET;
-
     comm_size = comm_ptr->local_size;
     rank = comm_ptr->rank;
     
     /* set op_errno to 0. stored in perthread structure */
-    MPID_THREADPRIV_FIELD(op_errno) = 0;
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        per_thread->op_errno = 0;
+    }
 
     if (HANDLE_GET_KIND(op) == HANDLE_KIND_BUILTIN) {
         is_commutative = 1;
@@ -215,8 +220,17 @@ int MPIR_Exscan (
     /* check if multiple threads are calling this collective function */
     MPIDU_ERR_CHECK_MULTIPLE_THREADS_EXIT( comm_ptr );
 
-    if (MPID_THREADPRIV_FIELD(op_errno)) 
-	mpi_errno = MPID_THREADPRIV_FIELD(op_errno);
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+
+        if (per_thread->op_errno)
+            mpi_errno = per_thread->op_errno;
+    }
 
 fn_exit:
     MPIU_CHKLMEM_FREEALL();
diff --git a/src/mpi/coll/ireduce.c b/src/mpi/coll/ireduce.c
index 1b80e8a..bda2b4b 100644
--- a/src/mpi/coll/ireduce.c
+++ b/src/mpi/coll/ireduce.c
@@ -41,7 +41,6 @@ int MPIR_Ireduce_binomial(const void *sendbuf, void *recvbuf, int count, MPI_Dat
     MPI_Aint true_lb, true_extent, extent;
     void *tmp_buf;
     MPIR_SCHED_CHKPMEM_DECL(2);
-    MPID_THREADPRIV_DECL;
 
     MPIU_Assert(comm_ptr->comm_kind == MPID_INTRACOMM);
 
@@ -51,8 +50,15 @@ int MPIR_Ireduce_binomial(const void *sendbuf, void *recvbuf, int count, MPI_Dat
     rank = comm_ptr->rank;
 
     /* set op_errno to 0. stored in perthread structure */
-    MPID_THREADPRIV_GET;
-    MPID_THREADPRIV_FIELD(op_errno) = 0;
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        per_thread->op_errno = 0;
+    }
 
     /* Create a temporary buffer */
 
diff --git a/src/mpi/coll/opband.c b/src/mpi/coll/opband.c
index 210dba7..5c27768 100644
--- a/src/mpi/coll/opband.c
+++ b/src/mpi/coll/opband.c
@@ -42,9 +42,15 @@ void MPIR_BAND (
 #undef MPIR_OP_TYPE_MACRO
         /* --BEGIN ERROR HANDLING-- */
         default: {
-            MPID_THREADPRIV_DECL;
-            MPID_THREADPRIV_GET;
-            MPID_THREADPRIV_FIELD(op_errno) = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_BAND" );
+            {
+                MPIR_Per_thread_t *per_thread = NULL;
+                int err = 0;
+
+                MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                             MPIR_Per_thread, per_thread, &err);
+                MPIU_Assert(err == 0);
+                per_thread->op_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_BAND" );
+            }
             break;
         }
         /* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/opbor.c b/src/mpi/coll/opbor.c
index 57e0001..ef41f85 100644
--- a/src/mpi/coll/opbor.c
+++ b/src/mpi/coll/opbor.c
@@ -42,9 +42,15 @@ void MPIR_BOR (
 #undef MPIR_OP_TYPE_MACRO
         /* --BEGIN ERROR HANDLING-- */
         default: {
-            MPID_THREADPRIV_DECL;
-            MPID_THREADPRIV_GET;
-            MPID_THREADPRIV_FIELD(op_errno) = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_BOR" );
+            {
+                MPIR_Per_thread_t *per_thread = NULL;
+                int err = 0;
+
+                MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                             MPIR_Per_thread, per_thread, &err);
+                MPIU_Assert(err == 0);
+                per_thread->op_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_BOR" );
+            }
             break;
         }
         /* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/opbxor.c b/src/mpi/coll/opbxor.c
index 7edb83f..0be0be7 100644
--- a/src/mpi/coll/opbxor.c
+++ b/src/mpi/coll/opbxor.c
@@ -42,9 +42,15 @@ void MPIR_BXOR (
 #undef MPIR_OP_TYPE_MACRO
 	/* --BEGIN ERROR HANDLING-- */
         default: {
-            MPID_THREADPRIV_DECL;
-            MPID_THREADPRIV_GET;
-            MPID_THREADPRIV_FIELD(op_errno) = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_BXOR" );
+            {
+                MPIR_Per_thread_t *per_thread = NULL;
+                int err = 0;
+
+                MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                             MPIR_Per_thread, per_thread, &err);
+                MPIU_Assert(err == 0);
+                per_thread->op_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_BXOR" );
+            }
             break;
         }
 	/* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/opland.c b/src/mpi/coll/opland.c
index 25660af..45b21af 100644
--- a/src/mpi/coll/opland.c
+++ b/src/mpi/coll/opland.c
@@ -73,9 +73,15 @@ void MPIR_LAND (
 #undef MPIR_OP_TYPE_MACRO
         /* --BEGIN ERROR HANDLING-- */
         default: {
-            MPID_THREADPRIV_DECL;
-            MPID_THREADPRIV_GET;
-            MPID_THREADPRIV_FIELD(op_errno) = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_LAND" );
+            {
+                MPIR_Per_thread_t *per_thread = NULL;
+                int err = 0;
+
+                MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                             MPIR_Per_thread, per_thread, &err);
+                MPIU_Assert(err == 0);
+                per_thread->op_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_LAND" );
+            }
             break;
         }
         /* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/oplor.c b/src/mpi/coll/oplor.c
index c3d48f4..0a268ef 100644
--- a/src/mpi/coll/oplor.c
+++ b/src/mpi/coll/oplor.c
@@ -73,9 +73,15 @@ void MPIR_LOR (
 #undef MPIR_OP_TYPE_MACRO
 	/* --BEGIN ERROR HANDLING-- */
         default: {
-            MPID_THREADPRIV_DECL;
-            MPID_THREADPRIV_GET;
-            MPID_THREADPRIV_FIELD(op_errno) = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_LOR" );
+            {
+                MPIR_Per_thread_t *per_thread = NULL;
+                int err = 0;
+
+                MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                             MPIR_Per_thread, per_thread, &err);
+                MPIU_Assert(err == 0);
+                per_thread->op_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_LOR" );
+            }
             break;
         }
 	/* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/oplxor.c b/src/mpi/coll/oplxor.c
index 0880073..3ea3fbd 100644
--- a/src/mpi/coll/oplxor.c
+++ b/src/mpi/coll/oplxor.c
@@ -73,9 +73,15 @@ void MPIR_LXOR (
 #undef MPIR_OP_TYPE_MACRO
         /* --BEGIN ERROR HANDLING-- */
         default: {
-            MPID_THREADPRIV_DECL;
-            MPID_THREADPRIV_GET;
-            MPID_THREADPRIV_FIELD(op_errno) = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_LXOR" );
+            {
+                MPIR_Per_thread_t *per_thread = NULL;
+                int err = 0;
+
+                MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                             MPIR_Per_thread, per_thread, &err);
+                MPIU_Assert(err == 0);
+                per_thread->op_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_LXOR" );
+            }
             break;
         }
         /* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/opmax.c b/src/mpi/coll/opmax.c
index e809f8b..bb4fa15 100644
--- a/src/mpi/coll/opmax.c
+++ b/src/mpi/coll/opmax.c
@@ -39,9 +39,15 @@ void MPIR_MAXF(
 #undef MPIR_OP_TYPE_MACRO
         /* --BEGIN ERROR HANDLING-- */
         default: {
-            MPID_THREADPRIV_DECL;
-            MPID_THREADPRIV_GET;
-            MPID_THREADPRIV_FIELD(op_errno) = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_MAX" );
+            {
+                MPIR_Per_thread_t *per_thread = NULL;
+                int err = 0;
+
+                MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                             MPIR_Per_thread, per_thread, &err);
+                MPIU_Assert(err == 0);
+                per_thread->op_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_MAX" );
+            }
             break;
         }
         /* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/opmaxloc.c b/src/mpi/coll/opmaxloc.c
index 3c9f781..3732364 100644
--- a/src/mpi/coll/opmaxloc.c
+++ b/src/mpi/coll/opmaxloc.c
@@ -112,10 +112,16 @@ void MPIR_MAXLOC(
 #endif
 	/* --BEGIN ERROR HANDLING-- */
     default: {
-	MPID_THREADPRIV_DECL;
-	MPID_THREADPRIV_GET;
         MPIR_ERR_SET1(mpi_errno, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_MAXLOC" );
-        MPID_THREADPRIV_FIELD(op_errno) = mpi_errno;
+        {
+            MPIR_Per_thread_t *per_thread = NULL;
+            int err = 0;
+
+            MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                         MPIR_Per_thread, per_thread, &err);
+            MPIU_Assert(err == 0);
+            per_thread->op_errno = mpi_errno;
+        }
         break;
     }
 	/* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/opmin.c b/src/mpi/coll/opmin.c
index 8db5101..75cbf3f 100644
--- a/src/mpi/coll/opmin.c
+++ b/src/mpi/coll/opmin.c
@@ -38,9 +38,15 @@ void MPIR_MINF (
 #undef MPIR_OP_TYPE_MACRO
         /* --BEGIN ERROR HANDLING-- */
         default: {
-            MPID_THREADPRIV_DECL;
-            MPID_THREADPRIV_GET;
-            MPID_THREADPRIV_FIELD(op_errno) = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_MIN" );
+            {
+                MPIR_Per_thread_t *per_thread = NULL;
+                int err = 0;
+
+                MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                             MPIR_Per_thread, per_thread, &err);
+                MPIU_Assert(err == 0);
+                per_thread->op_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_MIN" );
+            }
             break;
         }
         /* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/opminloc.c b/src/mpi/coll/opminloc.c
index 6ee7660..ff343ef 100644
--- a/src/mpi/coll/opminloc.c
+++ b/src/mpi/coll/opminloc.c
@@ -111,10 +111,16 @@ void MPIR_MINLOC(
 #endif
 	/* --BEGIN ERROR HANDLING-- */
     default: {
-	MPID_THREADPRIV_DECL;
-	MPID_THREADPRIV_GET;
         MPIR_ERR_SET1(mpi_errno, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_MINLOC" );
-        MPID_THREADPRIV_FIELD(op_errno) = mpi_errno;
+        {
+            MPIR_Per_thread_t *per_thread = NULL;
+            int err = 0;
+
+            MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                         MPIR_Per_thread, per_thread, &err);
+            MPIU_Assert(err == 0);
+            per_thread->op_errno = mpi_errno;
+        }
         break;
     }
 	/* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/opprod.c b/src/mpi/coll/opprod.c
index 38b363f..bf9bdfc 100644
--- a/src/mpi/coll/opprod.c
+++ b/src/mpi/coll/opprod.c
@@ -62,9 +62,15 @@ void MPIR_PROD (
 #define MPIR_OP_C_COMPLEX_TYPE_MACRO(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
         /* --BEGIN ERROR HANDLING-- */
         default: {
-            MPID_THREADPRIV_DECL;
-            MPID_THREADPRIV_GET;
-            MPID_THREADPRIV_FIELD(op_errno) = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_PROD" );
+            {
+                MPIR_Per_thread_t *per_thread = NULL;
+                int err = 0;
+
+                MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                             MPIR_Per_thread, per_thread, &err);
+                MPIU_Assert(err == 0);
+                per_thread->op_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_PROD" );
+            }
             break;
         }
         /* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/opsum.c b/src/mpi/coll/opsum.c
index c500da7..28e4c3b 100644
--- a/src/mpi/coll/opsum.c
+++ b/src/mpi/coll/opsum.c
@@ -61,9 +61,15 @@ void MPIR_SUM (
 #define MPIR_OP_C_COMPLEX_TYPE_MACRO(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
         /* --BEGIN ERROR HANDLING-- */
         default: {
-            MPID_THREADPRIV_DECL;
-            MPID_THREADPRIV_GET;
-            MPID_THREADPRIV_FIELD(op_errno) = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_SUM" );
+            {
+                MPIR_Per_thread_t *per_thread = NULL;
+                int err = 0;
+
+                MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                             MPIR_Per_thread, per_thread, &err);
+                MPIU_Assert(err == 0);
+                per_thread->op_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opundefined","**opundefined %s", "MPI_SUM" );
+            }
             break;
         }
         /* --END ERROR HANDLING-- */
diff --git a/src/mpi/coll/red_scat.c b/src/mpi/coll/red_scat.c
index ec32a50..5eb3595 100644
--- a/src/mpi/coll/red_scat.c
+++ b/src/mpi/coll/red_scat.c
@@ -256,15 +256,21 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
     MPI_Datatype sendtype, recvtype;
     int nprocs_completed, tmp_mask, tree_root, is_commutative;
     MPID_Op *op_ptr;
-    MPID_THREADPRIV_DECL;
     MPIU_CHKLMEM_DECL(5);
 
     comm_size = comm_ptr->local_size;
     rank = comm_ptr->rank;
 
     /* set op_errno to 0. stored in perthread structure */
-    MPID_THREADPRIV_GET;
-    MPID_THREADPRIV_FIELD(op_errno) = 0;
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        per_thread->op_errno = 0;
+    }
 
     MPID_Datatype_get_extent_macro(datatype, extent);
     MPIR_Type_get_true_extent_impl(datatype, &true_lb, &true_extent);
@@ -873,8 +879,16 @@ fn_exit:
     /* check if multiple threads are calling this collective function */
     MPIDU_ERR_CHECK_MULTIPLE_THREADS_EXIT( comm_ptr );
 
-    if (MPID_THREADPRIV_FIELD(op_errno)) 
-	mpi_errno = MPID_THREADPRIV_FIELD(op_errno);
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        if (per_thread->op_errno)
+            mpi_errno = per_thread->op_errno;
+    }
 
     if (mpi_errno_ret)
         mpi_errno = mpi_errno_ret;
diff --git a/src/mpi/coll/red_scat_block.c b/src/mpi/coll/red_scat_block.c
index 2321bde..28c6b17 100644
--- a/src/mpi/coll/red_scat_block.c
+++ b/src/mpi/coll/red_scat_block.c
@@ -256,15 +256,21 @@ int MPIR_Reduce_scatter_block_intra (
     MPI_Datatype sendtype, recvtype;
     int nprocs_completed, tmp_mask, tree_root, is_commutative;
     MPID_Op *op_ptr;
-    MPID_THREADPRIV_DECL;
     MPIU_CHKLMEM_DECL(5);
 
     comm_size = comm_ptr->local_size;
     rank = comm_ptr->rank;
 
     /* set op_errno to 0. stored in perthread structure */
-    MPID_THREADPRIV_GET;
-    MPID_THREADPRIV_FIELD(op_errno) = 0;
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        per_thread->op_errno = 0;
+    }
 
     if (recvcount == 0) {
         goto fn_exit;
@@ -844,8 +850,16 @@ fn_exit:
     /* check if multiple threads are calling this collective function */
     MPIDU_ERR_CHECK_MULTIPLE_THREADS_EXIT( comm_ptr );
 
-    if (MPID_THREADPRIV_FIELD(op_errno)) 
-	mpi_errno = MPID_THREADPRIV_FIELD(op_errno);
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        if (per_thread->op_errno)
+            mpi_errno = per_thread->op_errno;
+    }
 
     /* --BEGIN ERROR HANDLING-- */
     if (mpi_errno_ret)
diff --git a/src/mpi/coll/reduce.c b/src/mpi/coll/reduce.c
index ef03577..9e7575a 100644
--- a/src/mpi/coll/reduce.c
+++ b/src/mpi/coll/reduce.c
@@ -302,14 +302,20 @@ static int MPIR_Reduce_redscat_gather (
     void *tmp_buf;
 
     MPIU_CHKLMEM_DECL(4);
-    MPID_THREADPRIV_DECL;
 
     comm_size = comm_ptr->local_size;
     rank = comm_ptr->rank;
 
     /* set op_errno to 0. stored in perthread structure */
-    MPID_THREADPRIV_GET;
-    MPID_THREADPRIV_FIELD(op_errno) = 0;
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        per_thread->op_errno = 0;
+    }
 
     /* Create a temporary buffer */
 
@@ -634,9 +640,17 @@ static int MPIR_Reduce_redscat_gather (
     /* FIXME does this need to be checked after each uop invocation for
        predefined operators? */
     /* --BEGIN ERROR HANDLING-- */
-    if (MPID_THREADPRIV_FIELD(op_errno)) {
-        mpi_errno = MPID_THREADPRIV_FIELD(op_errno);
-        goto fn_fail;
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        if (per_thread->op_errno) {
+            mpi_errno = per_thread->op_errno;
+            goto fn_fail;
+        }
     }
     /* --END ERROR HANDLING-- */
 
diff --git a/src/mpi/coll/reduce_local.c b/src/mpi/coll/reduce_local.c
index b171b39..d91f975 100644
--- a/src/mpi/coll/reduce_local.c
+++ b/src/mpi/coll/reduce_local.c
@@ -44,12 +44,18 @@ int MPIR_Reduce_local_impl(const void *inbuf, void *inoutbuf, int count, MPI_Dat
 #if defined(HAVE_FORTRAN_BINDING) && !defined(HAVE_FINT_IS_INT)
     int is_f77_uop = 0;
 #endif
-    MPID_THREADPRIV_DECL;
 
     if (count == 0) goto fn_exit;
 
-    MPID_THREADPRIV_GET;
-    MPID_THREADPRIV_FIELD(op_errno) = MPI_SUCCESS;
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        per_thread->op_errno = MPI_SUCCESS;
+    }
 
     if (HANDLE_GET_KIND(op) == HANDLE_KIND_BUILTIN) {
         /* get the function by indexing into the op table */
@@ -103,8 +109,16 @@ int MPIR_Reduce_local_impl(const void *inbuf, void *inoutbuf, int count, MPI_Dat
     }
 
     /* --BEGIN ERROR HANDLING-- */
-    if (MPID_THREADPRIV_FIELD(op_errno))
-        mpi_errno = MPID_THREADPRIV_FIELD(op_errno);
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        if (per_thread->op_errno)
+            mpi_errno = per_thread->op_errno;
+    }
     /* --END ERROR HANDLING-- */
 
 fn_exit:
diff --git a/src/mpi/coll/scan.c b/src/mpi/coll/scan.c
index a5c1375..4715f6a 100644
--- a/src/mpi/coll/scan.c
+++ b/src/mpi/coll/scan.c
@@ -86,7 +86,6 @@ static int MPIR_Scan_generic (
     MPI_Aint true_extent, true_lb, extent;
     void *partial_scan, *tmp_buf;
     MPID_Op *op_ptr;
-    MPID_THREADPRIV_DECL;
     MPIU_CHKLMEM_DECL(2);
     
     if (count == 0) return MPI_SUCCESS;
@@ -97,9 +96,16 @@ static int MPIR_Scan_generic (
     comm_size = comm_ptr->local_size;
     rank = comm_ptr->rank;
 
-    MPID_THREADPRIV_GET;
     /* set op_errno to 0. stored in perthread structure */
-    MPID_THREADPRIV_FIELD(op_errno) = 0;
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        per_thread->op_errno = 0;
+    }
 
     if (HANDLE_GET_KIND(op) == HANDLE_KIND_BUILTIN) {
         is_commutative = 1;
@@ -192,9 +198,17 @@ static int MPIR_Scan_generic (
         mask <<= 1;
     }
     
-    if (MPID_THREADPRIV_FIELD(op_errno)) {
-	mpi_errno = MPID_THREADPRIV_FIELD(op_errno);
-        if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+    {
+        MPIR_Per_thread_t *per_thread = NULL;
+        int err = 0;
+
+        MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                     MPIR_Per_thread, per_thread, &err);
+        MPIU_Assert(err == 0);
+        if (per_thread->op_errno) {
+            mpi_errno = per_thread->op_errno;
+            if (mpi_errno) MPIR_ERR_POP(mpi_errno);
+        }
     }
     
  fn_exit:
@@ -233,7 +247,6 @@ int MPIR_Scan(
     int mpi_errno = MPI_SUCCESS;
     int mpi_errno_ret = MPI_SUCCESS;
     MPIU_CHKLMEM_DECL(3);
-    MPID_THREADPRIV_DECL;
     int rank = comm_ptr->rank;
     MPI_Status status;
     void *tempbuf = NULL, *localfulldata = NULL, *prefulldata = NULL;
@@ -251,7 +264,6 @@ int MPIR_Scan(
         return MPIR_Scan_generic(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);
     }
     
-    MPID_THREADPRIV_GET;
     MPIR_Type_get_true_extent_impl(datatype, &true_lb, &true_extent);
 
     MPID_Datatype_get_extent_macro(datatype, extent);
diff --git a/src/mpi/datatype/register_datarep.c b/src/mpi/datatype/register_datarep.c
index c445927..7f136eb 100644
--- a/src/mpi/datatype/register_datarep.c
+++ b/src/mpi/datatype/register_datarep.c
@@ -55,7 +55,6 @@ int MPI_Register_datarep(char *datarep,
 {
     static const char FCNAME[] = "MPI_Register_datarep";
     int mpi_errno = MPI_SUCCESS;
-    MPID_THREADPRIV_DECL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_REGISTER_DATAREP);
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
diff --git a/src/mpi/errhan/file_call_errhandler.c b/src/mpi/errhan/file_call_errhandler.c
index 8a120a3..79c21de 100644
--- a/src/mpi/errhan/file_call_errhandler.c
+++ b/src/mpi/errhan/file_call_errhandler.c
@@ -57,15 +57,12 @@ int MPI_File_call_errhandler(MPI_File fh, int errorcode)
     MPID_Errhandler *e;
     MPI_Errhandler eh;
 #endif
-    MPID_THREADPRIV_DECL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_FILE_CALL_ERRHANDLER);
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_FILE_CALL_ERRHANDLER);
 
-    MPID_THREADPRIV_GET;
-
 #ifdef MPI_MODE_RDONLY
     /* Validate parameters, especially handles needing to be converted */
     /* FIXME: check for a valid file handle (fh) before converting to a 
diff --git a/src/mpi/errhan/win_call_errhandler.c b/src/mpi/errhan/win_call_errhandler.c
index 03395ce..f92445f 100644
--- a/src/mpi/errhan/win_call_errhandler.c
+++ b/src/mpi/errhan/win_call_errhandler.c
@@ -57,15 +57,12 @@ int MPI_Win_call_errhandler(MPI_Win win, int errorcode)
     int mpi_errno = MPI_SUCCESS;
     MPID_Win *win_ptr = NULL;
     int in_cs = FALSE;
-    MPID_THREADPRIV_DECL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_WIN_CALL_ERRHANDLER);
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
     
     MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_CALL_ERRHANDLER);
 
-    MPID_THREADPRIV_GET;
-    
     /* Validate parameters, especially handles needing to be converted */
 #   ifdef HAVE_ERROR_CHECKING
     {
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 2d3216b..0761690 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -86,6 +86,14 @@ MPICH_PerProcess_t MPIR_Process = { OPA_INT_T_INITIALIZER(MPICH_PRE_INIT) };
      /* all other fields in MPIR_Process are irrelevant */
 MPIR_Thread_info_t MPIR_ThreadInfo = { 0 };
 
+#if defined(MPICH_IS_THREADED) && defined(MPICH_TLS_SPECIFIER)
+MPICH_TLS_SPECIFIER MPIR_Per_thread_t MPIR_Per_thread = { 0 };
+#else
+MPIR_Per_thread_t MPIR_Per_thread = { 0 };
+#endif
+
+MPID_Thread_tls_t MPIR_Per_thread_key;
+
 /* These are initialized as null (avoids making these into common symbols).
    If the Fortran binding is supported, these can be initialized to 
    their Fortran values (MPI only requires that they be valid between
@@ -180,7 +188,6 @@ MPID_Thread_mutex_t MPIR_THREAD_POBJ_PMI_MUTEX;
 static int thread_cs_init( void )
 {
     int err;
-    MPID_THREADPRIV_DECL;
 
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL
 /* There is a single, global lock, held for the duration of an MPI call */
@@ -218,8 +225,7 @@ static int thread_cs_init( void )
 #error Unrecognized thread granularity
 #endif
 
-    MPID_THREADPRIV_INITKEY;
-    MPID_THREADPRIV_INIT;
+    MPID_THREADPRIV_KEY_CREATE;
 
     MPIU_DBG_MSG(MPIR_DBG_INIT,TYPICAL,"Created global mutex and private storage");
     return MPI_SUCCESS;
@@ -268,7 +274,7 @@ int MPIR_Thread_CS_Finalize( void )
 #error Unrecognized thread granularity
 #endif
 
-    MPID_THREADPRIV_FINALIZE;
+    MPID_THREADPRIV_KEY_DESTROY;
 
     return MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/adio/include/adioi.h b/src/mpi/romio/adio/include/adioi.h
index 1ab9d81..b49648c 100644
--- a/src/mpi/romio/adio/include/adioi.h
+++ b/src/mpi/romio/adio/include/adioi.h
@@ -1020,7 +1020,6 @@ int  ADIOI_MPE_iwrite_b;
   #define ADIOI_ENSURE_AINT_FITS_IN_PTR(aint_value) 
   #define ADIOI_Assert assert
   #define MPIU_Upint unsigned long
-  #define MPID_THREADPRIV_DECL
 #endif
 
 #ifdef USE_DBG_LOGGING    /*todo fix dependency on mpich?*/
diff --git a/src/mpi/romio/mpi-io/get_errh.c b/src/mpi/romio/mpi-io/get_errh.c
index 7962e33..d369c83 100644
--- a/src/mpi/romio/mpi-io/get_errh.c
+++ b/src/mpi/romio/mpi-io/get_errh.c
@@ -42,7 +42,6 @@ int MPI_File_get_errhandler(MPI_File mpi_fh, MPI_Errhandler *errhandler)
     int error_code = MPI_SUCCESS;
     ADIO_File fh;
     static char myname[] = "MPI_FILE_GET_ERRHANDLER";
-    MPID_THREADPRIV_DECL;
 
     ROMIO_THREAD_CS_ENTER();
 
diff --git a/src/mpi/romio/mpi-io/ioreq_c2f.c b/src/mpi/romio/mpi-io/ioreq_c2f.c
index d49ebcd..3e335f4 100644
--- a/src/mpi/romio/mpi-io/ioreq_c2f.c
+++ b/src/mpi/romio/mpi-io/ioreq_c2f.c
@@ -47,7 +47,6 @@ MPI_Fint MPIO_Request_c2f(MPIO_Request request)
     return (MPI_Fint) request;
 #else
     int i;
-    MPID_THREADPRIV_DECL;
 
     /* We can make this test outside of the GLOBAL mutex because it does
        not access any shared data */
diff --git a/src/mpi/romio/mpi-io/ioreq_f2c.c b/src/mpi/romio/mpi-io/ioreq_f2c.c
index a58e4a2..8e33b4e 100644
--- a/src/mpi/romio/mpi-io/ioreq_f2c.c
+++ b/src/mpi/romio/mpi-io/ioreq_f2c.c
@@ -43,7 +43,6 @@ MPIO_Request MPIO_Request_f2c(MPI_Fint request)
 {
     int error_code;
     static char myname[] = "MPIO_REQUEST_F2C";
-    MPID_THREADPRIV_DECL;
 
 #ifndef INT_LT_POINTER
     return (MPIO_Request) request;
diff --git a/src/mpi/romio/mpi-io/iotest.c b/src/mpi/romio/mpi-io/iotest.c
index 42bc8a3..8fed7ee 100644
--- a/src/mpi/romio/mpi-io/iotest.c
+++ b/src/mpi/romio/mpi-io/iotest.c
@@ -47,7 +47,6 @@ int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status)
 {
     int error_code;
     static char myname[] = "MPIO_TEST";
-    MPID_THREADPRIV_DECL;
 #ifdef MPI_hpux
     int fl_xmpi;
 
diff --git a/src/mpi/romio/mpi-io/iotestall.c b/src/mpi/romio/mpi-io/iotestall.c
index 24dd8b2..d267336 100644
--- a/src/mpi/romio/mpi-io/iotestall.c
+++ b/src/mpi/romio/mpi-io/iotestall.c
@@ -32,7 +32,6 @@ int MPIO_Testall(int count, MPIO_Request requests[], int *flag,
 		 MPI_Status statuses[])
 {
     int done, i, err; 
-    MPID_THREADPRIV_DECL;
 
     ROMIO_THREAD_CS_ENTER();
     if (count == 1)  {
diff --git a/src/mpi/romio/mpi-io/iotestany.c b/src/mpi/romio/mpi-io/iotestany.c
index eac6197..5cd1e41 100644
--- a/src/mpi/romio/mpi-io/iotestany.c
+++ b/src/mpi/romio/mpi-io/iotestany.c
@@ -32,7 +32,6 @@ int MPIO_Testany(int count, MPIO_Request requests[], int *index,
 		 int *flag, MPI_Status *status)
 {
     int i, err; 
-    MPID_THREADPRIV_DECL;
 
     ROMIO_THREAD_CS_ENTER();
 
diff --git a/src/mpi/romio/mpi-io/iotestsome.c b/src/mpi/romio/mpi-io/iotestsome.c
index a7d7d4c..a09de64 100644
--- a/src/mpi/romio/mpi-io/iotestsome.c
+++ b/src/mpi/romio/mpi-io/iotestsome.c
@@ -33,7 +33,6 @@ int MPIO_Testsome(int count, MPIO_Request requests[], int *outcount,
 {
     int i, err; 
     int flag;
-    MPID_THREADPRIV_DECL;
 
     ROMIO_THREAD_CS_ENTER();
 
diff --git a/src/mpi/romio/mpi-io/iowait.c b/src/mpi/romio/mpi-io/iowait.c
index 4d383c8..e5c961e 100644
--- a/src/mpi/romio/mpi-io/iowait.c
+++ b/src/mpi/romio/mpi-io/iowait.c
@@ -46,7 +46,6 @@ int MPIO_Wait(MPIO_Request *request, MPI_Status *status)
 {
     int error_code;
     static char myname[] = "MPIO_WAIT";
-    MPID_THREADPRIV_DECL;
 
 #ifdef MPI_hpux
     int fl_xmpi;
diff --git a/src/mpi/romio/mpi-io/iowaitall.c b/src/mpi/romio/mpi-io/iowaitall.c
index 3e5e5b8..455736a 100644
--- a/src/mpi/romio/mpi-io/iowaitall.c
+++ b/src/mpi/romio/mpi-io/iowaitall.c
@@ -31,7 +31,6 @@
 int MPIO_Waitall( int count, MPIO_Request requests[], MPI_Status statuses[] )
 {
     int notdone, i, flag, err; 
-    MPID_THREADPRIV_DECL;
 
     ROMIO_THREAD_CS_ENTER();
 
diff --git a/src/mpi/romio/mpi-io/iowaitany.c b/src/mpi/romio/mpi-io/iowaitany.c
index 747aa5b..c54d459 100644
--- a/src/mpi/romio/mpi-io/iowaitany.c
+++ b/src/mpi/romio/mpi-io/iowaitany.c
@@ -32,7 +32,6 @@ int MPIO_Waitany(int count, MPIO_Request requests[], int *index,
 		 MPI_Status *status)
 {
     int i, flag, err; 
-    MPID_THREADPRIV_DECL;
 
     ROMIO_THREAD_CS_ENTER();
 
diff --git a/src/mpi/romio/mpi-io/iowaitsome.c b/src/mpi/romio/mpi-io/iowaitsome.c
index 1bca9c6..f3808f3 100644
--- a/src/mpi/romio/mpi-io/iowaitsome.c
+++ b/src/mpi/romio/mpi-io/iowaitsome.c
@@ -32,7 +32,6 @@ int MPIO_Waitsome(int count, MPIO_Request requests[], int *outcount,
 		  int indices[], MPI_Status *statuses)
 {
     int i, flag, err; 
-    MPID_THREADPRIV_DECL;
 
     ROMIO_THREAD_CS_ENTER();
 
diff --git a/src/mpi/romio/mpi-io/set_errh.c b/src/mpi/romio/mpi-io/set_errh.c
index d943787..2b14913 100644
--- a/src/mpi/romio/mpi-io/set_errh.c
+++ b/src/mpi/romio/mpi-io/set_errh.c
@@ -40,7 +40,6 @@ int MPI_File_set_errhandler(MPI_File mpi_fh, MPI_Errhandler errhandler)
     int error_code = MPI_SUCCESS;
     static char myname[] = "MPI_FILE_SET_ERRHANDLER";
     ADIO_File fh;
-    MPID_THREADPRIV_DECL;
 
     ROMIO_THREAD_CS_ENTER();
 
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 382fb2f..3d3afe6 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
@@ -135,7 +135,7 @@ int MPIDI_CH3_SHM_Win_free(MPID_Win **win_ptr);
 #define HANDLE_WIN_MUTEX_ERROR()                                                        \
     do {                                                                                \
         HLOCAL str;                                                                     \
-        char error_msg[MPIU_STRERROR_BUF_SIZE];                                         \
+        char error_msg[MPIR_STRERROR_BUF_SIZE];                                         \
         DWORD error = GetLastError();                                                   \
         int num_bytes = FormatMessage(                                                  \
         FORMAT_MESSAGE_FROM_SYSTEM |                                                    \
@@ -149,7 +149,7 @@ int MPIDI_CH3_SHM_Win_free(MPID_Win **win_ptr);
         if (num_bytes != 0) {                                                           \
             int pt_err = 1;                                                             \
             int mpi_errno = MPI_ERR_OTHER;                                              \
-            MPL_strncpy(error_msg, str, MPIU_STRERROR_BUF_SIZE);                       \
+            MPL_strncpy(error_msg, str, MPIR_STRERROR_BUF_SIZE);                       \
             LocalFree(str);                                                             \
             strtok(error_msg, "\r\n");                                                  \
             MPIR_ERR_CHKANDJUMP1(pt_err, mpi_errno, MPI_ERR_OTHER, "**windows_mutex",   \
diff --git a/src/mpid/ch3/include/mpid_thread.h b/src/mpid/ch3/include/mpid_thread.h
index 375efe0..7c55275 100644
--- a/src/mpid/ch3/include/mpid_thread.h
+++ b/src/mpid/ch3/include/mpid_thread.h
@@ -45,11 +45,8 @@ typedef MPIDU_Thread_func_t  MPID_Thread_func_t;
 #define MPID_Thread_tls_set MPIDU_Thread_tls_set
 #define MPID_Thread_tls_get MPIDU_Thread_tls_get
 
-#define MPID_THREADPRIV_INITKEY  MPIDU_THREADPRIV_INITKEY
-#define MPID_THREADPRIV_INIT     MPIDU_THREADPRIV_INIT
-#define MPID_THREADPRIV_GET      MPIDU_THREADPRIV_GET
-#define MPID_THREADPRIV_DECL     MPIDU_THREADPRIV_DECL
-#define MPID_THREADPRIV_FIELD    MPIDU_THREADPRIV_FIELD
-#define MPID_THREADPRIV_FINALIZE MPIDU_THREADPRIV_FINALIZE
+#define MPID_THREADPRIV_KEY_CREATE  MPIDU_THREADPRIV_KEY_CREATE
+#define MPID_THREADPRIV_KEY_GET_ADDR    MPIDU_THREADPRIV_KEY_GET_ADDR
+#define MPID_THREADPRIV_KEY_DESTROY MPIDU_THREADPRIV_KEY_DESTROY
 
 #endif /* !defined(MPID_THREAD_H_INCLUDED) */
diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index 911bafc..6b08355 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -85,18 +85,20 @@ M*/
 #define MPIDUI_THREAD_CS_ENTER_GLOBAL(mutex)                            \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
-            int depth_;                                                 \
-            MPIDU_THREADPRIV_DECL;                                      \
+            int rec_err_ = 0;                                           \
+            MPIR_Per_thread_t *per_thread = NULL;                              \
                                                                         \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive locking GLOBAL mutex"); \
-            MPIDU_THREADPRIV_GET;                                       \
-            depth_ = MPIDU_THREADPRIV_FIELD(lock_depth);                \
-            if (depth_ == 0) {                                          \
+            MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key, \
+                                         MPIR_Per_thread, per_thread, &rec_err_); \
+            MPIU_Assert(rec_err_ == 0);                                 \
+                                                                        \
+            if (per_thread->lock_depth == 0) {                          \
                 int err_ = 0;                                           \
                 MPIDU_Thread_mutex_lock(&mutex, &err_);                 \
                 MPIU_Assert(err_ == 0);                                 \
             }                                                           \
-            MPIDU_THREADPRIV_FIELD(lock_depth) += 1;                    \
+            per_thread->lock_depth++;                                   \
         }                                                               \
     } while (0)
 #define MPIDUI_THREAD_CS_ENTER_ALLGRAN(mutex)                           \
@@ -155,19 +157,22 @@ M*/
 #define MPIDUI_THREAD_CS_EXIT_GLOBAL(mutex)                             \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
-            int depth_;                                                 \
-            MPIDU_THREADPRIV_DECL;                                      \
+            int rec_err_ = 0;                                           \
+            MPIR_Per_thread_t *per_thread = NULL;                              \
                                                                         \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive unlocking GLOBAL mutex"); \
-            MPIDU_THREADPRIV_GET;                                       \
-            depth_ = MPIDU_THREADPRIV_FIELD(lock_depth);                \
-            if (depth_ == 1) {                                          \
+            MPIU_Assert(rec_err_ == 0);                                 \
+            MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key, \
+                                         MPIR_Per_thread, per_thread, &rec_err_); \
+            MPIU_Assert(rec_err_ == 0);                                 \
+                                                                        \
+            if (per_thread->lock_depth == 1) {                          \
                 int err_ = 0;                                           \
                 MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIDU_Thread_mutex_unlock %p", &mutex); \
                 MPIDU_Thread_mutex_unlock(&mutex, &err_);               \
                 MPIU_Assert(err_ == 0);                                 \
             }                                                           \
-            MPIDU_THREADPRIV_FIELD(lock_depth) -= 1;                    \
+            per_thread->lock_depth--;                                   \
         }                                                               \
     } while (0)
 
@@ -557,36 +562,20 @@ M*/
     } while (0)
 
 
-#define MPIDU_THREADPRIV_INITKEY                                        \
+#define MPIDU_THREADPRIV_KEY_CREATE                                     \
     do {                                                                \
         int err_ = 0;                                                   \
-        MPIU_THREADPRIV_INITKEY(MPIR_ThreadInfo.isThreaded, &err_);     \
+        MPIU_THREADPRIV_KEY_CREATE(MPIR_Per_thread_key, MPIR_Per_thread, &err_); \
         MPIU_Assert(err_ == 0);                                         \
     } while (0)
 
-#define MPIDU_THREADPRIV_INIT                                   \
-    do {                                                        \
-        int err_ = 0;                                           \
-        MPIU_THREADPRIV_INIT(MPIR_ThreadInfo.isThreaded, &err_);        \
-        MPIU_Assert(err_ == 0);                                 \
-    } while (0)
+#define MPIDU_THREADPRIV_KEY_GET_ADDR  MPIU_THREADPRIV_KEY_GET_ADDR
 
-#define MPIDU_THREADPRIV_GET                                    \
+#define MPIDU_THREADPRIV_KEY_DESTROY                            \
     do {                                                        \
         int err_ = 0;                                           \
-        MPIU_THREADPRIV_GET(MPIR_ThreadInfo.isThreaded, &err_);  \
+        MPIU_THREADPRIV_KEY_DESTROY(MPIR_Per_thread_key, &err_); \
         MPIU_Assert(err_ == 0);                                 \
     } while (0)
 
-#define MPIDU_THREADPRIV_DECL     MPIU_THREADPRIV_DECL
-#define MPIDU_THREADPRIV_FIELD    MPIU_THREADPRIV_FIELD
-
-#define MPIDU_THREADPRIV_FINALIZE                                       \
-    do {                                                                \
-        int err_ = 0;                                                   \
-        MPIU_THREADPRIV_FINALIZE(MPIR_ThreadInfo.isThreaded, &err_);    \
-        MPIU_Assert(err_ == 0);                                         \
-    } while (0)
-
-
 #endif /* !defined(MPIDU_THREAD_H_INCLUDED) */
diff --git a/src/util/mem/strerror.c b/src/util/mem/strerror.c
index a409b59..68c3fbc 100644
--- a/src/util/mem/strerror.c
+++ b/src/util/mem/strerror.c
@@ -19,17 +19,21 @@ const char *MPIU_Strerror(int errnum)
 {
 #if defined(HAVE_STRERROR_R)
     char *buf;
-    MPID_THREADPRIV_DECL;
-    MPID_THREADPRIV_GET;
-    buf = MPID_THREADPRIV_FIELD(strerrbuf);
+    MPIR_Per_thread_t *per_thread = NULL;
+    int err = 0;
+
+    MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
+                                 MPIR_Per_thread, per_thread, &err);
+    MPIU_Assert(err == 0);
+    buf = per_thread->strerrbuf;
 #  if defined(STRERROR_R_CHAR_P)
     /* strerror_r returns char ptr (old GNU-flavor).  Static strings for known
      * errnums are in returned buf, unknown errnums put a message in buf and
      * return buf */
-    buf = strerror_r(errnum, buf, MPIU_STRERROR_BUF_SIZE);
+    buf = strerror_r(errnum, buf, MPIR_STRERROR_BUF_SIZE);
 #  else
     /* strerror_r returns an int */
-    strerror_r(errnum, buf, MPIU_STRERROR_BUF_SIZE);
+    strerror_r(errnum, buf, MPIR_STRERROR_BUF_SIZE);
 #  endif
     return buf;
 
diff --git a/src/util/thread/mpiu_thread.c b/src/util/thread/mpiu_thread.c
index c23cde7..863e937 100644
--- a/src/util/thread/mpiu_thread.c
+++ b/src/util/thread/mpiu_thread.c
@@ -6,18 +6,10 @@
 
 #include "mpiu_thread.h"
 
-#if !defined(MPICH_IS_THREADED) || !defined(MPICH_TLS_SPECIFIER)
-MPIUI_Per_thread_t MPIUI_Thread = { 0 };
-#else
-MPICH_TLS_SPECIFIER MPIUI_Per_thread_t MPIUI_Thread = { 0 };
-#endif
-
 MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 #if defined(MPICH_IS_THREADED) && !defined(MPICH_TLS_SPECIFIER)
 
-MPIU_Thread_tls_t MPIUI_Thread_storage;
-
 /* 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 */
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index 2bb79c9..eed76c5 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -53,31 +53,6 @@ typedef void (*MPIU_Thread_func_t) (void *data);
 #  error MPICH_THREAD_GRANULARITY_LOCK_FREE not implemented yet
 #endif
 
-/* ------------------------------------------------------------------------- */
-/* thread-local storage macros */
-/* moved here from mpiimpl.h because they logically belong here */
-
-/* arbitrary, just needed to avoid cleaning up heap allocated memory at thread
- * destruction time */
-#define MPIU_STRERROR_BUF_SIZE (1024)
-
-/* 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 {
-    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_MULTIPLE)
-    int lock_depth;
-#endif
-} MPIUI_Per_thread_t;
-
 #include "mpiu_thread_priv.h"
 
 #endif /* !defined(MPIU_THREAD_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_priv.h b/src/util/thread/mpiu_thread_priv.h
index 63dab0c..bb6d1ad 100644
--- a/src/util/thread/mpiu_thread_priv.h
+++ b/src/util/thread/mpiu_thread_priv.h
@@ -23,15 +23,8 @@
    the declaration.
 */
 
-#if !defined(MPICH_IS_THREADED) || !defined(MPICH_TLS_SPECIFIER)
-extern MPIUI_Per_thread_t MPIUI_Thread;
-#elif defined(MPICH_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 MPICH_TLS_SPECIFIER MPIUI_Per_thread_t MPIUI_Thread;
-#endif
-
 #if defined(MPICH_IS_THREADED) && !defined(MPICH_TLS_SPECIFIER)
+
 /* We need to provide a function that will cleanup the storage attached
  * to the key.  */
 void MPIUI_Cleanup_tls(void *a);
@@ -48,75 +41,74 @@ void MPIUI_Cleanup_tls(void *a);
    whether MPICH is initialized with thread safety, one or the other is used.
 
  */
-extern MPIU_Thread_tls_t MPIUI_Thread_storage;   /* Id for perthread data */
 
-#define MPIU_THREADPRIV_INITKEY(is_threaded, initkey_err_ptr_)          \
+#define MPIU_THREADPRIV_KEY_CREATE(key, var, err_ptr_)                  \
     do {                                                                \
-        if (is_threaded) {                                              \
-            MPIU_Thread_tls_create(MPIUI_Cleanup_tls,&MPIUI_Thread_storage,initkey_err_ptr_); \
+        void *thread_ptr;                                               \
+                                                                        \
+        MPIU_Thread_tls_create(MPIUI_Cleanup_tls, &(key) , err_ptr_);   \
+        if (unlikely(*((int *) err_ptr_)))                              \
+            break;                                                      \
+        thread_ptr = MPIU_Calloc(1, sizeof(var));                       \
+        if (unlikely(!thread_ptr)) {                                    \
+            *((int *) err_ptr_) = MPIU_THREAD_ERROR;                    \
+            break;                                                      \
         }                                                               \
+        MPIU_Thread_tls_set(&(key), thread_ptr, err_ptr_);              \
     } while (0)
 
-#define MPIU_THREADPRIV_INIT(is_threaded, init_err_ptr_)                \
+#define MPIU_THREADPRIV_KEY_GET_ADDR(is_threaded, key, var, addr, err_ptr_) \
     do {                                                                \
         if (is_threaded) {                                              \
-            MPIUI_Thread_ptr = (MPIUI_Per_thread_t *) MPIU_Calloc(1, sizeof(MPIUI_Per_thread_t)); \
-            if (unlikely(MPIUI_Thread_ptr == NULL)) {                   \
-                *((int *) init_err_ptr_) = MPIU_THREAD_ERROR;           \
+            void *thread_ptr;                                           \
+            MPIU_Thread_tls_get(&(key), &thread_ptr, err_ptr_);         \
+            if (unlikely(*((int *) err_ptr_)))                          \
                 break;                                                  \
-            }                                                           \
-            MPIU_Thread_tls_set(&MPIUI_Thread_storage, (void *)MPIUI_Thread_ptr, init_err_ptr_); \
-        }                                                               \
-    } while (0)
-
-#define MPIU_THREADPRIV_GET(is_threaded, get_err_ptr_)                  \
-    do {                                                                \
-        if (!MPIUI_Thread_ptr) {                                        \
-            if (is_threaded) {                                          \
-                MPIU_Thread_tls_get(&MPIUI_Thread_storage, (void **) &MPIUI_Thread_ptr, get_err_ptr_); \
-                if (unlikely(*((int *) get_err_ptr_)))                  \
+            if (!thread_ptr) {                                          \
+                thread_ptr = MPIU_Calloc(1, sizeof(var));               \
+                if (unlikely(!thread_ptr)) {                            \
+                    *((int *) err_ptr_) = MPIU_THREAD_ERROR;            \
                     break;                                              \
-                if (!MPIUI_Thread_ptr) {                                \
-                    MPIU_THREADPRIV_INIT(is_threaded, get_err_ptr_); /* subtle, sets MPIUI_Thread_ptr */ \
                 }                                                       \
+                MPIU_Thread_tls_set(&(key), thread_ptr, err_ptr_);      \
+                if (unlikely(*((int *) err_ptr_)))                      \
+                    break;                                              \
             }                                                           \
-            else {                                                      \
-                MPIUI_Thread_ptr = &MPIUI_Thread;                       \
-            }                                                           \
-                                                                        \
-            if (unlikely(MPIUI_Thread_ptr == NULL)) {                   \
-                *((int *) get_err_ptr_) = MPIU_THREAD_ERROR;            \
-                break;                                                  \
-            }                                                           \
+            addr = thread_ptr;                                          \
+        }                                                               \
+        else {                                                          \
+            addr = &(var);                                              \
         }                                                               \
     } while (0)
 
-/* common definitions when using MPIU_Thread-based TLS */
-#define MPIU_THREADPRIV_DECL MPIUI_Per_thread_t *MPIUI_Thread_ptr = NULL
-#define MPIU_THREADPRIV_FIELD(a_) (MPIUI_Thread_ptr->a_)
-#define MPIU_THREADPRIV_FINALIZE(is_threaded, finalize_err_ptr_)        \
-    do {                                                                \
-        MPIU_THREADPRIV_DECL;                                           \
-        if (is_threaded) {                                              \
-            MPIU_THREADPRIV_GET(is_threaded, finalize_err_ptr_);        \
-            MPIU_Free(MPIUI_Thread_ptr);                                \
-            MPIU_Thread_tls_set(&MPIUI_Thread_storage,NULL,finalize_err_ptr_); \
-            if (unlikely(*((int *) finalize_err_ptr_)))                 \
-                break;                                                  \
-            MPIU_Thread_tls_destroy(&MPIUI_Thread_storage,finalize_err_ptr_); \
-            if (unlikely(*((int *) finalize_err_ptr_)))                 \
-                break;                                                  \
-        }                                                               \
+#define MPIU_THREADPRIV_KEY_DESTROY(key, err_ptr_)              \
+    do {                                                        \
+        void *thread_ptr;                                       \
+                                                                \
+        MPIU_Thread_tls_get(&(key), &thread_ptr, err_ptr_);     \
+        if (unlikely(*((int *) err_ptr_)))                      \
+            break;                                              \
+                                                                \
+        if (thread_ptr)                                         \
+            MPIU_Free(thread_ptr);                              \
+                                                                \
+        MPIU_Thread_tls_set(&(key), NULL, err_ptr_);            \
+        if (unlikely(*((int *) err_ptr_)))                      \
+            break;                                              \
+                                                                \
+        MPIU_Thread_tls_destroy(&(key), err_ptr_);              \
     } while (0)
 
 #else /* !defined(MPICH_IS_THREADED) || defined(MPICH_TLS_SPECIFIER) */
-
-#define MPIU_THREADPRIV_INITKEY(...)
-#define MPIU_THREADPRIV_INIT(...)
-#define MPIU_THREADPRIV_DECL
-#define MPIU_THREADPRIV_GET(...)
-#define MPIU_THREADPRIV_FIELD(a_) (MPIUI_Thread.a_)
-#define MPIU_THREADPRIV_FINALIZE(...) do {} while (0)
+/* 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. */
+#define MPIU_THREADPRIV_KEY_CREATE(...)
+#define MPIU_THREADPRIV_KEY_GET_ADDR(is_threaded, key, var, addr, err_ptr_) \
+    do {                                                                \
+        addr = &(var);                                                  \
+        *((int *) err_ptr_) = MPIU_THREAD_SUCCESS;                      \
+    } while (0)
+#define MPIU_THREADPRIV_KEY_DESTROY(...)
 
 #endif /* defined(MPICH_TLS_SPECIFIER) */
 

http://git.mpich.org/mpich.git/commitdiff/81e97eb4f349360294fe1ea71d989c67cec4dac5

commit 81e97eb4f349360294fe1ea71d989c67cec4dac5
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 7 01:52:48 2016 -0600

    threads: remove unnecessary files.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/util/thread/Makefile.mk b/src/util/thread/Makefile.mk
index 393d468..fb26c00 100644
--- a/src/util/thread/Makefile.mk
+++ b/src/util/thread/Makefile.mk
@@ -9,8 +9,6 @@ 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_priv.h	      	\
     src/util/thread/mpiu_thread_posix.h   	\
     src/util/thread/mpiu_thread_solaris.h 	\
diff --git a/src/util/thread/mpiu_thread_multiple.h b/src/util/thread/mpiu_thread_multiple.h
deleted file mode 100644
index 017be83..0000000
--- a/src/util/thread/mpiu_thread_multiple.h
+++ /dev/null
@@ -1,12 +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(MPIU_THREAD_MULTIPLE_H_INCLUDED)
-#define MPIU_THREAD_MULTIPLE_H_INCLUDED
-
-#include "mpiu_thread_priv.h"
-
-#endif /* !defined(MPIU_THREAD_MULTIPLE_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_single.h b/src/util/thread/mpiu_thread_single.h
deleted file mode 100644
index 2801ebf..0000000
--- a/src/util/thread/mpiu_thread_single.h
+++ /dev/null
@@ -1,20 +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(MPIU_THREAD_SINGLE_H_INCLUDED)
-#define MPIU_THREAD_SINGLE_H_INCLUDED
-
-/* If single threaded, make this point at a pre-allocated segment.
-   This structure is allocated in src/mpi/init/initthread.c */
-extern MPIUI_Per_thread_t MPIUI_Thread;
-
-#define MPIU_THREADPRIV_INITKEY
-#define MPIU_THREADPRIV_INIT
-#define MPIU_THREADPRIV_DECL
-#define MPIU_THREADPRIV_GET
-#define MPIU_THREADPRIV_FIELD(a_) (MPIUI_Thread.a_)
-
-#endif /* !defined(MPIU_THREAD_SINGLE_H_INCLUDED) */

http://git.mpich.org/mpich.git/commitdiff/78f7ba35b5467db291dbd1e090e7de0a036e5b47

commit 78f7ba35b5467db291dbd1e090e7de0a036e5b47
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 6 23:41:47 2016 -0600

    threads: simplify and unify TLS storage variables.
    
    Rename variables to be consistent when they signify the same concept in
    different configuration options.  As a side-effect of that change, this
    patch also unifies the declaration of variables in the no-compiler-tls
    and thread-single configurations, which are identical for this purpose.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/util/thread/mpiu_thread.c b/src/util/thread/mpiu_thread.c
index bf27775..c23cde7 100644
--- a/src/util/thread/mpiu_thread.c
+++ b/src/util/thread/mpiu_thread.c
@@ -6,20 +6,15 @@
 
 #include "mpiu_thread.h"
 
-#if !defined(MPICH_IS_THREADED)
-
-/* If single threaded, we preallocate this.  Otherwise, we create it */
+#if !defined(MPICH_IS_THREADED) || !defined(MPICH_TLS_SPECIFIER)
 MPIUI_Per_thread_t MPIUI_Thread = { 0 };
-
-#elif defined(MPICH_TLS_SPECIFIER)
-
+#else
 MPICH_TLS_SPECIFIER MPIUI_Per_thread_t MPIUI_Thread = { 0 };
+#endif
 
-#else /* defined(MPICH_IS_THREADED) && !defined(MPICH_TLS_SPECIFIER) */
+MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
-/* If we may be single threaded, we need a preallocated version to use
- * if we are single threaded case */
-MPIUI_Per_thread_t MPIUI_ThreadSingle = { 0 };
+#if defined(MPICH_IS_THREADED) && !defined(MPICH_TLS_SPECIFIER)
 
 MPIU_Thread_tls_t MPIUI_Thread_storage;
 
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index ff4f695..2bb79c9 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -78,10 +78,6 @@ typedef struct {
 #endif
 } MPIUI_Per_thread_t;
 
-#if defined (MPICH_IS_THREADED)
-#include "mpiu_thread_multiple.h"
-#else
-#include "mpiu_thread_single.h"
-#endif
+#include "mpiu_thread_priv.h"
 
 #endif /* !defined(MPIU_THREAD_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_priv.h b/src/util/thread/mpiu_thread_priv.h
index 32b938d..63dab0c 100644
--- a/src/util/thread/mpiu_thread_priv.h
+++ b/src/util/thread/mpiu_thread_priv.h
@@ -23,7 +23,15 @@
    the declaration.
 */
 
-#if !defined(MPICH_TLS_SPECIFIER)
+#if !defined(MPICH_IS_THREADED) || !defined(MPICH_TLS_SPECIFIER)
+extern MPIUI_Per_thread_t MPIUI_Thread;
+#elif defined(MPICH_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 MPICH_TLS_SPECIFIER MPIUI_Per_thread_t MPIUI_Thread;
+#endif
+
+#if defined(MPICH_IS_THREADED) && !defined(MPICH_TLS_SPECIFIER)
 /* We need to provide a function that will cleanup the storage attached
  * to the key.  */
 void MPIUI_Cleanup_tls(void *a);
@@ -40,9 +48,6 @@ void MPIUI_Cleanup_tls(void *a);
    whether MPICH is initialized with thread safety, 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 MPIUI_Per_thread_t MPIUI_ThreadSingle;
 extern MPIU_Thread_tls_t MPIUI_Thread_storage;   /* Id for perthread data */
 
 #define MPIU_THREADPRIV_INITKEY(is_threaded, initkey_err_ptr_)          \
@@ -76,7 +81,7 @@ extern MPIU_Thread_tls_t MPIUI_Thread_storage;   /* Id for perthread data */
                 }                                                       \
             }                                                           \
             else {                                                      \
-                MPIUI_Thread_ptr = &MPIUI_ThreadSingle;                 \
+                MPIUI_Thread_ptr = &MPIUI_Thread;                       \
             }                                                           \
                                                                         \
             if (unlikely(MPIUI_Thread_ptr == NULL)) {                   \
@@ -104,11 +109,7 @@ extern MPIU_Thread_tls_t MPIUI_Thread_storage;   /* Id for perthread data */
         }                                                               \
     } while (0)
 
-#else /* defined(MPICH_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 MPICH_TLS_SPECIFIER MPIUI_Per_thread_t MPIUI_Thread;
+#else /* !defined(MPICH_IS_THREADED) || defined(MPICH_TLS_SPECIFIER) */
 
 #define MPIU_THREADPRIV_INITKEY(...)
 #define MPIU_THREADPRIV_INIT(...)

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

commit e7789d21362e4c182c244b0944eb2ea20b358033
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 6 23:24:06 2016 -0600

    threads: move MPIR code out of MPIU threads.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index cec5d26..33078a7 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -197,6 +197,24 @@ int usleep(useconds_t usec);
 #define MPIU_SYSCALL(a_,b_,c_) a_ = b_ c_
 #endif
 
+
+typedef struct {
+    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
+    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 */
+} MPIR_Thread_info_t;
+extern MPIR_Thread_info_t MPIR_ThreadInfo;
+
+
 /*TDSOverview.tex
   
   MPI has a number of data structures, most of which are represented by 
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index bd8240d..ff4f695 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -13,10 +13,8 @@
 #include "mpidbg.h"
 #include "mpiu_strerror.h"
 
-/* FIXME: we should not be including an MPIR-level header here.  But
- * the code is currently a rat-hole where the MPIU and MPIR functions
- * are all mixed up.  Till that's resolved, adding mpimem.h here as a
- * workaround for using MPIU_Calloc functionality. */
+/* FIXME: Adding mpimem.h here as a workaround for using MPIU_Calloc
+ * functionality. */
 #include "mpimem.h"
 
 /* _INVALID exists to avoid accidental macro evaluations to 0 */
@@ -55,22 +53,6 @@ typedef void (*MPIU_Thread_func_t) (void *data);
 #  error MPICH_THREAD_GRANULARITY_LOCK_FREE not implemented yet
 #endif
 
-typedef struct {
-    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
-    MPIU_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 */
-} MPIR_Thread_info_t;
-extern MPIR_Thread_info_t MPIR_ThreadInfo;
-
 /* ------------------------------------------------------------------------- */
 /* thread-local storage macros */
 /* moved here from mpiimpl.h because they logically belong here */

http://git.mpich.org/mpich.git/commitdiff/658dbbc4e380af5677cf0aae7867fb2ca0a145e9

commit 658dbbc4e380af5677cf0aae7867fb2ca0a145e9
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 6 23:17:51 2016 -0600

    threads: get thread_storage out of MPIR structure.
    
    The thread storage variable is used by the MPIU threads layer
    internally.  Declaring it in an MPIR structure is unnecessary.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/util/thread/mpiu_thread.c b/src/util/thread/mpiu_thread.c
index 789e2b3..bf27775 100644
--- a/src/util/thread/mpiu_thread.c
+++ b/src/util/thread/mpiu_thread.c
@@ -21,6 +21,8 @@ MPICH_TLS_SPECIFIER MPIUI_Per_thread_t MPIUI_Thread = { 0 };
  * if we are single threaded case */
 MPIUI_Per_thread_t MPIUI_ThreadSingle = { 0 };
 
+MPIU_Thread_tls_t MPIUI_Thread_storage;
+
 /* 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 */
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index e5ddab7..bd8240d 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -58,10 +58,6 @@ typedef void (*MPIU_Thread_func_t) (void *data);
 typedef struct {
     int thread_provided;        /* Provided level of thread support */
 
-#if defined(MPICH_IS_THREADED) && !defined(MPICH_TLS_SPECIFIER)
-    MPIU_Thread_tls_t thread_storage;   /* Id for perthread data */
-#endif
-
     /* 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
diff --git a/src/util/thread/mpiu_thread_priv.h b/src/util/thread/mpiu_thread_priv.h
index c7f4a9f..32b938d 100644
--- a/src/util/thread/mpiu_thread_priv.h
+++ b/src/util/thread/mpiu_thread_priv.h
@@ -43,11 +43,12 @@ void MPIUI_Cleanup_tls(void *a);
 /* For the single threaded case, we use a preallocated structure
    This structure is allocated in src/mpi/init/initthread.c */
 extern MPIUI_Per_thread_t MPIUI_ThreadSingle;
+extern MPIU_Thread_tls_t MPIUI_Thread_storage;   /* Id for perthread data */
 
 #define MPIU_THREADPRIV_INITKEY(is_threaded, initkey_err_ptr_)          \
     do {                                                                \
         if (is_threaded) {                                              \
-            MPIU_Thread_tls_create(MPIUI_Cleanup_tls,&MPIR_ThreadInfo.thread_storage,initkey_err_ptr_); \
+            MPIU_Thread_tls_create(MPIUI_Cleanup_tls,&MPIUI_Thread_storage,initkey_err_ptr_); \
         }                                                               \
     } while (0)
 
@@ -59,7 +60,7 @@ extern MPIUI_Per_thread_t MPIUI_ThreadSingle;
                 *((int *) init_err_ptr_) = MPIU_THREAD_ERROR;           \
                 break;                                                  \
             }                                                           \
-            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage, (void *)MPIUI_Thread_ptr, init_err_ptr_); \
+            MPIU_Thread_tls_set(&MPIUI_Thread_storage, (void *)MPIUI_Thread_ptr, init_err_ptr_); \
         }                                                               \
     } while (0)
 
@@ -67,7 +68,7 @@ extern MPIUI_Per_thread_t MPIUI_ThreadSingle;
     do {                                                                \
         if (!MPIUI_Thread_ptr) {                                        \
             if (is_threaded) {                                          \
-                MPIU_Thread_tls_get(&MPIR_ThreadInfo.thread_storage, (void **) &MPIUI_Thread_ptr, get_err_ptr_); \
+                MPIU_Thread_tls_get(&MPIUI_Thread_storage, (void **) &MPIUI_Thread_ptr, get_err_ptr_); \
                 if (unlikely(*((int *) get_err_ptr_)))                  \
                     break;                                              \
                 if (!MPIUI_Thread_ptr) {                                \
@@ -94,10 +95,10 @@ extern MPIUI_Per_thread_t MPIUI_ThreadSingle;
         if (is_threaded) {                                              \
             MPIU_THREADPRIV_GET(is_threaded, finalize_err_ptr_);        \
             MPIU_Free(MPIUI_Thread_ptr);                                \
-            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage,NULL,finalize_err_ptr_); \
+            MPIU_Thread_tls_set(&MPIUI_Thread_storage,NULL,finalize_err_ptr_); \
             if (unlikely(*((int *) finalize_err_ptr_)))                 \
                 break;                                                  \
-            MPIU_Thread_tls_destroy(&MPIR_ThreadInfo.thread_storage,finalize_err_ptr_); \
+            MPIU_Thread_tls_destroy(&MPIUI_Thread_storage,finalize_err_ptr_); \
             if (unlikely(*((int *) finalize_err_ptr_)))                 \
                 break;                                                  \
         }                                                               \

http://git.mpich.org/mpich.git/commitdiff/6f99cf0557bf3867c2f4bb410981e3255b45ef9e

commit 6f99cf0557bf3867c2f4bb410981e3255b45ef9e
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 6 21:16:25 2016 -0600

    threads: move debug out of the threads layer.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index 35d048c..911bafc 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -104,7 +104,9 @@ M*/
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking ALLGRAN mutex"); \
+            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_mutex_lock %p", &mutex); \
             MPIDU_Thread_mutex_lock(&mutex, &err_);                     \
+            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_mutex_lock %p", &mutex); \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -117,7 +119,9 @@ M*/
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking POBJ mutex"); \
+            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_mutex_lock %p", &mutex); \
             MPIDU_Thread_mutex_lock(&mutex, &err_);                     \
+            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_mutex_lock %p", &mutex); \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -159,6 +163,7 @@ M*/
             depth_ = MPIDU_THREADPRIV_FIELD(lock_depth);                \
             if (depth_ == 1) {                                          \
                 int err_ = 0;                                           \
+                MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIDU_Thread_mutex_unlock %p", &mutex); \
                 MPIDU_Thread_mutex_unlock(&mutex, &err_);               \
                 MPIU_Assert(err_ == 0);                                 \
             }                                                           \
@@ -171,6 +176,7 @@ M*/
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking ALLGRAN mutex"); \
+            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIDU_Thread_mutex_unlock %p", &mutex); \
             MPIDU_Thread_mutex_unlock(&mutex, &err_);                   \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
@@ -184,6 +190,7 @@ M*/
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking POBJ mutex"); \
+            MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIDU_Thread_mutex_unlock %p", &mutex); \
             MPIDU_Thread_mutex_unlock(&mutex, &err_);                   \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
@@ -221,7 +228,9 @@ M*/
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding GLOBAL mutex"); \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"enter MPIDU_Thread_yield"); \
             MPIDU_Thread_yield(&mutex, &err_);                          \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"exit MPIDU_Thread_yield"); \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -339,6 +348,7 @@ M*/
         OPA_store_int(&(mutex_ptr_)->num_queued_threads, 0);            \
         MPIU_Thread_mutex_create(&(mutex_ptr_)->mutex, err_ptr_);       \
         MPIU_Assert(*err_ptr_ == 0);                                    \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
     } while (0)
 
 /*@
@@ -352,6 +362,7 @@ M*/
 @*/
 #define MPIDU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)                \
     do {                                                                \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPIU_Thread_mutex %p", (mutex_ptr_)); \
         MPIU_Thread_mutex_destroy(&(mutex_ptr_)->mutex, err_ptr_);      \
         MPIU_Assert(*err_ptr_ == 0);                                    \
     } while (0)
@@ -365,8 +376,10 @@ M*/
 #define MPIDU_Thread_mutex_lock(mutex_ptr_, err_ptr_)                   \
     do {                                                                \
         OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIU_Thread_mutex_lock %p", &(mutex_ptr_)->mutex); \
         MPIU_Thread_mutex_lock(&(mutex_ptr_)->mutex, err_ptr_);         \
         MPIU_Assert(*err_ptr_ == 0);                                    \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIU_Thread_mutex_lock %p", &(mutex_ptr_)->mutex); \
         OPA_decr_int(&(mutex_ptr_)->num_queued_threads);                \
     } while (0)
 
@@ -397,6 +410,7 @@ M*/
     do {                                                \
         MPIU_Thread_cond_create(cond_ptr_, err_ptr_);   \
         MPIU_Assert(*err_ptr_ == 0);                    \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPIU_Thread_cond %p", (cond_ptr_)); \
     } while (0)
 
 /*@
@@ -411,6 +425,7 @@ M*/
 @*/
 #define MPIDU_Thread_cond_destroy(cond_ptr_, err_ptr_)  \
     do {                                                \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPIU_Thread_cond %p", (cond_ptr_)); \
         MPIU_Thread_cond_destroy(cond_ptr_, err_ptr_);  \
         MPIU_Assert(*err_ptr_ == 0);                    \
     } while (0)
@@ -432,9 +447,11 @@ M*/
 #define MPIDU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_)         \
     do {                                                                \
         OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                \
+        MPIU_DBG_MSG_FMT(MPIR_DBG_THREAD,TYPICAL,(MPIU_DBG_FDEST,"Enter cond_wait on cond=%p mutex=%p",(cond_ptr_),&(mutex_ptr_)->mutex)); \
         MPIU_Thread_cond_wait(cond_ptr_, &(mutex_ptr_)->mutex, err_ptr_); \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("cond_wait failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
+        MPIU_DBG_MSG_FMT(MPIR_DBG_THREAD,TYPICAL,(MPIU_DBG_FDEST,"Exit cond_wait on cond=%p mutex=%p",(cond_ptr_),&(mutex_ptr_)->mutex)); \
         OPA_decr_int(&(mutex_ptr_)->num_queued_threads);                \
     } while (0)
 
@@ -446,6 +463,7 @@ M*/
 @*/
 #define MPIDU_Thread_cond_broadcast(cond_ptr_, err_ptr_)                \
     do {                                                                \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_broadcast on MPIU_Thread_cond %p", (cond_ptr_)); \
         MPIU_Thread_cond_broadcast(cond_ptr_, err_ptr_);                \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("cond_broadcast failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
@@ -459,6 +477,7 @@ M*/
 @*/
 #define MPIDU_Thread_cond_signal(cond_ptr_, err_ptr_)                   \
     do {                                                                \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_signal on MPIU_Thread_cond %p", (cond_ptr_)); \
         MPIU_Thread_cond_signal(cond_ptr_, err_ptr_);                   \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("cond_signal failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
diff --git a/src/util/thread/mpiu_thread_posix.h b/src/util/thread/mpiu_thread_posix.h
index 2a5a295..8c82f00 100644
--- a/src/util/thread/mpiu_thread_posix.h
+++ b/src/util/thread/mpiu_thread_posix.h
@@ -43,12 +43,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(same_) = pthread_equal(*(id1_), *(id2_)) ? TRUE : FALSE;	\
     } while (0)
 
-#define MPIU_Thread_yield()                                             \
-    do {                                                                \
-        MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"enter MPIU_Thread_yield");         \
-        MPL_sched_yield();                                              \
-        MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"exit MPIU_Thread_yield");          \
-    } while (0)
+#define MPIU_Thread_yield MPL_sched_yield
 
 
 /*
@@ -76,7 +71,6 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
             MPL_internal_sys_error_printf("pthread_mutex_init", err__,  \
                                           "    %s:%d\n", __FILE__, __LINE__); \
         *(int *)(err_ptr_) = err__;                                     \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
     } while (0)
 
 #else /* defined(MPICH_PTHREAD_MUTEX_ERRORCHECK_VALUE) */
@@ -93,7 +87,6 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
             MPL_internal_sys_error_printf("pthread_mutex_init", err__,  \
                                           "    %s:%d\n", __FILE__, __LINE__); \
         *(int *)(err_ptr_) = err__;                                     \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
     } while (0)
 
 #endif /* defined(MPICH_PTHREAD_MUTEX_ERRORCHECK_VALUE) */
@@ -102,7 +95,6 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     do {                                                                \
         int err__;							\
                                                                         \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPIU_Thread_mutex %p", (mutex_ptr_)); \
         err__ = pthread_mutex_destroy(mutex_ptr_);                      \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_mutex_destroy", err__, \
@@ -114,15 +106,12 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
 #define MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_)                    \
     do {                                                                \
         int err__;                                                      \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"enter MPIU_Thread_mutex_lock %p", (mutex_ptr_)); \
         err__ = pthread_mutex_lock(mutex_ptr_);                         \
         if (unlikely(err__)) {                                          \
-            MPIU_DBG_MSG_S(MPIR_DBG_THREAD,TERSE,"  mutex lock error: %s", MPIU_Strerror(err__)); \
             MPL_internal_sys_error_printf("pthread_mutex_lock", err__,  \
                                           "    %s:%d\n", __FILE__, __LINE__); \
         }                                                               \
         *(int *)(err_ptr_) = err__;                                     \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIU_Thread_mutex_lock %p", (mutex_ptr_)); \
     } while (0)
 
 
@@ -130,10 +119,8 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     do {                                                                \
         int err__;                                                      \
                                                                         \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIU_Thread_mutex_unlock %p", (mutex_ptr_)); \
         err__ = pthread_mutex_unlock(mutex_ptr_);                       \
         if (unlikely(err__)) {                                          \
-            MPIU_DBG_MSG_S(MPIR_DBG_THREAD,TERSE,"  mutex unlock error: %s", MPIU_Strerror(err__)); \
             MPL_internal_sys_error_printf("pthread_mutex_unlock", err__, \
                                           "    %s:%d\n", __FILE__, __LINE__); \
         }                                                               \
@@ -153,7 +140,6 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_cond_init", err__,   \
                                           "    %s:%d\n", __FILE__, __LINE__); \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPIU_Thread_cond %p", (cond_ptr_)); \
         *(int *)(err_ptr_) = err__;                                     \
     } while (0)
 
@@ -161,7 +147,6 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     do {                                                                \
         int err__;							\
                                                                         \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPIU_Thread_cond %p", (cond_ptr_)); \
         err__ = pthread_cond_destroy(cond_ptr_);                        \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_cond_destroy", err__, \
@@ -176,23 +161,20 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         /* 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(MPIR_DBG_THREAD,TYPICAL,(MPIU_DBG_FDEST,"Enter cond_wait on cond=%p mutex=%p",(cond_ptr_),(mutex_ptr_))) \
-            do {                                                        \
-                err__ = pthread_cond_wait((cond_ptr_), mutex_ptr_);     \
-            } while (err__ == EINTR);                                   \
+        do {                                                            \
+            err__ = pthread_cond_wait((cond_ptr_), mutex_ptr_);         \
+        } while (err__ == EINTR);                                       \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_cond_wait", err__,   \
                                           "    %s:%d\n", __FILE__, __LINE__); \
 									\
         *(int *)(err_ptr_) = err__;                                     \
-        MPIU_DBG_MSG_FMT(MPIR_DBG_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(MPIR_DBG_THREAD,TYPICAL,"About to cond_broadcast on MPIU_Thread_cond %p", (cond_ptr_)); \
         err__ = pthread_cond_broadcast(cond_ptr_);			\
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_cond_broadcast", err__, \
@@ -205,7 +187,6 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     do {                                                                \
         int err__;							\
                                                                         \
-        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_signal on MPIU_Thread_cond %p", (cond_ptr_)); \
         err__ = pthread_cond_signal(cond_ptr_);                         \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_cond_signal", err__, \
diff --git a/src/util/thread/mpiu_thread_solaris.h b/src/util/thread/mpiu_thread_solaris.h
index e2bf1a3..fffb85a 100644
--- a/src/util/thread/mpiu_thread_solaris.h
+++ b/src/util/thread/mpiu_thread_solaris.h
@@ -36,10 +36,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(same_ptr_) = (*(id1_ptr_) == *(id2_ptr_)) ? TRUE : FALSE;     \
     } while (0)
 
-#define MPIU_Thread_yield()                             \
-    do {                                                \
-        thr_yield();                                    \
-    } while (0)
+#define MPIU_Thread_yield thr_yield
 
 
 /*

http://git.mpich.org/mpich.git/commitdiff/1c6ac3af032083d0f3587e79bd03abf566b84b83

commit 1c6ac3af032083d0f3587e79bd03abf566b84b83
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 6 20:30:51 2016 -0600

    threads: move OPA out of threads MPIU layer.
    
    This is not a simple move of the OPA code to the MPIDU layer.  It
    includes moving the unlock/lock code in yield to the upper layer as
    well.  This is to ensure that the lock part of the yield correctly
    updates the OPA counter.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index 0d4c998..35d048c 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -8,6 +8,7 @@
 #define MPIDU_THREAD_H_INCLUDED
 
 #include "mpiutil.h"
+#include "opa_primitives.h"
 
 /* some important critical section names:
  *   GLOBAL - entered/exited at beginning/end of (nearly) every MPI_ function
@@ -58,7 +59,11 @@ g * MPI_FINALIZED, MPI_GET_COUNT, MPI_GET_ELEMENTS, MPI_GRAPH_GET,
  * state.  Such situations should be avoided where possible.
  */
 
-typedef MPIU_Thread_mutex_t MPIDU_Thread_mutex_t;
+typedef struct {
+    MPIU_Thread_mutex_t mutex;
+    OPA_int_t num_queued_threads;
+} MPIDU_Thread_mutex_t;
+
 typedef MPIU_Thread_cond_t  MPIDU_Thread_cond_t;
 typedef MPIU_Thread_id_t    MPIDU_Thread_id_t;
 typedef MPIU_Thread_tls_t   MPIDU_Thread_tls_t;
@@ -307,10 +312,15 @@ M*/
 /*@
   MPIDU_Thread_yield - voluntarily relinquish the CPU, giving other threads an opportunity to run
 @*/
-#define MPIDU_Thread_yield(mutex_ptr_, err_ptr_)        \
-    do {                                                \
-        MPIU_Thread_yield(mutex_ptr_, err_ptr_);        \
-        MPIU_Assert(*err_ptr_ == 0);                    \
+#define MPIDU_Thread_yield(mutex_ptr_, err_ptr_)                        \
+    do {                                                                \
+        if (OPA_load_int(&(mutex_ptr_)->num_queued_threads) == 0)       \
+            break;                                                      \
+        MPIDU_Thread_mutex_unlock(mutex_ptr_, err_ptr_);                \
+        MPIU_Assert(*err_ptr_ == 0);                                    \
+        MPIU_Thread_yield();                                            \
+        MPIDU_Thread_mutex_lock(mutex_ptr_, err_ptr_);                  \
+        MPIU_Assert(*err_ptr_ == 0);                                    \
     } while (0)
 
 /*
@@ -324,10 +334,11 @@ M*/
 + mutex - mutex
 - err - error code (non-zero indicates an error has occurred)
 @*/
-#define MPIDU_Thread_mutex_create(mutex_ptr_, err_ptr_) \
-    do {                                                \
-        MPIU_Thread_mutex_create(mutex_ptr_, err_ptr_); \
-        MPIU_Assert(*err_ptr_ == 0);                    \
+#define MPIDU_Thread_mutex_create(mutex_ptr_, err_ptr_)                 \
+    do {                                                                \
+        OPA_store_int(&(mutex_ptr_)->num_queued_threads, 0);            \
+        MPIU_Thread_mutex_create(&(mutex_ptr_)->mutex, err_ptr_);       \
+        MPIU_Assert(*err_ptr_ == 0);                                    \
     } while (0)
 
 /*@
@@ -339,10 +350,10 @@ M*/
   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 MPIDU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)        \
-    do {                                                        \
-        MPIU_Thread_mutex_destroy(mutex_ptr_, err_ptr_);        \
-        MPIU_Assert(*err_ptr_ == 0);                            \
+#define MPIDU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)                \
+    do {                                                                \
+        MPIU_Thread_mutex_destroy(&(mutex_ptr_)->mutex, err_ptr_);      \
+        MPIU_Assert(*err_ptr_ == 0);                                    \
     } while (0)
 
 /*@
@@ -351,10 +362,12 @@ M*/
   Input Parameter:
 . mutex - mutex
 @*/
-#define MPIDU_Thread_mutex_lock(mutex_ptr_, err_ptr_)   \
-    do {                                                \
-        MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_);   \
-        MPIU_Assert(*err_ptr_ == 0);                    \
+#define MPIDU_Thread_mutex_lock(mutex_ptr_, err_ptr_)                   \
+    do {                                                                \
+        OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                \
+        MPIU_Thread_mutex_lock(&(mutex_ptr_)->mutex, err_ptr_);         \
+        MPIU_Assert(*err_ptr_ == 0);                                    \
+        OPA_decr_int(&(mutex_ptr_)->num_queued_threads);                \
     } while (0)
 
 /*@
@@ -363,10 +376,10 @@ M*/
   Input Parameter:
 . mutex - mutex
 @*/
-#define MPIDU_Thread_mutex_unlock(mutex_ptr_, err_ptr_) \
-    do {                                                \
-        MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_); \
-        MPIU_Assert(*err_ptr_ == 0);                    \
+#define MPIDU_Thread_mutex_unlock(mutex_ptr_, err_ptr_)                 \
+    do {                                                                \
+        MPIU_Thread_mutex_unlock(&(mutex_ptr_)->mutex, err_ptr_);       \
+        MPIU_Assert(*err_ptr_ == 0);                                    \
     } while (0)
 
 /*
@@ -418,9 +431,11 @@ M*/
 @*/
 #define MPIDU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_)         \
     do {                                                                \
-        MPIU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_);         \
+        OPA_incr_int(&(mutex_ptr_)->num_queued_threads);                \
+        MPIU_Thread_cond_wait(cond_ptr_, &(mutex_ptr_)->mutex, err_ptr_); \
         MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
                             ("cond_wait failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
+        OPA_decr_int(&(mutex_ptr_)->num_queued_threads);                \
     } while (0)
 
 /*@
diff --git a/src/util/thread/mpiu_thread_posix.h b/src/util/thread/mpiu_thread_posix.h
index ba324cc..2a5a295 100644
--- a/src/util/thread/mpiu_thread_posix.h
+++ b/src/util/thread/mpiu_thread_posix.h
@@ -15,12 +15,8 @@
 
 #include <errno.h>
 #include <pthread.h>
-#include "opa_primitives.h"
 
-typedef struct {
-    pthread_mutex_t mutex;
-    OPA_int_t num_queued_threads;
-} MPIU_Thread_mutex_t;
+typedef pthread_mutex_t 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;
@@ -47,14 +43,10 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(same_) = pthread_equal(*(id1_), *(id2_)) ? TRUE : FALSE;	\
     } while (0)
 
-#define MPIU_Thread_yield(mutex_ptr_, err_ptr_)                         \
+#define MPIU_Thread_yield()                                             \
     do {                                                                \
         MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"enter MPIU_Thread_yield");         \
-        if (OPA_load_int(&(mutex_ptr_)->num_queued_threads) == 0)       \
-            break;                                                      \
-        MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_);                 \
         MPL_sched_yield();                                              \
-        MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_);                   \
         MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"exit MPIU_Thread_yield");          \
     } while (0)
 
@@ -79,8 +71,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     do {                                                                \
         int err__;                                                      \
                                                                         \
-        OPA_store_int(&(mutex_ptr_)->num_queued_threads, 0);            \
-        err__ = pthread_mutex_init(&(mutex_ptr_)->mutex, NULL);         \
+        err__ = pthread_mutex_init(mutex_ptr_, NULL);                   \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_mutex_init", err__,  \
                                           "    %s:%d\n", __FILE__, __LINE__); \
@@ -95,10 +86,9 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         int err__;                                                      \
         pthread_mutexattr_t attr__;                                     \
                                                                         \
-        OPA_store_int(&(mutex_ptr_)->num_queued_threads, 0);            \
         pthread_mutexattr_init(&attr__);                                \
         pthread_mutexattr_settype(&attr__, MPICH_PTHREAD_MUTEX_ERRORCHECK_VALUE); \
-        err__ = pthread_mutex_init(&(mutex_ptr_)->mutex, &attr__);      \
+        err__ = pthread_mutex_init(mutex_ptr_, &attr__);                \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_mutex_init", err__,  \
                                           "    %s:%d\n", __FILE__, __LINE__); \
@@ -113,7 +103,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         int err__;							\
                                                                         \
         MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPIU_Thread_mutex %p", (mutex_ptr_)); \
-        err__ = pthread_mutex_destroy(&(mutex_ptr_)->mutex);            \
+        err__ = pthread_mutex_destroy(mutex_ptr_);                      \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_mutex_destroy", err__, \
                                           "    %s:%d\n", __FILE__, __LINE__); \
@@ -125,9 +115,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     do {                                                                \
         int err__;                                                      \
         MPIU_DBG_MSG_P(MPIR_DBG_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);                \
+        err__ = pthread_mutex_lock(mutex_ptr_);                         \
         if (unlikely(err__)) {                                          \
             MPIU_DBG_MSG_S(MPIR_DBG_THREAD,TERSE,"  mutex lock error: %s", MPIU_Strerror(err__)); \
             MPL_internal_sys_error_printf("pthread_mutex_lock", err__,  \
@@ -143,7 +131,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         int err__;                                                      \
                                                                         \
         MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIU_Thread_mutex_unlock %p", (mutex_ptr_)); \
-        err__ = pthread_mutex_unlock(&(mutex_ptr_)->mutex);             \
+        err__ = pthread_mutex_unlock(mutex_ptr_);                       \
         if (unlikely(err__)) {                                          \
             MPIU_DBG_MSG_S(MPIR_DBG_THREAD,TERSE,"  mutex unlock error: %s", MPIU_Strerror(err__)); \
             MPL_internal_sys_error_printf("pthread_mutex_unlock", err__, \
@@ -190,9 +178,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
          * older implementations still do. */                           \
         MPIU_DBG_MSG_FMT(MPIR_DBG_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);        \
+                err__ = pthread_cond_wait((cond_ptr_), mutex_ptr_);     \
             } while (err__ == EINTR);                                   \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_cond_wait", err__,   \
diff --git a/src/util/thread/mpiu_thread_solaris.h b/src/util/thread/mpiu_thread_solaris.h
index 191e470..e2bf1a3 100644
--- a/src/util/thread/mpiu_thread_solaris.h
+++ b/src/util/thread/mpiu_thread_solaris.h
@@ -36,11 +36,9 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(same_ptr_) = (*(id1_ptr_) == *(id2_ptr_)) ? TRUE : FALSE;     \
     } while (0)
 
-#define MPIU_Thread_yield(mutex_ptr_, err_ptr_)         \
+#define MPIU_Thread_yield()                             \
     do {                                                \
-        MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_); \
         thr_yield();                                    \
-        MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_);   \
     } while (0)
 
 
diff --git a/src/util/thread/mpiu_thread_win.c b/src/util/thread/mpiu_thread_win.c
index b943810..4c8ca7f 100644
--- a/src/util/thread/mpiu_thread_win.c
+++ b/src/util/thread/mpiu_thread_win.c
@@ -102,11 +102,9 @@ void MPIU_Thread_same(MPIU_Thread_id_t * id1, MPIU_Thread_id_t * id2, int *same)
     *same = (*id1 == *id2) ? TRUE : FALSE;
 }
 
-void MPIU_Thread_yield(MPIU_Thread_mutex_t * mutex, int *err)
+void MPIU_Thread_yield(void)
 {
-    MPIU_Thread_mutex_unlock(mutex, err);
     Sleep(0);
-    MPIU_Thread_mutex_lock(mutex, err);
 }
 
 /*
diff --git a/src/util/thread/mpiu_thread_win.h b/src/util/thread/mpiu_thread_win.h
index 3185e6c..6ec0003 100644
--- a/src/util/thread/mpiu_thread_win.h
+++ b/src/util/thread/mpiu_thread_win.h
@@ -32,7 +32,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
 void MPIU_Thread_exit(void);
 void MPIU_Thread_self(MPIU_Thread_id_t * id);
 void MPIU_Thread_same(MPIU_Thread_id_t * id1, MPIU_Thread_id_t * id2, int *same);
-void MPIU_Thread_yield(MPIU_Thread_mutex_t * mutex, int *err);
+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);

http://git.mpich.org/mpich.git/commitdiff/3705475cc6267520f4b8b50bbb7b094c0949e6d2

commit 3705475cc6267520f4b8b50bbb7b094c0949e6d2
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 6 22:52:23 2016 -0600

    threads: move recursive locks to the MPIDU layer.
    
    Now the threads MPIU layer is simple and only handles the portability
    aspects across different OSs and compilers.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index ab6ba88..0d4c998 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -80,10 +80,18 @@ M*/
 #define MPIDUI_THREAD_CS_ENTER_GLOBAL(mutex)                            \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
-            int err_ = 0;                                               \
+            int depth_;                                                 \
+            MPIDU_THREADPRIV_DECL;                                      \
+                                                                        \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive locking GLOBAL mutex"); \
-            MPIU_THREAD_CS_ENTER_RECURSIVE(mutex, &err_);               \
-            MPIU_Assert(err_ == 0);                                     \
+            MPIDU_THREADPRIV_GET;                                       \
+            depth_ = MPIDU_THREADPRIV_FIELD(lock_depth);                \
+            if (depth_ == 0) {                                          \
+                int err_ = 0;                                           \
+                MPIDU_Thread_mutex_lock(&mutex, &err_);                 \
+                MPIU_Assert(err_ == 0);                                 \
+            }                                                           \
+            MPIDU_THREADPRIV_FIELD(lock_depth) += 1;                    \
         }                                                               \
     } while (0)
 #define MPIDUI_THREAD_CS_ENTER_ALLGRAN(mutex)                           \
@@ -91,7 +99,7 @@ M*/
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking ALLGRAN mutex"); \
-            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex, &err_);            \
+            MPIDU_Thread_mutex_lock(&mutex, &err_);                     \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -104,7 +112,7 @@ M*/
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking POBJ mutex"); \
-            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex, &err_);            \
+            MPIDU_Thread_mutex_lock(&mutex, &err_);                     \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -138,18 +146,27 @@ M*/
 #define MPIDUI_THREAD_CS_EXIT_GLOBAL(mutex)                             \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
-            int err_ = 0;                                               \
+            int depth_;                                                 \
+            MPIDU_THREADPRIV_DECL;                                      \
+                                                                        \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive unlocking GLOBAL mutex"); \
-            MPIU_THREAD_CS_EXIT_RECURSIVE(mutex, &err_);                \
-            MPIU_Assert(err_ == 0);                                     \
+            MPIDU_THREADPRIV_GET;                                       \
+            depth_ = MPIDU_THREADPRIV_FIELD(lock_depth);                \
+            if (depth_ == 1) {                                          \
+                int err_ = 0;                                           \
+                MPIDU_Thread_mutex_unlock(&mutex, &err_);               \
+                MPIU_Assert(err_ == 0);                                 \
+            }                                                           \
+            MPIDU_THREADPRIV_FIELD(lock_depth) -= 1;                    \
         }                                                               \
     } while (0)
+
 #define MPIDUI_THREAD_CS_EXIT_ALLGRAN(mutex)                            \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking ALLGRAN mutex"); \
-            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex, &err_);             \
+            MPIDU_Thread_mutex_unlock(&mutex, &err_);                   \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -162,7 +179,7 @@ M*/
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking POBJ mutex"); \
-            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex, &err_);             \
+            MPIDU_Thread_mutex_unlock(&mutex, &err_);                   \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -198,8 +215,8 @@ M*/
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
-            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive yielding GLOBAL mutex"); \
-            MPIU_THREAD_CS_YIELD_RECURSIVE(mutex, &err_);               \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding GLOBAL mutex"); \
+            MPIDU_Thread_yield(&mutex, &err_);                          \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -208,7 +225,7 @@ M*/
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding ALLGRAN mutex"); \
-            MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex, &err_);            \
+            MPIDU_Thread_yield(&mutex, &err_);                          \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
@@ -221,7 +238,7 @@ M*/
         if (MPIR_ThreadInfo.isThreaded) {                               \
             int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding POBJ mutex"); \
-            MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex, &err_);            \
+            MPIDU_Thread_yield(&mutex, &err_);                          \
             MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
diff --git a/src/util/thread/mpiu_thread_multiple.h b/src/util/thread/mpiu_thread_multiple.h
index 21edecb..017be83 100644
--- a/src/util/thread/mpiu_thread_multiple.h
+++ b/src/util/thread/mpiu_thread_multiple.h
@@ -9,58 +9,4 @@
 
 #include "mpiu_thread_priv.h"
 
-/* Nonrecursive mutex macros */
-#define MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex, err_ptr_)              \
-    do {                                                                \
-        MPIU_Thread_mutex_lock(&mutex, err_ptr_);                       \
-    } while (0)
-
-#define MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex, err_ptr_)               \
-    do {                                                                \
-        MPIU_Thread_mutex_unlock(&mutex, err_ptr_);                     \
-    } while (0)
-
-#define MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex, err_ptr_)      \
-    do {                                                        \
-        MPIU_Thread_yield(&mutex, err_ptr_);                    \
-    } while (0)
-
-
-/* Recursive mutex macros */
-/* We don't need to protect the depth variable since it is thread
- * private and sequentially accessed within a thread */
-/* We assume threaded mode over here.  The upper layer should check if
- * locks are needed before calling this function. */
-#define MPIU_THREAD_CS_ENTER_RECURSIVE(mutex, err_ptr_) \
-    do {                                                \
-        int depth_;                                     \
-        MPIU_THREADPRIV_DECL;                           \
-        MPIU_THREADPRIV_GET(1, err_ptr_);               \
-        if (unlikely(*(err_ptr_)))                      \
-            break;                                      \
-                                                        \
-        depth_ = MPIU_THREADPRIV_FIELD(lock_depth);     \
-        if (depth_ == 0) {                              \
-            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex, err_ptr_); \
-        }                                               \
-        MPIU_THREADPRIV_FIELD(lock_depth) += 1;         \
-    } while (0)
-
-#define MPIU_THREAD_CS_EXIT_RECURSIVE(mutex, err_ptr_)  \
-    do {                                                \
-        int depth_;                                     \
-        MPIU_THREADPRIV_DECL;                           \
-        MPIU_THREADPRIV_GET(1, err_ptr_);               \
-        if (unlikely(*(err_ptr_)))                      \
-            break;                                      \
-                                                        \
-        depth_ = MPIU_THREADPRIV_FIELD(lock_depth);     \
-        if (depth_ == 1) {                              \
-            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex, err_ptr_);  \
-        }                                               \
-        MPIU_THREADPRIV_FIELD(lock_depth) -= 1;         \
-    } while (0)
-
-#define MPIU_THREAD_CS_YIELD_RECURSIVE MPIU_THREAD_CS_YIELD_NONRECURSIVE
-
 #endif /* !defined(MPIU_THREAD_MULTIPLE_H_INCLUDED) */

http://git.mpich.org/mpich.git/commitdiff/7540dd7b3e64e40754305f5ac9475d1d1f8263c9

commit 7540dd7b3e64e40754305f5ac9475d1d1f8263c9
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 20 15:20:44 2016 -0600

    threads: make error assertions consistent.
    
    Added error asserts for all functions instead of just a small subset of
    thread functions, for consistency.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index 716e927..ab6ba88 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -256,7 +256,11 @@ M*/
   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 MPIDU_Thread_create       MPIU_Thread_create
+#define MPIDU_Thread_create(func_, data_, id_, err_ptr_)        \
+    do {                                                        \
+        MPIU_Thread_create(func_, data_, id_, err_ptr_);        \
+        MPIU_Assert(*err_ptr_ == 0);                            \
+    } while (0)
 
 /*@
   MPIDU_Thread_exit - exit from the current thread
@@ -286,7 +290,11 @@ M*/
 /*@
   MPIDU_Thread_yield - voluntarily relinquish the CPU, giving other threads an opportunity to run
 @*/
-#define MPIDU_Thread_yield      MPIU_Thread_yield
+#define MPIDU_Thread_yield(mutex_ptr_, err_ptr_)        \
+    do {                                                \
+        MPIU_Thread_yield(mutex_ptr_, err_ptr_);        \
+        MPIU_Assert(*err_ptr_ == 0);                    \
+    } while (0)
 
 /*
  *    Mutexes
@@ -299,7 +307,11 @@ M*/
 + mutex - mutex
 - err - error code (non-zero indicates an error has occurred)
 @*/
-#define MPIDU_Thread_mutex_create  MPIU_Thread_mutex_create
+#define MPIDU_Thread_mutex_create(mutex_ptr_, err_ptr_) \
+    do {                                                \
+        MPIU_Thread_mutex_create(mutex_ptr_, err_ptr_); \
+        MPIU_Assert(*err_ptr_ == 0);                    \
+    } while (0)
 
 /*@
   MPIDU_Thread_mutex_destroy - destroy an existing mutex
@@ -310,7 +322,11 @@ M*/
   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 MPIDU_Thread_mutex_destroy  MPIU_Thread_mutex_destroy
+#define MPIDU_Thread_mutex_destroy(mutex_ptr_, err_ptr_)        \
+    do {                                                        \
+        MPIU_Thread_mutex_destroy(mutex_ptr_, err_ptr_);        \
+        MPIU_Assert(*err_ptr_ == 0);                            \
+    } while (0)
 
 /*@
   MPIDU_Thread_lock - acquire a mutex
@@ -318,7 +334,11 @@ M*/
   Input Parameter:
 . mutex - mutex
 @*/
-#define MPIDU_Thread_mutex_lock MPIU_Thread_mutex_lock
+#define MPIDU_Thread_mutex_lock(mutex_ptr_, err_ptr_)   \
+    do {                                                \
+        MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_);   \
+        MPIU_Assert(*err_ptr_ == 0);                    \
+    } while (0)
 
 /*@
   MPIDU_Thread_unlock - release a mutex
@@ -326,7 +346,11 @@ M*/
   Input Parameter:
 . mutex - mutex
 @*/
-#define MPIDU_Thread_mutex_unlock MPIU_Thread_mutex_unlock
+#define MPIDU_Thread_mutex_unlock(mutex_ptr_, err_ptr_) \
+    do {                                                \
+        MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_); \
+        MPIU_Assert(*err_ptr_ == 0);                    \
+    } while (0)
 
 /*
  * Condition Variables
@@ -339,7 +363,11 @@ M*/
 + 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 MPIDU_Thread_cond_create MPIU_Thread_cond_create
+#define MPIDU_Thread_cond_create(cond_ptr_, err_ptr_)   \
+    do {                                                \
+        MPIU_Thread_cond_create(cond_ptr_, err_ptr_);   \
+        MPIU_Assert(*err_ptr_ == 0);                    \
+    } while (0)
 
 /*@
   MPIDU_Thread_cond_destroy - destroy an existinga condition variable
@@ -351,7 +379,11 @@ M*/
 . err - location to store the error code; pointer may be NULL; error is zero
         for success, non-zero if a failure occurred
 @*/
-#define MPIDU_Thread_cond_destroy MPIU_Thread_cond_destroy
+#define MPIDU_Thread_cond_destroy(cond_ptr_, err_ptr_)  \
+    do {                                                \
+        MPIU_Thread_cond_destroy(cond_ptr_, err_ptr_);  \
+        MPIU_Assert(*err_ptr_ == 0);                    \
+    } while (0)
 
 /*@
   MPIDU_Thread_cond_wait - wait (block) on a condition variable
@@ -415,7 +447,11 @@ M*/
 - err - location to store the error code; pointer may be NULL; error is zero
         for success, non-zero if a failure occurred
 @*/
-#define MPIDU_Thread_tls_create MPIU_Thread_tls_create
+#define MPIDU_Thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_)     \
+    do {                                                                \
+        MPIU_Thread_tls_create(exit_func_ptr_, tls_ptr_, err_ptr_);     \
+        MPIU_Assert(*(int *) err_ptr_ == 0);                            \
+    } while (0)
 
 /*@
   MPIDU_Thread_tls_destroy - destroy a thread local storage space
@@ -431,7 +467,11 @@ M*/
   The destroy function associated with the thread local storage will not
   called after the space has been destroyed.
 @*/
-#define MPIDU_Thread_tls_destroy MPIU_Thread_tls_destroy
+#define MPIDU_Thread_tls_destroy(tls_ptr_, err_ptr_)    \
+    do {                                                \
+        MPIU_Thread_tls_destroy(tls_ptr_, err_ptr_);    \
+        MPIU_Assert(*(int *) err_ptr_ == 0);            \
+    } while (0)
 
 /*@
   MPIDU_Thread_tls_set - associate a value with the current thread in the
@@ -458,7 +498,12 @@ M*/
   Output Parameter:
 . value - value associated with current thread
 @*/
-#define MPIDU_Thread_tls_get MPIU_Thread_tls_get
+#define MPIDU_Thread_tls_get(tls_ptr_, value_ptr_, err_ptr_)            \
+    do {                                                                \
+        MPIU_Thread_tls_get(tls_ptr_, value_ptr_, err_ptr_);            \
+        MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
+                            ("tls_get failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
+    } while (0)
 
 
 #define MPIDU_THREADPRIV_INITKEY                                        \

http://git.mpich.org/mpich.git/commitdiff/2de17d96390e4eb905dcc42a00000b8545ba668b

commit 2de17d96390e4eb905dcc42a00000b8545ba668b
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 6 19:17:28 2016 -0600

    threads: move error assertions to the MPIDU layer.
    
    The MPIU layer for threads still checks for errors, but does not assert
    for their success.  Instead, it now simply passes on the error to the
    upper layer, which can assert on it or use it in a different way.
    
    The error assertions are not consistent.  Some functions assert on
    errors, while others simply pass them on to the upper layer.  We need to
    decide one way or another and be consistent.  This patch does not fix
    this issue.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index 04f2fd8..716e927 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -80,15 +80,19 @@ M*/
 #define MPIDUI_THREAD_CS_ENTER_GLOBAL(mutex)                            \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
+            int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive locking GLOBAL mutex"); \
-            MPIU_THREAD_CS_ENTER_RECURSIVE(mutex);                      \
+            MPIU_THREAD_CS_ENTER_RECURSIVE(mutex, &err_);               \
+            MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
 #define MPIDUI_THREAD_CS_ENTER_ALLGRAN(mutex)                           \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
+            int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking ALLGRAN mutex"); \
-            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex);                   \
+            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex, &err_);            \
+            MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
 #define MPIDUI_THREAD_CS_ENTER_POBJ(mutex) do {} while (0)
@@ -98,8 +102,10 @@ M*/
 #define MPIDUI_THREAD_CS_ENTER_POBJ(mutex)                              \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
+            int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking POBJ mutex"); \
-            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex);                   \
+            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex, &err_);            \
+            MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
 #define MPIDUI_THREAD_CS_ENTER_ALLGRAN  MPIDUI_THREAD_CS_ENTER_POBJ
@@ -132,15 +138,19 @@ M*/
 #define MPIDUI_THREAD_CS_EXIT_GLOBAL(mutex)                             \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
+            int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive unlocking GLOBAL mutex"); \
-            MPIU_THREAD_CS_EXIT_RECURSIVE(mutex);                       \
+            MPIU_THREAD_CS_EXIT_RECURSIVE(mutex, &err_);                \
+            MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
 #define MPIDUI_THREAD_CS_EXIT_ALLGRAN(mutex)                            \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
+            int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking ALLGRAN mutex"); \
-            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex);                    \
+            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex, &err_);             \
+            MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
 #define MPIDUI_THREAD_CS_EXIT_POBJ(mutex) do {} while (0)
@@ -150,8 +160,10 @@ M*/
 #define MPIDUI_THREAD_CS_EXIT_POBJ(mutex)                               \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
+            int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking POBJ mutex"); \
-            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex);                    \
+            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex, &err_);             \
+            MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
 #define MPIDUI_THREAD_CS_EXIT_ALLGRAN  MPIDUI_THREAD_CS_EXIT_POBJ
@@ -185,15 +197,19 @@ M*/
 #define MPIDUI_THREAD_CS_YIELD_GLOBAL(mutex)                            \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
+            int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive yielding GLOBAL mutex"); \
-            MPIU_THREAD_CS_YIELD_RECURSIVE(mutex);                      \
+            MPIU_THREAD_CS_YIELD_RECURSIVE(mutex, &err_);               \
+            MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
 #define MPIDUI_THREAD_CS_YIELD_ALLGRAN(mutex)                           \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
+            int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding ALLGRAN mutex"); \
-            MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex);                   \
+            MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex, &err_);            \
+            MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
 #define MPIDUI_THREAD_CS_YIELD_POBJ(mutex) do {} while (0)
@@ -203,8 +219,10 @@ M*/
 #define MPIDUI_THREAD_CS_YIELD_POBJ(mutex)                              \
     do {                                                                \
         if (MPIR_ThreadInfo.isThreaded) {                               \
+            int err_ = 0;                                               \
             MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding POBJ mutex"); \
-            MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex);                   \
+            MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex, &err_);            \
+            MPIU_Assert(err_ == 0);                                     \
         }                                                               \
     } while (0)
 #define MPIDUI_THREAD_CS_YIELD_ALLGRAN  MPIDUI_THREAD_CS_YIELD_POBJ
@@ -349,7 +367,12 @@ M*/
   has changed in a way that warrants letting the
   thread proceed.
 @*/
-#define MPIDU_Thread_cond_wait MPIU_Thread_cond_wait
+#define MPIDU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_)         \
+    do {                                                                \
+        MPIU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_);         \
+        MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
+                            ("cond_wait failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
+    } while (0)
 
 /*@
   MPIDU_Thread_cond_broadcast - release all threads currently waiting on a condition variable
@@ -357,7 +380,12 @@ M*/
   Input Parameter:
 . cond - condition variable
 @*/
-#define MPIDU_Thread_cond_broadcast MPIU_Thread_cond_broadcast
+#define MPIDU_Thread_cond_broadcast(cond_ptr_, err_ptr_)                \
+    do {                                                                \
+        MPIU_Thread_cond_broadcast(cond_ptr_, err_ptr_);                \
+        MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
+                            ("cond_broadcast failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
+    } while (0)
 
 /*@
   MPIDU_Thread_cond_signal - release one thread currently waitng on a condition variable
@@ -365,7 +393,12 @@ M*/
   Input Parameter:
 . cond - condition variable
 @*/
-#define MPIDU_Thread_cond_signal MPIU_Thread_cond_signal
+#define MPIDU_Thread_cond_signal(cond_ptr_, err_ptr_)                   \
+    do {                                                                \
+        MPIU_Thread_cond_signal(cond_ptr_, err_ptr_);                   \
+        MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
+                            ("cond_signal failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
+    } while (0)
 
 /*
  * Thread Local Storage
@@ -408,7 +441,12 @@ M*/
 + tls - thread local storage space
 - value - value to associate with current thread
 @*/
-#define MPIDU_Thread_tls_set MPIU_Thread_tls_set
+#define MPIDU_Thread_tls_set(tls_ptr_, value_, err_ptr_)                \
+    do {                                                                \
+        MPIU_Thread_tls_set(tls_ptr_, value_, err_ptr_);                \
+        MPIU_Assert_fmt_msg(*((int *) err_ptr_) == 0,                   \
+                            ("tls_set failed, err=%d (%s)", *((int *) err_ptr_), strerror(*((int *) err_ptr_)))); \
+    } while (0)
 
 /*@
   MPIDU_Thread_tls_get - obtain the value associated with the current thread
@@ -423,12 +461,36 @@ M*/
 #define MPIDU_Thread_tls_get MPIU_Thread_tls_get
 
 
-#define MPIDU_THREADPRIV_INITKEY  MPIU_THREADPRIV_INITKEY
-#define MPIDU_THREADPRIV_INIT     MPIU_THREADPRIV_INIT
-#define MPIDU_THREADPRIV_GET      MPIU_THREADPRIV_GET
+#define MPIDU_THREADPRIV_INITKEY                                        \
+    do {                                                                \
+        int err_ = 0;                                                   \
+        MPIU_THREADPRIV_INITKEY(MPIR_ThreadInfo.isThreaded, &err_);     \
+        MPIU_Assert(err_ == 0);                                         \
+    } while (0)
+
+#define MPIDU_THREADPRIV_INIT                                   \
+    do {                                                        \
+        int err_ = 0;                                           \
+        MPIU_THREADPRIV_INIT(MPIR_ThreadInfo.isThreaded, &err_);        \
+        MPIU_Assert(err_ == 0);                                 \
+    } while (0)
+
+#define MPIDU_THREADPRIV_GET                                    \
+    do {                                                        \
+        int err_ = 0;                                           \
+        MPIU_THREADPRIV_GET(MPIR_ThreadInfo.isThreaded, &err_);  \
+        MPIU_Assert(err_ == 0);                                 \
+    } while (0)
+
 #define MPIDU_THREADPRIV_DECL     MPIU_THREADPRIV_DECL
 #define MPIDU_THREADPRIV_FIELD    MPIU_THREADPRIV_FIELD
-#define MPIDU_THREADPRIV_FINALIZE MPIU_THREADPRIV_FINALIZE
+
+#define MPIDU_THREADPRIV_FINALIZE                                       \
+    do {                                                                \
+        int err_ = 0;                                                   \
+        MPIU_THREADPRIV_FINALIZE(MPIR_ThreadInfo.isThreaded, &err_);    \
+        MPIU_Assert(err_ == 0);                                         \
+    } while (0)
 
 
 #endif /* !defined(MPIDU_THREAD_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index e1d2d8c..e5ddab7 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -11,7 +11,6 @@
 #include "mpichconf.h"  /* defines MPICH_THREAD_PACKAGE_NAME */
 #include "mpichconfconst.h"
 #include "mpidbg.h"
-#include "mpiassert.h"
 #include "mpiu_strerror.h"
 
 /* FIXME: we should not be including an MPIR-level header here.  But
@@ -47,6 +46,7 @@ typedef void (*MPIU_Thread_func_t) (void *data);
 
 /* Error values */
 #define MPIU_THREAD_SUCCESS 0
+#define MPIU_THREAD_ERROR   1
 /* FIXME: Define other error codes.  For now, any non-zero value is an error. */
 
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_INVALID
diff --git a/src/util/thread/mpiu_thread_multiple.h b/src/util/thread/mpiu_thread_multiple.h
index 4d33dfd..21edecb 100644
--- a/src/util/thread/mpiu_thread_multiple.h
+++ b/src/util/thread/mpiu_thread_multiple.h
@@ -10,49 +10,53 @@
 #include "mpiu_thread_priv.h"
 
 /* Nonrecursive mutex macros */
-#define MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex)                        \
+#define MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex, err_ptr_)              \
     do {                                                                \
-        int err_;                                                       \
-        MPIU_Thread_mutex_lock(&mutex, &err_);                          \
+        MPIU_Thread_mutex_lock(&mutex, err_ptr_);                       \
     } while (0)
 
-#define MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex)                         \
+#define MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex, err_ptr_)               \
     do {                                                                \
-        int err_;                                                       \
-        MPIU_Thread_mutex_unlock(&mutex, &err_);                        \
+        MPIU_Thread_mutex_unlock(&mutex, err_ptr_);                     \
     } while (0)
 
-#define MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex)                        \
-    do {                                                                \
-        MPIU_Thread_yield(&mutex);                                      \
+#define MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex, err_ptr_)      \
+    do {                                                        \
+        MPIU_Thread_yield(&mutex, err_ptr_);                    \
     } while (0)
 
 
 /* Recursive mutex macros */
 /* We don't need to protect the depth variable since it is thread
  * private and sequentially accessed within a thread */
-#define MPIU_THREAD_CS_ENTER_RECURSIVE(mutex)           \
+/* We assume threaded mode over here.  The upper layer should check if
+ * locks are needed before calling this function. */
+#define MPIU_THREAD_CS_ENTER_RECURSIVE(mutex, err_ptr_) \
     do {                                                \
         int depth_;                                     \
         MPIU_THREADPRIV_DECL;                           \
-        MPIU_THREADPRIV_GET;                            \
+        MPIU_THREADPRIV_GET(1, err_ptr_);               \
+        if (unlikely(*(err_ptr_)))                      \
+            break;                                      \
                                                         \
         depth_ = MPIU_THREADPRIV_FIELD(lock_depth);     \
         if (depth_ == 0) {                              \
-            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex);   \
+            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex, err_ptr_); \
         }                                               \
         MPIU_THREADPRIV_FIELD(lock_depth) += 1;         \
     } while (0)
 
-#define MPIU_THREAD_CS_EXIT_RECURSIVE(mutex)            \
+#define MPIU_THREAD_CS_EXIT_RECURSIVE(mutex, err_ptr_)  \
     do {                                                \
         int depth_;                                     \
         MPIU_THREADPRIV_DECL;                           \
-        MPIU_THREADPRIV_GET;                            \
+        MPIU_THREADPRIV_GET(1, err_ptr_);               \
+        if (unlikely(*(err_ptr_)))                      \
+            break;                                      \
                                                         \
         depth_ = MPIU_THREADPRIV_FIELD(lock_depth);     \
         if (depth_ == 1) {                              \
-            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex);    \
+            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex, err_ptr_);  \
         }                                               \
         MPIU_THREADPRIV_FIELD(lock_depth) -= 1;         \
     } while (0)
diff --git a/src/util/thread/mpiu_thread_posix.h b/src/util/thread/mpiu_thread_posix.h
index 77f2d51..ba324cc 100644
--- a/src/util/thread/mpiu_thread_posix.h
+++ b/src/util/thread/mpiu_thread_posix.h
@@ -47,15 +47,14 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(same_) = pthread_equal(*(id1_), *(id2_)) ? TRUE : FALSE;	\
     } while (0)
 
-#define MPIU_Thread_yield(mutex_ptr_)                                   \
+#define MPIU_Thread_yield(mutex_ptr_, err_ptr_)                         \
     do {                                                                \
-        int err;                                                        \
         MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"enter MPIU_Thread_yield");         \
         if (OPA_load_int(&(mutex_ptr_)->num_queued_threads) == 0)       \
             break;                                                      \
-        MPIU_Thread_mutex_unlock(mutex_ptr_, &err);                     \
+        MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_);                 \
         MPL_sched_yield();                                              \
-        MPIU_Thread_mutex_lock(mutex_ptr_, &err);                       \
+        MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_);                   \
         MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"exit MPIU_Thread_yield");          \
     } while (0)
 
@@ -200,8 +199,6 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
                                           "    %s:%d\n", __FILE__, __LINE__); \
 									\
         *(int *)(err_ptr_) = err__;                                     \
-        MPIU_Assert_fmt_msg(err__ == 0,                                 \
-                            ("cond_wait failed, err=%d (%s)",err__,strerror(err__))); \
         MPIU_DBG_MSG_FMT(MPIR_DBG_THREAD,TYPICAL,(MPIU_DBG_FDEST,"Exit cond_wait on cond=%p mutex=%p",(cond_ptr_),(mutex_ptr_))); \
     } while (0)
 
@@ -216,8 +213,6 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
                                           "    %s:%d\n", __FILE__, __LINE__); \
                                                                         \
         *(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_)                    \
@@ -231,8 +226,6 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
                                           "    %s:%d\n", __FILE__, __LINE__); \
                                                                         \
         *(int *)(err_ptr_) = err__;                                     \
-        MPIU_Assert_fmt_msg(err__ == 0,                                 \
-                            ("cond_signal failed, err__=%d (%s)",err__,strerror(err__))); \
     } while (0)
 
 
@@ -274,8 +267,6 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
                                           "    %s:%d\n", __FILE__, __LINE__); \
                                                                         \
         *(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
index 1e53b3d..c7f4a9f 100644
--- a/src/util/thread/mpiu_thread_priv.h
+++ b/src/util/thread/mpiu_thread_priv.h
@@ -37,67 +37,71 @@ void MPIUI_Cleanup_tls(void *a);
    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
    MPIUI_Per_thread_t struct, as in the single threaded case.  Based on
-   MPIR_Process.isThreaded, one or the other is used.
+   whether MPICH is initialized with thread safety, 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 MPIUI_Per_thread_t MPIUI_ThreadSingle;
 
-#define MPIU_THREADPRIV_INITKEY                                         \
+#define MPIU_THREADPRIV_INITKEY(is_threaded, initkey_err_ptr_)          \
     do {                                                                \
-        if (MPIR_ThreadInfo.isThreaded) {                               \
-            int initkey_err_;                                           \
-            MPIU_Thread_tls_create(MPIUI_Cleanup_tls,&MPIR_ThreadInfo.thread_storage,&initkey_err_); \
-            MPIU_Assert(initkey_err_ == 0);                             \
+        if (is_threaded) {                                              \
+            MPIU_Thread_tls_create(MPIUI_Cleanup_tls,&MPIR_ThreadInfo.thread_storage,initkey_err_ptr_); \
         }                                                               \
     } while (0)
 
-#define MPIU_THREADPRIV_INIT                                            \
+#define MPIU_THREADPRIV_INIT(is_threaded, init_err_ptr_)                \
     do {                                                                \
-        if (MPIR_ThreadInfo.isThreaded) {                               \
-            int init_err_;                                              \
+        if (is_threaded) {                                              \
             MPIUI_Thread_ptr = (MPIUI_Per_thread_t *) MPIU_Calloc(1, sizeof(MPIUI_Per_thread_t)); \
-            MPIU_Assert(MPIUI_Thread_ptr);                               \
-            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage, (void *)MPIUI_Thread_ptr, &init_err_); \
-            MPIU_Assert(init_err_ == 0);                                \
+            if (unlikely(MPIUI_Thread_ptr == NULL)) {                   \
+                *((int *) init_err_ptr_) = MPIU_THREAD_ERROR;           \
+                break;                                                  \
+            }                                                           \
+            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage, (void *)MPIUI_Thread_ptr, init_err_ptr_); \
         }                                                               \
     } while (0)
 
-#define MPIU_THREADPRIV_GET                                             \
+#define MPIU_THREADPRIV_GET(is_threaded, get_err_ptr_)                  \
     do {                                                                \
-        if (!MPIUI_Thread_ptr) {                                         \
-            if (MPIR_ThreadInfo.isThreaded) {                           \
-                int get_err_;                                           \
-                MPIU_Thread_tls_get(&MPIR_ThreadInfo.thread_storage, (void **) &MPIUI_Thread_ptr, &get_err_); \
-                MPIU_Assert(get_err_ == 0);                             \
-                if (!MPIUI_Thread_ptr) {                                 \
-                    MPIU_THREADPRIV_INIT; /* subtle, sets MPIUI_Thread_ptr */ \
+        if (!MPIUI_Thread_ptr) {                                        \
+            if (is_threaded) {                                          \
+                MPIU_Thread_tls_get(&MPIR_ThreadInfo.thread_storage, (void **) &MPIUI_Thread_ptr, get_err_ptr_); \
+                if (unlikely(*((int *) get_err_ptr_)))                  \
+                    break;                                              \
+                if (!MPIUI_Thread_ptr) {                                \
+                    MPIU_THREADPRIV_INIT(is_threaded, get_err_ptr_); /* subtle, sets MPIUI_Thread_ptr */ \
                 }                                                       \
             }                                                           \
             else {                                                      \
-                MPIUI_Thread_ptr = &MPIUI_ThreadSingle;                   \
+                MPIUI_Thread_ptr = &MPIUI_ThreadSingle;                 \
+            }                                                           \
+                                                                        \
+            if (unlikely(MPIUI_Thread_ptr == NULL)) {                   \
+                *((int *) get_err_ptr_) = MPIU_THREAD_ERROR;            \
+                break;                                                  \
             }                                                           \
-            MPIU_Assert(MPIUI_Thread_ptr);                               \
         }                                                               \
     } while (0)
 
 /* common definitions when using MPIU_Thread-based TLS */
 #define MPIU_THREADPRIV_DECL MPIUI_Per_thread_t *MPIUI_Thread_ptr = NULL
 #define MPIU_THREADPRIV_FIELD(a_) (MPIUI_Thread_ptr->a_)
-#define MPIU_THREADPRIV_FINALIZE                                        \
+#define MPIU_THREADPRIV_FINALIZE(is_threaded, finalize_err_ptr_)        \
     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(MPIUI_Thread_ptr);                                 \
-            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage,NULL, &tpf_err_); \
-            MPIU_Assert(tpf_err_ == 0);                                 \
-            MPIU_Thread_tls_destroy(&MPIR_ThreadInfo.thread_storage,&tpf_err_); \
-            MPIU_Assert(tpf_err_ == 0);                                 \
+        if (is_threaded) {                                              \
+            MPIU_THREADPRIV_GET(is_threaded, finalize_err_ptr_);        \
+            MPIU_Free(MPIUI_Thread_ptr);                                \
+            MPIU_Thread_tls_set(&MPIR_ThreadInfo.thread_storage,NULL,finalize_err_ptr_); \
+            if (unlikely(*((int *) finalize_err_ptr_)))                 \
+                break;                                                  \
+            MPIU_Thread_tls_destroy(&MPIR_ThreadInfo.thread_storage,finalize_err_ptr_); \
+            if (unlikely(*((int *) finalize_err_ptr_)))                 \
+                break;                                                  \
         }                                                               \
-        } while (0)
+    } while (0)
 
 #else /* defined(MPICH_TLS_SPECIFIER) */
 
@@ -105,12 +109,12 @@ extern MPIUI_Per_thread_t MPIUI_ThreadSingle;
  * should yield the best performance and simplest code, so we'll use that. */
 extern MPICH_TLS_SPECIFIER MPIUI_Per_thread_t MPIUI_Thread;
 
-#define MPIU_THREADPRIV_INITKEY
-#define MPIU_THREADPRIV_INIT
+#define MPIU_THREADPRIV_INITKEY(...)
+#define MPIU_THREADPRIV_INIT(...)
 #define MPIU_THREADPRIV_DECL
-#define MPIU_THREADPRIV_GET
+#define MPIU_THREADPRIV_GET(...)
 #define MPIU_THREADPRIV_FIELD(a_) (MPIUI_Thread.a_)
-#define MPIU_THREADPRIV_FINALIZE do {} while (0)
+#define MPIU_THREADPRIV_FINALIZE(...) do {} while (0)
 
 #endif /* defined(MPICH_TLS_SPECIFIER) */
 
diff --git a/src/util/thread/mpiu_thread_solaris.h b/src/util/thread/mpiu_thread_solaris.h
index e723c91..191e470 100644
--- a/src/util/thread/mpiu_thread_solaris.h
+++ b/src/util/thread/mpiu_thread_solaris.h
@@ -36,12 +36,11 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(same_ptr_) = (*(id1_ptr_) == *(id2_ptr_)) ? TRUE : FALSE;     \
     } while (0)
 
-#define MPIU_Thread_yield(mutex_ptr_)                   \
+#define MPIU_Thread_yield(mutex_ptr_, err_ptr_)         \
     do {                                                \
-        int err;                                        \
-        MPIU_Thread_mutex_unlock(mutex_ptr_, &err);     \
+        MPIU_Thread_mutex_unlock(mutex_ptr_, err_ptr_); \
         thr_yield();                                    \
-        MPIU_Thread_mutex_lock(mutex_ptr_, &err);       \
+        MPIU_Thread_mutex_lock(mutex_ptr_, err_ptr_);   \
     } while (0)
 
 
diff --git a/src/util/thread/mpiu_thread_win.c b/src/util/thread/mpiu_thread_win.c
index bcf1891..b943810 100644
--- a/src/util/thread/mpiu_thread_win.c
+++ b/src/util/thread/mpiu_thread_win.c
@@ -102,13 +102,11 @@ void MPIU_Thread_same(MPIU_Thread_id_t * id1, MPIU_Thread_id_t * id2, int *same)
     *same = (*id1 == *id2) ? TRUE : FALSE;
 }
 
-void MPIU_Thread_yield(MPIU_Thread_mutex_t * mutex)
+void MPIU_Thread_yield(MPIU_Thread_mutex_t * mutex, int *err)
 {
-    int err;
-
-    MPIU_Thread_mutex_unlock(mutex, &err);
+    MPIU_Thread_mutex_unlock(mutex, err);
     Sleep(0);
-    MPIU_Thread_mutex_lock(mutex, &err);
+    MPIU_Thread_mutex_lock(mutex, err);
 }
 
 /*
diff --git a/src/util/thread/mpiu_thread_win.h b/src/util/thread/mpiu_thread_win.h
index 6ec0003..3185e6c 100644
--- a/src/util/thread/mpiu_thread_win.h
+++ b/src/util/thread/mpiu_thread_win.h
@@ -32,7 +32,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
 void MPIU_Thread_exit(void);
 void MPIU_Thread_self(MPIU_Thread_id_t * id);
 void MPIU_Thread_same(MPIU_Thread_id_t * id1, MPIU_Thread_id_t * id2, int *same);
-void MPIU_Thread_yield(void);
+void MPIU_Thread_yield(MPIU_Thread_mutex_t * mutex, int *err);
 
 void MPIU_Thread_mutex_create(MPIU_Thread_mutex_t * mutex, int *err);
 void MPIU_Thread_mutex_destroy(MPIU_Thread_mutex_t * mutex, int *err);

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

commit cbe60c0176ad8f6d4cce9844002f6b436177de3a
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 20 17:36:19 2016 -0600

    threads: make thread begin/end usage consistent.
    
    In some cases we were ending the thread begin/end checks with a
    semi-colon and in some cases we were not.  This patch makes such usage
    consistent throughout the code.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpi/errhan/errutil.c b/src/mpi/errhan/errutil.c
index 1bf51e9..177fb6b 100644
--- a/src/mpi/errhan/errutil.c
+++ b/src/mpi/errhan/errutil.c
@@ -840,18 +840,18 @@ static MPID_Thread_mutex_t error_ring_mutex;
     do {                                                 \
         int err;                                         \
         if (did_err_init) {                              \
-            MPIR_THREAD_CHECK_BEGIN                      \
+            MPIR_THREAD_CHECK_BEGIN;                        \
             MPID_Thread_mutex_lock(&error_ring_mutex,&err); \
-            MPIR_THREAD_CHECK_END                        \
+            MPIR_THREAD_CHECK_END;                          \
         }                                                \
     } while (0)
 #define error_ring_mutex_unlock()                        \
     do {                                                 \
         int err;                                         \
         if (did_err_init) {                              \
-            MPIR_THREAD_CHECK_BEGIN                      \
+            MPIR_THREAD_CHECK_BEGIN;                          \
             MPID_Thread_mutex_unlock(&error_ring_mutex,&err); \
-            MPIR_THREAD_CHECK_END                        \
+            MPIR_THREAD_CHECK_END;                            \
         }                                                \
     } while (0)
 #else
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
index b4c0962..7c15b97 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
@@ -947,7 +947,7 @@ int MPIDI_CH3I_Progress_init(void)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_INIT);
 
-    MPIR_THREAD_CHECK_BEGIN
+    MPIR_THREAD_CHECK_BEGIN;
     /* FIXME should be appropriately abstracted somehow */
 #   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL)
     {
@@ -956,7 +956,7 @@ int MPIDI_CH3I_Progress_init(void)
         MPIU_Assert(err == 0);
     }
 #   endif
-    MPIR_THREAD_CHECK_END
+    MPIR_THREAD_CHECK_END;
 
     MPIDI_CH3I_shm_sendq.head = NULL;
     MPIDI_CH3I_shm_sendq.tail = NULL;
diff --git a/src/mpid/ch3/channels/sock/src/ch3_progress.c b/src/mpid/ch3/channels/sock/src/ch3_progress.c
index 04520b3..be8f228 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_progress.c
@@ -165,7 +165,7 @@ static int MPIDI_CH3i_Progress_wait(MPID_Progress_state * progress_state)
 #   endif
 	
 #   ifdef MPICH_IS_THREADED
-    MPIR_THREAD_CHECK_BEGIN
+    MPIR_THREAD_CHECK_BEGIN;
     {
 	if (MPIDI_CH3I_progress_blocked == TRUE) 
 	{
@@ -185,7 +185,7 @@ static int MPIDI_CH3i_Progress_wait(MPID_Progress_state * progress_state)
 	    goto fn_exit;
 	}
     }
-    MPIR_THREAD_CHECK_END
+    MPIR_THREAD_CHECK_END;
 #   endif
     
     do
@@ -313,7 +313,7 @@ int MPIDI_CH3I_Progress_init(void)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_INIT);
 
-    MPIR_THREAD_CHECK_BEGIN
+    MPIR_THREAD_CHECK_BEGIN;
     /* FIXME should be appropriately abstracted somehow */
 #   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL)
     {
@@ -322,7 +322,7 @@ int MPIDI_CH3I_Progress_init(void)
         MPIU_Assert(err == 0);
     }
 #   endif
-    MPIR_THREAD_CHECK_END
+    MPIR_THREAD_CHECK_END;
 	
     mpi_errno = MPIDU_Sock_init();
     if (mpi_errno != MPI_SUCCESS) {
@@ -397,7 +397,7 @@ int MPIDI_CH3I_Progress_finalize(void)
     MPIDU_Sock_destroy_set(MPIDI_CH3I_sock_set);
     MPIDU_Sock_finalize();
 
-    MPIR_THREAD_CHECK_BEGIN
+    MPIR_THREAD_CHECK_BEGIN;
     /* FIXME should be appropriately abstracted somehow */
 #   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL)
     {
@@ -406,7 +406,7 @@ int MPIDI_CH3I_Progress_finalize(void)
         MPIU_Assert(err == 0);
     }
 #   endif
-    MPIR_THREAD_CHECK_END
+    MPIR_THREAD_CHECK_END;
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_FINALIZE);
@@ -760,14 +760,14 @@ static int MPIDI_CH3I_Progress_continue(unsigned int completion_count)
 {
     int mpi_errno = MPI_SUCCESS,err;
 
-    MPIR_THREAD_CHECK_BEGIN
+    MPIR_THREAD_CHECK_BEGIN;
     /* FIXME should be appropriately abstracted somehow */
 #   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL)
     {
         MPID_Thread_cond_broadcast(&MPIDI_CH3I_progress_completion_cond,&err);
     }
 #   endif
-    MPIR_THREAD_CHECK_END
+    MPIR_THREAD_CHECK_END;
 
     return mpi_errno;
 }

http://git.mpich.org/mpich.git/commitdiff/14348c29ec91b3ce7517de300832d2dca85f063d

commit 14348c29ec91b3ce7517de300832d2dca85f063d
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 6 12:15:20 2016 -0600

    threads: separate code into MPIU/MPIDU/MPIR.
    
    We were combining portability code (between different threading
    implementations) and convenience macros into the MPIU layer.  This is
    unnecessary.  If we move the convenience macros to the MPIR and MPIDU
    layers, the portability functionality is minimal facilitating easier
    porting to newer platforms.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index c1e19b1..cec5d26 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -553,6 +553,14 @@ extern MPID_Info MPID_Info_builtin[MPID_INFO_N_BUILTIN];
 extern MPID_Info MPID_Info_direct[];
 /* ------------------------------------------------------------------------- */
 
+#if defined(MPICH_IS_THREADED)
+#define MPIR_THREAD_CHECK_BEGIN if (MPIR_ThreadInfo.isThreaded) {
+#define MPIR_THREAD_CHECK_END   }
+#else
+#define MPIR_THREAD_CHECK_BEGIN
+#define MPIR_THREAD_CHECK_END
+#endif /* MPICH_IS_THREADED */
+
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL || \
     MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
 extern MPID_Thread_mutex_t MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX;
diff --git a/src/mpi/errhan/errutil.c b/src/mpi/errhan/errutil.c
index 88c307b..1bf51e9 100644
--- a/src/mpi/errhan/errutil.c
+++ b/src/mpi/errhan/errutil.c
@@ -840,18 +840,18 @@ static MPID_Thread_mutex_t error_ring_mutex;
     do {                                                 \
         int err;                                         \
         if (did_err_init) {                              \
-            MPID_THREAD_CHECK_BEGIN                      \
+            MPIR_THREAD_CHECK_BEGIN                      \
             MPID_Thread_mutex_lock(&error_ring_mutex,&err); \
-            MPID_THREAD_CHECK_END                        \
+            MPIR_THREAD_CHECK_END                        \
         }                                                \
     } while (0)
 #define error_ring_mutex_unlock()                        \
     do {                                                 \
         int err;                                         \
         if (did_err_init) {                              \
-            MPID_THREAD_CHECK_BEGIN                      \
+            MPIR_THREAD_CHECK_BEGIN                      \
             MPID_Thread_mutex_unlock(&error_ring_mutex,&err); \
-            MPID_THREAD_CHECK_END                        \
+            MPIR_THREAD_CHECK_END                        \
         }                                                \
     } while (0)
 #else
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
index 85c5c4a..b4c0962 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
@@ -454,7 +454,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
-    MPID_THREAD_CHECK_BEGIN;
+    MPIR_THREAD_CHECK_BEGIN;
     {
         while (MPIDI_CH3I_progress_blocked == TRUE)
         {
@@ -482,7 +482,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
             }
         }
     }
-    MPID_THREAD_CHECK_END;
+    MPIR_THREAD_CHECK_END;
 #endif
 
     do
@@ -615,7 +615,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
         }
 
 #ifdef MPICH_IS_THREADED
-        MPID_THREAD_CHECK_BEGIN;
+        MPIR_THREAD_CHECK_BEGIN;
         {
             if (is_blocking) {
                 MPIDI_CH3I_progress_blocked = TRUE;
@@ -635,7 +635,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
                 MPIDI_CH3I_progress_wakeup_signalled = FALSE;
             }
         }
-        MPID_THREAD_CHECK_END;
+        MPIR_THREAD_CHECK_END;
 #else
         MPIU_Busy_wait();
 #endif
@@ -644,14 +644,14 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
 
     
 #ifdef MPICH_IS_THREADED
-    MPID_THREAD_CHECK_BEGIN;
+    MPIR_THREAD_CHECK_BEGIN;
     {
         if (is_blocking)
         {
             MPIDI_CH3I_Progress_continue(0/*unused*/);
         }
     }
-    MPID_THREAD_CHECK_END;
+    MPIR_THREAD_CHECK_END;
 #endif
 
  fn_exit:
@@ -947,7 +947,7 @@ int MPIDI_CH3I_Progress_init(void)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_INIT);
 
-    MPID_THREAD_CHECK_BEGIN
+    MPIR_THREAD_CHECK_BEGIN
     /* FIXME should be appropriately abstracted somehow */
 #   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL)
     {
@@ -956,7 +956,7 @@ int MPIDI_CH3I_Progress_init(void)
         MPIU_Assert(err == 0);
     }
 #   endif
-    MPID_THREAD_CHECK_END
+    MPIR_THREAD_CHECK_END
 
     MPIDI_CH3I_shm_sendq.head = NULL;
     MPIDI_CH3I_shm_sendq.tail = NULL;
diff --git a/src/mpid/ch3/channels/sock/src/ch3_progress.c b/src/mpid/ch3/channels/sock/src/ch3_progress.c
index 866a969..04520b3 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_progress.c
@@ -165,7 +165,7 @@ static int MPIDI_CH3i_Progress_wait(MPID_Progress_state * progress_state)
 #   endif
 	
 #   ifdef MPICH_IS_THREADED
-    MPID_THREAD_CHECK_BEGIN
+    MPIR_THREAD_CHECK_BEGIN
     {
 	if (MPIDI_CH3I_progress_blocked == TRUE) 
 	{
@@ -185,7 +185,7 @@ static int MPIDI_CH3i_Progress_wait(MPID_Progress_state * progress_state)
 	    goto fn_exit;
 	}
     }
-    MPID_THREAD_CHECK_END
+    MPIR_THREAD_CHECK_END
 #   endif
     
     do
@@ -313,7 +313,7 @@ int MPIDI_CH3I_Progress_init(void)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_INIT);
 
-    MPID_THREAD_CHECK_BEGIN
+    MPIR_THREAD_CHECK_BEGIN
     /* FIXME should be appropriately abstracted somehow */
 #   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL)
     {
@@ -322,7 +322,7 @@ int MPIDI_CH3I_Progress_init(void)
         MPIU_Assert(err == 0);
     }
 #   endif
-    MPID_THREAD_CHECK_END
+    MPIR_THREAD_CHECK_END
 	
     mpi_errno = MPIDU_Sock_init();
     if (mpi_errno != MPI_SUCCESS) {
@@ -397,7 +397,7 @@ int MPIDI_CH3I_Progress_finalize(void)
     MPIDU_Sock_destroy_set(MPIDI_CH3I_sock_set);
     MPIDU_Sock_finalize();
 
-    MPID_THREAD_CHECK_BEGIN
+    MPIR_THREAD_CHECK_BEGIN
     /* FIXME should be appropriately abstracted somehow */
 #   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL)
     {
@@ -406,7 +406,7 @@ int MPIDI_CH3I_Progress_finalize(void)
         MPIU_Assert(err == 0);
     }
 #   endif
-    MPID_THREAD_CHECK_END
+    MPIR_THREAD_CHECK_END
 
   fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_FINALIZE);
@@ -760,14 +760,14 @@ static int MPIDI_CH3I_Progress_continue(unsigned int completion_count)
 {
     int mpi_errno = MPI_SUCCESS,err;
 
-    MPID_THREAD_CHECK_BEGIN
+    MPIR_THREAD_CHECK_BEGIN
     /* FIXME should be appropriately abstracted somehow */
 #   if defined(MPICH_IS_THREADED) && (MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL)
     {
         MPID_Thread_cond_broadcast(&MPIDI_CH3I_progress_completion_cond,&err);
     }
 #   endif
-    MPID_THREAD_CHECK_END
+    MPIR_THREAD_CHECK_END
 
     return mpi_errno;
 }
diff --git a/src/mpid/ch3/include/mpid_thread.h b/src/mpid/ch3/include/mpid_thread.h
index 012f8ed..375efe0 100644
--- a/src/mpid/ch3/include/mpid_thread.h
+++ b/src/mpid/ch3/include/mpid_thread.h
@@ -23,9 +23,6 @@ typedef MPIDU_Thread_func_t  MPID_Thread_func_t;
 #define MPID_THREAD_CS_EXIT        MPIDU_THREAD_CS_EXIT
 #define MPID_THREAD_CS_YIELD       MPIDU_THREAD_CS_YIELD
 
-#define MPID_THREAD_CHECK_BEGIN    MPIDU_THREAD_CHECK_BEGIN
-#define MPID_THREAD_CHECK_END      MPIDU_THREAD_CHECK_END
-
 #define MPID_Thread_create       MPIDU_Thread_create
 #define MPID_Thread_exit         MPIDU_Thread_exit
 #define MPID_Thread_self         MPIDU_Thread_self
diff --git a/src/mpid/common/sock/iocp/sock.c b/src/mpid/common/sock/iocp/sock.c
index 66cba6e..d699481 100644
--- a/src/mpid/common/sock/iocp/sock.c
+++ b/src/mpid/common/sock/iocp/sock.c
@@ -1785,9 +1785,9 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
             int err;
 	    /* Release the lock so that other threads may make progress while this thread waits for something to do */
 	    MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Exit global critical section");
-	    MPIU_THREAD_CHECK_BEGIN;
+	    MPIR_THREAD_CHECK_BEGIN;
 	    MPID_Thread_mutex_unlock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
-	    MPIU_THREAD_CHECK_END;
+	    MPIR_THREAD_CHECK_END;
 	}
 #       else
 #           error selected multi-threaded implementation is not supported
@@ -1810,9 +1810,9 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
                 int err;
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
 		MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Enter global critical section");
-		MPIU_THREAD_CHECK_BEGIN;
+		MPIR_THREAD_CHECK_BEGIN;
 		MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
-		MPIU_THREAD_CHECK_END;
+		MPIR_THREAD_CHECK_END;
 	    }
 #           else
 #               error selected multi-threaded implementation is not supported
@@ -2403,9 +2403,9 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
                 int err;
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
 		MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Enter global critical section");
-		MPIU_THREAD_CHECK_BEGIN;
+		MPIR_THREAD_CHECK_BEGIN;
 		MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
-		MPIU_THREAD_CHECK_END;
+		MPIR_THREAD_CHECK_END;
 	    }
 #           else
 #               error selected multi-threaded implementation is not supported
diff --git a/src/mpid/common/sock/poll/sock_immed.i b/src/mpid/common/sock/poll/sock_immed.i
index 2a17dd5..b0f183f 100644
--- a/src/mpid/common/sock/poll/sock_immed.i
+++ b/src/mpid/common/sock/poll/sock_immed.i
@@ -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;
+    MPIR_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;
+    MPIR_THREAD_CHECK_END;
 #   endif
 
 #ifdef MPICH_IS_THREADED
diff --git a/src/mpid/common/sock/poll/sock_set.i b/src/mpid/common/sock/poll/sock_set.i
index 72e80f6..ad101d4 100644
--- a/src/mpid/common/sock/poll/sock_set.i
+++ b/src/mpid/common/sock/poll/sock_set.i
@@ -55,7 +55,7 @@ int MPIDU_Sock_create_set(struct MPIDU_Sock_set ** sock_setp)
 #   endif
 
 #   ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN;
+    MPIR_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;
+    MPIR_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;
+	MPIR_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;
+	MPIR_THREAD_CHECK_END;
 #	endif
 	
 	MPIU_Free(sock_set);
@@ -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;
+    MPIR_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;
+    MPIR_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 2b82799..5583d97 100644
--- a/src/mpid/common/sock/poll/sock_wait.i
+++ b/src/mpid/common/sock/poll/sock_wait.i
@@ -117,7 +117,7 @@ int MPIDU_Sock_wait(struct MPIDU_Sock_set * sock_set, int millisecond_timeout,
 		 then test for that and if we are *not* multithreaded, 
 		 just use the same code as above.  Otherwise, use 
 		 multithreaded code (and we don't then need the 
-		 MPIU_THREAD_CHECK_BEGIN/END macros) */
+		 MPIR_THREAD_CHECK_BEGIN/END macros) */
 		if (!MPIR_ThreadInfo.isThreaded) {
 		    MPIDI_FUNC_ENTER(MPID_STATE_POLL);
 		    n_fds = poll(sock_set->pollfds, sock_set->poll_array_elems, 
diff --git a/src/mpid/common/sock/poll/socki_util.i b/src/mpid/common/sock/poll/socki_util.i
index 92d6cda..d52249b 100644
--- a/src/mpid/common/sock/poll/socki_util.i
+++ b/src/mpid/common/sock/poll/socki_util.i
@@ -361,7 +361,7 @@ static struct MPIDU_Socki_eventq_table *MPIDU_Socki_eventq_table_head=NULL;
 #define FCNAME MPL_QUOTE(FUNCNAME)
 static int MPIDU_Socki_wakeup(struct MPIDU_Sock_set * sock_set)
 {
-    MPIU_THREAD_CHECK_BEGIN;
+    MPIR_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;
+    MPIR_THREAD_CHECK_END;
     return MPIDU_SOCK_SUCCESS;
 }
 /* end MPIDU_Socki_wakeup() */
@@ -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;
+        MPIR_THREAD_CHECK_BEGIN;
 	if (sock_set->pollfds_active != NULL)
 	{
 	    sock_set->pollfds_updated = TRUE;
 	}
-        MPIU_THREAD_CHECK_END;
+        MPIR_THREAD_CHECK_END;
     }
 #   endif
     
diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index c9db086..04f2fd8 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -71,7 +71,50 @@ typedef MPIU_Thread_func_t  MPIDU_Thread_func_t;
 - _context - A context (typically an object) of the critical section
 
 M*/
-#define MPIDU_THREAD_CS_ENTER       MPIU_THREAD_CS_ENTER
+#define MPIDU_THREAD_CS_ENTER(name, mutex) MPIDUI_THREAD_CS_ENTER_##name(mutex)
+
+#if defined(MPICH_IS_THREADED)
+
+#if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL
+
+#define MPIDUI_THREAD_CS_ENTER_GLOBAL(mutex)                            \
+    do {                                                                \
+        if (MPIR_ThreadInfo.isThreaded) {                               \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive locking GLOBAL mutex"); \
+            MPIU_THREAD_CS_ENTER_RECURSIVE(mutex);                      \
+        }                                                               \
+    } while (0)
+#define MPIDUI_THREAD_CS_ENTER_ALLGRAN(mutex)                           \
+    do {                                                                \
+        if (MPIR_ThreadInfo.isThreaded) {                               \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking ALLGRAN mutex"); \
+            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex);                   \
+        }                                                               \
+    } while (0)
+#define MPIDUI_THREAD_CS_ENTER_POBJ(mutex) do {} while (0)
+
+#else /* MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_POBJ */
+
+#define MPIDUI_THREAD_CS_ENTER_POBJ(mutex)                              \
+    do {                                                                \
+        if (MPIR_ThreadInfo.isThreaded) {                               \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive locking POBJ mutex"); \
+            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex);                   \
+        }                                                               \
+    } while (0)
+#define MPIDUI_THREAD_CS_ENTER_ALLGRAN  MPIDUI_THREAD_CS_ENTER_POBJ
+#define MPIDUI_THREAD_CS_ENTER_GLOBAL(mutex) do {} while (0)
+
+#endif  /* MPICH_THREAD_GRANULARITY */
+
+#else  /* !defined(MPICH_IS_THREADED) */
+
+#define MPIDUI_THREAD_CS_ENTER_GLOBAL(mutex) do {} while (0)
+#define MPIDUI_THREAD_CS_ENTER_ALLGRAN(mutex) do {} while (0)
+#define MPIDUI_THREAD_CS_ENTER_POBJ(mutex) do {} while (0)
+
+#endif /* MPICH_IS_THREADED */
+
 
 /*M MPIDU_THREAD_CS_EXIT - Exit a named critical section
 
@@ -80,7 +123,50 @@ M*/
 - _context - A context (typically an object) of the critical section
 
 M*/
-#define MPIDU_THREAD_CS_EXIT        MPIU_THREAD_CS_EXIT
+#define MPIDU_THREAD_CS_EXIT(name, mutex) MPIDUI_THREAD_CS_EXIT_##name(mutex)
+
+#if defined(MPICH_IS_THREADED)
+
+#if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL
+
+#define MPIDUI_THREAD_CS_EXIT_GLOBAL(mutex)                             \
+    do {                                                                \
+        if (MPIR_ThreadInfo.isThreaded) {                               \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive unlocking GLOBAL mutex"); \
+            MPIU_THREAD_CS_EXIT_RECURSIVE(mutex);                       \
+        }                                                               \
+    } while (0)
+#define MPIDUI_THREAD_CS_EXIT_ALLGRAN(mutex)                            \
+    do {                                                                \
+        if (MPIR_ThreadInfo.isThreaded) {                               \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking ALLGRAN mutex"); \
+            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex);                    \
+        }                                                               \
+    } while (0)
+#define MPIDUI_THREAD_CS_EXIT_POBJ(mutex) do {} while (0)
+
+#else /* MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_POBJ */
+
+#define MPIDUI_THREAD_CS_EXIT_POBJ(mutex)                               \
+    do {                                                                \
+        if (MPIR_ThreadInfo.isThreaded) {                               \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive unlocking POBJ mutex"); \
+            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex);                    \
+        }                                                               \
+    } while (0)
+#define MPIDUI_THREAD_CS_EXIT_ALLGRAN  MPIDUI_THREAD_CS_EXIT_POBJ
+#define MPIDUI_THREAD_CS_EXIT_GLOBAL(mutex) do {} while (0)
+
+#endif  /* MPICH_THREAD_GRANULARITY */
+
+#else  /* !defined(MPICH_IS_THREADED) */
+
+#define MPIDUI_THREAD_CS_EXIT_GLOBAL(mutex) do {} while (0)
+#define MPIDUI_THREAD_CS_EXIT_ALLGRAN(mutex) do {} while (0)
+#define MPIDUI_THREAD_CS_EXIT_POBJ(mutex) do {} while (0)
+
+#endif /* MPICH_IS_THREADED */
+
 
 /*M MPIDU_THREAD_CS_YIELD - Temporarily release a critical section and yield
     to other threads
@@ -90,10 +176,52 @@ M*/
 - _context - A context (typically an object) of the critical section
 
   M*/
-#define MPIDU_THREAD_CS_YIELD       MPIU_THREAD_CS_YIELD
+#define MPIDU_THREAD_CS_YIELD(name, mutex) MPIDUI_THREAD_CS_YIELD_##name(mutex)
+
+#if defined(MPICH_IS_THREADED)
+
+#if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL
+
+#define MPIDUI_THREAD_CS_YIELD_GLOBAL(mutex)                            \
+    do {                                                                \
+        if (MPIR_ThreadInfo.isThreaded) {                               \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "recursive yielding GLOBAL mutex"); \
+            MPIU_THREAD_CS_YIELD_RECURSIVE(mutex);                      \
+        }                                                               \
+    } while (0)
+#define MPIDUI_THREAD_CS_YIELD_ALLGRAN(mutex)                           \
+    do {                                                                \
+        if (MPIR_ThreadInfo.isThreaded) {                               \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding ALLGRAN mutex"); \
+            MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex);                   \
+        }                                                               \
+    } while (0)
+#define MPIDUI_THREAD_CS_YIELD_POBJ(mutex) do {} while (0)
+
+#else /* MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_POBJ */
+
+#define MPIDUI_THREAD_CS_YIELD_POBJ(mutex)                              \
+    do {                                                                \
+        if (MPIR_ThreadInfo.isThreaded) {                               \
+            MPIU_DBG_MSG(MPIR_DBG_THREAD, TYPICAL, "non-recursive yielding POBJ mutex"); \
+            MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex);                   \
+        }                                                               \
+    } while (0)
+#define MPIDUI_THREAD_CS_YIELD_ALLGRAN  MPIDUI_THREAD_CS_YIELD_POBJ
+#define MPIDUI_THREAD_CS_YIELD_GLOBAL(mutex) do {} while (0)
+
+#endif  /* MPICH_THREAD_GRANULARITY */
+
+#else  /* !defined(MPICH_IS_THREADED) */
+
+#define MPIDUI_THREAD_CS_YIELD_GLOBAL(mutex) do {} while (0)
+#define MPIDUI_THREAD_CS_YIELD_ALLGRAN(mutex) do {} while (0)
+#define MPIDUI_THREAD_CS_YIELD_POBJ(mutex) do {} while (0)
+
+#endif /* MPICH_IS_THREADED */
+
+
 
-#define MPIDU_THREAD_CHECK_BEGIN    MPIU_THREAD_CHECK_BEGIN
-#define MPIDU_THREAD_CHECK_END      MPIU_THREAD_CHECK_END
 
 /*@
   MPIDU_Thread_create - create a new thread
diff --git a/src/pmi/pmi2/simple/simple2pmi.c b/src/pmi/pmi2/simple/simple2pmi.c
index b5320a3..fb18b24 100644
--- a/src/pmi/pmi2/simple/simple2pmi.c
+++ b/src/pmi/pmi2/simple/simple2pmi.c
@@ -288,11 +288,11 @@ int PMI2_Init(int *spawned, int *size, int *rank, int *appnum)
         }
 
 #ifdef MPICH_IS_THREADED
-        MPIU_THREAD_CHECK_BEGIN;
+        MPIR_THREAD_CHECK_BEGIN;
         {
             isThreaded = 1;
         }
-        MPIU_THREAD_CHECK_END;
+        MPIR_THREAD_CHECK_END;
 #endif
         init_kv_str(&pairs[npairs], THREADED_KEY, isThreaded ? "TRUE" : "FALSE");
         ++npairs;
@@ -1232,7 +1232,7 @@ int PMIi_ReadCommand( int fd, PMI2_Command *cmd )
     memset(cmd_len_str, 0, sizeof(cmd_len_str));
 
 #ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN;
+    MPIR_THREAD_CHECK_BEGIN;
     {
         MPID_Thread_mutex_lock(&mutex, &err);
 
@@ -1247,7 +1247,7 @@ int PMIi_ReadCommand( int fd, PMI2_Command *cmd )
         blocked = TRUE;
         MPID_Thread_mutex_unlock(&mutex, &err);
     }
-    MPIU_THREAD_CHECK_END;
+    MPIR_THREAD_CHECK_END;
 #endif
 
     do {
@@ -1364,14 +1364,14 @@ int PMIi_ReadCommand( int fd, PMI2_Command *cmd )
     } while (!cmd->complete);
 
 #ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN;
+    MPIR_THREAD_CHECK_BEGIN;
     {
         MPID_Thread_mutex_lock(&mutex, &err);
         blocked = FALSE;
         MPID_Thread_cond_broadcast(&cond,&err);
         MPID_Thread_mutex_unlock(&mutex, &err);
     }
-    MPIU_THREAD_CHECK_END;
+    MPIR_THREAD_CHECK_END;
 #endif
 
 
@@ -1442,14 +1442,14 @@ int PMIi_WriteSimpleCommand( int fd, PMI2_Command *resp, const char cmd[], PMI2_
     remaining_len -= ret;
 
 #ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN;
+    MPIR_THREAD_CHECK_BEGIN;
     if (resp) {
         ret = MPL_snprintf(c, remaining_len, "thrid=%p;", resp);
         PMI2U_ERR_CHKANDJUMP1(ret >= remaining_len, pmi2_errno, PMI2_ERR_OTHER, "**intern", "**intern %s", "Ran out of room for command");
         c += ret;
         remaining_len -= ret;
     }
-    MPIU_THREAD_CHECK_END;
+    MPIR_THREAD_CHECK_END;
 #endif
 
     for (pair_index = 0; pair_index < npairs; ++pair_index) {
@@ -1491,7 +1491,7 @@ int PMIi_WriteSimpleCommand( int fd, PMI2_Command *resp, const char cmd[], PMI2_
 
 
  #ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN;
+    MPIR_THREAD_CHECK_BEGIN;
     {
         MPID_Thread_mutex_lock(&mutex, &err);
 
@@ -1501,7 +1501,7 @@ int PMIi_WriteSimpleCommand( int fd, PMI2_Command *resp, const char cmd[], PMI2_
         blocked = TRUE;
         MPID_Thread_mutex_unlock(&mutex, &err);
     }
-    MPIU_THREAD_CHECK_END;
+    MPIR_THREAD_CHECK_END;
 #endif
 
     if (PMI2_debug)
@@ -1518,14 +1518,14 @@ int PMIi_WriteSimpleCommand( int fd, PMI2_Command *resp, const char cmd[], PMI2_
         offset += nbytes;
     } while (offset < cmdlen + PMII_COMMANDLEN_SIZE);
 #ifdef MPICH_IS_THREADED
-    MPIU_THREAD_CHECK_BEGIN;
+    MPIR_THREAD_CHECK_BEGIN;
     {
         MPID_Thread_mutex_lock(&mutex, &err);
         blocked = FALSE;
         MPID_Thread_cond_broadcast(&cond,&err);
         MPID_Thread_mutex_unlock(&mutex, &err);
     }
-    MPIU_THREAD_CHECK_END;
+    MPIR_THREAD_CHECK_END;
 #endif
 
 fn_exit:
diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index a7f8e78..ca213f1 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -103,13 +103,13 @@ static FILE *get_fp(void)
     int err;
     /* if we're not initialized, use the static fp, since there should
      * only be one thread in here until then */
-    MPIU_THREAD_CHECK_BEGIN;
+    MPIR_THREAD_CHECK_BEGIN;
     if (dbg_initialized == DBG_INITIALIZED) {
         FILE *fp;
         MPID_Thread_tls_get(&dbg_tls_key, (void **) &fp, &err);
         return fp;
     }
-    MPIU_THREAD_CHECK_END;
+    MPIR_THREAD_CHECK_END;
 #endif
 
     return dbg_static_fp;
@@ -121,12 +121,12 @@ static void set_fp(FILE *fp)
     int err;
     /* if we're not initialized, use the static fp, since there should
      * only be one thread in here until then */
-    MPIU_THREAD_CHECK_BEGIN;
+    MPIR_THREAD_CHECK_BEGIN;
     if (dbg_initialized == DBG_INITIALIZED) {
         MPID_Thread_tls_set(&dbg_tls_key, (void *)fp, &err);
         return;
     }
-    MPIU_THREAD_CHECK_END;
+    MPIR_THREAD_CHECK_END;
 #endif
 
     dbg_static_fp = fp;
diff --git a/src/util/thread/Makefile.mk b/src/util/thread/Makefile.mk
index 39d134f..393d468 100644
--- a/src/util/thread/Makefile.mk
+++ b/src/util/thread/Makefile.mk
@@ -11,8 +11,6 @@ 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.h   	\
     src/util/thread/mpiu_thread_solaris.h 	\
diff --git a/src/util/thread/mpiu_thread_global.h b/src/util/thread/mpiu_thread_global.h
deleted file mode 100644
index 1eb9884..0000000
--- a/src/util/thread/mpiu_thread_global.h
+++ /dev/null
@@ -1,25 +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(MPIU_THREAD_GLOBAL_H_INCLUDED)
-#define MPIU_THREAD_GLOBAL_H_INCLUDED
-
-/* GLOBAL locks are all real recursive ops */
-#define MPIUI_THREAD_CS_ENTER_GLOBAL(mutex) MPIUI_THREAD_CS_ENTER_RECURSIVE("GLOBAL", mutex)
-#define MPIUI_THREAD_CS_EXIT_GLOBAL(mutex) MPIUI_THREAD_CS_EXIT_RECURSIVE("GLOBAL", mutex)
-#define MPIUI_THREAD_CS_YIELD_GLOBAL(mutex) MPIUI_THREAD_CS_YIELD_RECURSIVE("GLOBAL", mutex)
-
-/* ALLGRAN locks are all real nonrecursive ops */
-#define MPIUI_THREAD_CS_ENTER_ALLGRAN(mutex) MPIUI_THREAD_CS_ENTER_NONRECURSIVE("ALLGRAN", mutex)
-#define MPIUI_THREAD_CS_EXIT_ALLGRAN(mutex) MPIUI_THREAD_CS_EXIT_NONRECURSIVE("ALLGRAN", mutex)
-#define MPIUI_THREAD_CS_YIELD_ALLGRAN(mutex) MPIUI_THREAD_CS_YIELD_NONRECURSIVE("ALLGRAN", mutex)
-
-/* POBJ locks are all NO-OPs */
-#define MPIUI_THREAD_CS_ENTER_POBJ(mutex) do {} while (0)
-#define MPIUI_THREAD_CS_EXIT_POBJ(mutex) do {} while (0)
-#define MPIUI_THREAD_CS_YIELD_POBJ(mutex) do {} 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
index 468b531..4d33dfd 100644
--- a/src/util/thread/mpiu_thread_multiple.h
+++ b/src/util/thread/mpiu_thread_multiple.h
@@ -9,87 +9,54 @@
 
 #include "mpiu_thread_priv.h"
 
-#define MPIU_THREAD_CHECK_BEGIN if (MPIR_ThreadInfo.isThreaded) {
-#define MPIU_THREAD_CHECK_END   }
-
 /* Nonrecursive mutex macros */
-#define MPIUI_THREAD_CS_ENTER_NONRECURSIVE(lockname, mutex)             \
+#define MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex)                        \
     do {                                                                \
         int err_;                                                       \
-        MPIU_THREAD_CHECK_BEGIN;                                        \
-        MPIU_DBG_MSG_S(MPIR_DBG_THREAD, TYPICAL, "locking %s", lockname);        \
         MPIU_Thread_mutex_lock(&mutex, &err_);                          \
-        MPIU_THREAD_CHECK_END;                                          \
     } while (0)
 
-#define MPIUI_THREAD_CS_EXIT_NONRECURSIVE(lockname, mutex)              \
+#define MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex)                         \
     do {                                                                \
         int err_;                                                       \
-        MPIU_THREAD_CHECK_BEGIN;                                        \
-        MPIU_DBG_MSG_S(MPIR_DBG_THREAD, TYPICAL, "unlocking %s", lockname);      \
         MPIU_Thread_mutex_unlock(&mutex, &err_);                        \
-        MPIU_THREAD_CHECK_END;                                          \
     } while (0)
 
-#define MPIUI_THREAD_CS_YIELD_NONRECURSIVE(lockname, mutex)             \
+#define MPIU_THREAD_CS_YIELD_NONRECURSIVE(mutex)                        \
     do {                                                                \
-        MPIU_THREAD_CHECK_BEGIN;                                        \
-        MPIU_DBG_MSG_S(MPIR_DBG_THREAD, TYPICAL, "yielding %s", lockname);       \
         MPIU_Thread_yield(&mutex);                                      \
-        MPIU_THREAD_CHECK_END;                                          \
     } while (0)
 
 
 /* Recursive mutex macros */
 /* We don't need to protect the depth variable since it is thread
  * private and sequentially accessed within a thread */
-#define MPIUI_THREAD_CS_ENTER_RECURSIVE(lockname, mutex)                \
-    do {                                                                \
-        int depth_;                                                     \
-        MPIU_THREADPRIV_DECL;                                           \
-        MPIU_THREADPRIV_GET;                                            \
-                                                                        \
-        MPIU_THREAD_CHECK_BEGIN;                                        \
-        depth_ = MPIU_THREADPRIV_FIELD(lock_depth);                     \
-        MPIU_DBG_MSG_S(MPIR_DBG_THREAD, TYPICAL, "recursive locking %s", lockname); \
-        if (depth_ == 0) {                                              \
-            MPIUI_THREAD_CS_ENTER_NONRECURSIVE(lockname, mutex);        \
-        }                                                               \
-        MPIU_THREADPRIV_FIELD(lock_depth) += 1;                         \
-        MPIU_THREAD_CHECK_END;                                          \
+#define MPIU_THREAD_CS_ENTER_RECURSIVE(mutex)           \
+    do {                                                \
+        int depth_;                                     \
+        MPIU_THREADPRIV_DECL;                           \
+        MPIU_THREADPRIV_GET;                            \
+                                                        \
+        depth_ = MPIU_THREADPRIV_FIELD(lock_depth);     \
+        if (depth_ == 0) {                              \
+            MPIU_THREAD_CS_ENTER_NONRECURSIVE(mutex);   \
+        }                                               \
+        MPIU_THREADPRIV_FIELD(lock_depth) += 1;         \
     } while (0)
 
-#define MPIUI_THREAD_CS_EXIT_RECURSIVE(lockname, mutex)                 \
-    do {                                                                \
-        int depth_;                                                     \
-        MPIU_THREADPRIV_DECL;                                           \
-        MPIU_THREADPRIV_GET;                                            \
-                                                                        \
-        MPIU_THREAD_CHECK_BEGIN;                                        \
-        depth_ = MPIU_THREADPRIV_FIELD(lock_depth);                     \
-        MPIU_DBG_MSG_S(MPIR_DBG_THREAD, TYPICAL, "recursive unlocking %s", lockname); \
-        if (depth_ == 1) {                                              \
-            MPIUI_THREAD_CS_EXIT_NONRECURSIVE(lockname, mutex);         \
-        }                                                               \
-        MPIU_THREADPRIV_FIELD(lock_depth) -= 1;                         \
-        MPIU_THREAD_CHECK_END;                                          \
+#define MPIU_THREAD_CS_EXIT_RECURSIVE(mutex)            \
+    do {                                                \
+        int depth_;                                     \
+        MPIU_THREADPRIV_DECL;                           \
+        MPIU_THREADPRIV_GET;                            \
+                                                        \
+        depth_ = MPIU_THREADPRIV_FIELD(lock_depth);     \
+        if (depth_ == 1) {                              \
+            MPIU_THREAD_CS_EXIT_NONRECURSIVE(mutex);    \
+        }                                               \
+        MPIU_THREADPRIV_FIELD(lock_depth) -= 1;         \
     } while (0)
 
-#define MPIUI_THREAD_CS_YIELD_RECURSIVE MPIUI_THREAD_CS_YIELD_NONRECURSIVE
-
-#define MPIU_THREAD_CS_ENTER(name, mutex) MPIUI_THREAD_CS_ENTER_##name(mutex)
-#define MPIU_THREAD_CS_EXIT(name, mutex) MPIUI_THREAD_CS_EXIT_##name(mutex)
-#define MPIU_THREAD_CS_YIELD(name, mutex) MPIUI_THREAD_CS_YIELD_##name(mutex)
-
-/* Definitions of the thread support for various levels of thread granularity */
-#if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL
-#include "mpiu_thread_global.h"
-#elif MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
-#include "mpiu_thread_pobj.h"
-#elif MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_LOCK_FREE
-#error lock-free not yet implemented
-#else
-#error Unrecognized thread granularity
-#endif
+#define MPIU_THREAD_CS_YIELD_RECURSIVE MPIU_THREAD_CS_YIELD_NONRECURSIVE
 
 #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
deleted file mode 100644
index 0aa53d7..0000000
--- a/src/util/thread/mpiu_thread_pobj.h
+++ /dev/null
@@ -1,92 +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(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. */
-
-/* POBJ locks are all real recursive ops */
-#define MPIUI_THREAD_CS_ENTER_POBJ(mutex) MPIUI_THREAD_CS_ENTER_NONRECURSIVE("POBJ", mutex)
-#define MPIUI_THREAD_CS_EXIT_POBJ(mutex) MPIUI_THREAD_CS_EXIT_NONRECURSIVE("POBJ", mutex)
-#define MPIUI_THREAD_CS_YIELD_POBJ(mutex) MPIUI_THREAD_CS_YIELD_NONRECURSIVE("POBJ", mutex)
-
-/* ALLGRAN locks are all real nonrecursive ops */
-#define MPIUI_THREAD_CS_ENTER_ALLGRAN(mutex) MPIUI_THREAD_CS_ENTER_NONRECURSIVE("ALLGRAN", mutex)
-#define MPIUI_THREAD_CS_EXIT_ALLGRAN(mutex) MPIUI_THREAD_CS_EXIT_NONRECURSIVE("ALLGRAN", mutex)
-#define MPIUI_THREAD_CS_YIELD_ALLGRAN(mutex) MPIUI_THREAD_CS_YIELD_NONRECURSIVE("ALLGRAN", mutex)
-
-/* GLOBAL locks are all NO-OPs */
-#define MPIUI_THREAD_CS_ENTER_GLOBAL(mutex) do {} while (0)
-#define MPIUI_THREAD_CS_EXIT_GLOBAL(mutex) do {} while (0)
-#define MPIUI_THREAD_CS_YIELD_GLOBAL(mutex) do {} while (0)
-
-#endif /* !defined(MPIU_THREAD_POBJ_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_single.h b/src/util/thread/mpiu_thread_single.h
index 646d483..2801ebf 100644
--- a/src/util/thread/mpiu_thread_single.h
+++ b/src/util/thread/mpiu_thread_single.h
@@ -7,9 +7,6 @@
 #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 MPIUI_Per_thread_t MPIUI_Thread;
@@ -20,9 +17,4 @@ extern MPIUI_Per_thread_t MPIUI_Thread;
 #define MPIU_THREADPRIV_GET
 #define MPIU_THREADPRIV_FIELD(a_) (MPIUI_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)
-
 #endif /* !defined(MPIU_THREAD_SINGLE_H_INCLUDED) */

http://git.mpich.org/mpich.git/commitdiff/28d12fc3eed7527e43888459c5ca5cb67d360102

commit 28d12fc3eed7527e43888459c5ca5cb67d360102
Author: Pavan Balaji <balaji at anl.gov>
Date:   Tue Jan 5 20:18:48 2016 -0600

    threads: move mutexes outside of the thread layer.
    
    The actual mutex variables do not need to be visible to the threads
    layer.  Each layer can allocate the mutex variables that it needs and
    use them.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 1ff948b..c1e19b1 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -553,6 +553,24 @@ extern MPID_Info MPID_Info_builtin[MPID_INFO_N_BUILTIN];
 extern MPID_Info MPID_Info_direct[];
 /* ------------------------------------------------------------------------- */
 
+#if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL || \
+    MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
+extern MPID_Thread_mutex_t MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX;
+extern MPID_Thread_mutex_t MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX;
+#endif
+
+#if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
+extern MPID_Thread_mutex_t MPIR_THREAD_POBJ_HANDLE_MUTEX;
+extern MPID_Thread_mutex_t MPIR_THREAD_POBJ_MSGQ_MUTEX;
+extern MPID_Thread_mutex_t MPIR_THREAD_POBJ_COMPLETION_MUTEX;
+extern MPID_Thread_mutex_t MPIR_THREAD_POBJ_CTX_MUTEX;
+extern MPID_Thread_mutex_t MPIR_THREAD_POBJ_PMI_MUTEX;
+
+#define MPIR_THREAD_POBJ_COMM_MUTEX(_comm_ptr) _comm_ptr->mutex
+#define MPIR_THREAD_POBJ_WIN_MUTEX(_win_ptr)   _win_ptr->mutex
+#endif
+
+
 /* ------------------------------------------------------------------------- */
 /* Error Handlers */
 /*E
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index f32b44a..2d3216b 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -158,6 +158,20 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
 
 #if defined(MPICH_IS_THREADED)
 
+#if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL || \
+    MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
+MPID_Thread_mutex_t MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX;
+MPID_Thread_mutex_t MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX;
+#endif
+
+#if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
+MPID_Thread_mutex_t MPIR_THREAD_POBJ_HANDLE_MUTEX;
+MPID_Thread_mutex_t MPIR_THREAD_POBJ_MSGQ_MUTEX;
+MPID_Thread_mutex_t MPIR_THREAD_POBJ_COMPLETION_MUTEX;
+MPID_Thread_mutex_t MPIR_THREAD_POBJ_CTX_MUTEX;
+MPID_Thread_mutex_t MPIR_THREAD_POBJ_PMI_MUTEX;
+#endif
+
 /* These routine handle any thread initialization that my be required */
 #undef FUNCNAME
 #define FUNCNAME thread_cs_init
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index e837d34..e1d2d8c 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -72,34 +72,9 @@ typedef struct {
     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 == MPICH_THREAD_GRANULARITY_GLOBAL || \
-    MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
-    MPIU_Thread_mutex_t global_mutex;
-    MPIU_Thread_mutex_t memalloc_mutex; /* for MPIU_{Malloc,Free,Calloc} */
-#endif
-
-#if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
-    MPIU_Thread_mutex_t handle_mutex;
-    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
 } MPIR_Thread_info_t;
 extern MPIR_Thread_info_t MPIR_ThreadInfo;
 
-#define MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX      MPIR_ThreadInfo.global_mutex
-#define MPIR_THREAD_POBJ_HANDLE_MUTEX         MPIR_ThreadInfo.handle_mutex
-#define MPIR_THREAD_POBJ_MSGQ_MUTEX           MPIR_ThreadInfo.msgq_mutex
-#define MPIR_THREAD_POBJ_COMPLETION_MUTEX     MPIR_ThreadInfo.completion_mutex
-#define MPIR_THREAD_POBJ_CTX_MUTEX            MPIR_ThreadInfo.ctx_mutex
-#define MPIR_THREAD_POBJ_PMI_MUTEX            MPIR_ThreadInfo.pmi_mutex
-#define MPIR_THREAD_ALLGRAN_MEMALLOC_MUTEX    MPIR_ThreadInfo.memalloc_mutex
-#define MPIR_THREAD_POBJ_COMM_MUTEX(_comm_ptr) _comm_ptr->mutex
-#define MPIR_THREAD_POBJ_WIN_MUTEX(_win_ptr)   _win_ptr->mutex
-
 /* ------------------------------------------------------------------------- */
 /* thread-local storage macros */
 /* moved here from mpiimpl.h because they logically belong here */

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

commit d8f5696ace1c6a94ab293f7ddcc82f6e146b8518
Author: Pavan Balaji <balaji at anl.gov>
Date:   Tue Jan 5 18:58:09 2016 -0600

    threads: separate refcount code from threads.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 4f5877e..1ff948b 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -68,6 +68,7 @@ int usleep(useconds_t usec);
 #include "mpi.h"
 #include "mpiutil.h"
 #include "mpidpre.h"
+#include "mpir_refcount.h"
 
 #if defined(HAVE_LONG_LONG_INT)
 /* tt#1776: some platforms have "long long" but not a LLONG_MAX/ULLONG_MAX,
@@ -1428,7 +1429,7 @@ struct MPID_Grequest_fns {
                                                        the generalize req */
 };
 
-#define MPID_Request_is_complete(req_) (MPID_cc_is_complete((req_)->cc_ptr))
+#define MPID_Request_is_complete(req_) (MPIR_cc_is_complete((req_)->cc_ptr))
 
 /*S
   MPID_Request - Description of the Request data structure
@@ -1451,13 +1452,13 @@ typedef struct MPID_Request {
     /* pointer to the completion counter */
     /* This is necessary for the case when an operation is described by a 
        list of requests */
-    MPID_cc_t *cc_ptr;
+    MPIR_cc_t *cc_ptr;
     /* A comm is needed to find the proper error handler */
     MPID_Comm *comm;
     /* completion counter.  Ensure cc and status are in the same cache
        line, assuming the cache line size is a multiple of 32 bytes
        and 32-bit integers */
-    MPID_cc_t cc;
+    MPIR_cc_t cc;
     /* Status is needed for wait/test/recv */
     MPI_Status status;
     /* Persistent requests have their own "real" requests.  Receive requests
diff --git a/src/mpi/attr/comm_create_keyval.c b/src/mpi/attr/comm_create_keyval.c
index 01b18aa..81a7e67 100644
--- a/src/mpi/attr/comm_create_keyval.c
+++ b/src/mpi/attr/comm_create_keyval.c
@@ -70,7 +70,7 @@ int MPIR_Comm_create_keyval_impl(MPI_Comm_copy_attr_function *comm_copy_attr_fn,
     keyval_ptr->delfn.user_function = comm_delete_attr_fn;
     keyval_ptr->delfn.proxy = MPIR_Attr_delete_c_proxy;
 
-    MPID_OBJ_PUBLISH_HANDLE(*comm_keyval, keyval_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*comm_keyval, keyval_ptr->handle);
 
  fn_exit:
     return mpi_errno;
diff --git a/src/mpi/attr/type_create_keyval.c b/src/mpi/attr/type_create_keyval.c
index f9436cb..a321a20 100644
--- a/src/mpi/attr/type_create_keyval.c
+++ b/src/mpi/attr/type_create_keyval.c
@@ -122,7 +122,7 @@ int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn,
     /* Tell finalize to check for attributes on permenant types */
     MPIR_DatatypeAttrFinalize();
     
-    MPID_OBJ_PUBLISH_HANDLE(*type_keyval, keyval_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*type_keyval, keyval_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/attr/win_create_keyval.c b/src/mpi/attr/win_create_keyval.c
index 433869a..4c3d6aa 100644
--- a/src/mpi/attr/win_create_keyval.c
+++ b/src/mpi/attr/win_create_keyval.c
@@ -119,7 +119,7 @@ int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn,
     keyval_ptr->delfn.user_function = win_delete_attr_fn;
     keyval_ptr->delfn.proxy = MPIR_Attr_delete_c_proxy;
     
-    MPID_OBJ_PUBLISH_HANDLE(*win_keyval, keyval_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*win_keyval, keyval_ptr->handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/coll/op_create.c b/src/mpi/coll/op_create.c
index 416fc7a..5b75650 100644
--- a/src/mpi/coll/op_create.c
+++ b/src/mpi/coll/op_create.c
@@ -129,7 +129,7 @@ int MPI_Op_create(MPI_User_function *user_fn, int commute, MPI_Op *op)
 				   const int *, const MPI_Datatype *))user_fn;
     MPIU_Object_set_ref(op_ptr,1);
 
-    MPID_OBJ_PUBLISH_HANDLE(*op, op_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*op, op_ptr->handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/comm/comm_create.c b/src/mpi/comm/comm_create.c
index 02f8de9..9878bea 100644
--- a/src/mpi/comm/comm_create.c
+++ b/src/mpi/comm/comm_create.c
@@ -546,7 +546,7 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm)
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
     if (newcomm_ptr)
-        MPID_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
+        MPIR_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     else
         *newcomm = MPI_COMM_NULL;
     /* ... end of body of routine ... */
diff --git a/src/mpi/comm/comm_create_group.c b/src/mpi/comm/comm_create_group.c
index 545a83e..e0402e0 100644
--- a/src/mpi/comm/comm_create_group.c
+++ b/src/mpi/comm/comm_create_group.c
@@ -209,7 +209,7 @@ int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm * ne
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (newcomm_ptr)
-        MPID_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
+        MPIR_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     else
         *newcomm = MPI_COMM_NULL;
     /* ... end of body of routine ... */
diff --git a/src/mpi/comm/comm_dup.c b/src/mpi/comm/comm_dup.c
index 725b253..cfb10d8 100644
--- a/src/mpi/comm/comm_dup.c
+++ b/src/mpi/comm/comm_dup.c
@@ -161,7 +161,7 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)
     mpi_errno = MPIR_Comm_dup_impl(comm_ptr, &newcomm_ptr);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-    MPID_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/comm/comm_dup_with_info.c b/src/mpi/comm/comm_dup_with_info.c
index a3542ec..e0b204b 100644
--- a/src/mpi/comm/comm_dup_with_info.c
+++ b/src/mpi/comm/comm_dup_with_info.c
@@ -132,7 +132,7 @@ int MPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm)
     if (mpi_errno)
         MPIR_ERR_POP(mpi_errno);
 
-    MPID_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/comm/comm_idup.c b/src/mpi/comm/comm_idup.c
index 10f2ce5..20d2c08 100644
--- a/src/mpi/comm/comm_idup.c
+++ b/src/mpi/comm/comm_idup.c
@@ -143,7 +143,7 @@ int MPI_Comm_idup(MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request)
     /* 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
      * handle at request completion time. */
-    MPID_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     *request = dreq->handle;
 
     /* ... end of body of routine ... */
diff --git a/src/mpi/comm/comm_shrink.c b/src/mpi/comm/comm_shrink.c
index e9cdd1e..843630b 100644
--- a/src/mpi/comm/comm_shrink.c
+++ b/src/mpi/comm/comm_shrink.c
@@ -173,7 +173,7 @@ int MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm)
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
     if (newcomm_ptr)
-        MPID_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
+        MPIR_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     else
         *newcomm = MPI_COMM_NULL;
     /* ... end of body of routine ... */
diff --git a/src/mpi/comm/comm_split.c b/src/mpi/comm/comm_split.c
index 6a489a2..968b4ab 100644
--- a/src/mpi/comm/comm_split.c
+++ b/src/mpi/comm/comm_split.c
@@ -478,7 +478,7 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm)
     mpi_errno = MPIR_Comm_split_impl(comm_ptr, color, key, &newcomm_ptr);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     if (newcomm_ptr)
-        MPID_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
+        MPIR_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     else
         *newcomm = MPI_COMM_NULL;
 
diff --git a/src/mpi/comm/comm_split_type.c b/src/mpi/comm/comm_split_type.c
index b122126..c4e2f59 100644
--- a/src/mpi/comm/comm_split_type.c
+++ b/src/mpi/comm/comm_split_type.c
@@ -142,7 +142,7 @@ int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info,
     if (mpi_errno)
         MPIR_ERR_POP(mpi_errno);
     if (newcomm_ptr)
-        MPID_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
+        MPIR_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
     else
         *newcomm = MPI_COMM_NULL;
 
diff --git a/src/mpi/comm/intercomm_create.c b/src/mpi/comm/intercomm_create.c
index 0bfe3ae..fcde213 100644
--- a/src/mpi/comm/intercomm_create.c
+++ b/src/mpi/comm/intercomm_create.c
@@ -520,7 +520,7 @@ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader,
                                            remote_leader, tag, &new_intercomm_ptr);
     if (mpi_errno) goto fn_fail;
     
-    MPID_OBJ_PUBLISH_HANDLE(*newintercomm, new_intercomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newintercomm, new_intercomm_ptr->handle);
     /* ... end of body of routine ... */
     
   fn_exit:
diff --git a/src/mpi/comm/intercomm_merge.c b/src/mpi/comm/intercomm_merge.c
index fcdd0f1..97345d0 100644
--- a/src/mpi/comm/intercomm_merge.c
+++ b/src/mpi/comm/intercomm_merge.c
@@ -334,7 +334,7 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm)
     mpi_errno = MPIR_Intercomm_merge_impl(comm_ptr, high, &new_intracomm_ptr);
     if (mpi_errno) goto fn_fail;
     
-    MPID_OBJ_PUBLISH_HANDLE(*newintracomm, new_intracomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newintracomm, new_intracomm_ptr->handle);
 
     /* ... end of body of routine ... */
     
diff --git a/src/mpi/datatype/type_contiguous.c b/src/mpi/datatype/type_contiguous.c
index f033cf2..d99c80a 100644
--- a/src/mpi/datatype/type_contiguous.c
+++ b/src/mpi/datatype/type_contiguous.c
@@ -55,7 +55,7 @@ int MPIR_Type_contiguous_impl(int count,
 
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
 
  fn_exit:
     return mpi_errno;
diff --git a/src/mpi/datatype/type_create_darray.c b/src/mpi/datatype/type_create_darray.c
index a944662..925ec5a 100644
--- a/src/mpi/datatype/type_create_darray.c
+++ b/src/mpi/datatype/type_create_darray.c
@@ -739,7 +739,7 @@ int MPI_Type_create_darray(int size,
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
     /* --END ERROR HANDLING-- */
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/datatype/type_create_hindexed.c b/src/mpi/datatype/type_create_hindexed.c
index c987a7a..5db81a8 100644
--- a/src/mpi/datatype/type_create_hindexed.c
+++ b/src/mpi/datatype/type_create_hindexed.c
@@ -133,7 +133,7 @@ int MPI_Type_create_hindexed(int count,
 
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/datatype/type_create_hindexed_block.c b/src/mpi/datatype/type_create_hindexed_block.c
index 752a8ac..9714d82 100644
--- a/src/mpi/datatype/type_create_hindexed_block.c
+++ b/src/mpi/datatype/type_create_hindexed_block.c
@@ -59,7 +59,7 @@ int MPIR_Type_create_hindexed_block_impl(int count, int blocklength,
                                            &oldtype);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
 
   fn_exit:
     return mpi_errno;
diff --git a/src/mpi/datatype/type_create_hvector.c b/src/mpi/datatype/type_create_hvector.c
index 23a871a..f7b95ed 100644
--- a/src/mpi/datatype/type_create_hvector.c
+++ b/src/mpi/datatype/type_create_hvector.c
@@ -116,7 +116,7 @@ int MPI_Type_create_hvector(int count,
 
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/datatype/type_create_indexed_block.c b/src/mpi/datatype/type_create_indexed_block.c
index c297d55..2fafcac 100644
--- a/src/mpi/datatype/type_create_indexed_block.c
+++ b/src/mpi/datatype/type_create_indexed_block.c
@@ -69,7 +69,7 @@ int MPIR_Type_create_indexed_block_impl(int count,
 				           &oldtype);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
 
  fn_exit:
     MPIU_CHKLMEM_FREEALL();
diff --git a/src/mpi/datatype/type_create_resized.c b/src/mpi/datatype/type_create_resized.c
index b3b4b4f..894a87e 100644
--- a/src/mpi/datatype/type_create_resized.c
+++ b/src/mpi/datatype/type_create_resized.c
@@ -110,7 +110,7 @@ int MPI_Type_create_resized(MPI_Datatype oldtype,
 
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/datatype/type_create_struct.c b/src/mpi/datatype/type_create_struct.c
index a64803d..5557ce1 100644
--- a/src/mpi/datatype/type_create_struct.c
+++ b/src/mpi/datatype/type_create_struct.c
@@ -69,7 +69,7 @@ int MPIR_Type_create_struct_impl(int count,
 				           array_of_types);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
         
  fn_exit:
     MPIU_CHKLMEM_FREEALL();
diff --git a/src/mpi/datatype/type_create_subarray.c b/src/mpi/datatype/type_create_subarray.c
index 2725a0d..84419cf 100644
--- a/src/mpi/datatype/type_create_subarray.c
+++ b/src/mpi/datatype/type_create_subarray.c
@@ -327,7 +327,7 @@ int MPI_Type_create_subarray(int ndims,
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/datatype/type_dup.c b/src/mpi/datatype/type_dup.c
index 817ea31..25f5394 100644
--- a/src/mpi/datatype/type_dup.c
+++ b/src/mpi/datatype/type_dup.c
@@ -129,7 +129,7 @@ int MPI_Type_dup(MPI_Datatype oldtype, MPI_Datatype *newtype)
 
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/datatype/type_hindexed.c b/src/mpi/datatype/type_hindexed.c
index 94d6cb4..b48bed7 100644
--- a/src/mpi/datatype/type_hindexed.c
+++ b/src/mpi/datatype/type_hindexed.c
@@ -159,7 +159,7 @@ int MPI_Type_hindexed(int count,
 				           &oldtype);
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/datatype/type_hvector.c b/src/mpi/datatype/type_hvector.c
index a7ef432..4174cf0 100644
--- a/src/mpi/datatype/type_hvector.c
+++ b/src/mpi/datatype/type_hvector.c
@@ -58,7 +58,7 @@ int MPIR_Type_hvector_impl(int count, int blocklength, MPI_Aint stride, MPI_Data
 				           &oldtype);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
 
  fn_exit:
     return mpi_errno;
diff --git a/src/mpi/datatype/type_indexed.c b/src/mpi/datatype/type_indexed.c
index b4eda63..f02de6d 100644
--- a/src/mpi/datatype/type_indexed.c
+++ b/src/mpi/datatype/type_indexed.c
@@ -73,7 +73,7 @@ int MPIR_Type_indexed_impl(int count, const int *array_of_blocklengths,
 					   &oldtype);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
 
  fn_exit:
     MPIU_CHKLMEM_FREEALL();
diff --git a/src/mpi/datatype/type_struct.c b/src/mpi/datatype/type_struct.c
index ca4e012..0a9f9dc 100644
--- a/src/mpi/datatype/type_struct.c
+++ b/src/mpi/datatype/type_struct.c
@@ -67,7 +67,7 @@ int MPIR_Type_struct_impl(int count, const int *array_of_blocklengths,
     
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
 
  fn_exit:
     MPIU_CHKLMEM_FREEALL();
diff --git a/src/mpi/datatype/type_vector.c b/src/mpi/datatype/type_vector.c
index 3402fce..ded9339 100644
--- a/src/mpi/datatype/type_vector.c
+++ b/src/mpi/datatype/type_vector.c
@@ -60,7 +60,7 @@ int MPIR_Type_vector_impl(int count, int blocklength, int stride, MPI_Datatype o
                                            &oldtype);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-    MPID_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newtype, new_handle);
     
  fn_exit:
     return mpi_errno;
diff --git a/src/mpi/errhan/comm_create_errhandler.c b/src/mpi/errhan/comm_create_errhandler.c
index de7bd8e..8bb32b2 100644
--- a/src/mpi/errhan/comm_create_errhandler.c
+++ b/src/mpi/errhan/comm_create_errhandler.c
@@ -44,7 +44,7 @@ int MPIR_Comm_create_errhandler_impl(MPI_Comm_errhandler_function *comm_errhandl
     MPIU_Object_set_ref(errhan_ptr,1);
     errhan_ptr->errfn.C_Comm_Handler_function = comm_errhandler_fn;
 
-    MPID_OBJ_PUBLISH_HANDLE(*errhandler, errhan_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*errhandler, errhan_ptr->handle);
  fn_exit:
     return mpi_errno;
  fn_fail:
diff --git a/src/mpi/errhan/file_create_errhandler.c b/src/mpi/errhan/file_create_errhandler.c
index 467585a..f6c8868 100644
--- a/src/mpi/errhan/file_create_errhandler.c
+++ b/src/mpi/errhan/file_create_errhandler.c
@@ -81,7 +81,7 @@ int MPI_File_create_errhandler(MPI_File_errhandler_function *file_errhandler_fn,
     MPIU_Object_set_ref(errhan_ptr,1);
     errhan_ptr->errfn.C_File_Handler_function = file_errhandler_fn;
 
-    MPID_OBJ_PUBLISH_HANDLE(*errhandler, errhan_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*errhandler, errhan_ptr->handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/errhan/win_create_errhandler.c b/src/mpi/errhan/win_create_errhandler.c
index a805bdd..cb4e31c 100644
--- a/src/mpi/errhan/win_create_errhandler.c
+++ b/src/mpi/errhan/win_create_errhandler.c
@@ -84,7 +84,7 @@ int MPI_Win_create_errhandler(MPI_Win_errhandler_function *win_errhandler_fn,
     MPIU_Object_set_ref(errhan_ptr,1);
     errhan_ptr->errfn.C_Win_Handler_function = win_errhandler_fn;
 
-    MPID_OBJ_PUBLISH_HANDLE(*errhandler, errhan_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*errhandler, errhan_ptr->handle);
     /* ... end of body of routine ... */
 
   fn_exit:
diff --git a/src/mpi/group/group_difference.c b/src/mpi/group/group_difference.c
index bb79d8e..c733a97 100644
--- a/src/mpi/group/group_difference.c
+++ b/src/mpi/group/group_difference.c
@@ -185,7 +185,7 @@ int MPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup
     mpi_errno = MPIR_Group_difference_impl(group_ptr1, group_ptr2, &new_group_ptr);
     if (mpi_errno) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/group/group_excl.c b/src/mpi/group/group_excl.c
index d158a7c..138c3bf 100644
--- a/src/mpi/group/group_excl.c
+++ b/src/mpi/group/group_excl.c
@@ -166,7 +166,7 @@ int MPI_Group_excl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
     mpi_errno = MPIR_Group_excl_impl(group_ptr, n, ranks, &new_group_ptr);
     if (mpi_errno) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/group/group_incl.c b/src/mpi/group/group_incl.c
index 98ee62b..2a66e9e 100644
--- a/src/mpi/group/group_incl.c
+++ b/src/mpi/group/group_incl.c
@@ -155,7 +155,7 @@ int MPI_Group_incl(MPI_Group group, int n, const int ranks[], MPI_Group *newgrou
     mpi_errno = MPIR_Group_incl_impl(group_ptr, n, ranks, &new_group_ptr);
     if (mpi_errno) goto fn_fail;
     
-    MPID_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/group/group_intersection.c b/src/mpi/group/group_intersection.c
index e337628..9e7c83a 100644
--- a/src/mpi/group/group_intersection.c
+++ b/src/mpi/group/group_intersection.c
@@ -185,7 +185,7 @@ int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgro
     mpi_errno = MPIR_Group_intersection_impl(group_ptr1, group_ptr2, &new_group_ptr);
     if (mpi_errno) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/group/group_range_excl.c b/src/mpi/group/group_range_excl.c
index ee42a72..3da0828 100644
--- a/src/mpi/group/group_range_excl.c
+++ b/src/mpi/group/group_range_excl.c
@@ -202,7 +202,7 @@ int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
     mpi_errno = MPIR_Group_range_excl_impl(group_ptr, n, ranges, &new_group_ptr);
     if (mpi_errno) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/group/group_range_incl.c b/src/mpi/group/group_range_incl.c
index 26ece15..9182aaf 100644
--- a/src/mpi/group/group_range_incl.c
+++ b/src/mpi/group/group_range_incl.c
@@ -178,7 +178,7 @@ int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
     mpi_errno = MPIR_Group_range_incl_impl(group_ptr, n, ranges, &new_group_ptr);
     if (mpi_errno) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/group/group_union.c b/src/mpi/group/group_union.c
index 4e56608..cf548c2 100644
--- a/src/mpi/group/group_union.c
+++ b/src/mpi/group/group_union.c
@@ -218,7 +218,7 @@ int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup)
     mpi_errno = MPIR_Group_union_impl(group_ptr1, group_ptr2, &new_group_ptr);
     if (mpi_errno) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newgroup, new_group_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/pt2pt/bsend_init.c b/src/mpi/pt2pt/bsend_init.c
index 6313626..fe5bfb5 100644
--- a/src/mpi/pt2pt/bsend_init.c
+++ b/src/mpi/pt2pt/bsend_init.c
@@ -125,7 +125,7 @@ int MPI_Bsend_init(const void *buf, int count, MPI_Datatype datatype,
     MPIR_SENDQ_REMEMBER(request_ptr, dest, tag, comm_ptr->context_id);
 
     /* return the handle of the request to the user */
-    MPID_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
 
     /* ... end of body of routine ... */
     
diff --git a/src/mpi/pt2pt/cancel.c b/src/mpi/pt2pt/cancel.c
index 15c51cf..742f833 100644
--- a/src/mpi/pt2pt/cancel.c
+++ b/src/mpi/pt2pt/cancel.c
@@ -77,7 +77,7 @@ int MPIR_Cancel_impl(MPID_Request *request_ptr)
                      * cc field?  shouldn't our cc_ptr be set to the address
                      * 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));
+                                                     MPIR_cc_is_complete(&request_ptr->partner_request->cc));
                     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 		}
 	    } else {
@@ -99,7 +99,7 @@ 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));
+            mpi_errno = MPIR_Grequest_cancel(request_ptr, MPIR_cc_is_complete(&request_ptr->cc));
             if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 	    break;
 	}
diff --git a/src/mpi/pt2pt/greq_start.c b/src/mpi/pt2pt/greq_start.c
index e60d9a7..8f42781 100644
--- a/src/mpi/pt2pt/greq_start.c
+++ b/src/mpi/pt2pt/greq_start.c
@@ -90,7 +90,7 @@ int MPIR_Grequest_start_impl(MPI_Grequest_query_function *query_fn,
     (*request_ptr)->kind                 = MPID_UREQUEST;
     MPIU_Object_set_ref( *request_ptr, 1 );
     (*request_ptr)->cc_ptr               = &(*request_ptr)->cc;
-    MPID_cc_set((*request_ptr)->cc_ptr, 1);
+    MPIR_cc_set((*request_ptr)->cc_ptr, 1);
     (*request_ptr)->comm                 = NULL;
     (*request_ptr)->greq_fns             = NULL;
     MPIU_CHKPMEM_MALLOC((*request_ptr)->greq_fns, struct MPID_Grequest_fns *, sizeof(struct MPID_Grequest_fns), mpi_errno, "greq_fns");
@@ -203,7 +203,7 @@ int MPI_Grequest_start( MPI_Grequest_query_function *query_fn,
     mpi_errno = MPIR_Grequest_start_impl(query_fn, free_fn, cancel_fn, extra_state, &request_ptr);
     if (mpi_errno) goto fn_fail;
     
-    MPID_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
 
     /* ... end of body of routine ... */
 
@@ -304,7 +304,7 @@ int MPIX_Grequest_class_create(MPI_Grequest_query_function *query_fn,
             MPIR_Grequest_registered_finalizer = 1;
         }
 
-        MPID_OBJ_PUBLISH_HANDLE(*greq_class, class_ptr->handle);
+        MPIR_OBJ_PUBLISH_HANDLE(*greq_class, class_ptr->handle);
 
 	/* ... end of body of routine ... */
 fn_exit:
diff --git a/src/mpi/pt2pt/ibsend.c b/src/mpi/pt2pt/ibsend.c
index 8313f25..478f106 100644
--- a/src/mpi/pt2pt/ibsend.c
+++ b/src/mpi/pt2pt/ibsend.c
@@ -117,7 +117,7 @@ int MPIR_Ibsend_impl(const void *buf, int count, MPI_Datatype datatype, int dest
     /* 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);
-    MPID_OBJ_PUBLISH_HANDLE(*request, new_request_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*request, new_request_ptr->handle);
   
  fn_exit:
     return mpi_errno;
diff --git a/src/mpi/pt2pt/mpir_request.c b/src/mpi/pt2pt/mpir_request.c
index 2c0264f..19791d0 100644
--- a/src/mpi/pt2pt/mpir_request.c
+++ b/src/mpi/pt2pt/mpir_request.c
@@ -96,7 +96,7 @@ int MPIR_Request_complete(MPI_Request * request, MPID_Request * request_ptr,
 		MPID_Request * prequest_ptr = request_ptr->partner_request;
 
 		/* reset persistent request to inactive state */
-                MPID_cc_set(&request_ptr->cc, 0);
+                MPIR_cc_set(&request_ptr->cc, 0);
 		request_ptr->cc_ptr = &request_ptr->cc;
 		request_ptr->partner_request = NULL;
 		
@@ -164,7 +164,7 @@ int MPIR_Request_complete(MPI_Request * request, MPID_Request * request_ptr,
 		MPID_Request * prequest_ptr = request_ptr->partner_request;
 
 		/* reset persistent request to inactive state */
-                MPID_cc_set(&request_ptr->cc, 0);
+                MPIR_cc_set(&request_ptr->cc, 0);
 		request_ptr->cc_ptr = &request_ptr->cc;
 		request_ptr->partner_request = NULL;
 		
diff --git a/src/mpi/pt2pt/recv_init.c b/src/mpi/pt2pt/recv_init.c
index d684439..45cefcc 100644
--- a/src/mpi/pt2pt/recv_init.c
+++ b/src/mpi/pt2pt/recv_init.c
@@ -130,7 +130,7 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source,
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
     /* return the handle of the request to the user */
-    MPID_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
 
     /* ... end of body of routine ... */
     
diff --git a/src/mpi/pt2pt/rsend_init.c b/src/mpi/pt2pt/rsend_init.c
index 3991348..28714de 100644
--- a/src/mpi/pt2pt/rsend_init.c
+++ b/src/mpi/pt2pt/rsend_init.c
@@ -130,7 +130,7 @@ int MPI_Rsend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
     /* return the handle of the request to the user */
-    MPID_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
 
     /* ... end of body of routine ... */
     
diff --git a/src/mpi/pt2pt/send_init.c b/src/mpi/pt2pt/send_init.c
index 6d51c13..1a3cad7 100644
--- a/src/mpi/pt2pt/send_init.c
+++ b/src/mpi/pt2pt/send_init.c
@@ -131,7 +131,7 @@ int MPI_Send_init(const void *buf, int count, MPI_Datatype datatype, int dest,
     MPIR_SENDQ_REMEMBER(request_ptr, dest, tag, comm_ptr->context_id);
     
     /* return the handle of the request to the user */
-    MPID_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
 
     /* ... end of body of routine ... */
     
diff --git a/src/mpi/pt2pt/ssend_init.c b/src/mpi/pt2pt/ssend_init.c
index b4c7a5b..e9af88f 100644
--- a/src/mpi/pt2pt/ssend_init.c
+++ b/src/mpi/pt2pt/ssend_init.c
@@ -127,7 +127,7 @@ int MPI_Ssend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
     /* return the handle of the request to the user */
-    MPID_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
 
     /* ... end of body of routine ... */
     
diff --git a/src/mpi/rma/win_allocate.c b/src/mpi/rma/win_allocate.c
index 3ee66f1..0361857 100644
--- a/src/mpi/rma/win_allocate.c
+++ b/src/mpi/rma/win_allocate.c
@@ -147,7 +147,7 @@ int MPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info,
     win_ptr->errhandler = 0;
 
     /* return the handle of the window object to the user */
-    MPID_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/rma/win_allocate_shared.c b/src/mpi/rma/win_allocate_shared.c
index 0c84cdb..4b68e7c 100644
--- a/src/mpi/rma/win_allocate_shared.c
+++ b/src/mpi/rma/win_allocate_shared.c
@@ -145,7 +145,7 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Com
     win_ptr->errhandler = 0;
 
     /* return the handle of the window object to the user */
-    MPID_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/rma/win_create.c b/src/mpi/rma/win_create.c
index 21747af..112bfb1 100644
--- a/src/mpi/rma/win_create.c
+++ b/src/mpi/rma/win_create.c
@@ -175,7 +175,7 @@ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info,
     win_ptr->errhandler = 0;
 
     /* return the handle of the window object to the user */
-    MPID_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/rma/win_create_dynamic.c b/src/mpi/rma/win_create_dynamic.c
index 7d5ac94..ddc5dfa 100644
--- a/src/mpi/rma/win_create_dynamic.c
+++ b/src/mpi/rma/win_create_dynamic.c
@@ -139,7 +139,7 @@ int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win)
     win_ptr->errhandler = 0;
 
     /* return the handle of the window object to the user */
-    MPID_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/spawn/comm_accept.c b/src/mpi/spawn/comm_accept.c
index 4063784..7f33bf1 100644
--- a/src/mpi/spawn/comm_accept.c
+++ b/src/mpi/spawn/comm_accept.c
@@ -112,7 +112,7 @@ int MPI_Comm_accept(const char *port_name, MPI_Info info, int root, MPI_Comm com
     mpi_errno = MPIR_Comm_accept_impl(port_name, info_ptr, root, comm_ptr, &newcomm_ptr);
     if (mpi_errno) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/spawn/comm_connect.c b/src/mpi/spawn/comm_connect.c
index 332b25e..e76e897 100644
--- a/src/mpi/spawn/comm_connect.c
+++ b/src/mpi/spawn/comm_connect.c
@@ -112,7 +112,7 @@ int MPI_Comm_connect(const char *port_name, MPI_Info info, int root, MPI_Comm co
     mpi_errno = MPIR_Comm_connect_impl(port_name, info_ptr, root, comm_ptr, &newcomm_ptr);
     if (mpi_errno) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/spawn/comm_join.c b/src/mpi/spawn/comm_join.c
index 6684bf9..62ddb3c 100644
--- a/src/mpi/spawn/comm_join.c
+++ b/src/mpi/spawn/comm_join.c
@@ -179,7 +179,7 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
     mpi_errno = MPIR_Close_port_impl(local_port);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-    MPID_OBJ_PUBLISH_HANDLE(*intercomm, intercomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*intercomm, intercomm_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/spawn/comm_spawn.c b/src/mpi/spawn/comm_spawn.c
index 6f540da..bdf9732 100644
--- a/src/mpi/spawn/comm_spawn.c
+++ b/src/mpi/spawn/comm_spawn.c
@@ -127,7 +127,7 @@ int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info inf
                                          array_of_errcodes); 
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*intercomm, intercomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*intercomm, intercomm_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/spawn/comm_spawn_multiple.c b/src/mpi/spawn/comm_spawn_multiple.c
index a94ca7f..3321f77 100644
--- a/src/mpi/spawn/comm_spawn_multiple.c
+++ b/src/mpi/spawn/comm_spawn_multiple.c
@@ -144,7 +144,7 @@ int MPI_Comm_spawn_multiple(int count, char *array_of_commands[],
                                          array_of_errcodes);
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*intercomm, intercomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*intercomm, intercomm_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/topo/cart_create.c b/src/mpi/topo/cart_create.c
index f31181e..c5ecdbc 100644
--- a/src/mpi/topo/cart_create.c
+++ b/src/mpi/topo/cart_create.c
@@ -156,7 +156,7 @@ int MPIR_Cart_create( MPID_Comm *comm_ptr, int ndims, const int dims[],
     mpi_errno = MPIR_Topology_put( newcomm_ptr, cart_ptr );
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-    MPID_OBJ_PUBLISH_HANDLE(*comm_cart, newcomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*comm_cart, newcomm_ptr->handle);
 
  fn_exit:
     return mpi_errno;
diff --git a/src/mpi/topo/dist_gr_create.c b/src/mpi/topo/dist_gr_create.c
index b11d8bc..ec5de8b 100644
--- a/src/mpi/topo/dist_gr_create.c
+++ b/src/mpi/topo/dist_gr_create.c
@@ -393,7 +393,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
 
     MPIU_CHKPMEM_COMMIT();
 
-    MPID_OBJ_PUBLISH_HANDLE(*comm_dist_graph, comm_dist_graph_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*comm_dist_graph, comm_dist_graph_ptr->handle);
 
     /* ... end of body of routine ... */
 
diff --git a/src/mpi/topo/dist_gr_create_adj.c b/src/mpi/topo/dist_gr_create_adj.c
index bdf066b..f761af0 100644
--- a/src/mpi/topo/dist_gr_create_adj.c
+++ b/src/mpi/topo/dist_gr_create_adj.c
@@ -177,7 +177,7 @@ int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old,
     mpi_errno = MPIR_Topology_put(comm_dist_graph_ptr, topo_ptr);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-    MPID_OBJ_PUBLISH_HANDLE(*comm_dist_graph, comm_dist_graph_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*comm_dist_graph, comm_dist_graph_ptr->handle);
     MPIU_CHKPMEM_COMMIT();
     /* ... end of body of routine ... */
   fn_exit:
diff --git a/src/mpi/topo/graphcreate.c b/src/mpi/topo/graphcreate.c
index cbc943d..94492d5 100644
--- a/src/mpi/topo/graphcreate.c
+++ b/src/mpi/topo/graphcreate.c
@@ -106,7 +106,7 @@ int MPIR_Graph_create( MPID_Comm *comm_ptr, int nnodes,
     mpi_errno = MPIR_Topology_put( newcomm_ptr, graph_ptr );
     if (mpi_errno != MPI_SUCCESS) goto fn_fail;
 
-    MPID_OBJ_PUBLISH_HANDLE(*comm_graph, newcomm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*comm_graph, newcomm_ptr->handle);
 
     /* ... end of body of routine ... */
 
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 04974e7..86bd30f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
@@ -165,7 +165,7 @@ static inline int MPID_nem_ofi_handle_packet(cq_tagged_entry_t * wc ATTRIBUTE((u
     MPIDI_VC_t *vc;
 
     BEGIN_FUNC(FCNAME);
-    if (MPID_cc_get(rreq->cc) == 1) {
+    if (MPIR_cc_get(rreq->cc) == 1) {
       vc = REQ_OFI(rreq)->vc;
       MPIU_Assert(vc);
       MPIDI_CH3I_NM_OFI_RC(MPID_nem_handle_pkt(vc, REQ_OFI(rreq)->pack_buffer, REQ_OFI(rreq)->pack_buffer_size));
@@ -224,7 +224,7 @@ static inline int MPID_nem_ofi_preposted_callback(cq_tagged_entry_t * wc, MPID_R
       pkt_len = 0;
     c = 1;
     MPID_nem_ofi_create_req(&new_rreq, 1);
-    MPID_cc_incr(new_rreq->cc_ptr, &c);
+    MPIR_cc_incr(new_rreq->cc_ptr, &c);
     new_rreq->dev.OnDataAvail = NULL;
     new_rreq->dev.next = NULL;
     REQ_OFI(new_rreq)->event_callback = MPID_nem_ofi_handle_packet;
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 46c6c64..14a7677 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_msg.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_msg.c
@@ -65,8 +65,8 @@
         GET_PGID_AND_SET_MATCH();                                       \
         VC_READY_CHECK(vc);                                             \
         c = 1;                                                          \
-        MPID_cc_incr(sreq->cc_ptr, &c);                                 \
-        MPID_cc_incr(sreq->cc_ptr, &c);                                 \
+        MPIR_cc_incr(sreq->cc_ptr, &c);                                 \
+        MPIR_cc_incr(sreq->cc_ptr, &c);                                 \
         REQ_OFI(sreq)->event_callback   = MPID_nem_ofi_data_callback;   \
         REQ_OFI(sreq)->pack_buffer      = pack_buffer;                  \
         REQ_OFI(sreq)->pack_buffer_size = pkt_len;                      \
@@ -130,7 +130,7 @@ static int MPID_nem_ofi_data_callback(cq_tagged_entry_t * wc, MPID_Request * sre
          * Multiple DATA events may arrive because we need
          * to store updated TAG values in the sreq.
          */
-        if (MPID_cc_get(sreq->cc) == 1) {
+        if (MPIR_cc_get(sreq->cc) == 1) {
             if (REQ_OFI(sreq)->pack_buffer)
                 MPIU_Free(REQ_OFI(sreq)->pack_buffer);
 
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 e11e5f8..d91aca1 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
@@ -165,7 +165,7 @@ ADD_SUFFIX(do_isend)(struct MPIDI_VC *vc,
         /* matching with MPI level messages.                    */
         /* ---------------------------------------------------- */
         int c = 1;
-        MPID_cc_incr(sreq->cc_ptr, &c);
+        MPIR_cc_incr(sreq->cc_ptr, &c);
         MPID_nem_ofi_create_req(&sync_req, 1);
         sync_req->dev.OnDataAvail = NULL;
         sync_req->dev.next = NULL;
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 b44fd68..849d079 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
@@ -70,7 +70,7 @@ static int handler_send(const ptl_event_t *e)
     MPIU_Assert(e->type == PTL_EVENT_SEND || e->type == PTL_EVENT_GET);
 
     /* if we are done, release all netmod resources */
-    if (MPID_cc_get(sreq->cc) == 1) {
+    if (MPIR_cc_get(sreq->cc) == 1) {
         if (REQ_PTL(sreq)->md != PTL_INVALID_HANDLE) {
             ret = PtlMDRelease(REQ_PTL(sreq)->md);
             MPIR_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdrelease", "**ptlmdrelease %s", MPID_nem_ptl_strerror(ret));
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 7286744..7990533 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
@@ -205,7 +205,7 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
     /* 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
      * bother finishing this. */
-    if (!found && MPID_cc_get(rreq->cc) == 0) {
+    if (!found && MPIR_cc_get(rreq->cc) == 0) {
         *rreqp = NULL;
         goto fn_exit;
     }
diff --git a/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c b/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
index d582609..ed3eb29 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
@@ -131,7 +131,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 		    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 		}
 		sreq->kind = MPID_REQUEST_SEND;
-		MPID_cc_set(&(sreq->cc), 0);
+		MPIR_cc_set(&(sreq->cc), 0);
 		sreq->status.MPI_ERROR = MPIR_Err_create_code( rc,
 			       MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, 
 			       MPI_ERR_INTERN, "**ch3|sock|writefailed",
@@ -199,7 +199,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
 	sreq->kind = MPID_REQUEST_SEND;
-	MPID_cc_set(&sreq->cc, 0);
+	MPIR_cc_set(&sreq->cc, 0);
 	
 	sreq->status.MPI_ERROR = MPIR_Err_create_code( MPI_SUCCESS,
 		       MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, 
diff --git a/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c b/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
index 71ea17d..a5b39a1 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
@@ -163,7 +163,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 		    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 		}
 		sreq->kind = MPID_REQUEST_SEND;
-        MPID_cc_set(&(sreq->cc), 0);
+        MPIR_cc_set(&(sreq->cc), 0);
 		sreq->status.MPI_ERROR = MPIR_Err_create_code( rc,
 			       MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, 
 			       MPI_ERR_INTERN, "**ch3|sock|writefailed", 
@@ -231,7 +231,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 	    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 	}
 	sreq->kind = MPID_REQUEST_SEND;
-    MPID_cc_set(&(sreq->cc), 0);
+    MPIR_cc_set(&(sreq->cc), 0);
 	sreq->status.MPI_ERROR = MPIR_Err_create_code( MPI_SUCCESS,
 		       MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, 
 		       MPI_ERR_INTERN, "**ch3|sock|connectionfailed",0 );
diff --git a/src/mpid/ch3/include/mpid_thread.h b/src/mpid/ch3/include/mpid_thread.h
index 82565ae..012f8ed 100644
--- a/src/mpid/ch3/include/mpid_thread.h
+++ b/src/mpid/ch3/include/mpid_thread.h
@@ -48,15 +48,6 @@ typedef MPIDU_Thread_func_t  MPID_Thread_func_t;
 #define MPID_Thread_tls_set MPIDU_Thread_tls_set
 #define MPID_Thread_tls_get MPIDU_Thread_tls_get
 
-#define MPID_cc_t            MPIDU_cc_t
-#define MPID_cc_get          MPIDU_cc_get
-#define MPID_cc_set          MPIDU_cc_set
-#define MPID_cc_is_complete  MPIDU_cc_is_complete
-#define MPID_cc_incr         MPIDU_cc_incr
-#define MPID_cc_decr         MPIDU_cc_decr
-
-#define MPID_OBJ_PUBLISH_HANDLE  MPIDU_OBJ_PUBLISH_HANDLE
-
 #define MPID_THREADPRIV_INITKEY  MPIDU_THREADPRIV_INITKEY
 #define MPID_THREADPRIV_INIT     MPIDU_THREADPRIV_INIT
 #define MPID_THREADPRIV_GET      MPIDU_THREADPRIV_GET
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index 17d9fe4..503a84e 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -324,7 +324,7 @@ extern MPIDI_Process_t MPIDI_Process;
         if ((rreq_) != NULL) {                                             \
             MPIU_Object_set_ref((rreq_), 1);                               \
             /* MT FIXME should these be handled by MPID_Request_create? */ \
-            MPID_cc_set(&(rreq_)->cc, 0);                                  \
+            MPIR_cc_set(&(rreq_)->cc, 0);                                  \
             (rreq_)->kind = MPID_REQUEST_RECV;                             \
             MPIR_Status_set_procnull(&(rreq_)->status);                    \
         }                                                                  \
diff --git a/src/mpid/ch3/include/mpidpost.h b/src/mpid/ch3/include/mpidpost.h
index 01fd8c0..0ce6cd9 100644
--- a/src/mpid/ch3/include/mpidpost.h
+++ b/src/mpid/ch3/include/mpidpost.h
@@ -152,11 +152,11 @@ int MPIDI_CH3_Comm_connect(char * port_name, int root, MPID_Comm * comm_ptr,
    from the channel level? */
 /* The above comment is accurate, although we do not currently have any channels
  * that do this.  Memory barriers are included in fine-grained multithreaded
- * versions of the MPID_cc_incr/decr macros. */
+ * versions of the MPIR_cc_incr/decr macros. */
 #define MPIDI_CH3U_Request_decrement_cc(req_, incomplete_)   \
-    MPID_cc_decr((req_)->cc_ptr, incomplete_)
+    MPIR_cc_decr((req_)->cc_ptr, incomplete_)
 #define MPIDI_CH3U_Request_increment_cc(req_, was_incomplete_)   \
-    MPID_cc_incr((req_)->cc_ptr, was_incomplete_)
+    MPIR_cc_incr((req_)->cc_ptr, was_incomplete_)
 
 /*
  * Device level request management macros
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index d64ac67..29990fe 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -673,7 +673,7 @@ static inline int check_and_set_req_completion(MPID_Win * win_ptr, MPIDI_RMA_Tar
             incomplete_req_cnt++;
 
             if (rma_op->ureq != NULL) {
-                MPID_cc_set(&(rma_op->ureq->cc), incomplete_req_cnt);
+                MPIR_cc_set(&(rma_op->ureq->cc), incomplete_req_cnt);
                 (*req)->dev.request_handle = rma_op->ureq->handle;
             }
 
diff --git a/src/mpid/ch3/src/ch3u_eager.c b/src/mpid/ch3/src/ch3u_eager.c
index 2e40923..5115bf4 100644
--- a/src/mpid/ch3/src/ch3u_eager.c
+++ b/src/mpid/ch3/src/ch3u_eager.c
@@ -315,7 +315,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* 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
      * bother finishing this. */
-    if (!found && MPID_cc_get(rreq->cc) == 0) {
+    if (!found && MPIR_cc_get(rreq->cc) == 0) {
         *rreqp = NULL;
         goto fn_fail;
     }
@@ -632,7 +632,7 @@ int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* 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
      * bother finishing this. */
-    if (!found && MPID_cc_get(rreq->cc) == 0) {
+    if (!found && MPIR_cc_get(rreq->cc) == 0) {
         *rreqp = NULL;
         goto fn_fail;
     }
@@ -722,7 +722,7 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* 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
      * bother finishing this. */
-    if (!found && MPID_cc_get(rreq->cc) == 0) {
+    if (!found && MPIR_cc_get(rreq->cc) == 0) {
         *rreqp = NULL;
         goto fn_fail;
     }
diff --git a/src/mpid/ch3/src/ch3u_eagersync.c b/src/mpid/ch3/src/ch3u_eagersync.c
index a3bbd94..ae6d87c 100644
--- a/src/mpid/ch3/src/ch3u_eagersync.c
+++ b/src/mpid/ch3/src/ch3u_eagersync.c
@@ -42,7 +42,7 @@ int MPIDI_CH3_EagerSyncNoncontigSend( MPID_Request **sreq_p,
 
     /* MT FIXME what are the two operations we are waiting for?  the send and
      * the sync response? */
-    MPID_cc_set(&sreq->cc, 2);
+    MPIR_cc_set(&sreq->cc, 2);
     sreq->dev.OnDataAvail = 0;
     sreq->dev.OnFinal = 0;
 
@@ -129,7 +129,7 @@ int MPIDI_CH3_EagerSyncZero(MPID_Request **sreq_p, int rank, int tag,
     
     /* MT FIXME what are the two operations we are waiting for?  the send and
      * the sync response? */
-    MPID_cc_set(&sreq->cc, 2);
+    MPIR_cc_set(&sreq->cc, 2);
     MPIDI_Request_set_msg_type(sreq, MPIDI_REQUEST_EAGER_MSG);
     sreq->dev.OnDataAvail = 0;
     
@@ -238,7 +238,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* 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
      * bother finishing this. */
-    if (!found && MPID_cc_get(rreq->cc) == 0) {
+    if (!found && MPIR_cc_get(rreq->cc) == 0) {
         *rreqp = NULL;
         goto fn_fail;
     }
diff --git a/src/mpid/ch3/src/ch3u_request.c b/src/mpid/ch3/src/ch3u_request.c
index cbb493d..bee9aa7 100644
--- a/src/mpid/ch3/src/ch3u_request.c
+++ b/src/mpid/ch3/src/ch3u_request.c
@@ -65,7 +65,7 @@ MPID_Request * MPID_Request_create(void)
 	   values be set only for RMA requests? */
 	MPIU_Object_set_ref(req, 1);
 	req->kind		   = MPID_REQUEST_UNDEFINED;
-        MPID_cc_set(&req->cc, 1);
+        MPIR_cc_set(&req->cc, 1);
 	req->cc_ptr		   = &req->cc;
 	/* FIXME: status fields meaningful only for receive, and even then
 	   should not need to be set. */
diff --git a/src/mpid/ch3/src/ch3u_rndv.c b/src/mpid/ch3/src/ch3u_rndv.c
index d2949a1..142fa65 100644
--- a/src/mpid/ch3/src/ch3u_rndv.c
+++ b/src/mpid/ch3/src/ch3u_rndv.c
@@ -131,7 +131,7 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* 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
      * bother finishing this. */
-    if (!found && MPID_cc_get(rreq->cc) == 0) {
+    if (!found && MPIR_cc_get(rreq->cc) == 0) {
         *rreqp = NULL;
         goto fn_fail;
     }
diff --git a/src/mpid/ch3/src/mpid_cancel_send.c b/src/mpid/ch3/src/mpid_cancel_send.c
index e4fbe73..4fa2b22 100644
--- a/src/mpid/ch3/src/mpid_cancel_send.c
+++ b/src/mpid/ch3/src/mpid_cancel_send.c
@@ -142,7 +142,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
 		    MPIR_STATUS_SET_CANCEL_BIT(sreq->status, TRUE);
 		    /* no other thread should be waiting on sreq, so it is 
 		       safe to reset ref_count and cc */
-                    MPID_cc_set(&sreq->cc, 0);
+                    MPIR_cc_set(&sreq->cc, 0);
                     /* FIXME should be a decr and assert, not a set */
 		    MPIU_Object_set_ref(sreq, 1);
 		    goto fn_exit;
@@ -157,7 +157,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
 		MPIR_STATUS_SET_CANCEL_BIT(sreq->status, TRUE);
 		/* no other thread should be waiting on sreq, so it is safe to 
 		   reset ref_count and cc */
-                MPID_cc_set(&sreq->cc, 0);
+                MPIR_cc_set(&sreq->cc, 0);
                 /* FIXME should be a decr and assert, not a set */
 		MPIU_Object_set_ref(sreq, 1);
 		goto fn_exit;
diff --git a/src/mpid/ch3/src/mpid_irsend.c b/src/mpid/ch3/src/mpid_irsend.c
index da84c6a..84eb4ad 100644
--- a/src/mpid/ch3/src/mpid_irsend.c
+++ b/src/mpid/ch3/src/mpid_irsend.c
@@ -71,7 +71,7 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
     if (rank == MPI_PROC_NULL)
     {
 	MPIU_Object_set_ref(sreq, 1);
-        MPID_cc_set(&sreq->cc, 0);
+        MPIR_cc_set(&sreq->cc, 0);
 	goto fn_exit;
     }
     
diff --git a/src/mpid/ch3/src/mpid_isend.c b/src/mpid/ch3/src/mpid_isend.c
index 4a81e43..6833f2f 100644
--- a/src/mpid/ch3/src/mpid_isend.c
+++ b/src/mpid/ch3/src/mpid_isend.c
@@ -84,7 +84,7 @@ int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
     if (rank == MPI_PROC_NULL)
     {
 	MPIU_Object_set_ref(sreq, 1);
-        MPID_cc_set(&sreq->cc, 0);
+        MPIR_cc_set(&sreq->cc, 0);
 	goto fn_exit;
     }
 
diff --git a/src/mpid/ch3/src/mpid_issend.c b/src/mpid/ch3/src/mpid_issend.c
index 9389eed..a96d0b6 100644
--- a/src/mpid/ch3/src/mpid_issend.c
+++ b/src/mpid/ch3/src/mpid_issend.c
@@ -70,7 +70,7 @@ int MPID_Issend(const void * buf, int count, MPI_Datatype datatype, int rank, in
     if (rank == MPI_PROC_NULL)
     {
 	MPIU_Object_set_ref(sreq, 1);
-        MPID_cc_set(&sreq->cc, 0);
+        MPIR_cc_set(&sreq->cc, 0);
 	goto fn_exit;
     }
     
diff --git a/src/mpid/ch3/src/mpid_send.c b/src/mpid/ch3/src/mpid_send.c
index 905f3ed..a693275 100644
--- a/src/mpid/ch3/src/mpid_send.c
+++ b/src/mpid/ch3/src/mpid_send.c
@@ -56,7 +56,7 @@ int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
 	   will not be made (long-term FIXME) */
 #       ifndef MPICH_IS_THREADED
 	{
-	    if (sreq != NULL && MPID_cc_get(sreq->cc) != 0) {
+	    if (sreq != NULL && MPIR_cc_get(sreq->cc) != 0) {
 		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
 				    "**dev|selfsenddeadlock");
 	    }
diff --git a/src/mpid/ch3/src/mpid_ssend.c b/src/mpid/ch3/src/mpid_ssend.c
index 6f2ec86..dded70d 100644
--- a/src/mpid/ch3/src/mpid_ssend.c
+++ b/src/mpid/ch3/src/mpid_ssend.c
@@ -55,7 +55,7 @@ int MPID_Ssend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
 #       ifndef MPICH_IS_THREADED
 	{
 	    /* --BEGIN ERROR HANDLING-- */
-	    if (sreq != NULL && MPID_cc_get(sreq->cc) != 0)
+	    if (sreq != NULL && MPIR_cc_get(sreq->cc) != 0)
 	    {
 		mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER,
 						 "**dev|selfsenddeadlock", 0);
diff --git a/src/mpid/ch3/src/mpid_startall.c b/src/mpid/ch3/src/mpid_startall.c
index a948c0a..12ce84e 100644
--- a/src/mpid/ch3/src/mpid_startall.c
+++ b/src/mpid/ch3/src/mpid_startall.c
@@ -31,7 +31,7 @@
     }									\
 									\
     MPIU_Object_set_ref((sreq_), 1);					\
-    MPID_cc_set(&(sreq_)->cc, 0);                                       \
+    MPIR_cc_set(&(sreq_)->cc, 0);                                       \
     (sreq_)->kind = MPID_PREQUEST_SEND;					\
     (sreq_)->comm = comm;						\
     MPIR_Comm_add_ref(comm);						\
@@ -142,7 +142,7 @@ int MPID_Startall(int count, MPID_Request * requests[])
 	    preq->partner_request = NULL;
 	    preq->status.MPI_ERROR = rc;
 	    preq->cc_ptr = &preq->cc;
-            MPID_cc_set(&preq->cc, 0);
+            MPIR_cc_set(&preq->cc, 0);
 	}
 	/* --END ERROR HANDLING-- */
     }
@@ -311,7 +311,7 @@ int MPID_Recv_init(void * buf, int count, MPI_Datatype datatype, int rank, int t
     MPIU_Object_set_ref(rreq, 1);
     rreq->kind = MPID_PREQUEST_RECV;
     rreq->comm = comm;
-    MPID_cc_set(&rreq->cc, 0);
+    MPIR_cc_set(&rreq->cc, 0);
     MPIR_Comm_add_ref(comm);
     rreq->dev.match.parts.rank = rank;
     rreq->dev.match.parts.tag = tag;
diff --git a/src/mpid/ch3/src/mpidi_isend_self.c b/src/mpid/ch3/src/mpidi_isend_self.c
index 7dfdf22..2a13390 100644
--- a/src/mpid/ch3/src/mpidi_isend_self.c
+++ b/src/mpid/ch3/src/mpidi_isend_self.c
@@ -61,7 +61,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
     /* 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
      * bother finishing this. */
-    if (!found && MPID_cc_get(rreq->cc) == 0) {
+    if (!found && MPIR_cc_get(rreq->cc) == 0) {
         /* We release the send request twice, once to release the
          * progress engine reference and the second to release the
          * user reference since the user will never have a chance to
diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index 54692f5..c9db086 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -295,15 +295,6 @@ M*/
 #define MPIDU_Thread_tls_get MPIU_Thread_tls_get
 
 
-#define MPIDU_cc_t            MPIU_cc_t
-#define MPIDU_cc_get          MPIU_cc_get
-#define MPIDU_cc_set          MPIU_cc_set
-#define MPIDU_cc_is_complete  MPIU_cc_is_complete
-#define MPIDU_cc_incr         MPIU_cc_incr
-#define MPIDU_cc_decr         MPIU_cc_decr
-
-#define MPIDU_OBJ_PUBLISH_HANDLE  MPIU_OBJ_PUBLISH_HANDLE
-
 #define MPIDU_THREADPRIV_INITKEY  MPIU_THREADPRIV_INITKEY
 #define MPIDU_THREADPRIV_INIT     MPIU_THREADPRIV_INIT
 #define MPIDU_THREADPRIV_GET      MPIU_THREADPRIV_GET
diff --git a/src/mpid/pamid/src/mpid_imrecv.c b/src/mpid/pamid/src/mpid_imrecv.c
index 68a011a..7bbb7ab 100644
--- a/src/mpid/pamid/src/mpid_imrecv.c
+++ b/src/mpid/pamid/src/mpid_imrecv.c
@@ -80,7 +80,7 @@ int MPID_Imrecv(void *buf, int count, MPI_Datatype datatype,
 #endif
 
 #ifdef MPIDI_STATISTICS
-  if (!(MPID_cc_is_complete(&rreq->cc)))
+  if (!(MPIR_cc_is_complete(&rreq->cc)))
     {
         MPID_NSTAT(mpid_statp->recvWaitsComplete);
     }
diff --git a/src/mpid/pamid/src/mpid_request.c b/src/mpid/pamid/src/mpid_request.c
index 19d2c6c..df284ff 100644
--- a/src/mpid/pamid/src/mpid_request.c
+++ b/src/mpid/pamid/src/mpid_request.c
@@ -76,13 +76,13 @@ MPIDI_Request_uncomplete(MPID_Request *req)
 {
   int count;
   MPIU_Object_add_ref(req);
-  MPID_cc_incr(req->cc_ptr, &count);
+  MPIR_cc_incr(req->cc_ptr, &count);
 }
 
 
 void
 MPID_Request_set_completed(MPID_Request *req)
 {
-  MPID_cc_set(&req->cc, 0);
+  MPIR_cc_set(&req->cc, 0);
   MPIDI_Progress_signal();
 }
diff --git a/src/mpid/pamid/src/mpid_request.h b/src/mpid/pamid/src/mpid_request.h
index a9fb6de..462b726 100644
--- a/src/mpid/pamid/src/mpid_request.h
+++ b/src/mpid/pamid/src/mpid_request.h
@@ -153,7 +153,7 @@ MPIDI_Request_create_basic()
   MPIDI_Request_tls_alloc(req);
   MPID_assert(req != NULL);
   MPID_assert(HANDLE_GET_MPI_KIND(req->handle) == MPID_REQUEST);
-  MPID_cc_set(&req->cc, 1);
+  MPIR_cc_set(&req->cc, 1);
   req->cc_ptr = &req->cc;
 
 #if 0
@@ -278,7 +278,7 @@ MPID_Request_release_inline(MPID_Request *req)
 
   if (count == 0)
   {
-    MPID_assert(MPID_cc_is_complete(&req->cc));
+    MPID_assert(MPIR_cc_is_complete(&req->cc));
 
     if (req->comm)              MPIR_Comm_release(req->comm, 0);
     if (req->greq_fns)          MPIU_Free(req->greq_fns);
@@ -323,7 +323,7 @@ static inline void
 MPIDI_Request_complete_inline(MPID_Request *req)
 {
     int count;
-    MPID_cc_decr(req->cc_ptr, &count);
+    MPIR_cc_decr(req->cc_ptr, &count);
     MPID_assert(count >= 0);
 
     MPID_Request_release(req);
@@ -338,7 +338,7 @@ static inline void
 MPIDI_Request_complete_norelease_inline(MPID_Request *req)
 {
     int count;
-    MPID_cc_decr(req->cc_ptr, &count);
+    MPIR_cc_decr(req->cc_ptr, &count);
     MPID_assert(count >= 0);
 
     if (count == 0) /* decrement completion count; if 0, signal progress engine */
diff --git a/src/mpid/pamid/src/mpix/mpix.c b/src/mpid/pamid/src/mpix/mpix.c
index fdb2d28..6385e87 100644
--- a/src/mpid/pamid/src/mpix/mpix.c
+++ b/src/mpid/pamid/src/mpix/mpix.c
@@ -733,7 +733,7 @@ MPIX_Pset_same_comm_create_from_parent (MPI_Comm parent_comm, MPI_Comm *pset_com
   mpi_errno = _MPIX_Pset_same_comm_create (parent_comm_ptr, &pset_comm_ptr);
   if (mpi_errno) MPIU_ERR_POP(mpi_errno);
   if (pset_comm_ptr)
-    MPIU_OBJ_PUBLISH_HANDLE(*pset_comm, pset_comm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*pset_comm, pset_comm_ptr->handle);
   else
     goto fn_fail;
 
@@ -800,7 +800,7 @@ MPIX_Pset_diff_comm_create_from_parent (MPI_Comm parent_comm, MPI_Comm *pset_com
   mpi_errno = MPIR_Comm_split_impl(parent_comm_ptr, color, key, &pset_diff_comm_ptr);
   if (mpi_errno) MPIU_ERR_POP(mpi_errno);
   if (pset_diff_comm_ptr)
-    MPIU_OBJ_PUBLISH_HANDLE(*pset_comm, pset_diff_comm_ptr->handle);
+    MPIR_OBJ_PUBLISH_HANDLE(*pset_comm, pset_diff_comm_ptr->handle);
   else
     goto fn_fail;
 
diff --git a/src/mpid/pamid/src/onesided/mpid_1s.c b/src/mpid/pamid/src/onesided/mpid_1s.c
index f46c0ba..87358f0 100644
--- a/src/mpid/pamid/src/onesided/mpid_1s.c
+++ b/src/mpid/pamid/src/onesided/mpid_1s.c
@@ -79,7 +79,7 @@ MPIDI_Win_DoneCB(pami_context_t  context,
            *
            * See MPID_Request_release_inline()
            */
-          MPID_cc_set(req_handle->cc_ptr, 0);
+          MPIR_cc_set(req_handle->cc_ptr, 0);
       }
     }
   if ((MPIDI_Process.typed_onesided == 1) && (!req->target.dt.contig || !req->origin.dt.contig)) {
diff --git a/src/mpid/pamid/src/onesided/mpid_win_accumulate.c b/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
index 26ed220..50255d6 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_accumulate.c
@@ -245,7 +245,7 @@ MPID_Accumulate(const void   *origin_addr,
        (target_rank == MPI_PROC_NULL))
     {
       if(req->req_handle)
-        MPID_cc_set(req->req_handle->cc_ptr, 0);
+        MPIR_cc_set(req->req_handle->cc_ptr, 0);
       else
         MPIU_Free(req);
       return MPI_SUCCESS;
diff --git a/src/mpid/pamid/src/onesided/mpid_win_get.c b/src/mpid/pamid/src/onesided/mpid_win_get.c
index 338c4ab..8bd68cc 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_get.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_get.c
@@ -287,7 +287,7 @@ MPID_Get(void         *origin_addr,
        (target_rank == MPI_PROC_NULL))
     {
       if(req->req_handle)
-         MPID_cc_set(req->req_handle->cc_ptr, 0);
+         MPIR_cc_set(req->req_handle->cc_ptr, 0);
       else
          MPIU_Free(req);
       return MPI_SUCCESS;
@@ -319,7 +319,7 @@ MPID_Get(void         *origin_addr,
        * See MPID_Request_release_inline()
        */
       if(req->req_handle)
-        MPID_cc_set(req->req_handle->cc_ptr, 0);
+        MPIR_cc_set(req->req_handle->cc_ptr, 0);
       else
         MPIU_Free(req);
       return mpi_errno;
diff --git a/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c b/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c
index f57eddb..3831757 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_get_accumulate.c
@@ -202,7 +202,7 @@ MPIDI_Win_GetAccDoneCB(pami_context_t  context,
        * See MPID_Request_release_inline()
        */
       if(req_handle)
-          MPID_cc_set(req_handle->cc_ptr, 0);
+          MPIR_cc_set(req_handle->cc_ptr, 0);
     }
   MPIDI_Progress_signal();
 }
@@ -459,7 +459,7 @@ MPID_Get_accumulate(const void   * origin_addr,
        (target_rank == MPI_PROC_NULL))
     {
       if(req->req_handle)
-         MPID_cc_set(req->req_handle->cc_ptr, 0);
+         MPIR_cc_set(req->req_handle->cc_ptr, 0);
       else
          MPIU_Free(req);
       return MPI_SUCCESS;
@@ -526,7 +526,7 @@ MPID_Get_accumulate(const void   * origin_addr,
        MPIDI_Win_datatype_unmap(&req->result.dt);
 
        if(req->req_handle) {
-          MPID_cc_set(req->req_handle->cc_ptr, 0);
+          MPIR_cc_set(req->req_handle->cc_ptr, 0);
        } else { 
            MPIU_Free(req);
        }
diff --git a/src/mpid/pamid/src/onesided/mpid_win_put.c b/src/mpid/pamid/src/onesided/mpid_win_put.c
index 625676e..f2329ec 100644
--- a/src/mpid/pamid/src/onesided/mpid_win_put.c
+++ b/src/mpid/pamid/src/onesided/mpid_win_put.c
@@ -291,7 +291,7 @@ MPID_Put(const void   *origin_addr,
        (target_rank == MPI_PROC_NULL))
     {
       if(req->req_handle)
-       MPID_cc_set(req->req_handle->cc_ptr, 0);
+       MPIR_cc_set(req->req_handle->cc_ptr, 0);
       else
        MPIU_Free(req);
       return MPI_SUCCESS;
@@ -322,7 +322,7 @@ MPID_Put(const void   *origin_addr,
        * See MPID_Request_release_inline()
        */
        if(req->req_handle)
-         MPID_cc_set(req->req_handle->cc_ptr, 0);
+         MPIR_cc_set(req->req_handle->cc_ptr, 0);
        else
          MPIU_Free(req);
        return mpi_errno;
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_done.c b/src/mpid/pamid/src/pt2pt/mpidi_done.c
index 7636448..31b4ac0 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_done.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_done.c
@@ -215,7 +215,7 @@ void MPIDI_Recvq_process_out_of_order_msgs(pami_task_t src, pami_context_t conte
         else
 #endif
           MPIDI_Recvq_remove(MPIDI_Recvq.unexpected, ooreq, ooreq->mpid.prev);
-	if (!MPID_cc_is_complete(&ooreq->cc)) {
+        if (!MPIR_cc_is_complete(&ooreq->cc)) {
 	  ooreq->mpid.oo_peer = rreq;
           MPIDI_RecvMsg_Unexp(ooreq, rreq->mpid.userbuf, rreq->mpid.userbufcount, rreq->mpid.datatype);
 	} else {
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_recv.h b/src/mpid/pamid/src/pt2pt/mpidi_recv.h
index 211fbc3..f63cd87 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_recv.h
+++ b/src/mpid/pamid/src/pt2pt/mpidi_recv.h
@@ -245,7 +245,7 @@ MPIDI_Recv(void          * buf,
   if (status != MPI_STATUS_IGNORE)
     *status = rreq->status;
 #ifdef MPIDI_STATISTICS
-    if (!(MPID_cc_is_complete(&rreq->cc)))
+    if (!(MPIR_cc_is_complete(&rreq->cc)))
     {
         MPID_NSTAT(mpid_statp->recvWaitsComplete);
     }
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c b/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c
index 7bdbfba..6eb7ced 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c
@@ -62,7 +62,7 @@ MPIDI_RecvMsg_Unexp(MPID_Request  * rreq,
     }
   else 
     {
-     if (MPID_cc_is_complete(&rreq->cc))
+     if (MPIR_cc_is_complete(&rreq->cc))
      {
       if (unlikely(MPIDI_Request_isSync(rreq)))
       {
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c b/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c
index ec61b77..4826696 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c
@@ -498,7 +498,7 @@ if (!TOKEN_FLOW_CONTROL_ON) {
                           sndbuf,
                           data_sz);
 #ifdef MPIDI_STATISTICS
-      if (!isLocal && MPID_cc_is_complete(&sreq->cc))
+      if (!isLocal && MPIR_cc_is_complete(&sreq->cc))
         {
           MPID_NSTAT(mpid_statp->sendsComplete);
         }
@@ -529,7 +529,7 @@ if (!TOKEN_FLOW_CONTROL_ON) {
         }
 
 #ifdef MPIDI_STATISTICS
-      if (!isLocal && MPID_cc_is_complete(&sreq->cc))
+      if (!isLocal && MPIR_cc_is_complete(&sreq->cc))
         {
           MPID_NSTAT(mpid_statp->sendsComplete);
         }
@@ -598,7 +598,7 @@ if (!TOKEN_FLOW_CONTROL_ON) {
                                  sndbuf,
                                  data_sz);
 #ifdef MPIDI_STATISTICS
-                    if (MPID_cc_is_complete(&sreq->cc)) {
+                    if (MPIR_cc_is_complete(&sreq->cc)) {
                         MPID_NSTAT(mpid_statp->sendsComplete);
                     }
 #endif
@@ -616,7 +616,7 @@ if (!TOKEN_FLOW_CONTROL_ON) {
                                   sndbuf,
                                   data_sz);
 #ifdef MPIDI_STATISTICS
-                       if (MPID_cc_is_complete(&sreq->cc))
+                       if (MPIR_cc_is_complete(&sreq->cc))
                        {
                           MPID_NSTAT(mpid_statp->sendsComplete);
                        }
@@ -646,7 +646,7 @@ if (!TOKEN_FLOW_CONTROL_ON) {
               MPIDI_SendMsg_rzv_zerobyte(context, sreq, dest);
             }
 #ifdef MPIDI_STATISTICS
-               if (MPID_cc_is_complete(&sreq->cc))
+               if (MPIR_cc_is_complete(&sreq->cc))
                 {
                    MPID_NSTAT(mpid_statp->sendsComplete);
                 }
diff --git a/src/util/Makefile.mk b/src/util/Makefile.mk
index 90c7d25..7bde3f8 100644
--- a/src/util/Makefile.mk
+++ b/src/util/Makefile.mk
@@ -10,6 +10,7 @@ include $(top_srcdir)/src/util/logging/Makefile.mk
 include $(top_srcdir)/src/util/mem/Makefile.mk
 include $(top_srcdir)/src/util/cvar/Makefile.mk
 include $(top_srcdir)/src/util/procmap/Makefile.mk
+include $(top_srcdir)/src/util/refcount/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
diff --git a/src/util/refcount/Makefile.mk b/src/util/refcount/Makefile.mk
new file mode 100644
index 0000000..cea1625
--- /dev/null
+++ b/src/util/refcount/Makefile.mk
@@ -0,0 +1,14 @@
+## -*- 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/refcount
+
+noinst_HEADERS +=                               \
+    src/util/refcount/mpir_refcount.h           \
+    src/util/refcount/mpir_refcount_global.h	\
+    src/util/refcount/mpir_refcount_pobj.h	\
+    src/util/refcount/mpir_refcount_single.h
diff --git a/src/util/refcount/mpir_refcount.h b/src/util/refcount/mpir_refcount.h
new file mode 100644
index 0000000..f7d0e14
--- /dev/null
+++ b/src/util/refcount/mpir_refcount.h
@@ -0,0 +1,26 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPIR_REFCOUNT_H_INCLUDED)
+#define MPIR_REFCOUNT_H_INCLUDED
+
+#include "mpi.h"
+#include "mpichconf.h"
+
+#if MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE
+
+#if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL
+#include "mpir_refcount_global.h"
+#elif MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_PER_OBJECT
+#include "mpir_refcount_obj.h"
+#endif
+
+#else
+#include "mpir_refcount_single.h"
+
+#endif
+
+#endif /* !defined(MPIR_REFCOUNT_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_single.h b/src/util/refcount/mpir_refcount_global.h
similarity index 55%
copy from src/util/thread/mpiu_thread_single.h
copy to src/util/refcount/mpir_refcount_global.h
index c16f3fb..9f01da2 100644
--- a/src/util/thread/mpiu_thread_single.h
+++ b/src/util/refcount/mpir_refcount_global.h
@@ -4,41 +4,23 @@
  *      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 MPIUI_Per_thread_t MPIUI_Thread;
-
-#define MPIU_THREADPRIV_INITKEY
-#define MPIU_THREADPRIV_INIT
-#define MPIU_THREADPRIV_DECL
-#define MPIU_THREADPRIV_GET
-#define MPIU_THREADPRIV_FIELD(a_) (MPIUI_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)
-
+#if !defined(MPIR_REFCOUNT_GLOBAL_H_INCLUDED)
+#define MPIR_REFCOUNT_GLOBAL_H_INCLUDED
 
 /* 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_)  \
+/* 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 MPIR_cc_t;
+#define MPIR_cc_get(cc_) (cc_)
+#define MPIR_cc_set(cc_ptr_, val_) (*(cc_ptr_)) = (val_)
+#define MPIR_cc_is_complete(cc_ptr_) (0 == *(cc_ptr_))
+
+#define MPIR_cc_incr(cc_ptr_, was_incomplete_)  \
     do {                                        \
         *(was_incomplete_) = (*(cc_ptr_))++;    \
     } while (0)
 
-#define MPIU_cc_decr(cc_ptr_, incomplete_)      \
+#define MPIR_cc_decr(cc_ptr_, incomplete_)      \
     do {                                        \
         *(incomplete_) = --(*(cc_ptr_));        \
     } while (0)
@@ -58,9 +40,9 @@ typedef int MPIU_cc_t;
 /* 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_)     \
+#define MPIR_OBJ_PUBLISH_HANDLE(hnd_lval_, handle_)     \
     do {                                                \
         (hnd_lval_) = (handle_);                        \
     } while (0)
 
-#endif /* !defined(MPIU_THREAD_SINGLE_H_INCLUDED) */
+#endif /* !defined(MPIR_REFCOUNT_MULTIPLE_H_INCLUDED) */
diff --git a/src/util/refcount/mpir_refcount_pobj.h b/src/util/refcount/mpir_refcount_pobj.h
new file mode 100644
index 0000000..1631b7e
--- /dev/null
+++ b/src/util/refcount/mpir_refcount_pobj.h
@@ -0,0 +1,108 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#if !defined(MPIR_REFCOUNT_POBJ_H_INCLUDED)
+#define MPIR_REFCOUNT_POBJ_H_INCLUDED
+
+/* define a type for the completion counter */
+#include "opa_primitives.h"
+
+typedef OPA_int_t MPIR_cc_t;
+
+/* implies no barrier, since this routine should only be used for request
+ * initialization */
+static inline void MPIR_cc_set(MPIR_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 MPIR_cc_is_complete(MPIR_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 MPIR_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 MPIR_cc_incr(cc_ptr_, was_incomplete_)                  \
+    do {                                                        \
+        *(was_incomplete_) = OPA_fetch_and_incr_int(cc_ptr_);   \
+    } while (0)
+
+#define MPIR_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 MPIR_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(MPIR_REFCOUNT_POBJ_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_single.h b/src/util/refcount/mpir_refcount_single.h
similarity index 55%
copy from src/util/thread/mpiu_thread_single.h
copy to src/util/refcount/mpir_refcount_single.h
index c16f3fb..3ae7758 100644
--- a/src/util/thread/mpiu_thread_single.h
+++ b/src/util/refcount/mpir_refcount_single.h
@@ -4,41 +4,22 @@
  *      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 MPIUI_Per_thread_t MPIUI_Thread;
-
-#define MPIU_THREADPRIV_INITKEY
-#define MPIU_THREADPRIV_INIT
-#define MPIU_THREADPRIV_DECL
-#define MPIU_THREADPRIV_GET
-#define MPIU_THREADPRIV_FIELD(a_) (MPIUI_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)
-
+#if !defined(MPIR_REFCOUNT_SINGLE_H_INCLUDED)
+#define MPIR_REFCOUNT_SINGLE_H_INCLUDED
 
 /* define a type for the completion counter */
-typedef int MPIU_cc_t;
+typedef int MPIR_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 MPIR_cc_get(cc_) (cc_)
+#define MPIR_cc_set(cc_ptr_, val_) (*(cc_ptr_)) = (val_)
+#define MPIR_cc_is_complete(cc_ptr_) (0 == *(cc_ptr_))
 
-#define MPIU_cc_incr(cc_ptr_, was_incomplete_)  \
+#define MPIR_cc_incr(cc_ptr_, was_incomplete_)  \
     do {                                        \
         *(was_incomplete_) = (*(cc_ptr_))++;    \
     } while (0)
 
-#define MPIU_cc_decr(cc_ptr_, incomplete_)      \
+#define MPIR_cc_decr(cc_ptr_, incomplete_)      \
     do {                                        \
         *(incomplete_) = --(*(cc_ptr_));        \
     } while (0)
@@ -58,9 +39,9 @@ typedef int MPIU_cc_t;
 /* 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_)     \
+#define MPIR_OBJ_PUBLISH_HANDLE(hnd_lval_, handle_)     \
     do {                                                \
         (hnd_lval_) = (handle_);                        \
     } while (0)
 
-#endif /* !defined(MPIU_THREAD_SINGLE_H_INCLUDED) */
+#endif /* !defined(MPIR_REFCOUNT_SINGLE_H_INCLUDED) */
diff --git a/src/util/thread/mpiu_thread_global.h b/src/util/thread/mpiu_thread_global.h
index 09ef314..1eb9884 100644
--- a/src/util/thread/mpiu_thread_global.h
+++ b/src/util/thread/mpiu_thread_global.h
@@ -22,43 +22,4 @@
 #define MPIUI_THREAD_CS_EXIT_POBJ(mutex) do {} while (0)
 #define MPIUI_THREAD_CS_YIELD_POBJ(mutex) do {} while (0)
 
-
-/* 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_pobj.h b/src/util/thread/mpiu_thread_pobj.h
index a036884..0aa53d7 100644
--- a/src/util/thread/mpiu_thread_pobj.h
+++ b/src/util/thread/mpiu_thread_pobj.h
@@ -89,102 +89,4 @@
 #define MPIUI_THREAD_CS_EXIT_GLOBAL(mutex) do {} while (0)
 #define MPIUI_THREAD_CS_YIELD_GLOBAL(mutex) do {} 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_single.h b/src/util/thread/mpiu_thread_single.h
index c16f3fb..646d483 100644
--- a/src/util/thread/mpiu_thread_single.h
+++ b/src/util/thread/mpiu_thread_single.h
@@ -25,42 +25,4 @@ extern MPIUI_Per_thread_t MPIUI_Thread;
 #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) */

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

commit 5cb1bedf62285019b8ffe881da083cb9e603131c
Author: Pavan Balaji <balaji at anl.gov>
Date:   Mon Jan 18 20:52:42 2016 -0600

    threads: fix duplicate definition.
    
    We had somehow missed the definition of MPIDU_Thread_yield and instead
    defined MPIDU_Thread_same twice.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index 8b5705d..54692f5 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -140,7 +140,7 @@ M*/
 /*@
   MPIDU_Thread_yield - voluntarily relinquish the CPU, giving other threads an opportunity to run
 @*/
-#define MPIDU_Thread_same       MPIU_Thread_same
+#define MPIDU_Thread_yield      MPIU_Thread_yield
 
 /*
  *    Mutexes

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

commit ca025aef5251368c3ece5d7bb8f31112fd4678c2
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 6 20:56:16 2016 -0600

    threads: fix bugs in the thread mutex declarations.
    
    We should always use the MPID thread mutexes, and not directly the MPIU
    thread mutexes.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/include/mpitimpl.h b/src/include/mpitimpl.h
index 48bf02b..992ac72 100644
--- a/src/include/mpitimpl.h
+++ b/src/include/mpitimpl.h
@@ -1390,7 +1390,7 @@ extern int MPIR_T_is_threaded;
 #define MPIR_T_THREAD_CHECK_END }
 
 #ifdef MPICH_IS_THREADED
-extern MPIU_Thread_mutex_t mpi_t_mutex;
+extern MPID_Thread_mutex_t mpi_t_mutex;
 #define MPIR_T_THREAD_CS_INIT() \
     do { \
         int err_; \
diff --git a/src/mpi_t/mpit.c b/src/mpi_t/mpit.c
index d25ec93..d814f34 100644
--- a/src/mpi_t/mpit.c
+++ b/src/mpi_t/mpit.c
@@ -9,7 +9,7 @@
 int MPIR_T_init_balance = 0;
 
 #ifdef MPICH_IS_THREADED
-MPIU_Thread_mutex_t mpi_t_mutex;
+MPID_Thread_mutex_t mpi_t_mutex;
 int MPIR_T_is_threaded;
 #endif
 

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

commit ca995aa6962a0eb2dcf23e30bbc7396237ee22f5
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 6 22:57:35 2016 -0600

    threads: comments were referring to MPIU versions.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpid/common/thread/mpidu_thread_fallback.h b/src/mpid/common/thread/mpidu_thread_fallback.h
index b7e65ca..8b5705d 100644
--- a/src/mpid/common/thread/mpidu_thread_fallback.h
+++ b/src/mpid/common/thread/mpidu_thread_fallback.h
@@ -64,7 +64,7 @@ typedef MPIU_Thread_id_t    MPIDU_Thread_id_t;
 typedef MPIU_Thread_tls_t   MPIDU_Thread_tls_t;
 typedef MPIU_Thread_func_t  MPIDU_Thread_func_t;
 
-/*M MPIU_THREAD_CS_ENTER - Enter a named critical section
+/*M MPIDU_THREAD_CS_ENTER - Enter a named critical section
 
   Input Parameters:
 + _name - name of the critical section
@@ -73,7 +73,7 @@ typedef MPIU_Thread_func_t  MPIDU_Thread_func_t;
 M*/
 #define MPIDU_THREAD_CS_ENTER       MPIU_THREAD_CS_ENTER
 
-/*M MPIU_THREAD_CS_EXIT - Exit a named critical section
+/*M MPIDU_THREAD_CS_EXIT - Exit a named critical section
 
   Input Parameters:
 + _name - cname of the critical section
@@ -82,7 +82,7 @@ M*/
 M*/
 #define MPIDU_THREAD_CS_EXIT        MPIU_THREAD_CS_EXIT
 
-/*M MPIU_THREAD_CS_YIELD - Temporarily release a critical section and yield
+/*M MPIDU_THREAD_CS_YIELD - Temporarily release a critical section and yield
     to other threads
 
   Input Parameters:

http://git.mpich.org/mpich.git/commitdiff/22cd1f15b8cda4987c6e100bc1ecdd4f99b9ff88

commit 22cd1f15b8cda4987c6e100bc1ecdd4f99b9ff88
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 7 21:03:09 2016 -0600

    threads: remove thread-local handle allocation.
    
    This code is very broken and should be redone at some point.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index dec6720..17d9fe4 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -256,43 +256,12 @@ extern MPIDI_Process_t MPIDI_Process;
 /* FIXME XXX DJG for TLS hack */
 #define MPID_REQUEST_TLS_MAX 128
 
-#if MPIU_HANDLE_ALLOCATION_METHOD == MPIU_HANDLE_ALLOCATION_THREAD_LOCAL
-#  define MPIDI_Request_tls_alloc(req) \
-    do { \
-        int i;                                                         \
-        MPID_THREADPRIV_DECL;                                          \
-        MPID_THREADPRIV_GET;                                           \
-        if (!MPID_THREADPRIV_FIELD(request_handles)) {                 \
-            MPID_Request *prev, *cur;                                  \
-            /* batch allocate a linked list of requests */             \
-            MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_HANDLE_MUTEX);                        \
-            prev = MPIU_Handle_obj_alloc_unsafe(&MPID_Request_mem);    \
-            prev->next = NULL;                                         \
-            assert(prev);                                              \
-            for (i = 1; i < MPID_REQUEST_TLS_MAX; ++i) {               \
-                cur = MPIU_Handle_obj_alloc_unsafe(&MPID_Request_mem); \
-                assert(cur);                                           \
-                cur->next = prev;                                      \
-                prev = cur;                                            \
-            }                                                          \
-            MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_HANDLE_MUTEX);                         \
-            MPID_THREADPRIV_FIELD(request_handles) = cur;              \
-            MPID_THREADPRIV_FIELD(request_handle_count) += MPID_REQUEST_TLS_MAX;    \
-        }                                                              \
-        (req) = MPID_THREADPRIV_FIELD(request_handles);                \
-        MPID_THREADPRIV_FIELD(request_handles) = req->next;            \
-        MPID_THREADPRIV_FIELD(request_handle_count) -= 1;              \
-    } while (0)
-#elif MPIU_HANDLE_ALLOCATION_METHOD == MPIU_HANDLE_ALLOCATION_MUTEX
 #  define MPIDI_Request_tls_alloc(req_) \
     do { \
 	(req_) = MPIU_Handle_obj_alloc(&MPID_Request_mem); \
         MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL,VERBOSE,		\
 	       "allocated request, handle=0x%08x", req_);\
     } while (0)
-#else
-#  error MPIU_HANDLE_ALLOCATION_METHOD not defined
-#endif
 
 
 /* If the channel doesn't initialize anything in the request, 

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

commit d4e2ed9cb185e8bbf60cce25d2aa1d7b78be91a2
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 7 03:59:43 2016 -0600

    threads: check for C11 thread-local storage.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/confdb/ax_tls.m4 b/confdb/ax_tls.m4
index 0a9ed69..ef0f4d9 100644
--- a/confdb/ax_tls.m4
+++ b/confdb/ax_tls.m4
@@ -46,7 +46,7 @@
 AC_DEFUN([AX_TLS], [
   AC_MSG_CHECKING(for thread local storage specifier)
   AC_CACHE_VAL(ac_cv_tls, [
-    ax_tls_keywords="__thread __declspec(thread) none"
+    ax_tls_keywords="_Thread_local __thread __declspec(thread) none"
     for ax_tls_keyword in $ax_tls_keywords; do
        case $ax_tls_keyword in
           none) ac_cv_tls=none ; break ;;

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

commit c6040586b21ab0fc037302fc973fd37b952c4bad
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 7 12:44:45 2016 -0600

    threads: tls configure fix.
    
    We cannot compute on variables with just extern declarations.  We need a
    full declaration.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/confdb/ax_tls.m4 b/confdb/ax_tls.m4
index 3f6a0ac..0a9ed69 100644
--- a/confdb/ax_tls.m4
+++ b/confdb/ax_tls.m4
@@ -69,7 +69,11 @@ AC_DEFUN([AX_TLS], [
 	     PAC_APPEND_FLAG([-shared],[LIBS])
 	     if test "$ac_cv_tls" != "none" ; then
                 AC_LINK_IFELSE(
-			[AC_LANG_PROGRAM([extern $ax_tls_keyword int bar;],[++bar;])],
+			[AC_LANG_PROGRAM(
+				[
+					extern $ax_tls_keyword int bar;
+					$ax_tls_keyword int bar = 0;
+				],[++bar;])],
                         [ac_cv_tls=$ax_tls_keyword],
                         [ac_cv_tls=none])
 	     fi

http://git.mpich.org/mpich.git/commitdiff/2019f1ce369fc147558526146927a1fa29a805ac

commit 2019f1ce369fc147558526146927a1fa29a805ac
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 20 12:02:47 2016 -0600

    mem: move mpimem.h to before memory routines are used.
    
    We were using memory allocation routines before the corresponding
    header was included.  The code works without this change because we
    are including mpiu_thread.h, which implicitly includes mpimem.h.  If
    we remove the dependency of threads on mpimem.h, this would break.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index c2dd156..4f5877e 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -122,6 +122,9 @@ int usleep(useconds_t usec);
 
 #include "mpir_type_defs.h"
 
+/* Routines for memory management */
+#include "mpimem.h"
+
 /* Overriding memcpy:
      This is a utility function for memory copy.  The device might use
      this directly or override it with a different device-specific
@@ -160,9 +163,6 @@ int usleep(useconds_t usec);
 /* end of mpidebug.h */
 /* ------------------------------------------------------------------------- */
 
-/* Routines for memory management */
-#include "mpimem.h"
-
 #if defined HAVE_LIBHCOLL
 #include "../mpid/common/hcoll/hcollpre.h"
 #endif

http://git.mpich.org/mpich.git/commitdiff/97a6552e698c89ce151a18569788428e07dd30b9

commit 97a6552e698c89ce151a18569788428e07dd30b9
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Jan 8 13:38:40 2016 -0600

    utils: move sched yield code to MPL.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/configure.ac b/configure.ac
index 0e27ce4..5326611 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5008,70 +5008,6 @@ AX_TLS
 
 AC_CHECK_FUNCS(getpid)
 
-# Choose a method to yield the procesor.
-
-# If the user specified a method to use, we check if it's available.
-# If a method was not specified, we make a guess based on the OS.  The
-# default is to use sched_yield() or yield() if one is available,
-# otherwise, default to nothing.  After that we define the appropriate
-# macro.
-
-AC_CHECK_HEADERS(sched.h)
-AC_CHECK_HEADERS(unistd.h)
-AC_CHECK_HEADERS(sys/select.h)
-AC_CHECK_FUNCS(sched_yield yield usleep sleep select)
-
-if test "$ac_cv_func_usleep" = "yes" ; then
-    PAC_FUNC_NEEDS_DECL([#include <unistd.h>],usleep)
-fi
-
-AC_ARG_ENABLE([yield], 
-    [AS_HELP_STRING([--enable-yield], [choose a method to yield the processor in busy loops.  Available methods are: sched_yield, yield, select, usleep, sleep, nothing])], 
-    [AS_CASE([$enableval],
-        [sched_yield], [AS_IF([test "x$ac_cv_func_sched_yield" != "xyes"], [enable_yield=unavail])],
-        [yield],       [AS_IF([test "x$ac_cv_func_yield"       != "xyes"], [enable_yield=unavail])],
-        [select],      [AS_IF([test "x$ac_cv_func_select"      != "xyes"], [enable_yield=unavail])],
-        [usleep],      [AS_IF([test "x$ac_cv_func_usleep"      != "xyes"], [enable_yield=unavail])],
-        [sleep],       [AS_IF([test "x$ac_cv_func_sleep"       != "xyes"], [enable_yield=unavail])],
-        [nothing|no|none], [],
-        [AC_MSG_ERROR([Invalid option $enableval for --enable-yield])])
-
-     AS_IF([test "x$enable_yield" = "xunavail"], 
-              [AC_MSG_ERROR([Yield method $enableval is not available on this platform.])])
-    ],
-    [# none specified by user; make a guess based on os
-     AS_CASE([$host],
-        [*-*-darwin*], 
-            [# In Lion, sched_yield worked but none of the other options had any effect
-             AS_IF([test "x$ac_cv_func_sched_yield" = "xyes"], [enable_yield=sched_yield],
-                   [enable_yield=nothing])],
-        [*-*-linux*], 
-            [# sched_yield() has been broken in linux since 2.6.23, and no good alternative exists.
-             enable_yield=nothing],
-        [# default: just use sched_yield() or yield()
-         AS_IF([test "x$ac_cv_func_sched_yield" = "xyes"], [enable_yield=sched_yield],
-               [test "x$ac_cv_func_yield" = "xyes"], [enable_yield=yield],
-               [enable_yield=nothing])])
-    ]
-)
-
-# set the appropriate macro
-AS_CASE([$enable_yield],
-    [sched_yield], 
-        [AC_DEFINE(USE_SCHED_YIELD_FOR_YIELD,1,[Define to use sched_yield to yield processor])],
-    [yield],
-        [AC_DEFINE(USE_YIELD_FOR_YIELD,1,[Define to use yield to yield processor])],
-    [select],
-        [AC_DEFINE(USE_SELECT_FOR_YIELD,1,[Define to use select to yield processor])],
-    [usleep],
-        [AC_DEFINE(USE_USLEEP_FOR_YIELD,1,[Define to use usleep to yield processor])],
-    [sleep],
-        [AC_DEFINE(USE_SLEEP_FOR_YIELD,1,[Define to use sleep to yield processor])],
-    [nothing|no|none],
-        [AC_DEFINE(USE_NOTHING_FOR_YIELD,1,[Define to use nothing to yield processor])],
-    [AC_MSG_ERROR([Invalid value $enable_yield for enable_yield.])]
-)
-
 # Check for the Linux functions for controlling processor affinity.
 # LINUX: sched_setaffinity
 # AIX:   bindprocessor
diff --git a/src/mpid/ch3/channels/nemesis/include/mpid_nem_debug.h b/src/mpid/ch3/channels/nemesis/include/mpid_nem_debug.h
index 0b19d11..9a4b783 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_debug.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_debug.h
@@ -9,7 +9,7 @@
 
 /*#define YIELD_IN_SKIP*/
 #ifdef YIELD_IN_SKIP
-#define SKIP MPIU_PW_Sched_yield()
+#define SKIP MPL_sched_yield()
 #warning "SKIP is yield"
 #else /* YIELD_IN_SKIP */
 #define SKIP do{}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 f5f6d38..b7450a4 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
@@ -75,7 +75,7 @@ cvars:
             static int poll_count_ = 0;                         \
             if (poll_count_ >= MPIR_CVAR_POLLS_BEFORE_YIELD) { \
                 poll_count_ = 0;                                \
-                MPIU_PW_Sched_yield();                          \
+                MPL_sched_yield();                              \
             } else {                                            \
                 ++poll_count_;                                  \
             }                                                   \
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c b/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c
index b95844a..a76bd91 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3i_comm.c
@@ -216,7 +216,7 @@ static int barrier(MPID_Comm *comm_ptr, MPIR_Errflag_t *errflag)
     else
     {
         while (OPA_load_int(&barrier_vars->sig) == sense)
-            MPIU_PW_Sched_yield();
+            MPL_sched_yield();
     }
 
  fn_exit:
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 5b2e09b..e2c7910 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_barrier.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_barrier.c
@@ -61,7 +61,7 @@ int MPID_nem_barrier(void)
     {
 	/* wait */
 	while (OPA_load_int(&MPID_nem_mem_region.barrier->wait) == sense)
-            MPIU_PW_Sched_yield(); /* skip */
+            MPL_sched_yield(); /* skip */
     }
     sense = 1 - sense;
 
diff --git a/src/mpl/configure.ac b/src/mpl/configure.ac
index 647c3bd..98cad7d 100644
--- a/src/mpl/configure.ac
+++ b/src/mpl/configure.ac
@@ -463,6 +463,75 @@ AC_SUBST(MPL_TIMER_TYPE)
 #######################################################################
 
 
+#######################################################################
+## START OF PROCESSOR YIELD CODE
+#######################################################################
+# If the user specified a method to use, we check if it's available.
+# If a method was not specified, we make a guess based on the OS.  The
+# default is to use sched_yield() or yield() if one is available,
+# otherwise, default to nothing.  After that we define the appropriate
+# macro.
+
+AC_CHECK_HEADERS(sched.h)
+AC_CHECK_HEADERS(unistd.h)
+AC_CHECK_HEADERS(sys/select.h)
+AC_CHECK_FUNCS(sched_yield yield usleep sleep select)
+
+if test "$ac_cv_func_usleep" = "yes" ; then
+    PAC_FUNC_NEEDS_DECL([#include <unistd.h>],usleep)
+fi
+
+AC_ARG_ENABLE([yield],
+    [AS_HELP_STRING([--enable-yield], [choose a method to yield the processor in busy loops.  Available methods are: sched_yield, yield, select, usleep, sleep, nothing])],
+    [AS_CASE([$enableval],
+        [sched_yield], [AS_IF([test "x$ac_cv_func_sched_yield" != "xyes"], [enable_yield=unavail])],
+        [yield],       [AS_IF([test "x$ac_cv_func_yield"       != "xyes"], [enable_yield=unavail])],
+        [select],      [AS_IF([test "x$ac_cv_func_select"      != "xyes"], [enable_yield=unavail])],
+        [usleep],      [AS_IF([test "x$ac_cv_func_usleep"      != "xyes"], [enable_yield=unavail])],
+        [sleep],       [AS_IF([test "x$ac_cv_func_sleep"       != "xyes"], [enable_yield=unavail])],
+        [nothing|no|none], [],
+        [AC_MSG_ERROR([Invalid option $enableval for --enable-yield])])
+
+     AS_IF([test "x$enable_yield" = "xunavail"],
+              [AC_MSG_ERROR([Yield method $enableval is not available on this platform.])])
+    ],
+    [# none specified by user; make a guess based on os
+     AS_CASE([$host],
+        [*-*-darwin*],
+            [# In Lion, sched_yield worked but none of the other options had any effect
+             AS_IF([test "x$ac_cv_func_sched_yield" = "xyes"], [enable_yield=sched_yield],
+                   [enable_yield=nothing])],
+        [*-*-linux*],
+            [# sched_yield() has been broken in linux since 2.6.23, and no good alternative exists.
+             enable_yield=nothing],
+        [# default: just use sched_yield() or yield()
+         AS_IF([test "x$ac_cv_func_sched_yield" = "xyes"], [enable_yield=sched_yield],
+               [test "x$ac_cv_func_yield" = "xyes"], [enable_yield=yield],
+               [enable_yield=nothing])])
+    ]
+)
+
+# set the appropriate macro
+AS_CASE([$enable_yield],
+    [sched_yield],
+        [AC_DEFINE(USE_SCHED_YIELD_FOR_YIELD,1,[Define to use sched_yield to yield processor])],
+    [yield],
+        [AC_DEFINE(USE_YIELD_FOR_YIELD,1,[Define to use yield to yield processor])],
+    [select],
+        [AC_DEFINE(USE_SELECT_FOR_YIELD,1,[Define to use select to yield processor])],
+    [usleep],
+        [AC_DEFINE(USE_USLEEP_FOR_YIELD,1,[Define to use usleep to yield processor])],
+    [sleep],
+        [AC_DEFINE(USE_SLEEP_FOR_YIELD,1,[Define to use sleep to yield processor])],
+    [nothing|no|none],
+        [AC_DEFINE(USE_NOTHING_FOR_YIELD,1,[Define to use nothing to yield processor])],
+    [AC_MSG_ERROR([Invalid value $enable_yield for enable_yield.])]
+)
+
+#######################################################################
+## END OF PROCESSOR YIELD CODE
+#######################################################################
+
 
 ## Enable creation of libtool-style versioning or no versioning
 AC_ARG_ENABLE(versioning,
diff --git a/src/mpl/include/mpl.h b/src/mpl/include/mpl.h
index 86933e5..d91bb94 100644
--- a/src/mpl/include/mpl.h
+++ b/src/mpl/include/mpl.h
@@ -18,5 +18,6 @@
 #include "mpl_iov.h"
 #include "mpl_bt.h"
 #include "mpl_timer.h"
+#include "mpl_yield.h"
 
 #endif /* !defined(MPL_H_INCLUDED) */
diff --git a/src/util/wrappers/mpiu_process_wrappers.h b/src/mpl/include/mpl_yield.h
similarity index 54%
rename from src/util/wrappers/mpiu_process_wrappers.h
rename to src/mpl/include/mpl_yield.h
index 8ec43ee..308fd2d 100644
--- a/src/util/wrappers/mpiu_process_wrappers.h
+++ b/src/mpl/include/mpl_yield.h
@@ -3,12 +3,12 @@
  *  (C) 2006 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
  */
-#ifndef MPIU_PROCESS_WRAPPERS_H_INCLUDED
-#define MPIU_PROCESS_WRAPPERS_H_INCLUDED
-/* MPIU_PW --> MPI Util Process Wrapper */
-#include "mpichconf.h"
+#ifndef MPL_PROCESS_WRAPPERS_H_INCLUDED
+#define MPL_PROCESS_WRAPPERS_H_INCLUDED
 
-/* MPIU_PW_SCHED_YIELD() - Yield the processor to OS scheduler */
+#include "mplconfig.h"
+
+/* MPL_SCHED_YIELD() - Yield the processor to OS scheduler */
 /* On a typical Linux system (verified with kernels 3.2 and 3.5),
  * usleep has a resolution of more than 1000 cycles. This makes
  * it impractical if the desired sleeping period is shorter. On
@@ -19,46 +19,46 @@
  * preferred if available.
  * Note that nanosleep has the same shortcomings as usleep.*/
 
-#if defined(USE_SWITCHTOTHREAD_FOR_YIELD)
+#if defined(MPL_USE_SWITCHTOTHREAD_FOR_YIELD)
     #include <winsock2.h>
     #include <windows.h>
-    #define MPIU_PW_Sched_yield() SwitchToThread()
-#elif defined(USE_WIN32_SLEEP_FOR_YIELD)
+    #define MPL_sched_yield() SwitchToThread()
+#elif defined(MPL_USE_WIN32_SLEEP_FOR_YIELD)
     #include <winsock2.h>
     #include <windows.h>
-    #define MPIU_PW_Sched_yield() Sleep(0)
-#elif defined(USE_SCHED_YIELD_FOR_YIELD)
+    #define MPL_sched_yield() Sleep(0)
+#elif defined(MPL_USE_SCHED_YIELD_FOR_YIELD)
     #ifdef HAVE_SCHED_H
         #include <sched.h>
     #endif
-    #define MPIU_PW_Sched_yield() sched_yield()
-#elif defined(USE_YIELD_FOR_YIELD)
+    #define MPL_sched_yield() sched_yield()
+#elif defined(MPL_USE_YIELD_FOR_YIELD)
     #ifdef HAVE_SCHED_H
         #include <sched.h>
     #endif
-    #define MPIU_PW_Sched_yield() yield()
-#elif defined (USE_SELECT_FOR_YIELD)
+    #define MPL_sched_yield() yield()
+#elif defined (MPL_USE_SELECT_FOR_YIELD)
     #ifdef HAVE_SYS_SELECT_H
         #include <sys/select.h>
     #endif
-    #define MPIU_PW_Sched_yield() do { struct timeval t; t.tv_sec = 0; t.tv_usec = 0; select(0,0,0,0,&t); } while (0)
-#elif defined (USE_USLEEP_FOR_YIELD)
+    #define MPL_sched_yield() do { struct timeval t; t.tv_sec = 0; t.tv_usec = 0; select(0,0,0,0,&t); } while (0)
+#elif defined (MPL_USE_USLEEP_FOR_YIELD)
     #ifdef HAVE_UNISTD_H
         #include <unistd.h>
-        #if defined (NEEDS_USLEEP_DECL)
+        #if defined (MPL_NEEDS_USLEEP_DECL)
         int usleep(useconds_t usec);
         #endif
     #endif
-    #define MPIU_PW_Sched_yield() usleep(0)
-#elif defined (USE_SLEEP_FOR_YIELD)
+    #define MPL_sched_yield() usleep(0)
+#elif defined (MPL_USE_SLEEP_FOR_YIELD)
     #ifdef HAVE_UNISTD_H
         #include <unistd.h>
     #endif
-    #define MPIU_PW_Sched_yield() sleep(0)
-#elif defined (USE_NOTHING_FOR_YIELD)
-    #define MPIU_PW_Sched_yield() do {} while (0)
+    #define MPL_sched_yield() sleep(0)
+#elif defined (MPL_USE_NOTHING_FOR_YIELD)
+    #define MPL_sched_yield() do {} while (0)
 #else
     #error "No mechanism available to yield"
 #endif
 
-#endif /* MPIU_PROCESS_WRAPPERS_H_INCLUDED */
+#endif /* MPL_PROCESS_WRAPPERS_H_INCLUDED */
diff --git a/src/util/thread/mpiu_thread_posix.h b/src/util/thread/mpiu_thread_posix.h
index 02bbc33..77f2d51 100644
--- a/src/util/thread/mpiu_thread_posix.h
+++ b/src/util/thread/mpiu_thread_posix.h
@@ -11,7 +11,7 @@
 #ifndef MPIU_THREAD_POSIX_H_INCLUDED
 #define MPIU_THREAD_POSIX_H_INCLUDED
 
-#include "mpiu_process_wrappers.h"      /* for MPIU_PW_Sched_yield */
+#include "mpl.h"      /* for MPL_sched_yield */
 
 #include <errno.h>
 #include <pthread.h>
@@ -54,7 +54,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         if (OPA_load_int(&(mutex_ptr_)->num_queued_threads) == 0)       \
             break;                                                      \
         MPIU_Thread_mutex_unlock(mutex_ptr_, &err);                     \
-        MPIU_PW_Sched_yield();                                          \
+        MPL_sched_yield();                                              \
         MPIU_Thread_mutex_lock(mutex_ptr_, &err);                       \
         MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"exit MPIU_Thread_yield");          \
     } while (0)
diff --git a/src/util/wrappers/Makefile.mk b/src/util/wrappers/Makefile.mk
index a162637..3d21618 100644
--- a/src/util/wrappers/Makefile.mk
+++ b/src/util/wrappers/Makefile.mk
@@ -11,7 +11,6 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/util/wrappers -I$(top_builddir)/src/util/wrap
 noinst_HEADERS +=                             \
     src/util/wrappers/mpiu_os_wrappers.h      \
     src/util/wrappers/mpiu_os_wrappers_pre.h  \
-    src/util/wrappers/mpiu_process_wrappers.h \
     src/util/wrappers/mpiu_shm_wrappers.h     \
     src/util/wrappers/mpiu_sock_wrappers.h    \
     src/util/wrappers/mpiu_util_wrappers.h
diff --git a/src/util/wrappers/mpiu_os_wrappers.h b/src/util/wrappers/mpiu_os_wrappers.h
index 0125b9f..9ac6c18 100644
--- a/src/util/wrappers/mpiu_os_wrappers.h
+++ b/src/util/wrappers/mpiu_os_wrappers.h
@@ -7,7 +7,7 @@
 #define MPIU_OS_WRAPPERS_H_INCLUDED
 /* #include "mpiu_os_wrappers_conf.h" */
 #include "mpiu_util_wrappers.h"
-#include "mpiu_process_wrappers.h"
+#include "mpl.h"
 #include "mpiu_shm_wrappers.h"
 #include "mpiu_sock_wrappers.h"
 #endif /* MPIU_OS_WRAPPERS_H_INCLUDED */

http://git.mpich.org/mpich.git/commitdiff/984e4aebd30df8dfee0d16c9c178818f83bd6ee4

commit 984e4aebd30df8dfee0d16c9c178818f83bd6ee4
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Jan 8 13:44:13 2016 -0600

    timers: make local variables static.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpl/src/timer/mpl_timer_query_performance_counter.c b/src/mpl/src/timer/mpl_timer_query_performance_counter.c
index 4e6510c..67dec5f 100644
--- a/src/mpl/src/timer/mpl_timer_query_performance_counter.c
+++ b/src/mpl/src/timer/mpl_timer_query_performance_counter.c
@@ -10,30 +10,31 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 #if MPL_TIMER_KIND == MPL_TIMER_KIND__QUERYPERFORMANCECOUNTER
 
-double MPL_Seconds_per_tick = 0.0;     /* High performance counter frequency */
+static double seconds_per_tick = 0.0;     /* High performance counter frequency */
+
 int MPL_wtime_init(void)
 {
     LARGE_INTEGER n;
     QueryPerformanceFrequency(&n);
-    MPL_Seconds_per_tick = 1.0 / (double) n.QuadPart;
+    seconds_per_tick = 1.0 / (double) n.QuadPart;
     return 0;
 }
 
 double MPL_wtick(void)
 {
-    return MPL_Seconds_per_tick;
+    return seconds_per_tick;
 }
 
 void MPL_wtime_todouble(MPL_time_t * t, double *val)
 {
-    *val = (double) t->QuadPart * MPL_Seconds_per_tick;
+    *val = (double) t->QuadPart * seconds_per_tick;
 }
 
 void MPL_wtime_diff(MPL_time_t * t1, MPL_time_t * t2, double *diff)
 {
     LARGE_INTEGER n;
     n.QuadPart = t2->QuadPart - t1->QuadPart;
-    *diff = (double) n.QuadPart * MPL_Seconds_per_tick;
+    *diff = (double) n.QuadPart * seconds_per_tick;
 }
 
 void MPL_wtime_acc(MPL_time_t * t1, MPL_time_t * t2, MPL_time_t * t3)
diff --git a/src/mpl/src/timer/mpl_timer_win86_cycle.c b/src/mpl/src/timer/mpl_timer_win86_cycle.c
index aee1960..4943f12 100644
--- a/src/mpl/src/timer/mpl_timer_win86_cycle.c
+++ b/src/mpl/src/timer/mpl_timer_win86_cycle.c
@@ -10,20 +10,21 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 #if (MPL_TIMER_KIND == MPL_TIMER_KIND__WIN86_CYCLE) || (MPL_TIMER_KIND == MPL_TIMER_KIND__WIN64_CYCLE)
 
-double MPL_Seconds_per_tick = 0.0;
+static double seconds_per_tick = 0.0;
+
 double MPL_wtick(void)
 {
-    return MPL_Seconds_per_tick;
+    return seconds_per_tick;
 }
 
 void MPL_wtime_todouble(MPL_time_t * t, double *d)
 {
-    *d = (double) (__int64) * t * MPL_Seconds_per_tick;
+    *d = (double) (__int64) * t * seconds_per_tick;
 }
 
 void MPL_wtime_diff(MPL_time_t * t1, MPL_time_t * t2, double *diff)
 {
-    *diff = (double) ((__int64) (*t2 - *t1)) * MPL_Seconds_per_tick;
+    *diff = (double) ((__int64) (*t2 - *t1)) * seconds_per_tick;
 }
 
 int MPL_wtime_init(void)
@@ -48,10 +49,10 @@ int MPL_wtime_init(void)
     MPL_wtime(&t2);
 
     /* calculate the frequency of the assembly cycle counter */
-    MPL_Seconds_per_tick = ((double) (s2 - s1) / 1000.0) / (double) ((__int64) (t2 - t1));
+    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), MPL_Seconds_per_tick, MPL_Seconds_per_tick * 1.0e6);
+     * (int)(t2-t1), (int)(s2 - s1), seconds_per_tick, seconds_per_tick * 1.0e6);
      */
     return 0;
 }

http://git.mpich.org/mpich.git/commitdiff/90e5cad43ce8c3dd5daa94edd5aa365437a57fab

commit 90e5cad43ce8c3dd5daa94edd5aa365437a57fab
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Jan 8 13:42:18 2016 -0600

    timers: Use MPL_<lowercase> format for consistency.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpid/common/timers/mpid_timers_fallback.h b/src/mpid/common/timers/mpid_timers_fallback.h
index a31fd93..a7aa292 100644
--- a/src/mpid/common/timers/mpid_timers_fallback.h
+++ b/src/mpid/common/timers/mpid_timers_fallback.h
@@ -7,12 +7,12 @@
 #if !defined(MPID_TIMERS_FALLBACK_H_INCLUDED)
 #define MPID_TIMERS_FALLBACK_H_INCLUDED
 
-#define MPID_Time_t         MPL_Time_t
-#define MPID_Wtime          MPL_Wtime
-#define MPID_Wtime_diff     MPL_Wtime_diff
-#define MPID_Wtime_acc      MPL_Wtime_acc
-#define MPID_Wtime_todouble MPL_Wtime_todouble
-#define MPID_Wtick          MPL_Wtick
-#define MPID_Wtime_init     MPL_Wtime_init
+#define MPID_Time_t         MPL_time_t
+#define MPID_Wtime          MPL_wtime
+#define MPID_Wtime_diff     MPL_wtime_diff
+#define MPID_Wtime_acc      MPL_wtime_acc
+#define MPID_Wtime_todouble MPL_wtime_todouble
+#define MPID_Wtick          MPL_wtick
+#define MPID_Wtime_init     MPL_wtime_init
 
 #endif /* !defined(MPID_TIMERS_FALLBACK_H_INCLUDED) */
diff --git a/src/mpid/pamid/src/mpid_time.c b/src/mpid/pamid/src/mpid_time.c
index 4581f85..95f3856 100644
--- a/src/mpid/pamid/src/mpid_time.c
+++ b/src/mpid/pamid/src/mpid_time.c
@@ -23,7 +23,7 @@
 
 int MPIDI_PAMID_Timer_is_ready = 0;
 
-static int wtime(MPL_Time_t *tval)
+static int wtime(MPL_time_t *tval)
 {
     if (MPIDI_PAMID_Timer_is_ready) {
         *((MPID_Time_t *) tval) = PAMI_Wtime(MPIDI_Client);
@@ -35,7 +35,7 @@ static int wtime(MPL_Time_t *tval)
 
 int MPID_Wtime(MPID_Time_t *tval)
 {
-    return wtime((MPL_Time_t *) tval);
+    return wtime((MPL_time_t *) tval);
 }
 
 static int wtick(double *wtick)
@@ -50,10 +50,10 @@ static int wtick(double *wtick)
 
 int MPID_Wtick(double *tick)
 {
-    return wtick((MPL_Time_t *) tick);
+    return wtick((MPL_time_t *) tick);
 }
 
-static int wtime_diff(MPL_Time_t *t1, MPL_Time_t *t2, double *diff)
+static int wtime_diff(MPL_time_t *t1, MPL_time_t *t2, double *diff)
 {
     if (MPIDI_PAMID_Timer_is_ready) {
         *diff = *((MPID_Time_t *) t2) - *((MPID_Time_t *) t1);
@@ -65,10 +65,10 @@ static int wtime_diff(MPL_Time_t *t1, MPL_Time_t *t2, double *diff)
 
 int MPID_Wtime_diff(MPID_Time_t *t1, MPID_Time_t *t2, double *diff)
 {
-    return wtime_diff((MPL_Time_t *) t1, (MPL_Time_t *) t2, diff);
+    return wtime_diff((MPL_time_t *) t1, (MPL_time_t *) t2, diff);
 }
 
-static int wtime_todouble(MPL_Time_t *t, double *val)
+static int wtime_todouble(MPL_time_t *t, double *val)
 {
     if (MPIDI_PAMID_Timer_is_ready) {
         *val = *((MPID_Time_t *) t);
@@ -80,10 +80,10 @@ static int wtime_todouble(MPL_Time_t *t, double *val)
 
 int MPID_Wtime_todouble(MPID_Time_t *t, double *val)
 {
-    return wtime_todouble((MPL_Time_t *) t, val);
+    return wtime_todouble((MPL_time_t *) t, val);
 }
 
-static int wtime_acc(MPL_Time_t *t1, MPL_Time_t *t2, MPL_Time_t *t3)
+static int wtime_acc(MPL_time_t *t1, MPL_time_t *t2, MPL_time_t *t3)
 {
     if (MPIDI_PAMID_Timer_is_ready) {
         *((MPID_Time_t *) t3) += *((MPID_Time_t *) t1) - *((MPID_Time_t *) t2);
@@ -95,16 +95,16 @@ static int wtime_acc(MPL_Time_t *t1, MPL_Time_t *t2, MPL_Time_t *t3)
 
 int MPID_Wtime_acc(MPID_Time_t *t1, MPID_Time_t *t2, MPID_Time_t *t3)
 {
-    return wtime_acc((MPL_Time_t *) t1, (MPL_Time_t *) t2, (MPL_Time_t *) t3);
+    return wtime_acc((MPL_time_t *) t1, (MPL_time_t *) t2, (MPL_time_t *) t3);
 }
 
 int MPID_Wtime_init( void )
 {
-    MPL_Wtime_fn = wtime;
-    MPL_Wtick_fn = wtick;
-    MPL_Wtime_diff_fn = wtime_diff;
-    MPL_Wtime_todouble_fn = wtime_todouble;
-    MPL_Wtime_acc_fn = wtime_acc;
+    MPL_wtime_fn = wtime;
+    MPL_wtick_fn = wtick;
+    MPL_wtime_diff_fn = wtime_diff;
+    MPL_wtime_todouble_fn = wtime_todouble;
+    MPL_wtime_acc_fn = wtime_acc;
 
     return MPID_TIMER_SUCCESS;
 }
diff --git a/src/mpl/include/mpl_timer.h.in b/src/mpl/include/mpl_timer.h.in
index 30edc05..b16b91b 100644
--- a/src/mpl/include/mpl_timer.h.in
+++ b/src/mpl/include/mpl_timer.h.in
@@ -39,7 +39,7 @@ int usleep(useconds_t usec);
 #define MPL_TIMER_KIND @MPL_TIMER_KIND@
 
 /* Define a time stamp */
-typedef @MPL_TIMER_TYPE@ MPL_Time_t;
+typedef @MPL_TIMER_TYPE@ MPL_time_t;
 
 /* The timer code is allowed to return "NOT_INITIALIZED" before the
  * device is initialized.  Once the device is initialized, it must
@@ -77,20 +77,20 @@ typedef @MPL_TIMER_TYPE@ MPL_Time_t;
 #if defined MPLI_WTIME_IS_A_FUNCTION
 
 /*@
-  MPL_Wtime - Return a time stamp
+  MPL_wtime - Return a time stamp
 
   Output Parameter:
-. timeval - A pointer to an 'MPL_Wtime_t' variable.
+. timeval - A pointer to an 'MPL_wtime_t' variable.
 
   Notes:
   This routine returns an `opaque` time value.  This difference between two
-  time values returned by 'MPL_Wtime' can be converted into an elapsed time
-  in seconds with the routine 'MPL_Wtime_diff'.
+  time values returned by 'MPL_wtime' can be converted into an elapsed time
+  in seconds with the routine 'MPL_wtime_diff'.
 
   This routine is defined this way to simplify its implementation as a macro.
   For example, the for Intel x86 and gcc,
 .vb
-#define MPL_Wtime(timeval) \
+#define MPL_wtime(timeval) \
      __asm__ __volatile__("rdtsc" : "=A" (*timeval))
 .ve
 
@@ -110,14 +110,14 @@ typedef @MPL_TIMER_TYPE@ MPL_Time_t;
   MPI-2 allows 'MPI_Wtime' to be a macro.  We should make that easy; this
   version does not accomplish that.
   @*/
-int MPL_Wtime(MPL_Time_t * timeval);
+int MPL_wtime(MPL_time_t * timeval);
 #endif /* MPLI_WTIME_IS_A_FUNCTION */
 
 /*@
-  MPL_Wtime_diff - Compute the difference between two time stamps
+  MPL_wtime_diff - Compute the difference between two time stamps
 
   Input Parameters:
-. t1, t2 - Two time values set by 'MPL_Wtime' on this process.
+. t1, t2 - Two time values set by 'MPL_wtime' on this process.
 
 
   Output Parameter:
@@ -125,21 +125,21 @@ int MPL_Wtime(MPL_Time_t * timeval);
 
   Note:
   If 't1' is null, then 't2' is assumed to be differences accumulated with
-  'MPL_Wtime_acc', and the output value gives the number of seconds that
+  'MPL_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 'MPL_Wtime_todouble' that converts a single timestamp to a
+  routine 'MPL_wtime_todouble' that converts a single timestamp to a
   double value?
 
   Module:
   Timer
   @*/
-int MPL_Wtime_diff( MPL_Time_t *t1, MPL_Time_t *t2, double *diff );
+int MPL_wtime_diff( MPL_time_t *t1, MPL_time_t *t2, double *diff );
 
 /*@
-  MPL_Wtime_acc - Accumulate time values
+  MPL_wtime_acc - Accumulate time values
 
   Input Parameters:
 . t1,t2,t3 - Three time values.  't3' is updated with the difference between
@@ -148,23 +148,23 @@ int MPL_Wtime_diff( MPL_Time_t *t1, MPL_Time_t *t2, double *diff );
   Notes:
   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 'MPL_Wtime' routine accesses
+  type such as a 'double'.  For example, if the 'MPL_wtime' routine accesses
   a cycle counter, this routine (or macro) can perform the accumulation using
   integer arithmetic.
 
-  To convert a time value accumulated with this routine, use 'MPL_Wtime_diff'
+  To convert a time value accumulated with this routine, use 'MPL_wtime_diff'
   with a 't1' of zero.
 
   Module:
   Timer
   @*/
-int MPL_Wtime_acc( MPL_Time_t *t1, MPL_Time_t *t2, MPL_Time_t *t3 );
+int MPL_wtime_acc( MPL_time_t *t1, MPL_time_t *t2, MPL_time_t *t3 );
 
 /*@
-  MPL_Wtime_todouble - Converts a timestamp to a double
+  MPL_wtime_todouble - Converts a timestamp to a double
 
   Input Parameter:
-. timeval - 'MPL_Time_t' time stamp
+. timeval - 'MPL_time_t' time stamp
 
   Output Parameter:
 . seconds - Time in seconds from an arbitrary (but fixed) time in the past
@@ -174,16 +174,16 @@ int MPL_Wtime_acc( MPL_Time_t *t1, MPL_Time_t *t2, MPL_Time_t *t3 );
   suitable for 'MPI_Wtime'.
 
   @*/
-int MPL_Wtime_todouble( MPL_Time_t *timeval, double *seconds );
+int MPL_wtime_todouble( MPL_time_t *timeval, double *seconds );
 
 /*@
-  MPL_Wtick - Provide the resolution of the 'MPL_Wtime' timer
+  MPL_wtick - Provide the resolution of the 'MPL_wtime' timer
 
   Return value:
   Resolution of the timer in seconds.  In many cases, this is the
-  time between ticks of the clock that 'MPL_Wtime' returns.  In other
+  time between ticks of the clock that 'MPL_wtime' returns.  In other
   words, the minimum significant difference that can be computed by
-  'MPL_Wtime_diff'.
+  'MPL_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
@@ -192,10 +192,10 @@ int MPL_Wtime_todouble( MPL_Time_t *timeval, double *seconds );
   Module:
   Timer
   @*/
-int MPL_Wtick(double *);
+int MPL_wtick(double *);
 
 /*@
-  MPL_Wtime_init - Initialize the timer
+  MPL_wtime_init - Initialize the timer
 
   Note:
   This routine should perform any steps needed to initialize the timer.
@@ -207,7 +207,7 @@ int MPL_Wtick(double *);
   Timer
 
   @*/
-int MPL_Wtime_init(void);
+int MPL_wtime_init(void);
 
 /*
  * For timers that do not have defined resolutions, compute the resolution
@@ -220,23 +220,23 @@ static void init_wtick(void) ATTRIBUTE((unused));
 static void init_wtick(void)
 {
     double timediff;
-    MPL_Time_t t1, t2;
+    MPL_time_t t1, t2;
     int cnt;
     int icnt;
 
     tickval = 1.0e6;
     for (icnt = 0; icnt < 10; icnt++) {
         cnt = 1000;
-        MPL_Wtime(&t1);
+        MPL_wtime(&t1);
         do {
-            MPL_Wtime(&t2);
-            MPL_Wtime_diff(&t1, &t2, &timediff);
+            MPL_wtime(&t2);
+            MPL_wtime_diff(&t1, &t2, &timediff);
             if (timediff > 0)
                 break;
         }
         while (cnt--);
         if (cnt && timediff > 0.0 && timediff < tickval) {
-            MPL_Wtime_diff(&t1, &t2, &tickval);
+            MPL_wtime_diff(&t1, &t2, &tickval);
         }
     }
 }
diff --git a/src/mpl/include/mpl_timer_device.h b/src/mpl/include/mpl_timer_device.h
index 8c704e0..5b6f599 100644
--- a/src/mpl/include/mpl_timer_device.h
+++ b/src/mpl/include/mpl_timer_device.h
@@ -17,16 +17,16 @@
  *       model would be used by the MPICH internal code, and would
  *       give fast access to the timers.
  *
- *    2. It would expose it through the MPL_Timer_ function pointers.
+ *    2. It would expose it through the MPL_timer_ function pointers.
  *       This model would be used by "external" code segments (such as
  *       MPL) which do not have direct access to the MPICH devices.
  *       This model might be slightly slower, but would give the same
  *       functionality.
  */
-extern int (*MPL_Wtime_fn)(MPL_Time_t *timeval);
-extern int (*MPL_Wtime_diff_fn)(MPL_Time_t *t1, MPL_Time_t *t2, double *diff);
-extern int (*MPL_Wtime_acc_fn)(MPL_Time_t *t1, MPL_Time_t *t2, MPL_Time_t *t3);
-extern int (*MPL_Wtime_todouble_fn)(MPL_Time_t *timeval, double *seconds);
-extern int (*MPL_Wtick_fn)(double *tick);
+extern int (*MPL_wtime_fn)(MPL_time_t *timeval);
+extern int (*MPL_wtime_diff_fn)(MPL_time_t *t1, MPL_time_t *t2, double *diff);
+extern int (*MPL_wtime_acc_fn)(MPL_time_t *t1, MPL_time_t *t2, MPL_time_t *t3);
+extern int (*MPL_wtime_todouble_fn)(MPL_time_t *timeval, double *seconds);
+extern int (*MPL_wtick_fn)(double *tick);
 
 #endif
diff --git a/src/mpl/include/mpl_timer_gcc_ia64_cycle.h b/src/mpl/include/mpl_timer_gcc_ia64_cycle.h
index 0cd121b..32ac6c4 100644
--- a/src/mpl/include/mpl_timer_gcc_ia64_cycle.h
+++ b/src/mpl/include/mpl_timer_gcc_ia64_cycle.h
@@ -7,9 +7,9 @@
 #ifndef MPL_TIMER_GCC_IA64_CYCLE_H_INCLUDED
 #define MPL_TIMER_GCC_IA64_CYCLE_H_INCLUDED
 
-static inline void MPL_Wtime(MPL_Time_t *timeval)
+static inline void MPL_wtime(MPL_time_t *timeval)
 {
-    MPL_Time_t t_val;
+    MPL_time_t t_val;
 
 #ifdef __INTEL_COMPILER
 #include "ia64regs.h"
diff --git a/src/mpl/include/mpl_timer_linux86_cycle.h b/src/mpl/include/mpl_timer_linux86_cycle.h
index bac07ca..30420d9 100644
--- a/src/mpl/include/mpl_timer_linux86_cycle.h
+++ b/src/mpl/include/mpl_timer_linux86_cycle.h
@@ -7,7 +7,7 @@
 #ifndef MPL_TIMER_LINUX86_CYCLE_H_INCLUDED
 #define MPL_TIMER_LINUX86_CYCLE_H_INCLUDED
 
-static inline int MPL_Wtime(MPL_Time_t *timeval)
+static inline int MPL_wtime(MPL_time_t *timeval)
 {
 /* The rdtsc instruction is not a "serializing" instruction, so the
    processor is free to reorder it.  In order to get more accurate
diff --git a/src/mpl/include/mpl_timer_query_performance_counter.h b/src/mpl/include/mpl_timer_query_performance_counter.h
index e9b9f81..0638c13 100644
--- a/src/mpl/include/mpl_timer_query_performance_counter.h
+++ b/src/mpl/include/mpl_timer_query_performance_counter.h
@@ -10,7 +10,7 @@
 #include <winsock2.h>
 #include <windows.h>
 
-static inline void MPL_Wtime(MPL_Time_t *timeval)
+static inline void MPL_wtime(MPL_time_t *timeval)
 {
     QueryPerformanceCounter(timeval);
 
diff --git a/src/mpl/include/mpl_timer_win86_cycle.h b/src/mpl/include/mpl_timer_win86_cycle.h
index ca7c172..ad670ed 100644
--- a/src/mpl/include/mpl_timer_win86_cycle.h
+++ b/src/mpl/include/mpl_timer_win86_cycle.h
@@ -10,7 +10,7 @@
 #include <winsock2.h>
 #include <windows.h>
 
-static inline void MPL_Wtime(MPL_Time_t *timeval)
+static inline void MPL_wtime(MPL_time_t *timeval)
 {
     register int *f1 = (int*)var_ptr;
     __asm cpuid;
diff --git a/src/mpl/src/timer/mpl_timer_clock_gettime.c b/src/mpl/src/timer/mpl_timer_clock_gettime.c
index 9dc90a2..e42431d 100644
--- a/src/mpl/src/timer/mpl_timer_clock_gettime.c
+++ b/src/mpl/src/timer/mpl_timer_clock_gettime.c
@@ -10,7 +10,7 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 #if MPL_TIMER_KIND == MPL_TIMER_KIND__CLOCK_GETTIME
 
-int MPL_Wtime(MPL_Time_t * timeval)
+int MPL_wtime(MPL_time_t * timeval)
 {
     /* POSIX timer (14.2.1, page 311) */
     clock_gettime(CLOCK_REALTIME, timeval);
@@ -18,21 +18,21 @@ int MPL_Wtime(MPL_Time_t * timeval)
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_diff(MPL_Time_t * t1, MPL_Time_t * t2, double *diff)
+int MPL_wtime_diff(MPL_time_t * t1, MPL_time_t * t2, double *diff)
 {
     *diff = ((double) (t2->tv_sec - t1->tv_sec) + 1.0e-9 * (double) (t2->tv_nsec - t1->tv_nsec));
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_todouble(MPL_Time_t * t, double *val)
+int MPL_wtime_todouble(MPL_time_t * t, double *val)
 {
     *val = ((double) t->tv_sec + 1.0e-9 * (double) t->tv_nsec);
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_acc(MPL_Time_t * t1, MPL_Time_t * t2, MPL_Time_t * t3)
+int MPL_wtime_acc(MPL_time_t * t1, MPL_time_t * t2, MPL_time_t * t3)
 {
     int nsec, sec;
 
@@ -49,7 +49,7 @@ int MPL_Wtime_acc(MPL_Time_t * t1, MPL_Time_t * t2, MPL_Time_t * t3)
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtick(double *wtick)
+int MPL_wtick(double *wtick)
 {
     struct timespec res;
     int rc;
@@ -66,7 +66,7 @@ int MPL_Wtick(double *wtick)
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_init(void)
+int MPL_wtime_init(void)
 {
     init_wtick();
 
diff --git a/src/mpl/src/timer/mpl_timer_device.c b/src/mpl/src/timer/mpl_timer_device.c
index 48504fa..1f2e6f1 100644
--- a/src/mpl/src/timer/mpl_timer_device.c
+++ b/src/mpl/src/timer/mpl_timer_device.c
@@ -10,45 +10,45 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 #if MPL_TIMER_KIND == MPL_TIMER_KIND__DEVICE
 
-int (*MPL_Wtime_fn)(MPL_Time_t *timeval) = NULL;
-int (*MPL_Wtime_diff_fn)(MPL_Time_t *t1, MPL_Time_t *t2, double *diff) = NULL;
-int (*MPL_Wtime_acc_fn)(MPL_Time_t *t1, MPL_Time_t *t2, MPL_Time_t *t3) = NULL;
-int (*MPL_Wtime_todouble_fn)(MPL_Time_t *timeval, double *seconds) = NULL;
-int (*MPL_Wtick_fn)(double *tick) = NULL;
+int (*MPL_wtime_fn)(MPL_time_t *timeval) = NULL;
+int (*MPL_wtime_diff_fn)(MPL_time_t *t1, MPL_time_t *t2, double *diff) = NULL;
+int (*MPL_wtime_acc_fn)(MPL_time_t *t1, MPL_time_t *t2, MPL_time_t *t3) = NULL;
+int (*MPL_wtime_todouble_fn)(MPL_time_t *timeval, double *seconds) = NULL;
+int (*MPL_wtick_fn)(double *tick) = NULL;
 
-int MPL_Wtime(MPL_Time_t *timeval)
+int MPL_wtime(MPL_time_t *timeval)
 {
-    if (MPL_Wtime_fn == NULL)
+    if (MPL_wtime_fn == NULL)
         return MPL_TIMER_ERR_NOT_INITIALIZED;
-    return MPL_Wtime_fn(timeval);
+    return MPL_wtime_fn(timeval);
 }
 
-int MPL_Wtime_diff(MPL_Time_t *t1, MPL_Time_t *t2, double *diff)
+int MPL_wtime_diff(MPL_time_t *t1, MPL_time_t *t2, double *diff)
 {
-    if (MPL_Wtime_diff_fn == NULL)
+    if (MPL_wtime_diff_fn == NULL)
         return MPL_TIMER_ERR_NOT_INITIALIZED;
-    return MPL_Wtime_diff_fn(t1, t2, diff);
+    return MPL_wtime_diff_fn(t1, t2, diff);
 }
 
-int MPL_Wtime_todouble(MPL_Time_t *t, double *val)
+int MPL_wtime_todouble(MPL_time_t *t, double *val)
 {
-    if (MPL_Wtime_todouble_fn == NULL)
+    if (MPL_wtime_todouble_fn == NULL)
         return MPL_TIMER_ERR_NOT_INITIALIZED;
-    return MPL_Wtime_todouble_fn(t, val);
+    return MPL_wtime_todouble_fn(t, val);
 }
 
-int MPL_Wtime_acc(MPL_Time_t *t1, MPL_Time_t *t2, MPL_Time_t *t3)
+int MPL_wtime_acc(MPL_time_t *t1, MPL_time_t *t2, MPL_time_t *t3)
 {
-    if (MPL_Wtime_acc_fn == NULL)
+    if (MPL_wtime_acc_fn == NULL)
         return MPL_TIMER_ERR_NOT_INITIALIZED;
-    return MPL_Wtime_acc_fn(t1, t2, t3);
+    return MPL_wtime_acc_fn(t1, t2, t3);
 }
 
-int MPL_Wtick(double *wtick)
+int MPL_wtick(double *wtick)
 {
-    if (MPL_Wtick_fn == NULL)
+    if (MPL_wtick_fn == NULL)
         return MPL_TIMER_ERR_NOT_INITIALIZED;
-    return MPL_Wtick_fn(wtick);
+    return MPL_wtick_fn(wtick);
 }
 
 #endif
diff --git a/src/mpl/src/timer/mpl_timer_gcc_ia64_cycle.c b/src/mpl/src/timer/mpl_timer_gcc_ia64_cycle.c
index 01fd0e4..99c5643 100644
--- a/src/mpl/src/timer/mpl_timer_gcc_ia64_cycle.c
+++ b/src/mpl/src/timer/mpl_timer_gcc_ia64_cycle.c
@@ -14,24 +14,24 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 static double seconds_per_tick = 0.0;
 
-int MPL_Wtick(double *wtick)
+int MPL_wtick(double *wtick)
 {
     *wtick = seconds_per_tick;
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_init(void)
+int MPL_wtime_init(void)
 {
     unsigned long long t1, t2;
     struct timeval tv1, tv2;
     double td1, td2;
 
     gettimeofday(&tv1, NULL);
-    MPL_Wtime(&t1);
+    MPL_wtime(&t1);
     usleep(250000);
     gettimeofday(&tv2, NULL);
-    MPL_Wtime(&t2);
+    MPL_wtime(&t2);
 
     td1 = tv1.tv_sec + tv1.tv_usec / 1000000.0;
     td2 = tv2.tv_sec + tv2.tv_usec / 1000000.0;
@@ -42,14 +42,14 @@ int MPL_Wtime_init(void)
 }
 
 /* Time stamps created by a macro */
-int MPL_Wtime_diff(MPL_Time_t * t1, MPL_Time_t * t2, double *diff)
+int MPL_wtime_diff(MPL_time_t * t1, MPL_time_t * t2, double *diff)
 {
     *diff = (double) (*t2 - *t1) * seconds_per_tick;
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_todouble(MPL_Time_t * t, double *val)
+int MPL_wtime_todouble(MPL_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
@@ -59,7 +59,7 @@ int MPL_Wtime_todouble(MPL_Time_t * t, double *val)
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_acc(MPL_Time_t * t1, MPL_Time_t * t2, MPL_Time_t * t3)
+int MPL_wtime_acc(MPL_time_t * t1, MPL_time_t * t2, MPL_time_t * t3)
 {
     *t3 += (*t2 - *t1);
 
diff --git a/src/mpl/src/timer/mpl_timer_gethrtime.c b/src/mpl/src/timer/mpl_timer_gethrtime.c
index d971475..ad69fe4 100644
--- a/src/mpl/src/timer/mpl_timer_gethrtime.c
+++ b/src/mpl/src/timer/mpl_timer_gethrtime.c
@@ -11,7 +11,7 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 #if MPL_TIMER_KIND == MPL_TIMER_KIND__GETHRTIME
 
 /*
- * MPL_Time_t is hrtime_t, which under Solaris is defined as a 64bit
+ * MPL_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.
@@ -24,35 +24,35 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
  * supports an 8 byte long long.  We can also cast hrtime_t to long long
  * if long long is available and 8 bytes.
  */
-int MPL_Wtime(MPL_Time_t * timeval)
+int MPL_wtime(MPL_time_t * timeval)
 {
     *timeval = gethrtime();
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_diff(MPL_Time_t * t1, MPL_Time_t * t2, double *diff)
+int MPL_wtime_diff(MPL_time_t * t1, MPL_time_t * t2, double *diff)
 {
     *diff = 1.0e-9 * (double) (*t2 - *t1);
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_todouble(MPL_Time_t * t, double *val)
+int MPL_wtime_todouble(MPL_time_t * t, double *val)
 {
     *val = 1.0e-9 * (*t);
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_acc(MPL_Time_t * t1, MPL_Time_t * t2, MPL_Time_t * t3)
+int MPL_wtime_acc(MPL_time_t * t1, MPL_time_t * t2, MPL_time_t * t3)
 {
     *t3 += ((*t2) - (*t1));
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtick(double *wtick)
+int MPL_wtick(double *wtick)
 {
     /* According to the documentation, ticks should be in nanoseconds.  This
      * is untested */
@@ -61,7 +61,7 @@ int MPL_Wtick(double *wtick)
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_init(void)
+int MPL_wtime_init(void)
 {
     return MPL_TIMER_SUCCESS;
 }
diff --git a/src/mpl/src/timer/mpl_timer_gettimeofday.c b/src/mpl/src/timer/mpl_timer_gettimeofday.c
index cf0d6b6..a211fe7 100644
--- a/src/mpl/src/timer/mpl_timer_gettimeofday.c
+++ b/src/mpl/src/timer/mpl_timer_gettimeofday.c
@@ -17,28 +17,28 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 #include <unistd.h>
 #endif
 
-int MPL_Wtime(MPL_Time_t * tval)
+int MPL_wtime(MPL_time_t * tval)
 {
     gettimeofday(tval, NULL);
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_diff(MPL_Time_t * t1, MPL_Time_t * t2, double *diff)
+int MPL_wtime_diff(MPL_time_t * t1, MPL_time_t * t2, double *diff)
 {
     *diff = ((double) (t2->tv_sec - t1->tv_sec) + .000001 * (double) (t2->tv_usec - t1->tv_usec));
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_todouble(MPL_Time_t * t, double *val)
+int MPL_wtime_todouble(MPL_time_t * t, double *val)
 {
     *val = (double) t->tv_sec + .000001 * (double) t->tv_usec;
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_acc(MPL_Time_t * t1, MPL_Time_t * t2, MPL_Time_t * t3)
+int MPL_wtime_acc(MPL_time_t * t1, MPL_time_t * t2, MPL_time_t * t3)
 {
     int usec, sec;
 
@@ -55,14 +55,14 @@ int MPL_Wtime_acc(MPL_Time_t * t1, MPL_Time_t * t2, MPL_Time_t * t3)
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtick(double *wtick)
+int MPL_wtick(double *wtick)
 {
     *wtick = tickval;
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_init(void)
+int MPL_wtime_init(void)
 {
     init_wtick();
 
diff --git a/src/mpl/src/timer/mpl_timer_linux86_cycle.c b/src/mpl/src/timer/mpl_timer_linux86_cycle.c
index 8f71589..5b14a57 100644
--- a/src/mpl/src/timer/mpl_timer_linux86_cycle.c
+++ b/src/mpl/src/timer/mpl_timer_linux86_cycle.c
@@ -14,24 +14,24 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 static double seconds_per_tick = 0.0;
 
-int MPL_Wtick(double *wtick)
+int MPL_wtick(double *wtick)
 {
     *wtick = seconds_per_tick;
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_init(void)
+int MPL_wtime_init(void)
 {
-    MPL_Time_t t1, t2;
+    MPL_time_t t1, t2;
     struct timeval tv1, tv2;
     double td1, td2;
 
     gettimeofday(&tv1, NULL);
-    MPL_Wtime(&t1);
+    MPL_wtime(&t1);
     usleep(250000);
     gettimeofday(&tv2, NULL);
-    MPL_Wtime(&t2);
+    MPL_wtime(&t2);
 
     td1 = tv1.tv_sec + tv1.tv_usec / 1000000.0;
     td2 = tv2.tv_sec + tv2.tv_usec / 1000000.0;
@@ -42,14 +42,14 @@ int MPL_Wtime_init(void)
 }
 
 /* Time stamps created by a macro */
-int MPL_Wtime_diff(MPL_Time_t * t1, MPL_Time_t * t2, double *diff)
+int MPL_wtime_diff(MPL_time_t * t1, MPL_time_t * t2, double *diff)
 {
     *diff = (double) (*t2 - *t1) * seconds_per_tick;
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_todouble(MPL_Time_t * t, double *val)
+int MPL_wtime_todouble(MPL_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
@@ -59,7 +59,7 @@ int MPL_Wtime_todouble(MPL_Time_t * t, double *val)
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_acc(MPL_Time_t * t1, MPL_Time_t * t2, MPL_Time_t * t3)
+int MPL_wtime_acc(MPL_time_t * t1, MPL_time_t * t2, MPL_time_t * t3)
 {
     *t3 += (*t2 - *t1);
 
diff --git a/src/mpl/src/timer/mpl_timer_mach_absolute_time.c b/src/mpl/src/timer/mpl_timer_mach_absolute_time.c
index b869d67..31afaef 100644
--- a/src/mpl/src/timer/mpl_timer_mach_absolute_time.c
+++ b/src/mpl/src/timer/mpl_timer_mach_absolute_time.c
@@ -12,7 +12,7 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 
 static double MPIR_Wtime_mult;
 
-int MPL_Wtime_init(void)
+int MPL_wtime_init(void)
 {
     mach_timebase_info_data_t info;
     mach_timebase_info(&info);
@@ -22,35 +22,35 @@ int MPL_Wtime_init(void)
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime(MPL_Time_t * timeval)
+int MPL_wtime(MPL_time_t * timeval)
 {
     *timeval = mach_absolute_time();
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_diff(MPL_Time_t * t1, MPL_Time_t * t2, double *diff)
+int MPL_wtime_diff(MPL_time_t * t1, MPL_time_t * t2, double *diff)
 {
     *diff = (*t2 - *t1) * MPIR_Wtime_mult;
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_todouble(MPL_Time_t * t, double *val)
+int MPL_wtime_todouble(MPL_time_t * t, double *val)
 {
     *val = *t * MPIR_Wtime_mult;
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtime_acc(MPL_Time_t * t1, MPL_Time_t * t2, MPL_Time_t * t3)
+int MPL_wtime_acc(MPL_time_t * t1, MPL_time_t * t2, MPL_time_t * t3)
 {
     *t3 += *t2 - *t1;
 
     return MPL_TIMER_SUCCESS;
 }
 
-int MPL_Wtick(double *wtick)
+int MPL_wtick(double *wtick)
 {
     *wtick = tickval;
 
diff --git a/src/mpl/src/timer/mpl_timer_query_performance_counter.c b/src/mpl/src/timer/mpl_timer_query_performance_counter.c
index 382b186..4e6510c 100644
--- a/src/mpl/src/timer/mpl_timer_query_performance_counter.c
+++ b/src/mpl/src/timer/mpl_timer_query_performance_counter.c
@@ -11,7 +11,7 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 #if MPL_TIMER_KIND == MPL_TIMER_KIND__QUERYPERFORMANCECOUNTER
 
 double MPL_Seconds_per_tick = 0.0;     /* High performance counter frequency */
-int MPL_Wtime_init(void)
+int MPL_wtime_init(void)
 {
     LARGE_INTEGER n;
     QueryPerformanceFrequency(&n);
@@ -19,24 +19,24 @@ int MPL_Wtime_init(void)
     return 0;
 }
 
-double MPL_Wtick(void)
+double MPL_wtick(void)
 {
     return MPL_Seconds_per_tick;
 }
 
-void MPL_Wtime_todouble(MPL_Time_t * t, double *val)
+void MPL_wtime_todouble(MPL_time_t * t, double *val)
 {
     *val = (double) t->QuadPart * MPL_Seconds_per_tick;
 }
 
-void MPL_Wtime_diff(MPL_Time_t * t1, MPL_Time_t * t2, double *diff)
+void MPL_wtime_diff(MPL_time_t * t1, MPL_time_t * t2, double *diff)
 {
     LARGE_INTEGER n;
     n.QuadPart = t2->QuadPart - t1->QuadPart;
     *diff = (double) n.QuadPart * MPL_Seconds_per_tick;
 }
 
-void MPL_Wtime_acc(MPL_Time_t * t1, MPL_Time_t * t2, MPL_Time_t * t3)
+void MPL_wtime_acc(MPL_time_t * t1, MPL_time_t * t2, MPL_time_t * t3)
 {
     t3->QuadPart += ((t2->QuadPart) - (t1->QuadPart));
 }
diff --git a/src/mpl/src/timer/mpl_timer_win86_cycle.c b/src/mpl/src/timer/mpl_timer_win86_cycle.c
index b40d474..aee1960 100644
--- a/src/mpl/src/timer/mpl_timer_win86_cycle.c
+++ b/src/mpl/src/timer/mpl_timer_win86_cycle.c
@@ -11,41 +11,41 @@ MPL_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;
 #if (MPL_TIMER_KIND == MPL_TIMER_KIND__WIN86_CYCLE) || (MPL_TIMER_KIND == MPL_TIMER_KIND__WIN64_CYCLE)
 
 double MPL_Seconds_per_tick = 0.0;
-double MPL_Wtick(void)
+double MPL_wtick(void)
 {
     return MPL_Seconds_per_tick;
 }
 
-void MPL_Wtime_todouble(MPL_Time_t * t, double *d)
+void MPL_wtime_todouble(MPL_time_t * t, double *d)
 {
     *d = (double) (__int64) * t * MPL_Seconds_per_tick;
 }
 
-void MPL_Wtime_diff(MPL_Time_t * t1, MPL_Time_t * t2, double *diff)
+void MPL_wtime_diff(MPL_time_t * t1, MPL_time_t * t2, double *diff)
 {
     *diff = (double) ((__int64) (*t2 - *t1)) * MPL_Seconds_per_tick;
 }
 
-int MPL_Wtime_init(void)
+int MPL_wtime_init(void)
 {
-    MPL_Time_t t1, t2;
+    MPL_time_t t1, t2;
     DWORD s1, s2;
     double d;
     int i;
 
-    MPL_Wtime(&t1);
-    MPL_Wtime(&t1);
+    MPL_wtime(&t1);
+    MPL_wtime(&t1);
 
     /* time an interval using both timers */
     s1 = GetTickCount();
-    MPL_Wtime(&t1);
+    MPL_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();
-    MPL_Wtime(&t2);
+    MPL_wtime(&t2);
 
     /* calculate the frequency of the assembly cycle counter */
     MPL_Seconds_per_tick = ((double) (s2 - s1) / 1000.0) / (double) ((__int64) (t2 - t1));
diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index 036201b..a7f8e78 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -140,7 +140,7 @@ int MPIU_DBG_Outevent( const char *file, int line, int class, int kind,
     char *str, stmp[MPIU_DBG_MAXLINE];
     int  i;
     void *p;
-    MPL_Time_t t;
+    MPL_time_t t;
     double  curtime;
     unsigned long long int threadID  = 0;
     int pid = -1;
@@ -170,8 +170,8 @@ int MPIU_DBG_Outevent( const char *file, int line, int class, int kind,
         set_fp(dbg_fp);
     }
 
-    MPL_Wtime( &t );
-    MPL_Wtime_todouble( &t, &curtime );
+    MPL_wtime( &t );
+    MPL_wtime_todouble( &t, &curtime );
     curtime = curtime - time_origin;
 
     /* The kind values are used with the macros to simplify these cases */
@@ -434,7 +434,7 @@ MPIU_DBG_Class MPIU_DBG_ALL = ~(0);  /* pre-initialize the ALL class */
  */
 int MPIU_DBG_PreInit( int *argc_p, char ***argv_p, int wtimeNotReady )
 {
-    MPL_Time_t t;
+    MPL_time_t t;
 
     /* if the DBG_MSG system was already initialized, say by the device, then
        return immediately */
@@ -451,8 +451,8 @@ int MPIU_DBG_PreInit( int *argc_p, char ***argv_p, int wtimeNotReady )
     dbg_process_args( argc_p, argv_p );
 
     if (wtimeNotReady == 0) {
-	MPL_Wtime( &t );
-	MPL_Wtime_todouble( &t, &time_origin );
+	MPL_wtime( &t );
+	MPL_wtime_todouble( &t, &time_origin );
 	reset_time_origin = 0;
     }
 
@@ -491,9 +491,9 @@ int MPIU_DBG_Init( int *argc_p, char ***argv_p, int has_args, int has_env,
 
     /* We may need to wait until the device is set up to initialize the timer */
     if (reset_time_origin) {
-	MPL_Time_t t;
-	MPL_Wtime( &t );
-	MPL_Wtime_todouble( &t, &time_origin );
+	MPL_time_t t;
+	MPL_wtime( &t );
+	MPL_wtime_todouble( &t, &time_origin );
 	reset_time_origin = 0;
     }
     /* Check to see if any debugging was selected.  The order of these

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

commit 4c799ed63694c616f5bcce1e37aa805cdd4a4a16
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Dec 31 23:51:47 2015 -0600

    mpidbg: initial draft of alloc class.
    
    This patch removes the hard-coded class names.  Instead, each layer can
    allocate a new class and use it in that layer.  We still leave behind a
    few "predefined" classes (such as routine enter and exit classes), which
    do not naturally belong to any layer.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/glue/romio/glue_romio.c b/src/glue/romio/glue_romio.c
index fa327ab..e071d17 100644
--- a/src/glue/romio/glue_romio.c
+++ b/src/glue/romio/glue_romio.c
@@ -11,6 +11,10 @@
 #include "mpiimpl.h"
 #include "glue_romio.h"
 
+#if defined (USE_DBG_LOGGING)
+static MPIU_DBG_Class DBG_ROMIO;
+#endif /* USE_DBG_LOGGING */
+
 int MPIR_Ext_dbg_romio_terse_enabled = 0;
 int MPIR_Ext_dbg_romio_typical_enabled = 0;
 int MPIR_Ext_dbg_romio_verbose_enabled = 0;
@@ -19,12 +23,20 @@ int MPIR_Ext_dbg_romio_verbose_enabled = 0;
  * glue code that cannot be initialized statically */
 int MPIR_Ext_init(void)
 {
-    if (MPIU_DBG_SELECTED(ROMIO,TERSE))
+    MPIR_Ext_dbg_romio_terse_enabled = 0;
+    MPIR_Ext_dbg_romio_typical_enabled = 0;
+    MPIR_Ext_dbg_romio_verbose_enabled = 0;
+
+#if defined (USE_DBG_LOGGING)
+    DBG_ROMIO = MPIU_DBG_Class_alloc("ROMIO", "romio");
+
+    if (MPIU_DBG_SELECTED(DBG_ROMIO,TERSE))
         MPIR_Ext_dbg_romio_terse_enabled = 1;
-    if (MPIU_DBG_SELECTED(ROMIO,TYPICAL))
+    if (MPIU_DBG_SELECTED(DBG_ROMIO,TYPICAL))
         MPIR_Ext_dbg_romio_typical_enabled = 1;
-    if (MPIU_DBG_SELECTED(ROMIO,VERBOSE))
+    if (MPIU_DBG_SELECTED(DBG_ROMIO,VERBOSE))
         MPIR_Ext_dbg_romio_verbose_enabled = 1;
+#endif /* USE_DBG_LOGGING */
 
     return MPI_SUCCESS;
 }
diff --git a/src/include/mpifunc.h b/src/include/mpifunc.h
index 402c6bc..397eadf 100644
--- a/src/include/mpifunc.h
+++ b/src/include/mpifunc.h
@@ -24,13 +24,13 @@
 
 /* function enter and exit macros */
 #if defined(USE_DBG_LOGGING)
-#define MPIR_FUNC_ENTER(a) MPIU_DBG_MSG(ROUTINE_ENTER,TYPICAL,"Entering "#a)
+#define MPIR_FUNC_ENTER(a) MPIU_DBG_MSG(MPIU_DBG_ROUTINE_ENTER,TYPICAL,"Entering "#a)
 #elif defined(MPICH_DEBUG_MEMARENA)
 #define MPIR_FUNC_ENTER(a) MPIU_trvalid("Entering " #a)
 #endif
 
 #if defined(USE_DBG_LOGGING)
-#define MPIR_FUNC_EXIT(a) MPIU_DBG_MSG(ROUTINE_EXIT,TYPICAL,"Leaving "#a)
+#define MPIR_FUNC_EXIT(a) MPIU_DBG_MSG(MPIU_DBG_ROUTINE_EXIT,TYPICAL,"Leaving "#a)
 #elif defined(MPICH_DEBUG_MEMARENA)
 #define MPIR_FUNC_EXIT(a) MPIU_trvalid("Leaving " #a)
 #endif
diff --git a/src/include/mpihandlemem.h b/src/include/mpihandlemem.h
index 91b3ae7..bd912ee 100644
--- a/src/include/mpihandlemem.h
+++ b/src/include/mpihandlemem.h
@@ -6,6 +6,8 @@
 #ifndef MPIHANDLE_H_INCLUDED
 #define MPIHANDLE_H_INCLUDED
 
+#include "mpichconf.h"
+
 /*TOpaqOverview.tex
   MPI Opaque Objects:
 
@@ -116,6 +118,10 @@ const char *MPIU_Handle_get_kind_str(int kind);
 #define HANDLE_MASK 0x03FFFFFF
 #define HANDLE_INDEX(a) ((a)& HANDLE_MASK)
 
+#if defined (USE_DBG_LOGGING)
+extern MPIU_DBG_Class MPIR_DBG_HANDLE;
+#endif /* USE_DBG_LOGGING */
+
 /* ------------------------------------------------------------------------- */
 /* reference counting macros */
 
@@ -130,7 +136,7 @@ const char *MPIU_Handle_get_kind_str(int kind);
         int local_ref_count_ = MPIU_Object_get_ref(objptr_);                                        \
         if (local_ref_count_ > MPICH_DEBUG_MAX_REFCOUNT || local_ref_count_ < 0)                    \
         {                                                                                           \
-            MPIU_DBG_MSG_FMT(HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                        \
+            MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                        \
                                              "Invalid refcount (%d) in %p (0x%08x) %s",             \
                                              local_ref_count_, (objptr_), (objptr_)->handle, op_)); \
         }                                                                                           \
@@ -142,7 +148,7 @@ const char *MPIU_Handle_get_kind_str(int kind);
 #endif
 
 #define MPIU_HANDLE_LOG_REFCOUNT_CHANGE(objptr_, action_str_)                                          \
-    MPIU_DBG_MSG_FMT(HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                                   \
+    MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                                   \
                                      "%s %p (0x%08x kind=%s) refcount to %d",                          \
                                      (action_str_),                                                    \
                                      (objptr_),                                                        \
@@ -299,7 +305,7 @@ typedef OPA_int_t MPIU_Handle_ref_count;
             MPIU_Object_add_ref_always((objptr_));             \
         }                                                      \
         else {                                                                                                 \
-            MPIU_DBG_MSG_FMT(HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                                   \
+            MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                                   \
                                              "skipping add_ref on %p (0x%08x kind=%s) refcount=%d",            \
                                              (objptr_),                                                        \
                                              (objptr_)->handle,                                                \
@@ -315,7 +321,7 @@ typedef OPA_int_t MPIU_Handle_ref_count;
         }                                                            \
         else {                                                       \
             *(inuse_ptr_) = 1;                                       \
-            MPIU_DBG_MSG_FMT(HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                                   \
+            MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                                   \
                                              "skipping release_ref on %p (0x%08x kind=%s) refcount=%d",        \
                                              (objptr_),                                                        \
                                              (objptr_)->handle,                                                \
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 4907e9c..c2dd156 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -2117,6 +2117,19 @@ typedef struct MPICH_PerProcess_t {
 } MPICH_PerProcess_t;
 extern MPICH_PerProcess_t MPIR_Process;
 
+#if defined (USE_DBG_LOGGING)
+extern MPIU_DBG_Class MPIR_DBG_INIT;
+extern MPIU_DBG_Class MPIR_DBG_PT2PT;
+extern MPIU_DBG_Class MPIR_DBG_THREAD;
+extern MPIU_DBG_Class MPIR_DBG_DATATYPE;
+extern MPIU_DBG_Class MPIR_DBG_COMM;
+extern MPIU_DBG_Class MPIR_DBG_BSEND;
+extern MPIU_DBG_Class MPIR_DBG_ERRHAND;
+extern MPIU_DBG_Class MPIR_DBG_OTHER;
+
+extern MPIU_DBG_Class MPIR_DBG_ASSERT;
+#endif /* USE_DBG_LOGGING */
+
 /* ------------------------------------------------------------------------- */
 /* In MPICH, each function has an "enter" and "exit" macro.  These can be 
  * used to add various features to each function at compile time, or they
diff --git a/src/include/mpimem.h b/src/include/mpimem.h
index 7d6c066..2cd68c1 100644
--- a/src/include/mpimem.h
+++ b/src/include/mpimem.h
@@ -29,6 +29,12 @@ extern "C" {
 #define ATTRIBUTE(a)
 #endif
 
+#include "mpidbg.h"
+
+#if defined (USE_DBG_LOGGING)
+extern MPIU_DBG_Class MPIR_DBG_STRING;
+#endif /* USE_DBG_LOGGING */
+
 /* ------------------------------------------------------------------------- */
 /* mpimem.h */
 /* ------------------------------------------------------------------------- */
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index 433fd93..572e547 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -210,7 +210,7 @@ int MPIC_Wait(MPID_Request * request_ptr, MPIR_Errflag_t *errflag)
 
     MPIDI_PT2PT_FUNC_ENTER(MPID_STATE_MPIC_WAIT);
 
-    MPIU_DBG_MSG_S(PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
+    MPIU_DBG_MSG_S(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
 
     if (request_ptr->kind == MPID_REQUEST_SEND)
         request_ptr->status.MPI_TAG = 0;
@@ -234,7 +234,7 @@ int MPIC_Wait(MPID_Request * request_ptr, MPIR_Errflag_t *errflag)
     MPIR_TAG_CLEAR_ERROR_BITS(request_ptr->status.MPI_TAG);
 
  fn_exit:
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_PT2PT_FUNC_EXIT(MPID_STATE_MPIC_WAIT);
     return mpi_errno;
  fn_fail:
@@ -278,7 +278,7 @@ int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SEND);
 
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
@@ -305,7 +305,7 @@ int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
     }
 
  fn_exit:
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SEND);
     return mpi_errno;
  fn_fail:
@@ -337,7 +337,7 @@ int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_RECV);
 
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
@@ -370,7 +370,7 @@ int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int
     }
 
  fn_exit:
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_RECV);
     return mpi_errno;
  fn_fail:
@@ -394,7 +394,7 @@ int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SSEND);
 
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
             "**countneg", "**countneg %d", count);
@@ -421,7 +421,7 @@ int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
     }
 
  fn_exit:
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SSEND);
     return mpi_errno;
  fn_fail:
@@ -455,7 +455,7 @@ int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SENDRECV);
 
-    MPIU_DBG_MSG_S(PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
+    MPIU_DBG_MSG_S(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
 
     MPIR_ERR_CHKANDJUMP1((sendcount < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", sendcount);
@@ -501,7 +501,7 @@ int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype
     MPID_Request_release(recv_req_ptr);
 
  fn_exit:
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SENDRECV);
     return mpi_errno;
@@ -542,7 +542,7 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SENDRECV_REPLACE);
 
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
@@ -603,7 +603,7 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
 
  fn_exit:
     MPIU_CHKLMEM_FREEALL();
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SENDRECV_REPLACE);
     return mpi_errno;
  fn_fail:
@@ -627,7 +627,7 @@ int MPIC_Isend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_ISEND);
 
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
@@ -668,7 +668,7 @@ int MPIC_Issend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_ISSEND);
 
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
 
     MPIR_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
                          "**countneg", "**countneg %d", count);
@@ -744,7 +744,7 @@ int MPIC_Waitall(int numreq, MPID_Request *requests[], MPI_Status statuses[], MP
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIC_WAITALL);
 
-    MPIU_DBG_MSG_S(PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
+    MPIU_DBG_MSG_S(MPIR_DBG_PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
 
     if (statuses == MPI_STATUSES_IGNORE) {
         status_array = status_static_array;
@@ -781,7 +781,7 @@ int MPIC_Waitall(int numreq, MPID_Request *requests[], MPI_Status statuses[], MP
     if (numreq > MPIC_REQUEST_PTR_ARRAY_SIZE)
         MPIU_CHKLMEM_FREEALL();
 
-    MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
+    MPIU_DBG_MSG_D(MPIR_DBG_PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIC_WAITALL);
     return mpi_errno;
  fn_fail:
diff --git a/src/mpi/comm/comm_create.c b/src/mpi/comm/comm_create.c
index 9edeeab..02f8de9 100644
--- a/src/mpi/comm/comm_create.c
+++ b/src/mpi/comm/comm_create.c
@@ -87,7 +87,7 @@ int MPIR_Comm_create_calculate_mapping(MPID_Group  *group_ptr,
             int g_lpid = group_ptr->lrank_to_lpid[i].lpid;
 
             /* This mapping is relative to comm world */
-            MPIU_DBG_MSG_FMT(COMM,VERBOSE,
+            MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,
                              (MPIU_DBG_FDEST,
                               "comm-create - mapping into world[%d] = %d",
                               i, g_lpid ));
@@ -100,7 +100,7 @@ int MPIR_Comm_create_calculate_mapping(MPID_Group  *group_ptr,
             }
         }
     }
-    MPIU_DBG_MSG_D(COMM,VERBOSE, "subsetOfWorld=%d", subsetOfWorld );
+    MPIU_DBG_MSG_D(MPIR_DBG_COMM,VERBOSE, "subsetOfWorld=%d", subsetOfWorld );
     if (subsetOfWorld) {
 #           ifdef HAVE_ERROR_CHECKING
         {
diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c
index 0288822..89c3105 100644
--- a/src/mpi/comm/commutil.c
+++ b/src/mpi/comm/commutil.c
@@ -176,7 +176,7 @@ int MPIR_Setup_intercomm_localcomm(MPID_Comm * intercomm_ptr)
         MPID_CONTEXT_SET_FIELD(IS_LOCALCOMM, intercomm_ptr->recvcontext_id, 1);
     localcomm_ptr->context_id = localcomm_ptr->recvcontext_id;
 
-    MPIU_DBG_MSG_FMT(COMM, TYPICAL,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, TYPICAL,
                      (MPIU_DBG_FDEST,
                       "setup_intercomm_localcomm ic=%p ic->context_id=%d ic->recvcontext_id=%d lc->recvcontext_id=%d",
                       intercomm_ptr, intercomm_ptr->context_id, intercomm_ptr->recvcontext_id,
@@ -562,7 +562,7 @@ int MPIR_Comm_commit(MPID_Comm * comm)
 
             /* Non-fatal errors simply mean that this communicator will not have
              * any node awareness.  Node-aware collectives are an optimization. */
-            MPIU_DBG_MSG_P(COMM, VERBOSE, "MPIU_Find_local_and_external failed for comm_ptr=%p",
+            MPIU_DBG_MSG_P(MPIR_DBG_COMM, VERBOSE, "MPIU_Find_local_and_external failed for comm_ptr=%p",
                            comm);
             if (comm->intranode_table)
                 MPIU_Free(comm->intranode_table);
@@ -598,7 +598,7 @@ int MPIR_Comm_commit(MPID_Comm * comm)
             comm->node_comm->comm_kind = MPID_INTRACOMM;
             comm->node_comm->hierarchy_kind = MPID_HIERARCHY_NODE;
             comm->node_comm->local_comm = NULL;
-            MPIU_DBG_MSG_D(COMM, VERBOSE, "Create node_comm=%p\n", comm->node_comm);
+            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Create node_comm=%p\n", comm->node_comm);
 
             comm->node_comm->local_size = num_local;
             comm->node_comm->remote_size = num_local;
diff --git a/src/mpi/comm/contextid.c b/src/mpi/comm/contextid.c
index f06d361..f8f77e8 100644
--- a/src/mpi/comm/contextid.c
+++ b/src/mpi/comm/contextid.c
@@ -246,7 +246,7 @@ static int allocate_context_bit(uint32_t mask[], MPIU_Context_id_t id)
     /* clear the bit */
     mask[idx] &= ~(1 << bitpos);
 
-    MPIU_DBG_MSG_FMT(COMM, VERBOSE, (MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE, (MPIU_DBG_FDEST,
                                      "allocating contextid = %d, (mask=%p, mask[%d], bit %d)",
                                      id, mask, idx, bitpos));
     return id;
@@ -393,7 +393,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
 
     *context_id = 0;
 
-    MPIU_DBG_MSG_FMT(COMM, VERBOSE, (MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE, (MPIU_DBG_FDEST,
                                      "Entering; shared state is %d:%d, my ctx id is %d, tag=%d",
                                      mask_in_use, eager_in_use, comm_ptr->context_id, tag));
 
@@ -451,7 +451,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
             if (mask_in_use || &st != next_gcn) {
                 memset(st.local_mask, 0, MPIR_MAX_CONTEXT_MASK * sizeof(int));
                 st.own_mask = 0;
-                MPIU_DBG_MSG_FMT(COMM, VERBOSE, (MPIU_DBG_FDEST,
+                MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE, (MPIU_DBG_FDEST,
                                                  "Mask is in use, my context_id is %d, owner context id is %d",
                                                  st.comm_ptr->context_id,
                                                  next_gcn->comm_ptr->context_id));
@@ -466,7 +466,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
 
                 mask_in_use = 1;
                 st.own_mask = 1;
-                MPIU_DBG_MSG(COMM, VERBOSE, "Copied local_mask");
+                MPIU_DBG_MSG(MPIR_DBG_COMM, VERBOSE, "Copied local_mask");
             }
         }
         MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
@@ -513,7 +513,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
             /* There is a chance that we've found a context id */
             /* Find_and_allocate_context_id updates the context_mask if it finds a match */
             *context_id = find_and_allocate_context_id(st.local_mask);
-            MPIU_DBG_MSG_D(COMM, VERBOSE, "Context id is now %hd", *context_id);
+            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Context id is now %hd", *context_id);
 
             st.own_eager_mask = 0;
             eager_in_use = 0;
@@ -533,7 +533,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
             /* There is a chance that we've found a context id */
             /* Find_and_allocate_context_id updates the context_mask if it finds a match */
             *context_id = find_and_allocate_context_id(st.local_mask);
-            MPIU_DBG_MSG_D(COMM, VERBOSE, "Context id is now %hd", *context_id);
+            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Context id is now %hd", *context_id);
 
             mask_in_use = 0;
 
@@ -626,7 +626,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm * comm_ptr, MPID_Group * group_ptr
   fn_exit:
     if (ignore_id)
         *context_id = MPIU_INVALID_CONTEXT_ID;
-    MPIU_DBG_MSG_S(COMM, VERBOSE, "Context mask = %s", context_mask_to_str());
+    MPIU_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "Context mask = %s", context_mask_to_str());
     MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_GET_CONTEXTID);
     return mpi_errno;
 
@@ -1201,7 +1201,7 @@ void MPIR_Free_contextid(MPIU_Context_id_t context_id)
      * same way that low bits of non-dynamic ctx IDs do.  So we have to
      * check the dynamic case first. */
     if (MPID_CONTEXT_READ_FIELD(DYNAMIC_PROC, context_id)) {
-        MPIU_DBG_MSG_D(COMM, VERBOSE, "skipping dynamic process ctx id, context_id=%d", context_id);
+        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "skipping dynamic process ctx id, context_id=%d", context_id);
         goto fn_exit;
     }
     else {      /* non-dynamic context ID */
@@ -1213,12 +1213,12 @@ void MPIR_Free_contextid(MPIU_Context_id_t context_id)
 #ifdef USE_DBG_LOGGING
             char dump_str[1024];
             dump_context_id(context_id, dump_str, sizeof(dump_str));
-            MPIU_DBG_MSG_S(COMM, VERBOSE, "skipping localcomm id: %s", dump_str);
+            MPIU_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "skipping localcomm id: %s", dump_str);
 #endif
             goto fn_exit;
         }
         else if (MPID_CONTEXT_READ_FIELD(SUBCOMM, context_id)) {
-            MPIU_DBG_MSG_D(COMM, VERBOSE, "skipping non-parent communicator ctx id, context_id=%d",
+            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "skipping non-parent communicator ctx id, context_id=%d",
                            context_id);
             goto fn_exit;
         }
@@ -1230,8 +1230,8 @@ void MPIR_Free_contextid(MPIU_Context_id_t context_id)
 #ifdef USE_DBG_LOGGING
         char dump_str[1024];
         dump_context_id(context_id, dump_str, sizeof(dump_str));
-        MPIU_DBG_MSG_S(COMM, VERBOSE, "context dump: %s", dump_str);
-        MPIU_DBG_MSG_S(COMM, VERBOSE, "context mask = %s", context_mask_to_str());
+        MPIU_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "context dump: %s", dump_str);
+        MPIU_DBG_MSG_S(MPIR_DBG_COMM, VERBOSE, "context mask = %s", context_mask_to_str());
 #endif
         MPID_Abort(0, MPI_ERR_INTERN, 1, "In MPIR_Free_contextid, the context id is not in use");
     }
@@ -1244,7 +1244,7 @@ void MPIR_Free_contextid(MPIU_Context_id_t context_id)
     context_mask[idx] |= (0x1 << bitpos);
     MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_CTX_MUTEX);
 
-    MPIU_DBG_MSG_FMT(COMM, VERBOSE,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
                      (MPIU_DBG_FDEST,
                       "Freed context %d, mask[%d] bit %d (prefix=%#x)",
                       context_id, idx, bitpos, raw_prefix));
diff --git a/src/mpi/comm/intercomm_create.c b/src/mpi/comm/intercomm_create.c
index 4f42a2d..0bfe3ae 100644
--- a/src/mpi/comm/intercomm_create.c
+++ b/src/mpi/comm/intercomm_create.c
@@ -164,7 +164,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
         local_size = local_comm_ptr->local_size;
 
         /* printf( "About to sendrecv in intercomm_create\n" );fflush(stdout);*/
-        MPIU_DBG_MSG_FMT(COMM,VERBOSE,(MPIU_DBG_FDEST,"rank %d sendrecv to rank %d", peer_comm_ptr->rank,
+        MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPIU_DBG_FDEST,"rank %d sendrecv to rank %d", peer_comm_ptr->rank,
                                        remote_leader));
         mpi_errno = MPIC_Sendrecv( &local_size,  1, MPI_INT,
                                       remote_leader, cts_tag,
@@ -173,7 +173,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
                                       peer_comm_ptr, MPI_STATUS_IGNORE, &errflag );
         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,
+        MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPIU_DBG_FDEST, "local size = %d, remote size = %d", local_size,
                                        remote_size ));
         /* With this information, we can now send and receive the
            global process ids from the peer. */
@@ -231,7 +231,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
      * we know that the local and remote groups are disjoint, this
      * step will complete
      */
-    MPIU_DBG_MSG_FMT(COMM,VERBOSE, (MPIU_DBG_FDEST,"About to get contextid (local_size=%d) on rank %d",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPIU_DBG_FDEST,"About to get contextid (local_size=%d) on rank %d",
                                     local_comm_ptr->local_size, local_comm_ptr->rank ));
     /* In the multi-threaded case, MPIR_Get_contextid_sparse assumes that the
        calling routine already holds the single criticial section */
@@ -239,7 +239,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
     mpi_errno = MPIR_Get_contextid_sparse( local_comm_ptr, &recvcontext_id, FALSE );
     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));
+    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPIU_DBG_FDEST,"Got contextid=%d", recvcontext_id));
 
     /* Leaders can now swap context ids and then broadcast the value
        to the local group of processes */
@@ -258,7 +258,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
         comm_info[0] = remote_size;
         comm_info[1] = final_context_id;
         comm_info[2] = is_low_group;
-        MPIU_DBG_MSG(COMM,VERBOSE,"About to bcast on local_comm");
+        MPIU_DBG_MSG(MPIR_DBG_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) MPIR_ERR_POP(mpi_errno);
         MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
@@ -266,13 +266,13 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
                                      local_comm_ptr, &errflag );
         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",
+        MPIU_DBG_MSG_D(MPIR_DBG_COMM,VERBOSE,"end of bcast on local_comm of size %d",
                        local_comm_ptr->local_size );
     }
     else
     {
         /* we're the other processes */
-        MPIU_DBG_MSG(COMM,VERBOSE,"About to receive bcast on local_comm");
+        MPIU_DBG_MSG(MPIR_DBG_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) MPIR_ERR_POP(mpi_errno);
         MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
diff --git a/src/mpi/datatype/type_get_name.c b/src/mpi/datatype/type_get_name.c
index b7939a1..eff3446 100644
--- a/src/mpi/datatype/type_get_name.c
+++ b/src/mpi/datatype/type_get_name.c
@@ -178,7 +178,7 @@ int MPIR_Datatype_init_names(void)
 			      "**typeinitfail", "**typeinitfail %d", i - 1);
 	    }
 
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,
 		   "mpi_names[%d].name = %p", i, mpi_names[i].name));
 
 	    MPL_strncpy(datatype_ptr->name, mpi_names[i].name,
diff --git a/src/mpi/debugger/dbginit.c b/src/mpi/debugger/dbginit.c
index ed3e4a5..6027675 100644
--- a/src/mpi/debugger/dbginit.c
+++ b/src/mpi/debugger/dbginit.c
@@ -293,7 +293,7 @@ void MPIR_WaitForDebugger( void )
  */
 void * MPIR_Breakpoint( void )
 {
-    MPIU_DBG_MSG(OTHER,VERBOSE,"In MPIR_Breakpoint");
+    MPIU_DBG_MSG(MPIR_DBG_OTHER,VERBOSE,"In MPIR_Breakpoint");
     return 0;
 }
 #endif
@@ -452,9 +452,9 @@ MPIR_Comm_list MPIR_All_communicators = { 0, 0 };
 
 void MPIR_CommL_remember( MPID_Comm *comm_ptr )
 {   
-    MPIU_DBG_MSG_P(COMM,VERBOSE,
+    MPIU_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
 		   "Adding communicator %p to remember list",comm_ptr);
-    MPIU_DBG_MSG_P(COMM,VERBOSE,
+    MPIU_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
 		   "Remember list structure address is %p",&MPIR_All_communicators);
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_COMM_MUTEX(comm_ptr));
     if (comm_ptr == MPIR_All_communicators.head) {
@@ -464,7 +464,7 @@ void MPIR_CommL_remember( MPID_Comm *comm_ptr )
     comm_ptr->comm_next = MPIR_All_communicators.head;
     MPIR_All_communicators.head = comm_ptr;
     MPIR_All_communicators.sequence_number++;
-    MPIU_DBG_MSG_P(COMM,VERBOSE,
+    MPIU_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
 		   "master head is %p", MPIR_All_communicators.head );
 
     MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_COMM_MUTEX(comm_ptr));
@@ -474,7 +474,7 @@ void MPIR_CommL_forget( MPID_Comm *comm_ptr )
 {
     MPID_Comm *p, *prev;
 
-    MPIU_DBG_MSG_P(COMM,VERBOSE,
+    MPIU_DBG_MSG_P(MPIR_DBG_COMM,VERBOSE,
 		   "Forgetting communicator %p from remember list",comm_ptr);
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_COMM_MUTEX(comm_ptr));
     p = MPIR_All_communicators.head;
diff --git a/src/mpi/errhan/errutil.c b/src/mpi/errhan/errutil.c
index b380fbc..88c307b 100644
--- a/src/mpi/errhan/errutil.c
+++ b/src/mpi/errhan/errutil.c
@@ -253,7 +253,7 @@ int MPIR_Err_return_comm( MPID_Comm  *comm_ptr, const char fcname[],
     }
     /* --END ERROR HANDLING-- */
 
-    MPIU_DBG_MSG_FMT(ERRHAND, TERSE, (MPIU_DBG_FDEST, "MPIR_Err_return_comm(comm_ptr=%p, fcname=%s, errcode=%d)", comm_ptr, fcname, errcode));
+    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TERSE, (MPIU_DBG_FDEST, "MPIR_Err_return_comm(comm_ptr=%p, fcname=%s, errcode=%d)", comm_ptr, fcname, errcode));
 
     if (comm_ptr) {
         MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_COMM_MUTEX(comm_ptr));
@@ -357,7 +357,7 @@ int MPIR_Err_return_win( MPID_Win  *win_ptr, const char fcname[], int errcode )
 
     checkValidErrcode( error_class, fcname, &errcode );
 
-    MPIU_DBG_MSG_FMT(ERRHAND, TERSE, (MPIU_DBG_FDEST, "MPIR_Err_return_win(win_ptr=%p, fcname=%s, errcode=%d)", win_ptr, fcname, errcode));
+    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TERSE, (MPIU_DBG_FDEST, "MPIR_Err_return_win(win_ptr=%p, fcname=%s, errcode=%d)", win_ptr, fcname, errcode));
 
     /* --BEGIN ERROR HANDLING-- */
     if (MPIR_Err_is_fatal(errcode) ||
@@ -656,7 +656,7 @@ int MPIR_Err_create_code( int lastcode, int fatal, const char fcname[],
 			  int line, int error_class, const char generic_msg[],
 			  const char specific_msg[], ... )
 {
-    MPIU_DBG_MSG_FMT(ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
                                         fatal ? "Fatal " : "", lastcode, error_class, fcname, line, generic_msg));
     return (lastcode == MPI_SUCCESS) ? error_class : lastcode;
 }
@@ -686,7 +686,7 @@ int MPIR_Err_create_code( int lastcode, int fatal, const char fcname[],
 			  int line, int error_class, const char generic_msg[],
 			  const char specific_msg[], ... )
 {
-    MPIU_DBG_MSG_FMT(ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
                                         fatal ? "Fatal " : "", lastcode, error_class, fcname, line, generic_msg));
     return (lastcode == MPI_SUCCESS) ? error_class : lastcode;
 }
@@ -727,7 +727,7 @@ int MPIR_Err_create_code( int lastcode, int fatal, const char fcname[],
     int rc;
     va_list Argp;
     va_start(Argp, specific_msg);
-    MPIU_DBG_MSG_FMT(ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
                                         fatal ? "Fatal " : "", lastcode, error_class, fcname, line, generic_msg));
     rc = MPIR_Err_create_code_valist( lastcode, fatal, fcname, line,
 				      error_class, generic_msg, specific_msg,
@@ -869,7 +869,7 @@ int MPIR_Err_create_code( int lastcode, int fatal, const char fcname[],
     int rc;
     va_list Argp;
     va_start(Argp, specific_msg);
-    MPIU_DBG_MSG_FMT(ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, TYPICAL, (MPIU_DBG_FDEST, "%sError created: last=%#010x class=%#010x %s(%d) %s",
                                         fatal ? "Fatal " : "", lastcode, error_class, fcname, line, generic_msg));
     rc = MPIR_Err_create_code_valist( lastcode, fatal, fcname, line,
 				      error_class, generic_msg, specific_msg,
@@ -1084,10 +1084,10 @@ int MPIR_Err_create_code_valist( int lastcode, int fatal, const char fcname[],
 		ErrorRing[ring_idx].location[0] = '\0';
 	    }
             {
-                MPIU_DBG_MSG_FMT(ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "New ErrorRing[%d]", ring_idx));
-                MPIU_DBG_MSG_FMT(ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "    id         = %#010x", ErrorRing[ring_idx].id));
-                MPIU_DBG_MSG_FMT(ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "    prev_error = %#010x", ErrorRing[ring_idx].prev_error));
-                MPIU_DBG_MSG_FMT(ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "    user=%d", ErrorRing[ring_idx].use_user_error_code));
+                MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "New ErrorRing[%d]", ring_idx));
+                MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "    id         = %#010x", ErrorRing[ring_idx].id));
+                MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "    prev_error = %#010x", ErrorRing[ring_idx].prev_error));
+                MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND,VERBOSE,(MPIU_DBG_FDEST, "    user=%d", ErrorRing[ring_idx].use_user_error_code));
             }
 	}
 	error_ring_mutex_unlock();
@@ -1885,7 +1885,7 @@ static int checkErrcodeIsValid( int errcode )
     if (errcode <= MPIR_MAX_ERROR_CLASS_INDEX && errcode >= 0) return 0;
 
     convertErrcodeToIndexes( errcode, &ring_idx, &ring_id, &generic_idx );
-    MPIU_DBG_MSG_FMT(ERRHAND, VERBOSE, (MPIU_DBG_FDEST, "code=%#010x ring_idx=%d ring_id=%#010x generic_idx=%d",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_ERRHAND, VERBOSE, (MPIU_DBG_FDEST, "code=%#010x ring_idx=%d ring_id=%#010x generic_idx=%d",
                                         errcode, ring_idx, ring_id, generic_idx));
 
     if (ring_idx < 0 || ring_idx >= MAX_ERROR_RING ||
diff --git a/src/mpi/group/group_translate_ranks.c b/src/mpi/group/group_translate_ranks.c
index 1145f48..5307b65 100644
--- a/src/mpi/group/group_translate_ranks.c
+++ b/src/mpi/group/group_translate_ranks.c
@@ -37,7 +37,7 @@ int MPIR_Group_translate_ranks_impl(MPID_Group *gp1, int n, const int ranks1[],
     int mpi_errno = MPI_SUCCESS;
     int i, g2_idx, l1_pid, l2_pid;
 
-    MPIU_DBG_MSG_S(OTHER,VERBOSE,"gp2->is_local_dense_monotonic=%s", (gp2->is_local_dense_monotonic ? "TRUE" : "FALSE"));
+    MPIU_DBG_MSG_S(MPIR_DBG_OTHER,VERBOSE,"gp2->is_local_dense_monotonic=%s", (gp2->is_local_dense_monotonic ? "TRUE" : "FALSE"));
 
     /* Initialize the output ranks */
     for (i=0; i<n; i++)
diff --git a/src/mpi/group/grouputil.c b/src/mpi/group/grouputil.c
index 9f0b28c..89ab9e8 100644
--- a/src/mpi/group/grouputil.c
+++ b/src/mpi/group/grouputil.c
@@ -396,12 +396,12 @@ int MPIR_Group_check_subset( MPID_Group *group_ptr, MPID_Comm *comm_ptr )
     MPIR_Group_setup_lpid_list( group_ptr );
     g1_idx = group_ptr->idx_of_first_lpid;
     g2_idx = mergesort_lpidarray( vmap, vsize );
-    MPIU_DBG_MSG_FMT(COMM,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPIU_DBG_FDEST,
 			   "initial indices: %d %d\n", g1_idx, g2_idx ));
     while (g1_idx >= 0 && g2_idx >= 0) {
 	l1_pid = group_ptr->lrank_to_lpid[g1_idx].lpid;
 	l2_pid = vmap[g2_idx].lpid;
-	MPIU_DBG_MSG_FMT(COMM,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPIU_DBG_FDEST,
 				       "Lpids are %d, %d\n", l1_pid, l2_pid ));
 	if (l1_pid < l2_pid) {
 	    /* If we have to advance g1, we didn't find a match, so
@@ -416,7 +416,7 @@ int MPIR_Group_check_subset( MPID_Group *group_ptr, MPID_Comm *comm_ptr )
 	    g1_idx = group_ptr->lrank_to_lpid[g1_idx].next_lpid;
 	    g2_idx = vmap[g2_idx].next_lpid;
 	}
-	MPIU_DBG_MSG_FMT(COMM,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE,(MPIU_DBG_FDEST,
 				       "g1 = %d, g2 = %d\n", g1_idx, g2_idx ));
     }
 
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 0401124..f32b44a 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -207,7 +207,7 @@ static int thread_cs_init( void )
     MPID_THREADPRIV_INITKEY;
     MPID_THREADPRIV_INIT;
 
-    MPIU_DBG_MSG(INIT,TYPICAL,"Created global mutex and private storage");
+    MPIU_DBG_MSG(MPIR_DBG_INIT,TYPICAL,"Created global mutex and private storage");
     return MPI_SUCCESS;
 }
 
@@ -219,7 +219,7 @@ int MPIR_Thread_CS_Finalize( void )
 {
     int err;
 
-    MPIU_DBG_MSG(INIT,TYPICAL,"Freeing global mutex and private storage");
+    MPIU_DBG_MSG(MPIR_DBG_INIT,TYPICAL,"Freeing global mutex and private storage");
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL
 /* There is a single, global lock, held for the duration of an MPI call */
     MPID_Thread_mutex_destroy(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
@@ -279,6 +279,22 @@ MPI_F08_Status *MPI_F08_STATUS_IGNORE = &MPIR_F08_MPI_STATUS_IGNORE_OBJ;
 MPI_F08_Status *MPI_F08_STATUSES_IGNORE = &MPIR_F08_MPI_STATUSES_IGNORE_OBJ[0];
 #endif
 
+#if defined (USE_DBG_LOGGING)
+MPIU_DBG_Class MPIR_DBG_INIT;
+MPIU_DBG_Class MPIR_DBG_PT2PT;
+MPIU_DBG_Class MPIR_DBG_THREAD;
+MPIU_DBG_Class MPIR_DBG_DATATYPE;
+MPIU_DBG_Class MPIR_DBG_HANDLE;
+MPIU_DBG_Class MPIR_DBG_COMM;
+MPIU_DBG_Class MPIR_DBG_BSEND;
+MPIU_DBG_Class MPIR_DBG_ERRHAND;
+MPIU_DBG_Class MPIR_DBG_OTHER;
+
+/* these classes might need to move out later */
+MPIU_DBG_Class MPIR_DBG_ASSERT;
+MPIU_DBG_Class MPIR_DBG_STRING;
+#endif /* USE_DBG_LOGGING */
+
 #undef FUNCNAME
 #define FUNCNAME MPIR_Init_thread
 #undef FCNAME
@@ -505,6 +521,19 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
 #ifdef USE_DBG_LOGGING
     MPIU_DBG_Init( argc, argv, has_args, has_env, 
 		   MPIR_Process.comm_world->rank );
+
+    MPIR_DBG_INIT = MPIU_DBG_Class_alloc("INIT", "init");
+    MPIR_DBG_PT2PT = MPIU_DBG_Class_alloc("PT2PT", "pt2pt");
+    MPIR_DBG_THREAD = MPIU_DBG_Class_alloc("THREAD", "thread");
+    MPIR_DBG_DATATYPE = MPIU_DBG_Class_alloc("DATATYPE", "datatype");
+    MPIR_DBG_HANDLE = MPIU_DBG_Class_alloc("HANDLE", "handle");
+    MPIR_DBG_COMM = MPIU_DBG_Class_alloc("COMM", "comm");
+    MPIR_DBG_BSEND = MPIU_DBG_Class_alloc("BSEND", "bsend");
+    MPIR_DBG_ERRHAND = MPIU_DBG_Class_alloc("ERRHAND", "errhand");
+    MPIR_DBG_OTHER = MPIU_DBG_Class_alloc("OTHER", "other");
+
+    MPIR_DBG_ASSERT = MPIU_DBG_Class_alloc("ASSERT", "assert");
+    MPIR_DBG_STRING = MPIU_DBG_Class_alloc("STRING", "string");
 #endif
 
     /* Initialize the C versions of the Fortran link-time constants.
diff --git a/src/mpi/pt2pt/bsendutil.c b/src/mpi/pt2pt/bsendutil.c
index 734e2be..060f62b 100644
--- a/src/mpi/pt2pt/bsendutil.c
+++ b/src/mpi/pt2pt/bsendutil.c
@@ -236,7 +236,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
     else
         packsize = count;
 
-    MPIU_DBG_MSG_D(BSEND,TYPICAL,"looking for buffer of size " MPI_AINT_FMT_DEC_SPEC, packsize);
+    MPIU_DBG_MSG_D(MPIR_DBG_BSEND,TYPICAL,"looking for buffer of size " MPI_AINT_FMT_DEC_SPEC, packsize);
     /*
      * Use two passes.  Each pass is the same; between the two passes,
      * attempt to complete any active requests, and start any pending
@@ -247,7 +247,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
 	
 	p = MPIR_Bsend_find_buffer( packsize );
 	if (p) {
-	    MPIU_DBG_MSG_FMT(BSEND,TYPICAL,(MPIU_DBG_FDEST,
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPIU_DBG_FDEST,
                      "found buffer of size " MPI_AINT_FMT_DEC_SPEC " with address %p",packsize,p));
 	    /* Found a segment */
 
@@ -279,7 +279,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
                how we signal failure to send. */
 
 	    if (p->request) {
-		MPIU_DBG_MSG_FMT(BSEND,TYPICAL,
+		MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,
 		    (MPIU_DBG_FDEST,"saving request %p in %p",p->request,p));
 		/* An optimization is to check to see if the 
 		   data has already been sent.  The original code
@@ -295,7 +295,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
 	    Note that the test on phere is redundant, as the code breaks 
 	    out of the loop in the test above if a block p is found. */
 	if (p || pass == 1) break;
-	MPIU_DBG_MSG(BSEND,TYPICAL,"Could not find storage, checking active");
+	MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Could not find storage, checking active");
 	/* Try to complete some pending bsends */
 	MPIR_Bsend_check_active( );
 	/* Give priority to any pending operations */
@@ -306,8 +306,8 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
 	/* Return error for no buffer space found */
 	/* Generate a traceback of the allocated space, explaining why
 	   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_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Could not find space; dumping arena" );
+	MPIU_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
         MPIR_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_BUFFER, "**bufbsend", "**bufbsend %d %d", packsize, BsendBuffer.buffer_size);
     }
     
@@ -331,7 +331,7 @@ int MPIR_Bsend_free_req_seg( MPID_Request* req )
     int mpi_errno = MPI_ERR_INTERN;
     MPIR_Bsend_data_t *active = BsendBuffer.active;
 
-    MPIU_DBG_MSG_P(BSEND,TYPICAL,"Checking active starting at %p", active);
+    MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Checking active starting at %p", active);
     while (active) {
 
 	if (active->request == req) {
@@ -341,7 +341,7 @@ int MPIR_Bsend_free_req_seg( MPID_Request* req )
 
 	active = active->next;;
 
-	MPIU_DBG_MSG_P(BSEND,TYPICAL,"Next active is %p",active);
+	MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Next active is %p",active);
     }
 
  fn_exit:
@@ -368,23 +368,23 @@ static void MPIR_Bsend_free_segment( MPIR_Bsend_data_t *p )
 {
     MPIR_Bsend_data_t *prev = p->prev, *avail = BsendBuffer.avail, *avail_prev;
 
-    MPIU_DBG_MSG_FMT(BSEND,TYPICAL,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPIU_DBG_FDEST,
                  "Freeing bsend segment at %p of size %llu, next at %p",
                  p, (unsigned long long) p->size, ((char *)p)+p->total_size));
 
-    MPIU_DBG_MSG_D(BSEND,TYPICAL,
+    MPIU_DBG_MSG_D(MPIR_DBG_BSEND,TYPICAL,
                    "At the begining of free_segment with size %llu:",
                    (unsigned long long) p->total_size );
-    MPIU_DBG_STMT(BSEND,TYPICAL,MPIR_Bsend_dump());
+    MPIU_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
 
     /* Remove the segment from the active list */
     if (prev) {
-	MPIU_DBG_MSG(BSEND,TYPICAL,"free segment is within active list");
+	MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"free segment is within active list");
 	prev->next = p->next;
     }
     else {
 	/* p was at the head of the active list */
-	MPIU_DBG_MSG(BSEND,TYPICAL,"free segment is head of active list");
+	MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"free segment is head of active list");
 	BsendBuffer.active = p->next;
 	/* The next test sets the prev pointer to null */
     }
@@ -392,7 +392,7 @@ static void MPIR_Bsend_free_segment( MPIR_Bsend_data_t *p )
 	p->next->prev = prev;
     }
 
-    MPIU_DBG_STMT(BSEND,VERBOSE,MPIR_Bsend_dump());
+    MPIU_DBG_STMT(MPIR_DBG_BSEND,VERBOSE,MPIR_Bsend_dump());
 
     /* Merge into the avail list */
     /* Find avail_prev, avail, such that p is between them.
@@ -442,8 +442,8 @@ static void MPIR_Bsend_free_segment( MPIR_Bsend_data_t *p )
 	p->prev           = 0;
     }
 
-    MPIU_DBG_MSG(BSEND,TYPICAL,"At the end of free_segment:" );
-    MPIU_DBG_STMT(BSEND,TYPICAL,MPIR_Bsend_dump());
+    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"At the end of free_segment:" );
+    MPIU_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
 }
 
 /* 
@@ -463,7 +463,7 @@ static int MPIR_Bsend_check_active( void )
     int mpi_errno = MPI_SUCCESS;
     MPIR_Bsend_data_t *active = BsendBuffer.active, *next_active;
 
-    MPIU_DBG_MSG_P(BSEND,TYPICAL,"Checking active starting at %p", active);
+    MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Checking active starting at %p", active);
     while (active) {
 	MPI_Request r = active->request->handle;
 	int         flag;
@@ -497,11 +497,11 @@ static int MPIR_Bsend_check_active( void )
 	}
 	if (flag) {
 	    /* We're done.  Remove this segment */
-	    MPIU_DBG_MSG_P(BSEND,TYPICAL,"Removing segment %p", active);
+	    MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Removing segment %p", active);
 	    MPIR_Bsend_free_segment( active );
 	}
 	active = next_active;
-	MPIU_DBG_MSG_P(BSEND,TYPICAL,"Next active is %p",active);
+	MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Next active is %p",active);
     }
 
  fn_exit:
@@ -565,7 +565,7 @@ static void MPIR_Bsend_take_buffer( MPIR_Bsend_data_t *p, int size  )
     /* alloc_size is the amount of space (out of size) that we will 
        allocate for this buffer. */
 
-    MPIU_DBG_MSG_FMT(BSEND,TYPICAL,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPIU_DBG_FDEST,
                                     "Taking %d bytes from a block with %llu bytes\n",
                                     alloc_size, (unsigned long long) p->total_size ));
 
@@ -575,7 +575,7 @@ static void MPIR_Bsend_take_buffer( MPIR_Bsend_data_t *p, int size  )
 	   carve out a new block */
 	MPIR_Bsend_data_t *newp;
 	
-	MPIU_DBG_MSG_P(BSEND,TYPICAL,"Breaking block into used and allocated at %p", p );
+	MPIU_DBG_MSG_P(MPIR_DBG_BSEND,TYPICAL,"Breaking block into used and allocated at %p", p );
 	newp = (MPIR_Bsend_data_t *)( (char *)p + BSENDDATA_HEADER_TRUE_SIZE + 
 				alloc_size );
 	newp->total_size = p->total_size - alloc_size - 
@@ -594,7 +594,7 @@ static void MPIR_Bsend_take_buffer( MPIR_Bsend_data_t *p, int size  )
 	p->total_size = (char *)newp - (char*)p;
 	p->size       = p->total_size - BSENDDATA_HEADER_TRUE_SIZE;
 
-	MPIU_DBG_MSG_FMT(BSEND,TYPICAL,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND,TYPICAL,(MPIU_DBG_FDEST,
                                         "broken blocks p (%llu) and new (%llu)\n",
                                         (unsigned long long) p->total_size,
                                         (unsigned long long) newp->total_size ));
@@ -620,9 +620,9 @@ static void MPIR_Bsend_take_buffer( MPIR_Bsend_data_t *p, int size  )
     p->prev	       = 0;
     BsendBuffer.active = p;
 
-    MPIU_DBG_MSG_P(BSEND,VERBOSE,"segment %p now head of active",p); 
-    MPIU_DBG_MSG(BSEND,TYPICAL,"At end of take buffer" );
-    MPIU_DBG_STMT(BSEND,TYPICAL,MPIR_Bsend_dump());
+    MPIU_DBG_MSG_P(MPIR_DBG_BSEND,VERBOSE,"segment %p now head of active",p);
+    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"At end of take buffer" );
+    MPIU_DBG_STMT(MPIR_DBG_BSEND,TYPICAL,MPIR_Bsend_dump());
 }
 
 static int MPIR_Bsend_finalize( void *p ATTRIBUTE((unused)) )
@@ -647,34 +647,34 @@ static void MPIR_Bsend_dump( void )
 {
     MPIR_Bsend_data_t *a = BsendBuffer.avail;
 
-    MPIU_DBG_MSG_D(BSEND, TYPICAL, "Total size is %llu",
+    MPIU_DBG_MSG_D(MPIR_DBG_BSEND, TYPICAL, "Total size is %llu",
                    (unsigned long long) BsendBuffer.buffer_size);
-    MPIU_DBG_MSG(BSEND,TYPICAL,"Avail list is:" );
+    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Avail list is:" );
     while (a) {
-        MPIU_DBG_MSG_FMT(BSEND, TYPICAL, (MPIU_DBG_FDEST, "[%p] totalsize = %llu(%llx)",
+        MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND, TYPICAL, (MPIU_DBG_FDEST, "[%p] totalsize = %llu(%llx)",
                                           a, (unsigned long long) a->total_size,
                                           (unsigned long long) a->total_size));
 	if (a == a->next) {
-	    MPIU_DBG_MSG(BSEND,TYPICAL,
+	    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,
 			 "@@@Corrupt list; avail block points at itself" );
 	    break;
 	}
 	a = a->next;
     }
     
-    MPIU_DBG_MSG(BSEND,TYPICAL,"Active list is:" );
+    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"Active list is:" );
     a = BsendBuffer.active;
     while (a) {
-        MPIU_DBG_MSG_FMT(BSEND, TYPICAL, (MPIU_DBG_FDEST, "[%p] totalsize = %llu(%llx)",
+        MPIU_DBG_MSG_FMT(MPIR_DBG_BSEND, TYPICAL, (MPIU_DBG_FDEST, "[%p] totalsize = %llu(%llx)",
                                           a, (unsigned long long) a->total_size,
                                           (unsigned long long) a->total_size));
 	if (a == a->next) {
-	    MPIU_DBG_MSG(BSEND,TYPICAL,
+	    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,
 			 "@@@Corrupt list; active block points at itself" );
 	    break;
 	}
 	a = a->next;
     }
-    MPIU_DBG_MSG(BSEND,TYPICAL,"end of list" );
+    MPIU_DBG_MSG(MPIR_DBG_BSEND,TYPICAL,"end of list" );
 }
 #endif
diff --git a/src/mpi/topo/topoutil.c b/src/mpi/topo/topoutil.c
index 5055673..5cf2089 100644
--- a/src/mpi/topo/topoutil.c
+++ b/src/mpi/topo/topoutil.c
@@ -358,12 +358,12 @@ int MPIR_Topo_canon_nhb(MPID_Comm *comm_ptr,
 #ifdef USE_DBG_LOGGING
     {
         int i;
-        MPIU_DBG_MSG_FMT(PT2PT, VERBOSE, (MPIU_DBG_FDEST, "canonical neighbors for comm=0x%x comm_ptr=%p", comm_ptr->handle, comm_ptr));
+        MPIU_DBG_MSG_FMT(MPIR_DBG_PT2PT, VERBOSE, (MPIU_DBG_FDEST, "canonical neighbors for comm=0x%x comm_ptr=%p", comm_ptr->handle, comm_ptr));
         for (i = 0; i < outdegree; ++i) {
-            MPIU_DBG_MSG_FMT(PT2PT, VERBOSE, (MPIU_DBG_FDEST, "%d/%d: to   %d", i, outdegree, dests[i]));
+            MPIU_DBG_MSG_FMT(MPIR_DBG_PT2PT, VERBOSE, (MPIU_DBG_FDEST, "%d/%d: to   %d", i, outdegree, dests[i]));
         }
         for (i = 0; i < indegree; ++i) {
-            MPIU_DBG_MSG_FMT(PT2PT, VERBOSE, (MPIU_DBG_FDEST, "%d/%d: from %d", i, indegree, sources[i]));
+            MPIU_DBG_MSG_FMT(MPIR_DBG_PT2PT, VERBOSE, (MPIU_DBG_FDEST, "%d/%d: from %d", i, indegree, sources[i]));
         }
     }
 #endif
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 5d0e359..f81221b 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_impl.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_impl.h
@@ -141,7 +141,7 @@ typedef union MPIDI_CH3_nem_pkt
         MPID_Request *_rts_req;                                                                         \
         MPL_IOV _iov[2];                                                                               \
                                                                                                         \
-        MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending rndv RTS packet");                                      \
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv RTS packet");                                      \
         (rts_pkt)->cookie_len = (s_cookie_len);                                                         \
                                                                                                         \
         _iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST)(rts_pkt);                                            \
@@ -185,7 +185,7 @@ typedef union MPIDI_CH3_nem_pkt
         MPID_Request *_cts_req;                                                                         \
         MPL_IOV _iov[2];                                                                               \
                                                                                                         \
-        MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending rndv CTS packet");                                      \
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv CTS packet");                                      \
         MPIDI_Pkt_init(_cts_pkt, MPIDI_NEM_PKT_LMT_CTS);                                                \
         _cts_pkt->sender_req_id = (rreq)->ch.lmt_req_id;                                                \
         _cts_pkt->receiver_req_id = (rreq)->handle;                                                     \
@@ -218,7 +218,7 @@ static inline int MPID_nem_lmt_send_COOKIE(MPIDI_VC_t *vc, MPID_Request *req,
     MPID_Request *cookie_req;
     MPL_IOV iov[2];
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending rndv COOKIE packet");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv COOKIE packet");
     MPIDI_Pkt_init(cookie_pkt, MPIDI_NEM_PKT_LMT_COOKIE);
     cookie_pkt->cookie_len = (cookie_len);
 
@@ -264,7 +264,7 @@ fn_fail:
         MPID_PKT_DECL_CAST(_upkt, MPID_nem_pkt_lmt_done_t, _done_pkt);                                          \
         MPID_Request *_done_req;                                                                                \
                                                                                                                 \
-        MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending rndv DONE packet");                                             \
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv DONE packet");                                             \
         MPIDI_Pkt_init(_done_pkt, MPIDI_NEM_PKT_LMT_DONE);                                                      \
         _done_pkt->req_id = (rreq)->ch.lmt_req_id;                                                              \
                                                                                                                 \
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 deb3bf8..f5f6d38 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
@@ -123,14 +123,14 @@ MPID_nem_mpich_send_header (void* buf, int size, MPIDI_VC_t *vc, int *again)
         pbox->cell.pkt.mpich.datalen = size;
         pbox->cell.pkt.mpich.seqno   = vc_ch->send_seqno++;
         
-        MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
         
         MPIU_Memcpy((void *)pbox->cell.pkt.mpich.p.payload, buf, size);
 
         OPA_store_release_int(&pbox->flag.value, 1);
 
-        MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "--> Sent fbox ");
-        MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
+        MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent fbox ");
+        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
         
         goto return_success;
     }
@@ -169,13 +169,13 @@ MPID_nem_mpich_send_header (void* buf, int size, MPIDI_VC_t *vc, int *again)
     el->pkt.mpich.dest    = vc->lpid;
     el->pkt.mpich.datalen = size;
     el->pkt.mpich.seqno   = vc_ch->send_seqno++;
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
     
     MPIU_Memcpy((void *)el->pkt.mpich.p.payload, buf, size);
     DO_PAPI (PAPI_accum_var (PAPI_EventSet, PAPI_vvalues11));
 
-    MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "--> Sent queue");
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
+    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
 
     DO_PAPI (PAPI_reset (PAPI_EventSet));
     MPID_nem_queue_enqueue (vc_ch->recv_queue, el);
@@ -288,10 +288,10 @@ MPID_nem_mpich_sendv (MPL_IOV **iov, int *n_iov, MPIDI_VC_t *vc, int *again)
     el->pkt.mpich.dest    = vc->lpid;
     el->pkt.mpich.datalen = MPID_NEM_MPICH_DATA_LEN - payload_len;
     el->pkt.mpich.seqno   = vc_ch->send_seqno++;
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH);
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH);
 
-    MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "--> Sent queue");
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
+    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
 
     MPID_nem_queue_enqueue (vc_ch->recv_queue, el);
     /*MPID_nem_rel_dump_queue( vc_ch->recv_queue ); */
@@ -357,7 +357,7 @@ MPID_nem_mpich_sendv_header (MPL_IOV **iov, int *n_iov,
         pbox->cell.pkt.mpich.source  = MPID_nem_mem_region.local_rank;
         pbox->cell.pkt.mpich.datalen = (*iov)[1].MPL_IOV_LEN + sizeof(MPIDI_CH3_Pkt_t);
         pbox->cell.pkt.mpich.seqno   = vc_ch->send_seqno++;
-        MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
         
         MPIU_Memcpy((void *)pbox->cell.pkt.mpich.p.payload, (*iov)[0].MPL_IOV_BUF, (*iov)[0].MPL_IOV_LEN);
         MPIU_Memcpy ((char *)pbox->cell.pkt.mpich.p.payload + (*iov)[0].MPL_IOV_LEN, (*iov)[1].MPL_IOV_BUF, (*iov)[1].MPL_IOV_LEN);
@@ -365,8 +365,8 @@ MPID_nem_mpich_sendv_header (MPL_IOV **iov, int *n_iov,
         OPA_store_release_int(&pbox->flag.value, 1);
         *n_iov = 0;
 
-        MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "--> Sent fbox ");
-        MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
+        MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent fbox ");
+        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
         
         goto return_success;
     }
@@ -437,10 +437,10 @@ MPID_nem_mpich_sendv_header (MPL_IOV **iov, int *n_iov,
     el->pkt.mpich.dest    = vc->lpid;
     el->pkt.mpich.datalen = MPID_NEM_MPICH_DATA_LEN - payload_len;
     el->pkt.mpich.seqno   = vc_ch->send_seqno++;
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
 
-    MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "--> Sent queue");
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
+    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
 
     MPID_nem_queue_enqueue (vc_ch->recv_queue, el);	
     /*MPID_nem_rel_dump_queue( vc_ch->recv_queue ); */
@@ -525,7 +525,7 @@ MPID_nem_mpich_send_seg_header (MPID_Segment *segment, MPIDI_msg_sz_t *segment_f
 	    pbox->cell.pkt.mpich.source  = MPID_nem_mem_region.local_rank;
 	    pbox->cell.pkt.mpich.datalen = sizeof(MPIDI_CH3_Pkt_t) + segment_size;
 	    pbox->cell.pkt.mpich.seqno   = vc_ch->send_seqno++;
-            MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+            MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, pbox->cell.pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
 
             /* copy header */
             MPIU_Memcpy((void *)pbox->cell.pkt.mpich.p.payload, header, header_sz);
@@ -539,8 +539,8 @@ MPID_nem_mpich_send_seg_header (MPID_Segment *segment, MPIDI_msg_sz_t *segment_f
 
             *segment_first = last;
 
-	    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "--> Sent fbox ");
-	    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent fbox ");
+	    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (&pbox->cell));
 
             goto return_success;
 	}
@@ -598,10 +598,10 @@ MPID_nem_mpich_send_seg_header (MPID_Segment *segment, MPIDI_msg_sz_t *segment_f
     el->pkt.mpich.dest    = vc->lpid;
     el->pkt.mpich.datalen = datalen;
     el->pkt.mpich.seqno   = vc_ch->send_seqno++;
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
 
-    MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "--> Sent queue");
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
+    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
 
     MPID_nem_queue_enqueue (vc_ch->recv_queue, el);	
 
@@ -681,10 +681,10 @@ MPID_nem_mpich_send_seg (MPID_Segment *segment, MPIDI_msg_sz_t *segment_first, M
     el->pkt.mpich.dest    = vc->lpid;
     el->pkt.mpich.datalen = datalen;
     el->pkt.mpich.seqno   = vc_ch->send_seqno++;
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, el->pkt.mpich.type = MPID_NEM_PKT_MPICH_HEAD);
 
-    MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "--> Sent queue");
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
+    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "--> Sent queue");
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (el));
 
     MPID_nem_queue_enqueue (vc_ch->recv_queue, el);	
 
@@ -867,11 +867,11 @@ MPID_nem_mpich_test_recv(MPID_nem_cell_ptr_t *cell, int *in_fbox, int in_blockin
  fn_exit:
     DO_PAPI (PAPI_accum_var (PAPI_EventSet, PAPI_vvalues6));
     
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, {
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
 	if (*cell)
 	{
-	    MPIU_DBG_MSG_S (CH3_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
-	    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (*cell));
+	    MPIU_DBG_MSG_S (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
+	    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (*cell));
 	}
     });
 
@@ -926,11 +926,11 @@ MPID_nem_mpich_test_recv_wait (MPID_nem_cell_ptr_t *cell, int *in_fbox, int time
     *in_fbox = 0;
  exit_l:
     
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, {
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
             if (*cell)
             {
-                MPIU_DBG_MSG_S (CH3_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
-                MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (*cell));
+                MPIU_DBG_MSG_S (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
+                MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell (*cell));
             }
         });
 
@@ -1014,11 +1014,11 @@ MPID_nem_mpich_blocking_recv(MPID_nem_cell_ptr_t *cell, int *in_fbox, int comple
 
     DO_PAPI (PAPI_accum_var (PAPI_EventSet,PAPI_vvalues8));
     
-    MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, {
+    MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
             if (*cell)
             {
-                MPIU_DBG_MSG_S (CH3_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
-                MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell(*cell));
+                MPIU_DBG_MSG_S (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "<-- Recv %s", (*in_fbox) ? "fbox " : "queue");
+                MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, MPID_nem_dbg_dump_cell(*cell));
             }
         });
 
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 d3ac74a..382fb2f 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
@@ -30,14 +30,14 @@ extern struct MPID_Request *MPIDI_CH3I_shm_active_send;
 #define MPIDI_CH3I_Sendq_enqueue(qp, ep) do {                                           \
         /* add refcount so req doesn't get freed before it's dequeued */                \
         MPIR_Request_add_ref(ep);                                                       \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
                           "MPIDI_CH3I_Sendq_enqueue req=%p (handle=%#x), queue=%p",     \
                           ep, (ep)->handle, qp));                                       \
         GENERIC_Q_ENQUEUE (qp, ep, dev.next);                                           \
     } while (0)
 #define MPIDI_CH3I_Sendq_dequeue(qp, ep)  do {                                          \
         GENERIC_Q_DEQUEUE (qp, ep, dev.next);                                           \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
                           "MPIDI_CH3I_Sendq_dequeuereq=%p (handle=%#x), queue=%p",      \
                           *(ep), *(ep) ? (*(ep))->handle : -1, qp));                    \
         MPID_Request_release(*(ep));                                                    \
diff --git a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h
index 5603587..1686232 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h
@@ -53,21 +53,21 @@ typedef GENERIC_Q_DECL(struct MPID_Request) MPID_nem_lmt_rts_queue_t;
 #define MPID_nem_lmt_rtsq_empty(q) GENERIC_Q_EMPTY (q)
 #define MPID_nem_lmt_rtsq_head(q) GENERIC_Q_HEAD (q)
 #define MPID_nem_lmt_rtsq_enqueue(qp, ep) do {                                          \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
                           "MPID_nem_lmt_rtsq_enqueue req=%p (handle=%#x), queue=%p",    \
                           ep, (ep)->handle, qp));                                       \
         GENERIC_Q_ENQUEUE (qp, ep, dev.next);                                           \
     } while (0)
 #define MPID_nem_lmt_rtsq_dequeue(qp, epp)  do {                                        \
         GENERIC_Q_DEQUEUE (qp, epp, dev.next);                                          \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
                           "MPID_nem_lmt_rtsq_dequeue req=%p (handle=%#x), queue=%p",    \
                           *(epp), *(epp) ? (*(epp))->handle : -1, qp));                 \
     } while (0)
 #define MPID_nem_lmt_rtsq_search_remove(qp, req_id, epp) do {                           \
         GENERIC_Q_SEARCH_REMOVE(qp, _e->handle == (req_id), epp,                        \
                 struct MPID_Request, dev.next);                                         \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
                     "MPID_nem_lmt_rtsq_search_remove req=%p (handle=%#x), queue=%p",    \
                     *(epp), req_id, qp));                                               \
 } while (0)
@@ -192,18 +192,18 @@ struct MPIDI_CH3I_Request
 #if 0
 #define DUMP_REQUEST(req) do {                                          \
         int i;                                                          \
-        MPIU_DBG_MSG_P(CH3_OTHER, TERSE, "request %p\n", (req));        \
-        MPIU_DBG_MSG_D(CH3_OTHER, TERSE, "  handle = %d\n", (req)->handle); \
-        MPIU_DBG_MSG_D(CH3_OTHER, TERSE, "  ref_count = %d\n", (req)->ref_count); \
-        MPIU_DBG_MSG_D(CH3_OTHER, TERSE, "  cc = %d\n", (req)->cc);     \
+        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER, TERSE, "request %p\n", (req));        \
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  handle = %d\n", (req)->handle); \
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  ref_count = %d\n", (req)->ref_count); \
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  cc = %d\n", (req)->cc);     \
         for (i = 0; i < (req)->iov_count; ++i)                          \
-            MPIU_DBG_MSG_FMT(CH3_OTHER, TERSE, (MPIU_DBG_FDEST, "  dev.iov[%d] = (%p, %d)\n", i, \
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPIU_DBG_FDEST, "  dev.iov[%d] = (%p, %d)\n", i, \
                                                 (req)->dev.iov[i+(req)->dev.iov_offset].MPL_IOV_BUF, \
                                                 (req)->dev.iov[i+(req)->dev.iov_offset].MPL_IOV_LEN)); \
-        MPIU_DBG_MSG_D(CH3_OTHER, TERSE, "  dev.iov_count = %d\n",      \
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "  dev.iov_count = %d\n",      \
                        (req)->dev.iov_count);                           \
-        MPIU_DBG_MSG_FMT(CH3_OTHER, TERSE, (MPIU_DBG_FDEST, "  dev.state = 0x%x\n", (req)->dev.state)); \
-        MPIU_DBG_MSG_D(CH3_OTHER, TERSE, "    type = %d\n",             \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPIU_DBG_FDEST, "  dev.state = 0x%x\n", (req)->dev.state)); \
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, TERSE, "    type = %d\n",             \
                        MPIDI_Request_get_type(req));                    \
     } while (0)
 #else
@@ -232,7 +232,7 @@ extern OPA_int_t MPIDI_CH3I_progress_completion_count;
 #define MPIDI_CH3I_INCR_PROGRESS_COMPLETION_COUNT do {                                  \
         OPA_write_barrier();                                                            \
         OPA_incr_int(&MPIDI_CH3I_progress_completion_count);                            \
-        MPIU_DBG_MSG_D(CH3_PROGRESS,VERBOSE,                                            \
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_PROGRESS,VERBOSE,                                            \
                        "just incremented MPIDI_CH3I_progress_completion_count=%d",      \
                        OPA_load_int(&MPIDI_CH3I_progress_completion_count));            \
     } while(0)
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 4b1be26..8017816 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
@@ -61,7 +61,7 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
 
     /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_SEND_HANDLER); */
 
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_send_handler");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_send_handler");
 
     MPIU_Assert(sreq != NULL);
 
@@ -76,8 +76,8 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
         MPID_nem_llc_send_queued(vc, &vc_llc->send_queue);
 
         p_reqid[0] = !MPIDI_CH3I_Sendq_empty(vc_llc->send_queue);
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_send_handler");
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "send queue %d", (unsigned int) p_reqid[0]);
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_send_handler");
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "send queue %d", (unsigned int) p_reqid[0]);
 
         goto fn_exit;
     }
@@ -138,7 +138,7 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
                     if (r_mpi_errno != MPI_SUCCESS) {
                         MPIR_ERR_POP(r_mpi_errno);
                     }
-                    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                 }
                 else {
                     complete = 0;
@@ -148,7 +148,7 @@ static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
                     if (complete == 0) {
                         MPIU_Assert(complete == TRUE);
                     }
-                    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete2");
+                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete2");
                 }
 
                 /* push queued messages */
@@ -185,7 +185,7 @@ static void MPID_nem_llc_recv_handler(void *vp_vc, uint64_t raddr, void *buf, si
 
     /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_RECV_HANDLER); */
 
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_recv_handler");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_recv_handler");
 
     {
         int pg_rank = (int) raddr;
@@ -201,13 +201,13 @@ static void MPID_nem_llc_recv_handler(void *vp_vc, uint64_t raddr, void *buf, si
             MPIDI_PG_Get_vc_set_active(pg, pg_rank, &vc_from_pg);
         }
         else {
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad vc %p or", pg);
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad pg_rank %d", pg_rank);
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad pg_rank < %d", MPIDI_PG_Get_size(pg));
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad vc %p or", pg);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad pg_rank %d", pg_rank);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad pg_rank < %d", MPIDI_PG_Get_size(pg));
             vc_from_pg = vc;    /* XXX */
         }
         if (vc != vc_from_pg) {
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad vc for pg_rank %d", pg_rank);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bad vc for pg_rank %d", pg_rank);
         }
         if (vc == 0) {
             vc = vc_from_pg;
@@ -216,7 +216,7 @@ static void MPID_nem_llc_recv_handler(void *vp_vc, uint64_t raddr, void *buf, si
     if (vc != 0) {
         mpi_errno = MPID_nem_handle_pkt(vc, buf, bsz);
         if (mpi_errno != 0) {
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "MPID_nem_handle_pkt() = %d", mpi_errno);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPID_nem_handle_pkt() = %d", mpi_errno);
         }
     }
 
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 5e3f1a2..f17797d 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
@@ -177,13 +177,13 @@ int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
             MPIDI_Process.my_pg_rank, vc->pg_rank, hdr, hdr_sz, data, data_sz);
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_iStartContigMsg");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_iStartContigMsg");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "vc.pg_rank = %d", vc->pg_rank);
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "my_pg_rank = %d", MPIDI_Process.my_pg_rank);
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "hdr_sz     = %d", (int) hdr_sz);
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "data_sz    = %d", (int) data_sz);
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "hdr type   = %d", ((MPIDI_CH3_Pkt_t *) hdr)->type);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc.pg_rank = %d", vc->pg_rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "my_pg_rank = %d", MPIDI_Process.my_pg_rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "hdr_sz     = %d", (int) hdr_sz);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "data_sz    = %d", (int) data_sz);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "hdr type   = %d", ((MPIDI_CH3_Pkt_t *) hdr)->type);
 
     /* create a request */
     sreq = MPID_Request_create();
@@ -202,12 +202,12 @@ int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
     sreq->dev.iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) & sreq->dev.pending_pkt;
     sreq->dev.iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
     sreq->dev.iov_count = 1;
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
     if (data_sz > 0) {
         sreq->dev.iov[1].MPL_IOV_BUF = data;
         sreq->dev.iov[1].MPL_IOV_LEN = data_sz;
         sreq->dev.iov_count = 2;
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
     }
 
@@ -227,17 +227,17 @@ int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
             mpi_errno = MPI_ERR_OTHER;
             MPIR_ERR_POP(mpi_errno);
         }
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
         if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
             need_to_queue = 2;  /* YYY */
         }
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
     }
 
   queue_it:
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "need_to_que  %d", need_to_queue);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "need_to_que  %d", need_to_queue);
     if (need_to_queue > 0) {
         MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
     }
@@ -271,17 +271,17 @@ int MPID_nem_llc_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
             sreq, hdr, hdr_sz, data, data_sz);
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_iSendContig");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_iSendContig");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
     MPIU_DBG_PKT(vc, hdr, "isendcontig");
     {
         MPIDI_CH3_Pkt_t *pkt = (MPIDI_CH3_Pkt_t *) hdr;
 
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "pkt->type  = %d", pkt->type);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "pkt->type  = %d", pkt->type);
     }
 
     MPIU_Assert(sreq != NULL);
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "OnDataAvail= %p", sreq->dev.OnDataAvail);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "OnDataAvail= %p", sreq->dev.OnDataAvail);
     sreq->ch.vc = vc;
     sreq->dev.iov_offset = 0;
 
@@ -290,12 +290,12 @@ int MPID_nem_llc_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
     sreq->dev.iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) & sreq->dev.pending_pkt;
     sreq->dev.iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
     sreq->dev.iov_count = 1;
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN    = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
     if (data_sz > 0) {
         sreq->dev.iov[1].MPL_IOV_BUF = data;
         sreq->dev.iov[1].MPL_IOV_LEN = data_sz;
         sreq->dev.iov_count = 2;
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "IOV_LEN    = %d", (int) sreq->dev.iov[1].MPL_IOV_LEN);
     }
 
@@ -315,14 +315,14 @@ int MPID_nem_llc_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
             mpi_errno = MPI_ERR_OTHER;
             MPIR_ERR_POP(mpi_errno);
         }
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "WRITEV()   = %d", ret);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "WRITEV()   = %d", ret);
         if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
             need_to_queue = 2;  /* YYY */
         }
     }
 
   queue_it:
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "need_to_que  %d", need_to_queue);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "need_to_que  %d", need_to_queue);
     if (need_to_queue > 0) {
         MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
     }
@@ -344,7 +344,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_SENDNONCONTIG);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_SENDNONCONTIG);
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_SendNoncontig");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_SendNoncontig");
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
 
@@ -359,7 +359,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     sreq->dev.iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST) & sreq->dev.pending_pkt;
     sreq->dev.iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
     sreq->dev.iov_count = 1;
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[0].MPL_IOV_LEN);
 
     data_sz = sreq->dev.segment_size;
     if (data_sz > 0) {
@@ -371,7 +371,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
         sreq->dev.iov[1].MPL_IOV_BUF = REQ_FIELD(sreq, rma_buf);
         sreq->dev.iov[1].MPL_IOV_LEN = data_sz;
         sreq->dev.iov_count = 2;
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[1].MPL_IOV_LEN);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[1].MPL_IOV_LEN);
     }
 
     sreq->ch.vc = vc;
@@ -398,7 +398,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     }
 
   queue_it:
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "need_to_que %d", need_to_queue);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "need_to_que %d", need_to_queue);
     if (need_to_queue > 0) {
         MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
     }
@@ -434,7 +434,7 @@ int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t * send_queue)
         int niov;
 
         sreq = MPIDI_CH3I_Sendq_head(*send_queue);
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "sreq %p", sreq);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "sreq %p", sreq);
 
         if (mpi_errno == MPI_SUCCESS) {
             iovs = &sreq->dev.iov[sreq->dev.iov_offset];
@@ -450,12 +450,12 @@ int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t * send_queue)
             MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
             sreq->status.MPI_ERROR = mpi_errno;
 
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "OnDataAvail = %p", sreq->dev.OnDataAvail);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "OnDataAvail = %p", sreq->dev.OnDataAvail);
             MPID_Request_complete(sreq);
             continue;
         }
         if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "skip %p", sreq);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "skip %p", sreq);
             break;
         }
         MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
@@ -483,16 +483,16 @@ int MPIDI_nem_llc_Rqst_iov_update(MPID_Request * mreq, MPIDI_msg_sz_t consume)
 
     MPIU_Assert(consume >= 0);
 
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : consume    %d", (int) consume);
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : iov_count  %d", mreq->dev.iov_count);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : consume    %d", (int) consume);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : iov_count  %d", mreq->dev.iov_count);
 
     nv = mreq->dev.iov_count;
     for (iv = mreq->dev.iov_offset; iv < nv; iv++) {
         MPL_IOV *iov = &mreq->dev.iov[iv];
 
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : iov[iv]    %d", iv);
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : consume b  %d", (int) consume);
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : iov[iv]    %d", iv);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : consume b  %d", (int) consume);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "iov_update() : iov_len b  %d", (int) iov->MPL_IOV_LEN);
         if (iov->MPL_IOV_LEN > consume) {
             iov->MPL_IOV_BUF = ((char *) iov->MPL_IOV_BUF) + consume;
@@ -504,13 +504,13 @@ int MPIDI_nem_llc_Rqst_iov_update(MPID_Request * mreq, MPIDI_msg_sz_t consume)
         consume -= iov->MPL_IOV_LEN;
         iov->MPL_IOV_LEN = 0;
     }
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : consume %d", (int) consume);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : consume %d", (int) consume);
 
     mreq->dev.iov_count = nv - iv;
     mreq->dev.iov_offset = iv;
 
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : iov_offset %ld", mreq->dev.iov_offset);
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() = %d", ret);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() : iov_offset %ld", mreq->dev.iov_offset);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_update() = %d", ret);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_NEM_LLC_RQST_IOV_UPDATE);
     return ret;
@@ -527,7 +527,7 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
 
     dprintf("writev,raddr=%ld,niov=%d,sreq=%p", raddr, niov, cbarg);
 
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev(%d)", (int) raddr);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev(%d)", (int) raddr);
     {
         uint8_t *buff = 0;
 #ifdef	notdef_hsiz_hack
@@ -599,7 +599,7 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
         char *bp;
         size_t bz;
 
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : nv %d", nv);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev() : nv %d", nv);
         bp = (void *) lcmd->iov_local[0].addr;
         bz = lcmd->iov_local[0].length;
 
@@ -627,11 +627,11 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
             }
             bp += len;
         }
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : iv %d", iv);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev() : iv %d", iv);
         {
             void *bb = (void *) lcmd->iov_local[0].addr;
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "wptr       = %d", (int) (bp - (char *) bb));
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "wptr       = %d", (int) (bp - (char *) bb));
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                            "blocklengt = %d", (int) lcmd->iov_local[0].length);
             MPIU_DBG_PKT(endpt, bb, "writev");
         }
@@ -666,7 +666,7 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
     }
 
   bad:
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : nw %d", (int) nw);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "llc_writev() : nw %d", (int) nw);
     return nw;
 }
 
@@ -788,7 +788,7 @@ int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
 #endif
 #endif /* notdef_hsiz_hack */
                 {
-                    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "LLC_leng   = %d", (int) bsiz);
+                    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "LLC_leng   = %d", (int) bsiz);
                     MPIU_DBG_PKT(vp_vc, buff, "poll");
                 }
                 dprintf("llc_poll,EVENT_UNSOLICITED_ARRIVED,%d<-%d\n",
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 eb00c01..e3af2f3 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
@@ -130,11 +130,11 @@ static int llc_vc_init(MPIDI_VC_t * vc)
 
 
     {
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "MPIDI_NEM_VC_NETMOD_AREA_LEN = %d\n", MPIDI_NEM_VC_NETMOD_AREA_LEN);
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "MPIDI_NEM_REQ_NETMOD_AREA_LEN = %d", MPIDI_NEM_REQ_NETMOD_AREA_LEN);
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                        "MPID_nem_llc_vc_area = %d\n", (int) sizeof(MPID_nem_llc_vc_area));
     }
 
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
index ecee4bb..5c2d999 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
@@ -190,14 +190,14 @@ typedef GENERIC_Q_DECL(struct MPID_Request) MPID_nem_mxm_reqq_t;
 #define MPID_nem_mxm_queue_enqueue(qp, ep) do {                                           \
         /* add refcount so req doesn't get freed before it's dequeued */                \
         MPIR_Request_add_ref(ep);                                                       \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
                           "MPID_nem_mxm_queue_enqueue req=%p (handle=%#x), queue=%p",     \
                           ep, (ep)->handle, qp));                                       \
         GENERIC_Q_ENQUEUE (qp, ep, dev.next);                                           \
     } while (0)
 #define MPID_nem_mxm_queue_dequeue(qp, ep)  do {                                          \
         GENERIC_Q_DEQUEUE (qp, ep, dev.next);                                           \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,                         \
                           "MPID_nem_mxm_queue_dequeuereq=%p (handle=%#x), queue=%p",      \
                           *(ep), *(ep) ? (*(ep))->handle : -1, qp));                    \
         MPID_Request_release(*(ep));                                                    \
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 1b0f091..7408f8b 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
@@ -277,7 +277,7 @@ int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc)
 
     /* local connection is used for any source communication */
     MPIU_Assert(MPID_nem_mem_region.rank != vc->lpid);
-    MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                      (MPIU_DBG_FDEST,
                       "[%i]=== connecting  to  %i  \n", MPID_nem_mem_region.rank, vc->lpid));
     {
@@ -410,7 +410,7 @@ static int _mxm_conf(void)
 
     cur_ver = mxm_get_version();
     if (cur_ver != MXM_API) {
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE,
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                          (MPIU_DBG_FDEST,
                           "WARNING: MPICH was compiled with MXM version %d.%d but version %ld.%ld detected.",
                           MXM_VERNO_MAJOR,
@@ -436,7 +436,7 @@ static int _mxm_conf(void)
         (_mxm_obj.conf.bulk_connect || _mxm_obj.conf.bulk_disconnect)) {
         _mxm_obj.conf.bulk_connect = 0;
         _mxm_obj.conf.bulk_disconnect = 0;
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE,
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE,
                          (MPIU_DBG_FDEST,
                           "WARNING: MPICH runs with %s version of MXM that is less than 3.2, "
                           "so bulk connect/disconnect cannot work properly and will be turn off.",
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 680041b..c6a0298 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
@@ -77,7 +77,7 @@ void MPID_nem_mxm_get_adi_msg(mxm_conn_h conn, mxm_imm_t imm, void *data,
 {
     MPIDI_VC_t *vc = NULL;
 
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "MPID_nem_mxm_get_adi_msg");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPID_nem_mxm_get_adi_msg");
 
     vc = mxm_conn_ctx_get(conn);
 
@@ -273,7 +273,7 @@ static int _mxm_handle_rreq(MPID_Request * req)
     else {
         data_sz = userbuf_sz;
         MPIR_STATUS_SET_COUNT(req->status, userbuf_sz);
-        MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE, (MPIU_DBG_FDEST,
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPIU_DBG_FDEST,
                                               "receive buffer too small; message truncated, msg_sz="
                                               MPIDI_MSG_SZ_FMT ", userbuf_sz="
                                               MPIDI_MSG_SZ_FMT, req->dev.recv_data_sz, userbuf_sz));
@@ -395,7 +395,7 @@ static int _mxm_irecv(MPID_nem_mxm_ep_t * ep, MPID_nem_mxm_req_area * req, int i
         list_grow_mxm_req(free_queue);
         req->mxm_req = list_dequeue_mxm_req(free_queue);
         if (!req->mxm_req) {
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "empty free queue");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "empty free queue");
             mpi_errno = MPI_ERR_OTHER;
             goto fn_fail;
         }
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 fcaf499..c4006bc 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
@@ -43,7 +43,7 @@ int MPID_nem_mxm_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISENDCONTIGMSG);
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "mxm_iSendContig");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "mxm_iSendContig");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
 
     MPIU_Memcpy(&(sreq->dev.pending_pkt), (char *) hdr, sizeof(MPIDI_CH3_Pkt_t));
@@ -109,7 +109,7 @@ int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISTARTCONTIGMSG);
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "mxm_iStartContigMsg");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "mxm_iStartContigMsg");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
 
     /* create a request */
@@ -174,7 +174,7 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_SENDNONCONTIGMSG);
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "MPID_nem_mxm_iSendNoncontig");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPID_nem_mxm_iSendNoncontig");
 
     MPIU_Memcpy(&(sreq->dev.pending_pkt), (char *) hdr, sizeof(MPIDI_CH3_Pkt_t));
 
@@ -723,7 +723,7 @@ static int _mxm_isend(MPID_nem_mxm_ep_t * ep, MPID_nem_mxm_req_area * req,
         list_grow_mxm_req(free_queue);
         req->mxm_req = list_dequeue_mxm_req(free_queue);
         if (!req->mxm_req) {
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "empty free queue");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "empty free queue");
             mpi_errno = MPI_ERR_OTHER;
             goto fn_fail;
         }
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
index 43f6020..6d32684 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
@@ -221,10 +221,10 @@ const char *MPID_nem_ptl_strnifail(ptl_ni_fail_t ni_fail);
 const char *MPID_nem_ptl_strlist(ptl_list_t list);
 
 #define DBG_MSG_PUT(md_, data_sz_, pg_rank_, match_, header_) do {                                                                          \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "MPID_nem_ptl_rptl_put: md=%s data_sz=%lu pg_rank=%d", md_, data_sz_, pg_rank_));          \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        tag=%#lx ctx=%#lx rank=%ld match=%#lx",                            \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "MPID_nem_ptl_rptl_put: md=%s data_sz=%lu pg_rank=%d", md_, data_sz_, pg_rank_));          \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        tag=%#lx ctx=%#lx rank=%ld match=%#lx",                            \
                                                 NPTL_MATCH_GET_TAG(match_), NPTL_MATCH_GET_CTX(match_), NPTL_MATCH_GET_RANK(match_), match_)); \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        flags=%c%c%c data_sz=%ld header=%#lx",                             \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        flags=%c%c%c data_sz=%ld header=%#lx",                             \
                                                 header_ & NPTL_SSEND ? 'S':' ',                                                             \
                                                 header_ & NPTL_LARGE ? 'L':' ',                                                             \
                                                 header_ & NPTL_MULTIPLE ? 'M':' ',                                                          \
@@ -232,22 +232,22 @@ const char *MPID_nem_ptl_strlist(ptl_list_t list);
     } while(0)
 
 #define DBG_MSG_GET(md_, data_sz_, pg_rank_, match_) do {                                                                                   \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlGet: md=%s data_sz=%lu pg_rank=%d", md_, data_sz_, pg_rank_));          \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        tag=%#lx ctx=%#lx rank=%ld match=%#lx",                            \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlGet: md=%s data_sz=%lu pg_rank=%d", md_, data_sz_, pg_rank_));          \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        tag=%#lx ctx=%#lx rank=%ld match=%#lx",                            \
                                                 NPTL_MATCH_GET_TAG(match_), NPTL_MATCH_GET_CTX(match_), NPTL_MATCH_GET_RANK(match_), match_)); \
     } while(0)
 
 #define DBG_MSG_MEAPPEND(pt_, pg_rank_, me_, usr_ptr_) do {                                                                                 \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMEAppend: pt=%s pg_rank=%d me.start=%p me.length=%lu is_IOV=%d usr_ptr=%p", \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMEAppend: pt=%s pg_rank=%d me.start=%p me.length=%lu is_IOV=%d usr_ptr=%p", \
                                                 pt_, pg_rank_, me_.start, me_.length, me_.options & PTL_IOVEC, usr_ptr_));                  \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "             tag=%#lx ctx=%#lx rank=%ld match=%#lx ignore=%#lx",           \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "             tag=%#lx ctx=%#lx rank=%ld match=%#lx ignore=%#lx",           \
                                                 NPTL_MATCH_GET_TAG(me_.match_bits), NPTL_MATCH_GET_CTX(me_.match_bits),                     \
                                                 NPTL_MATCH_GET_RANK(me_.match_bits), me_.match_bits, me_.ignore_bits));                     \
     } while(0)
     
 #define DBG_MSG_MESearch(pt_, pg_rank_, me_, usr_ptr_) do {                                                                             \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMESearch: pt=%s pg_rank=%d usr_ptr=%p", pt_, pg_rank_, usr_ptr_));  \
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "             tag=%#lx ctx=%#lx rank=%ld match=%#lx ignore=%#lx",       \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMESearch: pt=%s pg_rank=%d usr_ptr=%p", pt_, pg_rank_, usr_ptr_));  \
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "             tag=%#lx ctx=%#lx rank=%ld match=%#lx ignore=%#lx",       \
                                                 NPTL_MATCH_GET_TAG(me_.match_bits), NPTL_MATCH_GET_CTX(me_.match_bits),                 \
                                                 NPTL_MATCH_GET_RANK(me_.match_bits), me_.match_bits, me_.ignore_bits));                 \
     } while(0)
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 921e2b4..1c12f81 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
@@ -377,7 +377,7 @@ static int get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
 
     ret = PtlGetId(MPIDI_nem_ptl_ni, &my_ptl_id);
     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",
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_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));
@@ -613,7 +613,7 @@ int MPID_nem_ptl_vc_terminated(MPIDI_VC_t *vc)
     MPIDI_FUNC_EXIT(MPID_NEM_PTL_VC_TERMINATED);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
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 bafb327..9b7ebc3 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -241,7 +241,7 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
                                 vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, NPTL_HEADER(0, remaining));
     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)",
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
                                             sendbuf_sz, vc_ptl->id.phys.nid,
                                             vc_ptl->id.phys.pid, vc_ptl->ptc));
 
@@ -315,7 +315,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
                                 vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, NPTL_HEADER(0, remaining));
     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)",
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
                                             sendbuf_sz, vc_ptl->id.phys.nid,
                                             vc_ptl->id.phys.pid, vc_ptl->ptc));
 
@@ -427,7 +427,7 @@ static inline int on_data_avail(MPID_Request * req)
             MPIR_ERR_POP(mpi_errno);
         }
 
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
     }
     else {
         int complete;
@@ -521,7 +521,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                                                 size, vc_ptl->id, vc_ptl->ptc, NPTL_MATCH(sender_req_id, GET_TAG, MPIDI_Process.my_pg_rank), target_offset, req);
                     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,
+                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,
                                                             "PtlGet(size=%lu id=(%#x,%#x) pt=%#x tag=%d)", size,
                                                             vc_ptl->id.phys.nid,
                                                             vc_ptl->id.phys.pid, vc_ptl->ptc, sender_req_id));
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 0e06e1a..85bea90 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
@@ -162,7 +162,7 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
             }
         }
         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",
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_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));
         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));
@@ -184,8 +184,8 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
         case PTL_EVENT_REPLY:
         case PTL_EVENT_SEARCH: {
             MPID_Request * const req = event.user_ptr;
-            MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "req = %p", req);
-            MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "REQ_PTL(req)->event_handler = %p", REQ_PTL(req)->event_handler);
+            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "req = %p", req);
+            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_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) MPIR_ERR_POP(mpi_errno);
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 9268ea5..22d1e59 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
@@ -316,7 +316,7 @@ int MPID_nem_ptl_pkt_cancel_send_req_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pk
     ptl_me_t me;
     MPID_nem_ptl_vc_area *const vc_ptl = VC_PTL(vc);
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
       "received cancel send req pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d",
                       req_pkt->sender_req_id, req_pkt->match.parts.rank,
                       req_pkt->match.parts.tag, req_pkt->match.parts.context_id));
@@ -407,10 +407,10 @@ int MPID_nem_ptl_pkt_cancel_send_resp_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *p
         if (REQ_PTL(sreq)->get_me_p)
             MPIU_Free(REQ_PTL(sreq)->get_me_p);
 
-        MPIU_DBG_MSG(CH3_OTHER,TYPICAL,"message cancelled");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"message cancelled");
     } else {
         MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
-        MPIU_DBG_MSG(CH3_OTHER,TYPICAL,"unable to cancel message");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"unable to cancel message");
     }
 
     mpi_errno = MPID_Request_complete(sreq);
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 0d74b5c..9945a06 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
@@ -108,7 +108,7 @@ static int handler_recv_dequeue_complete(const ptl_event_t *e)
 
     if (e->type == PTL_EVENT_PUT_OVERFLOW) {
         /* unpack the data from unexpected buffer */
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "is_contig = %d", is_contig);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "is_contig = %d", is_contig);
 
         if (is_contig) {
             MPIU_Memcpy((char *)rreq->dev.user_buf + dt_true_lb, e->start, e->mlength);
@@ -197,7 +197,7 @@ static void big_get(void *buf, ptl_size_t left_to_get, MPIDI_VC_t *vc, ptl_match
 
         ret = MPID_nem_ptl_rptl_get(MPIDI_nem_ptl_global_md, start, get_sz, vc_ptl->id, vc_ptl->ptg, match_bits, 0, rreq);
         DBG_MSG_GET("global", get_sz, vc->pg_rank, match_bits);
-        MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "   buf=%p", (char *)start);
+        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   buf=%p", (char *)start);
         MPIU_Assert(ret == 0);
 
         /* account for what has been sent */
@@ -461,7 +461,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
         me.match_id = vc_ptl->id;
     }
 
-    MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "tag=%#x ctx=%#x rank=%#x", rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id, rreq->dev.match.parts.rank));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "tag=%#x ctx=%#x rank=%#x", rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id, rreq->dev.match.parts.rank));
     me.match_bits = NPTL_MATCH(rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id,
                                rreq->dev.match.parts.rank);
     if (rreq->dev.match.parts.tag == MPI_ANY_TAG)
@@ -472,13 +472,13 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
     me.min_free = 0;
 
     MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
-    MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "count="MPI_AINT_FMT_DEC_SPEC" datatype=%#x contig=%d data_sz=%lu", rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "count="MPI_AINT_FMT_DEC_SPEC" datatype=%#x contig=%d data_sz=%lu", rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz));
 
     if (data_sz <= PTL_LARGE_THRESHOLD) {
         if (dt_contig) {
             /* small contig message */
             void *start = (char *)rreq->dev.user_buf + dt_true_lb;
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Small contig message");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small contig message");
             if (start == NULL)
                 me.start = &dummy;
             else
@@ -487,7 +487,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
             REQ_PTL(rreq)->event_handler = handler_recv_dequeue_complete;
         } else {
             /* small noncontig */
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Small noncontig message");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small noncontig message");
             rreq->dev.segment_ptr = 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);
@@ -500,7 +500,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
 
             if (last == rreq->dev.segment_size) {
                 /* entire message fits in IOV */
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "    entire message fits in IOV");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    entire message fits in IOV");
                 me.start = rreq->dev.iov;
                 me.length = rreq->dev.iov_count;
                 me.options |= PTL_IOVEC;
@@ -508,7 +508,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
             } else {
                 /* IOV is not long enough to describe entire message: recv into
                    buffer and unpack later */
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer");
                 MPIU_CHKPMEM_MALLOC(REQ_PTL(rreq)->chunk_buffer[0], void *, data_sz, mpi_errno, "chunk_buffer");
                 me.start = REQ_PTL(rreq)->chunk_buffer[0];
                 me.length = data_sz;
@@ -519,13 +519,13 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
         /* Large message: Create an ME for the first chunk of data, then do a GET for the rest */
         if (dt_contig) {
             /* large contig message */
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Large contig message");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large contig message");
             me.start = (char *)rreq->dev.user_buf + dt_true_lb;
             me.length = PTL_LARGE_THRESHOLD;
             REQ_PTL(rreq)->event_handler = handler_recv_dequeue_large;
         } else {
             /* large noncontig */
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Large noncontig message");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large noncontig message");
             rreq->dev.segment_ptr = 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);
@@ -538,7 +538,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
 
             if (last == PTL_LARGE_THRESHOLD) {
                 /* first chunk fits in IOV */
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "    first chunk fits in IOV");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    first chunk fits in IOV");
                 rreq->dev.segment_first = last;
                 me.start = rreq->dev.iov;
                 me.length = rreq->dev.iov_count;
@@ -547,7 +547,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
             } else {
                 /* IOV is not long enough to describe the first chunk: recv into
                    buffer and unpack later */
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer for first chunk");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer for first chunk");
                 MPIU_CHKPMEM_MALLOC(REQ_PTL(rreq)->chunk_buffer[0], void *, PTL_LARGE_THRESHOLD, mpi_errno, "chunk_buffer");
                 me.start = REQ_PTL(rreq)->chunk_buffer[0];
                 me.length = PTL_LARGE_THRESHOLD;
@@ -560,8 +560,8 @@ 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);
     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);
+    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    buf=%p", me.start);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "MPIDI_nem_ptl_pt = %d", MPIDI_nem_ptl_pt);
 
  fn_exit:
     MPIU_CHKPMEM_COMMIT();
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 386b02d..b44fd68 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
@@ -132,15 +132,15 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
     }
 
     MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
-    MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "count="MPI_AINT_FMT_DEC_SPEC" datatype=%#x contig=%d data_sz=%lu", count, datatype, dt_contig, data_sz));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "count="MPI_AINT_FMT_DEC_SPEC" datatype=%#x contig=%d data_sz=%lu", count, datatype, dt_contig, data_sz));
 
     if (data_sz <= PTL_LARGE_THRESHOLD) {
         /* Small message.  Send all data eagerly */
         if (dt_contig) {
             void *start = (char *)buf + dt_true_lb;
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Small contig message");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small contig message");
             REQ_PTL(sreq)->event_handler = handler_send;
-            MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "&REQ_PTL(sreq)->event_handler = %p", &(REQ_PTL(sreq)->event_handler));
+            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "&REQ_PTL(sreq)->event_handler = %p", &(REQ_PTL(sreq)->event_handler));
             if (start == NULL)
                 ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)&dummy, data_sz, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt,
                                             NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
@@ -151,16 +151,16 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
                                             NPTL_HEADER(ssend_flag, data_sz));
             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);
-            MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "sreq = %p", sreq);
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "vc_ptl->pt = %d", vc_ptl->pt);
-            MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "REQ_PTL(sreq)->event_handler = %p", REQ_PTL(sreq)->event_handler);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "id.nid = %#x", vc_ptl->id.phys.nid);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "id.pid = %#x", vc_ptl->id.phys.pid);
+            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "sreq = %p", sreq);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc_ptl->pt = %d", vc_ptl->pt);
+            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "REQ_PTL(sreq)->event_handler = %p", REQ_PTL(sreq)->event_handler);
            goto fn_exit;
         }
         
         /* noncontig data */
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Small noncontig message");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Small noncontig message");
         sreq->dev.segment_ptr = 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);
@@ -173,7 +173,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
 
         if (last == sreq->dev.segment_size) {
             /* IOV is able to describe entire message */
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "    entire message fits in IOV");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    entire message fits in IOV");
             md.start = sreq->dev.iov;
             md.length = sreq->dev.iov_count;
             md.options = PTL_IOVEC;
@@ -192,7 +192,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
         }
         
         /* IOV is not long enough to describe entire message */
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    IOV too long: using bounce buffer");
         MPIU_CHKPMEM_MALLOC(REQ_PTL(sreq)->chunk_buffer[0], void *, data_sz, mpi_errno, "chunk_buffer");
         MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
         sreq->dev.segment_first = 0;
@@ -211,7 +211,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
     /* Large message.  Send first chunk of data and let receiver get the rest */
     if (dt_contig) {
         /* create ME for buffer so receiver can issue a GET for the data */
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Large contig message");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large contig message");
         big_meappend((char *)buf + dt_true_lb + PTL_LARGE_THRESHOLD, data_sz - PTL_LARGE_THRESHOLD, vc,
                      NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), sreq);
 
@@ -225,7 +225,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");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Large noncontig message");
     sreq->dev.segment_ptr = 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);
@@ -241,7 +241,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
 
     if (last == PTL_LARGE_THRESHOLD) {
         /* first chunk of message fits into IOV */
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "    first chunk fits in IOV");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    first chunk fits in IOV");
         if (initial_iov_count < MPL_IOV_LIMIT) {
             /* There may be space for the rest of the message in this IOV */
             sreq->dev.iov_count = MPL_IOV_LIMIT - sreq->dev.iov_count;
@@ -255,7 +255,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
                 /* Entire message fit in one IOV */
                 int was_incomplete;
 
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "    rest of message fits in one IOV");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    rest of message fits in one IOV");
                 /* Create ME for remaining data */
                 me.start = &sreq->dev.iov[initial_iov_count];
                 me.length = remaining_iov_count;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
index 4af735f..b4c8846 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
@@ -189,7 +189,7 @@ static int alloc_sc_plfd_tbls (void)
     return mpi_errno;
  fn_fail:
     MPIU_CHKPMEM_REAP();
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -225,8 +225,8 @@ static int expand_sc_plfd_tbls (void)
     int new_capacity = g_tbl_capacity + CONN_PLFD_TBL_GROW_SIZE, i;
     MPIU_CHKPMEM_DECL (2);
 
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls Entry"));
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls b4 g_sc_tbl[0].fd=%d", g_sc_tbl[0].fd));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls Entry"));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls b4 g_sc_tbl[0].fd=%d", g_sc_tbl[0].fd));
     MPIU_CHKPMEM_MALLOC (new_sc_tbl, sockconn_t *, new_capacity * sizeof(sockconn_t), 
                          mpi_errno, "expanded connection table");
     MPIU_CHKPMEM_MALLOC (new_plfd_tbl, struct pollfd *, new_capacity * sizeof(struct pollfd), 
@@ -263,7 +263,7 @@ static int expand_sc_plfd_tbls (void)
     }
     g_tbl_capacity = new_capacity;
 
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls af g_sc_tbl[0].fd=%d", g_sc_tbl[0].fd));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls af g_sc_tbl[0].fd=%d", g_sc_tbl[0].fd));
     for (i = 0; i < g_tbl_capacity; ++i)
     {
         sockconn_t *sc = &g_sc_tbl[i];
@@ -281,11 +281,11 @@ static int expand_sc_plfd_tbls (void)
     
     MPIU_CHKPMEM_COMMIT();
  fn_exit:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls Exit"));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "expand_sc_plfd_tbls Exit"));
     return mpi_errno;
  fn_fail:
     MPIU_CHKPMEM_REAP();
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -334,7 +334,7 @@ static int find_free_entry(int *idx)
     INIT_POLLFD_ENTRY(&MPID_nem_tcp_plfd_tbl[*idx]);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -405,19 +405,19 @@ static int found_better_sc(sockconn_t *sc, sockconn_t **fnd_sc)
 fn_exit:
     if (found) {
         if (fnd_sc) {
-            MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE,
+            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
                              (MPIU_DBG_FDEST, "found_better_sc(sc=%p (%s), *fnd_sc=%p (%s)) found=TRUE",
                               sc, CONN_STATE_STR[sc->state.cstate],
                               *fnd_sc, (*fnd_sc ? CONN_STATE_STR[(*fnd_sc)->state.cstate] : "N/A")));
         }
         else {
-            MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE,
+            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
                              (MPIU_DBG_FDEST, "found_better_sc(sc=%p (%s), fnd_sc=(nil)) found=TRUE",
                               sc, CONN_STATE_STR[sc->state.cstate]));
         }
     }
     else {
-        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE,
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
                          (MPIU_DBG_FDEST, "found_better_sc(sc=%p (%s), *fnd_sc=N/A) found=FALSE",
                           sc, CONN_STATE_STR[sc->state.cstate]));
     }
@@ -445,7 +445,7 @@ static int vc_is_in_shutdown(MPIDI_VC_t *vc)
         retval = TRUE;
     }
 
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "vc_is_in_shutdown(%p)=%s", vc, (retval ? "TRUE" : "FALSE")));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "vc_is_in_shutdown(%p)=%s", vc, (retval ? "TRUE" : "FALSE")));
     return retval;
 }
 
@@ -466,7 +466,7 @@ static int send_id_info(const sockconn_t *const sc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_SEND_ID_INFO);
 
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "my_pg->id=%s my_pg->rank=%d, sc->pg_rank=%d sc->is_same_pg=%s",
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "my_pg->id=%s my_pg->rank=%d, sc->pg_rank=%d sc->is_same_pg=%s",
                                              (char *)MPIDI_Process.my_pg->id, MPIDI_Process.my_pg_rank, sc->pg_rank,
                                              (sc->is_same_pg ? "TRUE" : "FALSE")));
     if (!sc->is_same_pg)
@@ -505,7 +505,7 @@ static int send_id_info(const sockconn_t *const sc)
     MPIDI_FUNC_EXIT(MPID_STATE_SEND_ID_INFO);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d, offset=%lld, errno=%d %s", mpi_errno, (long long)offset, errno, MPIU_Strerror(errno)));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d, offset=%lld, errno=%d %s", mpi_errno, (long long)offset, errno, MPIU_Strerror(errno)));
     goto fn_exit;    
 }
 
@@ -526,7 +526,7 @@ static int send_tmpvc_info(const sockconn_t *const sc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_SEND_TMPVC_INFO);
 
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "my->pg_rank=%d, sc->pg_rank=%d"
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "my->pg_rank=%d, sc->pg_rank=%d"
                                              , MPIDI_Process.my_pg_rank, sc->pg_rank));
 
 /*     store ending NULL also */
@@ -555,7 +555,7 @@ static int send_tmpvc_info(const sockconn_t *const sc)
     MPIDI_FUNC_EXIT(MPID_STATE_SEND_TMPVC_INFO);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d, offset=%lld, errno=%d %s", mpi_errno, (long long)offset, errno, MPIU_Strerror(errno)));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d, offset=%lld, errno=%d %s", mpi_errno, (long long)offset, errno, MPIU_Strerror(errno)));
     goto fn_exit;    
 }
 
@@ -628,7 +628,7 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
             MPID_nem_tcp_vc_area *sc_vc_tcp = VC_TCP(sc_vc);
 
             MPIU_Assert(sc_vc != NULL);
-            MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc_vc, sc_vc_tcp->sc_ref_count));
+            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc_vc, sc_vc_tcp->sc_ref_count));
             ++sc_vc_tcp->sc_ref_count;
         }
         
@@ -636,13 +636,13 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
         sc->pg_is_set = TRUE;
         MPIU_Assert(!sc->is_tmpvc);
         
-	MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PKT_ID_INFO: sc->pg_rank=%d sc->is_same_pg=%d sc->fd=%d, sc->vc=%p, sc=%p", sc->pg_rank, sc->is_same_pg, sc->fd, sc->vc, sc));
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PKT_ID_INFO: sc->pg_rank=%d sc->is_same_pg=%d sc->fd=%d, sc->vc=%p, sc=%p", sc->pg_rank, sc->is_same_pg, sc->fd, sc->vc, sc));
     }
     else if (hdr.pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_TMPVC_INFO) {
         MPIDI_VC_t *vc;
         MPID_nem_tcp_vc_area *vc_tcp;
 
-        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "PKT_TMPVC_INFO: sc->fd=%d", sc->fd));
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "PKT_TMPVC_INFO: sc->fd=%d", sc->fd));
         /* create a new VC */
         MPIU_CHKPMEM_MALLOC (vc, MPIDI_VC_t *, sizeof(MPIDI_VC_t), mpi_errno, "real vc from tmp vc");
         /* --BEGIN ERROR HANDLING-- */
@@ -657,7 +657,7 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
         MPIDI_VC_Init(vc, NULL, 0);
         vc_tcp->state = MPID_NEM_TCP_VC_STATE_CONNECTED; /* FIXME: is it needed ? */
         sc->vc = vc;
-        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc->vc, vc_tcp->sc_ref_count));
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc->vc, vc_tcp->sc_ref_count));
         ++vc_tcp->sc_ref_count;
 
         ASSIGN_SC_TO_VC(vc_tcp, sc);
@@ -673,7 +673,7 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
         sc->pg_id = NULL;
         sc->is_tmpvc = TRUE;
 
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "enqueuing on acceptq vc=%p, sc->fd=%d, tag=%d", vc, sc->fd, sc->vc->port_name_tag));
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "enqueuing on acceptq vc=%p, sc->fd=%d, tag=%d", vc, sc->fd, sc->vc->port_name_tag));
         MPIDI_CH3I_Acceptq_enqueue(vc, sc->vc->port_name_tag);
 
         MPIU_Assert(!sc->pg_is_set);
@@ -686,7 +686,7 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
     return mpi_errno;
  fn_fail:
     MPIU_CHKPMEM_REAP();
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -720,7 +720,7 @@ static int send_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t pkt_type)
  fn_exit:
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -758,7 +758,7 @@ static int recv_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t *pkt_type)
     MPIDI_FUNC_EXIT(MPID_STATE_RECV_CMD_PKT);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -802,7 +802,7 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
         int rc = 0;
 
         if (vc_tcp->connect_retry_count > MPIDI_NEM_TCP_MAX_CONNECT_RETRIES) {
-            MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "exceeded retries, closing sc");
+            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "exceeded retries, closing sc");
             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);
             MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
@@ -857,11 +857,11 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
         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));
+	MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_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) 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));
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_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 */
         MPIR_ERR_CHKANDJUMP2(rc < 0 && errno != EINPROGRESS, mpi_errno, MPI_ERR_OTHER, "**sock_connect", "**sock_connect %d %s", errno, MPIU_Strerror(errno));
@@ -895,7 +895,7 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
 
         ASSIGN_SC_TO_VC(vc_tcp, sc);
         sc->vc = vc;
-        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc->vc, vc_tcp->sc_ref_count));
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc->vc, vc_tcp->sc_ref_count));
         ++vc_tcp->sc_ref_count;
     }
     else if (vc_tcp->state == MPID_NEM_TCP_VC_STATE_CONNECTED) {
@@ -919,7 +919,7 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
  fn_fail:
     if (idx != -1)
         close_cleanup_and_free_sc_plfd(&g_sc_tbl[idx]); /* ignore error return */
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -944,7 +944,7 @@ static int cleanup_and_free_sc_plfd(sockconn_t *const sc)
         goto fn_exit;
 
     if (sc_vc) {
-        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "about to decr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc_vc, sc_vc_tcp->sc_ref_count));
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "about to decr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc_vc, sc_vc_tcp->sc_ref_count));
         MPIU_Assert(sc_vc_tcp->sc_ref_count > 0);
         --sc_vc_tcp->sc_ref_count;
     }
@@ -970,7 +970,7 @@ static int cleanup_and_free_sc_plfd(sockconn_t *const sc)
     return mpi_errno;
  fn_fail:
     MPIU_CHKPMEM_REAP();
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -991,7 +991,7 @@ int close_cleanup_and_free_sc_plfd(sockconn_t *const sc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_CLOSE_CLEANUP_AND_FREE_SC_PLFD);
 
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "vc=%p, sc=%p, closing fd=%d", sc->vc, sc, sc->fd));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "vc=%p, sc=%p, closing fd=%d", sc->vc, sc, sc->fd));
 
     if (sc == NULL)
         goto fn_exit;
@@ -1055,7 +1055,7 @@ int MPID_nem_tcp_cleanup (struct MPIDI_VC *const vc)
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_CLEANUP);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -1119,7 +1119,7 @@ static int state_tc_c_cnting_handler(struct pollfd *const plfd, sockconn_t *cons
         CHANGE_STATE(sc, CONN_STATE_TC_C_CNTD);
     }
     else if (status == MPID_NEM_TCP_SOCK_ERROR_EOF) {
-        MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "state_tc_c_cnting_handler(): closing sc");
+        MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "state_tc_c_cnting_handler(): closing sc");
         mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
     }
     else { /* status == MPID_NEM_TCP_SOCK_NOEVENT */
@@ -1151,17 +1151,17 @@ static int state_tc_c_cntd_handler(struct pollfd *const plfd, sockconn_t *const
     MPIDI_FUNC_ENTER(MPID_STATE_STATE_TC_C_CNTD_HANDLER);
 
     if (found_better_sc(sc, NULL)) {
-        MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "state_tc_c_cntd_handler(): closing sc");
+        MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "state_tc_c_cntd_handler(): closing sc");
         mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         goto fn_exit;
     }
     
     if (IS_WRITEABLE(plfd)) {
-        MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "inside if (IS_WRITEABLE(plfd))");
+        MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "inside if (IS_WRITEABLE(plfd))");
         if (!sc->is_tmpvc) { /* normal connection */
             mpi_errno = send_id_info(sc);
             if (mpi_errno) {
-                MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "state_tc_c_cntd_handler(): closing sc");
+                MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "state_tc_c_cntd_handler(): closing sc");
                 mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
                 mpi_errno = MPI_SUCCESS; /* don't return an error if we fail in the connect protocol, just retry. */
                 goto fn_exit;
@@ -1183,7 +1183,7 @@ static int state_tc_c_cntd_handler(struct pollfd *const plfd, sockconn_t *const
     MPIDI_FUNC_EXIT(MPID_STATE_STATE_TC_C_CNTD_HANDLER);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
     goto fn_exit;
 }
@@ -1217,14 +1217,14 @@ static int state_c_ranksent_handler(struct pollfd *const plfd, sockconn_t *const
 
             MPID_nem_tcp_conn_est (sc_vc);
             sc_vc_tcp->connect_retry_count = 0; /* successfully connected, reset connection retry count */
-            MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "c_ranksent_handler(): connection established (sc=%p, sc->vc=%p, fd=%d)", sc, sc->vc, sc->fd));
+            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "c_ranksent_handler(): connection established (sc=%p, sc->vc=%p, fd=%d)", sc, sc->vc, sc->fd));
             break;
         case MPIDI_NEM_TCP_SOCKSM_PKT_ID_NAK:
-            MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "received NAK, closing sc");
+            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "received NAK, closing sc");
             mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
             break;
         case MPIDI_NEM_TCP_SOCKSM_PKT_CLOSED:
-            MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "received CLOSED, closing sc");
+            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "received CLOSED, closing sc");
             mpi_errno = MPIDI_CH3U_Handle_connection(sc_vc, MPIDI_VC_EVENT_TERMINATED);
             if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
@@ -1238,7 +1238,7 @@ fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_STATE_C_RANKSENT_HANDLER);
     return mpi_errno;
 fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
     mpi_errno = MPI_SUCCESS; /* don't return an error if we fail in the connect protocol, just retry. */
     goto fn_exit;
@@ -1262,7 +1262,7 @@ static int state_c_tmpvcsent_handler(struct pollfd *const plfd, sockconn_t *cons
         mpi_errno = recv_cmd_pkt(sc->fd, &pkt_type);
         if (mpi_errno) {
             int mpi_errno2 = MPI_SUCCESS;
-            MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "error sending cmd pkt, closing sc");
+            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "error sending cmd pkt, closing sc");
             mpi_errno2 = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
             if (mpi_errno2) {
                 MPIR_ERR_SET(mpi_errno2, MPI_ERR_OTHER, "**tcp_cleanup_fail");
@@ -1281,11 +1281,11 @@ static int state_c_tmpvcsent_handler(struct pollfd *const plfd, sockconn_t *cons
                 ASSIGN_SC_TO_VC(sc_vc_tcp, sc);
                 MPID_nem_tcp_conn_est (sc_vc);
                 sc_vc_tcp->connect_retry_count = 0; /* successfully connected, reset connection retry count */
-                MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "c_tmpvcsent_handler(): connection established (fd=%d, sc=%p, sc->vc=%p)", sc->fd, sc, sc_vc));
+                MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "c_tmpvcsent_handler(): connection established (fd=%d, sc=%p, sc->vc=%p)", sc->fd, sc, sc_vc));
             }
             else { /* pkt_type must be MPIDI_NEM_TCP_SOCKSM_PKT_ID_NAK */
-                MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "state_c_tmpvcsent_handler() 2: closing sc"));
-                MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "received NAK, closing sc");
+                MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "state_c_tmpvcsent_handler() 2: closing sc"));
+                MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "received NAK, closing sc");
                 mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
             }
         }
@@ -1310,7 +1310,7 @@ static int state_l_cntd_handler(struct pollfd *const plfd, sockconn_t *const sc)
 
     status = MPID_nem_tcp_check_sock_status(plfd);
     if (status == MPID_NEM_TCP_SOCK_ERROR_EOF) {
-        MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "Received EOF, closing sc");
+        MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "Received EOF, closing sc");
         mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         goto fn_exit;
     }
@@ -1323,7 +1323,7 @@ static int state_l_cntd_handler(struct pollfd *const plfd, sockconn_t *const sc)
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (got_sc_eof) {
-            MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "got eof, closing sc");
+            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "got eof, closing sc");
             mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
             goto fn_exit;
         }
@@ -1337,14 +1337,14 @@ static int state_l_cntd_handler(struct pollfd *const plfd, sockconn_t *const sc)
     }
     else {
         /* remain in same state */
-        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "!IS_READABLE(plfd) fd=%d events=%#x revents=%#x", plfd->fd, plfd->events, plfd->revents));
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "!IS_READABLE(plfd) fd=%d events=%#x revents=%#x", plfd->fd, plfd->events, plfd->revents));
     }
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_STATE_L_CNTD_HANDLER);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
     mpi_errno = MPI_SUCCESS; /* don't return an error if we fail in the connect protocol, just retry. */
     goto fn_exit;
@@ -1376,7 +1376,7 @@ static int do_i_win(sockconn_t *rmt_sc)
             win = TRUE;
     }
 
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE,
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE,
                      (MPIU_DBG_FDEST, "do_i_win(rmt_sc=%p (%s)) win=%s is_same_pg=%s my_pg_rank=%d rmt_pg_rank=%d",
                       rmt_sc, CONN_STATE_STR[rmt_sc->state.cstate],
                       (win ? "TRUE" : "FALSE"),(rmt_sc->is_same_pg ? "TRUE" : "FALSE"), MPIDI_Process.my_pg_rank,
@@ -1423,7 +1423,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) MPIR_ERR_POP(mpi_errno);
-            MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "lost head-to-head, closing sc");
+            MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "lost head-to-head, closing sc");
             mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         } else {
             /* The following line is _crucial_ to correct operation.  We need to
@@ -1440,7 +1440,7 @@ static int state_l_rankrcvd_handler(struct pollfd *const plfd, sockconn_t *const
             
             CHANGE_STATE(sc, CONN_STATE_TS_COMMRDY);
             ASSIGN_SC_TO_VC(sc_vc_tcp, sc);
-            MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "connection established: sc=%p, sc->vc=%p, sc->fd=%d, is_same_pg=%s, pg_rank=%d", sc, sc_vc, sc->fd, (sc->is_same_pg ? "TRUE" : "FALSE"), sc->pg_rank));
+            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "connection established: sc=%p, sc->vc=%p, sc->fd=%d, is_same_pg=%s, pg_rank=%d", sc, sc_vc, sc->fd, (sc->is_same_pg ? "TRUE" : "FALSE"), sc->pg_rank));
             MPID_nem_tcp_conn_est (sc_vc);
             sc_vc_tcp->connect_retry_count = 0; /* successfully connected, reset connection retry count */
         }
@@ -1450,7 +1450,7 @@ fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_STATE_L_RANKRCVD_HANDLER);
     return mpi_errno;
 fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
     mpi_errno = MPI_SUCCESS; /* don't return an error if we fail in the connect protocol, just retry. */
     goto fn_exit;
@@ -1472,7 +1472,7 @@ static int state_l_tmpvcrcvd_handler(struct pollfd *const plfd, sockconn_t *cons
 
     status = MPID_nem_tcp_check_sock_status(plfd);
     if (status == MPID_NEM_TCP_SOCK_ERROR_EOF) {
-        MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "Received EOF, closing sc");
+        MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "Received EOF, closing sc");
         mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         goto fn_exit;
     }
@@ -1485,7 +1485,7 @@ static int state_l_tmpvcrcvd_handler(struct pollfd *const plfd, sockconn_t *cons
         ASSIGN_SC_TO_VC(sc_vc_tcp, sc);
         MPID_nem_tcp_conn_est(sc_vc);
         sc_vc_tcp->connect_retry_count = 0; /* successfully connected, reset connection retry count */
-        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "fd=%d: TMPVC_ACK sent, connection established!", sc->fd));
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "fd=%d: TMPVC_ACK sent, connection established!", sc->fd));
     }
 
 fn_exit:
@@ -1494,7 +1494,7 @@ fn_exit:
  fn_fail:
     {
         int cleanup_errno = MPI_SUCCESS;
-        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
         mpi_errno = close_cleanup_and_free_sc_plfd(sc); /* QUIESCENT */
         if (cleanup_errno) {
             MPIR_ERR_SET(cleanup_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
@@ -1547,7 +1547,7 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
                        disconnecting, then we end up with a potential race where
                        the other side performs a tcp close() before we do and we
                        blow up here. */
-                    MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "other side closed, but we're shutting down, closing sc");
+                    MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "other side closed, but we're shutting down, closing sc");
                     /* it's really not an error, but we're calling
                        cleanup_on_error because it does what we want it to */
                     mpi_errno = MPID_nem_tcp_cleanup_on_error(sc_vc, MPI_SUCCESS);
@@ -1555,7 +1555,7 @@ 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_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "ERROR: sock (fd=%d) is closed: bytes_recvd == 0", sc->fd );
                     MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
                 }
             }
@@ -1565,7 +1565,7 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
             }
         }
     
-        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));
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_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) MPIR_ERR_POP_LABEL(mpi_errno, fn_noncomm_fail);
@@ -1594,7 +1594,7 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
             }
         }
 
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "Cont recv %ld", (long int)bytes_recvd);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Cont recv %ld", (long int)bytes_recvd);
 
         /* update the iov */
         for (iov = &rreq->dev.iov[rreq->dev.iov_offset]; iov < &rreq->dev.iov[rreq->dev.iov_offset + rreq->dev.iov_count]; ++iov)
@@ -1605,9 +1605,9 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
                 iov->MPL_IOV_LEN -= bytes_recvd;
                 rreq->dev.iov_count = (int)(&rreq->dev.iov[rreq->dev.iov_offset + rreq->dev.iov_count] - iov);
                 rreq->dev.iov_offset = iov - rreq->dev.iov;
-                MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bytes_recvd = %ld", (long int)bytes_recvd);
-                MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov len = %ld", (long int)iov->MPL_IOV_LEN);
-                MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_offset = %lld", (long long)rreq->dev.iov_offset);
+                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "bytes_recvd = %ld", (long int)bytes_recvd);
+                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov len = %ld", (long int)iov->MPL_IOV_LEN);
+                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iov_offset = %lld", (long long)rreq->dev.iov_offset);
                 goto fn_exit;
             }
             bytes_recvd -= iov->MPL_IOV_LEN;
@@ -1623,7 +1623,7 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
             if (mpi_errno != MPI_SUCCESS) {
                 MPIR_ERR_POP(mpi_errno);
             }
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "...complete");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...complete");
             sc_vc_ch->recv_active = NULL;
         }
         else
@@ -1635,12 +1635,12 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
 
             if (complete)
             {
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "...complete");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...complete");
                 sc_vc_ch->recv_active = NULL;
             }
             else
             {
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "...not complete");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...not complete");
             }
         }
     }
@@ -1678,7 +1678,7 @@ static int state_commrdy_handler(struct pollfd *const plfd, sockconn_t *const sc
 
     MPIDI_FUNC_ENTER(MPID_STATE_STATE_COMMRDY_HANDLER);
 
-    MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "vc = %p", sc->vc);
+    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc = %p", sc->vc);
     if (IS_READABLE(plfd))
     {
         mpi_errno = MPID_nem_tcp_recv_handler(sc);
@@ -1808,7 +1808,7 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
 
     CHECK_EINTR(n, poll(MPID_nem_tcp_plfd_tbl, num_polled, 0));
     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")); */
+    /* MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "some sc fd poll event")); */
     for(i = 0; i < num_polled; i++)
     {
         struct pollfd *it_plfd = &MPID_nem_tcp_plfd_tbl[i];
@@ -1830,7 +1830,7 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
                 if (rc < 0)
                     err_str = MPIU_Strerror(errno);
                 
-                MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "error polling fd, closing sc");
+                MPIU_DBG_MSG(MPIDI_NEM_TCP_DBG_DET, VERBOSE, "error polling fd, closing sc");
                 if (it_sc->vc) {
                     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);
@@ -1854,7 +1854,7 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
  fn_exit:
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -1903,9 +1903,9 @@ int MPID_nem_tcp_state_listening_handler(struct pollfd *const unused_1, sockconn
     while (1) {
         l_sc = &g_sc_tbl[0];  /* N3 Important */
         len = sizeof(SA_IN);
-        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "before accept"));
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "before accept"));
         if ((connfd = accept(l_sc->fd, (SA *) &rmt_addr, &len)) < 0) {
-            MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "after accept, l_sc=%p lstnfd=%d connfd=%d, errno=%d:%s ", l_sc, l_sc->fd, connfd, errno, MPIU_Strerror(errno)));
+            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "after accept, l_sc=%p lstnfd=%d connfd=%d, errno=%d:%s ", l_sc, l_sc->fd, connfd, errno, MPIU_Strerror(errno)));
             if (errno == EINTR) 
                 continue;
             else if (errno == EWOULDBLOCK || errno == EAGAIN)
@@ -1931,7 +1931,7 @@ int MPID_nem_tcp_state_listening_handler(struct pollfd *const unused_1, sockconn
 
             CHANGE_STATE(sc, CONN_STATE_TA_C_CNTD);
 
-            MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "accept success, added to table, connfd=%d, sc->vc=%p, sc=%p plfd->events=%#x", connfd, sc->vc, sc, plfd->events)); /* sc->vc should be NULL at this point */
+            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "accept success, added to table, connfd=%d, sc->vc=%p, sc=%p plfd->events=%#x", connfd, sc->vc, sc, plfd->events)); /* sc->vc should be NULL at this point */
         }
     }
 
@@ -1939,7 +1939,7 @@ int MPID_nem_tcp_state_listening_handler(struct pollfd *const unused_1, sockconn
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_STATE_LISTENING_HANDLER);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h
index 270de1a..a517ac4 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h
@@ -103,12 +103,12 @@ extern const char *const CONN_STATE_STR[];
 #define DBG_CHANGE_STATE(_sc, _cstate) do { \
     const char *state_str = NULL; \
     const char *old_state_str = NULL; \
-    if (MPIU_DBG_SELECTED(NEM_SOCK_DET,VERBOSE)) { \
+    if (MPIU_DBG_SELECTED(MPIDI_NEM_TCP_DBG_DET,VERBOSE)) { \
         if ((_sc)) { \
             old_state_str = CONN_STATE_TO_STRING((_sc)->state.cstate); \
             state_str     = CONN_STATE_TO_STRING(_cstate); \
         } \
-        MPIU_DBG_OUT_FMT(NEM_SOCK_DET, (MPIU_DBG_FDEST, "CHANGE_STATE(_sc=%p, _cstate=%d (%s)) - old_state=%s sc->vc=%p", _sc, _cstate, state_str, old_state_str, (_sc)->vc)); \
+        MPIU_DBG_OUT_FMT(MPIDI_NEM_TCP_DBG_DET, (MPIU_DBG_FDEST, "CHANGE_STATE(_sc=%p, _cstate=%d (%s)) - old_state=%s sc->vc=%p", _sc, _cstate, state_str, old_state_str, (_sc)->vc)); \
     } \
 } while (0)
 #else
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_impl.h
index 8c8b6b9..4139b4b 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_impl.h
@@ -21,6 +21,8 @@ extern struct pollfd *MPID_nem_tcp_plfd_tbl;
 extern sockconn_t MPID_nem_tcp_g_lstn_sc;
 extern struct pollfd MPID_nem_tcp_g_lstn_plfd;
 
+extern MPIU_DBG_Class MPIDI_NEM_TCP_DBG_DET;
+
 typedef enum{MPID_NEM_TCP_VC_STATE_DISCONNECTED,
              MPID_NEM_TCP_VC_STATE_CONNECTED,
              MPID_NEM_TCP_VC_STATE_ERROR
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 d2b17b7..ecc87b4 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
@@ -111,7 +111,8 @@ MPID_nem_netmod_funcs_t MPIDI_nem_tcp_funcs = {
 
 /* in case there are no packet types defined (e.g., they're ifdef'ed out) make sure the array is not zero length */
 static MPIDI_CH3_PktHandler_Fcn *pkt_handlers[MPIDI_NEM_TCP_PKT_NUM_TYPES ? MPIDI_NEM_TCP_PKT_NUM_TYPES : 1];
-    
+
+MPIU_DBG_Class MPIDI_NEM_TCP_DBG_DET;
 
 #undef FUNCNAME
 #define FUNCNAME set_up_listener
@@ -164,6 +165,10 @@ int MPID_nem_tcp_init (MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_
     /* first make sure that our private fields in the vc fit into the area provided  */
     MPIU_Assert(sizeof(MPID_nem_tcp_vc_area) <= MPIDI_NEM_VC_NETMOD_AREA_LEN);
 
+#if defined (USE_DBG_LOGGING)
+    MPIDI_NEM_TCP_DBG_DET = MPIU_DBG_Class_alloc("MPIDI_NEM_TCP_DBG_DET", "nem_sock_det");
+#endif /* USE_DBG_LOGGING */
+
     /* set up listener socket */
     mpi_errno = set_up_listener();
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
@@ -310,7 +315,7 @@ static int GetSockInterfaceAddr(int myRank, char *ifname, int maxIfname,
         mpi_errno = MPIDI_Get_IP_for_iface(MPIR_CVAR_NEMESIS_TCP_NETWORK_IFACE, ifaddr, &ifaddrFound);
         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,
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT, VERBOSE, (MPIU_DBG_FDEST,
                                                 "ifaddrFound=TRUE ifaddr->type=%d ifaddr->len=%d ifaddr->ifaddr[0-3]=%d.%d.%d.%d",
                                                 ifaddr->type, ifaddr->len, ifaddr->ifaddr[0], ifaddr->ifaddr[1], ifaddr->ifaddr[2],
                                                 ifaddr->ifaddr[3]));
@@ -441,7 +446,7 @@ int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_s
         unsigned char *p;
         p = (unsigned char *)(ifaddr.ifaddr);
         MPL_snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u", p[0], p[1], p[2], p[3] );
-        MPIU_DBG_MSG_S(CH3_CONNECT,VERBOSE,"ifname = %s",ifname );
+        MPIU_DBG_MSG_S(MPIDI_CH3_DBG_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) {
             MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
@@ -603,7 +608,7 @@ int MPID_nem_tcp_get_addr_port_from_bc(const char *business_card, struct in_addr
     return mpi_errno;
  fn_fail:
 /*     fprintf(stdout, "failure. mpi_errno = %d\n", mpi_errno); */
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -653,7 +658,7 @@ int MPID_nem_tcp_bind (int sockfd)
     return mpi_errno;
  fn_fail:
 /*     fprintf(stdout, "failure. mpi_errno = %d\n", mpi_errno); */
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
@@ -724,7 +729,7 @@ int MPID_nem_tcp_vc_terminated(MPIDI_VC_t *vc)
     MPIDI_FUNC_EXIT(MPID_NEM_TCP_VC_TERMINATED);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
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 2a0e9cc..227bbf7 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
@@ -79,7 +79,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_SEND_QUEUED);
 
-    MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "vc = %p", vc);
+    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "vc = %p", vc);
     MPIU_Assert(vc != NULL);
 
     if (MPIDI_CH3I_Sendq_empty(*send_queue))
@@ -88,7 +88,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
     while (!MPIDI_CH3I_Sendq_empty(*send_queue))
     {
         sreq = MPIDI_CH3I_Sendq_head(*send_queue);
-        MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "Sending %p", sreq);
+        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Sending %p", sreq);
 
         iov = &sreq->dev.iov[sreq->dev.iov_offset];
         
@@ -107,7 +107,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
             if (errno == EAGAIN)
             {
                 offset = 0;
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "EAGAIN");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "EAGAIN");
                 break;
             } else {
                 int req_errno = MPI_SUCCESS;
@@ -118,7 +118,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
                 goto fn_exit; /* this vc is closed now, just bail out */
             }
         }
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
 
         complete = 1;
         for (iov = &sreq->dev.iov[sreq->dev.iov_offset]; iov < &sreq->dev.iov[sreq->dev.iov_offset + sreq->dev.iov_count]; ++iov)
@@ -153,7 +153,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
                 if (mpi_errno != MPI_SUCCESS) {
                     MPIR_ERR_POP(mpi_errno);
                 }
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                 MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
                 continue;
             }
@@ -164,7 +164,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
             
             if (complete)
             {
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                 MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
                 continue;
             }
@@ -245,7 +245,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
     
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
     
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tcp_iStartContigMsg");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_iStartContigMsg");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
 
     if (!MPID_nem_tcp_vc_send_paused(vc_tcp)) {
@@ -283,7 +283,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
                         goto fn_fail;
                     }
                 }
-                MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
+                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
                 
                 if (offset == sizeof(MPIDI_CH3_Pkt_t) + data_sz)
                 {
@@ -303,7 +303,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
     }
 
     /* create and enqueue request */
-    MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "enqueuing");
+    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
 
     /* create a request */
     sreq = MPID_Request_create();
@@ -385,7 +385,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
     
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
     
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tcp_iStartContigMsg");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_iStartContigMsg");
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
 
     if (MPID_nem_tcp_vc_is_connected(vc_tcp))
@@ -423,7 +423,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
                     goto fn_fail;
                 }
             }
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
                 
             if (offset == sizeof(MPIDI_CH3_Pkt_t) + data_sz)
             {
@@ -442,7 +442,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
     }
 
     /* create and enqueue request */
-    MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "enqueuing");
+    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
 
     /* create a request */
     sreq = MPID_Request_create();
@@ -518,7 +518,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
     
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
     
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tcp_iSendContig");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_iSendContig");
 
     MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
 
@@ -567,7 +567,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
                         goto fn_fail;
                     }
                 }
-                MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
+                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write " MPIDI_MSG_SZ_FMT, offset);
                 
                 if (offset == sizeof(MPIDI_CH3_Pkt_t) + sreq->dev.ext_hdr_sz + data_sz)
                 {
@@ -582,7 +582,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
                         if (mpi_errno != MPI_SUCCESS) {
                             MPIR_ERR_POP(mpi_errno);
                         }
-                        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+                        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                         goto fn_exit;
                     }
                     else
@@ -594,7 +594,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
                         
                         if (complete)
                         {
-                            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+                            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                             goto fn_exit;
                         }
                         
@@ -658,7 +658,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
 
 enqueue_request:
     /* enqueue request */
-    MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "enqueuing");
+    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
     MPIU_Assert(sreq->dev.iov_count >= 1 && sreq->dev.iov[0].MPL_IOV_LEN > 0);
 
     sreq->ch.vc = vc;
@@ -708,7 +708,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_SENDNONCONTIG);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_SENDNONCONTIG);
-    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tcp_SendNoncontig");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "tcp_SendNoncontig");
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
 
     iov_n = 0;
@@ -760,7 +760,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
                     }
                 }
                 
-                MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "write noncontig " MPIDI_MSG_SZ_FMT, offset);
+                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "write noncontig " MPIDI_MSG_SZ_FMT, offset);
             }
         }
         else
@@ -809,7 +809,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
             if (mpi_errno != MPI_SUCCESS) {
                 MPIR_ERR_POP(mpi_errno);
             }
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
             goto fn_exit;
         }
 
@@ -819,13 +819,13 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
             
         if (complete)
         {
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
             goto fn_exit;
         }
     }
         
     /* enqueue request */
-    MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "enqueuing");
+    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "enqueuing");
     MPIU_Assert(sreq->dev.iov_count >= 1 && sreq->dev.iov[0].MPL_IOV_LEN > 0);
         
     sreq->ch.vc = vc;
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 947d998..584cc61 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c
@@ -41,7 +41,7 @@ int MPID_nem_tcp_get_vc_from_conninfo (char *pg_id, int pg_rank, struct MPIDI_VC
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_GET_VC_FROM_CONNINFO);
 
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "pg_id=%s pg_rank=%d", pg_id, pg_rank));
+    MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_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) MPIR_ERR_POP (mpi_errno);
@@ -148,7 +148,7 @@ MPID_nem_tcp_check_sock_status(const struct pollfd *const plfd)
     if (plfd->revents & POLLERR) 
     {
         rc = MPID_NEM_TCP_SOCK_ERROR_EOF;
-        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "POLLERR on socket"));
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "POLLERR on socket"));
         goto fn_exit;
     }
     if (plfd->revents & POLLIN || plfd->revents & POLLOUT) 
@@ -160,7 +160,7 @@ MPID_nem_tcp_check_sock_status(const struct pollfd *const plfd)
         if (getsockopt(plfd->fd, SOL_SOCKET, SO_ERROR, &error, &n) < 0 || error != 0) 
         {
             rc = MPID_NEM_TCP_SOCK_ERROR_EOF; /*  (N1) */
-            MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "getsockopt failure. error=%d:%s", error, MPIU_Strerror(error)));
+            MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "getsockopt failure. error=%d:%s", error, MPIU_Strerror(error)));
             goto fn_exit;
         }
         rc = MPID_NEM_TCP_SOCK_CONNECTED;
@@ -186,7 +186,7 @@ int MPID_nem_tcp_is_sock_connected(int fd)
     n = sizeof(error);
     if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &n) < 0 || error != 0) 
     {
-        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "getsockopt failure. error=%d:%s", error, MPIU_Strerror(error)));
+        MPIU_DBG_MSG_FMT(MPIDI_NEM_TCP_DBG_DET, VERBOSE, (MPIU_DBG_FDEST, "getsockopt failure. error=%d:%s", error, MPIU_Strerror(error)));
         rc = FALSE; /*  error */
         goto fn_exit;
     }
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_init.c b/src/mpid/ch3/channels/nemesis/src/ch3_init.c
index 4d432b1..cdafb39 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_init.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_init.c
@@ -208,7 +208,7 @@ int MPIDI_CH3_VC_Destroy(MPIDI_VC_t *vc )
     /* no need to destroy vc to self, this corresponds to the optimization above
      * in MPIDI_CH3_VC_Init */
     if (vc->pg == MPIDI_CH3I_my_pg && vc->pg_rank == MPIDI_CH3I_my_rank) {
-        MPIU_DBG_MSG_P(VC, VERBOSE, "skipping self vc=%p", vc);
+        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_VC, VERBOSE, "skipping self vc=%p", vc);
         goto fn_exit;
     }
 
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_isend.c b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
index c9dbd1a..d08bdc7 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
@@ -52,7 +52,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
     if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
     {
         MPIU_Assert(hdr_sz <= INT_MAX);
-	MPIU_DBG_MSG_D (CH3_CHANNEL, VERBOSE, "iSend %d", (int) hdr_sz);
+	MPIU_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iSend %d", (int) hdr_sz);
 	mpi_errno = MPID_nem_mpich_send_header (hdr, (int)hdr_sz, vc, &again);
         if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	if (again)
@@ -97,7 +97,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
     goto fn_exit;
 
  enqueue_it:
-    MPIU_DBG_MSG(CH3_OTHER, TERSE, "enqueuing");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
 
     sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *) hdr;
     sreq->dev.iov[0].MPL_IOV_BUF = (char *) &sreq->dev.pending_pkt;
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
index 746d0e2..f146a65 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
@@ -71,7 +71,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
 	MPL_IOV *remaining_iov = iov;
 	int remaining_n_iov = n_iov;
 
-        MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "iSendv");
+        MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iSendv");
 	mpi_errno = MPID_nem_mpich_sendv_header (&remaining_iov, &remaining_n_iov,
 	                                         sreq->dev.ext_hdr_ptr, sreq->dev.ext_hdr_sz,
 	                                         vc, &again);
@@ -96,13 +96,13 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
 	    {
 		sreq->dev.iov[0] = remaining_iov[0];
 	    }
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "  out of cells. remaining iov:");
-            MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "    %ld", (long int)sreq->dev.iov[0].MPL_IOV_LEN);
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "  out of cells. remaining iov:");
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    %ld", (long int)sreq->dev.iov[0].MPL_IOV_LEN);
 
 	    for (j = 1; j < remaining_n_iov; ++j)
 	    {
 		sreq->dev.iov[j] = remaining_iov[j];
-                MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "    %ld", (long int)remaining_iov[j].MPL_IOV_LEN);
+                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    %ld", (long int)remaining_iov[j].MPL_IOV_LEN);
 	    }
 	    sreq->dev.iov_offset = 0;
 	    sreq->dev.iov_count = remaining_n_iov;
@@ -116,7 +116,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
                 MPIDI_CH3I_shm_active_send = sreq;
             }
 
-            MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "  enqueued");
+            MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "  enqueued");
 	}
 	else
 	{
@@ -130,7 +130,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
                 if (mpi_errno != MPI_SUCCESS) {
                     MPIR_ERR_POP(mpi_errno);
                 }
-                MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, ".... complete");
+                MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
             }
             else
             {
@@ -147,11 +147,11 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
                     MPIDI_CH3I_Sendq_enqueue(&MPIDI_CH3I_shm_sendq, sreq);
                     MPIU_Assert (MPIDI_CH3I_shm_active_send == NULL);
                     MPIDI_CH3I_shm_active_send = sreq;
-                    MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, ".... reloaded and enqueued");
+                    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... reloaded and enqueued");
                 }
                 else
                 {
-                    MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, ".... complete");
+                    MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
                 }
             }
         }
@@ -160,7 +160,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPL_IOV *iov, int n_io
     {
 	int i;
 	
-	MPIU_DBG_MSG(CH3_OTHER, TERSE, "enqueuing");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
 	
 	sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *) iov[0].MPL_IOV_BUF;
 	sreq->dev.iov[0].MPL_IOV_BUF = (char *) &sreq->dev.pending_pkt;
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
index f951f67..4056364 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
@@ -56,7 +56,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
        /* MT */
     {
         MPIU_Assert(hdr_sz <= INT_MAX);
-	MPIU_DBG_MSG_D (CH3_CHANNEL, VERBOSE, "iStartMsg %d", (int) hdr_sz);
+	MPIU_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iStartMsg %d", (int) hdr_sz);
 	mpi_errno = MPID_nem_mpich_send_header (hdr, (int)hdr_sz, vc, &again);
         if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	if (again)
@@ -86,7 +86,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
     {
 	MPID_Request * sreq = NULL;
 	
-	MPIU_DBG_MSG(CH3_OTHER, TERSE, "enqueuing");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
 
 	/* create a request */
 	sreq = MPID_Request_create();
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
index 14a3a3d..fa6517b 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
@@ -80,37 +80,37 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
 	MPL_IOV *remaining_iov = iov;
 	int remaining_n_iov = n_iov;
 
-        MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "iStartMsgv");
-        MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, {
+        MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "iStartMsgv");
+        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
                 int total = 0;
                 int i;
                 for (i = 0; i < n_iov; ++i)
                     total += iov[i].MPL_IOV_LEN;
 
-                MPIU_DBG_MSG_D (CH3_CHANNEL, VERBOSE, "   + len=%d ", total);
+                MPIU_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   + len=%d ", total);
             });
 	mpi_errno = MPID_nem_mpich_sendv_header (&remaining_iov, &remaining_n_iov,
 	                                         NULL, 0, vc, &again);
         if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	while (!again && (remaining_n_iov > 0))
 	{
-            MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, {
+            MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
                     int total = 0;
                     int i;
                     for (i = 0; i < remaining_n_iov; ++i)
                         total += remaining_iov[i].MPL_IOV_LEN;
-                    MPIU_DBG_MSG_D (CH3_CHANNEL, VERBOSE, "   + len=%d ", total);
+                    MPIU_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   + len=%d ", total);
                 });
 
 	    mpi_errno = MPID_nem_mpich_sendv (&remaining_iov, &remaining_n_iov, vc, &again);
             if (mpi_errno) MPIR_ERR_POP (mpi_errno);
 	}
-        MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, {
+        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {
                 int total = 0;
                 int i;
                 for (i = 0; i < remaining_n_iov; ++i)
                     total += remaining_iov[i].MPL_IOV_LEN;
-                MPIU_DBG_MSG_D (CH3_CHANNEL, VERBOSE, "   - len=%d ", total);
+                MPIU_DBG_MSG_D (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "   - len=%d ", total);
             });
 
 	if (again)
@@ -146,7 +146,7 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPL_IOV *iov, int n_iov, MPID_Request
     {
 	int i;
 	
-	MPIU_DBG_MSG(CH3_OTHER, TERSE, "request enqueued");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "request enqueued");
 	/* create a request */
 	sreq = MPID_Request_create();
 	MPIU_Assert(sreq != NULL);
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
index 245fe61..85c5c4a 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
@@ -153,7 +153,7 @@ int MPIDI_CH3I_Shm_send_progress(void)
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SHM_SEND_PROGRESS);
 
     sreq = MPIDI_CH3I_shm_active_send;
-    MPIU_DBG_STMT(CH3_CHANNEL, VERBOSE, {if (sreq) MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "Send: cont sreq");});
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, {if (sreq) MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Send: cont sreq");});
     if (sreq)
     {
         if (!sreq->ch.noncontig)
@@ -195,7 +195,7 @@ int MPIDI_CH3I_Shm_send_progress(void)
     else
     {
         sreq = MPIDI_CH3I_Sendq_head(MPIDI_CH3I_shm_sendq);
-        MPIU_DBG_STMT (CH3_CHANNEL, VERBOSE, {if (sreq) MPIU_DBG_MSG (CH3_CHANNEL, VERBOSE, "Send: new sreq ");});
+        MPIU_DBG_STMT (MPIDI_CH3_DBG_CHANNEL, VERBOSE, {if (sreq) MPIU_DBG_MSG (MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Send: new sreq ");});
 
         if (!sreq->ch.noncontig)
         {
@@ -265,7 +265,7 @@ int MPIDI_CH3I_Shm_send_progress(void)
         /* MT - clear the current active send before dequeuing/destroying the current request */
         MPIDI_CH3I_shm_active_send = NULL;
         MPIDI_CH3I_Sendq_dequeue(&MPIDI_CH3I_shm_sendq, &sreq);
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
         mpi_errno = check_terminating_vcs();
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
@@ -279,7 +279,7 @@ int MPIDI_CH3I_Shm_send_progress(void)
         {
             MPIDI_CH3I_shm_active_send = NULL;
             MPIDI_CH3I_Sendq_dequeue(&MPIDI_CH3I_shm_sendq, &sreq);
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
             mpi_errno = check_terminating_vcs();
             if (mpi_errno) MPIR_ERR_POP(mpi_errno);
         }
@@ -526,7 +526,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
                     MPIDI_msg_sz_t buflen = payload_len;
 
                     /* This packet must be the first packet of a new message */
-                    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Recv pkt from fbox");
+                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Recv pkt from fbox");
                     MPIU_Assert(payload_len >= sizeof (MPIDI_CH3_Pkt_t));
 
                     MPIDI_PG_Get_vc_set_active(MPIDI_Process.my_pg, MPID_NEM_FBOX_SOURCE(cell), &vc);
@@ -563,7 +563,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
                 }
 
 
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Recv pkt from queue");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Recv pkt from queue");
 
                 MPIDI_PG_Get_vc_set_active(MPIDI_Process.my_pg, MPID_NEM_CELL_SOURCE(cell), &vc);
 
@@ -752,7 +752,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                 MPIDI_msg_sz_t len = buflen;
                 MPIDI_CH3_Pkt_t *pkt = (MPIDI_CH3_Pkt_t *)buf;
 
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "received new message");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "received new message");
 
                 /* invalid pkt data will result in unpredictable behavior */
                 MPIU_Assert(pkt->type >= 0 && pkt->type < MPIDI_CH3_PKT_END_ALL);
@@ -761,7 +761,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                 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"));
+                MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, if (!rreq) MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...completed immediately"));
             }
             while (!rreq && buflen >= sizeof(MPIDI_CH3_Pkt_t));
 
@@ -775,7 +775,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
         else if (vc_ch->recv_active)
         {
             MPIU_Assert(vc_ch->pending_pkt_len == 0);
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "continuing recv");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "continuing recv");
             rreq = vc_ch->recv_active;
         }
         else
@@ -785,7 +785,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
             MPIDI_msg_sz_t pktlen;
             MPIDI_CH3_Pkt_t *pkt = (MPIDI_CH3_Pkt_t *)vc_ch->pending_pkt;
 
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "received header fragment");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "received header fragment");
 
             copylen = ((vc_ch->pending_pkt_len + buflen <= sizeof(MPIDI_CH3_Pkt_t))
                        ? buflen
@@ -796,7 +796,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                 goto fn_exit;
 
             /* we have a whole header */
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "    completed header");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    completed header");
             MPIU_Assert(vc_ch->pending_pkt_len == sizeof(MPIDI_CH3_Pkt_t));
 
             buflen -= copylen;
@@ -814,7 +814,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
 
             if (!rreq)
             {
-                MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "...completed immediately");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...completed immediately");
                 continue;
             }
             /* Channel fields don't get initialized on request creation, init them here */
@@ -825,7 +825,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
         MPIU_Assert(rreq);
         MPIU_Assert(rreq->dev.iov_count > 0 && rreq->dev.iov[rreq->dev.iov_offset].MPL_IOV_LEN > 0);
 
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "    copying into user buffer from IOV");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "    copying into user buffer from IOV");
 
         if (buflen == 0)
         {
@@ -846,7 +846,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
             while (n_iov && buflen >= iov->MPL_IOV_LEN)
             {
                 size_t iov_len = iov->MPL_IOV_LEN;
-		MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "        %d", (int)iov_len);
+		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "        %d", (int)iov_len);
                 if (rreq->dev.drop_data == FALSE) {
                     MPIU_Memcpy (iov->MPL_IOV_BUF, buf, iov_len);
                 }
@@ -861,7 +861,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
             {
                 if (buflen > 0)
                 {
-		    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "        " MPIDI_MSG_SZ_FMT, buflen);
+		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "        " MPIDI_MSG_SZ_FMT, buflen);
                     if (rreq->dev.drop_data == FALSE) {
                         MPIU_Memcpy (iov->MPL_IOV_BUF, buf, buflen);
                     }
@@ -873,7 +873,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                 rreq->dev.iov_offset = iov - rreq->dev.iov;
                 rreq->dev.iov_count = n_iov;
                 vc_ch->recv_active = rreq;
-		MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        remaining: " MPIDI_MSG_SZ_FMT " bytes + %d iov entries", iov->MPL_IOV_LEN, n_iov));
+		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "        remaining: " MPIDI_MSG_SZ_FMT " bytes + %d iov entries", iov->MPL_IOV_LEN, n_iov));
             }
             else
             {
@@ -904,11 +904,11 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
                     rreq->dev.iov_offset = 0;
                     MPIU_Assert(rreq->dev.iov_count > 0 && rreq->dev.iov[rreq->dev.iov_offset].MPL_IOV_LEN > 0);
                     vc_ch->recv_active = rreq;
-                    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "...not complete");
+                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...not complete");
                 }
                 else
                 {
-                    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "...complete");
+                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "...complete");
                     vc_ch->recv_active = NULL;
                 }
             }
@@ -1053,7 +1053,7 @@ static int shm_connection_terminated(MPIDI_VC_t * vc)
     mpi_errno = MPIDI_CH3U_Handle_connection(vc, MPIDI_VC_EVENT_TERMINATED);
     if(mpi_errno) MPIR_ERR_POP(mpi_errno);
 
-    MPIU_DBG_MSG_D(CH3_DISCONNECT, TYPICAL, "Terminated VC %d", vc->pg_rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Terminated VC %d", vc->pg_rank);
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_SHM_CONNECTION_TERMINATED);
     return mpi_errno;
@@ -1074,7 +1074,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_CONNECTION_TERMINATE);
 
-    MPIU_DBG_MSG_D(CH3_DISCONNECT, TYPICAL, "Terminating VC %d", vc->pg_rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Terminating VC %d", vc->pg_rank);
 
     /* if this is already closed, exit */
     if (vc->state == MPIDI_VC_STATE_MORIBUND ||
@@ -1082,13 +1082,13 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
         goto fn_exit;
 
     if (vc->ch.is_local) {
-        MPIU_DBG_MSG(CH3_DISCONNECT, TYPICAL, "VC is local");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "VC is local");
 
         if (vc->state != MPIDI_VC_STATE_CLOSED) {
             /* VC is terminated as a result of a fault.  Complete
                outstanding sends with an error and terminate
                connection immediately. */
-            MPIU_DBG_MSG(CH3_DISCONNECT, TYPICAL, "VC terminated due to fault");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "VC terminated due to fault");
             mpi_errno = MPIDI_CH3I_Complete_sendq_with_error(vc);
             if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
@@ -1101,7 +1101,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
             if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq)) {
                 /* The sendq is empty, so we can immediately terminate
                    the connection. */
-                MPIU_DBG_MSG(CH3_DISCONNECT, TYPICAL, "Shm send queue empty, terminating immediately");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Shm send queue empty, terminating immediately");
                 mpi_errno = shm_connection_terminated(vc);
                 if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             } else {
@@ -1114,7 +1114,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
                    VC anymore) we know that all sends on this VC must
                    have completed.  */
                 vc_term_element_t *ep;
-                MPIU_DBG_MSG(CH3_DISCONNECT, TYPICAL, "Shm send queue not empty, waiting to terminate");
+                MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "Shm send queue not empty, waiting to terminate");
                 MPIU_CHKPMEM_MALLOC(ep, vc_term_element_t *, sizeof(vc_term_element_t), mpi_errno, "vc_term_element");
                 ep->vc = vc;
                 ep->req = MPIDI_CH3I_shm_sendq.tail;
@@ -1124,7 +1124,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
         }
     
     } else {
-        MPIU_DBG_MSG(CH3_DISCONNECT, TYPICAL, "VC is remote");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, "VC is remote");
         mpi_errno = MPID_nem_netmod_func->vc_terminate(vc);
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     }
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c b/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
index 532e05d..eb8539f 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c
@@ -36,7 +36,7 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
         /* send queue is not empty, enqueue the request then check to
            see if we can send any now */
 
-        MPIU_DBG_MSG(CH3_OTHER, TERSE, "enqueuing");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, TERSE, "enqueuing");
 
 	sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *)header;
         sreq->ch.noncontig    = TRUE;
@@ -83,7 +83,7 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
         if (mpi_errno != MPI_SUCCESS) {
             MPIR_ERR_POP(mpi_errno);
         }
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, ".... complete %d bytes", (int) (sreq->dev.segment_size));
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete %d bytes", (int) (sreq->dev.segment_size));
     }
     else
     {
@@ -92,7 +92,7 @@ int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
         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));
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete %d bytes", (int) (sreq->dev.segment_size));
     }
 
  fn_exit:
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 ff93a94..eb96008 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c
@@ -18,11 +18,11 @@ void MPID_nem_dbg_dump_cell (volatile struct MPID_nem_cell *cell)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_DBG_DUMP_CELL);
 
-    MPIU_DBG_MSG_D (OTHER, TERSE, "  src = %6d", cell->pkt.mpich.source);
-    MPIU_DBG_MSG_D (OTHER, TERSE, "  dst = %6d", cell->pkt.mpich.dest);
-    MPIU_DBG_MSG_D (OTHER, TERSE, "  len = %6d", (int)cell->pkt.mpich.datalen);
-    MPIU_DBG_MSG_D (OTHER, TERSE, "  sqn = %6d", cell->pkt.mpich.seqno);
-    MPIU_DBG_MSG_D (OTHER, TERSE, "  typ = %6d", cell->pkt.mpich.type);
+    MPIU_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  src = %6d", cell->pkt.mpich.source);
+    MPIU_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  dst = %6d", cell->pkt.mpich.dest);
+    MPIU_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  len = %6d", (int)cell->pkt.mpich.datalen);
+    MPIU_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  sqn = %6d", cell->pkt.mpich.seqno);
+    MPIU_DBG_MSG_D (MPIR_DBG_OTHER, TERSE, "  typ = %6d", cell->pkt.mpich.type);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_DBG_DUMP_CELL);
 }
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 99c82dd..40a0bff 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
@@ -549,7 +549,7 @@ MPID_nem_vc_init (MPIDI_VC_t *vc)
         else
             vc->ready_eager_max_msg_sz = MPIR_CVAR_NEMESIS_SHM_READY_EAGER_MAX_SZ;
 
-        MPIU_DBG_MSG(VC, VERBOSE, "vc using shared memory");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_VC, VERBOSE, "vc using shared memory");
     }
     else
     {
@@ -569,7 +569,7 @@ MPID_nem_vc_init (MPIDI_VC_t *vc)
         vc_ch->iStartContigMsg = NULL;
         vc_ch->iSendContig     = NULL;
 
-        MPIU_DBG_MSG_FMT(VC, VERBOSE, (MPIU_DBG_FDEST, "vc using %s netmod for rank %d pg %s",
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_VC, VERBOSE, (MPIU_DBG_FDEST, "vc using %s netmod for rank %d pg %s",
                                        MPID_nem_netmod_strings[MPID_nem_netmod_id], vc->pg_rank,
                                        ((vc->pg == MPIDI_Process.my_pg) 
                                         ? "my_pg" 
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 ac077cf..7286744 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
@@ -105,7 +105,7 @@ int MPID_nem_lmt_RndvSend(MPID_Request **sreq_p, const void * buf, MPI_Aint coun
         goto fn_exit;
     }
 
-    MPIU_DBG_MSG_D(CH3_OTHER,VERBOSE,
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		   "sending lmt RTS, data_sz=" MPIDI_MSG_SZ_FMT, data_sz);
     sreq->partner_request = NULL;
     sreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = 0;
@@ -162,7 +162,7 @@ int MPID_nem_lmt_RndvRecv(MPIDI_VC_t *vc, MPID_Request *rreq)
         goto fn_exit;
     }
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE, "lmt RTS in the request");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE, "lmt RTS in the request");
 
     mpi_errno = do_cts(vc, rreq, &complete);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
@@ -195,7 +195,7 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
 
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST, "received LMT RTS pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d, data_sz=" MPIDI_MSG_SZ_FMT,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_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));
 
@@ -223,7 +223,7 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
     if (data_len < rts_pkt->cookie_len)
     {
         /* set for the cookie to be received into the tmp_cookie in the request */
-        MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"haven't received entire cookie");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"haven't received entire cookie");
         MPIU_CHKPMEM_MALLOC(rreq->ch.lmt_tmp_cookie.MPL_IOV_BUF, char *, rts_pkt->cookie_len, mpi_errno, "tmp cookie buf");
         rreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = rts_pkt->cookie_len;
 
@@ -235,13 +235,13 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
         if (found)
         {
             /* set do_cts() to be called once we've received the entire cookie */
-            MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"posted request found");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
             rreq->dev.OnDataAvail = do_cts;
         }
         else
         {
             /* receive the rest of the cookie and wait for a match */
-            MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"unexpected request allocated");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
             rreq->dev.OnDataAvail = 0;
             MPIDI_CH3_Progress_signal_completion();
         }
@@ -259,7 +259,7 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
         else
         {
             /* receive cookie into tmp_cookie in the request */
-            MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received entire cookie");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received entire cookie");
             MPIU_CHKPMEM_MALLOC(rreq->ch.lmt_tmp_cookie.MPL_IOV_BUF, char *, rts_pkt->cookie_len, mpi_errno, "tmp cookie buf");
             rreq->ch.lmt_tmp_cookie.MPL_IOV_LEN = rts_pkt->cookie_len;
         
@@ -272,14 +272,14 @@ static int pkt_RTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
         {
             /* have a matching request and the entire cookie (if any), call do_cts() */
             int complete;
-            MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"posted request found");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
             mpi_errno = do_cts(vc, rreq, &complete);
             if (mpi_errno) MPIR_ERR_POP(mpi_errno);
             MPIU_Assert(complete);
         }
         else
         {
-            MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"unexpected request allocated");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
             rreq->dev.OnDataAvail = 0;
             MPIDI_CH3_Progress_signal_completion();
         }
@@ -314,7 +314,7 @@ static int pkt_CTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
 
     MPIDI_FUNC_ENTER(MPID_STATE_PKT_CTS_HANDLER);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received rndv CTS pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received rndv CTS pkt");
 
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
     data_buf = (char *)pkt + sizeof(MPIDI_CH3_Pkt_t);
@@ -544,7 +544,7 @@ static int do_cts(MPIDI_VC_t *vc, MPID_Request *rreq, int *complete)
 
     MPIDI_FUNC_ENTER(MPID_STATE_DO_CTS);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"posted request found");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
 
     /* determine amount of data to be transfered and check for truncation */
     MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
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 217f78c..f6eb19a 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
@@ -430,7 +430,7 @@ int MPID_nem_lmt_dma_start_recv(MPIDI_VC_t *vc, MPID_Request *rreq, MPL_IOV s_co
         if (complete) {
             /* request was completed by the OnDataAvail fn */
             MPID_nem_lmt_send_DONE(vc, rreq); /* tell the other side to complete its request */
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
 
         }
         else {
@@ -485,7 +485,7 @@ int MPID_nem_lmt_dma_done_send(MPIDI_VC_t *vc, MPID_Request *sreq)
         if (mpi_errno != MPI_SUCCESS) {
             MPIR_ERR_POP(mpi_errno);
         }
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
         goto fn_exit;
     }
 
@@ -495,7 +495,7 @@ int MPID_nem_lmt_dma_done_send(MPIDI_VC_t *vc, MPID_Request *sreq)
         
     if (complete) {
         /* request was completed by the OnDataAvail fn */
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
         goto fn_exit;
     }
     else {
@@ -584,7 +584,7 @@ int MPID_nem_lmt_dma_progress(void)
                     if (complete) {
                         /* request was completed by the OnDataAvail fn */
                         MPID_nem_lmt_send_DONE(cur->vc, cur->req); /* tell the other side to complete its request */
-                        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+                        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
 
                     }
                     else {
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 aa11809..69c42fc 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
@@ -216,7 +216,7 @@ int MPID_nem_lmt_shm_start_recv(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV s_coo
         /* lmt send didn't finish, enqueue it to be completed later */
         lmt_shm_prog_element_t *pe;
 
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "lmt recv not finished:  enqueue");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "lmt recv not finished:  enqueue");
 
         MPIU_CHKPMEM_MALLOC (pe, lmt_shm_prog_element_t *, sizeof (lmt_shm_prog_element_t), mpi_errno, "lmt progress queue element");
         pe->vc = vc;
@@ -259,7 +259,7 @@ int MPID_nem_lmt_shm_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_coo
 
         mpi_errno = MPID_nem_attach_shm_region(&vc_ch->lmt_copy_buf, vc_ch->lmt_copy_buf_handle);
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "attached to remote copy_buf");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "attached to remote copy_buf");
     }
     else{
         char *ser_lmt_copy_buf_handle=NULL;
@@ -286,7 +286,7 @@ int MPID_nem_lmt_shm_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_coo
             vc_ch->lmt_active_lmt = NULL;
         }
 
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "deleted my copy_buf and attached to remote");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "deleted my copy_buf and attached to remote");
     }
 
     queue_initially_empty = LMT_SHM_Q_EMPTY(vc_ch->lmt_queue) && vc_ch->lmt_active_lmt == NULL;
@@ -314,7 +314,7 @@ int MPID_nem_lmt_shm_start_send(MPIDI_VC_t *vc, MPID_Request *req, MPL_IOV r_coo
         MPID_nem_local_lmt_pending = TRUE;
         MPIU_Assert(!vc_ch->lmt_enqueued);
         vc_ch->lmt_enqueued = TRUE;
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "lmt send not finished:  enqueue");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "lmt send not finished:  enqueue");
    }
 
     MPIU_Assert(LMT_SHM_Q_EMPTY(vc_ch->lmt_queue) || !LMT_SHM_L_EMPTY());
@@ -348,8 +348,8 @@ static int get_next_req(MPIDI_VC_t *vc)
     if (prev_owner_rank == IN_USE || prev_owner_rank == MPIDI_Process.my_pg_rank)
     {
         /* last lmt is not complete (receiver still receiving */
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "waiting for receiver");
-        DBG_LMT(MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "waiting for receiver");
+        DBG_LMT(MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
         goto fn_exit;
     }
 
@@ -367,8 +367,8 @@ static int get_next_req(MPIDI_VC_t *vc)
 
         LMT_SHM_Q_DEQUEUE(&vc_ch->lmt_queue, &vc_ch->lmt_active_lmt);
         copy_buf->owner_info.val.remote_req_id = vc_ch->lmt_active_lmt->req->ch.lmt_req_id;
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "grabbed idle buf.  remote_req=%d local_req=%d", copy_buf->owner_info.val.remote_req_id, vc_ch->lmt_active_lmt->req->handle));
-        DBG_LMT(MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "grabbed idle buf.  remote_req=%d local_req=%d", copy_buf->owner_info.val.remote_req_id, vc_ch->lmt_active_lmt->req->handle));
+        DBG_LMT(MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
     }
     else
     {
@@ -377,8 +377,8 @@ static int get_next_req(MPIDI_VC_t *vc)
 
         OPA_read_barrier();
         
-        MPIU_DBG_STMT(CH3_CHANNEL, VERBOSE, if (copy_buf->owner_info.val.remote_req_id == MPI_REQUEST_NULL)
-                                                MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "waiting for owner rank=%d", vc->pg_rank));
+        MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, if (copy_buf->owner_info.val.remote_req_id == MPI_REQUEST_NULL)
+                                                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "waiting for owner rank=%d", vc->pg_rank));
             
         while (copy_buf->owner_info.val.remote_req_id == MPI_REQUEST_NULL) {
             int p = 0;
@@ -392,13 +392,13 @@ static int get_next_req(MPIDI_VC_t *vc)
         OPA_read_barrier();
         LMT_SHM_Q_SEARCH_REMOVE(&vc_ch->lmt_queue, copy_buf->owner_info.val.remote_req_id, &vc_ch->lmt_active_lmt);
 
-        MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "remote side owns buf.  local_req=%d", copy_buf->owner_info.val.remote_req_id);
-        DBG_LMT(MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "remote side owns buf.  local_req=%d", copy_buf->owner_info.val.remote_req_id);
+        DBG_LMT(MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
 
         if (vc_ch->lmt_active_lmt == NULL)
         {
             /* request not found  */
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "request not found in lmt queue");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "request not found in lmt queue");
             goto fn_exit;
         }
 
@@ -453,7 +453,7 @@ static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
 
     MPIDI_FUNC_ENTER(MPID_STATE_LMT_SHM_SEND_PROGRESS);
 
-    DBG_LMT(MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
+    DBG_LMT(MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
 
     copy_buf->sender_present.val = TRUE;
 
@@ -476,8 +476,8 @@ static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
                 req->dev.segment_first = first;
                 vc_ch->lmt_buf_num = buf_num;
                 *done = FALSE;
-                MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "first=" MPIDI_MSG_SZ_FMT " data_sz="MPIDI_MSG_SZ_FMT, first, data_sz));        
-                MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "Waiting on full buffer %d", buf_num);
+                MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "first=" MPIDI_MSG_SZ_FMT " data_sz="MPIDI_MSG_SZ_FMT, first, data_sz));
+                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Waiting on full buffer %d", buf_num);
                 goto fn_exit;
             }
             ++p;
@@ -500,7 +500,7 @@ static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
         first = last;
         buf_num = (buf_num+1) % NUM_BUFS;
 
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "sent data.  last=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, last, data_sz));        
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "sent data.  last=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, last, data_sz));
     }
     while (last < data_sz);
 
@@ -509,7 +509,7 @@ static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
     if (mpi_errno != MPI_SUCCESS) {
         MPIR_ERR_POP(mpi_errno);
     }
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "completed req local_req=%d", req->handle);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "completed req local_req=%d", req->handle);
 
 
  fn_exit:
@@ -549,7 +549,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
 
     MPIDI_FUNC_ENTER(MPID_STATE_LMT_SHM_RECV_PROGRESS);
 
-    DBG_LMT(MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
+    DBG_LMT(MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ctr=%d rank=%d", copy_buf->owner_info.val.ctr, vc->pg_rank)));
 
     copy_buf->receiver_present.val = TRUE;
 
@@ -571,8 +571,8 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
                 vc_ch->lmt_buf_num = buf_num;
                 vc_ch->lmt_surfeit = surfeit;
                 *done = FALSE;
-                MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "first=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, first, data_sz));
-                MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "Waiting on empty buffer %d", buf_num);
+                MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "first=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, first, data_sz));
+                MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Waiting on empty buffer %d", buf_num);
                 goto fn_exit;
             }
             ++p;
@@ -587,7 +587,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
 
 	MPID_Segment_unpack(req->dev.segment_ptr, first, &last, src_buf);
 
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "recvd data.  last=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, last, data_sz));
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "recvd data.  last=" MPIDI_MSG_SZ_FMT " data_sz=" MPIDI_MSG_SZ_FMT, last, data_sz));
 
         if (surfeit && buf_num > 0)
         {
@@ -599,7 +599,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
             /* Make sure we copied at least the leftover data from last time */
             MPIU_Assert(last - first > surfeit);
 
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "freed previous buffer");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "freed previous buffer");
         }
 
         if (last < expected_last)
@@ -625,7 +625,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
                 MPIU_Memcpy(((char *)copy_buf->buf[buf_num+1]) - surfeit, tmpbuf, surfeit);
             }
 
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "copied leftover data");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "copied leftover data");
         }
         else
         {
@@ -644,7 +644,7 @@ static int lmt_shm_recv_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
     for (i = 0; i < NUM_BUFS; ++i)
         copy_buf->len[i].val = 0;
 
-    MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "completed request local_req=%d", req->handle);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "completed request local_req=%d", req->handle);
     OPA_write_barrier();
     OPA_store_int(&copy_buf->owner_info.val.rank, NO_OWNER);
 
@@ -839,7 +839,7 @@ int MPID_nem_lmt_shm_vc_terminated(MPIDI_VC_t *vc)
        calls lmt_shm_progress_vc() and it finds an empty queue. */
 
     if (vc_ch->lmt_active_lmt) {
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Clearing active LMT");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Clearing active LMT");
         vc_ch->lmt_active_lmt->req->status.MPI_ERROR = req_errno;
         MPID_Request_complete(vc_ch->lmt_active_lmt->req);
         MPIU_Free(vc_ch->lmt_active_lmt);
@@ -847,7 +847,7 @@ int MPID_nem_lmt_shm_vc_terminated(MPIDI_VC_t *vc)
     }
 
     if (!LMT_SHM_Q_EMPTY(vc_ch->lmt_queue)) {
-        MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Empty LMT queue");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, "Empty LMT queue");
     }
 
     while (!LMT_SHM_Q_EMPTY(vc_ch->lmt_queue)) {
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 8a582f2..c7b42a3 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
@@ -162,7 +162,7 @@ static int do_vmsplice(MPID_Request *sreq, int pipe_fd, MPL_IOV iov[],
         if (*complete) {
             err = close(pipe_fd);
             MPIR_ERR_CHKANDJUMP(err < 0, mpi_errno, MPI_ERR_OTHER, "**close");
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
         }
     }
 
@@ -241,7 +241,7 @@ static int do_readv(MPID_Request *rreq, int pipe_fd, MPL_IOV iov[],
         if (*complete) {
             nread = close(pipe_fd);
             MPIR_ERR_CHKANDJUMP(nread < 0, mpi_errno, MPI_ERR_OTHER, "**close");
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
         }
     }
 
@@ -340,7 +340,7 @@ int MPID_nem_lmt_vmsplice_progress(void)
         }
 
         if (complete) {
-            MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
 
             /* remove the node from the list */
             if (cur == outstanding_head) {
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 cea3ef7..5e681dd 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich.c
@@ -114,7 +114,7 @@ int MPID_nem_send_iov(MPIDI_VC_t *vc, MPID_Request **sreq_ptr, MPL_IOV *iov, int
         /* --BEGIN ERROR HANDLING-- */
         if (sreq->dev.tmpbuf_sz == 0)
         {
-            MPIU_DBG_MSG(CH3_CHANNEL,TYPICAL,"SRBuf allocation failure");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"SRBuf allocation failure");
             mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL,
                                              FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem", 0);
             sreq->status.MPI_ERROR = mpi_errno;
diff --git a/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h b/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h
index 27f09a8..8cb4c7d 100644
--- a/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h
+++ b/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h
@@ -20,7 +20,7 @@
 
 #define MPIDI_CH3I_SendQ_enqueue(vcch, req)				\
 {									\
-    MPIU_DBG_MSG(CH3_MSG,TYPICAL,"Enqueuing this request");\
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_MSG,TYPICAL,"Enqueuing this request");\
     MPIR_Request_add_ref(req);                                          \
     req->dev.next = NULL;						\
     if (vcch->sendq_tail != NULL)					\
@@ -37,7 +37,7 @@
     /* MT - not thread safe! */
 #define MPIDI_CH3I_SendQ_enqueue_head(vcch, req)			\
 {									\
-    MPIU_DBG_MSG(CH3_MSG,TYPICAL,"Enqueuing this request at head");\
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_MSG,TYPICAL,"Enqueuing this request at head");\
     MPIR_Request_add_ref(req);                                          \
     req->dev.next = vcch->sendq_head;					\
     if (vcch->sendq_tail == NULL)					\
@@ -51,7 +51,7 @@
 #define MPIDI_CH3I_SendQ_dequeue(vcch)					\
 {									\
     MPID_Request *req_ = vcch->sendq_head;                              \
-    MPIU_DBG_MSG(CH3_MSG,TYPICAL,"Dequeuing this request");\
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_MSG,TYPICAL,"Dequeuing this request");\
     vcch->sendq_head = vcch->sendq_head->dev.next;			\
     if (vcch->sendq_head == NULL)					\
     {									\
diff --git a/src/mpid/ch3/channels/sock/src/ch3_init.c b/src/mpid/ch3/channels/sock/src/ch3_init.c
index e6e90b6..24be7b0 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_init.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_init.c
@@ -78,7 +78,7 @@ int MPIDI_CH3_VC_Init( MPIDI_VC_t *vc ) {
     vcch->sendq_tail         = NULL;
     vcch->state              = MPIDI_CH3I_VC_STATE_UNCONNECTED;
     MPIDI_VC_InitSock( vc );
-    MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"vc=%p: Setting state (ch) to VC_STATE_UNCONNECTED (Initialization)", vc );
+    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"vc=%p: Setting state (ch) to VC_STATE_UNCONNECTED (Initialization)", vc );
     return 0;
 }
 
diff --git a/src/mpid/ch3/channels/sock/src/ch3_isend.c b/src/mpid/ch3/channels/sock/src/ch3_isend.c
index 2178358..9fbeb9a 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_isend.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_isend.c
@@ -43,7 +43,7 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
     /* The sock channel uses a fixed length header, the size of which is the 
        maximum of all possible packet headers */
     hdr_sz = sizeof(MPIDI_CH3_Pkt_t);
-    MPIU_DBG_STMT(CH3_CHANNEL,VERBOSE,
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 		  MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)hdr));
 
     if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTED) /* MT */
@@ -55,7 +55,7 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 	    MPIU_Size_t nb;
 	    int rc;
 
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send queue empty, attempting to write");
 	    MPIU_DBG_PKT(vcch->conn,hdr,"isend");
 	    /* MT: need some signalling to lock down our right to use the 
@@ -64,12 +64,12 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 	    rc = MPIDU_Sock_write(vcch->sock, hdr, hdr_sz, &nb);
 	    if (rc == MPI_SUCCESS)
 	    {
-		MPIU_DBG_MSG_D(CH3_CHANNEL,VERBOSE,
+		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			       "wrote %ld bytes", (unsigned long) nb);
 		
 		if (nb == hdr_sz)
 		{
-		    MPIU_DBG_MSG_D(CH3_CHANNEL,VERBOSE,
+		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
                      "write complete " MPIDI_MSG_SZ_FMT " bytes, calling OnDataAvail fcn", nb);
 		    reqFn = sreq->dev.OnDataAvail;
 		    if (!reqFn) {
@@ -85,7 +85,7 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 			if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 			if (!complete) {
 			    MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-			    MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
+			    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 					     (MPIU_DBG_FDEST,
                     "posting writev, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 			    vcch->conn->send_active = sreq;
@@ -105,11 +105,11 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 		}
 		else
 		{
-		    MPIU_DBG_MSG_D(CH3_CHANNEL,VERBOSE,
+		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
                      "partial write of " MPIDI_MSG_SZ_FMT " bytes, request enqueued at head", nb);
 		    update_request(sreq, hdr, hdr_sz, nb);
 		    MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-		    MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
+		    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
      (MPIU_DBG_FDEST,"posting write, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 		    vcch->conn->send_active = sreq;
 		    mpi_errno = MPIDU_Sock_post_write(vcch->conn->sock, 
@@ -129,13 +129,13 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 	    /* --BEGIN ERROR HANDLING-- */
 	    else if (MPIR_ERR_GET_CLASS(rc) == MPIDU_SOCK_ERR_NOMEM)
 	    {
-		MPIU_DBG_MSG(CH3_CHANNEL,TYPICAL,
+		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			     "MPIDU_Sock_write failed, out of memory");
 		sreq->status.MPI_ERROR = MPIR_ERR_MEMALLOCFAILED;
 	    }
 	    else
 	    {
-		MPIU_DBG_MSG_D(CH3_CHANNEL,TYPICAL,
+		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			       "MPIDU_Sock_write failed, rc=%d", rc);
 		/* Connection just failed. Mark the request complete and 
 		   return an error. */
@@ -155,7 +155,7 @@ int MPIDI_CH3_iSend(MPIDI_VC_t * vc, MPID_Request * sreq, void * hdr,
 	}
 	else
 	{
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"send queue not empty, enqueuing");
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"send queue not empty, enqueuing");
 	    update_request(sreq, hdr, hdr_sz, 0);
 	    MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 	}
diff --git a/src/mpid/ch3/channels/sock/src/ch3_isendv.c b/src/mpid/ch3/channels/sock/src/ch3_isendv.c
index e8bfd5f..c8d2ea0 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_isendv.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_isendv.c
@@ -67,7 +67,7 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
     /* The sock channel uses a fixed length header, the size of which is the 
        maximum of all possible packet headers */
     iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
-    MPIU_DBG_STMT(CH3_CHANNEL,VERBOSE,
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 	 MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)iov[0].MPL_IOV_BUF));
 
     if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTED) /* MT */
@@ -79,7 +79,7 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 	    MPIU_Size_t nb;
 	    int rc;
 
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send queue empty, attempting to write");
 	    
 	    MPIU_DBG_PKT(vcch->conn,(MPIDI_CH3_Pkt_t*)iov[0].MPL_IOV_BUF,
@@ -97,7 +97,7 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 	    {
 		int offset = 0;
 
-		MPIU_DBG_MSG_D(CH3_CHANNEL,VERBOSE,
+		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			       "wrote %ld bytes", (unsigned long) nb);
 		
 		while (offset < n_iov)
@@ -109,11 +109,11 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 		    }
 		    else
 		    {
-			MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+			MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			     "partial write, request enqueued at head");
 			update_request(sreq, iov, n_iov, offset, nb);
 			MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-			MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
+			MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
     (MPIU_DBG_FDEST,"posting writev, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 			vcch->conn->send_active = sreq;
 			mpi_errno = MPIDU_Sock_post_writev(vcch->conn->sock, 
@@ -134,7 +134,7 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 		}
 		if (offset == n_iov)
 		{
-		    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+		    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 				 "write complete, calling OnDataAvail fcn");
 		    reqFn = sreq->dev.OnDataAvail;
 		    if (!reqFn) {
@@ -150,7 +150,7 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 			if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 			if (!complete) {
 			    MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-			    MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
+			    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
     (MPIU_DBG_FDEST,"posting writev, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 			    vcch->conn->send_active = sreq;
 			    mpi_errno = MPIDU_Sock_post_writev(
@@ -171,13 +171,13 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 	    /* --BEGIN ERROR HANDLING-- */
 	    else if (MPIR_ERR_GET_CLASS(rc) == MPIDU_SOCK_ERR_NOMEM)
 	    {
-		MPIU_DBG_MSG(CH3_CHANNEL,TYPICAL,
+		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			     "MPIDU_Sock_writev failed, out of memory");
 		sreq->status.MPI_ERROR = MPIR_ERR_MEMALLOCFAILED;
 	    }
 	    else
 	    {
-		MPIU_DBG_MSG_D(CH3_CHANNEL,TYPICAL,
+		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			       "MPIDU_Sock_writev failed, rc=%d", rc);
 		/* Connection just failed.  Mark the request complete and 
 		   return an error. */
@@ -198,7 +198,7 @@ int MPIDI_CH3_iSendv(MPIDI_VC_t * vc, MPID_Request * sreq,
 	}
 	else
 	{
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"send queue not empty, enqueuing");
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"send queue not empty, enqueuing");
 	    update_request(sreq, iov, n_iov, 0, 0);
 	    MPIDI_CH3I_SendQ_enqueue(vcch, sreq);
 	}
diff --git a/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c b/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
index 37b98f5..d582609 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_istartmsg.c
@@ -64,7 +64,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
     /* The SOCK channel uses a fixed length header, the size of which is the 
        maximum of all possible packet headers */
     hdr_sz = sizeof(MPIDI_CH3_Pkt_t);
-    MPIU_DBG_STMT(CH3_CHANNEL,VERBOSE,
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 		  MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)hdr));
 
     if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTED) /* MT */
@@ -76,7 +76,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	    MPIU_Size_t nb;
 	    int rc;
 
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send queue empty, attempting to write");
 	    
 	    MPIU_DBG_PKT(vcch->conn,hdr,"istartmsg");
@@ -86,18 +86,18 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	    rc = MPIDU_Sock_write(vcch->sock, hdr, hdr_sz, &nb);
 	    if (rc == MPI_SUCCESS)
 	    {
-		MPIU_DBG_MSG_D(CH3_CHANNEL,VERBOSE,
+		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			       "wrote %ld bytes", (unsigned long) nb);
 		
 		if (nb == hdr_sz)
 		{ 
-		    MPIU_DBG_MSG_D(CH3_CHANNEL,VERBOSE,
+		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 				   "entire write complete, " MPIDI_MSG_SZ_FMT " bytes", nb);
 		    /* done.  get us out of here as quickly as possible. */
 		}
 		else
 		{
-		    MPIU_DBG_MSG_D(CH3_CHANNEL,VERBOSE,
+		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
                     "partial write of " MPIDI_MSG_SZ_FMT " bytes, request enqueued at head", nb);
 		    sreq = create_request(hdr, hdr_sz, nb);
 		    if (!sreq) {
@@ -105,7 +105,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 		    }
 
 		    MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-		    MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
+		    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
      (MPIU_DBG_FDEST,"posting write, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 		    vcch->conn->send_active = sreq;
 		    mpi_errno = MPIDU_Sock_post_write(vcch->conn->sock, sreq->dev.iov[0].MPL_IOV_BUF,
@@ -124,7 +124,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	    /* --BEGIN ERROR HANDLING-- */
 	    else
 	    {
-		MPIU_DBG_MSG_D(CH3_CHANNEL,TYPICAL,
+		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			       "ERROR - MPIDU_Sock_write failed, rc=%d", rc);
 		sreq = MPID_Request_create();
 		if (!sreq) {
@@ -143,7 +143,7 @@ int MPIDI_CH3_iStartMsg(MPIDI_VC_t * vc, void * hdr, MPIDI_msg_sz_t hdr_sz,
 	}
 	else
 	{
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send in progress, request enqueued");
 	    sreq = create_request(hdr, hdr_sz, 0);
 	    if (!sreq) {
diff --git a/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c b/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
index 4540a3f..71ea17d 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c
@@ -88,7 +88,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
     /* The SOCK channel uses a fixed length header, the size of which is the 
        maximum of all possible packet headers */
     iov[0].MPL_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
-    MPIU_DBG_STMT(CH3_CHANNEL,VERBOSE,
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 	   MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t*)iov[0].MPL_IOV_BUF));
     
     if (vcch->state == MPIDI_CH3I_VC_STATE_CONNECTED) /* MT */
@@ -100,7 +100,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 	    int rc;
 	    MPIU_Size_t nb;
 
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send queue empty, attempting to write");
 	    MPIU_DBG_PKT(vcch->conn,(MPIDI_CH3_Pkt_t*)iov[0].MPL_IOV_BUF,"isend");
 	    
@@ -112,7 +112,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 	    {
 		int offset = 0;
     
-		MPIU_DBG_MSG_D(CH3_CHANNEL,VERBOSE,
+		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			       "wrote %ld bytes", (unsigned long) nb);
 		
 		while (offset < n_iov)
@@ -124,14 +124,14 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 		    }
 		    else
 		    {
-			MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+			MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			     "partial write, request enqueued at head");
 			sreq = create_request(iov, n_iov, offset, nb);
 			if (sreq == NULL) {
 			    MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem");
 			}
 			MPIDI_CH3I_SendQ_enqueue_head(vcch, sreq);
-			MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
+			MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 					 (MPIU_DBG_FDEST,"posting writev, vc=0x%p, sreq=0x%08x", vc, sreq->handle));
 			vcch->conn->send_active = sreq;
 			mpi_errno = MPIDU_Sock_post_writev(vcch->conn->sock, sreq->dev.iov + offset,
@@ -150,13 +150,13 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 
 		if (offset == n_iov)
 		{
-		    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"entire write complete");
+		    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"entire write complete");
 		}
 	    }
 	    /* --BEGIN ERROR HANDLING-- */
 	    else
 	    {
-		MPIU_DBG_MSG_D(CH3_CHANNEL,TYPICAL,
+		MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CHANNEL,TYPICAL,
 			       "ERROR - MPIDU_Sock_writev failed, rc=%d", rc);
 		sreq = MPID_Request_create();
 		if (sreq == NULL) {
@@ -175,7 +175,7 @@ int MPIDI_CH3_iStartMsgv(MPIDI_VC_t * vc, MPL_IOV * iov, int n_iov,
 	}
 	else
 	{
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 			 "send in progress, request enqueued");
 	    sreq = create_request(iov, n_iov, 0, 0);
 	    if (sreq == NULL) {
diff --git a/src/mpid/ch3/channels/sock/src/ch3_progress.c b/src/mpid/ch3/channels/sock/src/ch3_progress.c
index 2ab4eed..866a969 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_progress.c
@@ -287,7 +287,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc)
 
     MPIU_DBG_CONNSTATECHANGE(vc,vcch->conn,CONN_STATE_CLOSING);
     vcch->conn->state = CONN_STATE_CLOSING;
-    MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL,"Closing sock (Post_close)");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"Closing sock (Post_close)");
     mpi_errno = MPIDU_Sock_post_close(vcch->sock);
     if (mpi_errno != MPI_SUCCESS) {
 	MPIR_ERR_POP(mpi_errno);
@@ -424,7 +424,7 @@ int MPIDI_CH3I_Progress_finalize(void)
 #define FCNAME MPL_QUOTE(FUNCNAME)
 void MPIDI_CH3I_Progress_wakeup(void)
 {
-    MPIU_DBG_MSG(CH3_OTHER,TYPICAL,"progress_wakeup called");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"progress_wakeup called");
     MPIDU_Sock_wakeup(MPIDI_CH3I_sock_set);
 }
 #endif
@@ -450,7 +450,7 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_HANDLE_SOCK_EVENT);
 
-    MPIU_DBG_MSG_D(CH3_OTHER,VERBOSE,"Socket event of type %d", event->op_type );
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"Socket event of type %d", event->op_type );
 
     switch (event->op_type)
     {
@@ -623,7 +623,7 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 			}
 			/* --END ERROR HANDLING-- */
 
-			MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
+			MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
        (MPIU_DBG_FDEST,"immediate writev, vc=%p, sreq=0x%08x, nb=" MPIDI_MSG_SZ_FMT,
 	conn->vc, sreq->handle, nb));
 			    
@@ -653,7 +653,7 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
 			}
 			else
 			{
-			    MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
+			    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
        (MPIU_DBG_FDEST,"posting writev, vc=%p, conn=%p, sreq=0x%08x", 
 	conn->vc, conn, sreq->handle));
 			    mpi_errno = MPIDU_Sock_post_writev(conn->sock, iovp, sreq->dev.iov_count, NULL);
@@ -808,7 +808,7 @@ static inline int connection_pop_sendq_req(MPIDI_CH3I_Connection_t * conn)
     conn->send_active = MPIDI_CH3I_SendQ_head(vcch); /* MT */
     if (conn->send_active != NULL)
     {
-	MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"conn=%p: Posting message from connection send queue", conn );
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_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) {
 	    MPIR_ERR_POP(mpi_errno);
@@ -898,7 +898,7 @@ static int ReadMoreData( MPIDI_CH3I_Connection_t * conn, MPID_Request *rreq )
 	}
 	/* --END ERROR HANDLING-- */
 
-	MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 		 (MPIU_DBG_FDEST,"immediate readv, vc=%p nb=" MPIDI_MSG_SZ_FMT ", rreq=0x%08x",
 		  conn->vc, nb, rreq->handle));
 				
@@ -931,7 +931,7 @@ static int ReadMoreData( MPIDI_CH3I_Connection_t * conn, MPID_Request *rreq )
 	    }
 	}
 	else {
-	    MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,
+	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
         (MPIU_DBG_FDEST,"posting readv, vc=%p, rreq=0x%08x", 
 	 conn->vc, rreq->handle));
 	    conn->recv_active = rreq;
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index b94f886..dec6720 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -51,6 +51,17 @@ extern char *MPIDI_failed_procs_string;
 
 extern int MPIDI_Use_pmi2_api;
 
+#if defined(USE_DBG_LOGGING)
+extern MPIU_DBG_Class MPIDI_CH3_DBG_CONNECT;
+extern MPIU_DBG_Class MPIDI_CH3_DBG_DISCONNECT;
+extern MPIU_DBG_Class MPIDI_CH3_DBG_PROGRESS;
+extern MPIU_DBG_Class MPIDI_CH3_DBG_CHANNEL;
+extern MPIU_DBG_Class MPIDI_CH3_DBG_OTHER;
+extern MPIU_DBG_Class MPIDI_CH3_DBG_MSG;
+extern MPIU_DBG_Class MPIDI_CH3_DBG_VC;
+extern MPIU_DBG_Class MPIDI_CH3_DBG_REFCOUNT;
+#endif /* USE_DBG_LOGGING */
+
 #define MPIDI_CHANGE_VC_STATE(vc, new_state) do {               \
         MPIU_DBG_VCSTATECHANGE(vc, VC_STATE_##new_state);       \
         (vc)->state = MPIDI_VC_STATE_##new_state;               \
@@ -163,7 +174,7 @@ extern MPIDI_Process_t MPIDI_Process;
 	(dt_contig_out_) = TRUE;					\
         (dt_true_lb_)    = 0;                                           \
 	(data_sz_out_) = (MPIDI_msg_sz_t) (count_) * MPID_Datatype_get_basic_size(datatype_); \
-	MPIU_DBG_MSG_FMT(CH3_OTHER, TERSE, (MPIU_DBG_FDEST,"basic datatype: dt_contig=%d, dt_sz=%d, data_sz=" MPIDI_MSG_SZ_FMT, \
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPIU_DBG_FDEST,"basic datatype: dt_contig=%d, dt_sz=%d, data_sz=" MPIDI_MSG_SZ_FMT, \
 			  (dt_contig_out_), MPID_Datatype_get_basic_size(datatype_), (data_sz_out_)));\
     }									\
     else								\
@@ -172,7 +183,7 @@ extern MPIDI_Process_t MPIDI_Process;
 	(dt_contig_out_) = (dt_ptr_)->is_contig;			\
 	(data_sz_out_) = (MPIDI_msg_sz_t) (count_) * (dt_ptr_)->size;	\
         (dt_true_lb_)    = (dt_ptr_)->true_lb;                          \
-	MPIU_DBG_MSG_FMT(CH3_OTHER, TERSE, (MPIU_DBG_FDEST, "user defined datatype: dt_contig=%d, dt_sz=" MPI_AINT_FMT_DEC_SPEC ", data_sz=" MPIDI_MSG_SZ_FMT, \
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, TERSE, (MPIU_DBG_FDEST, "user defined datatype: dt_contig=%d, dt_sz=" MPI_AINT_FMT_DEC_SPEC ", data_sz=" MPIDI_MSG_SZ_FMT, \
 			  (dt_contig_out_), (dt_ptr_)->size, (data_sz_out_)));\
     }									\
 }
@@ -276,7 +287,7 @@ extern MPIDI_Process_t MPIDI_Process;
 #  define MPIDI_Request_tls_alloc(req_) \
     do { \
 	(req_) = MPIU_Handle_obj_alloc(&MPID_Request_mem); \
-        MPIU_DBG_MSG_P(CH3_CHANNEL,VERBOSE,		\
+        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL,VERBOSE,		\
 	       "allocated request, handle=0x%08x", req_);\
     } while (0)
 #else
@@ -349,7 +360,7 @@ extern MPIDI_Process_t MPIDI_Process;
             MPIR_Status_set_procnull(&(rreq_)->status);                    \
         }                                                                  \
         else {                                                             \
-            MPIU_DBG_MSG(CH3_CHANNEL,TYPICAL,"unable to allocate a request");\
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"unable to allocate a request");\
             (mpi_errno_) = MPIR_ERR_MEMALLOCFAILED;                        \
             FAIL_;                                                         \
         }                                                                  \
@@ -940,43 +951,43 @@ int MPIDI_PrintConnStrToFile( FILE *fd, const char *file, int line,
 
 */
 #define MPIU_DBG_VCSTATECHANGE(_vc,_newstate) do { \
-     MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
+     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
      "vc=%p: Setting state (vc) from %s to %s, vcchstate is %s", \
                  _vc, MPIDI_VC_GetStateString((_vc)->state), \
                  #_newstate, MPIDI_CH3_VC_GetStateString( (_vc) ))); \
 } while (0)
 
 #define MPIU_DBG_VCCHSTATECHANGE(_vc,_newstate) \
-     MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
+     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
      "vc=%p: Setting state (ch) from %s to %s, vc state is %s", \
            _vc, MPIDI_CH3_VC_GetStateString((_vc)), \
            #_newstate, MPIDI_VC_GetStateString( (_vc)->state )) )
 
 #define MPIU_DBG_CONNSTATECHANGE(_vc,_conn,_newstate) \
-     MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
+     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
      "vc=%p,conn=%p: Setting state (conn) from %s to %s, vcstate = %s", \
              _vc, _conn, \
              MPIDI_Conn_GetStateString((_conn)->state), #_newstate, \
              _vc ? MPIDI_VC_GetStateString((_vc)->state) : "<no vc>" ))
 
 #define MPIU_DBG_CONNSTATECHANGE_MSG(_vc,_conn,_newstate,_msg) \
-     MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
+     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST, \
      "vc=%p,conn=%p: Setting conn state from %s to %s, vcstate = %s %s", \
              _vc, _conn, \
              MPIDI_Conn_GetStateString((_conn)->state), #_newstate, \
              _vc ? MPIDI_VC_GetStateString((_vc)->state) : "<no vc>", _msg ))
 #define MPIU_DBG_VCUSE(_vc,_msg) \
-     MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST,\
+     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,\
       "vc=%p: Using vc for %s", _vc, _msg ))
 #define MPIU_DBG_PKT(_conn,_pkt,_msg) \
-     MPIU_DBG_MSG_FMT(CH3_OTHER,TYPICAL,(MPIU_DBG_FDEST,\
+     MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TYPICAL,(MPIU_DBG_FDEST,\
      "conn=%p: %s %s", _conn, _msg, MPIDI_Pkt_GetDescString( _pkt ) ))
 
 const char *MPIDI_Pkt_GetDescString( MPIDI_CH3_Pkt_t *pkt );
 
 /* These macros help trace communication headers */
 #define MPIU_DBG_MSGPKT(_vc,_tag,_contextid,_dest,_size,_kind)	\
-    MPIU_DBG_MSG_FMT(CH3_MSG,TYPICAL,(MPIU_DBG_FDEST,\
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_MSG,TYPICAL,(MPIU_DBG_FDEST,\
 		      "%s: vc=%p, tag=%d, context=%d, dest=%d, datasz=" MPIDI_MSG_SZ_FMT,\
 		      _kind,_vc,_tag,_contextid,_dest,_size) )
 
@@ -1204,7 +1215,7 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
     do {                                                                         \
         MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_COMPLETION_MUTEX);                                       \
         ++MPIDI_CH3I_progress_completion_count;                                  \
-        MPIU_DBG_MSG_D(CH3_PROGRESS,VERBOSE,                                     \
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_PROGRESS,VERBOSE,                                     \
                      "just incremented MPIDI_CH3I_progress_completion_count=%d", \
                      MPIDI_CH3I_progress_completion_count);                      \
         MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_COMPLETION_MUTEX);                                        \
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 97d738d..d64ac67 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -130,7 +130,7 @@ static inline int MPIDI_CH3I_Send_lock_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_p
     lock_ack_pkt->target_rank = win_ptr->comm_ptr->rank;
     lock_ack_pkt->flags = flags;
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
                      (MPIU_DBG_FDEST, "sending lock ack pkt on vc=%p, source_win_handle=%#08x",
                       vc, lock_ack_pkt->source_win_handle));
 
@@ -177,7 +177,7 @@ static inline int MPIDI_CH3I_Send_lock_op_ack_pkt(MPIDI_VC_t * vc, MPID_Win * wi
     lock_op_ack_pkt->target_rank = win_ptr->comm_ptr->rank;
     lock_op_ack_pkt->flags = flags;
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
                      (MPIU_DBG_FDEST, "sending lock op ack pkt on vc=%p, source_win_handle=%#08x",
                       vc, lock_op_ack_pkt->source_win_handle));
 
diff --git a/src/mpid/ch3/src/ch3u_buffer.c b/src/mpid/ch3/src/ch3u_buffer.c
index 9302c0f..4a792d2 100644
--- a/src/mpid/ch3/src/ch3u_buffer.c
+++ b/src/mpid/ch3/src/ch3u_buffer.c
@@ -57,7 +57,7 @@ void MPIDI_CH3U_Buffer_copy(
     /* --BEGIN ERROR HANDLING-- */
     if (sdata_sz > rdata_sz)
     {
-	MPIU_DBG_MSG_FMT(CH3_OTHER,TYPICAL,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TYPICAL,(MPIU_DBG_FDEST,
 	    "message truncated, sdata_sz=" MPIDI_MSG_SZ_FMT " rdata_sz=" MPIDI_MSG_SZ_FMT,
 			  sdata_sz, rdata_sz));
 	sdata_sz = rdata_sz;
@@ -85,10 +85,10 @@ void MPIDI_CH3U_Buffer_copy(
 
 	MPID_Segment_init(rbuf, rcount, rdt, &seg, 0);
 	last = sdata_sz;
-	MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST, 
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                           "pre-unpack last=" MPIDI_MSG_SZ_FMT, last ));
 	MPID_Segment_unpack(&seg, 0, &last, (char*)sbuf + sdt_true_lb);
-	MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 			 "pre-unpack last=" MPIDI_MSG_SZ_FMT, last ));
 	/* --BEGIN ERROR HANDLING-- */
 	if (last != sdata_sz)
@@ -106,10 +106,10 @@ void MPIDI_CH3U_Buffer_copy(
 
 	MPID_Segment_init(sbuf, scount, sdt, &seg, 0);
 	last = sdata_sz;
-	MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 			       "pre-pack last=" MPIDI_MSG_SZ_FMT, last ));
 	MPID_Segment_pack(&seg, 0, &last, (char*)rbuf + rdt_true_lb);
-	MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 			    "post-pack last=" MPIDI_MSG_SZ_FMT, last ));
 	/* --BEGIN ERROR HANDLING-- */
 	if (last != sdata_sz)
@@ -133,7 +133,7 @@ void MPIDI_CH3U_Buffer_copy(
 	/* --BEGIN ERROR HANDLING-- */
 	if (buf == NULL)
 	{
-	    MPIU_DBG_MSG(CH3_OTHER,TYPICAL,"SRBuf allocation failure");
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"SRBuf allocation failure");
 	    *smpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem", 0);
 	    *rmpi_errno = *smpi_errno;
 	    *rsz = 0;
@@ -162,11 +162,11 @@ void MPIDI_CH3U_Buffer_copy(
 		last = sdata_sz;
 	    }
 	    
-	    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                "pre-pack first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 
 						sfirst, last ));
 	    MPID_Segment_pack(&sseg, sfirst, &last, buf + buf_off);
-	    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                "post-pack first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 
                sfirst, last ));
 	    /* --BEGIN ERROR HANDLING-- */
@@ -176,11 +176,11 @@ void MPIDI_CH3U_Buffer_copy(
 	    buf_end = buf + buf_off + (last - sfirst);
 	    sfirst = last;
 	    
-	    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
              "pre-unpack first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 
 						rfirst, last ));
 	    MPID_Segment_unpack(&rseg, rfirst, &last, buf);
-	    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
              "post-unpack first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 
 						rfirst, last ));
 	    /* --BEGIN ERROR HANDLING-- */
@@ -207,7 +207,7 @@ void MPIDI_CH3U_Buffer_copy(
 	    buf_off = sfirst - rfirst;
 	    if (buf_off > 0)
 	    {
-		MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE, (MPIU_DBG_FDEST,
+		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPIU_DBG_FDEST,
                   "moved " MPIDI_MSG_SZ_FMT " bytes to the beginning of the tmp buffer", buf_off));
 		memmove(buf, buf_end - buf_off, buf_off);
 	    }
diff --git a/src/mpid/ch3/src/ch3u_comm.c b/src/mpid/ch3/src/ch3u_comm.c
index 7458f9a..c1b9bca 100644
--- a/src/mpid/ch3/src/ch3u_comm.c
+++ b/src/mpid/ch3/src/ch3u_comm.c
@@ -500,7 +500,7 @@ static int nonempty_intersection(MPID_Comm *comm, MPID_Group *group, int *flag)
     /* handle common case fast */
     if (comm == MPIR_Process.comm_world || comm == MPIR_Process.icomm_world) {
         *flag = TRUE;
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "comm is comm_world or icomm_world");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "comm is comm_world or icomm_world");
         goto fn_exit;
     }
     *flag = FALSE;
@@ -554,7 +554,7 @@ int MPIDI_CH3I_Comm_handle_failed_procs(MPID_Group *new_failed_procs)
         if (mpi_errno) MPIR_ERR_POP(mpi_errno);
 
         if (flag) {
-            MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE,
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
                              (MPIU_DBG_FDEST, "disabling AS on communicator %p (%#08x)",
                               comm, comm->handle));
             comm->dev.anysource_enabled = FALSE;
@@ -581,7 +581,7 @@ void MPIDI_CH3I_Comm_find(MPIU_Context_id_t context_id, MPID_Comm **comm)
         if ((*comm)->context_id == context_id || ((*comm)->context_id + MPID_CONTEXT_INTRA_COLL) == context_id ||
             ((*comm)->node_comm && ((*comm)->node_comm->context_id == context_id || ((*comm)->node_comm->context_id + MPID_CONTEXT_INTRA_COLL) == context_id)) ||
             ((*comm)->node_roots_comm && ((*comm)->node_roots_comm->context_id == context_id || ((*comm)->node_roots_comm->context_id + MPID_CONTEXT_INTRA_COLL) == context_id)) ) {
-            MPIU_DBG_MSG_D(CH3_OTHER,VERBOSE,"Found matching context id: %d", (*comm)->context_id);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"Found matching context id: %d", (*comm)->context_id);
             break;
         }
     }
diff --git a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
index 5a4fc17..5750439 100644
--- a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
+++ b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c
@@ -65,7 +65,7 @@ static int  mpi_to_pmi_keyvals( MPID_Info *info_ptr, PMI_keyval_t **kv_ptr,
 	}
 	MPIR_Info_get_impl( info_ptr, key, vallen+1, kv[i].val, &flag );
         MPIR_ERR_CHKANDJUMP1(!flag, mpi_errno, MPI_ERR_OTHER,"**infonokey", "**infonokey %s", key);
-	MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"key: <%s>, value: <%s>\n", kv[i].key, kv[i].val));
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"key: <%s>, value: <%s>\n", kv[i].key, kv[i].val));
     }
 
  fn_fail:
diff --git a/src/mpid/ch3/src/ch3u_eager.c b/src/mpid/ch3/src/ch3u_eager.c
index 13e200d..2e40923 100644
--- a/src/mpid/ch3/src/ch3u_eager.c
+++ b/src/mpid/ch3/src/ch3u_eager.c
@@ -99,7 +99,7 @@ int MPIDI_CH3_EagerNoncontigSend( MPID_Request **sreq_p,
     MPIDI_CH3_Pkt_t upkt;
     MPIDI_CH3_Pkt_eager_send_t * const eager_pkt = &upkt.eager_send;
     
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                      "sending non-contiguous eager message, data_sz=" MPIDI_MSG_SZ_FMT,
 					data_sz));
     sreq->dev.OnDataAvail = 0;
@@ -173,7 +173,7 @@ int MPIDI_CH3_EagerContigSend( MPID_Request **sreq_p,
     iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST)eager_pkt;
     iov[0].MPL_IOV_LEN = sizeof(*eager_pkt);
     
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 	       "sending contiguous eager message, data_sz=" MPIDI_MSG_SZ_FMT,
 					data_sz));
 	    
@@ -237,7 +237,7 @@ int MPIDI_CH3_EagerContigShortSend( MPID_Request **sreq_p,
     eagershort_pkt->match.parts.context_id = comm->context_id + context_offset;
     eagershort_pkt->data_sz	     = data_sz;
     
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
        "sending contiguous short eager message, data_sz=" MPIDI_MSG_SZ_FMT,
 					data_sz));
 	    
@@ -299,7 +299,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
     /* printf( "Receiving short eager!\n" ); fflush(stdout); */
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 	"received eagershort send pkt, rank=%d, tag=%d, context=%d",
 	eagershort_pkt->match.parts.rank, 
 	eagershort_pkt->match.parts.tag, 
@@ -354,7 +354,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 		data_sz = rreq->dev.recv_data_sz;
 	    }
 	    else {
-		MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 		    "receive buffer too small; message truncated, msg_sz=" 
 					  MPIDI_MSG_SZ_FMT ", userbuf_sz="
 				          MPIDI_MSG_SZ_FMT,
@@ -537,7 +537,7 @@ int MPIDI_CH3_EagerContigIsend( MPID_Request **sreq_p,
     MPID_Request *sreq = *sreq_p;
     MPL_IOV iov[MPL_IOV_LIMIT];
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 	       "sending contiguous eager message, data_sz=" MPIDI_MSG_SZ_FMT,
 					data_sz));
 	    
@@ -617,7 +617,7 @@ int MPIDI_CH3_PktHandler_EagerSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 	"received eager send pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d",
 	eager_pkt->sender_req_id, eager_pkt->match.parts.rank, 
 	eager_pkt->match.parts.tag, eager_pkt->match.parts.context_id));
@@ -705,7 +705,7 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPIDI_msg_sz_t data_len;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 	"received ready send pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d",
 			ready_pkt->sender_req_id, 
 			ready_pkt->match.parts.rank, 
@@ -824,14 +824,14 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_EagerSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... EAGER_SEND\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_send.sender_req_id));
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," context_id ... %d\n", pkt->eager_send.match.parts.context_id);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," tag .......... %d\n", pkt->eager_send.match.parts.tag);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," rank ......... %d\n", pkt->eager_send.match.parts.rank);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," data_sz ...... %d\n", pkt->eager_send.data_sz);
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGER_SEND\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_send.sender_req_id));
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->eager_send.match.parts.context_id);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->eager_send.match.parts.tag);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->eager_send.match.parts.rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->eager_send.data_sz);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," seqnum ....... %d\n", pkt->eager_send.seqnum);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->eager_send.seqnum);
 #endif
 }
 
@@ -840,13 +840,13 @@ int MPIDI_CH3_PktPrint_EagerShortSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
     int datalen;
     unsigned char *p = (unsigned char *)pkt->eagershort_send.data;
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... EAGERSHORT_SEND\n");
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," context_id ... %d\n", pkt->eagershort_send.match.parts.context_id);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," tag .......... %d\n", pkt->eagershort_send.match.parts.tag);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," rank ......... %d\n", pkt->eagershort_send.match.parts.rank);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," data_sz ...... %d\n", pkt->eagershort_send.data_sz);
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGERSHORT_SEND\n");
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->eagershort_send.match.parts.context_id);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->eagershort_send.match.parts.tag);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->eagershort_send.match.parts.rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->eagershort_send.data_sz);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," seqnum ....... %d\n", pkt->eagershort_send.seqnum);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->eagershort_send.seqnum);
 #endif
     datalen = pkt->eagershort_send.data_sz;
     if (datalen > 0) {
@@ -856,21 +856,21 @@ int MPIDI_CH3_PktPrint_EagerShortSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 	for (i=0; i<datalen; i++) {
 	    MPL_snprintf( &databytes[2*i], 64 - 2*i, "%2x", p[i] );
 	}
-	MPIU_DBG_MSG_S(CH3_OTHER,TERSE," data ......... %s\n", databytes);
+	MPIU_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,TERSE," data ......... %s\n", databytes);
     }
 }
 #endif /* defined(USE_EAGER_SHORT) */
 
 int MPIDI_CH3_PktPrint_ReadySend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... READY_SEND\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->ready_send.sender_req_id));
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," context_id ... %d\n", pkt->ready_send.match.parts.context_id);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," tag .......... %d\n", pkt->ready_send.match.parts.tag);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," rank ......... %d\n", pkt->ready_send.match.parts.rank);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," data_sz ...... %d\n", pkt->ready_send.data_sz);
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... READY_SEND\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->ready_send.sender_req_id));
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->ready_send.match.parts.context_id);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->ready_send.match.parts.tag);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->ready_send.match.parts.rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->ready_send.data_sz);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," seqnum ....... %d\n", pkt->ready_send.seqnum);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->ready_send.seqnum);
 #endif
 }
 
diff --git a/src/mpid/ch3/src/ch3u_eagersync.c b/src/mpid/ch3/src/ch3u_eagersync.c
index cd967ce..a3bbd94 100644
--- a/src/mpid/ch3/src/ch3u_eagersync.c
+++ b/src/mpid/ch3/src/ch3u_eagersync.c
@@ -64,7 +64,7 @@ int MPIDI_CH3_EagerSyncNoncontigSend( MPID_Request **sreq_p,
     if (dt_contig)
     {
         MPL_IOV iov[2];
-	MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                                             "sending contiguous sync eager message, data_sz=" MPIDI_MSG_SZ_FMT, 
 					    data_sz));
 	
@@ -89,7 +89,7 @@ int MPIDI_CH3_EagerSyncNoncontigSend( MPID_Request **sreq_p,
     }
     else
     {
-	MPIU_DBG_MSG_D(CH3_OTHER,VERBOSE,
+	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		       "sending non-contiguous sync eager message, data_sz=" MPIDI_MSG_SZ_FMT, 
 		       data_sz);
 	
@@ -125,7 +125,7 @@ int MPIDI_CH3_EagerSyncZero(MPID_Request **sreq_p, int rank, int tag,
     MPIDI_VC_t * vc;
     MPID_Request *sreq = *sreq_p;
     
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending zero length message");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
     
     /* MT FIXME what are the two operations we are waiting for?  the send and
      * the sync response? */
@@ -174,7 +174,7 @@ int MPIDI_CH3_EagerSyncAck( MPIDI_VC_t *vc, MPID_Request *rreq )
     MPIDI_CH3_Pkt_eager_sync_ack_t * const esa_pkt = &upkt.eager_sync_ack;
     MPID_Request * esa_req;
     
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending eager sync ack");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_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;
     MPID_THREAD_CS_ENTER(POBJ, vc->pobj_mutex);
@@ -223,7 +223,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPIDI_msg_sz_t data_len;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
      "received eager sync send pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d",
 	      es_pkt->sender_req_id, es_pkt->match.parts.rank, 
 	      es_pkt->match.parts.tag, 
@@ -286,7 +286,7 @@ int MPIDI_CH3_PktHandler_EagerSyncSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
                 *rreqp = rreq;
             }
 	}
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending eager sync ack");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_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;
@@ -352,7 +352,7 @@ int MPIDI_CH3_PktHandler_EagerSyncAck( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPID_Request * sreq;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
+    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 	   "received eager sync ack pkt, sreq=0x%08x", esa_pkt->sender_req_id);
 	    
     MPID_Request_get_ptr(esa_pkt->sender_req_id, sreq);
@@ -377,22 +377,22 @@ int MPIDI_CH3_PktHandler_EagerSyncAck( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_EagerSyncSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... EAGER_SYNC_SEND\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_sync_send.sender_req_id));
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," context_id ... %d\n", pkt->eager_sync_send.match.parts.context_id);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," tag .......... %d\n", pkt->eager_sync_send.match.parts.tag);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," rank ......... %d\n", pkt->eager_sync_send.match.parts.rank);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," data_sz ...... %d\n", pkt->eager_sync_send.data_sz);
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGER_SYNC_SEND\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_sync_send.sender_req_id));
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->eager_sync_send.match.parts.context_id);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->eager_sync_send.match.parts.tag);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->eager_sync_send.match.parts.rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->eager_sync_send.data_sz);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," seqnum ....... %d\n", pkt->eager_sync_send.seqnum);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->eager_sync_send.seqnum);
 #endif
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_EagerSyncAck( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... EAGER_SYNC_ACK\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_sync_ack.sender_req_id));
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... EAGER_SYNC_ACK\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->eager_sync_ack.sender_req_id));
     return MPI_SUCCESS;
 }
 #endif
diff --git a/src/mpid/ch3/src/ch3u_handle_connection.c b/src/mpid/ch3/src/ch3u_handle_connection.c
index 81a3ef8..fc1e822 100644
--- a/src/mpid/ch3/src/ch3u_handle_connection.c
+++ b/src/mpid/ch3/src/ch3u_handle_connection.c
@@ -65,7 +65,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
 
 		    /* MT: this is not thread safe */
 		    MPIDI_Outstanding_close_ops -= 1;
-		    MPIU_DBG_MSG_D(CH3_DISCONNECT,TYPICAL,
+		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
              "outstanding close operations = %d", MPIDI_Outstanding_close_ops);
 	    
 		    if (MPIDI_Outstanding_close_ops == 0)
@@ -81,7 +81,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
                     /* VC was terminated before it was activated.
                        This can happen if a failed process was
                        detected before the process used the VC. */
-                    MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL, "VC terminated before it was activated.  We probably got a failed"
+                    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "VC terminated before it was activated.  We probably got a failed"
                                  " process notification.");
                     MPIDI_CH3U_Complete_posted_with_error(vc);
                     ++MPIDI_Failed_vc_count;
@@ -97,7 +97,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
                        be outstanding sends or receives on the local
                        side, remote side or both. */
                     
- 		    MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL, "Connection closed prematurely.");
+                    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "Connection closed prematurely.");
 
                     MPIDI_CH3U_Complete_posted_with_error(vc);
                     ++MPIDI_Failed_vc_count;
@@ -124,7 +124,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
                        outstanding sends or receives on either
                        side. */
 
- 		    MPIU_DBG_MSG_D(CH3_DISCONNECT,TYPICAL, "Connection closed prematurely during close protocol.  "
+                    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "Connection closed prematurely during close protocol.  "
                                    "Outstanding close operations = %d", MPIDI_Outstanding_close_ops);
 
                     MPIDI_CH3U_Complete_posted_with_error(vc);
@@ -146,7 +146,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
 
 		default:
 		{
-		    MPIU_DBG_MSG_D(CH3_DISCONNECT,TYPICAL, "Unhandled connection state %d when closing connection",vc->state);
+		    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL, "Unhandled connection state %d when closing connection",vc->state);
 		    mpi_errno = MPIR_Err_create_code(
 			MPI_SUCCESS, MPIR_ERR_FATAL, FCNAME, __LINE__, 
                         MPI_ERR_INTERN, "**ch3|unhandled_connection_state",
@@ -233,7 +233,7 @@ int MPIDI_CH3U_VC_SendClose( MPIDI_VC_t *vc, int rank )
     /* 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,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,(MPIU_DBG_FDEST,
 		  "sending close(%s) on vc (pg=%p) %p to rank %d, ops = %d", 
 		  close_pkt->ack ? "TRUE" : "FALSE", vc->pg, vc, 
 		  rank, MPIDI_Outstanding_close_ops));
@@ -291,7 +291,7 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	MPIDI_Pkt_init(resp_pkt, MPIDI_CH3_PKT_CLOSE);
 	resp_pkt->ack = TRUE;
 	
-	MPIU_DBG_MSG_D(CH3_DISCONNECT,TYPICAL,"sending close(TRUE) to %d",
+	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"sending close(TRUE) to %d",
 		       vc->pg_rank);
 	mpi_errno = MPIDI_CH3_iStartMsg(vc, resp_pkt, sizeof(*resp_pkt), &resp_sreq);
         MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|send_close_ack");
@@ -308,7 +308,7 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     {
 	if (vc->state == MPIDI_VC_STATE_LOCAL_CLOSE)
 	{
-	    MPIU_DBG_MSG_D(CH3_DISCONNECT,TYPICAL,
+	    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
 		   "received close(FALSE) from %d, moving to CLOSE_ACKED.",
 		   vc->pg_rank);
             MPIDI_CHANGE_VC_STATE(vc, CLOSE_ACKED);
@@ -317,8 +317,8 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         {
 	    if (vc->state != MPIDI_VC_STATE_ACTIVE)
             {
-		MPIU_DBG_MSG_FMT(CH3_DISCONNECT, TYPICAL, (MPIU_DBG_FDEST, "Unexpected state %s in vc %p (rank=%d) (expecting MPIDI_VC_STATE_ACTIVE)\n", MPIDI_VC_GetStateString(vc->state), vc, vc->pg_rank ));
-	    MPIU_DBG_MSG_D(CH3_DISCONNECT,TYPICAL,
+		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT, TYPICAL, (MPIU_DBG_FDEST, "Unexpected state %s in vc %p (rank=%d) (expecting MPIDI_VC_STATE_ACTIVE)\n", MPIDI_VC_GetStateString(vc->state), vc, vc->pg_rank ));
+	    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
                      "received close(FALSE) from %d, moving to REMOTE_CLOSE.",
 				   vc->pg_rank);
             }
@@ -328,7 +328,7 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     }
     else /* (close_pkt->ack == TRUE) */
     {
-	MPIU_DBG_MSG_D(CH3_DISCONNECT,TYPICAL,
+	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
                        "received close(TRUE) from %d, moving to CLOSED.", 
 			       vc->pg_rank);
 	MPIU_Assert (vc->state == MPIDI_VC_STATE_LOCAL_CLOSE || 
@@ -349,8 +349,8 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_Close( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... MPIDI_CH3_PKT_CLOSE\n");
-    MPIU_DBG_MSG_S(CH3_OTHER,TERSE," ack ......... %s\n", pkt->close.ack ? "TRUE" : "FALSE");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_CLOSE\n");
+    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,TERSE," ack ......... %s\n", pkt->close.ack ? "TRUE" : "FALSE");
     return MPI_SUCCESS;
 }
 #endif
@@ -377,7 +377,7 @@ int MPIDI_CH3U_VC_WaitForClose( void )
 
     MPID_Progress_start(&progress_state);
     while(MPIDI_Outstanding_close_ops > 0) {
-	MPIU_DBG_MSG_D(CH3_DISCONNECT,TYPICAL,
+	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,
 		       "Waiting for %d close operations",
 		       MPIDI_Outstanding_close_ops);
 	mpi_errno = MPID_Progress_wait(&progress_state);
@@ -453,16 +453,16 @@ int MPIDI_CH3U_Get_failed_group(int last_rank, MPID_Group **failed_group)
 
     MPIDI_FUNC_ENTER(MPID_STATE_GET_FAILED_GROUP);
 
-    MPIU_DBG_MSG_D(CH3_OTHER, VERBOSE, "Getting failed group with %d as last acknowledged\n", last_rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, VERBOSE, "Getting failed group with %d as last acknowledged\n", last_rank);
 
     if (-1 == last_rank) {
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "No failure acknowledged");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "No failure acknowledged");
         *failed_group = MPID_Group_empty;
         goto fn_exit;
     }
 
     if (*MPIDI_failed_procs_string == '\0') {
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "Found no failed ranks");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "Found no failed ranks");
         *failed_group = MPID_Group_empty;
         goto fn_exit;
     }
@@ -476,7 +476,7 @@ int MPIDI_CH3U_Get_failed_group(int last_rank, MPID_Group **failed_group)
     while(1) {
         parse_rank(&rank);
         ++i;
-        MPIU_DBG_MSG_D(CH3_OTHER, VERBOSE, "Found failed rank: %d", rank);
+        MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, VERBOSE, "Found failed rank: %d", rank);
         utarray_push_back(failed_procs, &rank);
         MPIDI_last_known_failed = rank;
         MPIR_ERR_CHKINTERNAL(*c != ',' && *c != '\0', mpi_errno, "error parsing failed process list");
@@ -547,7 +547,7 @@ int MPIDI_CH3U_Check_for_failed_procs(void)
         goto fn_exit;
     }
 
-    MPIU_DBG_MSG_S(CH3_OTHER, TYPICAL, "Received proc fail notification: %s", MPIDI_failed_procs_string);
+    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_OTHER, TYPICAL, "Received proc fail notification: %s", MPIDI_failed_procs_string);
 
     /* save reference to previous group so we can identify new failures */
     prev_failed_group = MPIDI_Failed_procs_group;
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
index c069632..23d43fa 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
@@ -62,7 +62,7 @@ int MPIDI_CH3U_Handle_ordered_recv_pkt(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_HANDLE_ORDERED_RECV_PKT);
 
-    MPIU_DBG_STMT(CH3_OTHER,VERBOSE,MPIDI_DBG_Print_packet(pkt));
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,MPIDI_DBG_Print_packet(pkt));
 
     /* FIXME: We can turn this into something like
 
@@ -114,7 +114,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_RECEIVE_DATA_FOUND);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"posted request found");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
 	
     MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, 
 			    dt_contig, userbuf_sz, dt_ptr, dt_true_lb);
@@ -123,7 +123,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
 	data_sz = rreq->dev.recv_data_sz;
     }
     else {
-	MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                "receive buffer too small; message truncated, msg_sz=" MPIDI_MSG_SZ_FMT ", userbuf_sz="
 					    MPIDI_MSG_SZ_FMT,
 				 rreq->dev.recv_data_sz, userbuf_sz));
@@ -146,7 +146,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
            now, otherwise build an iov and let the channel unpack */
         if (*buflen >= data_sz)
         {
-            MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Copying contiguous data to user buffer");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Copying contiguous data to user buffer");
             /* copy data out of the receive buffer */
             if (rreq->dev.drop_data == FALSE) {
                 MPIU_Memcpy((char*)(rreq->dev.user_buf) + dt_true_lb, buf, data_sz);
@@ -156,7 +156,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
         }
         else
         {
-            MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"IOV loaded for contiguous read");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for contiguous read");
             
             rreq->dev.iov[0].MPL_IOV_BUF = 
                 (MPL_IOV_BUF_CAST)((char*)(rreq->dev.user_buf) + dt_true_lb);
@@ -187,7 +187,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
         if (data_sz == rreq->dev.recv_data_sz && *buflen >= data_sz)
         {
             MPIDI_msg_sz_t last;
-            MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Copying noncontiguous data to user buffer");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Copying noncontiguous data to user buffer");
             last = data_sz;
             MPID_Segment_unpack(rreq->dev.segment_ptr, rreq->dev.segment_first, 
 				&last, buf);
@@ -212,7 +212,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
         }
         else
         {   
-            MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"IOV loaded for non-contiguous read");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for non-contiguous read");
 
             mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
             if (mpi_errno != MPI_SUCCESS) {
@@ -246,7 +246,7 @@ int MPIDI_CH3U_Receive_data_unexpected(MPID_Request * rreq, char *buf, MPIDI_msg
        specialized buffer pool. */
     /* FIXME: to avoid memory exhaustion, integrate buffer pool management
        with flow control */
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"unexpected request allocated");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
     
     rreq->dev.tmpbuf = MPIU_Malloc(rreq->dev.recv_data_sz);
     if (!rreq->dev.tmpbuf) {
@@ -305,7 +305,7 @@ int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_POST_DATA_RECEIVE_FOUND);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"posted request found");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
 	
     MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, 
 			    dt_contig, userbuf_sz, dt_ptr, dt_true_lb);
@@ -314,7 +314,7 @@ int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
 	data_sz = rreq->dev.recv_data_sz;
     }
     else {
-	MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                "receive buffer too small; message truncated, msg_sz=" MPIDI_MSG_SZ_FMT ", userbuf_sz="
 					    MPIDI_MSG_SZ_FMT,
 				 rreq->dev.recv_data_sz, userbuf_sz));
@@ -332,7 +332,7 @@ int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
 	/* user buffer is contiguous and large enough to store the
 	   entire message.  However, we haven't yet *read* the data 
 	   (this code describes how to read the data into the destination) */
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"IOV loaded for contiguous read");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for contiguous read");
 	rreq->dev.iov[0].MPL_IOV_BUF = 
 	    (MPL_IOV_BUF_CAST)((char*)(rreq->dev.user_buf) + dt_true_lb);
 	rreq->dev.iov[0].MPL_IOV_LEN = data_sz;
@@ -345,7 +345,7 @@ int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
     else {
 	/* user buffer is not contiguous or is too small to hold
 	   the entire message */
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"IOV loaded for non-contiguous read");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"IOV loaded for non-contiguous read");
 	rreq->dev.segment_ptr = 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, 
@@ -381,7 +381,7 @@ int MPIDI_CH3U_Post_data_receive_unexpected(MPID_Request * rreq)
        specialized buffer pool. */
     /* FIXME: to avoid memory exhaustion, integrate buffer pool management
        with flow control */
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"unexpected request allocated");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
     
     rreq->dev.tmpbuf = MPIU_Malloc(rreq->dev.recv_data_sz);
     if (!rreq->dev.tmpbuf) {
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_req.c b/src/mpid/ch3/src/ch3u_handle_recv_req.c
index 4ef265e..fd421fa 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_req.c
@@ -677,7 +677,7 @@ int MPIDI_CH3_ReqHandler_AccumMetadataRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((un
     MPIDI_CH3U_SRBuf_alloc(rreq, MPIDI_CH3U_SRBuf_size);
     /* --BEGIN ERROR HANDLING-- */
     if (rreq->dev.tmpbuf_sz == 0) {
-        MPIU_DBG_MSG(CH3_CHANNEL, TYPICAL, "SRBuf allocation failure");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
         mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL,
                                          FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem",
                                          "**nomem %d", MPIDI_CH3U_SRBuf_size);
@@ -807,7 +807,7 @@ int MPIDI_CH3_ReqHandler_GaccumMetadataRecvComplete(MPIDI_VC_t * vc,
         MPIDI_CH3U_SRBuf_alloc(rreq, MPIDI_CH3U_SRBuf_size);
         /* --BEGIN ERROR HANDLING-- */
         if (rreq->dev.tmpbuf_sz == 0) {
-            MPIU_DBG_MSG(CH3_CHANNEL, TYPICAL, "SRBuf allocation failure");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
             mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL,
                                              FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem",
                                              "**nomem %d", MPIDI_CH3U_SRBuf_size);
diff --git a/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c b/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
index 559e75b..d6e6a22 100644
--- a/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
+++ b/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
@@ -17,7 +17,7 @@ int MPIDI_CH3_PktHandler_Revoke(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     int mpi_errno = MPI_SUCCESS;
     MPID_Comm *comm_ptr = NULL;
 
-    MPIU_DBG_MSG_D(CH3_OTHER, VERBOSE, "Received revoke pkt from %d", vc->pg_rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER, VERBOSE, "Received revoke pkt from %d", vc->pg_rank);
 
     /* Search through all of the communicators to find the right context_id */
     MPIDI_CH3I_Comm_find(revoke_pkt->revoked_comm, &comm_ptr);
diff --git a/src/mpid/ch3/src/ch3u_port.c b/src/mpid/ch3/src/ch3u_port.c
index dd4b313..45ff76c 100644
--- a/src/mpid/ch3/src/ch3u_port.c
+++ b/src/mpid/ch3/src/ch3u_port.c
@@ -216,7 +216,7 @@ static int MPIDI_Create_inter_root_communicator_accept(const char *port_name,
     *comm_pptr = tmp_comm;
     *vc_pptr = new_vc;
 
-    MPIU_DBG_MSG_FMT(CH3_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
 		  "new_vc=%p", new_vc));
 
 fn_exit:
@@ -389,7 +389,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
         send_ints[1] = local_comm_size;
         send_ints[2] = recvcontext_id;
 
-	MPIU_DBG_MSG_FMT(CH3_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
 		  "sending 3 ints, %d, %d and %d, and receiving 3 ints", 
                   send_ints[0], send_ints[1], send_ints[2]));
         mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0,
@@ -404,7 +404,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     }
 
     /* broadcast the received info to local processes */
-    MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"broadcasting the received 3 ints");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"broadcasting the received 3 ints");
     mpi_errno = MPIR_Bcast_intra(recv_ints, 3, MPI_INT, root, comm_ptr, &errflag);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
@@ -422,7 +422,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     MPIU_CHKLMEM_MALLOC(remote_translation,pg_translation*,
 			remote_comm_size * sizeof(pg_translation),
 			mpi_errno,"remote_translation");
-    MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"allocated remote process groups");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"allocated remote process groups");
 
     /* Exchange the process groups and their corresponding KVSes */
     if (rank == root)
@@ -432,7 +432,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 					n_remote_pgs, remote_pg );
 	/* Receive the translations from remote process rank to process group 
 	   index */
-	MPIU_DBG_MSG_FMT(CH3_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
                "sending %d ints, receiving %d ints", 
 	      local_comm_size * 2, remote_comm_size * 2));
 	mpi_errno = MPIC_Sendrecv(local_translation, local_comm_size * 2,
@@ -445,10 +445,10 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
 	}
 
 #ifdef MPICH_DBG_OUTPUT
-	MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"[%d]connect:Received remote_translation:\n", rank);
+	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]connect:Received remote_translation:\n", rank);
 	for (i=0; i<remote_comm_size; i++)
 	{
-	    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
+	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
 		i, remote_translation[i].pg_index, i, remote_translation[i].pg_rank));
 	}
 #endif
@@ -460,17 +460,17 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     }
 
     /* Broadcast out the remote rank translation array */
-    MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Broadcasting remote translation");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_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) MPIR_ERR_POP(mpi_errno);
     MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
 #ifdef MPICH_DBG_OUTPUT
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"[%d]connect:Received remote_translation after broadcast:\n", rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]connect:Received remote_translation after broadcast:\n", rank);
     for (i=0; i<remote_comm_size; i++)
     {
-	MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
 	    i, remote_translation[i].pg_index, i, remote_translation[i].pg_rank));
     }
 #endif
@@ -491,7 +491,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     /* synchronize with remote root */
     if (rank == root)
     {
-	MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"sync with peer");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"sync with peer");
         mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0,
                                      sendtag++, &j, 0, MPI_INT,
                                      0, recvtag++, tmp_comm,
@@ -516,7 +516,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     }
 
  fn_exit: 
-    MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Exiting ch3u_comm_connect");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Exiting ch3u_comm_connect");
     MPIU_CHKLMEM_FREEALL();
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_COMM_CONNECT);
     return mpi_errno;
@@ -547,7 +547,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
         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");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"broadcasting 3 ints: error case");
         mpi_errno2 = MPIR_Bcast_intra(recv_ints, 3, MPI_INT, root, comm_ptr, &errflag);
         if (mpi_errno2) MPIR_ERR_ADD(mpi_errno, mpi_errno2);
         if (errflag) {
@@ -611,7 +611,7 @@ static int ExtractLocalPGInfo( MPID_Comm *comm_p,
     if (mpi_errno != MPI_SUCCESS) {
 	MPIR_ERR_POP(mpi_errno);
     }
-    MPIU_DBG_STMT(CH3_CONNECT,VERBOSE,MPIDI_PrintConnStr(__FILE__,__LINE__,"PG as string is", pg_list->str ));
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,MPIDI_PrintConnStr(__FILE__,__LINE__,"PG as string is", pg_list->str ));
     local_translation[0].pg_index = 0;
     local_translation[0].pg_rank = comm_p->dev.vcrt->vcr_table[0]->pg_rank;
     pg_iter = pg_list;
@@ -658,7 +658,7 @@ static int ExtractLocalPGInfo( MPID_Comm *comm_p,
 #ifdef MPICH_DBG_OUTPUT
     pg_iter = pg_list;
     while (pg_iter != NULL) {
-	MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"connect:PG: '%s'\n<%s>\n", pg_iter->pg_id, pg_iter->str));
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"connect:PG: '%s'\n<%s>\n", pg_iter->pg_id, pg_iter->str));
 	pg_iter = pg_iter->next;
     }
 #endif
@@ -737,7 +737,7 @@ static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr,
 	/* 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 ));
+	MPIU_DBG_STMT(MPIDI_CH3_DBG_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) {
 	    MPIR_ERR_POP(mpi_errno);
@@ -1015,7 +1015,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     MPIU_CHKLMEM_MALLOC(remote_translation,pg_translation*,
 			remote_comm_size * sizeof(pg_translation),
 			mpi_errno, "remote_translation");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"[%d]accept:remote process groups: %d\nremote comm size: %d\n", rank, n_remote_pgs, remote_comm_size));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"[%d]accept:remote process groups: %d\nremote comm size: %d\n", rank, n_remote_pgs, remote_comm_size));
 
     /* Exchange the process groups and their corresponding KVSes */
     if (rank == root)
@@ -1035,10 +1035,10 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
 				  MPI_INT, 0, recvtag++, tmp_comm,
 				  MPI_STATUS_IGNORE, &errflag);
 #ifdef MPICH_DBG_OUTPUT
-	MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"[%d]accept:Received remote_translation:\n", rank);
+	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]accept:Received remote_translation:\n", rank);
 	for (i=0; i<remote_comm_size; i++)
 	{
-	    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
+	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
 		i, remote_translation[i].pg_index, i, remote_translation[i].pg_rank));
 	}
 #endif
@@ -1051,16 +1051,16 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     }
 
     /* Broadcast out the remote rank translation array */
-    MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Broadcast remote_translation");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_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) MPIR_ERR_POP(mpi_errno);
     MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 #ifdef MPICH_DBG_OUTPUT
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"[%d]accept:Received remote_translation after broadcast:\n", rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"[%d]accept:Received remote_translation after broadcast:\n", rank);
     for (i=0; i<remote_comm_size; i++)
     {
-	MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," remote_translation[%d].pg_index = %d\n remote_translation[%d].pg_rank = %d\n",
 	    i, remote_translation[i].pg_index, i, remote_translation[i].pg_rank));
     }
 #endif
@@ -1080,7 +1080,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     /* synchronize with remote root */
     if (rank == root)
     {
-	MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"sync with peer");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"sync with peer");
         mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0,
                                      sendtag++, &j, 0, MPI_INT,
                                      0, recvtag++, tmp_comm,
@@ -1093,7 +1093,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
         MPIR_Comm_release(tmp_comm);
     }
 
-    MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Barrier");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Barrier");
     mpi_errno = MPIR_Barrier_intra(comm_ptr, &errflag);
     if (mpi_errno != MPI_SUCCESS) {
 	MPIR_ERR_POP(mpi_errno);
@@ -1181,7 +1181,7 @@ static int SetupNewIntercomm( MPID_Comm *comm_ptr, int remote_comm_size,
     mpi_errno = MPIR_Comm_commit(intercomm);
     if (mpi_errno) MPIR_ERR_POP(mpi_errno);
     
-    MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Barrier");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Barrier");
     mpi_errno = MPIR_Barrier_intra(comm_ptr, &errflag);
     if (mpi_errno != MPI_SUCCESS) {
 	MPIR_ERR_POP(mpi_errno);
@@ -1290,7 +1290,7 @@ int MPIDI_CH3I_Acceptq_enqueue(MPIDI_VC_t * vc, int port_name_tag )
 	maxAcceptQueueSize = AcceptQueueSize;
 
     /* FIXME: Stack or queue? */
-    MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"vc=%p:Enqueuing accept connection",vc);
+    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"vc=%p:Enqueuing accept connection",vc);
     q_item->next = acceptq_head;
     acceptq_head = q_item;
     
@@ -1342,7 +1342,7 @@ int MPIDI_CH3I_Acceptq_dequeue(MPIDI_VC_t ** vc, int port_name_tag)
     
     mpi_errno = MPIDI_CH3_Complete_Acceptq_dequeue(*vc);
 
-    MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,
 	      (MPIU_DBG_FDEST,"vc=%p:Dequeuing accept connection with tag %d",
 	       *vc,port_name_tag));
 
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index 57a1eaa..9269f3f 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -817,7 +817,7 @@ MPID_Request * MPIDI_CH3U_Recvq_FDP_or_AEU(MPIDI_Message_match * match,
             MPIDI_Request_create_null_rreq( rreq, mpi_errno, found=FALSE;goto lock_exit );
             MPIU_Assert(mpi_errno == MPI_SUCCESS);
 
-            MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE,
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
                 (MPIU_DBG_FDEST, "RECEIVED MESSAGE FOR REVOKED COMM (tag=%d,src=%d,cid=%d)\n", MPIR_TAG_MASK_ERROR_BITS(match->parts.tag), match->parts.rank, comm_ptr->context_id));
             return rreq;
         }
@@ -893,7 +893,7 @@ static inline void dequeue_and_set_error(MPID_Request **req,  MPID_Request *prev
     /* set error and complete */
     (*req)->status.MPI_ERROR = *error;
     MPID_Request_complete(*req);
-    MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE,
                      (MPIU_DBG_FDEST, "set error of req %p (%#08x) to %#x and completing.",
                       *req, (*req)->handle, *error));
     *req = next;
@@ -939,7 +939,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
         match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_PT2PT;
 
         if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
-            MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                         "cleaning up unexpected pt2pt pkt rank=%d tag=%d contextid=%d",
                         rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
             dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -951,7 +951,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
         if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
             if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                 MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                             "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
                             rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                 dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -967,7 +967,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                                 "cleaning up unexpected pt2pt pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -981,7 +981,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                                 "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -995,7 +995,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                                 "cleaning up unexpected pt2pt pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -1009,7 +1009,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                                 "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
@@ -1031,7 +1031,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
         match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_PT2PT;
 
         if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
-            MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                         "cleaning up posted pt2pt pkt rank=%d tag=%d contextid=%d",
                         rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
             dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
@@ -1043,7 +1043,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
         if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
             if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                 MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                             "cleaning up posted collective pkt rank=%d tag=%d contextid=%d",
                             rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                 dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
@@ -1059,7 +1059,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                                 "cleaning up posted pt2pt pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
@@ -1073,7 +1073,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                                 "cleaning up posted collective pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
@@ -1087,7 +1087,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                                 "cleaning up posted pt2pt pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
@@ -1101,7 +1101,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
             if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
                 if (MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_AGREE_TAG &&
                     MPIR_TAG_MASK_ERROR_BITS(rreq->dev.match.parts.tag) != MPIR_SHRINK_TAG) {
-                    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+                    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                                 "cleaning up posted collective pkt rank=%d tag=%d contextid=%d",
                                 rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
                     dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
diff --git a/src/mpid/ch3/src/ch3u_request.c b/src/mpid/ch3/src/ch3u_request.c
index 6a6605a..cbb493d 100644
--- a/src/mpid/ch3/src/ch3u_request.c
+++ b/src/mpid/ch3/src/ch3u_request.c
@@ -45,7 +45,7 @@ MPID_Request * MPID_Request_create(void)
     req = MPIU_Handle_obj_alloc(&MPID_Request_mem);
     if (req != NULL)
     {
-	MPIU_DBG_MSG_P(CH3_CHANNEL,VERBOSE,
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 		       "allocated request, handle=0x%08x", req->handle);
 #ifdef MPICH_DBG_OUTPUT
 	/*MPIU_Assert(HANDLE_GET_MPI_KIND(req->handle) == MPID_REQUEST);*/
@@ -109,7 +109,7 @@ MPID_Request * MPID_Request_create(void)
     else
     {
 	/* FIXME: This fails to fail if debugging is turned off */
-	MPIU_DBG_MSG(CH3_CHANNEL,TYPICAL,"unable to allocate a request");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"unable to allocate a request");
     }
     
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_REQUEST_CREATE);
@@ -147,7 +147,7 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_REQUEST_LOAD_SEND_IOV);
     MPIU_Assert(sreq->dev.segment_ptr != NULL);
     last = sreq->dev.segment_size;
-    MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
      "pre-pv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d",
 		      sreq->dev.segment_first, last, *iov_n));
     MPIU_Assert(sreq->dev.segment_first < last);
@@ -155,19 +155,19 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
     MPIU_Assert(*iov_n > 0 && *iov_n <= MPL_IOV_LIMIT);
     MPID_Segment_pack_vector(sreq->dev.segment_ptr, sreq->dev.segment_first, 
 			     &last, iov, iov_n);
-    MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
     "post-pv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d",
 		      sreq->dev.segment_first, last, *iov_n));
     MPIU_Assert(*iov_n > 0 && *iov_n <= MPL_IOV_LIMIT);
     
     if (last == sreq->dev.segment_size)
     {
-	MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"remaining data loaded into IOV");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"remaining data loaded into IOV");
 	sreq->dev.OnDataAvail = sreq->dev.OnFinal;
     }
     else if ((last - sreq->dev.segment_first) / *iov_n >= MPIDI_IOV_DENSITY_MIN)
     {
-	MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"more data loaded into IOV");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"more data loaded into IOV");
 	sreq->dev.segment_first = last;
 	sreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_SendReloadIOV;
     }
@@ -176,7 +176,7 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
 	MPIDI_msg_sz_t data_sz;
 	int i, iov_data_copied;
 	
-	MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"low density.  using SRBuf.");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"low density.  using SRBuf.");
 	    
 	data_sz = sreq->dev.segment_size - sreq->dev.segment_first;
 	if (!MPIDI_Request_get_srbuf_flag(sreq))
@@ -185,7 +185,7 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
 	    /* --BEGIN ERROR HANDLING-- */
 	    if (sreq->dev.tmpbuf_sz == 0)
 	    {
-		MPIU_DBG_MSG(CH3_CHANNEL,TYPICAL,"SRBuf allocation failure");
+		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"SRBuf allocation failure");
 		mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, 
                                 FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem", 
 						 "**nomem %d", data_sz);
@@ -206,12 +206,12 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
 	last = (data_sz <= sreq->dev.tmpbuf_sz - iov_data_copied) ? 
 	    sreq->dev.segment_size :
 	    sreq->dev.segment_first + sreq->dev.tmpbuf_sz - iov_data_copied;
-	MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
                "pre-pack: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT,
 			  sreq->dev.segment_first, last));
 	MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, 
 			  &last, (char*) sreq->dev.tmpbuf + iov_data_copied);
-	MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
               "post-pack: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT,
 			   sreq->dev.segment_first, last));
 	iov[0].MPL_IOV_BUF = (MPL_IOV_BUF_CAST)sreq->dev.tmpbuf;
@@ -219,12 +219,12 @@ int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
 	*iov_n = 1;
 	if (last == sreq->dev.segment_size)
 	{
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"remaining data packed into SRBuf");
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"remaining data packed into SRBuf");
 	    sreq->dev.OnDataAvail = sreq->dev.OnFinal;
 	}
 	else 
 	{
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"more data packed into SRBuf");
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"more data packed into SRBuf");
 	    sreq->dev.segment_first = last;
 	    sreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_SendReloadIOV;
 	}
@@ -299,14 +299,14 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 	    if (rreq->dev.segment_first - orig_segment_first + data_sz + rreq->dev.tmpbuf_off ==
 		rreq->dev.recv_data_sz)
 	    {
-		MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 		  "updating rreq to read the remaining data into the SRBuf");
 		rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_UnpackSRBufComplete;
                 orig_segment_first = MPIDI_LOAD_RECV_IOV_ORIG_SEGMENT_FIRST_UNSET;
 	    }
 	    else
 	    {
-		MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 		       "updating rreq to read more data into the SRBuf");
 		rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_UnpackSRBufReloadIOV;
 	    }
@@ -316,7 +316,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 	last = rreq->dev.segment_size;
 	rreq->dev.iov_count = MPL_IOV_LIMIT;
 	rreq->dev.iov_offset = 0;
-	MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
    "pre-upv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d",
 			  rreq->dev.segment_first, last, rreq->dev.iov_count));
 	MPIU_Assert(rreq->dev.segment_first < last);
@@ -324,7 +324,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 	MPID_Segment_unpack_vector(rreq->dev.segment_ptr, 
 				   rreq->dev.segment_first,
 				   &last, &rreq->dev.iov[0], &rreq->dev.iov_count);
-	MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
    "post-upv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d, iov_offset=%lld",
 			  rreq->dev.segment_first, last, rreq->dev.iov_count, (long long)rreq->dev.iov_offset));
 	MPIU_Assert(rreq->dev.iov_count >= 0 && rreq->dev.iov_count <= 
@@ -353,7 +353,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 
 	if (last == rreq->dev.recv_data_sz + orig_segment_first)
 	{
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
      "updating rreq to read the remaining data directly into the user buffer");
 	    /* Eventually, use OnFinal for this instead */
 	    rreq->dev.OnDataAvail = rreq->dev.OnFinal;
@@ -364,7 +364,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
                  (last == rreq->dev.segment_size ||
                   (last - rreq->dev.segment_first) / rreq->dev.iov_count >= MPIDI_IOV_DENSITY_MIN))
 	{
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 	     "updating rreq to read more data directly into the user buffer");
 	    rreq->dev.segment_first = last;
 	    rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_ReloadIOV;
@@ -385,7 +385,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 		/* FIXME - we should drain the data off the pipe here, but we 
 		   don't have a buffer to drain it into.  should this be
 		   a fatal error? */
-		MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"SRBuf allocation failure");
+		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,"SRBuf allocation failure");
 		mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, 
 			      FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem", 
 			 "**nomem %d", 
@@ -412,7 +412,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 	    /* --BEGIN ERROR HANDLING-- */
 	    if (rreq->dev.tmpbuf_sz == 0)
 	    {
-		MPIU_DBG_MSG(CH3_CHANNEL,TYPICAL,"SRBuf allocation failure");
+		MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,TYPICAL,"SRBuf allocation failure");
 		mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, 
 			       FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem", 0);
 		rreq->status.MPI_ERROR = mpi_errno;
@@ -423,7 +423,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 
 	if (data_sz <= rreq->dev.tmpbuf_sz)
 	{
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 	    "updating rreq to read overflow data into the SRBuf and complete");
 	    rreq->dev.iov[0].MPL_IOV_LEN = data_sz;
 	    MPIU_Assert(MPIDI_Request_get_type(rreq) == MPIDI_REQUEST_TYPE_RECV);
@@ -433,7 +433,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
 	}
 	else
 	{
-	    MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
 	  "updating rreq to read overflow data into the SRBuf and reload IOV");
 	    rreq->dev.iov[0].MPL_IOV_LEN = rreq->dev.tmpbuf_sz;
 	    rreq->dev.segment_first += rreq->dev.tmpbuf_sz;
@@ -558,7 +558,7 @@ int MPIDI_CH3U_Request_unpack_uebuf(MPID_Request * rreq)
     else
     {
 	/* --BEGIN ERROR HANDLING-- */
-	MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
       "receive buffer overflow; message truncated, msg_sz=" MPIDI_MSG_SZ_FMT 
 	      ", buf_sz=" MPIDI_MSG_SZ_FMT, 
                 rreq->dev.recv_data_sz, userbuf_sz));
@@ -648,7 +648,7 @@ void MPID_Request_release(MPID_Request *req)
 
     MPIR_Request_release_ref(req, &inuse);
     if (inuse == 0) {
-        MPIU_DBG_MSG_P(CH3_CHANNEL,VERBOSE,
+        MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CHANNEL,VERBOSE,
                        "freeing request, handle=0x%08x", req->handle);
 
 #ifdef MPICH_DBG_OUTPUT
diff --git a/src/mpid/ch3/src/ch3u_rma_pkthandler.c b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
index bd5e94d..5466d15 100644
--- a/src/mpid/ch3/src/ch3u_rma_pkthandler.c
+++ b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
@@ -272,7 +272,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_PUT);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received put pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received put pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_put);
 
@@ -448,7 +448,7 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received get pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received get pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_get);
 
@@ -662,7 +662,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACCUMULATE);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received accumulate pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received accumulate pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_acc);
 
@@ -755,7 +755,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                 MPIDI_CH3U_SRBuf_alloc(req, MPIDI_CH3U_SRBuf_size);
                 /* --BEGIN ERROR HANDLING-- */
                 if (req->dev.tmpbuf_sz == 0) {
-                    MPIU_DBG_MSG(CH3_CHANNEL, TYPICAL, "SRBuf allocation failure");
+                    MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
                     mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL,
                                                      FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem",
                                                      "**nomem %d", MPIDI_CH3U_SRBuf_size);
@@ -873,7 +873,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GETACCUMULATE);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received accumulate pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received accumulate pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_get_accum);
 
@@ -1042,7 +1042,7 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
                     MPIDI_CH3U_SRBuf_alloc(req, MPIDI_CH3U_SRBuf_size);
                     /* --BEGIN ERROR HANDLING-- */
                     if (req->dev.tmpbuf_sz == 0) {
-                        MPIU_DBG_MSG(CH3_CHANNEL, TYPICAL, "SRBuf allocation failure");
+                        MPIU_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, TYPICAL, "SRBuf allocation failure");
                         mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL,
                                                          FCNAME, __LINE__, MPI_ERR_OTHER, "**nomem",
                                                          "**nomem %d", MPIDI_CH3U_SRBuf_size);
@@ -1160,7 +1160,7 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_CAS);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received CAS pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received CAS pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_cas);
 
@@ -1270,7 +1270,7 @@ int MPIDI_CH3_PktHandler_CASResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_CASRESP);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received CAS response pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received CAS response pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_cas_resp);
 
@@ -1334,7 +1334,7 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_FOP);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received FOP pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received FOP pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_fop);
 
@@ -1523,7 +1523,7 @@ int MPIDI_CH3_PktHandler_FOPResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_FOPRESP);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received FOP response pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received FOP response pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_fop_resp);
 
@@ -1612,7 +1612,7 @@ int MPIDI_CH3_PktHandler_Get_AccumResp(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET_ACCUM_RESP);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received Get-Accumulate response pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received Get-Accumulate response pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_get_accum_resp);
 
@@ -1745,7 +1745,7 @@ int MPIDI_CH3_PktHandler_Lock(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCK);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received lock pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received lock pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_lock);
 
@@ -1806,7 +1806,7 @@ int MPIDI_CH3_PktHandler_GetResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GETRESP);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received get response pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received get response pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_get_resp);
 
@@ -1887,7 +1887,7 @@ int MPIDI_CH3_PktHandler_LockAck(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKACK);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received lock ack pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received lock ack pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_lock_ack);
 
@@ -1990,7 +1990,7 @@ int MPIDI_CH3_PktHandler_Ack(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACK);
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received shared lock ops done pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received shared lock ops done pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_ack);
 
@@ -2071,7 +2071,7 @@ int MPIDI_CH3_PktHandler_Unlock(MPIDI_VC_t * vc ATTRIBUTE((unused)),
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_UNLOCK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_UNLOCK);
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received unlock pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received unlock pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_unlock);
 
@@ -2114,7 +2114,7 @@ int MPIDI_CH3_PktHandler_Flush(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_FLUSH);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_FLUSH);
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received flush pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER, VERBOSE, "received flush pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_flush);
 
@@ -2147,76 +2147,76 @@ int MPIDI_CH3_PktHandler_Flush(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_Put(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... MPIDI_CH3_PKT_PUT\n");
-    MPIU_DBG_MSG_P(CH3_OTHER,TERSE," addr ......... %p\n", pkt->put.addr);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," count ........ %d\n", pkt->put.count);
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," datatype ..... 0x%08X\n", pkt->put.datatype));
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," dataloop_size. 0x%08X\n", pkt->put.info.dataloop_size));
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->put.target_win_handle));
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->put.source_win_handle));
-    /*MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->put.win_ptr)); */
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_PUT\n");
+    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,TERSE," addr ......... %p\n", pkt->put.addr);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," count ........ %d\n", pkt->put.count);
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," datatype ..... 0x%08X\n", pkt->put.datatype));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," dataloop_size. 0x%08X\n", pkt->put.info.dataloop_size));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->put.target_win_handle));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->put.source_win_handle));
+    /*MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->put.win_ptr)); */
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_Get(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... MPIDI_CH3_PKT_GET\n");
-    MPIU_DBG_MSG_P(CH3_OTHER,TERSE," addr ......... %p\n", pkt->get.addr);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," count ........ %d\n", pkt->get.count);
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," datatype ..... 0x%08X\n", pkt->get.datatype));
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," dataloop_size. %d\n", pkt->get.info.dataloop_size);
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get.request_handle));
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->get.target_win_handle));
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->get.source_win_handle));
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_GET\n");
+    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,TERSE," addr ......... %p\n", pkt->get.addr);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," count ........ %d\n", pkt->get.count);
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," datatype ..... 0x%08X\n", pkt->get.datatype));
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," dataloop_size. %d\n", pkt->get.info.dataloop_size);
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get.request_handle));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->get.target_win_handle));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->get.source_win_handle));
     /*
-     * MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get.request));
-     * MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->get.win_ptr));
+     * MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get.request));
+     * MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->get.win_ptr));
      */
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_GetResp(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... MPIDI_CH3_PKT_GET_RESP\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get_resp.request_handle));
-    /*MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get_resp.request)); */
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_GET_RESP\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get_resp.request_handle));
+    /*MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," request ...... 0x%08X\n", pkt->get_resp.request)); */
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_Accumulate(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... MPIDI_CH3_PKT_ACCUMULATE\n");
-    MPIU_DBG_MSG_P(CH3_OTHER,TERSE," addr ......... %p\n", pkt->accum.addr);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," count ........ %d\n", pkt->accum.count);
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," datatype ..... 0x%08X\n", pkt->accum.datatype));
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," dataloop_size. %d\n", pkt->accum.info.dataloop_size);
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," op ........... 0x%08X\n", pkt->accum.op));
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->accum.target_win_handle));
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->accum.source_win_handle));
-    /*MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->accum.win_ptr)); */
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_ACCUMULATE\n");
+    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,TERSE," addr ......... %p\n", pkt->accum.addr);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," count ........ %d\n", pkt->accum.count);
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," datatype ..... 0x%08X\n", pkt->accum.datatype));
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," dataloop_size. %d\n", pkt->accum.info.dataloop_size);
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," op ........... 0x%08X\n", pkt->accum.op));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->accum.target_win_handle));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->accum.source_win_handle));
+    /*MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," win_ptr ...... 0x%08X\n", pkt->accum.win_ptr)); */
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_Lock(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... MPIDI_CH3_PKT_LOCK\n");
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," lock_type .... %d\n", pkt->lock.lock_type);
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->lock.target_win_handle));
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->lock.source_win_handle));
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_LOCK\n");
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," lock_type .... %d\n", pkt->lock.lock_type);
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," target ....... 0x%08X\n", pkt->lock.target_win_handle));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->lock.source_win_handle));
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_Ack(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... MPIDI_CH3_PKT_ACK\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->ack.source_win_handle));
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_ACK\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->ack.source_win_handle));
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_LockAck(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... MPIDI_CH3_PKT_LOCK_ACK\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->lock_ack.source_win_handle));
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_LOCK_ACK\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->lock_ack.source_win_handle));
     return MPI_SUCCESS;
 }
 #endif
diff --git a/src/mpid/ch3/src/ch3u_rndv.c b/src/mpid/ch3/src/ch3u_rndv.c
index d4360ae..d2949a1 100644
--- a/src/mpid/ch3/src/ch3u_rndv.c
+++ b/src/mpid/ch3/src/ch3u_rndv.c
@@ -29,7 +29,7 @@ int MPIDI_CH3_RndvSend( MPID_Request **sreq_p, const void * buf, MPI_Aint count,
     MPID_Request *sreq =*sreq_p;
     int          mpi_errno = MPI_SUCCESS;
 	
-    MPIU_DBG_MSG_D(CH3_OTHER,VERBOSE,
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		   "sending rndv RTS, data_sz=" MPIDI_MSG_SZ_FMT, data_sz);
 
     sreq->dev.OnDataAvail = 0;
@@ -115,7 +115,7 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPIDI_CH3_Pkt_rndv_req_to_send_t * rts_pkt = &pkt->rndv_req_to_send;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
  "received rndv 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, 
@@ -148,12 +148,12 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 	MPIDI_CH3_Pkt_t upkt;
 	MPIDI_CH3_Pkt_rndv_clr_to_send_t * cts_pkt = &upkt.rndv_clr_to_send;
 	
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"posted request found");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"posted request found");
 	
 	/* FIXME: What if the receive user buffer is not big enough to
 	   hold the data about to be cleared for sending? */
 	
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending rndv CTS packet");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending rndv CTS packet");
 	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;
@@ -170,7 +170,7 @@ int MPIDI_CH3_PktHandler_RndvReqToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     }
     else
     {
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"unexpected request allocated");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"unexpected request allocated");
 	
 	/*
 	 * A MPID_Probe() may be waiting for the request we just 
@@ -209,10 +209,10 @@ int MPIDI_CH3_PktHandler_RndvClrToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPID_Datatype * dt_ptr;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received rndv CTS pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received rndv CTS pkt");
     
     MPID_Request_get_ptr(cts_pkt->sender_req_id, sreq);
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"received cts, count=" MPI_AINT_FMT_DEC_SPEC "\n", sreq->dev.user_count));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"received cts, count=" MPI_AINT_FMT_DEC_SPEC "\n", sreq->dev.user_count));
 
     sreq->dev.OnDataAvail = 0;
     sreq->dev.OnFinal = 0;
@@ -241,7 +241,7 @@ int MPIDI_CH3_PktHandler_RndvClrToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     {
 	MPL_IOV iov[MPL_IOV_LIMIT];
 
-	MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 		    "sending contiguous rndv data, data_sz=" MPIDI_MSG_SZ_FMT, 
 					    data_sz));
 	
@@ -290,7 +290,7 @@ int MPIDI_CH3_PktHandler_RndvSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPIDI_msg_sz_t data_len;
     MPID_Request *req;
     
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received rndv send (data) pkt");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"received rndv send (data) pkt");
 
     MPID_Request_get_ptr(rs_pkt->receiver_req_id, req);
 
@@ -352,7 +352,7 @@ int MPIDI_CH3_RecvRndv( MPIDI_VC_t * vc, MPID_Request *rreq )
     MPIDI_CH3_Pkt_t upkt;
     MPIDI_CH3_Pkt_rndv_clr_to_send_t * cts_pkt = &upkt.rndv_clr_to_send;
     
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		 "rndv RTS in the request, sending rndv CTS");
     
     MPIDI_Pkt_init(cts_pkt, MPIDI_CH3_PKT_RNDV_CLR_TO_SEND);
@@ -383,28 +383,28 @@ int MPIDI_CH3_RecvRndv( MPIDI_VC_t * vc, MPID_Request *rreq )
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_RndvReqToSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... REQ_TO_SEND\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->rndv_req_to_send.sender_req_id));
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," context_id ... %d\n", pkt->rndv_req_to_send.match.parts.context_id);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," tag .......... %d\n", pkt->rndv_req_to_send.match.parts.tag);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," rank ......... %d\n", pkt->rndv_req_to_send.match.parts.rank);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," data_sz ...... %d\n", pkt->rndv_req_to_send.data_sz);
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... REQ_TO_SEND\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->rndv_req_to_send.sender_req_id));
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->rndv_req_to_send.match.parts.context_id);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->rndv_req_to_send.match.parts.tag);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->rndv_req_to_send.match.parts.rank);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," data_sz ...... %d\n", pkt->rndv_req_to_send.data_sz);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," seqnum ....... %d\n", pkt->rndv_req_to_send.seqnum);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," seqnum ....... %d\n", pkt->rndv_req_to_send.seqnum);
 #endif
     return MPI_SUCCESS;
 }
 int MPIDI_CH3_PktPrint_RndvClrToSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... CLR_TO_SEND\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->rndv_clr_to_send.sender_req_id));
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," recvr_reqid .. 0x%08X\n", pkt->rndv_clr_to_send.receiver_req_id));
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... CLR_TO_SEND\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->rndv_clr_to_send.sender_req_id));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," recvr_reqid .. 0x%08X\n", pkt->rndv_clr_to_send.receiver_req_id));
     return MPI_SUCCESS;
 }
 int MPIDI_CH3_PktPrint_RndvSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... RNDV_SEND\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," recvr_reqid .. 0x%08X\n", pkt->rndv_send.receiver_req_id));
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... RNDV_SEND\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," recvr_reqid .. 0x%08X\n", pkt->rndv_send.receiver_req_id));
     return MPI_SUCCESS;
 }
 #endif
diff --git a/src/mpid/ch3/src/mpid_cancel_recv.c b/src/mpid/ch3/src/mpid_cancel_recv.c
index 4bba002..11477af 100644
--- a/src/mpid/ch3/src/mpid_cancel_recv.c
+++ b/src/mpid/ch3/src/mpid_cancel_recv.c
@@ -36,7 +36,7 @@ int MPID_Cancel_recv(MPID_Request * rreq)
 
     if (netmod_cancelled && MPIDI_CH3U_Recvq_DP(rreq))
     {
-	MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		       "request 0x%08x cancelled", rreq->handle);
         MPIR_STATUS_SET_CANCEL_BIT(rreq->status, TRUE);
         MPIR_STATUS_SET_COUNT(rreq->status, 0);
@@ -47,7 +47,7 @@ int MPID_Cancel_recv(MPID_Request * rreq)
     }
     else
     {
-	MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 	    "request 0x%08x already matched, unable to cancel", rreq->handle);
     }
 
diff --git a/src/mpid/ch3/src/mpid_cancel_send.c b/src/mpid/ch3/src/mpid_cancel_send.c
index 3aaef9b..e4fbe73 100644
--- a/src/mpid/ch3/src/mpid_cancel_send.c
+++ b/src/mpid/ch3/src/mpid_cancel_send.c
@@ -53,7 +53,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
     {
 	MPID_Request * rreq;
 	
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		     "attempting to cancel message sent to self");
 	
 	MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
@@ -63,7 +63,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
 	{
 	    MPIU_Assert(rreq->partner_request == sreq);
 	    
-	    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
              "send-to-self cancellation successful, sreq=0x%08x, rreq=0x%08x",
 						sreq->handle, rreq->handle));
 
@@ -84,7 +84,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
 	else
 	{
 	    MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
-	    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                "send-to-self cancellation failed, sreq=0x%08x, rreq=0x%08x",
 						sreq->handle, rreq->handle));
 	}
@@ -174,7 +174,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
 	MPIDI_CH3_Pkt_cancel_send_req_t * const csr_pkt = &upkt.cancel_send_req;
 	MPID_Request * csr_sreq;
 	
-	MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
               "sending cancel request to %d for 0x%08x", 
 	      sreq->dev.match.parts.rank, sreq->handle));
 	
@@ -237,7 +237,7 @@ int MPIDI_CH3_PktHandler_CancelSendReq( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPID_Request * resp_sreq;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
       "received cancel send req pkt, sreq=0x%08x, rank=%d, tag=%d, context=%d",
 		      req_pkt->sender_req_id, req_pkt->match.parts.rank, 
 		      req_pkt->match.parts.tag, req_pkt->match.parts.context_id));
@@ -249,7 +249,7 @@ int MPIDI_CH3_PktHandler_CancelSendReq( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     rreq = MPIDI_CH3U_Recvq_FDU(req_pkt->sender_req_id, &req_pkt->match);
     if (rreq != NULL)
     {
-	MPIU_DBG_MSG(CH3_OTHER,TYPICAL,"message cancelled");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"message cancelled");
 	if (MPIDI_Request_get_msg_type(rreq) == MPIDI_REQUEST_EAGER_MSG && rreq->dev.recv_data_sz > 0)
 	{
 	    MPIU_Free(rreq->dev.tmpbuf);
@@ -263,7 +263,7 @@ int MPIDI_CH3_PktHandler_CancelSendReq( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     }
     else
     {
-	MPIU_DBG_MSG(CH3_OTHER,TYPICAL,"unable to cancel message");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"unable to cancel message");
 	ack = FALSE;
     }
     
@@ -297,7 +297,7 @@ int MPIDI_CH3_PktHandler_CancelSendResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
     MPID_Request * sreq;
     int mpi_errno = MPI_SUCCESS;
     
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 			"received cancel send resp pkt, sreq=0x%08x, ack=%d",
 			resp_pkt->sender_req_id, resp_pkt->ack));
 	    
@@ -319,12 +319,12 @@ int MPIDI_CH3_PktHandler_CancelSendResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
 	    MPIDI_CH3U_Request_decrement_cc(sreq, &cc);
 	}
 		
-	MPIU_DBG_MSG(CH3_OTHER,TYPICAL,"message cancelled");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"message cancelled");
     }
     else
     {
 	MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
-	MPIU_DBG_MSG(CH3_OTHER,TYPICAL,"unable to cancel message");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,"unable to cancel message");
     }
     
     mpi_errno = MPID_Request_complete(sreq);
@@ -347,20 +347,20 @@ int MPIDI_CH3_PktHandler_CancelSendResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
 #ifdef MPICH_DBG_OUTPUT
 int MPIDI_CH3_PktPrint_CancelSendReq( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... CANCEL_SEND\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->cancel_send_req.sender_req_id));
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," context_id ... %d\n", pkt->cancel_send_req.match.parts.context_id);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," tag .......... %d\n", pkt->cancel_send_req.match.parts.tag);
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," rank ......... %d\n", pkt->cancel_send_req.match.parts.rank);
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... CANCEL_SEND\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->cancel_send_req.sender_req_id));
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," context_id ... %d\n", pkt->cancel_send_req.match.parts.context_id);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," tag .......... %d\n", pkt->cancel_send_req.match.parts.tag);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," rank ......... %d\n", pkt->cancel_send_req.match.parts.rank);
 
     return MPI_SUCCESS;
 }
 
 int MPIDI_CH3_PktPrint_CancelSendResp( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
 {
-    MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... CANCEL_SEND_RESP\n");
-    MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->cancel_send_resp.sender_req_id));
-    MPIU_DBG_MSG_D(CH3_OTHER,TERSE," ack .......... %d\n", pkt->cancel_send_resp.ack);
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... CANCEL_SEND_RESP\n");
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," sender_reqid . 0x%08X\n", pkt->cancel_send_resp.sender_req_id));
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," ack .......... %d\n", pkt->cancel_send_resp.ack);
     
     return MPI_SUCCESS;
 }
diff --git a/src/mpid/ch3/src/mpid_comm_revoke.c b/src/mpid/ch3/src/mpid_comm_revoke.c
index 09d836f..6e9738a 100644
--- a/src/mpid/ch3/src/mpid_comm_revoke.c
+++ b/src/mpid/ch3/src/mpid_comm_revoke.c
@@ -41,7 +41,7 @@ int MPID_Comm_revoke(MPID_Comm *comm_ptr, int is_remote)
         /* Start a counter to track how many revoke messages we've received from
          * other ranks */
         comm_ptr->dev.waiting_for_revoke = comm_ptr->local_size - 1 - is_remote; /* Subtract the processes who already know about the revoke */
-        MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE, (MPIU_DBG_FDEST, "Comm %08x waiting_for_revoke: %d", comm_ptr->handle, comm_ptr->dev.waiting_for_revoke));
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPIU_DBG_FDEST, "Comm %08x waiting_for_revoke: %d", comm_ptr->handle, comm_ptr->dev.waiting_for_revoke));
 
         /* Keep a reference to this comm so it doesn't get destroyed while
          * it's being revoked */
@@ -90,7 +90,7 @@ int MPID_Comm_revoke(MPID_Comm *comm_ptr, int is_remote)
     } 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--;
-        MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE, (MPIU_DBG_FDEST, "Comm %08x waiting_for_revoke: %d", comm_ptr->handle, comm_ptr->dev.waiting_for_revoke));
+        MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPIU_DBG_FDEST, "Comm %08x waiting_for_revoke: %d", comm_ptr->handle, comm_ptr->dev.waiting_for_revoke));
 
         /* Check to see if we are done revoking */
         if (comm_ptr->dev.waiting_for_revoke == 0) {
diff --git a/src/mpid/ch3/src/mpid_imrecv.c b/src/mpid/ch3/src/mpid_imrecv.c
index cb0b00e..eca5cba 100644
--- a/src/mpid/ch3/src/mpid_imrecv.c
+++ b/src/mpid/ch3/src/mpid_imrecv.c
@@ -48,7 +48,7 @@ int MPID_Imrecv(void *buf, int count, MPI_Datatype datatype,
         int recv_pending;
 
         /* This is an eager message */
-        MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"eager message in the request");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"eager message in the request");
 
         /* If this is an eager synchronous message, then we need to send an
            acknowledgement back to the sender. */
diff --git a/src/mpid/ch3/src/mpid_init.c b/src/mpid/ch3/src/mpid_init.c
index 0ca8962..942aaaa 100644
--- a/src/mpid/ch3/src/mpid_init.c
+++ b/src/mpid/ch3/src/mpid_init.c
@@ -43,6 +43,16 @@ MPIDI_CH3U_Win_fns_t MPIDI_CH3U_Win_fns = { NULL };
 MPIDI_CH3U_Win_hooks_t MPIDI_CH3U_Win_hooks = { NULL };
 MPIDI_CH3U_Win_pkt_ordering_t MPIDI_CH3U_Win_pkt_orderings = { 0 };
 
+#if defined(USE_DBG_LOGGING)
+MPIU_DBG_Class MPIDI_CH3_DBG_CONNECT;
+MPIU_DBG_Class MPIDI_CH3_DBG_DISCONNECT;
+MPIU_DBG_Class MPIDI_CH3_DBG_PROGRESS;
+MPIU_DBG_Class MPIDI_CH3_DBG_CHANNEL;
+MPIU_DBG_Class MPIDI_CH3_DBG_OTHER;
+MPIU_DBG_Class MPIDI_CH3_DBG_MSG;
+MPIU_DBG_Class MPIDI_CH3_DBG_VC;
+MPIU_DBG_Class MPIDI_CH3_DBG_REFCOUNT;
+#endif /* USE_DBG_LOGGING */
 
 #undef FUNCNAME
 #define FUNCNAME finalize_failed_procs_group
@@ -179,6 +189,17 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
     MPIDI_CH3_Win_fns_init(&MPIDI_CH3U_Win_fns);
     MPIDI_CH3_Win_hooks_init(&MPIDI_CH3U_Win_hooks);
 
+#ifdef USE_DBG_LOGGING
+    MPIDI_CH3_DBG_CONNECT = MPIU_DBG_Class_alloc("CH3_CONNECT", "ch3_connect");;
+    MPIDI_CH3_DBG_DISCONNECT = MPIU_DBG_Class_alloc("CH3_DISCONNECT", "ch3_disconnect");
+    MPIDI_CH3_DBG_PROGRESS = MPIU_DBG_Class_alloc("CH3_PROGRESS", "ch3_progress");
+    MPIDI_CH3_DBG_CHANNEL = MPIU_DBG_Class_alloc("CH3_CHANNEL", "ch3_channel");
+    MPIDI_CH3_DBG_OTHER = MPIU_DBG_Class_alloc("CH3_OTHER", "ch3_other");
+    MPIDI_CH3_DBG_MSG = MPIU_DBG_Class_alloc("CH3_MSG", "ch3_msg");
+    MPIDI_CH3_DBG_VC = MPIU_DBG_Class_alloc("VC", "vc");
+    MPIDI_CH3_DBG_REFCOUNT = MPIU_DBG_Class_alloc("REFCOUNT", "refcount");
+#endif /* USE_DBG_LOGGING */
+
     /*
      * Let the channel perform any necessary initialization
      * The channel init should assume that PMI_Init has been called and that
@@ -294,7 +315,7 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
 	    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);
+	MPIU_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Parent port is %s", parent_port);
 	    
 	mpi_errno = MPID_Comm_connect(parent_port, NULL, 0, 
 				      MPIR_Process.comm_world, &comm);
diff --git a/src/mpid/ch3/src/mpid_irecv.c b/src/mpid/ch3/src/mpid_irecv.c
index 47528f5..0681eea 100644
--- a/src/mpid/ch3/src/mpid_irecv.c
+++ b/src/mpid/ch3/src/mpid_irecv.c
@@ -21,7 +21,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_IRECV);
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 			"rank=%d, tag=%d, context=%d", 
 			rank, tag, comm->recvcontext_id + context_offset));
 
@@ -35,7 +35,7 @@ int MPID_Irecv(void * buf, MPI_Aint 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_DBG_MSG(CH3_OTHER,VERBOSE,"Comm has been revoked. Returning from MPID_IRECV.");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Comm has been revoked. Returning from MPID_IRECV.");
         MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
 
@@ -54,7 +54,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 	MPIDI_VC_t * vc;
 	
 	/* Message was found in the unexepected queue */
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"request found in unexpected queue");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request found in unexpected queue");
 
 	/* Release the message queue - we've removed this request from 
 	   the queue already */
@@ -65,7 +65,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 	    int recv_pending;
 	    
 	    /* This is an eager message */
-	    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"eager message in the request");
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"eager message in the request");
 	    
 	    /* If this is a eager synchronous message, then we need to send an 
 	       acknowledgement back to the sender. */
@@ -147,7 +147,7 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 	/* Message has yet to arrived.  The request has been placed on the 
 	   list of posted receive requests and populated with
            information supplied in the arguments. */
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"request allocated in posted queue");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated in posted queue");
 	
 	if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN)
 	{
@@ -165,12 +165,12 @@ int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int
 
   fn_exit:
     *request = rreq;
-    MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,"request allocated, handle=0x%08x", 
+    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x",
 		   rreq->handle);
 
  fn_fail:
-    MPIU_DBG_MSG_D(CH3_OTHER,VERBOSE,"IRECV errno: 0x%08x", mpi_errno);
-    MPIU_DBG_MSG_D(CH3_OTHER,VERBOSE,"(class: %d)", MPIR_ERR_GET_CLASS(mpi_errno));
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"IRECV errno: 0x%08x", mpi_errno);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,VERBOSE,"(class: %d)", MPIR_ERR_GET_CLASS(mpi_errno));
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_IRECV);
     return mpi_errno;
 }
diff --git a/src/mpid/ch3/src/mpid_irsend.c b/src/mpid/ch3/src/mpid_irsend.c
index 1dfce62..da84c6a 100644
--- a/src/mpid/ch3/src/mpid_irsend.c
+++ b/src/mpid/ch3/src/mpid_irsend.c
@@ -34,7 +34,7 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_IRSEND);
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                 "rank=%d, tag=%d, context=%d", 
                 rank, tag, comm->context_id + context_offset));
 
@@ -86,7 +86,7 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
 
     if (data_sz == 0)
     {
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending zero length message");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
 
 	sreq->dev.OnDataAvail = 0;
 	
@@ -147,10 +147,10 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
   fn_exit:
     *request = sreq;
 
-    MPIU_DBG_STMT(CH3_OTHER,VERBOSE,{
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,{
 	if (sreq != NULL)
 	{
-	    MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
+	    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
 	}
     }
 		  );
diff --git a/src/mpid/ch3/src/mpid_isend.c b/src/mpid/ch3/src/mpid_isend.c
index 345e5cc..4a81e43 100644
--- a/src/mpid/ch3/src/mpid_isend.c
+++ b/src/mpid/ch3/src/mpid_isend.c
@@ -46,7 +46,7 @@ int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_ISEND);
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                   "rank=%d, tag=%d, context=%d", 
                   rank, tag, comm->context_id + context_offset));
 
@@ -54,7 +54,7 @@ int MPID_Isend(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_DBG_MSG(CH3_OTHER,VERBOSE,"Communicator revoked. MPID_ISEND returning");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"Communicator revoked. MPID_ISEND returning");
         MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
     }
     
@@ -99,7 +99,7 @@ int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
 	MPIDI_Request_set_msg_type(sreq, MPIDI_REQUEST_EAGER_MSG);
 	sreq->dev.OnDataAvail = 0;
 	    
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending zero length message");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
 	MPIDI_Pkt_init(eager_pkt, MPIDI_CH3_PKT_EAGER_SEND);
 	eager_pkt->match.parts.rank = comm->rank;
 	eager_pkt->match.parts.tag = tag;
@@ -178,11 +178,11 @@ int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
   fn_exit:
     *request = sreq;
 
-    MPIU_DBG_STMT(CH3_OTHER,VERBOSE,
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
     {
 	if (sreq != NULL)
 	{
-	    MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
+	    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
 	}
     }
 		  );
diff --git a/src/mpid/ch3/src/mpid_issend.c b/src/mpid/ch3/src/mpid_issend.c
index 7454af5..9389eed 100644
--- a/src/mpid/ch3/src/mpid_issend.c
+++ b/src/mpid/ch3/src/mpid_issend.c
@@ -33,7 +33,7 @@ int MPID_Issend(const void * buf, int count, MPI_Datatype datatype, int rank, in
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_ISSEND);
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                  "rank=%d, tag=%d, context=%d", 
                  rank, tag, comm->context_id + context_offset));
 
@@ -122,10 +122,10 @@ int MPID_Issend(const void * buf, int count, MPI_Datatype datatype, int rank, in
   fn_exit:
     *request = sreq;
     
-    MPIU_DBG_STMT(CH3_OTHER,VERBOSE,
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
     {
 	if (sreq != NULL) {
-	    MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
+	    MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 			   "request allocated, handle=0x%08x", sreq->handle);
 	}
     }
diff --git a/src/mpid/ch3/src/mpid_port.c b/src/mpid/ch3/src/mpid_port.c
index 8ba0546..e5fa8a0 100644
--- a/src/mpid/ch3/src/mpid_port.c
+++ b/src/mpid/ch3/src/mpid_port.c
@@ -310,7 +310,7 @@ static int MPIDI_Open_port(MPID_Info *info_ptr, char *port_name)
        may not use shared memory).  We may need a channel-specific 
        function to create an exportable connection string.  */
     mpi_errno = MPIDI_CH3_Get_business_card(myRank, port_name, len);
-    MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE, (MPIU_DBG_FDEST, "port_name = %s", port_name));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPIU_DBG_FDEST, "port_name = %s", port_name));
 
 fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_OPEN_PORT);
diff --git a/src/mpid/ch3/src/mpid_recv.c b/src/mpid/ch3/src/mpid_recv.c
index d226784..193bb7f 100644
--- a/src/mpid/ch3/src/mpid_recv.c
+++ b/src/mpid/ch3/src/mpid_recv.c
@@ -28,7 +28,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_RECV);
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                       "rank=%d, tag=%d, context=%d", rank, tag,
 		      comm->recvcontext_id + context_offset));
     
@@ -60,7 +60,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 	MPIDI_VC_t * vc;
 
 	/* Message was found in the unexepected queue */
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"request found in unexpected queue");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request found in unexpected queue");
 
 	/* Release the message queue - we've removed this request from 
 	   the queue already */
@@ -70,7 +70,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 	    int recv_pending;
 	    
 	    /* This is an eager message. */
-	    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"eager message in the request");
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"eager message in the request");
 
 	    if (MPIDI_Request_get_sync_send_flag(rreq))
 	    {
@@ -163,7 +163,7 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 	/* Message has yet to arrived.  The request has been placed on the 
 	   list of posted receive requests and populated with
            information supplied in the arguments. */
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"request allocated in posted queue");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated in posted queue");
 
 	/* FIXME: We do not need to add a datatype reference if
 	   the request is blocking.  This is currently added because
@@ -185,15 +185,15 @@ int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int t
 
   fn_exit:
     *request = rreq;
-    MPIU_DBG_STMT(CH3_OTHER,VERBOSE,
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
     if (rreq)
     {
-	MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		       "request allocated, handle=0x%08x", rreq->handle);
     }
     else
     {
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		     "operation complete, no requests allocated");
     });
 
diff --git a/src/mpid/ch3/src/mpid_rsend.c b/src/mpid/ch3/src/mpid_rsend.c
index 3619214..cb171a9 100644
--- a/src/mpid/ch3/src/mpid_rsend.c
+++ b/src/mpid/ch3/src/mpid_rsend.c
@@ -36,7 +36,7 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_RSEND);
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 					"rank=%d, tag=%d, context=%d", 
                               rank, tag, comm->context_id + context_offset));
 
@@ -75,7 +75,7 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
 	MPIDI_CH3_Pkt_t upkt;
 	MPIDI_CH3_Pkt_ready_send_t * const ready_pkt = &upkt.ready_send;
 
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending zero length message");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
     
 	MPIDI_Pkt_init(ready_pkt, MPIDI_CH3_PKT_READY_SEND);
 	ready_pkt->match.parts.rank = comm->rank;
@@ -144,15 +144,15 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
   fn_exit:
     *request = sreq;
 
-    MPIU_DBG_STMT(CH3_OTHER,VERBOSE,
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
     {
 	if (mpi_errno == MPI_SUCCESS) {
 	    if (sreq) {
-		MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
+		MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
 	    }
 	    else
 	    {
-		MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"operation complete, no requests allocated");
+		MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"operation complete, no requests allocated");
 	    }
 	}
     }
diff --git a/src/mpid/ch3/src/mpid_send.c b/src/mpid/ch3/src/mpid_send.c
index 7b6c2a8..905f3ed 100644
--- a/src/mpid/ch3/src/mpid_send.c
+++ b/src/mpid/ch3/src/mpid_send.c
@@ -34,7 +34,7 @@ int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEND);
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                 "rank=%d, tag=%d, context=%d", 
 		rank, tag, comm->context_id + context_offset));
 
@@ -91,7 +91,7 @@ int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
 	MPIDI_CH3_Pkt_t upkt;
 	MPIDI_CH3_Pkt_eager_send_t * const eager_pkt = &upkt.eager_send;
 
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending zero length message");
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending zero length message");
 	MPIDI_Pkt_init(eager_pkt, MPIDI_CH3_PKT_EAGER_SEND);
 	eager_pkt->match.parts.rank = comm->rank;
 	eager_pkt->match.parts.tag = tag;
@@ -174,16 +174,16 @@ int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
  fn_exit:
     *request = sreq;
 
-    MPIU_DBG_STMT(CH3_OTHER,VERBOSE,
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,
     {
 	if (mpi_errno == MPI_SUCCESS) {
 	    if (sreq) {
-		MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
+		MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 			 "request allocated, handle=0x%08x", sreq->handle);
 	    }
 	    else
 	    {
-		MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
+		MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 			     "operation complete, no requests allocated");
 	    }
 	}
diff --git a/src/mpid/ch3/src/mpid_ssend.c b/src/mpid/ch3/src/mpid_ssend.c
index cf3ba5f..6f2ec86 100644
--- a/src/mpid/ch3/src/mpid_ssend.c
+++ b/src/mpid/ch3/src/mpid_ssend.c
@@ -33,7 +33,7 @@ int MPID_Ssend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_SSEND);
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
               "rank=%d, tag=%d, context=%d", 
               rank, tag, comm->context_id + context_offset));
 
@@ -120,8 +120,8 @@ int MPID_Ssend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank
   fn_exit:
     *request = sreq;
     
-    MPIU_DBG_STMT(CH3_OTHER,VERBOSE,{if (sreq!=NULL) {
-            MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_OTHER,VERBOSE,{if (sreq!=NULL) {
+            MPIU_DBG_MSG_P(MPIDI_CH3_DBG_OTHER,VERBOSE,
 			   "request allocated, handle=0x%08x", sreq->handle);}});
     
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_SSEND);
diff --git a/src/mpid/ch3/src/mpid_startall.c b/src/mpid/ch3/src/mpid_startall.c
index cbd1ca4..a948c0a 100644
--- a/src/mpid/ch3/src/mpid_startall.c
+++ b/src/mpid/ch3/src/mpid_startall.c
@@ -25,7 +25,7 @@
     (sreq_) = MPID_Request_create();				\
     if ((sreq_) == NULL)						\
     {									\
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"send request allocation failed");\
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"send request allocation failed");\
 	(mpi_errno_) = MPIR_ERR_MEMALLOCFAILED;				\
 	FAIL_;								\
     }									\
diff --git a/src/mpid/ch3/src/mpid_vc.c b/src/mpid/ch3/src/mpid_vc.c
index fc6f7e7..a4092fb 100644
--- a/src/mpid/ch3/src/mpid_vc.c
+++ b/src/mpid/ch3/src/mpid_vc.c
@@ -135,7 +135,7 @@ int MPIDI_VCRT_Add_ref(struct MPIDI_VCRT *vcrt)
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_VCRT_ADD_REF);
     MPIU_Object_add_ref(vcrt);
-    MPIU_DBG_MSG_FMT(REFCOUNT,TYPICAL,(MPIU_DBG_FDEST, "Incr VCRT %p ref count",vcrt));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_REFCOUNT,TYPICAL,(MPIU_DBG_FDEST, "Incr VCRT %p ref count",vcrt));
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_VCRT_ADD_REF);
     return MPI_SUCCESS;
 }
@@ -161,7 +161,7 @@ int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt, int isDisconnect )
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_VCRT_RELEASE);
 
     MPIU_Object_release_ref(vcrt, &in_use);
-    MPIU_DBG_MSG_FMT(REFCOUNT,TYPICAL,(MPIU_DBG_FDEST, "Decr VCRT %p ref count",vcrt));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_REFCOUNT,TYPICAL,(MPIU_DBG_FDEST, "Decr VCRT %p ref count",vcrt));
     
     /* If this VC reference table is no longer in use, we can
        decrement the reference count of each of the VCs.  If the
@@ -227,7 +227,7 @@ int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt, int isDisconnect )
                         MPIDI_PG_Destroy(vc->pg);
                     }
 
-		    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+		    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                             "vc=%p: not sending a close to %d, vc in state %s",
 			     vc, i, MPIDI_VC_GetStateString(vc->state)));
 		}
@@ -287,7 +287,7 @@ int MPIDI_VCR_Dup(MPIDI_VCR orig_vcr, MPIDI_VCR * new_vcr)
     else {
 	MPIDI_VC_add_ref(orig_vcr);
     }
-    MPIU_DBG_MSG_FMT(REFCOUNT,TYPICAL,(MPIU_DBG_FDEST,"Incr VCR %p ref count",orig_vcr));
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_REFCOUNT,TYPICAL,(MPIU_DBG_FDEST,"Incr VCR %p ref count",orig_vcr));
     *new_vcr = orig_vcr;
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_VCR_DUP);
     return MPI_SUCCESS;
@@ -356,7 +356,7 @@ int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
 	}
 	*gpid++ = vc->pg_rank;
 
-        MPIU_DBG_MSG_FMT(COMM,VERBOSE, (MPIU_DBG_FDEST,
+        MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPIU_DBG_FDEST,
                          "pgid=%d vc->pg_rank=%d",
                          pgid, vc->pg_rank));
     }
@@ -784,7 +784,7 @@ static int parse_mapping(char *map_str, mapping_type_t *type, map_block_t **map,
          Y - number of nodes with size Z
          Z - number of processes assigned to each node
      */
-    MPIU_DBG_MSG_S(CH3_OTHER,VERBOSE,"parsing mapping string '%s'", map_str);
+    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,VERBOSE,"parsing mapping string '%s'", map_str);
 
     if (!strlen(map_str)) {
         /* An empty-string indicates an inability to determine or express the
@@ -1117,12 +1117,12 @@ int MPIDI_Populate_vc_node_ids(MPIDI_PG_t *pg, int our_pg_rank)
                 goto odd_even_cliques;
             }
             else {
-                MPIU_DBG_MSG_S(CH3_OTHER,TERSE,"did_map==0, unable to populate node ids from mapping=%s",value);
+                MPIU_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,TERSE,"did_map==0, unable to populate node ids from mapping=%s",value);
             }
             /* else fall through to O(N^2) PMI_KVS_Gets version */
         }
         else {
-            MPIU_DBG_MSG(CH3_OTHER,TERSE,"unable to obtain the 'PMI_process_mapping' PMI key");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"unable to obtain the 'PMI_process_mapping' PMI key");
         }
     }
 
diff --git a/src/mpid/ch3/src/mpidi_isend_self.c b/src/mpid/ch3/src/mpidi_isend_self.c
index 72c9f89..7dfdf22 100644
--- a/src/mpid/ch3/src/mpidi_isend_self.c
+++ b/src/mpid/ch3/src/mpidi_isend_self.c
@@ -29,7 +29,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
     int found;
     int mpi_errno = MPI_SUCCESS;
 	
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending message to self");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,"sending message to self");
 	
     MPIDI_Request_create_sreq(sreq, mpi_errno, goto fn_exit);
     MPIDI_Request_set_type(sreq, type);
@@ -87,7 +87,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
         /* we found a posted req, which we now own, so we can release the CS */
         MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_MSGQ_MUTEX);
 
-	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 		     "found posted receive request; copying data");
 	    
 	MPIDI_CH3U_Buffer_copy(buf, count, datatype, &sreq->status.MPI_ERROR,
@@ -111,7 +111,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
 	
 	    /* FIXME: Insert code here to buffer small sends in a temporary buffer? */
 
-	    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
           "added receive request to unexpected queue; attaching send request");
 	    if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN)
 	    {
@@ -126,7 +126,7 @@ int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, in
 	else
 	{
 	    /* --BEGIN ERROR HANDLING-- */
-	    MPIU_DBG_MSG(CH3_OTHER,TYPICAL,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TYPICAL,
 			 "ready send unable to find matching recv req");
 	    sreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER,
 							  "**rsendnomatch", "**rsendnomatch %d %d", rank, tag);
diff --git a/src/mpid/ch3/src/mpidi_pg.c b/src/mpid/ch3/src/mpidi_pg.c
index cc3d417..0a00f56 100644
--- a/src/mpid/ch3/src/mpidi_pg.c
+++ b/src/mpid/ch3/src/mpidi_pg.c
@@ -291,7 +291,7 @@ int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
             else
                 pg_prev->next = pg->next;
 
-            MPIU_DBG_MSG_FMT(CH3_DISCONNECT, VERBOSE, (MPIU_DBG_FDEST, "destroying pg=%p pg->id=%s", pg, (char *)pg->id));
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT, VERBOSE, (MPIU_DBG_FDEST, "destroying pg=%p pg->id=%s", pg, (char *)pg->id));
 
             for (i = 0; i < pg->size; ++i) {
                 /* FIXME it would be good if we could make this assertion.
@@ -306,7 +306,7 @@ int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
                       just haven't hit it in the tests yet.  */
                 /*MPIU_Assert(MPIU_Object_get_ref(pg->vct[i]) == 0);*/
 
-                MPIU_DBG_MSG_FMT(CH3_DISCONNECT, VERBOSE, (MPIU_DBG_FDEST, "about to free pg->vct=%p which contains vc=%p", pg->vct, &pg->vct[i]));
+                MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT, VERBOSE, (MPIU_DBG_FDEST, "about to free pg->vct=%p which contains vc=%p", pg->vct, &pg->vct[i]));
 
                 /* This used to be handled in MPIDI_VCRT_Release, but that was
                    not the right place to do this.  The VC should only be freed
@@ -1030,8 +1030,8 @@ int MPIDI_PrintConnStr( const char *file, int line,
 {
     int pg_size, i;
 
-    MPIU_DBG_Outevent( file, line, MPIU_DBG_CH3_CONNECT, 0, "%s", label );
-    MPIU_DBG_Outevent( file, line, MPIU_DBG_CH3_CONNECT, 0, "%s", str );
+    MPIU_DBG_Outevent( file, line, MPIDI_CH3_DBG_CONNECT, 0, "%s", label );
+    MPIU_DBG_Outevent( file, line, MPIDI_CH3_DBG_CONNECT, 0, "%s", str );
     
     /* Skip the pg id */
     while (*str) str++; str++;
@@ -1041,7 +1041,7 @@ int MPIDI_PrintConnStr( const char *file, int line,
     while (*str) str++; str++;
 
     for (i=0; i<pg_size; i++) {
-	MPIU_DBG_Outevent( file, line, MPIU_DBG_CH3_CONNECT, 0, "%s", str );
+	MPIU_DBG_Outevent( file, line, MPIDI_CH3_DBG_CONNECT, 0, "%s", str );
 	while (*str) str++;
 	str++;
     }
@@ -1171,7 +1171,7 @@ int MPIDI_PG_Close_VCs( void )
     while (pg) {
 	int i, inuse, n, i_start;
 
-	MPIU_DBG_MSG_S(CH3_DISCONNECT,VERBOSE,"Closing vcs for pg %s",
+	MPIU_DBG_MSG_S(MPIDI_CH3_DBG_DISCONNECT,VERBOSE,"Closing vcs for pg %s",
 		       (char *)pg->id );
 
         /* We want to reduce the chance of having all processes send
@@ -1212,7 +1212,7 @@ int MPIDI_PG_Close_VCs( void )
                 if (vc->state == MPIDI_VC_STATE_INACTIVE)
                     MPIDI_CHANGE_VC_STATE(vc, INACTIVE_CLOSED);
             } else {
-		MPIU_DBG_MSG_FMT(CH3_DISCONNECT,VERBOSE,(MPIU_DBG_FDEST,
+		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_DISCONNECT,VERBOSE,(MPIU_DBG_FDEST,
 		     "vc=%p: not sending a close to %d, vc in state %s", vc,i,
 		     MPIDI_VC_GetStateString(vc->state)));
 	    }
diff --git a/src/mpid/ch3/src/mpidi_printf.c b/src/mpid/ch3/src/mpidi_printf.c
index 0d4371a..9cd2899 100644
--- a/src/mpid/ch3/src/mpidi_printf.c
+++ b/src/mpid/ch3/src/mpidi_printf.c
@@ -63,7 +63,7 @@ void MPIDI_err_printf(char *func, char *fmt, ...)
 void MPIDI_DBG_Print_packet(MPIDI_CH3_Pkt_t * pkt)
 {
     {
-        MPIU_DBG_MSG(CH3_OTHER,TERSE,"MPIDI_CH3_Pkt_t:\n");
+        MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"MPIDI_CH3_Pkt_t:\n");
         switch (pkt->type) {
         case MPIDI_CH3_PKT_EAGER_SEND:
             MPIDI_CH3_PktPrint_EagerSend(stdout, pkt);
@@ -120,12 +120,12 @@ void MPIDI_DBG_Print_packet(MPIDI_CH3_Pkt_t * pkt)
             break;
             /*
              * case MPIDI_CH3_PKT_SHARED_LOCK_OPS_DONE:
-             * MPIU_DBG_MSG(CH3_OTHER,TERSE," type ......... MPIDI_CH3_PKT_SHARED_LOCK_OPS_DONE\n");
-             * MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->shared_lock_ops_done.source_win_handle));
+             * MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," type ......... MPIDI_CH3_PKT_SHARED_LOCK_OPS_DONE\n");
+             * MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST," source ....... 0x%08X\n", pkt->shared_lock_ops_done.source_win_handle));
              * break;
              */
         case MPIDI_CH3_PKT_FLOW_CNTL_UPDATE:
-            MPIU_DBG_MSG(CH3_OTHER,TERSE," FLOW_CNTRL_UPDATE\n");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," FLOW_CNTRL_UPDATE\n");
             break;
 
         case MPIDI_CH3_PKT_CLOSE:
@@ -133,41 +133,41 @@ void MPIDI_DBG_Print_packet(MPIDI_CH3_Pkt_t * pkt)
             break;
 
         default:
-            MPIU_DBG_MSG(CH3_OTHER,TERSE," INVALID PACKET\n");
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE," unknown type ... %d\n", pkt->type);
-            MPIU_DBG_MSG(CH3_OTHER,TERSE,"  type .......... EAGER_SEND\n");
-            MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->eager_send.sender_req_id));
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   context_id ... %d\n", pkt->eager_send.match.parts.context_id);
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   data_sz ...... %d\n", pkt->eager_send.data_sz);
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   tag .......... %d\n", pkt->eager_send.match.parts.tag);
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   rank ......... %d\n", pkt->eager_send.match.parts.rank);
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE," INVALID PACKET\n");
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE," unknown type ... %d\n", pkt->type);
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... EAGER_SEND\n");
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->eager_send.sender_req_id));
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   context_id ... %d\n", pkt->eager_send.match.parts.context_id);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   data_sz ...... %d\n", pkt->eager_send.data_sz);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   tag .......... %d\n", pkt->eager_send.match.parts.tag);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   rank ......... %d\n", pkt->eager_send.match.parts.rank);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   seqnum ....... %d\n", pkt->eager_send.seqnum);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   seqnum ....... %d\n", pkt->eager_send.seqnum);
 #endif
-            MPIU_DBG_MSG(CH3_OTHER,TERSE,"  type .......... REQ_TO_SEND\n");
-            MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->rndv_req_to_send.sender_req_id));
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   context_id ... %d\n",
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... REQ_TO_SEND\n");
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->rndv_req_to_send.sender_req_id));
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   context_id ... %d\n",
                            pkt->rndv_req_to_send.match.parts.context_id);
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   data_sz ...... %d\n", pkt->rndv_req_to_send.data_sz);
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   tag .......... %d\n", pkt->rndv_req_to_send.match.parts.tag);
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   rank ......... %d\n", pkt->rndv_req_to_send.match.parts.rank);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   data_sz ...... %d\n", pkt->rndv_req_to_send.data_sz);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   tag .......... %d\n", pkt->rndv_req_to_send.match.parts.tag);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   rank ......... %d\n", pkt->rndv_req_to_send.match.parts.rank);
 #ifdef MPID_USE_SEQUENCE_NUMBERS
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   seqnum ....... %d\n", pkt->rndv_req_to_send.seqnum);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   seqnum ....... %d\n", pkt->rndv_req_to_send.seqnum);
 #endif
-            MPIU_DBG_MSG(CH3_OTHER,TERSE,"  type .......... CLR_TO_SEND\n");
-            MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->rndv_clr_to_send.sender_req_id));
-            MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"   recvr_reqid .. 0x%08X\n", pkt->rndv_clr_to_send.receiver_req_id));
-            MPIU_DBG_MSG(CH3_OTHER,TERSE,"  type .......... RNDV_SEND\n");
-            MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"   recvr_reqid .. 0x%08X\n", pkt->rndv_send.receiver_req_id));
-            MPIU_DBG_MSG(CH3_OTHER,TERSE,"  type .......... CANCEL_SEND\n");
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   context_id ... %d\n",
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... CLR_TO_SEND\n");
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->rndv_clr_to_send.sender_req_id));
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   recvr_reqid .. 0x%08X\n", pkt->rndv_clr_to_send.receiver_req_id));
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... RNDV_SEND\n");
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   recvr_reqid .. 0x%08X\n", pkt->rndv_send.receiver_req_id));
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... CANCEL_SEND\n");
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   context_id ... %d\n",
                            pkt->cancel_send_req.match.parts.context_id);
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   tag .......... %d\n", pkt->cancel_send_req.match.parts.tag);
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   rank ......... %d\n", pkt->cancel_send_req.match.parts.rank);
-            MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->cancel_send_req.sender_req_id));
-            MPIU_DBG_MSG(CH3_OTHER,TERSE,"  type .......... CANCEL_SEND_RESP\n");
-            MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->cancel_send_resp.sender_req_id));
-            MPIU_DBG_MSG_D(CH3_OTHER,TERSE,"   ack .......... %d\n", pkt->cancel_send_resp.ack);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   tag .......... %d\n", pkt->cancel_send_req.match.parts.tag);
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   rank ......... %d\n", pkt->cancel_send_req.match.parts.rank);
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->cancel_send_req.sender_req_id));
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,TERSE,"  type .......... CANCEL_SEND_RESP\n");
+            MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"   sender_reqid . 0x%08X\n", pkt->cancel_send_resp.sender_req_id));
+            MPIU_DBG_MSG_D(MPIDI_CH3_DBG_OTHER,TERSE,"   ack .......... %d\n", pkt->cancel_send_resp.ack);
             break;
         }
     }
diff --git a/src/mpid/ch3/util/sock/ch3u_connect_sock.c b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
index fd51607..a7376e5 100644
--- a/src/mpid/ch3/util/sock/ch3u_connect_sock.c
+++ b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
@@ -104,7 +104,7 @@ int MPIDU_CH3I_SetupListener( MPIDU_Sock_set_t sock_set )
 	return mpi_errno;
     }
 
-    MPIU_DBG_MSG(CH3_CONNECT,TYPICAL,
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,TYPICAL,
 		 "Setting listener connect state to CONN_STATE_LISTENING");
     MPIDI_CH3I_listener_conn->sock	  = NULL;
     MPIDI_CH3I_listener_conn->vc	  = NULL;
@@ -116,7 +116,7 @@ int MPIDU_CH3I_SetupListener( MPIDU_Sock_set_t sock_set )
 				  &MPIDI_CH3I_listener_port, &sock);
     if (mpi_errno) return mpi_errno;
 
-    MPIU_DBG_MSG_D(CH3_CONNECT,VERBOSE,"Listener port %d",
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Listener port %d",
 		   MPIDI_CH3I_listener_port );
 
     MPIDI_CH3I_listener_conn->sock = sock;
@@ -133,7 +133,7 @@ int MPIDU_CH3I_ShutdownListener( void )
     int mpi_errno;
     MPID_Progress_state progress_state;
 
-    MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL,"Closing listener sock (Post_close)");
+    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"Closing listener sock (Post_close)");
     mpi_errno = MPIDU_Sock_post_close(MPIDI_CH3I_listener_conn->sock);
     if (mpi_errno != MPI_SUCCESS) {
 	return mpi_errno;
@@ -233,7 +233,7 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
        and the remote process to which the vc will connect). */
     MPIDI_VC_Init(vc, NULL, 0);
 
-    MPIU_DBG_MSG_S(CH3_CONNECT,VERBOSE,"Connect to root with portstring %s",
+    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"Connect to root with portstring %s",
 		   port_name );
 
     mpi_errno = MPIDU_Sock_get_conninfo_from_bc( port_name, host_description,
@@ -247,7 +247,7 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
 	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);
+    MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CONNECT,VERBOSE,"port tag %d",port_name_tag);
 
     mpi_errno = MPIDI_CH3I_Connection_alloc(&conn);
     if (mpi_errno != MPI_SUCCESS) {
@@ -262,7 +262,7 @@ int MPIDI_CH3I_Connect_to_root_sock(const char * port_name,
        socket for a connection and return the connection.  That will
        keep the socket set out of the general ch3 code, even if this
        is the socket utility functions. */
-    MPIU_DBG_MSG_FMT(CH3_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
 	  "posting connect to host %s, port %d", host_description, port ));
     mpi_errno = MPIDU_Sock_post_connect(MPIDI_CH3I_sock_set, conn, 
 					host_description, port, &conn->sock);
@@ -481,7 +481,7 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 	    p = (unsigned char *)(info->h_addr_list[0]);
 	    MPL_snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u", 
 			   p[0], p[1], p[2], p[3] );
-	    MPIU_DBG_MSG_S(CH3_CONNECT,VERBOSE,"ifname = %s",ifname );
+	    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"ifname = %s",ifname );
 	    str_errno = MPIU_Str_add_string_arg( bc_val_p,
 						 val_max_sz_p,
 						 MPIDI_CH3I_IFNAME_KEY,
@@ -502,7 +502,7 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 	    p = (unsigned char *)(ifaddr.ifaddr);
 	    MPL_snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u", 
 			   p[0], p[1], p[2], p[3] );
-	    MPIU_DBG_MSG_S(CH3_CONNECT,VERBOSE,"ifname = %s",ifname );
+	    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"ifname = %s",ifname );
 	    str_errno = MPIU_Str_add_string_arg( bc_val_p,
 						 val_max_sz_p,
 						 MPIDI_CH3I_IFNAME_KEY,
@@ -514,7 +514,7 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
 	}
     }
 
-    MPIU_DBG_MSG_S(CH3_CONNECT,TYPICAL,"business card is %s", bc_orig );
+    MPIU_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,TYPICAL,"business card is %s", bc_orig );
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3U_GET_BUSINESS_CARD_SOCK);
@@ -692,7 +692,7 @@ int MPIDI_CH3_Sockconn_handle_close_event( MPIDI_CH3I_Connection_t * conn )
 	}
         else if(conn->state == CONN_STATE_DISCARD) {
         /* post close, so the socket is closed and memmory leaks are avoided */
-            MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL,"CLosing sock (Post_close)");
+            MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"CLosing sock (Post_close)");
             conn->state = CONN_STATE_CLOSING;
             mpi_errno = MPIDU_Sock_post_close(conn->sock);
             if (mpi_errno != MPI_SUCCESS) {
@@ -847,7 +847,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
                no longer needed and should be closed. This is initiated with the post
                close command. This also caused that the socket is removed from the
                socket set, so no more polling on this socket*/
-	    MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL,"CLosing sock (Post_close)");
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"CLosing sock (Post_close)");
 	    mpi_errno = MPIDU_Sock_post_close(conn->sock);
 	    if (mpi_errno != MPI_SUCCESS) {
 		MPIR_ERR_POP(mpi_errno);
@@ -856,7 +856,7 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
     }
     /* --BEGIN ERROR HANDLING-- */
     else {
-	MPIU_DBG_STMT(CH3_CONNECT,VERBOSE,MPIDI_DBG_Print_packet(&conn->pkt));
+	MPIU_DBG_STMT(MPIDI_CH3_DBG_CONNECT,VERBOSE,MPIDI_DBG_Print_packet(&conn->pkt));
 	mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, FCNAME, __LINE__, MPI_ERR_INTERN,
 					 "**ch3|sock|badpacket", "**ch3|sock|badpacket %d", conn->pkt.type);
 	goto fn_fail;
@@ -934,7 +934,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
 	    /* the other process is in the same comm_world; just compare the 
 	       ranks */
 	    if (MPIR_Process.comm_world->rank < pg_rank) {
-		MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
+		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
                 "vc=%p,conn=%p:Accept head-to-head connection (my process group), discarding vcch->conn=%p",vc,conn, vcch->conn));
 
                 /* mark old connection */
@@ -954,7 +954,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
 	    }
 	    else {
 		/* refuse connection */
-		MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
+		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
                 "vc=%p,conn=%p:Refuse head-to-head connection (my process group)",vc,conn));
 		MPIDI_Pkt_init(openresp, MPIDI_CH3I_PKT_SC_OPEN_RESP);
 		openresp->ack = FALSE;
@@ -964,7 +964,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
 	    /* the two processes are in different comm_worlds; compare their 
 	       unique pg_ids. */
 	    if (strcmp(MPIDI_Process.my_pg->id, pg->id) < 0) {
-		MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
+		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
                 "vc=%p,conn=%p:Accept head-to-head connection (two process groups), discarding vcch->conn=%p",vc,conn, vcch->conn));
                 /* mark old connection */
                 MPIDI_CH3I_Connection_t *old_conn = vcch->conn;
@@ -982,7 +982,7 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
 	    }
 	    else {
 		/* refuse connection */
-		MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
+		MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
 			"vc=%p,conn=%p:Refuse head-to-head connection (two process groups)",vc,conn));
 		MPIDI_Pkt_init(openresp, MPIDI_CH3I_PKT_SC_OPEN_RESP);
 		openresp->ack = FALSE;
@@ -1063,7 +1063,7 @@ int MPIDI_CH3_Sockconn_handle_connwrite( MPIDI_CH3I_Connection_t * conn )
             /* zero out the vc to prevent trouble in _handle_close_event */
             conn->vc = NULL;
 
-	    MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL,"Closing sock2 (Post_close)");
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_DISCONNECT,TYPICAL,"Closing sock2 (Post_close)");
 	    mpi_errno = MPIDU_Sock_post_close(conn->sock);
 	    if (mpi_errno != MPI_SUCCESS) {
 		MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
@@ -1101,10 +1101,10 @@ int MPIDI_CH3I_VC_post_sockconnect(MPIDI_VC_t * vc)
     if(vcch->state == MPIDI_CH3I_VC_STATE_UNCONNECTED){ 
     	MPIU_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
     	vcch->state = MPIDI_CH3I_VC_STATE_CONNECTING;
-	MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"vc=(%p) Going ahead to obtain connstring", vc);
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"vc=(%p) Going ahead to obtain connstring", vc);
     }else{
-	MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"MT: vc=(%p) is already connecting/ed", vc);
-	MPIU_DBG_MSG(CH3_CONNECT,TYPICAL,"Aborting posting a connect");
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"MT: vc=(%p) is already connecting/ed", vc);
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Aborting posting a connect");
 	/*************** MT *****************/
 	/* There are 3 cases here,
          * 1) Another thread posted a connect while the current thread
@@ -1168,10 +1168,10 @@ int MPIDI_CH3I_Sock_connect( MPIDI_VC_t *vc, const char val[], int vallen )
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SOCK_CONNECT);
     
     if(vcch->state == MPIDI_CH3I_VC_STATE_CONNECTING){ 
-	MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"Posting a connect for vc=(%p)", vc);
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Posting a connect for vc=(%p)", vc);
     }else{
-	MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"MT: vc=(%p) is already connected", vc);
-	MPIU_DBG_MSG(CH3_CONNECT,TYPICAL,"Aborting posting a connect");
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"MT: vc=(%p) is already connected", vc);
+	MPIU_DBG_MSG(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Aborting posting a connect");
 	/*************** MT *****************/
         /* 1) Another thread received a connect from the same proc
          *    the current thread is connecting to and opened a 
@@ -1349,7 +1349,7 @@ static int connection_post_sendq_req(MPIDI_CH3I_Connection_t * conn)
     conn->send_active = MPIDI_CH3I_SendQ_head(vcch); /* MT */
     if (conn->send_active != NULL)
     {
-	MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"conn=%p: Posting message from connection send queue", conn );
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_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, 
diff --git a/src/mpid/ch3/util/sock/findinterfaces.c b/src/mpid/ch3/util/sock/findinterfaces.c
index cd00c5b..1f7a4e8 100644
--- a/src/mpid/ch3/util/sock/findinterfaces.c
+++ b/src/mpid/ch3/util/sock/findinterfaces.c
@@ -37,7 +37,7 @@ static int GetLocalIPs(int32_t *pIP, int max)
 	b = ((unsigned char *)(&pIP[n]))[1];
 	c = ((unsigned char *)(&pIP[n]))[2];
 	d = ((unsigned char *)(&pIP[n]))[3];
-	MPIU_DBG_MSG_FMT(CH3_OTHER,TERSE,(MPIU_DBG_FDEST,"ip: %u.%u.%u.%u\n", a, b, c, d));
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"ip: %u.%u.%u.%u\n", a, b, c, d));
 	}*/
 
 	hlist++;
diff --git a/src/mpid/ch3/util/unordered/unordered.c b/src/mpid/ch3/util/unordered/unordered.c
index d85070c..d915a55 100644
--- a/src/mpid/ch3/util/unordered/unordered.c
+++ b/src/mpid/ch3/util/unordered/unordered.c
@@ -47,13 +47,13 @@ int MPIDI_CH3U_Handle_unordered_recv_pkt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t * pkt,
 	    MPIDI_CH3_Pkt_send_container_t * pc_cur;
 	    MPIDI_CH3_Pkt_send_container_t * pc_last;
 	    
-	    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
+	    MPIU_DBG_MSG(MPIDI_CH3_DBG_OTHER,VERBOSE,
 			 "received (potentially) out-of-order send pkt");
-	    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
 	          "rank=%d, tag=%d, context=%d seqnum=%d",
 		  send_pkt->match.rank, send_pkt->match.tag, 
 		  send_pkt->match.context_id, send_pkt->seqnum));
-	    MPIU_DBG_MSG_FMAT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_MSG_FMAT(MPIDI_CH3_DBG_OTHER,VERBOSE,(MPIU_DBG_FDEST,
               "vc - seqnum_send=%d seqnum_recv=%d reorder_msg_queue=0x%08lx",
 	      vc->seqnum_send, vc->seqnum_recv, 
 	      (unsigned long) vc->msg_reorder_queue));
diff --git a/src/mpid/common/datatype/dataloop/dataloop.c b/src/mpid/common/datatype/dataloop/dataloop.c
index 6cb0841..8e0f9c0 100644
--- a/src/mpid/common/datatype/dataloop/dataloop.c
+++ b/src/mpid/common/datatype/dataloop/dataloop.c
@@ -63,7 +63,7 @@ void PREPEND_PREFIX(Dataloop_free)(DLOOP_Dataloop **dataloop)
     if (*dataloop == NULL) return;
 
 #ifdef DLOOP_DEBUG_MEMORY
-    MPIU_DBG_MSG_D(DATATYPE,VERBOSE,"DLOOP_Dataloop_free: freeing loop @ %x.\n",
+    MPIU_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE,"DLOOP_Dataloop_free: freeing loop @ %x.\n",
                    (int) *dataloop);
 #endif
 
@@ -102,7 +102,7 @@ void PREPEND_PREFIX(Dataloop_copy)(void *dest,
     DLOOP_Offset ptrdiff;
 
 #ifdef DLOOP_DEBUG_MEMORY
-    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Dataloop_copy: copying from %x to %x (%z bytes).\n",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Dataloop_copy: copying from %x to %x (%z bytes).\n",
                                        (int) src, (int) dest, (size_t)size));
 #endif
 
@@ -386,7 +386,7 @@ void PREPEND_PREFIX(Dataloop_alloc_and_copy)(int kind,
     }
 
 #ifdef DLOOP_DEBUG_MEMORY
-    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Dataloop_alloc_and_copy: new loop @ %x (tot sz = %z, loop = %z, off = %z, blk = %z, ptr = %z, extent = %z, old = %z)\n",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Dataloop_alloc_and_copy: new loop @ %x (tot sz = %z, loop = %z, off = %z, blk = %z, ptr = %z, extent = %z, old = %z)\n",
 		     (int) new_loop,
 		     new_loop_sz,
 		     loop_sz,
@@ -567,7 +567,7 @@ void PREPEND_PREFIX(Dataloop_struct_alloc)(DLOOP_Count count,
     }
 
 #ifdef DLOOP_DEBUG_MEMORY
-    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Dataloop_struct_alloc: new loop @ %x (tot sz = %z, loop = %z, off = %z, blk = %z, ptr = %z, extent = %z, basics = %z, old = %z)\n",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Dataloop_struct_alloc: new loop @ %x (tot sz = %z, loop = %z, off = %z, blk = %z, ptr = %z, extent = %z, basics = %z, old = %z)\n",
 		     (int) new_loop,
 		     new_loop_sz,
 		     loop_sz,
@@ -656,7 +656,7 @@ PREPEND_PREFIX(Dataloop_stream_size)(struct DLOOP_Dataloop *dl_p,
         case DLOOP_KIND_CONTIG:
             tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.c_t.count);
 #ifdef DLOOP_DEBUG_SIZE
-            MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: contig: ct = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+            MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: contig: ct = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                                                (int) dl_p->loop_params.c_t.count, (DLOOP_Offset) tmp_ct));
 #endif
             break;
@@ -664,7 +664,7 @@ PREPEND_PREFIX(Dataloop_stream_size)(struct DLOOP_Dataloop *dl_p,
             tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.v_t.count) *
 		      (DLOOP_Offset)(dl_p->loop_params.v_t.blocksize);
 #ifdef DLOOP_DEBUG_SIZE
-            MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: vector: ct = %d; blk = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+            MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: vector: ct = %d; blk = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                              (int) dl_p->loop_params.v_t.count,
                              (int) dl_p->loop_params.v_t.blocksize,
                              (DLOOP_Offset) tmp_ct));
@@ -674,7 +674,7 @@ PREPEND_PREFIX(Dataloop_stream_size)(struct DLOOP_Dataloop *dl_p,
             tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.bi_t.count) *
 		      (DLOOP_Offset)(dl_p->loop_params.bi_t.blocksize);
 #ifdef DLOOP_DEBUG_SIZE
-            MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: blkindexed: blks = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+            MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: blkindexed: blks = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                              (int) dl_p->loop_params.bi_t.count *
                              (int) dl_p->loop_params.bi_t.blocksize,
                              (DLOOP_Offset) tmp_ct));
@@ -683,7 +683,7 @@ PREPEND_PREFIX(Dataloop_stream_size)(struct DLOOP_Dataloop *dl_p,
         case DLOOP_KIND_INDEXED:
             tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.i_t.total_blocks);
 #ifdef DLOOP_DEBUG_SIZE
-            MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: contig: blks = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+            MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"stream_size: contig: blks = %d; new tot_ct = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                              (int) dl_p->loop_params.i_t.total_blocks,
                              (DLOOP_Offset) tmp_ct));
 #endif
@@ -724,22 +724,22 @@ void PREPEND_PREFIX(Dataloop_print)(struct DLOOP_Dataloop *dataloop,
 
     if (dataloop == NULL)
     {
-        MPIU_DBG_MSG(DATATYPE,VERBOSE,"dataloop is NULL (probably basic type)\n");
+        MPIU_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"dataloop is NULL (probably basic type)\n");
         return;
     }
 
-    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"loc=%p, treedepth=%d, kind=%d, el_extent=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"loc=%p, treedepth=%d, kind=%d, el_extent=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                                        dataloop, (int) depth, (int) dataloop->kind, (DLOOP_Offset) dataloop->el_extent));
     switch(dataloop->kind & DLOOP_KIND_MASK) {
 	case DLOOP_KIND_CONTIG:
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tCONTIG: count=%d, datatype=%p\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tCONTIG: count=%d, datatype=%p\n",
 			     (int) dataloop->loop_params.c_t.count,
                              dataloop->loop_params.c_t.dataloop));
 	    if (!(dataloop->kind & DLOOP_FINAL_MASK))
 		PREPEND_PREFIX(Dataloop_print)(dataloop->loop_params.c_t.dataloop, depth+1);
 	    break;
 	case DLOOP_KIND_VECTOR:
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tVECTOR: count=%d, blksz=%d, stride=" DLOOP_OFFSET_FMT_DEC_SPEC ", datatype=%p\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tVECTOR: count=%d, blksz=%d, stride=" DLOOP_OFFSET_FMT_DEC_SPEC ", datatype=%p\n",
 			     (int) dataloop->loop_params.v_t.count,
 			     (int) dataloop->loop_params.v_t.blocksize,
 			     (DLOOP_Offset) dataloop->loop_params.v_t.stride,
@@ -748,7 +748,7 @@ void PREPEND_PREFIX(Dataloop_print)(struct DLOOP_Dataloop *dataloop,
 		PREPEND_PREFIX(Dataloop_print)(dataloop->loop_params.v_t.dataloop, depth+1);
 	    break;
 	case DLOOP_KIND_BLOCKINDEXED:
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tBLOCKINDEXED: count=%d, blksz=%d, datatype=%p\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tBLOCKINDEXED: count=%d, blksz=%d, datatype=%p\n",
 			     (int) dataloop->loop_params.bi_t.count,
 			     (int) dataloop->loop_params.bi_t.blocksize,
                              dataloop->loop_params.bi_t.dataloop));
@@ -757,7 +757,7 @@ void PREPEND_PREFIX(Dataloop_print)(struct DLOOP_Dataloop *dataloop,
 		PREPEND_PREFIX(Dataloop_print)(dataloop->loop_params.bi_t.dataloop, depth+1);
 	    break;
 	case DLOOP_KIND_INDEXED:
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tINDEXED: count=%d, datatype=%p\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tINDEXED: count=%d, datatype=%p\n",
 			     (int) dataloop->loop_params.i_t.count,
                              dataloop->loop_params.i_t.dataloop));
 	    /* print out blocksizes and offsets later */
@@ -765,16 +765,16 @@ void PREPEND_PREFIX(Dataloop_print)(struct DLOOP_Dataloop *dataloop,
 		PREPEND_PREFIX(Dataloop_print)(dataloop->loop_params.i_t.dataloop, depth+1);
 	    break;
 	case DLOOP_KIND_STRUCT:
-	    MPIU_DBG_MSG_D(DATATYPE,VERBOSE,"\tSTRUCT: count=%d\n", (int) dataloop->loop_params.s_t.count);
-	    MPIU_DBG_MSG(DATATYPE,VERBOSE,"\tblocksizes:\n");
+	    MPIU_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE,"\tSTRUCT: count=%d\n", (int) dataloop->loop_params.s_t.count);
+	    MPIU_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"\tblocksizes:\n");
 	    for (i=0; i < dataloop->loop_params.s_t.count; i++)
-		MPIU_DBG_MSG_D(DATATYPE,VERBOSE,"\t\t%d\n", (int) dataloop->loop_params.s_t.blocksize_array[i]);
-	    MPIU_DBG_MSG(DATATYPE,VERBOSE,"\toffsets:\n");
+		MPIU_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE,"\t\t%d\n", (int) dataloop->loop_params.s_t.blocksize_array[i]);
+	    MPIU_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"\toffsets:\n");
 	    for (i=0; i < dataloop->loop_params.s_t.count; i++)
-		MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t\t" DLOOP_OFFSET_FMT_DEC_SPEC "\n", (DLOOP_Offset) dataloop->loop_params.s_t.offset_array[i]));
-	    MPIU_DBG_MSG(DATATYPE,VERBOSE,"\tdatatypes:\n");
+		MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t\t" DLOOP_OFFSET_FMT_DEC_SPEC "\n", (DLOOP_Offset) dataloop->loop_params.s_t.offset_array[i]));
+	    MPIU_DBG_MSG(MPIR_DBG_DATATYPE,VERBOSE,"\tdatatypes:\n");
 	    for (i=0; i < dataloop->loop_params.s_t.count; i++)
-		MPIU_DBG_MSG_P(DATATYPE,VERBOSE,"\t\t%p\n", dataloop->loop_params.s_t.dataloop_array[i]);
+		MPIU_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"\t\t%p\n", dataloop->loop_params.s_t.dataloop_array[i]);
 	    if (dataloop->kind & DLOOP_FINAL_MASK) break;
 
 	    for (i=0; i < dataloop->loop_params.s_t.count; i++) {
diff --git a/src/mpid/common/datatype/dataloop/dataloop_create_struct.c b/src/mpid/common/datatype/dataloop/dataloop_create_struct.c
index 7d51b7b..d240f11 100644
--- a/src/mpid/common/datatype/dataloop/dataloop_create_struct.c
+++ b/src/mpid/common/datatype/dataloop/dataloop_create_struct.c
@@ -684,14 +684,14 @@ static int DLOOP_Dataloop_create_flattened_struct(DLOOP_Count count,
     nr_blks = first_ind;
 
 #if 0
-    if (MPIU_DBG_SELECTED(DATATYPE,VERBOSE)) {
-	MPIU_DBG_OUT(DATATYPE,"--- start of flattened type ---");
+    if (MPIU_DBG_SELECTED(MPIR_DBG_DATATYPE,VERBOSE)) {
+	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"--- start of flattened type ---");
         for (i=0; i < nr_blks; i++) {
-	MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 				   "a[%d] = (%d, " DLOOP_OFFSET_FMT_DEC_SPEC ")", i,
 				   tmp_blklens[i], tmp_disps[i]));
 	}
-	MPIU_DBG_OUT(DATATYPE,"--- end of flattened type ---");
+	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"--- end of flattened type ---");
     }
 #endif
 
diff --git a/src/mpid/common/datatype/dataloop/segment.c b/src/mpid/common/datatype/dataloop/segment.c
index 2c23c1c..2f804e7 100644
--- a/src/mpid/common/datatype/dataloop/segment.c
+++ b/src/mpid/common/datatype/dataloop/segment.c
@@ -64,7 +64,7 @@ int PREPEND_PREFIX(Segment_init)(const DLOOP_Buffer buf,
 		 flag == DLOOP_DATALOOP_ALL_BYTES);
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Segment_init: count = %d, buf = %x\n",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"DLOOP_Segment_init: count = %d, buf = %x\n",
 		    count, buf));
 #endif
 
@@ -371,14 +371,14 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 
     if (first == *lastp) {
 	/* nothing to do */
-	MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"dloop_segment_manipulate: warning: first == last (" DLOOP_OFFSET_FMT_DEC_SPEC ")\n", first));
+	MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"dloop_segment_manipulate: warning: first == last (" DLOOP_OFFSET_FMT_DEC_SPEC ")\n", first));
 	return;
     }
 
     /* first we ensure that stream_off and first are in the same spot */
     if (first != stream_off) {
 #ifdef DLOOP_DEBUG_MANIPULATE
-	MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"first=" DLOOP_OFFSET_FMT_DEC_SPEC "; stream_off=" DLOOP_OFFSET_FMT_DEC_SPEC "; resetting.\n", first, stream_off));
+	MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"first=" DLOOP_OFFSET_FMT_DEC_SPEC "; stream_off=" DLOOP_OFFSET_FMT_DEC_SPEC "; resetting.\n", first, stream_off));
 #endif
 
 	if (first < stream_off) {
@@ -411,7 +411,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	DLOOP_SEGMENT_LOAD_LOCAL_VALUES;
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-	MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"done repositioning stream_off; first=" DLOOP_OFFSET_FMT_DEC_SPEC ", stream_off=" DLOOP_OFFSET_FMT_DEC_SPEC ", last=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+	MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"done repositioning stream_off; first=" DLOOP_OFFSET_FMT_DEC_SPEC ", stream_off=" DLOOP_OFFSET_FMT_DEC_SPEC ", last=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
                                            first, stream_off, last));
 #endif
     }
@@ -419,7 +419,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
     for (;;) {
 #ifdef DLOOP_DEBUG_MANIPULATE
 #if 0
-        MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"looptop; cur_sp=%d, cur_elmp=%x\n",
+        MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"looptop; cur_sp=%d, cur_elmp=%x\n",
                                            cur_sp, (unsigned) cur_elmp));
 #endif
 #endif
@@ -496,7 +496,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	    }
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\thit leaf; cur_sp=%d, elmp=%x, piece_sz=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\thit leaf; cur_sp=%d, elmp=%x, piece_sz=" DLOOP_OFFSET_FMT_DEC_SPEC "\n",
 			     cur_sp,
                              (unsigned) cur_elmp, myblocks * local_el_size));
 #endif
@@ -507,7 +507,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	    {
 		myblocks = ((last - stream_off) / stream_el_size);
 #ifdef DLOOP_DEBUG_MANIPULATE
-		MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tpartial block count=" DLOOP_OFFSET_FMT_DEC_SPEC " (" DLOOP_OFFSET_FMT_DEC_SPEC " bytes)\n",
+		MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tpartial block count=" DLOOP_OFFSET_FMT_DEC_SPEC " (" DLOOP_OFFSET_FMT_DEC_SPEC " bytes)\n",
 				 myblocks,
                                  myblocks * stream_el_size));
 #endif
@@ -695,7 +695,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	} /* end of if leaf */
 	else if (cur_elmp->curblock == 0) {
 #ifdef DLOOP_DEBUG_MANIPULATE
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\thit end of block; elmp=%x [%d]\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\thit end of block; elmp=%x [%d]\n",
                                                (unsigned) cur_elmp, cur_sp));
 #endif
 	    cur_elmp->curcount--;
@@ -726,7 +726,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 
 	    if (cur_elmp->curcount == 0) {
 #ifdef DLOOP_DEBUG_MANIPULATE
-		MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\talso hit end of count; elmp=%x [%d]\n",
+		MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\talso hit end of count; elmp=%x [%d]\n",
                                                    (unsigned) cur_elmp, cur_sp));
 #endif
 		DLOOP_SEGMENT_POP_AND_MAYBE_EXIT;
@@ -762,7 +762,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 		}
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-		MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tloading dlp=%x, elmp=%x [%d]\n",
+		MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tloading dlp=%x, elmp=%x [%d]\n",
 				 (unsigned) load_dlp,
 				 (unsigned) next_elmp,
                                  cur_sp+1));
@@ -774,7 +774,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	    }
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tpushing type, elmp=%x [%d], count=%d, block=%d\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tpushing type, elmp=%x [%d], count=%d, block=%d\n",
 			    (unsigned) cur_elmp, cur_sp, count_index,
                             block_index));
 #endif
@@ -817,7 +817,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	    }
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tstep 1: next orig_offset = " DLOOP_OFFSET_FMT_DEC_SPEC " (0x" DLOOP_OFFSET_FMT_HEX_SPEC ")\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tstep 1: next orig_offset = " DLOOP_OFFSET_FMT_DEC_SPEC " (0x" DLOOP_OFFSET_FMT_HEX_SPEC ")\n",
 			     next_elmp->orig_offset,
                              next_elmp->orig_offset));
 #endif
@@ -857,7 +857,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
 	    }
 
 #ifdef DLOOP_DEBUG_MANIPULATE
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tstep 2: next curoffset = " DLOOP_OFFSET_FMT_DEC_SPEC " (0x" DLOOP_OFFSET_FMT_HEX_SPEC ")\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\tstep 2: next curoffset = " DLOOP_OFFSET_FMT_DEC_SPEC " (0x" DLOOP_OFFSET_FMT_HEX_SPEC ")\n",
 			     next_elmp->curoffset,
                              next_elmp->curoffset));
 #endif
diff --git a/src/mpid/common/datatype/dataloop/segment_count.c b/src/mpid/common/datatype/dataloop/segment_count.c
index fd51d4b..fa0b398 100644
--- a/src/mpid/common/datatype/dataloop/segment_count.c
+++ b/src/mpid/common/datatype/dataloop/segment_count.c
@@ -103,7 +103,7 @@ static int DLOOP_Leaf_contig_count_block(DLOOP_Offset *blocks_p,
     size = *blocks_p * el_size;
 
 #ifdef MPID_SP_VERBOSE
-    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"contig count block: count = %d, buf+off = %d, lastloc = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"contig count block: count = %d, buf+off = %d, lastloc = " DLOOP_OFFSET_FMT_DEC_SPEC "\n",
 		    (int) paramp->count,
 		    (int) ((char *) bufp + rel_off),
                     paramp->last_loc));
diff --git a/src/mpid/common/datatype/dataloop/segment_flatten.c b/src/mpid/common/datatype/dataloop/segment_flatten.c
index dc1427e..0c230a6 100644
--- a/src/mpid/common/datatype/dataloop/segment_flatten.c
+++ b/src/mpid/common/datatype/dataloop/segment_flatten.c
@@ -236,7 +236,7 @@ static int DLOOP_Leaf_vector_mpi_flatten(DLOOP_Offset *blocks_p,
 	     */
 	    *blocks_p -= (blocks_left + (size / el_size));
 #ifdef MPID_SP_VERBOSE
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (1): next ind = %d, " DLOOP_OFFSET_FMT_DEC_SPEC " blocks processed.\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (1): next ind = %d, " DLOOP_OFFSET_FMT_DEC_SPEC " blocks processed.\n",
 			    paramp->u.pack_vector.index,
                             *blocks_p));
 #endif
@@ -261,7 +261,7 @@ static int DLOOP_Leaf_vector_mpi_flatten(DLOOP_Offset *blocks_p,
     }
 
 #ifdef MPID_SP_VERBOSE
-    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (2): next ind = %d, " DLOOP_OFFSET_FMT_DEC_SPEC " blocks processed.\n",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (2): next ind = %d, " DLOOP_OFFSET_FMT_DEC_SPEC " blocks processed.\n",
 		    paramp->u.pack_vector.index,
                     *blocks_p));
 #endif
diff --git a/src/mpid/common/datatype/mpid_datatype_free.c b/src/mpid/common/datatype/mpid_datatype_free.c
index e7bb965..dc34cfa 100644
--- a/src/mpid/common/datatype/mpid_datatype_free.c
+++ b/src/mpid/common/datatype/mpid_datatype_free.c
@@ -35,7 +35,7 @@ Output Parameters:
   @*/
 void MPID_Datatype_free(MPID_Datatype *ptr)
 {
-    MPIU_DBG_MSG_P(DATATYPE,VERBOSE,"type %x freed.", ptr->handle);
+    MPIU_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"type %x freed.", ptr->handle);
 
 #ifdef MPID_Dev_datatype_destroy_hook
        MPID_Dev_datatype_destroy_hook(ptr);
diff --git a/src/mpid/common/datatype/mpid_segment.c b/src/mpid/common/datatype/mpid_segment.c
index 62f6515..93cdc2b 100644
--- a/src/mpid/common/datatype/mpid_segment.c
+++ b/src/mpid/common/datatype/mpid_segment.c
@@ -234,7 +234,7 @@ static int MPID_Segment_contig_pack_to_iov(DLOOP_Offset *blocks_p,
     el_size = MPID_Datatype_get_basic_size(el_type);
     size = *blocks_p * (DLOOP_Offset) el_size;
 
-    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,
              "    contig to vec: do=" MPI_AINT_FMT_DEC_SPEC ", dp=%p, ind=%d, sz=%d, blksz=" MPI_AINT_FMT_DEC_SPEC,
 		    (MPI_Aint) rel_off,
 		    bufp,
@@ -310,7 +310,7 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
     basic_size = (DLOOP_Offset) MPID_Datatype_get_basic_size(el_type);
     blocks_left = *blocks_p;
 
-    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,
              "    vector to vec: do=" MPI_AINT_FMT_DEC_SPEC
              ", dp=%p"
              ", len=" MPI_AINT_FMT_DEC_SPEC
@@ -357,7 +357,7 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
 	     */
 	    *blocks_p -= (blocks_left + (size / basic_size));
 #ifdef MPID_SP_VERBOSE
-	    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (1): next ind = %d, " MPI_AINT_FMT_DEC_SPEC " blocks processed.\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (1): next ind = %d, " MPI_AINT_FMT_DEC_SPEC " blocks processed.\n",
 			    paramp->u.pack_vector.index,
                             (MPI_Aint) *blocks_p));
 #endif
@@ -381,7 +381,7 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
     }
 
 #ifdef MPID_SP_VERBOSE
-    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (2): next ind = %d, " MPI_AINT_FMT_DEC_SPEC " blocks processed.\n",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\t[vector to vec exiting (2): next ind = %d, " MPI_AINT_FMT_DEC_SPEC " blocks processed.\n",
 		    paramp->u.pack_vector.index,
                     (MPI_Aint) *blocks_p));
 #endif
@@ -420,7 +420,7 @@ static int MPID_Segment_contig_flatten(DLOOP_Offset *blocks_p,
     idx = paramp->u.flatten.index;
 
 #ifdef MPID_SP_VERBOSE
-    MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\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",
+    MPIU_DBG_MSG_FMT(MPIR_DBG_DATATYPE,VERBOSE,(MPIU_DBG_FDEST,"\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,
 		    MPIU_VOID_PTR_CAST_TO_MPI_AINT bufp,
 		    (MPI_Aint) rel_off,
diff --git a/src/mpid/common/datatype/mpid_type_commit.c b/src/mpid/common/datatype/mpid_type_commit.c
index de4580c..b592353 100644
--- a/src/mpid/common/datatype/mpid_type_commit.c
+++ b/src/mpid/common/datatype/mpid_type_commit.c
@@ -55,7 +55,7 @@ int MPID_Type_commit(MPI_Datatype *datatype_p)
 			     &datatype_ptr->hetero_dloop_depth,
 			     MPID_DATALOOP_HETEROGENEOUS);
 
-	MPIU_DBG_MSG_D(DATATYPE,TERSE,"# contig blocks = %d\n",
+	MPIU_DBG_MSG_D(MPIR_DBG_DATATYPE,TERSE,"# contig blocks = %d\n",
                        (int) datatype_ptr->max_contig_blocks);
 
 #if 0
diff --git a/src/mpid/common/datatype/mpid_type_contiguous.c b/src/mpid/common/datatype/mpid_type_contiguous.c
index 2aa7c39..06f18a4 100644
--- a/src/mpid/common/datatype/mpid_type_contiguous.c
+++ b/src/mpid/common/datatype/mpid_type_contiguous.c
@@ -130,7 +130,7 @@ int MPID_Type_contiguous(int count,
 
     *newtype = new_dtp->handle;
 
-    MPIU_DBG_MSG_P(DATATYPE,VERBOSE,"contig type %x created.",
+    MPIU_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"contig type %x created.",
 		   new_dtp->handle);
 
     return mpi_errno;
diff --git a/src/mpid/common/datatype/mpid_type_create_resized.c b/src/mpid/common/datatype/mpid_type_create_resized.c
index 05945ae..cd35132 100644
--- a/src/mpid/common/datatype/mpid_type_create_resized.c
+++ b/src/mpid/common/datatype/mpid_type_create_resized.c
@@ -90,7 +90,7 @@ int MPID_Type_create_resized(MPI_Datatype oldtype,
 
     *newtype_p = new_dtp->handle;
 
-    MPIU_DBG_MSG_P(DATATYPE,VERBOSE,"resized type %x created.", 
+    MPIU_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"resized type %x created.",
 		   new_dtp->handle);
 
     return MPI_SUCCESS;
diff --git a/src/mpid/common/datatype/mpid_type_debug.c b/src/mpid/common/datatype/mpid_type_debug.c
index 6c607be..95dbc23 100644
--- a/src/mpid/common/datatype/mpid_type_debug.c
+++ b/src/mpid/common/datatype/mpid_type_debug.c
@@ -39,7 +39,7 @@ void MPIDI_Datatype_dot_printf(MPI_Datatype type,
 			       int header)
 {
     if (HANDLE_GET_KIND(type) == HANDLE_KIND_BUILTIN) {
-	MPIU_DBG_OUT(DATATYPE,
+	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,
 			 "MPIDI_Datatype_dot_printf: type is a basic");
 	return;
     }
@@ -62,19 +62,19 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
     int i;
 
     if (loop_p == NULL) {
-	MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"<null dataloop>\n"));
+	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"<null dataloop>\n"));
 	return;
     }
 
     if (header) {
-	MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 		    /* graphviz does not like the 0xNNN format */
 				   "digraph %lld {   {", (long long int)loop_p));
     }
 
     switch (loop_p->kind & DLOOP_KIND_MASK) {
 	case DLOOP_KIND_CONTIG:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 	    "      dl%d [shape = record, label = \"contig |{ ct = %d; el_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext = " MPI_AINT_FMT_DEC_SPEC " }\"];",
 			    depth,
 			    (int) loop_p->loop_params.c_t.count,
@@ -82,7 +82,7 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 			    (MPI_Aint) loop_p->el_extent));
 	    break;
 	case DLOOP_KIND_VECTOR:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 	    "      dl%d [shape = record, label = \"vector |{ ct = %d; blk = %d; str = " MPI_AINT_FMT_DEC_SPEC "; el_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext =  "MPI_AINT_FMT_DEC_SPEC " }\"];",
 			    depth,
 			    (int) loop_p->loop_params.v_t.count,
@@ -92,7 +92,7 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 			    (MPI_Aint) loop_p->el_extent));
 	    break;
 	case DLOOP_KIND_INDEXED:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 	    "      dl%d [shape = record, label = \"indexed |{ ct = %d; tot_blks = %d; regions = ",
 			    depth,
 			    (int) loop_p->loop_params.i_t.count,
@@ -101,29 +101,29 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 	    for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.i_t.count; i++) {
 		if (i + 1 < loop_p->loop_params.i_t.count) {
 		    /* more regions after this one */
-		    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 		    "\\n(" MPI_AINT_FMT_DEC_SPEC ", %d), ",
 			  (MPI_Aint) loop_p->loop_params.i_t.offset_array[i],
 		          (int) loop_p->loop_params.i_t.blocksize_array[i]));
 		}
 		else {
-		    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 		           "\\n(" MPI_AINT_FMT_DEC_SPEC ", %d); ",
 		           (MPI_Aint) loop_p->loop_params.i_t.offset_array[i],
 			   (int) loop_p->loop_params.i_t.blocksize_array[i]));
 		}
 	    }
 	    if (i < loop_p->loop_params.i_t.count) {
-		MPIU_DBG_OUT(DATATYPE,"\\n...; ");
+		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"\\n...; ");
 	    }
 
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 				       "\\nel_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext = " MPI_AINT_FMT_DEC_SPEC " }\"];\n",
 				       (MPI_Aint) loop_p->el_size,
 				       (MPI_Aint) loop_p->el_extent));
 	    break;
 	case DLOOP_KIND_BLOCKINDEXED:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 	    "      dl%d [shape = record, label = \"blockindexed |{ ct = %d; blk = %d; disps = ",
 			    depth,
 			    (int) loop_p->loop_params.bi_t.count,
@@ -132,62 +132,62 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 	    for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.bi_t.count; i++) {
 		if (i + 1 < loop_p->loop_params.bi_t.count) {
 		    /* more regions after this one */
-		    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 		        MPI_AINT_FMT_DEC_SPEC ",\\n ",
 			(MPI_Aint) loop_p->loop_params.bi_t.offset_array[i]));
 		}
 		else {
-		    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 		         MPI_AINT_FMT_DEC_SPEC "; ",
 		         (MPI_Aint) loop_p->loop_params.bi_t.offset_array[i]));
 		}
 	    }
 	    if (i < loop_p->loop_params.bi_t.count) {
-		MPIU_DBG_OUT(DATATYPE,"...; ");
+		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"...; ");
 	    }
 
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 				      "\\nel_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext = " MPI_AINT_FMT_DEC_SPEC " }\"];",
 				       (MPI_Aint) loop_p->el_size,
 				       (MPI_Aint) loop_p->el_extent));
 	    break;
 	case DLOOP_KIND_STRUCT:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 	    "      dl%d [shape = record, label = \"struct | {ct = %d; blks = ",
 			    depth,
 			    (int) loop_p->loop_params.s_t.count));
 	    for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.s_t.count; i++) {
 		if (i + 1 < loop_p->loop_params.s_t.count) {
-		    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"%d, ",
+		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"%d, ",
 			    (int) loop_p->loop_params.s_t.blocksize_array[i]));
 		}
 		else {
-		    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"%d; ",
+		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"%d; ",
 			    (int) loop_p->loop_params.s_t.blocksize_array[i]));
 		}
 	    }
 	    if (i < loop_p->loop_params.s_t.count) {
-		MPIU_DBG_OUT(DATATYPE,"...; disps = ");
+		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"...; disps = ");
 	    }
 	    else {
-		MPIU_DBG_OUT(DATATYPE,"disps = ");
+		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"disps = ");
 	    }
 
 	    for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.s_t.count; i++) {
 		if (i + 1 < loop_p->loop_params.s_t.count) {
-		    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,MPI_AINT_FMT_DEC_SPEC ", ",
+		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,MPI_AINT_FMT_DEC_SPEC ", ",
 			    (MPI_Aint) loop_p->loop_params.s_t.offset_array[i]));
 		}
 		else {
-		    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,MPI_AINT_FMT_DEC_SPEC "; ",
+		    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,MPI_AINT_FMT_DEC_SPEC "; ",
 			    (MPI_Aint) loop_p->loop_params.s_t.offset_array[i]));
 		}
 	    }
 	    if (i < loop_p->loop_params.s_t.count) {
-		MPIU_DBG_OUT(DATATYPE,"... }\"];");
+		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"... }\"];");
 	    }
 	    else {
-		MPIU_DBG_OUT(DATATYPE,"}\"];");
+		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"}\"];");
 	    }
 	    break;
 	default:
@@ -196,7 +196,7 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 
     if (!(loop_p->kind & DLOOP_FINAL_MASK)) {
 	/* more loops to go; recurse */
-	MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 				   "      dl%d -> dl%d;\n", depth, depth + 1));
 	switch (loop_p->kind & DLOOP_KIND_MASK) {
 	    case DLOOP_KIND_CONTIG:
@@ -218,13 +218,13 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
 		}
 		break;
 	    default:
-		MPIU_DBG_OUT(DATATYPE,"      < unsupported type >");
+		MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"      < unsupported type >");
 	}
     }
 
 
     if (header) {
-	MPIU_DBG_OUT(DATATYPE,"   }\n}");
+	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"   }\n}");
     }
     return;
 }
@@ -264,11 +264,11 @@ void MPIDI_Datatype_printf(MPI_Datatype type,
 
     if (header == 1) {
 	/*               012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 */
-	MPIU_DBG_OUT(DATATYPE,"------------------------------------------------------------------------------------------------------------------------------------------\n");
-	MPIU_DBG_OUT(DATATYPE,"depth                   type         size       extent      true_lb      true_ub           lb(s)           ub(s)         disp       blklen\n");
-	MPIU_DBG_OUT(DATATYPE,"------------------------------------------------------------------------------------------------------------------------------------------\n");
+	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"------------------------------------------------------------------------------------------------------------------------------------------\n");
+	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"depth                   type         size       extent      true_lb      true_ub           lb(s)           ub(s)         disp       blklen\n");
+	MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"------------------------------------------------------------------------------------------------------------------------------------------\n");
     }
-    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"%5d  %21s  %11d  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "(" MPI_AINT_FMT_DEC_SPEC ")  " MPI_AINT_FMT_DEC_SPEC "(" MPI_AINT_FMT_DEC_SPEC ")  " MPI_AINT_FMT_DEC_SPEC "  %11d",
+    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"%5d  %21s  %11d  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "  " MPI_AINT_FMT_DEC_SPEC "(" MPI_AINT_FMT_DEC_SPEC ")  " MPI_AINT_FMT_DEC_SPEC "(" MPI_AINT_FMT_DEC_SPEC ")  " MPI_AINT_FMT_DEC_SPEC "  %11d",
 		    depth,
 		    string,
 		    (int) size,
@@ -449,13 +449,13 @@ void MPIDU_Datatype_debug(MPI_Datatype type,
      * fortran support included.
      */
     if (type == MPI_DATATYPE_NULL) {
-	MPIU_DBG_OUT_FMT(DATATYPE,
+	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,
 			 (MPIU_DBG_FDEST,
 			  "# MPIU_Datatype_debug: MPI_Datatype = MPI_DATATYPE_NULL"));
 	return;
     }
 
-    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 	       "# MPIU_Datatype_debug: MPI_Datatype = 0x%0x (%s)", type,
 	       (is_builtin) ? MPIDU_Datatype_builtin_to_string(type) :
 	        "derived"));
@@ -465,7 +465,7 @@ void MPIDU_Datatype_debug(MPI_Datatype type,
     MPID_Datatype_get_ptr(type, dtp);
     MPIU_Assert(dtp != NULL);
 
-    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
       "# Size = " MPI_AINT_FMT_DEC_SPEC ", Extent = " MPI_AINT_FMT_DEC_SPEC ", LB = " MPI_AINT_FMT_DEC_SPEC "%s, UB = " MPI_AINT_FMT_DEC_SPEC "%s, Extent = " MPI_AINT_FMT_DEC_SPEC ", Element Size = " MPI_AINT_FMT_DEC_SPEC " (%s), %s",
 		    (MPI_Aint) dtp->size,
 		    (MPI_Aint) dtp->extent,
@@ -479,10 +479,10 @@ void MPIDU_Datatype_debug(MPI_Datatype type,
 		    MPIDU_Datatype_builtin_to_string(dtp->basic_type),
 		    dtp->is_contig ? "is N contig" : "is not N contig"));
 
-    MPIU_DBG_OUT(DATATYPE,"# Contents:");
+    MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"# Contents:");
     MPIDI_Datatype_contents_printf(type, 0, array_ct);
 
-    MPIU_DBG_OUT(DATATYPE,"# Dataloop:");
+    MPIU_DBG_OUT(MPIR_DBG_DATATYPE,"# Dataloop:");
     MPIDI_Datatype_dot_printf(type, 0, 1);
 }
 
@@ -524,7 +524,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
     int *ints = NULL;
 
     if (HANDLE_GET_KIND(type) == HANDLE_KIND_BUILTIN) {
-	MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"# %stype: %s\n",
+	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %stype: %s\n",
 			MPIDI_Datatype_depth_spacing(depth),
 			MPIDU_Datatype_builtin_to_string(type)));
 	return;
@@ -534,7 +534,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
     cp = dtp->contents;
 
     if (cp == NULL) {
-	MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"# <NULL>\n"));
+	MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# <NULL>\n"));
 	return;
     }
 
@@ -555,7 +555,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
     }
 
 
-    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"# %scombiner: %s",
+    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %scombiner: %s",
 		    MPIDI_Datatype_depth_spacing(depth),
 		    MPIDU_Datatype_combiner_to_string(cp->combiner)));
 
@@ -567,7 +567,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 	    /* not done */
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_CONTIGUOUS:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"# %scontig ct = %d\n",
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %scontig ct = %d\n",
 			    MPIDI_Datatype_depth_spacing(depth),
 				       *ints));
 	    MPIDI_Datatype_contents_printf(*types,
@@ -575,7 +575,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 					   acount);
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_VECTOR:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 	                "# %svector ct = %d, blk = %d, str = %d\n",
 			MPIDI_Datatype_depth_spacing(depth),
 			    ints[0],
@@ -586,7 +586,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 					   acount);
 	    __mpidi_datatype_free_and_return;
         case MPI_COMBINER_HVECTOR:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 	                  "# %shvector ct = %d, blk = %d, str = " MPI_AINT_FMT_DEC_SPEC "\n",
 			    MPIDI_Datatype_depth_spacing(depth),
 			    ints[0],
@@ -597,11 +597,11 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 					   acount);
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_INDEXED:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"# %sindexed ct = %d:",
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %sindexed ct = %d:",
 			    MPIDI_Datatype_depth_spacing(depth),
 			    ints[0]));
 	    for (i=0; i < acount && i < ints[0]; i++) {
-		MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+		MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 		         "# %s  indexed [%d]: blk = %d, disp = %d\n",
 				MPIDI_Datatype_depth_spacing(depth),
 				i,
@@ -613,11 +613,11 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 	    }
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_HINDEXED:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"# %shindexed ct = %d:",
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %shindexed ct = %d:",
 			    MPIDI_Datatype_depth_spacing(depth),
 			    ints[0]));
 	    for (i=0; i < acount && i < ints[0]; i++) {
-		MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+		MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 		            "# %s  hindexed [%d]: blk = %d, disp = " MPI_AINT_FMT_DEC_SPEC "\n",
 				MPIDI_Datatype_depth_spacing(depth),
 				i,
@@ -629,11 +629,11 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 	    }
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_STRUCT:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"# %sstruct ct = %d:",
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %sstruct ct = %d:",
 			    MPIDI_Datatype_depth_spacing(depth),
 			    (int) ints[0]));
 	    for (i=0; i < acount && i < ints[0]; i++) {
-		MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+		MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 		           "# %s  struct[%d]: blk = %d, disp = " MPI_AINT_FMT_DEC_SPEC "\n",
 				MPIDI_Datatype_depth_spacing(depth),
 				i,
@@ -645,11 +645,11 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 	    }
 	    __mpidi_datatype_free_and_return;
 	case MPI_COMBINER_SUBARRAY:
-	    MPIU_DBG_OUT_FMT(DATATYPE, (MPIU_DBG_FDEST,"# %ssubarray ct = %d:",
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE, (MPIU_DBG_FDEST,"# %ssubarray ct = %d:",
 			MPIDI_Datatype_depth_spacing(depth),
 			(int) ints[0]));
 	    for (i=0; i< acount && i < ints[0]; i++) {
-		MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
+		MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,
 			    "# %s  sizes[%d] = %d subsizes[%d] = %d starts[%d] = %d\n",
 			    MPIDI_Datatype_depth_spacing(depth),
 			    i, (int)ints[i+1],
@@ -662,7 +662,7 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
 	    __mpidi_datatype_free_and_return;
 
 	default:
-	    MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"# %sunhandled combiner",
+	    MPIU_DBG_OUT_FMT(MPIR_DBG_DATATYPE,(MPIU_DBG_FDEST,"# %sunhandled combiner",
 			MPIDI_Datatype_depth_spacing(depth)));
 	    __mpidi_datatype_free_and_return;
     }
diff --git a/src/mpid/common/datatype/mpid_type_dup.c b/src/mpid/common/datatype/mpid_type_dup.c
index d4a8b3c..0de2a00 100644
--- a/src/mpid/common/datatype/mpid_type_dup.c
+++ b/src/mpid/common/datatype/mpid_type_dup.c
@@ -104,7 +104,7 @@ int MPID_Type_dup(MPI_Datatype oldtype,
       }
     }
 
-    MPIU_DBG_MSG_D(DATATYPE,VERBOSE, "dup type %x created.", *newtype);
+    MPIU_DBG_MSG_D(MPIR_DBG_DATATYPE,VERBOSE, "dup type %x created.", *newtype);
 
  fn_fail:
     return mpi_errno;
diff --git a/src/mpid/common/datatype/mpid_type_vector.c b/src/mpid/common/datatype/mpid_type_vector.c
index 67e398f..4ef8462 100644
--- a/src/mpid/common/datatype/mpid_type_vector.c
+++ b/src/mpid/common/datatype/mpid_type_vector.c
@@ -159,7 +159,7 @@ int MPID_Type_vector(int count,
 
     *newtype = new_dtp->handle;
 
-    MPIU_DBG_MSG_P(DATATYPE,VERBOSE,"vector type %x created.",
+    MPIU_DBG_MSG_P(MPIR_DBG_DATATYPE,VERBOSE,"vector type %x created.",
 		   new_dtp->handle);
 
     return mpi_errno;
diff --git a/src/mpid/common/hcoll/hcoll.h b/src/mpid/common/hcoll/hcoll.h
index fbabdda..0399c36 100644
--- a/src/mpid/common/hcoll/hcoll.h
+++ b/src/mpid/common/hcoll/hcoll.h
@@ -13,6 +13,10 @@
 
 extern int world_comm_destroying;
 
+#if defined(USE_DBG_LOGGING)
+extern MPIU_DBG_Class MPIR_DBG_HCOLL;
+#endif /* USE_DBG_LOGGING */
+
 int hcoll_comm_create(MPID_Comm * comm, void *param);
 int hcoll_comm_destroy(MPID_Comm * comm, void *param);
 
diff --git a/src/mpid/common/hcoll/hcoll_init.c b/src/mpid/common/hcoll/hcoll_init.c
index bf8c3c6..84512a3 100644
--- a/src/mpid/common/hcoll/hcoll_init.c
+++ b/src/mpid/common/hcoll/hcoll_init.c
@@ -22,6 +22,10 @@ int hcoll_enable_iallreduce = 1;
 int hcoll_comm_attr_keyval = MPI_KEYVAL_INVALID;
 int world_comm_destroying = 0;
 
+#if defined(USE_DBG_LOGGING)
+MPIU_DBG_Class MPIR_DBG_HCOLL;
+#endif /* USE_DBG_LOGGING */
+
 #undef FUNCNAME
 #define FUNCNAME hcoll_destroy
 #undef FCNAME
@@ -53,7 +57,7 @@ static int hcoll_comm_attr_del_fn(MPI_Comm comm, int keyval, void *attr_val, voi
         envar = getenv("HCOLL_ENABLE_" #nameEnv); \
         if (NULL != envar) { \
             hcoll_enable_##name = atoi(envar); \
-            MPIU_DBG_MSG_D(HCOLL, VERBOSE, "HCOLL_ENABLE_" #nameEnv " = %d\n", hcoll_enable_##name); \
+            MPIU_DBG_MSG_D(MPIR_DBG_HCOLL, VERBOSE, "HCOLL_ENABLE_" #nameEnv " = %d\n", hcoll_enable_##name); \
         } \
     } while (0)
 
@@ -73,6 +77,11 @@ int hcoll_initialize(void)
     if (0 == hcoll_enable) {
         goto fn_exit;
     }
+
+#if defined(USE_DBG_LOGGING)
+    MPIR_DBG_HCOLL = MPIU_DBG_Class_alloc("HCOLL", "hcoll");
+#endif /* USE_DBG_LOGGING */
+
     hcoll_rte_fns_setup();
     /*set INT_MAX/2 as tag_base here by the moment.
      * Need to think more about it.
@@ -123,7 +132,7 @@ int hcoll_initialize(void)
 #define INSTALL_COLL_WRAPPER(check_name, name) \
     if (hcoll_enable_##check_name && (NULL != hcoll_collectives.coll_##check_name)) { \
         comm_ptr->coll_fns->name      = hcoll_##name; \
-        MPIU_DBG_MSG(HCOLL,VERBOSE, #name " wrapper installed"); \
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL,VERBOSE, #name " wrapper installed"); \
     }
 
 #undef FUNCNAME
@@ -158,7 +167,7 @@ int hcoll_comm_create(MPID_Comm * comm_ptr, void *param)
     }
     comm_ptr->hcoll_priv.hcoll_context = hcoll_create_context((rte_grp_handle_t) comm_ptr);
     if (NULL == comm_ptr->hcoll_priv.hcoll_context) {
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "Couldn't create hcoll context.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "Couldn't create hcoll context.");
         goto fn_fail;
     }
     mpi_errno =
diff --git a/src/mpid/common/hcoll/hcoll_ops.c b/src/mpid/common/hcoll/hcoll_ops.c
index f58b558..f308597 100644
--- a/src/mpid/common/hcoll/hcoll_ops.c
+++ b/src/mpid/common/hcoll/hcoll_ops.c
@@ -15,17 +15,17 @@ int hcoll_Barrier(MPID_Comm * comm_ptr, MPIR_Errflag_t *err)
 {
     int rc;
     MPI_Comm comm = comm_ptr->handle;
-    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOL BARRIER.");
+    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL BARRIER.");
     rc = hcoll_collectives.coll_barrier(comm_ptr->hcoll_priv.hcoll_context);
     if (HCOLL_SUCCESS != rc) {
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK BARRIER.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BARRIER.");
         void *ptr = comm_ptr->coll_fns->Barrier;
         comm_ptr->coll_fns->Barrier =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Barrier : NULL;
         rc = MPI_Barrier(comm);
         comm_ptr->coll_fns->Barrier = ptr;
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK BARRIER - done.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BARRIER - done.");
     }
     return rc;
 }
@@ -39,7 +39,7 @@ int hcoll_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
 {
     dte_data_representation_t dtype;
     int rc;
-    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOLL BCAST.");
+    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL BCAST.");
     dtype = mpi_dtype_2_dte_dtype(datatype);
     int is_homogeneous = 1, use_fallback = 0;
     MPI_Comm comm = comm_ptr->handle;
@@ -51,7 +51,7 @@ int hcoll_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
         /*If we are here then datatype is not simple predefined datatype */
         /*In future we need to add more complex mapping to the dte_data_representation_t */
         /* Now use fallback */
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout, calling fallback bcast.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback bcast.");
         use_fallback = 1;
     }
     else {
@@ -62,14 +62,14 @@ int hcoll_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
         }
     }
     if (1 == use_fallback) {
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK BCAST - done.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BCAST - done.");
         void *ptr = comm_ptr->coll_fns->Bcast;
         comm_ptr->coll_fns->Bcast =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Bcast : NULL;
         rc = MPI_Bcast(buffer, count, datatype, root, comm);
         comm_ptr->coll_fns->Bcast = ptr;
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK BCAST - done.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK BCAST - done.");
     }
     return rc;
 }
@@ -91,7 +91,7 @@ int hcoll_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOL ALLREDUCE.");
+    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL ALLREDUCE.");
     Dtype = mpi_dtype_2_dte_dtype(datatype);
     Op = mpi_op_2_dte_op(op);
     if (MPI_IN_PLACE == sendbuf) {
@@ -99,7 +99,7 @@ int hcoll_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
     }
     if (HCOL_DTE_IS_COMPLEX(Dtype) || HCOL_DTE_IS_ZERO(Dtype) || (0 == is_homogeneous) ||
         (HCOL_DTE_OP_NULL == Op->id)) {
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout, calling fallback allreduce.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback allreduce.");
         use_fallback = 1;
     }
     else {
@@ -113,14 +113,14 @@ int hcoll_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
         if (HCOLL_IN_PLACE == sendbuf) {
             sendbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK ALLREDUCE.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLREDUCE.");
         void *ptr = comm_ptr->coll_fns->Allreduce;
         comm_ptr->coll_fns->Allreduce =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Allreduce : NULL;
         rc = MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm);
         comm_ptr->coll_fns->Allreduce = ptr;
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK ALLREDUCE done.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLREDUCE done.");
     }
     return rc;
 }
@@ -143,7 +143,7 @@ int hcoll_Allgather(const void *sbuf, int scount, MPI_Datatype sdtype,
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOLL ALLGATHER.");
+    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL ALLGATHER.");
     stype = mpi_dtype_2_dte_dtype(sdtype);
     rtype = mpi_dtype_2_dte_dtype(rdtype);
     if (MPI_IN_PLACE == sbuf) {
@@ -151,7 +151,7 @@ int hcoll_Allgather(const void *sbuf, int scount, MPI_Datatype sdtype,
     }
     if (HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) ||
         HCOL_DTE_IS_COMPLEX(rtype) || is_homogeneous == 0) {
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout; calling fallback allgather.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout; calling fallback allgather.");
         use_fallback = 1;
     }
     else {
@@ -165,14 +165,14 @@ int hcoll_Allgather(const void *sbuf, int scount, MPI_Datatype sdtype,
         if (HCOLL_IN_PLACE == sbuf) {
             sbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK ALLGATHER.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLGATHER.");
         void *ptr = comm_ptr->coll_fns->Allgather;
         comm_ptr->coll_fns->Allgather =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Allgather : NULL;
         rc = MPI_Allgather(sbuf, scount, sdtype, rbuf, rcount, rdtype, comm);
         comm_ptr->coll_fns->Allgather = ptr;
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK ALLGATHER - done.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK ALLGATHER - done.");
     }
     return rc;
 }
@@ -188,11 +188,11 @@ int hcoll_Ibarrier_req(MPID_Comm * comm_ptr, MPID_Request ** request)
     MPI_Comm comm;
     MPI_Request req;
     comm = comm_ptr->handle;
-    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOL IBARRIER.");
+    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL IBARRIER.");
     rt_handle = (void **) request;
     rc = hcoll_collectives.coll_ibarrier(comm_ptr->hcoll_priv.hcoll_context, rt_handle);
     if (HCOLL_SUCCESS != rc) {
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IBARRIER.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBARRIER.");
         void *ptr = comm_ptr->coll_fns->Ibarrier_req;
         comm_ptr->coll_fns->Ibarrier_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -200,7 +200,7 @@ int hcoll_Ibarrier_req(MPID_Comm * comm_ptr, MPID_Request ** request)
         rc = MPI_Ibarrier(comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Ibarrier_req = ptr;
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IBARRIER - done.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBARRIER - done.");
     }
     return rc;
 }
@@ -215,7 +215,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
     int rc;
     void **rt_handle;
     dte_data_representation_t dtype;
-    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOLL IBCAST.");
+    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL IBCAST.");
     dtype = mpi_dtype_2_dte_dtype(datatype);
     int is_homogeneous = 1, use_fallback = 0;
     MPI_Comm comm = comm_ptr->handle;
@@ -229,7 +229,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
         /*If we are here then datatype is not simple predefined datatype */
         /*In future we need to add more complex mapping to the dte_data_representation_t */
         /* Now use fallback */
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout, calling fallback ibcast.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback ibcast.");
         use_fallback = 1;
     }
     else {
@@ -240,7 +240,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
         }
     }
     if (1 == use_fallback) {
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
         void *ptr = comm_ptr->coll_fns->Ibcast_req;
         comm_ptr->coll_fns->Ibcast_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -248,7 +248,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
         rc = MPI_Ibcast(buffer, count, datatype, root, comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Ibcast_req = ptr;
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
     }
     return rc;
 }
@@ -276,7 +276,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOLL IALLGATHER.");
+    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOLL IALLGATHER.");
     stype = mpi_dtype_2_dte_dtype(sendtype);
     rtype = mpi_dtype_2_dte_dtype(recvtype);
     if (MPI_IN_PLACE == sendbuf) {
@@ -284,7 +284,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
     }
     if (HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) ||
         HCOL_DTE_IS_COMPLEX(rtype) || is_homogeneous == 0) {
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout; calling fallback iallgather.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout; calling fallback iallgather.");
         use_fallback = 1;
     }
     else {
@@ -298,7 +298,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
         if (HCOLL_IN_PLACE == sendbuf) {
             sendbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IALLGATHER.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLGATHER.");
         void *ptr = comm_ptr->coll_fns->Iallgather_req;
         comm_ptr->coll_fns->Iallgather_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -306,7 +306,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
         rc = MPI_Iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Iallgather_req = ptr;
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IALLGATHER - done.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLGATHER - done.");
     }
     return rc;
 }
@@ -331,7 +331,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOL IALLREDUCE.");
+    MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING HCOL IALLREDUCE.");
     Dtype = mpi_dtype_2_dte_dtype(datatype);
     Op = mpi_op_2_dte_op(op);
     if (MPI_IN_PLACE == sendbuf) {
@@ -339,7 +339,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
     }
     if (HCOL_DTE_IS_COMPLEX(Dtype) || HCOL_DTE_IS_ZERO(Dtype) || (0 == is_homogeneous) ||
         (HCOL_DTE_OP_NULL == Op->id)) {
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout, calling fallback iallreduce.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "unsupported data layout, calling fallback iallreduce.");
         use_fallback = 1;
     }
     else {
@@ -353,7 +353,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
         if (HCOLL_IN_PLACE == sendbuf) {
             sendbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IALLREDUCE.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLREDUCE.");
         void *ptr = comm_ptr->coll_fns->Iallreduce_req;
         comm_ptr->coll_fns->Iallreduce_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -361,7 +361,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
         rc = MPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Iallreduce_req = ptr;
-        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IALLREDUCE done.");
+        MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "RUNNING FALLBACK IALLREDUCE done.");
     }
     return rc;
 }
diff --git a/src/mpid/common/hcoll/hcoll_rte.c b/src/mpid/common/hcoll/hcoll_rte.c
index 8bd6f9b..3b24abf 100644
--- a/src/mpid/common/hcoll/hcoll_rte.c
+++ b/src/mpid/common/hcoll/hcoll_rte.c
@@ -160,7 +160,7 @@ static int recv_nb(struct dte_data_representation_t data,
             /* We have a full data description & buffer pointer simultaneously.
              * It is ambiguous. Throw a warning since the user might have made a
              * mistake with data reps */
-            MPIU_DBG_MSG(HCOLL, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
+            MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
                          "representation: buffer_pointer is ignored");
         }
         total_entries_number = count_total_dte_repeat_entries(&data);
@@ -227,7 +227,7 @@ static int send_nb(dte_data_representation_t data,
             /* We have a full data description & buffer pointer simultaneously.
              * It is ambiguous. Throw a warning since the user might have made a
              * mistake with data reps */
-            MPIU_DBG_MSG(HCOLL, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
+            MPIU_DBG_MSG(MPIR_DBG_HCOLL, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
                          "representation: buffer_pointer is ignored");
         }
         total_entries_number = count_total_dte_repeat_entries(&data);
diff --git a/src/mpid/common/sched/mpidu_sched.c b/src/mpid/common/sched/mpidu_sched.c
index 5c3ca7c..4344a34 100644
--- a/src/mpid/common/sched/mpidu_sched.c
+++ b/src/mpid/common/sched/mpidu_sched.c
@@ -135,7 +135,7 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
     switch (e->type) {
     case MPIDU_SCHED_ENTRY_SEND:
         comm = e->u.send.comm;
-        MPIU_DBG_MSG_D(COMM, VERBOSE, "starting SEND entry %d\n", (int) idx);
+        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting SEND entry %d\n", (int) idx);
         if (e->u.send.count_p) {
             /* deferred send */
             /* originally there was no branch and send.count_p was set to
@@ -165,14 +165,14 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
                 }
             }
             e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
-            MPIU_DBG_MSG_D(COMM, VERBOSE, "Sched SEND failed. Errflag: %d\n", (int) r->errflag);
+            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Sched SEND failed. Errflag: %d\n", (int) r->errflag);
         }
         else {
             e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
         }
         break;
     case MPIDU_SCHED_ENTRY_RECV:
-        MPIU_DBG_MSG_D(COMM, VERBOSE, "starting RECV entry %d\n", (int) idx);
+        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting RECV entry %d\n", (int) idx);
         comm = e->u.recv.comm;
         ret_errno = MPIC_Irecv(e->u.recv.buf, e->u.recv.count, e->u.recv.datatype,
                                e->u.recv.src, s->tag, comm, &e->u.recv.rreq);
@@ -189,14 +189,14 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
             /* We should set the status to failed here - since the request is not freed. this
              * will be handled later in MPIDU_Sched_progress_state, so set to started here */
             e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
-            MPIU_DBG_MSG_D(COMM, VERBOSE, "Sched RECV failed. Errflag: %d\n", (int) r->errflag);
+            MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "Sched RECV failed. Errflag: %d\n", (int) r->errflag);
         }
         else {
             e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
         }
         break;
     case MPIDU_SCHED_ENTRY_REDUCE:
-        MPIU_DBG_MSG_D(COMM, VERBOSE, "starting REDUCE entry %d\n", (int) idx);
+        MPIU_DBG_MSG_D(MPIR_DBG_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);
@@ -211,7 +211,7 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
         e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
         break;
     case MPIDU_SCHED_ENTRY_COPY:
-        MPIU_DBG_MSG_D(COMM, VERBOSE, "starting COPY entry %d\n", (int) idx);
+        MPIU_DBG_MSG_D(MPIR_DBG_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)
@@ -221,11 +221,11 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
         e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
         break;
     case MPIDU_SCHED_ENTRY_NOP:
-        MPIU_DBG_MSG_D(COMM, VERBOSE, "starting NOOP entry %d\n", (int) idx);
+        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting NOOP entry %d\n", (int) idx);
         /* nothing to be done */
         break;
     case MPIDU_SCHED_ENTRY_CB:
-        MPIU_DBG_MSG_D(COMM, VERBOSE, "starting CB entry %d\n", (int) idx);
+        MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "starting CB entry %d\n", (int) idx);
         if (e->u.cb.cb_type == MPIDU_SCHED_CB_TYPE_1) {
             ret_errno = e->u.cb.u.cb_p(r->comm, s->tag, e->u.cb.cb_state);
             /* Sched entries list can be reallocated inside callback */
@@ -265,14 +265,14 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
             }
         }
         else {
-            MPIU_DBG_MSG_D(COMM, TYPICAL, "unknown callback type, e->u.cb.cb_type=%d",
+            MPIU_DBG_MSG_D(MPIR_DBG_COMM, TYPICAL, "unknown callback type, e->u.cb.cb_type=%d",
                            e->u.cb.cb_type);
             e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
         }
 
         break;
     default:
-        MPIU_DBG_MSG_D(COMM, TYPICAL, "unknown entry type, e->type=%d", e->type);
+        MPIU_DBG_MSG_D(MPIR_DBG_COMM, TYPICAL, "unknown entry type, e->type=%d", e->type);
         break;
     }
 
@@ -441,7 +441,7 @@ int MPIDU_Sched_start(MPID_Sched_t * sp, MPID_Comm * comm, int tag, MPID_Request
     }
     MPL_DL_APPEND(all_schedules.head, s);
 
-    MPIU_DBG_MSG_P(COMM, TYPICAL, "started schedule s=%p\n", s);
+    MPIU_DBG_MSG_P(MPIR_DBG_COMM, TYPICAL, "started schedule s=%p\n", s);
     MPIDU_Sched_dump(s);
 
   fn_exit:
@@ -888,7 +888,7 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
             switch (e->type) {
             case MPIDU_SCHED_ENTRY_SEND:
                 if (e->u.send.sreq != NULL && MPID_Request_is_complete(e->u.send.sreq)) {
-                    MPIU_DBG_MSG_FMT(COMM, VERBOSE,
+                    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
                                      (MPIU_DBG_FDEST, "completed SEND entry %d, sreq=%p\n", (int) i,
                                       e->u.send.sreq));
                     if (s->req->errflag != MPIR_ERR_NONE)
@@ -903,7 +903,7 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
                 break;
             case MPIDU_SCHED_ENTRY_RECV:
                 if (e->u.recv.rreq != NULL && MPID_Request_is_complete(e->u.recv.rreq)) {
-                    MPIU_DBG_MSG_FMT(COMM, VERBOSE,
+                    MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
                                      (MPIU_DBG_FDEST, "completed RECV entry %d, rreq=%p\n", (int) i,
                                       e->u.recv.rreq));
                     MPIR_Process_status(&e->u.recv.rreq->status, &s->req->errflag);
@@ -931,7 +931,7 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
 
             if (i == s->idx && e->status >= MPIDU_SCHED_ENTRY_STATUS_COMPLETE) {
                 ++s->idx;
-                MPIU_DBG_MSG_D(COMM, VERBOSE, "completed OTHER entry %d\n", (int) i);
+                MPIU_DBG_MSG_D(MPIR_DBG_COMM, VERBOSE, "completed OTHER entry %d\n", (int) i);
                 if (e->is_barrier) {
                     /* post/perform the next round of operations */
                     mpi_errno = MPIDU_Sched_continue(s);
@@ -946,7 +946,7 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
         }
 
         if (s->idx == s->num_entries) {
-            MPIU_DBG_MSG_FMT(COMM, VERBOSE,
+            MPIU_DBG_MSG_FMT(MPIR_DBG_COMM, VERBOSE,
                              (MPIU_DBG_FDEST, "completing and dequeuing s=%p r=%p\n", s, s->req));
 
             /* dequeue this schedule from the state, it's complete */
diff --git a/src/mpid/common/sock/iocp/sock.c b/src/mpid/common/sock/iocp/sock.c
index cc712c1..66cba6e 100644
--- a/src/mpid/common/sock/iocp/sock.c
+++ b/src/mpid/common/sock/iocp/sock.c
@@ -692,7 +692,7 @@ int MPIDU_Sock_hostname_to_host_description(char *hostname, char *host_descripti
     iter = list;
     while (iter)
     {
-        MPIU_DBG_MSG_S(OTHER,TERSE,"adding host: %s\n", iter->host);
+        MPIU_DBG_MSG_S(MPIR_DBG_OTHER,TERSE,"adding host: %s\n", iter->host);
         str_errno = MPIU_Str_add_string(&host_description, &len, iter->host);
         MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPIDU_SOCK_ERR_NOMEM, "**desc_len");
 
@@ -1412,13 +1412,13 @@ int MPIDU_Sock_post_close(MPIDU_Sock_t sock)
 	/*MPIU_Assert(sock->state != 0);*/ /* The state can be 0 if the operation was aborted */
 #ifdef MPICH_DBG_OUTPUT
 	if (sock->state & SOCKI_CONNECTING)
-	    MPIU_DBG_MSG_D(OTHER,TERSE,"sock_post_close(%d) called while sock is connecting.\n", MPIDU_Sock_get_sock_id(sock));
+	    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_post_close(%d) called while sock is connecting.\n", MPIDU_Sock_get_sock_id(sock));
 	if (sock->state & SOCKI_READING)
 	{
 	    int i, n = 0;
 	    for (i=0; i<sock->read.iovlen; i++)
 		n += sock->read.iov[i].MPL_IOV_LEN;
-	    MPIU_DBG_MSG_FMT(OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_close(%d) called while sock is reading: %d bytes out of %d, index %d, iovlen %d.\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_close(%d) called while sock is reading: %d bytes out of %d, index %d, iovlen %d.\n",
 		MPIDU_Sock_get_sock_id(sock), sock->read.total, n, sock->read.index, sock->read.iovlen));
 	}
 	if (sock->state & SOCKI_WRITING)
@@ -1426,7 +1426,7 @@ int MPIDU_Sock_post_close(MPIDU_Sock_t sock)
 	    int i, n = 0;
 	    for (i=0; i<sock->write.iovlen; i++)
 		n += sock->write.iov[i].MPL_IOV_LEN;
-	    MPIU_DBG_MSG_FMT(OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_close(%d) called while sock is writing: %d bytes out of %d, index %d, iovlen %d.\n",
+	    MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_close(%d) called while sock is writing: %d bytes out of %d, index %d, iovlen %d.\n",
 		MPIDU_Sock_get_sock_id(sock), sock->write.total, n, sock->write.index, sock->write.iovlen));
 	}
 	fflush(stdout);
@@ -1584,7 +1584,7 @@ int MPIDU_Sock_post_readv(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIDU_Soc
 #ifdef MPICH_DBG_OUTPUT
     for (i=0; i<iov_n; i++)
     {
-	MPIU_DBG_MSG_FMT(OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_readv - iov[%d].len = %d\n", i, iov[i].MPL_IOV_LEN));
+	MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_readv - iov[%d].len = %d\n", i, iov[i].MPL_IOV_LEN));
     }
 #endif
     for (iter=0; iter<10; iter++)
@@ -1698,7 +1698,7 @@ int MPIDU_Sock_post_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIDU_So
 #ifdef MPICH_DBG_OUTPUT
     for (i=0; i<iov_n; i++)
     {
-	MPIU_DBG_MSG_FMT(OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_writev - iov[%d].len = %d\n", i, iov[i].MPL_IOV_LEN));
+	MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_post_writev - iov[%d].len = %d\n", i, iov[i].MPL_IOV_LEN));
     }
 #endif
     for (iter=0; iter<10; iter++)
@@ -1784,7 +1784,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	{
             int err;
 	    /* Release the lock so that other threads may make progress while this thread waits for something to do */
-	    MPIU_DBG_MSG(OTHER,TYPICAL,"Exit global critical section");
+	    MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Exit global critical section");
 	    MPIU_THREAD_CHECK_BEGIN;
 	    MPID_Thread_mutex_unlock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
 	    MPIU_THREAD_CHECK_END;
@@ -1809,7 +1809,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	    {
                 int err;
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
-		MPIU_DBG_MSG(OTHER,TYPICAL,"Enter global critical section");
+		MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Enter global critical section");
 		MPIU_THREAD_CHECK_BEGIN;
 		MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
 		MPIU_THREAD_CHECK_END;
@@ -1855,7 +1855,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			/*sock->rt2 = PMPI_Wtime();*/
 			/*printf("[%d] time from post_read  to op_read : %.3f - sock %d\n", getpid(), sock->rt2 - sock->rt1, sock->sock);*/
 			/* socket closed */
-			MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait readv returning %d bytes and EOF\n", sock->read.total);
+			MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait readv returning %d bytes and EOF\n", sock->read.total);
 			/*printf("sock_wait readv returning %d bytes and EOF\n", sock->read.total);*/
 			out->op_type = MPIDU_SOCK_OP_READ;
 			out->num_bytes = sock->read.total;
@@ -1865,7 +1865,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			sock->state &= ~SOCKI_READING; /* remove the SOCKI_READING bit */
 			if (sock->closing && sock->pending_operations == 0)
 			{
-			    MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 			    FlushFileBuffers((HANDLE)sock->sock);
 			    if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 			    {
@@ -1887,7 +1887,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WAIT);
 			return MPI_SUCCESS;
 		    }
-		    MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait readv update: %d bytes\n", num_bytes);
+		    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait readv update: %d bytes\n", num_bytes);
 		    sock->read.total += num_bytes;
 		    while (num_bytes)
 		    {
@@ -1909,7 +1909,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 		    {
 			/*sock->rt2 = PMPI_Wtime();*/
 			/*printf("[%d] time from post_read  to op_read : %.3f - sock %d\n", getpid(), sock->rt2 - sock->rt1, sock->sock);*/
-			MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait readv %d bytes\n", sock->read.total);
+			MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait readv %d bytes\n", sock->read.total);
 			out->op_type = MPIDU_SOCK_OP_READ;
 			out->num_bytes = sock->read.total;
 			out->error = MPI_SUCCESS;
@@ -1918,7 +1918,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			sock->state &= ~SOCKI_READING; /* remove the SOCKI_READING bit */
 			if (sock->closing && sock->pending_operations == 0)
 			{
-			    MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 			    FlushFileBuffers((HANDLE)sock->sock);
 			    if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 			    {
@@ -1961,7 +1961,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    sock->state &= ~SOCKI_READING;
 			    if (sock->closing && sock->pending_operations == 0)
 			    {
-				MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+				MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 				FlushFileBuffers((HANDLE)sock->sock);
 				if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				{
@@ -2021,7 +2021,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    sock->state &= ~SOCKI_READING;
 			    if (sock->closing && sock->pending_operations == 0)
 			    {
-				MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+				MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 				FlushFileBuffers((HANDLE)sock->sock);
 				if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				{
@@ -2059,7 +2059,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			sock->state ^= SOCKI_CONNECTING; /* remove the SOCKI_CONNECTING bit */
 			if (sock->closing && sock->pending_operations == 0)
 			{
-			    MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait: closing socket(%d) after connect completed.\n", MPIDU_Sock_get_sock_id(sock));
+			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after connect completed.\n", MPIDU_Sock_get_sock_id(sock));
 			    FlushFileBuffers((HANDLE)sock->sock);
 			    if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 			    {
@@ -2088,7 +2088,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    /*sock->wt2 = PMPI_Wtime();*/
 			    /*printf("[%d] time from post_write to op_write: %.3f - sock %d\n", getpid(), sock->wt2 - sock->wt1, sock->sock);*/
 			    /* socket closed */
-			    MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait writev returning %d bytes and EOF\n", sock->write.total);
+			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait writev returning %d bytes and EOF\n", sock->write.total);
 			    out->op_type = MPIDU_SOCK_OP_WRITE;
 			    out->num_bytes = sock->write.total;
 			    /*printf("sock_wait writev returning %d bytes and EOF\n", sock->write.total);*/
@@ -2098,7 +2098,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    sock->state &= ~SOCKI_WRITING; /* remove the SOCKI_WRITING bit */
 			    if (sock->closing && sock->pending_operations == 0)
 			    {
-				MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait: closing socket(%d) after iov write completed.\n", MPIDU_Sock_get_sock_id(sock));
+				MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov write completed.\n", MPIDU_Sock_get_sock_id(sock));
 				FlushFileBuffers((HANDLE)sock->sock);
 				if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				{
@@ -2120,13 +2120,13 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WAIT);
 			    return MPI_SUCCESS;
 			}
-			MPIU_DBG_MSG_FMT(OTHER,TERSE,(MPIU_DBG_FDEST,"sock_wait: write update, total = %d + %d = %d\n", sock->write.total, num_bytes, sock->write.total + num_bytes));
+			MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_wait: write update, total = %d + %d = %d\n", sock->write.total, num_bytes, sock->write.total + num_bytes));
 			sock->write.total += num_bytes;
 			while (num_bytes)
 			{
 			    if (sock->write.iov[sock->write.index].MPL_IOV_LEN <= num_bytes)
 			    {
-				/*MPIU_DBG_MSG_FMT(OTHER,TERSE,(MPIU_DBG_FDEST,"sock_wait: write.index %d, len %d\n", sock->write.index, 
+				/*MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_wait: write.index %d, len %d\n", sock->write.index,
 				sock->write.iov[sock->write.index].MPL_IOV_LEN));*/
 				num_bytes -= sock->write.iov[sock->write.index].MPL_IOV_LEN;
 				sock->write.index++;
@@ -2134,7 +2134,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    }
 			    else
 			    {
-				/*MPIU_DBG_MSG_FMT(OTHER,TERSE,(MPIU_DBG_FDEST,"sock_wait: partial data written [%d].len = %d, num_bytes = %d\n", sock->write.index,
+				/*MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"sock_wait: partial data written [%d].len = %d, num_bytes = %d\n", sock->write.index,
 				sock->write.iov[sock->write.index].MPL_IOV_LEN, num_bytes));*/
 				sock->write.iov[sock->write.index].MPL_IOV_LEN -= num_bytes;
 				sock->write.iov[sock->write.index].MPL_IOV_BUF = (MPL_IOV_BUF_CAST)(
@@ -2148,7 +2148,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    /*printf("[%d] time from post_write to op_write: %.3f - sock %d\n", getpid(), sock->wt2 - sock->wt1, sock->sock);*/
 			    if (sock->write.total > 0)
 			    {
-				MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait wrotev %d bytes\n", sock->write.total);
+				MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait wrotev %d bytes\n", sock->write.total);
 			    }
 			    out->op_type = MPIDU_SOCK_OP_WRITE;
 			    out->num_bytes = sock->write.total;
@@ -2158,7 +2158,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    sock->state &= ~SOCKI_WRITING; /* remove the SOCKI_WRITING bit */
 			    if (sock->closing && sock->pending_operations == 0)
 			    {
-				MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait: closing socket(%d) after iov write completed.\n", MPIDU_Sock_get_sock_id(sock));
+				MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov write completed.\n", MPIDU_Sock_get_sock_id(sock));
 				FlushFileBuffers((HANDLE)sock->sock);
 				if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				{
@@ -2184,7 +2184,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			if (sock->write.progress_update != NULL)
 			    sock->write.progress_update(num_bytes, sock->user_ptr);
 			/* post a write of the remaining data */
-			MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait: posting write of the remaining data, vec size %d\n", sock->write.iovlen);
+			MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: posting write of the remaining data, vec size %d\n", sock->write.iovlen);
 			if (WSASend(sock->sock, sock->write.iov, sock->write.iovlen, &sock->write.num_bytes, 0, &sock->write.ovl, NULL) == SOCKET_ERROR)
 			{
 			    mpi_errno = WSAGetLastError();
@@ -2201,7 +2201,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 				sock->state &= ~SOCKI_WRITING;
 				if (sock->closing && sock->pending_operations == 0)
 				{
-				    MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+				    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 				    FlushFileBuffers((HANDLE)sock->sock);
 				    if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				    {
@@ -2258,7 +2258,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 				sock->state &= ~SOCKI_WRITING;
 				if (sock->closing && sock->pending_operations == 0)
 				{
-				    MPIU_DBG_MSG_D(OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
+				    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_wait: closing socket(%d) after iov read completed.\n", MPIDU_Sock_get_sock_id(sock));
 				    FlushFileBuffers((HANDLE)sock->sock);
 				    if (shutdown(sock->sock, SD_BOTH) == SOCKET_ERROR)
 				    {
@@ -2291,7 +2291,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			{
 			    /*sock->rt2 = PMPI_Wtime();*/
 			    /*printf("[%d] time from post_read  to op_read : %.3f - sock %d\n", getpid(), sock->rt2 - sock->rt1, sock->sock);*/
-			    MPIU_DBG_MSG_D(OTHER,TERSE,"EOF with posted read on sock %d\n", sock->sock);
+			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"EOF with posted read on sock %d\n", sock->sock);
 			    out->op_type = MPIDU_SOCK_OP_READ;
 			    out->num_bytes = sock->read.total;
 			    /*printf("sock_wait returning %d bytes and EOF\n", sock->read.total);*/
@@ -2306,7 +2306,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			{
 			    /*sock->wt2 = PMPI_Wtime();*/
 			    /*printf("[%d] time from post_write to op_write: %.3f - sock %d\n", getpid(), sock->wt2 - sock->wt1, sock->sock);*/
-			    MPIU_DBG_MSG_D(OTHER,TERSE,"EOF with posted write on sock %d\n", sock->sock);
+			    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"EOF with posted write on sock %d\n", sock->sock);
 			    out->op_type = MPIDU_SOCK_OP_WRITE;
 			    out->num_bytes = sock->write.total;
 			    /*printf("sock_wait returning %d bytes and EOF\n", sock->write.total);*/
@@ -2317,12 +2317,12 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 			    MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WAIT);
 			    return MPI_SUCCESS;
 			}
-			MPIU_DBG_MSG_D(OTHER,TERSE,"ignoring EOF notification on unknown sock %d.\n", MPIDU_Sock_get_sock_id(sock));
+			MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"ignoring EOF notification on unknown sock %d.\n", MPIDU_Sock_get_sock_id(sock));
 		    }
 
 		    if (sock->sock != INVALID_SOCKET)
 		    {
-			MPIU_DBG_MSG_FMT(OTHER,TERSE,(MPIU_DBG_FDEST,"unmatched ovl: pending: %d, state = %d\n", sock->pending_operations, sock->state));
+			MPIU_DBG_MSG_FMT(MPIR_DBG_OTHER,TERSE,(MPIU_DBG_FDEST,"unmatched ovl: pending: %d, state = %d\n", sock->pending_operations, sock->state));
 			/*MPL_error_printf("In sock_wait(), returned overlapped structure does not match the current read or write ovl: 0x%x\n", ovl);*/
 			MPL_snprintf(error_msg, 1024, "In sock_wait(), returned overlapped structure does not match the current read or write ovl: 0x%p\n", ovl);
 			MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WAIT);
@@ -2330,7 +2330,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 		    }
 		    else
 		    {
-			MPIU_DBG_MSG(OTHER,TERSE,"ignoring notification on invalid sock.\n");
+			MPIU_DBG_MSG(MPIR_DBG_OTHER,TERSE,"ignoring notification on invalid sock.\n");
 		    }
 		}
 	    }
@@ -2402,7 +2402,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	    {
                 int err;
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
-		MPIU_DBG_MSG(OTHER,TYPICAL,"Enter global critical section");
+		MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Enter global critical section");
 		MPIU_THREAD_CHECK_BEGIN;
 		MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
 		MPIU_THREAD_CHECK_END;
@@ -2528,13 +2528,13 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 		    continue;
 		}
 	    }
-	    MPIU_DBG_MSG_D(OTHER,TERSE,"GetQueuedCompletionStatus failed, GetLastError: %d\n", mpi_errno);
+	    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, GetLastError: %d\n", mpi_errno);
 	    if (sock != NULL)
 	    {
-		MPIU_DBG_MSG(OTHER,TERSE,"GetQueuedCompletionStatus failed, sock != null\n");
+		MPIU_DBG_MSG(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, sock != null\n");
 		if (sock->type == SOCKI_SOCKET)
 		{
-		    MPIU_DBG_MSG(OTHER,TERSE,"GetQueuedCompletionStatus failed, sock == SOCKI_SOCKET \n");
+		    MPIU_DBG_MSG(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, sock == SOCKI_SOCKET \n");
 		    if (sock->closing)
 		    {
 			/*sock->ct2 = PMPI_Wtime();*/
@@ -2585,7 +2585,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 		}
 		if (sock->type == SOCKI_LISTENER)
 		{
-		    MPIU_DBG_MSG(OTHER,TERSE,"GetQueuedCompletionStatus failed, sock == SOCKI_LISTENER \n");
+		    MPIU_DBG_MSG(MPIR_DBG_OTHER,TERSE,"GetQueuedCompletionStatus failed, sock == SOCKI_LISTENER \n");
 		    /* this only works if the aborted operation is reported before the close is reported
 		       because the close will free the sock structure causing these dereferences bogus.
 		       I need to reference count the sock */
@@ -2730,7 +2730,7 @@ int MPIDU_Sock_readv(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t *
     {
 	*num_read = num_read_local;
     }
-    MPIU_DBG_MSG_D(OTHER,TERSE,"sock_readv %d bytes\n", *num_read);
+    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_readv %d bytes\n", *num_read);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_READV);
     return mpi_errno;
 }
@@ -2794,7 +2794,7 @@ int MPIDU_Sock_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t *
 	}
 	if (mpi_errno && (mpi_errno != WSAEWOULDBLOCK))
 	{
-	    MPIU_DBG_MSG_D(OTHER,TERSE,"WSASend failed: error %d\n", mpi_errno);
+	    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"WSASend failed: error %d\n", mpi_errno);
 	    mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPIDU_SOCK_ERR_FAIL, "**fail", "**fail %s %d", get_error_string(mpi_errno), mpi_errno);
 	    MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WRITEV);
 	    return mpi_errno;
@@ -2804,7 +2804,7 @@ int MPIDU_Sock_writev(MPIDU_Sock_t sock, MPL_IOV * iov, int iov_n, MPIU_Size_t *
     {
 	*num_written = num_written_local;
     }
-    MPIU_DBG_MSG_D(OTHER,TERSE,"sock_writev %d bytes\n", *num_written);
+    MPIU_DBG_MSG_D(MPIR_DBG_OTHER,TERSE,"sock_writev %d bytes\n", *num_written);
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_WRITEV);
     return MPI_SUCCESS;
diff --git a/src/mpid/common/sock/poll/sock_post.i b/src/mpid/common/sock/poll/sock_post.i
index c787d97..be0a932 100644
--- a/src/mpid/common/sock/poll/sock_post.i
+++ b/src/mpid/common/sock/poll/sock_post.i
@@ -125,10 +125,10 @@ int MPIDU_Sock_post_connect_ifaddr( struct MPIDU_Sock_set * sock_set,
     /*
      * Attempt to establish the connection
      */
-    MPIU_DBG_STMT(CH3_CONNECT,TYPICAL,{
+    MPIU_DBG_STMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,{
 	char addrString[64];
 	MPIDU_Sock_AddrToStr( ifaddr, addrString, sizeof(addrString) );
-	MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
+	MPIU_DBG_MSG_FMT(MPIDI_CH3_DBG_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
 			      "Connecting to %s:%d", addrString, port )); 
 	})
 
@@ -141,7 +141,7 @@ int MPIDU_Sock_post_connect_ifaddr( struct MPIDU_Sock_set * sock_set,
     if (rc == 0)
     {
 	/* connection succeeded */
-	MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_CONNECTED_RW for sock %p",sock);
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_CONNECTED_RW for sock %p",sock);
 	pollinfo->state = MPIDU_SOCKI_STATE_CONNECTED_RW;
 	MPIDU_SOCKI_EVENT_ENQUEUE(pollinfo, MPIDU_SOCK_OP_CONNECT, 0, user_ptr, MPI_SUCCESS, mpi_errno, fn_fail);
     }
@@ -149,13 +149,13 @@ int MPIDU_Sock_post_connect_ifaddr( struct MPIDU_Sock_set * sock_set,
     else if (errno == EINPROGRESS)
     {
 	/* connection pending */
-	MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_CONNECTING for sock %p",sock);
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_CONNECTING for sock %p",sock);
 	pollinfo->state = MPIDU_SOCKI_STATE_CONNECTING;
 	MPIDU_SOCKI_POLLFD_OP_SET(pollfd, pollinfo, POLLOUT);
     }
     else
     {
-	MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_DISCONNECTED (failure in connect) for sock %p",sock);
+	MPIU_DBG_MSG_P(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Setting state to SOCKI_STATE_DISCONNECTED (failure in connect) for sock %p",sock);
 	pollinfo->os_errno = errno;
 	pollinfo->state = MPIDU_SOCKI_STATE_DISCONNECTED;
 
diff --git a/src/mpid/common/sock/poll/sock_wait.i b/src/mpid/common/sock/poll/sock_wait.i
index 78fdc05..2b82799 100644
--- a/src/mpid/common/sock/poll/sock_wait.i
+++ b/src/mpid/common/sock/poll/sock_wait.i
@@ -155,7 +155,7 @@ int MPIDU_Sock_wait(struct MPIDU_Sock_set * sock_set, int millisecond_timeout,
 		    /* Release the lock so that other threads may make 
 		       progress while this thread waits for something to 
 		       do */
-		    MPIU_DBG_MSG(OTHER,TYPICAL,"Exit global critical section (sock_wait)");
+		    MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Exit global critical section (sock_wait)");
 		    /* 		    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
 				    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX); */
 		    MPID_Thread_mutex_unlock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
@@ -167,7 +167,7 @@ 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(OTHER,TYPICAL,"Enter global critical section (sock_wait)");
+		    MPIU_DBG_MSG(MPIR_DBG_OTHER,TYPICAL,"Enter global critical section (sock_wait)");
 		    /* 		    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
 				    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX); */
 		    MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
diff --git a/src/mpid/common/sock/poll/socki_util.i b/src/mpid/common/sock/poll/socki_util.i
index 20daf56..92d6cda 100644
--- a/src/mpid/common/sock/poll/socki_util.i
+++ b/src/mpid/common/sock/poll/socki_util.i
@@ -988,7 +988,7 @@ int MPIDU_Sock_SetSockBufferSize( int fd, int firm )
 	if (rc <= 0) {
 	    sockBufSize = 0;
 	}
-	MPIU_DBG_MSG_D(CH3_CONNECT,TYPICAL,"Sock buf size = %d",sockBufSize);
+	MPIU_DBG_MSG_D(MPIDI_CH3_DBG_CONNECT,TYPICAL,"Sock buf size = %d",sockBufSize);
     }
 
     if (sockBufSize > 0) {
diff --git a/src/mpid/pamid/src/mpid_vc.c b/src/mpid/pamid/src/mpid_vc.c
index 454c360..29b0f27 100644
--- a/src/mpid/pamid/src/mpid_vc.c
+++ b/src/mpid/pamid/src/mpid_vc.c
@@ -333,7 +333,7 @@ int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
 	  }
 	  *gpid++ = vc->pg_rank;
 
-          MPIU_DBG_MSG_FMT(COMM,VERBOSE, (MPIU_DBG_FDEST,
+          MPIU_DBG_MSG_FMT(MPIR_DBG_COMM,VERBOSE, (MPIU_DBG_FDEST,
                            "pgid=%d vc->pg_rank=%d",
                            pgid, vc->pg_rank));
       }
diff --git a/src/util/assert/assert.c b/src/util/assert/assert.c
index d0e05b6..2e29b2f 100644
--- a/src/util/assert/assert.c
+++ b/src/util/assert/assert.c
@@ -23,7 +23,7 @@ int MPIR_Assert_fail(const char *cond, const char *file_name, int line_num)
                             file_name, line_num, cond);
     MPL_internal_error_printf("Assertion failed in file %s at line %d: %s\n",
                                file_name, line_num, cond);
-    MPIU_DBG_MSG_FMT(ASSERT, TERSE,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_ASSERT, TERSE,
                      (MPIU_DBG_FDEST,
                       "Assertion failed in file %s at line %d: %s",
                       file_name, line_num, cond));
@@ -48,11 +48,11 @@ int MPIR_Assert_fail_fmt(const char *cond, const char *file_name, int line_num,
                                file_name, line_num, cond);
     MPL_internal_error_printf("%s\n", msg);
 
-    MPIU_DBG_MSG_FMT(ASSERT, TERSE,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_ASSERT, TERSE,
                      (MPIU_DBG_FDEST,
                       "Assertion failed in file %s at line %d: %s",
                       file_name, line_num, cond));
-    MPIU_DBG_MSG_FMT(ASSERT, TERSE, (MPIU_DBG_FDEST,"%s",msg));
+    MPIU_DBG_MSG_FMT(MPIR_DBG_ASSERT, TERSE, (MPIU_DBG_FDEST,"%s",msg));
 
     MPID_Abort(NULL, MPI_SUCCESS, 1, NULL);
     return MPI_ERR_INTERN; /* never get here, abort should kill us */
diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index dcb513b..036201b 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -231,36 +231,13 @@ typedef struct dbg_classname {
     const char *ucname, *lcname; 
 } dbg_classname;
 
-static const dbg_classname classnames[] = {
-    { MPIU_DBG_INIT,          "INIT",          "init" },
-    { MPIU_DBG_PT2PT,         "PT2PT",         "pt2pt" },
-    { MPIU_DBG_THREAD,        "THREAD",        "thread" },
-    { MPIU_DBG_ROUTINE_ENTER, "ROUTINE_ENTER", "routine_enter" },
-    { MPIU_DBG_ROUTINE_EXIT,  "ROUTINE_EXIT",  "routine_exit" },
-    { MPIU_DBG_ROUTINE_ENTER |
-      MPIU_DBG_ROUTINE_EXIT,  "ROUTINE",       "routine" },
-    { MPIU_DBG_DATATYPE,      "DATATYPE",      "datatype" },
-    { MPIU_DBG_HANDLE,        "HANDLE",        "handle" },
-    { MPIU_DBG_COMM,          "COMM",          "comm" },
-    { MPIU_DBG_BSEND,         "BSEND",         "bsend" },
-    { MPIU_DBG_OTHER,         "OTHER",         "other" },
-    { MPIU_DBG_CH3_CONNECT,   "CH3_CONNECT",   "ch3_connect" },
-    { MPIU_DBG_CH3_DISCONNECT,"CH3_DISCONNECT","ch3_disconnect" },
-    { MPIU_DBG_CH3_PROGRESS,  "CH3_PROGRESS",  "ch3_progress" },
-    { MPIU_DBG_CH3_CHANNEL,   "CH3_CHANNEL",   "ch3_channel" },
-    { MPIU_DBG_CH3_OTHER,     "CH3_OTHER",     "ch3_other" },
-    { MPIU_DBG_CH3_MSG,       "CH3_MSG",       "ch3_msg" },
-    { MPIU_DBG_NEM_SOCK_DET,  "NEM_SOCK_DET",  "nem_sock_det"},
-    { MPIU_DBG_VC,            "VC",            "vc"},
-    { MPIU_DBG_REFCOUNT,      "REFCOUNT",      "refcount"},
-    { MPIU_DBG_ROMIO,         "ROMIO",         "romio"},
-    { MPIU_DBG_HCOLL,         "HCOLL",         "hcoll"},
-    { MPIU_DBG_ASSERT,        "ASSERT",        "assert"},
-    { MPIU_DBG_STRING,        "STRING",        "string"},
-    { MPIU_DBG_ERRHAND,       "ERRHAND",       "errhand"},
-    { MPIU_DBG_ALL,           "ALL",           "all" }, 
-    { 0,                      0,               0 }
-};
+#define MAX_DBG_CLASSNAMES (sizeof(unsigned int) * 8)
+
+static dbg_classname classnames[MAX_DBG_CLASSNAMES];
+static int num_classnames = 0;
+
+static const char *unregistered_classes[MAX_DBG_CLASSNAMES];
+static int num_unregistered_classes = 0;
 
 /* Because the level values are simpler and are rarely changed, these
    use a simple set of parallel arrays */
@@ -270,6 +247,47 @@ static const int  level_values[] = { MPIU_DBG_TERSE,
 static const char *level_name[] = { "TERSE", "TYPICAL", "VERBOSE", 0 };
 static const char *lc_level_name[] = { "terse", "typical", "verbose", 0 };
 
+void MPIU_DBG_Class_register(MPIU_DBG_Class class, const char *ucname, const char *lcname)
+{
+    int i, j;
+
+    classnames[num_classnames].classbits = class;
+    classnames[num_classnames].ucname = ucname;
+    classnames[num_classnames].lcname = lcname;
+    num_classnames++;
+
+    if (num_unregistered_classes) {
+        /* there are some unregistered classes.  look through to see
+         * if any of them match this class. */
+        size_t len = strlen(lcname);
+
+        for (i = 0; i < num_unregistered_classes; i++) {
+            size_t slen = strlen(unregistered_classes[i]);
+            if (len == slen && (strncmp(unregistered_classes[i], lcname, len) ||
+                                strncmp(unregistered_classes[i], ucname, len))) {
+                /* got a match */
+                MPIU_DBG_ActiveClasses |= class;
+                for (j = i; j < num_unregistered_classes - 1; j++)
+                    unregistered_classes[j] = unregistered_classes[j + 1];
+                num_unregistered_classes--;
+                break;
+            }
+        }
+    }
+}
+
+MPIU_DBG_Class MPIU_DBG_Class_alloc(const char *ucname, const char *lcname)
+{
+    static unsigned int class = 1;
+
+    /* create a user handle for this class */
+    MPIU_DBG_Class_register(class, ucname, lcname);
+
+    class <<= 1;
+
+    return (class >> 1);
+}
+
 /* 
  * Initialize the DBG_MSG system.  This is called during MPI_Init to process
  * command-line arguments as well as checking the MPICH_DBG environment
@@ -404,6 +422,11 @@ static int dbg_process_env( void )
     return MPI_SUCCESS;
 }
 
+MPIU_DBG_Class MPIU_DBG_ROUTINE_ENTER;
+MPIU_DBG_Class MPIU_DBG_ROUTINE_EXIT;
+MPIU_DBG_Class MPIU_DBG_ROUTINE;
+MPIU_DBG_Class MPIU_DBG_ALL = ~(0);  /* pre-initialize the ALL class */
+
 /*
  * Attempt to initialize the logging system.  This works only if MPID_Init
  * is not responsible for updating the environment and/or command-line
@@ -433,6 +456,17 @@ int MPIU_DBG_PreInit( int *argc_p, char ***argv_p, int wtimeNotReady )
 	reset_time_origin = 0;
     }
 
+    /* Allocate the predefined classes */
+    MPIU_DBG_ROUTINE_ENTER = MPIU_DBG_Class_alloc("ROUTINE_ENTER", "routine_enter");
+    MPIU_DBG_ROUTINE_EXIT = MPIU_DBG_Class_alloc("ROUTINE_EXIT", "routine_exit");
+
+    MPIU_DBG_CLASS_CLR(MPIU_DBG_ROUTINE);
+    MPIU_DBG_CLASS_APPEND(MPIU_DBG_ROUTINE, MPIU_DBG_ROUTINE_ENTER);
+    MPIU_DBG_CLASS_APPEND(MPIU_DBG_ROUTINE, MPIU_DBG_ROUTINE_EXIT);
+    MPIU_DBG_Class_register(MPIU_DBG_ROUTINE, "ROUTINE", "routine");
+
+    MPIU_DBG_Class_register(MPIU_DBG_ALL, "ALL", "all");
+
     dbg_initialized = DBG_PREINIT;
 
     return MPI_SUCCESS;
@@ -845,46 +879,38 @@ static int dbg_openfile(FILE **dbg_fp)
    the bits corresponding to this name */
 static int dbg_set_class( const char *s )
 {
-    int i;
+    int i, found_match;
     size_t slen = 0;
-    size_t len = 0;
+    char *str;
 
     if (s && *s) slen = strlen(s);
 
-    while (s && *s) {
-	for (i=0; classnames[i].lcname; i++) {
-	    /* The LCLen and UCLen *should* be the same, but
-	       just in case, we separate them */
-	    size_t LClen = strlen(classnames[i].lcname);
-	    size_t UClen = strlen(classnames[i].ucname);
-	    int matchClass = 0;
-
-	    /* Allow the upper case and lower case in all cases */
-	    if (slen >= LClen && 
-		strncmp(s,classnames[i].lcname, LClen) == 0 &&
-		(s[LClen] == ',' || s[LClen] == 0) ) {
-		matchClass = 1;
-		len = LClen;
-	    }
-	    else if (slen >= UClen && 
-		strncmp(s,classnames[i].ucname, UClen) == 0 &&
-		(s[UClen] == ',' || s[UClen] == 0) ) {
-		matchClass = 1;
-		len = UClen;
-	    }
-	    if (matchClass) {
-		MPIU_DBG_ActiveClasses |= classnames[i].classbits;
-		s += len;
-		slen -= len;
-		if (*s == ',') { s++; slen--; }
-		/* If we found a name, we need to restart the for loop */
-		break;
-	    }
-	}
-	if (!classnames[i].lcname) {
-	    return 1;
-	}
+    str = strtok((char *) s, ",");
+    while (str) {
+        found_match = 0;
+        for (i = 0; i < num_classnames; i++) {
+            size_t len = strlen(classnames[i].lcname);
+
+            if (slen == len && (strncmp(str, classnames[i].lcname, len) ||
+                                strncmp(str, classnames[i].ucname, len))) {
+                /* we have a match */
+                MPIU_DBG_ActiveClasses |= classnames[i].classbits;
+                found_match = 1;
+                break;
+            }
+        }
+
+        if (!found_match) {
+            /* no match was found.  the component might not have
+             * registered yet.  store the user string for later
+             * access. */
+            unregistered_classes[num_unregistered_classes] = str;
+            num_unregistered_classes++;
+        }
+
+        str = strtok(NULL, ",");
     }
+
     return 0;
 }
 
diff --git a/src/util/dbg/mpidbg.h b/src/util/dbg/mpidbg.h
index e92307d..e5f08b8 100644
--- a/src/util/dbg/mpidbg.h
+++ b/src/util/dbg/mpidbg.h
@@ -22,24 +22,24 @@
 
 #ifdef USE_DBG_LOGGING
 #define MPIU_DBG_SELECTED(_class,_level) \
-   ((MPIU_DBG_##_class & MPIU_DBG_ActiveClasses) && \
+   ((_class & MPIU_DBG_ActiveClasses) && \
           MPIU_DBG_##_level <= MPIU_DBG_MaxLevel)
 #define MPIU_DBG_MSG(_class,_level,_string)  \
-   {if ( (MPIU_DBG_##_class & MPIU_DBG_ActiveClasses) && \
+   {if ( (_class & MPIU_DBG_ActiveClasses) && \
           MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) {\
-     MPIU_DBG_Outevent( __FILE__, __LINE__, MPIU_DBG_##_class, 0, "%s", _string ); }}
+     MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 0, "%s", _string ); }}
 #define MPIU_DBG_MSG_S(_class,_level,_fmat,_string) \
-   {if ( (MPIU_DBG_##_class & MPIU_DBG_ActiveClasses) && \
+   {if ( (_class & MPIU_DBG_ActiveClasses) && \
           MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) {\
-     MPIU_DBG_Outevent( __FILE__, __LINE__, MPIU_DBG_##_class, 1, _fmat, _string ); }}
+     MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 1, _fmat, _string ); }}
 #define MPIU_DBG_MSG_D(_class,_level,_fmat,_int) \
-   {if ( (MPIU_DBG_##_class & MPIU_DBG_ActiveClasses) && \
+   {if ( (_class & MPIU_DBG_ActiveClasses) && \
           MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) {\
-     MPIU_DBG_Outevent( __FILE__, __LINE__, MPIU_DBG_##_class, 2, _fmat, _int ); }}
+     MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 2, _fmat, _int ); }}
 #define MPIU_DBG_MSG_P(_class,_level,_fmat,_pointer) \
-   {if ( (MPIU_DBG_##_class & MPIU_DBG_ActiveClasses) && \
+   {if ( (_class & MPIU_DBG_ActiveClasses) && \
           MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) {\
-     MPIU_DBG_Outevent( __FILE__, __LINE__, MPIU_DBG_##_class, 3, _fmat, _pointer ); }}
+     MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 3, _fmat, _pointer ); }}
 
 #define MPIU_DBG_MAXLINE 256
 #define MPIU_DBG_FDEST _s,(size_t)MPIU_DBG_MAXLINE
@@ -54,21 +54,21 @@
 .ve  
   M*/
 #define MPIU_DBG_MSG_FMT(_class,_level,_fmatargs) \
-   {if ( (MPIU_DBG_##_class & MPIU_DBG_ActiveClasses) && \
+   {if ( (_class & MPIU_DBG_ActiveClasses) && \
           MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) {\
           char _s[MPIU_DBG_MAXLINE]; \
           MPL_snprintf _fmatargs ; \
-     MPIU_DBG_Outevent( __FILE__, __LINE__, MPIU_DBG_##_class, 0, "%s", _s ); }}
+     MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 0, "%s", _s ); }}
 #define MPIU_DBG_STMT(_class,_level,_stmt) \
-   {if ( (MPIU_DBG_##_class & MPIU_DBG_ActiveClasses) && \
+   {if ( (_class & MPIU_DBG_ActiveClasses) && \
           MPIU_DBG_##_level <= MPIU_DBG_MaxLevel ) { _stmt; }}
 
 #define MPIU_DBG_OUT(_class,_msg) \
-    MPIU_DBG_Outevent( __FILE__, __LINE__, MPIU_DBG_##_class, 0, "%s", _msg )
+    MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 0, "%s", _msg )
 #define MPIU_DBG_OUT_FMT(_class,_fmatargs) \
     {     char _s[MPIU_DBG_MAXLINE]; \
           MPL_snprintf _fmatargs ; \
-    MPIU_DBG_Outevent( __FILE__, __LINE__, MPIU_DBG_##_class, 0, "%s", _s );}
+    MPIU_DBG_Outevent( __FILE__, __LINE__, _class, 0, "%s", _s );}
 
 #else
 #define MPIU_DBG_SELECTED(_class,_level) 0
@@ -82,42 +82,33 @@
 #define MPIU_DBG_OUT_FMT(_class,_fmtargs)
 #endif
 
+typedef unsigned int MPIU_DBG_Class;
+
 /* Special constants */
 enum MPIU_DBG_LEVEL { MPIU_DBG_TERSE   = 0, 
 		      MPIU_DBG_TYPICAL = 50,
 		      MPIU_DBG_VERBOSE = 99 };
-/* Any change in MPIU_DBG_CLASS must be matched by changes in 
-   "classnames" in src/util/dbg/dbg_printf.c */
-enum MPIU_DBG_CLASS { MPIU_DBG_INIT          = 0x1,
-		      MPIU_DBG_PT2PT         = 0x2,
-		      MPIU_DBG_THREAD        = 0x4,
-		      MPIU_DBG_ROUTINE_ENTER = 0x8,
-		      MPIU_DBG_ROUTINE_EXIT  = 0x10,
-		      MPIU_DBG_DATATYPE      = 0x20,
-		      MPIU_DBG_HANDLE        = 0x40,
-		      MPIU_DBG_COMM          = 0x80,
-		      MPIU_DBG_BSEND         = 0x100,
-		      MPIU_DBG_OTHER         = 0x200,
-		      MPIU_DBG_CH3_CONNECT   = 0x400,
-		      MPIU_DBG_CH3_DISCONNECT= 0x800,
-		      MPIU_DBG_CH3_PROGRESS  = 0x1000,
-		      MPIU_DBG_CH3_CHANNEL   = 0x2000,
-		      MPIU_DBG_CH3_OTHER     = 0x4000,
-		      MPIU_DBG_CH3_MSG       = 0x8000,
-		      MPIU_DBG_CH3           = 0xfc00, /* alias for all CH3 */
-		      MPIU_DBG_NEM_SOCK_DET  = 0x10000,
-		      MPIU_DBG_VC            = 0x20000,
-		      MPIU_DBG_REFCOUNT      = 0x40000,
-		      MPIU_DBG_ROMIO         = 0x80000,
-		      MPIU_DBG_HCOLL         = 0x100000,
-		      MPIU_DBG_ASSERT        = 0x200000,
-		      MPIU_DBG_STRING        = 0x400000,
-		      MPIU_DBG_ERRHAND       = 0x800000,
-		      MPIU_DBG_ALL           = (~0) };   /* alias for all */
 
 extern int MPIU_DBG_ActiveClasses;
 extern int MPIU_DBG_MaxLevel;
 
+extern MPIU_DBG_Class MPIU_DBG_ROUTINE_ENTER;
+extern MPIU_DBG_Class MPIU_DBG_ROUTINE_EXIT;
+extern MPIU_DBG_Class MPIU_DBG_ROUTINE;
+extern MPIU_DBG_Class MPIU_DBG_ALL;
+
+MPIU_DBG_Class MPIU_DBG_Class_alloc(const char *ucname, const char *lcname);
+void MPIU_DBG_Class_register(MPIU_DBG_Class class, const char *ucname, const char *lcname);
+
+#define MPIU_DBG_CLASS_CLR(class)               \
+    do {                                        \
+        (class) = 0;                            \
+    } while (0)
+#define MPIU_DBG_CLASS_APPEND(out_class, in_class)      \
+    do {                                                \
+        (out_class) |= (in_class);                      \
+    } while (0)
+
 int MPIU_DBG_Outevent(const char *, int, int, int, const char *, ...) 
                                         ATTRIBUTE((format(printf,5,6)));
 int MPIU_DBG_Init( int *, char ***, int, int, int );
diff --git a/src/util/mem/argstr.c b/src/util/mem/argstr.c
index 6a97a70..9d06289 100644
--- a/src/util/mem/argstr.c
+++ b/src/util/mem/argstr.c
@@ -721,7 +721,7 @@ int MPIU_Str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 1)
     {
-	MPIU_DBG_MSG_S(STRING,VERBOSE,
+	MPIU_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
                   "partial argument added to string: '%s'", *str_ptr);
 	**str_ptr = '\0';
 	return MPIU_STR_NOMEM;
@@ -755,7 +755,7 @@ int MPIU_Str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 2)
     {
-	MPIU_DBG_MSG_S(STRING,VERBOSE,
+	MPIU_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**orig_str_ptr = '\0';
 	return MPIU_STR_NOMEM;
@@ -852,7 +852,7 @@ int MPIU_Str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 1)
     {
-	MPIU_DBG_MSG_S(STRING,VERBOSE,
+	MPIU_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**str_ptr = '\0';
 	return MPIU_STR_NOMEM;
@@ -877,7 +877,7 @@ int MPIU_Str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 2)
     {
-	MPIU_DBG_MSG_S(STRING,VERBOSE,
+	MPIU_DBG_MSG_S(MPIR_DBG_STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**orig_str_ptr = '\0';
 	return MPIU_STR_NOMEM;
diff --git a/src/util/mem/handlemem.c b/src/util/mem/handlemem.c
index 3dea600..b620610 100644
--- a/src/util/mem/handlemem.c
+++ b/src/util/mem/handlemem.c
@@ -382,7 +382,7 @@ void *MPIU_Handle_obj_alloc_unsafe(MPIU_Object_alloc_t *objmem)
          * annotations instead. */
         MPL_VG_ANNOTATE_NEW_MEMORY(ptr, objmem->size);
 
-        MPIU_DBG_MSG_FMT(HANDLE,TYPICAL,(MPIU_DBG_FDEST,
+        MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,
                                          "Allocating object ptr %p (handle val 0x%08x)",
                                          ptr, ptr->handle));
     }
@@ -407,7 +407,7 @@ void MPIU_Handle_obj_free( MPIU_Object_alloc_t *objmem, void *object )
 
     MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_HANDLE_MUTEX);
 
-    MPIU_DBG_MSG_FMT(HANDLE,TYPICAL,(MPIU_DBG_FDEST,
+    MPIU_DBG_MSG_FMT(MPIR_DBG_HANDLE,TYPICAL,(MPIU_DBG_FDEST,
                                      "Freeing object ptr %p (0x%08x kind=%s) refcount=%d",
                                      (obj),
                                      (obj)->handle,
diff --git a/src/util/thread/mpiu_thread_multiple.h b/src/util/thread/mpiu_thread_multiple.h
index 5ac8e65..468b531 100644
--- a/src/util/thread/mpiu_thread_multiple.h
+++ b/src/util/thread/mpiu_thread_multiple.h
@@ -17,7 +17,7 @@
     do {                                                                \
         int err_;                                                       \
         MPIU_THREAD_CHECK_BEGIN;                                        \
-        MPIU_DBG_MSG_S(THREAD, TYPICAL, "locking %s", lockname);        \
+        MPIU_DBG_MSG_S(MPIR_DBG_THREAD, TYPICAL, "locking %s", lockname);        \
         MPIU_Thread_mutex_lock(&mutex, &err_);                          \
         MPIU_THREAD_CHECK_END;                                          \
     } while (0)
@@ -26,7 +26,7 @@
     do {                                                                \
         int err_;                                                       \
         MPIU_THREAD_CHECK_BEGIN;                                        \
-        MPIU_DBG_MSG_S(THREAD, TYPICAL, "unlocking %s", lockname);      \
+        MPIU_DBG_MSG_S(MPIR_DBG_THREAD, TYPICAL, "unlocking %s", lockname);      \
         MPIU_Thread_mutex_unlock(&mutex, &err_);                        \
         MPIU_THREAD_CHECK_END;                                          \
     } while (0)
@@ -34,7 +34,7 @@
 #define MPIUI_THREAD_CS_YIELD_NONRECURSIVE(lockname, mutex)             \
     do {                                                                \
         MPIU_THREAD_CHECK_BEGIN;                                        \
-        MPIU_DBG_MSG_S(THREAD, TYPICAL, "yielding %s", lockname);       \
+        MPIU_DBG_MSG_S(MPIR_DBG_THREAD, TYPICAL, "yielding %s", lockname);       \
         MPIU_Thread_yield(&mutex);                                      \
         MPIU_THREAD_CHECK_END;                                          \
     } while (0)
@@ -51,7 +51,7 @@
                                                                         \
         MPIU_THREAD_CHECK_BEGIN;                                        \
         depth_ = MPIU_THREADPRIV_FIELD(lock_depth);                     \
-        MPIU_DBG_MSG_S(THREAD, TYPICAL, "recursive locking %s", lockname); \
+        MPIU_DBG_MSG_S(MPIR_DBG_THREAD, TYPICAL, "recursive locking %s", lockname); \
         if (depth_ == 0) {                                              \
             MPIUI_THREAD_CS_ENTER_NONRECURSIVE(lockname, mutex);        \
         }                                                               \
@@ -67,7 +67,7 @@
                                                                         \
         MPIU_THREAD_CHECK_BEGIN;                                        \
         depth_ = MPIU_THREADPRIV_FIELD(lock_depth);                     \
-        MPIU_DBG_MSG_S(THREAD, TYPICAL, "recursive unlocking %s", lockname); \
+        MPIU_DBG_MSG_S(MPIR_DBG_THREAD, TYPICAL, "recursive unlocking %s", lockname); \
         if (depth_ == 1) {                                              \
             MPIUI_THREAD_CS_EXIT_NONRECURSIVE(lockname, mutex);         \
         }                                                               \
diff --git a/src/util/thread/mpiu_thread_posix.h b/src/util/thread/mpiu_thread_posix.h
index 14c052c..02bbc33 100644
--- a/src/util/thread/mpiu_thread_posix.h
+++ b/src/util/thread/mpiu_thread_posix.h
@@ -50,13 +50,13 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
 #define MPIU_Thread_yield(mutex_ptr_)                                   \
     do {                                                                \
         int err;                                                        \
-        MPIU_DBG_MSG(THREAD,VERBOSE,"enter MPIU_Thread_yield");         \
+        MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"enter MPIU_Thread_yield");         \
         if (OPA_load_int(&(mutex_ptr_)->num_queued_threads) == 0)       \
             break;                                                      \
         MPIU_Thread_mutex_unlock(mutex_ptr_, &err);                     \
         MPIU_PW_Sched_yield();                                          \
         MPIU_Thread_mutex_lock(mutex_ptr_, &err);                       \
-        MPIU_DBG_MSG(THREAD,VERBOSE,"exit MPIU_Thread_yield");          \
+        MPIU_DBG_MSG(MPIR_DBG_THREAD,VERBOSE,"exit MPIU_Thread_yield");          \
     } while (0)
 
 
@@ -86,7 +86,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
             MPL_internal_sys_error_printf("pthread_mutex_init", err__,  \
                                           "    %s:%d\n", __FILE__, __LINE__); \
         *(int *)(err_ptr_) = err__;                                     \
-        MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
     } while (0)
 
 #else /* defined(MPICH_PTHREAD_MUTEX_ERRORCHECK_VALUE) */
@@ -104,7 +104,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
             MPL_internal_sys_error_printf("pthread_mutex_init", err__,  \
                                           "    %s:%d\n", __FILE__, __LINE__); \
         *(int *)(err_ptr_) = err__;                                     \
-        MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
     } while (0)
 
 #endif /* defined(MPICH_PTHREAD_MUTEX_ERRORCHECK_VALUE) */
@@ -113,7 +113,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     do {                                                                \
         int err__;							\
                                                                         \
-        MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to destroy MPIU_Thread_mutex %p", (mutex_ptr_)); \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPIU_Thread_mutex %p", (mutex_ptr_)); \
         err__ = pthread_mutex_destroy(&(mutex_ptr_)->mutex);            \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_mutex_destroy", err__, \
@@ -125,17 +125,17 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
 #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_)); \
+        MPIU_DBG_MSG_P(MPIR_DBG_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 (unlikely(err__)) {                                          \
-            MPIU_DBG_MSG_S(THREAD,TERSE,"  mutex lock error: %s", MPIU_Strerror(err__)); \
+            MPIU_DBG_MSG_S(MPIR_DBG_THREAD,TERSE,"  mutex lock error: %s", MPIU_Strerror(err__)); \
             MPL_internal_sys_error_printf("pthread_mutex_lock", err__,  \
                                           "    %s:%d\n", __FILE__, __LINE__); \
         }                                                               \
         *(int *)(err_ptr_) = err__;                                     \
-        MPIU_DBG_MSG_P(THREAD,VERBOSE,"exit MPIU_Thread_mutex_lock %p", (mutex_ptr_)); \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"exit MPIU_Thread_mutex_lock %p", (mutex_ptr_)); \
     } while (0)
 
 
@@ -143,10 +143,10 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     do {                                                                \
         int err__;                                                      \
                                                                         \
-        MPIU_DBG_MSG_P(THREAD,VERBOSE,"MPIU_Thread_mutex_unlock %p", (mutex_ptr_)); \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,VERBOSE,"MPIU_Thread_mutex_unlock %p", (mutex_ptr_)); \
         err__ = pthread_mutex_unlock(&(mutex_ptr_)->mutex);             \
         if (unlikely(err__)) {                                          \
-            MPIU_DBG_MSG_S(THREAD,TERSE,"  mutex unlock error: %s", MPIU_Strerror(err__)); \
+            MPIU_DBG_MSG_S(MPIR_DBG_THREAD,TERSE,"  mutex unlock error: %s", MPIU_Strerror(err__)); \
             MPL_internal_sys_error_printf("pthread_mutex_unlock", err__, \
                                           "    %s:%d\n", __FILE__, __LINE__); \
         }                                                               \
@@ -166,7 +166,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_cond_init", err__,   \
                                           "    %s:%d\n", __FILE__, __LINE__); \
-        MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_cond %p", (cond_ptr_)); \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"Created MPIU_Thread_cond %p", (cond_ptr_)); \
         *(int *)(err_ptr_) = err__;                                     \
     } while (0)
 
@@ -174,7 +174,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     do {                                                                \
         int err__;							\
                                                                         \
-        MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to destroy MPIU_Thread_cond %p", (cond_ptr_)); \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to destroy MPIU_Thread_cond %p", (cond_ptr_)); \
         err__ = pthread_cond_destroy(cond_ptr_);                        \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_cond_destroy", err__, \
@@ -189,7 +189,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         /* 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_))) \
+        MPIU_DBG_MSG_FMT(MPIR_DBG_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); \
@@ -202,14 +202,14 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
         *(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_))); \
+        MPIU_DBG_MSG_FMT(MPIR_DBG_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_)); \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_broadcast on MPIU_Thread_cond %p", (cond_ptr_)); \
         err__ = pthread_cond_broadcast(cond_ptr_);			\
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_cond_broadcast", err__, \
@@ -224,7 +224,7 @@ void MPIU_Thread_create(MPIU_Thread_func_t func, void *data, MPIU_Thread_id_t *
     do {                                                                \
         int err__;							\
                                                                         \
-        MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to cond_signal on MPIU_Thread_cond %p", (cond_ptr_)); \
+        MPIU_DBG_MSG_P(MPIR_DBG_THREAD,TYPICAL,"About to cond_signal on MPIU_Thread_cond %p", (cond_ptr_)); \
         err__ = pthread_cond_signal(cond_ptr_);                         \
         if (unlikely(err__))                                            \
             MPL_internal_sys_error_printf("pthread_cond_signal", err__, \

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

commit c785e5167091e381ba8e59d127d4f896377fb9af
Author: Pavan Balaji <balaji at anl.gov>
Date:   Tue Jan 5 13:58:40 2016 -0600

    mpidbg: only lookup a class if it is not NULL.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index 8fa6acc..dcb513b 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -380,9 +380,11 @@ static int dbg_process_env( void )
     }
 
     s = getenv( "MPICH_DBG_CLASS" );
-    rc = dbg_set_class( s );
-    if (rc) 
-	dbg_usage( "MPICH_DBG_CLASS", 0 );
+    if (s) {
+        rc = dbg_set_class( s );
+        if (rc)
+            dbg_usage( "MPICH_DBG_CLASS", 0 );
+    }
 
     s = getenv( "MPICH_DBG_FILENAME" );
     if (s) {

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

commit cf7d213ed2739f18cdfbfb8d03bc4c85aa399226
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 20 17:18:25 2016 -0600

    mpidbg: isolate class usage.
    
    Do not intermix usage of classes across layers, where possible.  For
    example, utility functions are independent of devices or the MPI
    layer.  They should not be using the same classes as the other layers.
    
    There are still some cases where we are not completely strict in the
    isolation of classes, but this should catch most cases.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c
index 683b4e1..0288822 100644
--- a/src/mpi/comm/commutil.c
+++ b/src/mpi/comm/commutil.c
@@ -598,7 +598,7 @@ int MPIR_Comm_commit(MPID_Comm * comm)
             comm->node_comm->comm_kind = MPID_INTRACOMM;
             comm->node_comm->hierarchy_kind = MPID_HIERARCHY_NODE;
             comm->node_comm->local_comm = NULL;
-            MPIU_DBG_MSG_D(CH3_OTHER, VERBOSE, "Create node_comm=%p\n", comm->node_comm);
+            MPIU_DBG_MSG_D(COMM, VERBOSE, "Create node_comm=%p\n", comm->node_comm);
 
             comm->node_comm->local_size = num_local;
             comm->node_comm->remote_size = num_local;
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 19447b7..0401124 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -207,7 +207,7 @@ static int thread_cs_init( void )
     MPID_THREADPRIV_INITKEY;
     MPID_THREADPRIV_INIT;
 
-    MPIU_DBG_MSG(THREAD,TYPICAL,"Created global mutex and private storage");
+    MPIU_DBG_MSG(INIT,TYPICAL,"Created global mutex and private storage");
     return MPI_SUCCESS;
 }
 
@@ -219,7 +219,7 @@ int MPIR_Thread_CS_Finalize( void )
 {
     int err;
 
-    MPIU_DBG_MSG(THREAD,TYPICAL,"Freeing global mutex and private storage");
+    MPIU_DBG_MSG(INIT,TYPICAL,"Freeing global mutex and private storage");
 #if MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY_GLOBAL
 /* There is a single, global lock, held for the duration of an MPI call */
     MPID_Thread_mutex_destroy(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
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 52fe111..921e2b4 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
@@ -613,7 +613,7 @@ int MPID_nem_ptl_vc_terminated(MPIDI_VC_t *vc)
     MPIDI_FUNC_EXIT(MPID_NEM_PTL_VC_TERMINATED);
     return mpi_errno;
  fn_fail:
-    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
+    MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
     goto fn_exit;
 }
 
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_init.c b/src/mpid/ch3/channels/nemesis/src/ch3_init.c
index 4a0540e..4d432b1 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_init.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_init.c
@@ -208,7 +208,7 @@ int MPIDI_CH3_VC_Destroy(MPIDI_VC_t *vc )
     /* no need to destroy vc to self, this corresponds to the optimization above
      * in MPIDI_CH3_VC_Init */
     if (vc->pg == MPIDI_CH3I_my_pg && vc->pg_rank == MPIDI_CH3I_my_rank) {
-        MPIU_DBG_MSG_P(NEM_SOCK_DET, VERBOSE, "skipping self vc=%p", vc);
+        MPIU_DBG_MSG_P(VC, VERBOSE, "skipping self vc=%p", vc);
         goto fn_exit;
     }
 
diff --git a/src/mpid/common/hcoll/hcoll_init.c b/src/mpid/common/hcoll/hcoll_init.c
index 88187d3..bf8c3c6 100644
--- a/src/mpid/common/hcoll/hcoll_init.c
+++ b/src/mpid/common/hcoll/hcoll_init.c
@@ -53,7 +53,7 @@ static int hcoll_comm_attr_del_fn(MPI_Comm comm, int keyval, void *attr_val, voi
         envar = getenv("HCOLL_ENABLE_" #nameEnv); \
         if (NULL != envar) { \
             hcoll_enable_##name = atoi(envar); \
-            MPIU_DBG_MSG_D(CH3_OTHER, VERBOSE, "HCOLL_ENABLE_" #nameEnv " = %d\n", hcoll_enable_##name); \
+            MPIU_DBG_MSG_D(HCOLL, VERBOSE, "HCOLL_ENABLE_" #nameEnv " = %d\n", hcoll_enable_##name); \
         } \
     } while (0)
 
@@ -123,7 +123,7 @@ int hcoll_initialize(void)
 #define INSTALL_COLL_WRAPPER(check_name, name) \
     if (hcoll_enable_##check_name && (NULL != hcoll_collectives.coll_##check_name)) { \
         comm_ptr->coll_fns->name      = hcoll_##name; \
-        MPIU_DBG_MSG(CH3_OTHER,VERBOSE, #name " wrapper installed"); \
+        MPIU_DBG_MSG(HCOLL,VERBOSE, #name " wrapper installed"); \
     }
 
 #undef FUNCNAME
@@ -158,7 +158,7 @@ int hcoll_comm_create(MPID_Comm * comm_ptr, void *param)
     }
     comm_ptr->hcoll_priv.hcoll_context = hcoll_create_context((rte_grp_handle_t) comm_ptr);
     if (NULL == comm_ptr->hcoll_priv.hcoll_context) {
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "Couldn't create hcoll context.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "Couldn't create hcoll context.");
         goto fn_fail;
     }
     mpi_errno =
diff --git a/src/mpid/common/hcoll/hcoll_ops.c b/src/mpid/common/hcoll/hcoll_ops.c
index 26c8ba8..f58b558 100644
--- a/src/mpid/common/hcoll/hcoll_ops.c
+++ b/src/mpid/common/hcoll/hcoll_ops.c
@@ -15,17 +15,17 @@ int hcoll_Barrier(MPID_Comm * comm_ptr, MPIR_Errflag_t *err)
 {
     int rc;
     MPI_Comm comm = comm_ptr->handle;
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING HCOL BARRIER.");
+    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOL BARRIER.");
     rc = hcoll_collectives.coll_barrier(comm_ptr->hcoll_priv.hcoll_context);
     if (HCOLL_SUCCESS != rc) {
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK BARRIER.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK BARRIER.");
         void *ptr = comm_ptr->coll_fns->Barrier;
         comm_ptr->coll_fns->Barrier =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Barrier : NULL;
         rc = MPI_Barrier(comm);
         comm_ptr->coll_fns->Barrier = ptr;
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK BARRIER - done.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK BARRIER - done.");
     }
     return rc;
 }
@@ -39,7 +39,7 @@ int hcoll_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
 {
     dte_data_representation_t dtype;
     int rc;
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING HCOLL BCAST.");
+    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOLL BCAST.");
     dtype = mpi_dtype_2_dte_dtype(datatype);
     int is_homogeneous = 1, use_fallback = 0;
     MPI_Comm comm = comm_ptr->handle;
@@ -51,7 +51,7 @@ int hcoll_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
         /*If we are here then datatype is not simple predefined datatype */
         /*In future we need to add more complex mapping to the dte_data_representation_t */
         /* Now use fallback */
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "unsupported data layout, calling fallback bcast.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout, calling fallback bcast.");
         use_fallback = 1;
     }
     else {
@@ -62,14 +62,14 @@ int hcoll_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
         }
     }
     if (1 == use_fallback) {
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK BCAST - done.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK BCAST - done.");
         void *ptr = comm_ptr->coll_fns->Bcast;
         comm_ptr->coll_fns->Bcast =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Bcast : NULL;
         rc = MPI_Bcast(buffer, count, datatype, root, comm);
         comm_ptr->coll_fns->Bcast = ptr;
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK BCAST - done.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK BCAST - done.");
     }
     return rc;
 }
@@ -91,7 +91,7 @@ int hcoll_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING HCOL ALLREDUCE.");
+    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOL ALLREDUCE.");
     Dtype = mpi_dtype_2_dte_dtype(datatype);
     Op = mpi_op_2_dte_op(op);
     if (MPI_IN_PLACE == sendbuf) {
@@ -99,7 +99,7 @@ int hcoll_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
     }
     if (HCOL_DTE_IS_COMPLEX(Dtype) || HCOL_DTE_IS_ZERO(Dtype) || (0 == is_homogeneous) ||
         (HCOL_DTE_OP_NULL == Op->id)) {
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "unsupported data layout, calling fallback allreduce.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout, calling fallback allreduce.");
         use_fallback = 1;
     }
     else {
@@ -113,14 +113,14 @@ int hcoll_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype
         if (HCOLL_IN_PLACE == sendbuf) {
             sendbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK ALLREDUCE.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK ALLREDUCE.");
         void *ptr = comm_ptr->coll_fns->Allreduce;
         comm_ptr->coll_fns->Allreduce =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Allreduce : NULL;
         rc = MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm);
         comm_ptr->coll_fns->Allreduce = ptr;
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK ALLREDUCE done.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK ALLREDUCE done.");
     }
     return rc;
 }
@@ -143,7 +143,7 @@ int hcoll_Allgather(const void *sbuf, int scount, MPI_Datatype sdtype,
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING HCOLL ALLGATHER.");
+    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOLL ALLGATHER.");
     stype = mpi_dtype_2_dte_dtype(sdtype);
     rtype = mpi_dtype_2_dte_dtype(rdtype);
     if (MPI_IN_PLACE == sbuf) {
@@ -151,7 +151,7 @@ int hcoll_Allgather(const void *sbuf, int scount, MPI_Datatype sdtype,
     }
     if (HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) ||
         HCOL_DTE_IS_COMPLEX(rtype) || is_homogeneous == 0) {
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "unsupported data layout; calling fallback allgather.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout; calling fallback allgather.");
         use_fallback = 1;
     }
     else {
@@ -165,14 +165,14 @@ int hcoll_Allgather(const void *sbuf, int scount, MPI_Datatype sdtype,
         if (HCOLL_IN_PLACE == sbuf) {
             sbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK ALLGATHER.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK ALLGATHER.");
         void *ptr = comm_ptr->coll_fns->Allgather;
         comm_ptr->coll_fns->Allgather =
             (NULL != comm_ptr->hcoll_priv.hcoll_origin_coll_fns) ?
             comm_ptr->hcoll_priv.hcoll_origin_coll_fns->Allgather : NULL;
         rc = MPI_Allgather(sbuf, scount, sdtype, rbuf, rcount, rdtype, comm);
         comm_ptr->coll_fns->Allgather = ptr;
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK ALLGATHER - done.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK ALLGATHER - done.");
     }
     return rc;
 }
@@ -188,11 +188,11 @@ int hcoll_Ibarrier_req(MPID_Comm * comm_ptr, MPID_Request ** request)
     MPI_Comm comm;
     MPI_Request req;
     comm = comm_ptr->handle;
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING HCOL IBARRIER.");
+    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOL IBARRIER.");
     rt_handle = (void **) request;
     rc = hcoll_collectives.coll_ibarrier(comm_ptr->hcoll_priv.hcoll_context, rt_handle);
     if (HCOLL_SUCCESS != rc) {
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK IBARRIER.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IBARRIER.");
         void *ptr = comm_ptr->coll_fns->Ibarrier_req;
         comm_ptr->coll_fns->Ibarrier_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -200,7 +200,7 @@ int hcoll_Ibarrier_req(MPID_Comm * comm_ptr, MPID_Request ** request)
         rc = MPI_Ibarrier(comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Ibarrier_req = ptr;
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK IBARRIER - done.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IBARRIER - done.");
     }
     return rc;
 }
@@ -215,7 +215,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
     int rc;
     void **rt_handle;
     dte_data_representation_t dtype;
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING HCOLL IBCAST.");
+    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOLL IBCAST.");
     dtype = mpi_dtype_2_dte_dtype(datatype);
     int is_homogeneous = 1, use_fallback = 0;
     MPI_Comm comm = comm_ptr->handle;
@@ -229,7 +229,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
         /*If we are here then datatype is not simple predefined datatype */
         /*In future we need to add more complex mapping to the dte_data_representation_t */
         /* Now use fallback */
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "unsupported data layout, calling fallback ibcast.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout, calling fallback ibcast.");
         use_fallback = 1;
     }
     else {
@@ -240,7 +240,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
         }
     }
     if (1 == use_fallback) {
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
         void *ptr = comm_ptr->coll_fns->Ibcast_req;
         comm_ptr->coll_fns->Ibcast_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -248,7 +248,7 @@ int hcoll_Ibcast_req(void *buffer, int count, MPI_Datatype datatype, int root,
         rc = MPI_Ibcast(buffer, count, datatype, root, comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Ibcast_req = ptr;
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IBCAST - done.");
     }
     return rc;
 }
@@ -276,7 +276,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING HCOLL IALLGATHER.");
+    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOLL IALLGATHER.");
     stype = mpi_dtype_2_dte_dtype(sendtype);
     rtype = mpi_dtype_2_dte_dtype(recvtype);
     if (MPI_IN_PLACE == sendbuf) {
@@ -284,7 +284,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
     }
     if (HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) ||
         HCOL_DTE_IS_COMPLEX(rtype) || is_homogeneous == 0) {
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "unsupported data layout; calling fallback iallgather.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout; calling fallback iallgather.");
         use_fallback = 1;
     }
     else {
@@ -298,7 +298,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
         if (HCOLL_IN_PLACE == sendbuf) {
             sendbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK IALLGATHER.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IALLGATHER.");
         void *ptr = comm_ptr->coll_fns->Iallgather_req;
         comm_ptr->coll_fns->Iallgather_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -306,7 +306,7 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
         rc = MPI_Iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Iallgather_req = ptr;
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK IALLGATHER - done.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IALLGATHER - done.");
     }
     return rc;
 }
@@ -331,7 +331,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
         is_homogeneous = 0;
 #endif
 
-    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING HCOL IALLREDUCE.");
+    MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING HCOL IALLREDUCE.");
     Dtype = mpi_dtype_2_dte_dtype(datatype);
     Op = mpi_op_2_dte_op(op);
     if (MPI_IN_PLACE == sendbuf) {
@@ -339,7 +339,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
     }
     if (HCOL_DTE_IS_COMPLEX(Dtype) || HCOL_DTE_IS_ZERO(Dtype) || (0 == is_homogeneous) ||
         (HCOL_DTE_OP_NULL == Op->id)) {
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "unsupported data layout, calling fallback iallreduce.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "unsupported data layout, calling fallback iallreduce.");
         use_fallback = 1;
     }
     else {
@@ -353,7 +353,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
         if (HCOLL_IN_PLACE == sendbuf) {
             sendbuf = MPI_IN_PLACE;
         }
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK IALLREDUCE.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IALLREDUCE.");
         void *ptr = comm_ptr->coll_fns->Iallreduce_req;
         comm_ptr->coll_fns->Iallreduce_req =
             (comm_ptr->hcoll_priv.hcoll_origin_coll_fns !=
@@ -361,7 +361,7 @@ int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Data
         rc = MPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, &req);
         MPID_Request_get_ptr(req, *request);
         comm_ptr->coll_fns->Iallreduce_req = ptr;
-        MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "RUNNING FALLBACK IALLREDUCE done.");
+        MPIU_DBG_MSG(HCOLL, VERBOSE, "RUNNING FALLBACK IALLREDUCE done.");
     }
     return rc;
 }
diff --git a/src/mpid/common/hcoll/hcoll_rte.c b/src/mpid/common/hcoll/hcoll_rte.c
index 9dd14f5..8bd6f9b 100644
--- a/src/mpid/common/hcoll/hcoll_rte.c
+++ b/src/mpid/common/hcoll/hcoll_rte.c
@@ -160,7 +160,7 @@ static int recv_nb(struct dte_data_representation_t data,
             /* We have a full data description & buffer pointer simultaneously.
              * It is ambiguous. Throw a warning since the user might have made a
              * mistake with data reps */
-            MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
+            MPIU_DBG_MSG(HCOLL, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
                          "representation: buffer_pointer is ignored");
         }
         total_entries_number = count_total_dte_repeat_entries(&data);
@@ -227,7 +227,7 @@ static int send_nb(dte_data_representation_t data,
             /* We have a full data description & buffer pointer simultaneously.
              * It is ambiguous. Throw a warning since the user might have made a
              * mistake with data reps */
-            MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
+            MPIU_DBG_MSG(HCOLL, VERBOSE, "Warning: buffer_pointer != NULL for NON-inline data "
                          "representation: buffer_pointer is ignored");
         }
         total_entries_number = count_total_dte_repeat_entries(&data);
diff --git a/src/mpid/common/sock/iocp/sock.c b/src/mpid/common/sock/iocp/sock.c
index 7836448..cc712c1 100644
--- a/src/mpid/common/sock/iocp/sock.c
+++ b/src/mpid/common/sock/iocp/sock.c
@@ -1784,7 +1784,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	{
             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_DBG_MSG(OTHER,TYPICAL,"Exit global critical section");
 	    MPIU_THREAD_CHECK_BEGIN;
 	    MPID_Thread_mutex_unlock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
 	    MPIU_THREAD_CHECK_END;
@@ -1809,7 +1809,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	    {
                 int err;
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
-		MPIU_DBG_MSG(THREAD,TYPICAL,"Enter global critical section");
+		MPIU_DBG_MSG(OTHER,TYPICAL,"Enter global critical section");
 		MPIU_THREAD_CHECK_BEGIN;
 		MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
 		MPIU_THREAD_CHECK_END;
@@ -2402,7 +2402,7 @@ int MPIDU_Sock_wait(MPIDU_Sock_set_t set, int timeout, MPIDU_Sock_event_t * out)
 	    {
                 int err;
 		/* Reaquire the lock before processing any of the information returned from GetQueuedCompletionStatus */
-		MPIU_DBG_MSG(THREAD,TYPICAL,"Enter global critical section");
+		MPIU_DBG_MSG(OTHER,TYPICAL,"Enter global critical section");
 		MPIU_THREAD_CHECK_BEGIN;
 		MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
 		MPIU_THREAD_CHECK_END;
diff --git a/src/mpid/common/sock/poll/sock_wait.i b/src/mpid/common/sock/poll/sock_wait.i
index eb7f6b8..78fdc05 100644
--- a/src/mpid/common/sock/poll/sock_wait.i
+++ b/src/mpid/common/sock/poll/sock_wait.i
@@ -155,7 +155,7 @@ int MPIDU_Sock_wait(struct MPIDU_Sock_set * sock_set, int millisecond_timeout,
 		    /* 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 (sock_wait)");
+		    MPIU_DBG_MSG(OTHER,TYPICAL,"Exit global critical section (sock_wait)");
 		    /* 		    MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
 				    MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX); */
 		    MPID_Thread_mutex_unlock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
@@ -167,7 +167,7 @@ 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_DBG_MSG(OTHER,TYPICAL,"Enter global critical section (sock_wait)");
 		    /* 		    MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
 				    MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX); */
 		    MPID_Thread_mutex_lock(&MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX, &err);
diff --git a/src/util/assert/assert.c b/src/util/assert/assert.c
index 0fd9cca..d0e05b6 100644
--- a/src/util/assert/assert.c
+++ b/src/util/assert/assert.c
@@ -23,7 +23,7 @@ int MPIR_Assert_fail(const char *cond, const char *file_name, int line_num)
                             file_name, line_num, cond);
     MPL_internal_error_printf("Assertion failed in file %s at line %d: %s\n",
                                file_name, line_num, cond);
-    MPIU_DBG_MSG_FMT(OTHER, TERSE,
+    MPIU_DBG_MSG_FMT(ASSERT, TERSE,
                      (MPIU_DBG_FDEST,
                       "Assertion failed in file %s at line %d: %s",
                       file_name, line_num, cond));
@@ -48,11 +48,11 @@ int MPIR_Assert_fail_fmt(const char *cond, const char *file_name, int line_num,
                                file_name, line_num, cond);
     MPL_internal_error_printf("%s\n", msg);
 
-    MPIU_DBG_MSG_FMT(OTHER, TERSE,
+    MPIU_DBG_MSG_FMT(ASSERT, TERSE,
                      (MPIU_DBG_FDEST,
                       "Assertion failed in file %s at line %d: %s",
                       file_name, line_num, cond));
-    MPIU_DBG_MSG_FMT(OTHER, TERSE, (MPIU_DBG_FDEST,"%s",msg));
+    MPIU_DBG_MSG_FMT(ASSERT, TERSE, (MPIU_DBG_FDEST,"%s",msg));
 
     MPID_Abort(NULL, MPI_SUCCESS, 1, NULL);
     return MPI_ERR_INTERN; /* never get here, abort should kill us */
diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index 6f4a458..8fa6acc 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -232,6 +232,7 @@ typedef struct dbg_classname {
 } dbg_classname;
 
 static const dbg_classname classnames[] = {
+    { MPIU_DBG_INIT,          "INIT",          "init" },
     { MPIU_DBG_PT2PT,         "PT2PT",         "pt2pt" },
     { MPIU_DBG_THREAD,        "THREAD",        "thread" },
     { MPIU_DBG_ROUTINE_ENTER, "ROUTINE_ENTER", "routine_enter" },
@@ -247,12 +248,15 @@ static const dbg_classname classnames[] = {
     { MPIU_DBG_CH3_DISCONNECT,"CH3_DISCONNECT","ch3_disconnect" },
     { MPIU_DBG_CH3_PROGRESS,  "CH3_PROGRESS",  "ch3_progress" },
     { MPIU_DBG_CH3_CHANNEL,   "CH3_CHANNEL",   "ch3_channel" },
-    { MPIU_DBG_CH3_MSG,       "CH3_MSG",       "ch3_msg" },
     { MPIU_DBG_CH3_OTHER,     "CH3_OTHER",     "ch3_other" },
+    { MPIU_DBG_CH3_MSG,       "CH3_MSG",       "ch3_msg" },
     { MPIU_DBG_NEM_SOCK_DET,  "NEM_SOCK_DET",  "nem_sock_det"},
     { MPIU_DBG_VC,            "VC",            "vc"},
     { MPIU_DBG_REFCOUNT,      "REFCOUNT",      "refcount"},
     { MPIU_DBG_ROMIO,         "ROMIO",         "romio"},
+    { MPIU_DBG_HCOLL,         "HCOLL",         "hcoll"},
+    { MPIU_DBG_ASSERT,        "ASSERT",        "assert"},
+    { MPIU_DBG_STRING,        "STRING",        "string"},
     { MPIU_DBG_ERRHAND,       "ERRHAND",       "errhand"},
     { MPIU_DBG_ALL,           "ALL",           "all" }, 
     { 0,                      0,               0 }
diff --git a/src/util/dbg/mpidbg.h b/src/util/dbg/mpidbg.h
index a62b878..e92307d 100644
--- a/src/util/dbg/mpidbg.h
+++ b/src/util/dbg/mpidbg.h
@@ -88,27 +88,31 @@ enum MPIU_DBG_LEVEL { MPIU_DBG_TERSE   = 0,
 		      MPIU_DBG_VERBOSE = 99 };
 /* Any change in MPIU_DBG_CLASS must be matched by changes in 
    "classnames" in src/util/dbg/dbg_printf.c */
-enum MPIU_DBG_CLASS { MPIU_DBG_PT2PT         = 0x1,
-		      MPIU_DBG_THREAD        = 0x2,
-		      MPIU_DBG_ROUTINE_ENTER = 0x4,
-		      MPIU_DBG_ROUTINE_EXIT  = 0x8,
-		      MPIU_DBG_DATATYPE      = 0x10,
-		      MPIU_DBG_HANDLE        = 0x20,
-		      MPIU_DBG_COMM          = 0x40,
-		      MPIU_DBG_BSEND         = 0x80,
-		      MPIU_DBG_OTHER         = 0x100,
-		      MPIU_DBG_CH3_CONNECT   = 0x200,
-		      MPIU_DBG_CH3_DISCONNECT= 0x400,
-		      MPIU_DBG_CH3_PROGRESS  = 0x800,
-		      MPIU_DBG_CH3_CHANNEL   = 0x1000,
-		      MPIU_DBG_CH3_OTHER     = 0x2000,
-		      MPIU_DBG_CH3_MSG       = 0x4000,
-		      MPIU_DBG_CH3           = 0x7e00, /* alias for all CH3 */
-		      MPIU_DBG_NEM_SOCK_DET  = 0x8000,
-		      MPIU_DBG_VC            = 0x10000,
-		      MPIU_DBG_REFCOUNT      = 0x20000,
-		      MPIU_DBG_ROMIO         = 0x40000,
-		      MPIU_DBG_ERRHAND       = 0x80000,
+enum MPIU_DBG_CLASS { MPIU_DBG_INIT          = 0x1,
+		      MPIU_DBG_PT2PT         = 0x2,
+		      MPIU_DBG_THREAD        = 0x4,
+		      MPIU_DBG_ROUTINE_ENTER = 0x8,
+		      MPIU_DBG_ROUTINE_EXIT  = 0x10,
+		      MPIU_DBG_DATATYPE      = 0x20,
+		      MPIU_DBG_HANDLE        = 0x40,
+		      MPIU_DBG_COMM          = 0x80,
+		      MPIU_DBG_BSEND         = 0x100,
+		      MPIU_DBG_OTHER         = 0x200,
+		      MPIU_DBG_CH3_CONNECT   = 0x400,
+		      MPIU_DBG_CH3_DISCONNECT= 0x800,
+		      MPIU_DBG_CH3_PROGRESS  = 0x1000,
+		      MPIU_DBG_CH3_CHANNEL   = 0x2000,
+		      MPIU_DBG_CH3_OTHER     = 0x4000,
+		      MPIU_DBG_CH3_MSG       = 0x8000,
+		      MPIU_DBG_CH3           = 0xfc00, /* alias for all CH3 */
+		      MPIU_DBG_NEM_SOCK_DET  = 0x10000,
+		      MPIU_DBG_VC            = 0x20000,
+		      MPIU_DBG_REFCOUNT      = 0x40000,
+		      MPIU_DBG_ROMIO         = 0x80000,
+		      MPIU_DBG_HCOLL         = 0x100000,
+		      MPIU_DBG_ASSERT        = 0x200000,
+		      MPIU_DBG_STRING        = 0x400000,
+		      MPIU_DBG_ERRHAND       = 0x800000,
 		      MPIU_DBG_ALL           = (~0) };   /* alias for all */
 
 extern int MPIU_DBG_ActiveClasses;
diff --git a/src/util/mem/argstr.c b/src/util/mem/argstr.c
index ca49a98..6a97a70 100644
--- a/src/util/mem/argstr.c
+++ b/src/util/mem/argstr.c
@@ -57,7 +57,7 @@ static int encode_buffer(char *dest, int dest_length, const char *src,
 	    *num_encoded = n;
 	    return MPIU_STR_TRUNCATED;
 	}
-	/*MPIU_DBG_MSG_FMT(OTHER,VERBOSE,(MPIU_DBG_FDEST," %c = %c%c", 
+	/*MPIU_DBG_MSG_FMT(STRING,VERBOSE,(MPIU_DBG_FDEST," %c = %c%c",
 	  ch, dest[0], dest[1]));*/
 	dest += num_used;
 	dest_length -= num_used;
@@ -99,7 +99,7 @@ static int decode_buffer(const char *str, char *dest, int length,
 	str++;
 	sscanf(hex, "%X", &value);
 	*dest = (char)value;
-	/*MPIU_DBG_MSG_FMT(OTHER,VERBOSE,(MPIU_DBG_FDEST," %s = %c",
+	/*MPIU_DBG_MSG_FMT(STRING,VERBOSE,(MPIU_DBG_FDEST," %s = %c",
 	  hex, *dest));*/
 	dest++;
 	n++;
@@ -721,7 +721,7 @@ int MPIU_Str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 1)
     {
-	MPIU_DBG_MSG_S(OTHER,VERBOSE,
+	MPIU_DBG_MSG_S(STRING,VERBOSE,
                   "partial argument added to string: '%s'", *str_ptr);
 	**str_ptr = '\0';
 	return MPIU_STR_NOMEM;
@@ -755,7 +755,7 @@ int MPIU_Str_add_string_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 2)
     {
-	MPIU_DBG_MSG_S(OTHER,VERBOSE,
+	MPIU_DBG_MSG_S(STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**orig_str_ptr = '\0';
 	return MPIU_STR_NOMEM;
@@ -852,7 +852,7 @@ int MPIU_Str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 1)
     {
-	MPIU_DBG_MSG_S(OTHER,VERBOSE,
+	MPIU_DBG_MSG_S(STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**str_ptr = '\0';
 	return MPIU_STR_NOMEM;
@@ -877,7 +877,7 @@ int MPIU_Str_add_binary_arg(char **str_ptr, int *maxlen_ptr, const char *flag,
     *maxlen_ptr = *maxlen_ptr - num_chars;
     if (*maxlen_ptr < 2)
     {
-	MPIU_DBG_MSG_S(OTHER,VERBOSE,
+	MPIU_DBG_MSG_S(STRING,VERBOSE,
 		       "partial argument added to string: '%s'", *str_ptr);
 	**orig_str_ptr = '\0';
 	return MPIU_STR_NOMEM;

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

commit b33ae626426653945ce0cd4f3dd40df34130518b
Author: Pavan Balaji <balaji at anl.gov>
Date:   Tue Jan 19 19:18:07 2016 -0600

    warning: no empty macros.
    
    Having an empty macro results in an empty statement after the
    preprocessor embeds the macro.  Some compilers throw a warning in such
    cases.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/util/thread/mpiu_thread_global.h b/src/util/thread/mpiu_thread_global.h
index b4f2d23..09ef314 100644
--- a/src/util/thread/mpiu_thread_global.h
+++ b/src/util/thread/mpiu_thread_global.h
@@ -18,9 +18,9 @@
 #define MPIUI_THREAD_CS_YIELD_ALLGRAN(mutex) MPIUI_THREAD_CS_YIELD_NONRECURSIVE("ALLGRAN", mutex)
 
 /* POBJ locks are all NO-OPs */
-#define MPIUI_THREAD_CS_ENTER_POBJ(mutex)
-#define MPIUI_THREAD_CS_EXIT_POBJ(mutex)
-#define MPIUI_THREAD_CS_YIELD_POBJ(mutex)
+#define MPIUI_THREAD_CS_ENTER_POBJ(mutex) do {} while (0)
+#define MPIUI_THREAD_CS_EXIT_POBJ(mutex) do {} while (0)
+#define MPIUI_THREAD_CS_YIELD_POBJ(mutex) do {} while (0)
 
 
 /* define a type for the completion counter */
diff --git a/src/util/thread/mpiu_thread_pobj.h b/src/util/thread/mpiu_thread_pobj.h
index 3e58ff0..a036884 100644
--- a/src/util/thread/mpiu_thread_pobj.h
+++ b/src/util/thread/mpiu_thread_pobj.h
@@ -85,9 +85,9 @@
 #define MPIUI_THREAD_CS_YIELD_ALLGRAN(mutex) MPIUI_THREAD_CS_YIELD_NONRECURSIVE("ALLGRAN", mutex)
 
 /* GLOBAL locks are all NO-OPs */
-#define MPIUI_THREAD_CS_ENTER_GLOBAL(mutex)
-#define MPIUI_THREAD_CS_EXIT_GLOBAL(mutex)
-#define MPIUI_THREAD_CS_YIELD_GLOBAL(mutex)
+#define MPIUI_THREAD_CS_ENTER_GLOBAL(mutex) do {} while (0)
+#define MPIUI_THREAD_CS_EXIT_GLOBAL(mutex) do {} while (0)
+#define MPIUI_THREAD_CS_YIELD_GLOBAL(mutex) do {} while (0)
 
 /* define a type for the completion counter */
 #include "opa_primitives.h"

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

commit b1754ce2b07238a71309a0eb01e2d2791af64437
Author: Pavan Balaji <balaji at anl.gov>
Date:   Tue Jan 19 19:20:49 2016 -0600

    warning: fix weird macro definition.
    
    The original macro definition had a macro call and MPI_SUCCESS with a
    comma separation.  The MPI_SUCCESS had no purpose and is, in general,
    weird code.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

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 c9065f3..5d0e359 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_impl.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_impl.h
@@ -37,9 +37,10 @@ int MPID_nem_lmt_RndvSend(MPID_Request **sreq_p, const void * buf, MPI_Aint coun
                           MPIDI_msg_sz_t data_sz, MPI_Aint dt_true_lb, int rank, int tag, MPID_Comm * comm, int context_offset);
 int MPID_nem_lmt_RndvRecv(struct MPIDI_VC *vc, MPID_Request *rreq);
 
-#define MPID_nem_mpich_release_fbox(cell)                                                                     \
-    (OPA_store_release_int(&MPID_nem_mem_region.mailboxes.in[(cell)->pkt.mpich.source]->mpich.flag.value, 0), \
-     MPI_SUCCESS)
+#define MPID_nem_mpich_release_fbox(cell)                               \
+    do {                                                                \
+        OPA_store_release_int(&MPID_nem_mem_region.mailboxes.in[(cell)->pkt.mpich.source]->mpich.flag.value, 0); \
+    } while (0)
 
 /* initialize shared-memory MPI_Barrier variables */
 int MPID_nem_barrier_vars_init (MPID_nem_barrier_vars_t *barrier_region);

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

commit a03917c99ed4dd8e63aa482f63bd2e65f74e3ba2
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 21 17:01:42 2016 -0600

    hydra: improve localhost detection.
    
    Be more forgiving for systems that do not resolve "localhost" or
    equivalent names very well (e.g., they are not added to /etc/hosts).
    Try them out, and if nothing works, fallback to "is not local" mode.
    
    Thanks to Orion Poplawski <orion at cora.nwra.com> for the suggestion.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/pm/hydra/utils/sock/sock.c b/src/pm/hydra/utils/sock/sock.c
index 86b2507..dc56c76 100644
--- a/src/pm/hydra/utils/sock/sock.c
+++ b/src/pm/hydra/utils/sock/sock.c
@@ -492,7 +492,7 @@ HYD_status HYDU_sock_get_iface_ip(char *iface, char **ip)
 HYD_status HYDU_sock_is_local(char *host, int *is_local)
 {
     struct hostent *ht;
-    char *host_ip = NULL, *local_ip = NULL, *lhost_ip = NULL;
+    char *host_ip = NULL, *lhost_ip = NULL;
     char lhost[MAX_HOSTNAME_LEN];
     struct sockaddr_in sa;
     struct ifaddrs *ifaddr, *ifa;
@@ -516,54 +516,63 @@ HYD_status HYDU_sock_is_local(char *host, int *is_local)
 
     /* STEP 1: If "host" matches the local host name, return */
     if (gethostname(lhost, MAX_HOSTNAME_LEN) < 0) {
-        HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "gethostname returned an error\n");
+        /* We can't figure out what my localhost name is.  *sigh*.  We
+         * could return an error here, but we will just punt it to the
+         * upper layer saying that we don't know if it is local.  We
+         * cannot try steps 2 and 3 either, since we don't have our
+         * local hostname. */
+        goto fn_exit;
     }
     else if (!strcmp(lhost, host)) {
         *is_local = 1;
         goto fn_exit;
     }
+    else {
+        /* we have our local hostname, but that does not match the
+         * provided hostname.  Let's try to get our remote IP address
+         * first.  If we can't get that, we can give up. */
+        /* If we are unable to resolve the remote host name, it need
+         * not be an error. It could mean that the user is using an
+         * alias for the hostname (e.g., an ssh config alias) */
+        if ((ht = gethostbyname(host)) == NULL)
+            goto fn_exit;
 
+        memset((char *) &sa, 0, sizeof(struct sockaddr_in));
+        memcpy(&sa.sin_addr, ht->h_addr_list[0], ht->h_length);
 
-    /* STEP 2: If the IP address associated with "host" and the IP address local
-     * host resolves to match, return */
-
-    if ((ht = gethostbyname(lhost)) == NULL) {
-        HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "gethostbyname error on %s: %s\n",
-                            lhost, hstrerror(h_errno));
+        /* Find the IP address of the host */
+        host_ip = HYDU_strdup((char *) inet_ntop(AF_INET, (const void *) &sa.sin_addr, buf,
+                                                 MAX_HOSTNAME_LEN));
+        HYDU_ASSERT(host_ip, status);
     }
 
-    memset((char *) &sa, 0, sizeof(struct sockaddr_in));
-    memcpy(&sa.sin_addr, ht->h_addr_list[0], ht->h_length);
-
-    /* Find the IP address of the host */
-    lhost_ip = HYDU_strdup((char *) inet_ntop(AF_INET, (const void *) &sa.sin_addr, buf,
-                                              MAX_HOSTNAME_LEN));
-    HYDU_ASSERT(lhost_ip, status);
+    /* OK, if we are here, we got the remote IP.  We have two ways of
+     * getting the local IP: gethostbyname or getifaddrs.  We'll try
+     * both.  */
 
-    /* If we are unable to resolve the remote host name, it need not be an
-     * error. It could mean that the user is using an alias for the hostname
-     * (e.g., an ssh config alias) */
-    if ((ht = gethostbyname(host)) == NULL)
-        goto fn_exit;
+    /* STEP 2: Let's try the gethostbyname model */
 
-    memset((char *) &sa, 0, sizeof(struct sockaddr_in));
-    memcpy(&sa.sin_addr, ht->h_addr_list[0], ht->h_length);
+    if ((ht = gethostbyname(lhost))) {
+        memset((char *) &sa, 0, sizeof(struct sockaddr_in));
+        memcpy(&sa.sin_addr, ht->h_addr_list[0], ht->h_length);
 
-    /* Find the IP address of the host */
-    host_ip = HYDU_strdup((char *) inet_ntop(AF_INET, (const void *) &sa.sin_addr, buf,
-                                             MAX_HOSTNAME_LEN));
-    HYDU_ASSERT(host_ip, status);
+        /* Find the IP address of the host */
+        lhost_ip = HYDU_strdup((char *) inet_ntop(AF_INET, (const void *) &sa.sin_addr, buf,
+                                                  MAX_HOSTNAME_LEN));
+        HYDU_ASSERT(lhost_ip, status);
 
-    /* See if the IP address of the hostname we got matches the IP address
-     * to which the local host resolves */
-    if (!strcmp(lhost_ip, host_ip)) {
-        *is_local = 1;
-        goto fn_exit;
+        /* See if the IP address of the hostname we got matches the IP
+         * address to which the local host resolves */
+        if (!strcmp(lhost_ip, host_ip)) {
+            *is_local = 1;
+            goto fn_exit;
+        }
     }
 
+    /* Either gethostbyname didn't resolve or we didn't find a match.
+     * Either way, let's try the getifaddr model. */
 
-    /* STEP 3: Find all local IP addresses and try to match the host IP
-     * with it. */
+    /* STEP 3: Let's try the getifaddr model */
 
     if (getifaddrs(&ifaddr) == -1)
         HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "getifaddrs failed\n");
@@ -573,21 +582,21 @@ HYD_status HYDU_sock_is_local(char *host, int *is_local)
         if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET) {
             struct sockaddr_in *sa_ptr = (struct sockaddr_in *) ifa->ifa_addr;
 
-            local_ip = HYDU_strdup((char *)
+            lhost_ip = HYDU_strdup((char *)
                                    inet_ntop(AF_INET, (const void *) &(sa_ptr->sin_addr), buf,
                                              MAX_HOSTNAME_LEN));
-            HYDU_ASSERT(local_ip, status);
+            HYDU_ASSERT(lhost_ip, status);
 
-            /* STEP 3: For each local IP address, see if it matches the "host"
+            /* For each local IP address, see if it matches the "host"
              * IP address */
-            if (!strcmp(host_ip, local_ip)) {
+            if (!strcmp(host_ip, lhost_ip)) {
                 *is_local = 1;
                 freeifaddrs(ifaddr);
                 goto fn_exit;
             }
 
-            HYDU_FREE(local_ip);
-            local_ip = NULL;
+            HYDU_FREE(lhost_ip);
+            lhost_ip = NULL;
         }
     }
 
@@ -596,8 +605,6 @@ HYD_status HYDU_sock_is_local(char *host, int *is_local)
   fn_exit:
     if (host_ip)
         HYDU_FREE(host_ip);
-    if (local_ip)
-        HYDU_FREE(local_ip);
     if (lhost_ip)
         HYDU_FREE(lhost_ip);
     return status;

http://git.mpich.org/mpich.git/commitdiff/1c121530dd6909e71b280d2d540072fd456b0ce6

commit 1c121530dd6909e71b280d2d540072fd456b0ce6
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jan 20 16:59:33 2016 -0600

    hydra: large arrays go on the heap.
    
    Large arrays should be allocated on the heap to keep the stack size
    small.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/pm/hydra/pm/pmiserv/pmip_cb.c b/src/pm/hydra/pm/pmiserv/pmip_cb.c
index 20f1d1a..1866f29 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_cb.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_cb.c
@@ -204,7 +204,7 @@ static HYD_status check_pmi_cmd(char **buf, int *pmi_version, int *repeat)
 
 static HYD_status pmi_cb(int fd, HYD_event_t events, void *userp)
 {
-    char *buf = NULL, *pmi_cmd = NULL, *args[MAX_PMI_ARGS] = { 0 };
+    char *buf = NULL, *pmi_cmd = NULL, **args = NULL;
     int closed, repeat, sent, i = -1, linelen, pid = -1;
     struct HYD_pmcd_hdr hdr;
     struct HYD_pmcd_pmip_pmi_handle *h;
@@ -301,6 +301,10 @@ static HYD_status pmi_cb(int fd, HYD_event_t events, void *userp)
         else
             HYD_pmcd_pmip_pmi_handle = HYD_pmcd_pmip_pmi_v2;
 
+        HYDU_MALLOC(args, char **, MAX_PMI_ARGS * sizeof(char *), status);
+        for(i = 0;i < MAX_PMI_ARGS; i++)
+            args[i]= NULL;
+
         status = HYD_pmcd_pmi_parse_pmi_cmd(buf, hdr.pmi_version, &pmi_cmd, args);
         HYDU_ERR_POP(status, "unable to parse PMI command\n");
 
@@ -345,7 +349,10 @@ static HYD_status pmi_cb(int fd, HYD_event_t events, void *userp)
   fn_exit:
     if (pmi_cmd)
         HYDU_FREE(pmi_cmd);
-    HYDU_free_strlist(args);
+    if (args) {
+        HYDU_free_strlist(args);
+        HYDU_free(args);
+    }
     if (buf)
         HYDU_FREE(buf);
     HYDU_FUNC_EXIT();
@@ -357,8 +364,8 @@ static HYD_status pmi_cb(int fd, HYD_event_t events, void *userp)
 
 static HYD_status handle_pmi_response(int fd, struct HYD_pmcd_hdr hdr)
 {
-    int count, closed, sent;
-    char *buf = NULL, *pmi_cmd = NULL, *args[MAX_PMI_INTERNAL_ARGS] = { 0 };
+    int count, closed, sent, i;
+    char *buf = NULL, *pmi_cmd = NULL, **args = NULL;
     struct HYD_pmcd_pmip_pmi_handle *h;
     HYD_status status = HYD_SUCCESS;
 
@@ -372,6 +379,10 @@ static HYD_status handle_pmi_response(int fd, struct HYD_pmcd_hdr hdr)
 
     buf[hdr.buflen] = 0;
 
+    HYDU_MALLOC(args, char **, MAX_PMI_INTERNAL_ARGS * sizeof(char *), status);
+    for (i = 0; i < MAX_PMI_INTERNAL_ARGS; i++)
+        args[i] = NULL;
+
     status = HYD_pmcd_pmi_parse_pmi_cmd(buf, hdr.pmi_version, &pmi_cmd, args);
     HYDU_ERR_POP(status, "unable to parse PMI command\n");
 
@@ -402,7 +413,10 @@ static HYD_status handle_pmi_response(int fd, struct HYD_pmcd_hdr hdr)
   fn_exit:
     if (pmi_cmd)
         HYDU_FREE(pmi_cmd);
-    HYDU_free_strlist(args);
+    if (args) {
+        HYDU_free_strlist(args);
+        HYDU_free(args);
+    }
     if (buf)
         HYDU_FREE(buf);
     HYDU_FUNC_EXIT();
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_cb.c b/src/pm/hydra/pm/pmiserv/pmiserv_cb.c
index e24804c..a9d2c1c 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_cb.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_cb.c
@@ -15,8 +15,9 @@
 
 static HYD_status handle_pmi_cmd(int fd, int pgid, int pid, char *buf, int pmi_version)
 {
-    char *args[MAX_PMI_ARGS], *cmd = NULL;
+    char **args = NULL, *cmd = NULL;
     struct HYD_pmcd_pmi_handle *h;
+    int i;
     HYD_status status = HYD_SUCCESS;
 
     HYDU_FUNC_ENTER();
@@ -29,6 +30,10 @@ static HYD_status handle_pmi_cmd(int fd, int pgid, int pid, char *buf, int pmi_v
     if (HYD_server_info.user_global.debug)
         HYDU_dump(stdout, "[pgid: %d] got PMI command: %s\n", pgid, buf);
 
+    HYDU_MALLOC(args, char **, MAX_PMI_ARGS * sizeof(char *), status);
+    for (i = 0; i < MAX_PMI_ARGS; i++)
+        args[i] = NULL;
+
     status = HYD_pmcd_pmi_parse_pmi_cmd(buf, pmi_version, &cmd, args);
     HYDU_ERR_POP(status, "unable to parse PMI command\n");
 
@@ -55,7 +60,10 @@ static HYD_status handle_pmi_cmd(int fd, int pgid, int pid, char *buf, int pmi_v
   fn_exit:
     if (cmd)
         HYDU_FREE(cmd);
-    HYDU_free_strlist(args);
+    if (args) {
+        HYDU_free_strlist(args);
+        HYDU_free(args);
+    }
     HYDU_FUNC_EXIT();
     return status;
 

http://git.mpich.org/mpich.git/commitdiff/416fb3285a2c062553a3d83f892fd2d22559f729

commit 416fb3285a2c062553a3d83f892fd2d22559f729
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 21 11:44:40 2016 -0600

    hydra: get rid of ftb integration.
    
    FTB is no longer maintained.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/pm/hydra/configure.ac b/src/pm/hydra/configure.ac
index 360e086..19ff6a1 100644
--- a/src/pm/hydra/configure.ac
+++ b/src/pm/hydra/configure.ac
@@ -705,25 +705,6 @@ fi
 
 
 #########################################################################
-# FTB integration
-#########################################################################
-# FTB requires pthreads support; add pthreads to LIBS before trying to
-# find FTB
-PAC_PUSH_FLAG([LIBS])
-PAC_PREPEND_FLAG([-lpthread],[LIBS])
-PAC_SET_HEADER_LIB_PATH(ftb)
-PAC_CHECK_HEADER_LIB(libftb.h, ftb, FTB_Connect, have_ftb=yes, have_ftb=no)
-PAC_POP_FLAG([LIBS])
-if test "$have_ftb" = "yes" ; then
-   # FIXME: We need to test to make sure FTB works correctly
-   PAC_APPEND_FLAG([-lpthread],[LIBS])
-   AC_DEFINE(ENABLE_FTB,1,[Define if FTB is enabled])
-   PAC_APPEND_FLAG([-lftb],[WRAPPER_LIBS])
-fi
-AM_CONDITIONAL([hydra_have_ftb], [test "${have_ftb}" = "yes"])
-
-
-#########################################################################
 # Signals and friends
 #########################################################################
 AC_CHECK_FUNCS(strsignal)
diff --git a/src/pm/hydra/pm/pmiserv/pmip.c b/src/pm/hydra/pm/pmiserv/pmip.c
index 32c15e4..825569c 100644
--- a/src/pm/hydra/pm/pmiserv/pmip.c
+++ b/src/pm/hydra/pm/pmiserv/pmip.c
@@ -9,7 +9,6 @@
 #include "demux.h"
 #include "bsci.h"
 #include "topo.h"
-#include "hydt_ftb.h"
 
 struct HYD_pmcd_pmip_s HYD_pmcd_pmip;
 
@@ -171,9 +170,6 @@ int main(int argc, char **argv)
     status = HYDT_dmx_init(&HYD_pmcd_pmip.user_global.demux);
     HYDU_ERR_POP(status, "unable to initialize the demux engine\n");
 
-    status = HYDT_ftb_init();
-    HYDU_ERR_POP(status, "unable to initialize FTB\n");
-
     /* See if HYDI_CONTROL_FD is set before trying to connect upstream */
     ret = MPL_env2int("HYDI_CONTROL_FD", &HYD_pmcd_pmip.upstream.control);
     if (ret < 0) {
@@ -279,9 +275,6 @@ int main(int argc, char **argv)
     status = HYDT_dmx_finalize();
     HYDU_ERR_POP(status, "error returned from demux finalize\n");
 
-    status = HYDT_ftb_finalize();
-    HYDU_ERR_POP(status, "unable to finalize FTB\n");
-
     status = HYDT_bsci_finalize();
     HYDU_ERR_POP(status, "unable to finalize the bootstrap device\n");
 
diff --git a/src/pm/hydra/pm/pmiserv/pmip_cb.c b/src/pm/hydra/pm/pmiserv/pmip_cb.c
index 906fdcd..20f1d1a 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_cb.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_cb.c
@@ -10,7 +10,6 @@
 #include "ckpoint.h"
 #include "demux.h"
 #include "topo.h"
-#include "hydt_ftb.h"
 
 struct HYD_pmcd_pmip_pmi_handle *HYD_pmcd_pmip_pmi_handle = { 0 };
 
@@ -209,7 +208,6 @@ static HYD_status pmi_cb(int fd, HYD_event_t events, void *userp)
     int closed, repeat, sent, i = -1, linelen, pid = -1;
     struct HYD_pmcd_hdr hdr;
     struct HYD_pmcd_pmip_pmi_handle *h;
-    char ftb_event_payload[HYDT_FTB_MAX_PAYLOAD_DATA];
     HYD_status status = HYD_SUCCESS;
 
     HYDU_FUNC_ENTER();
@@ -245,12 +243,6 @@ static HYD_status pmi_cb(int fd, HYD_event_t events, void *userp)
          * active" (which means that this is an MPI application).
          */
         if (pid != -1 && HYD_pmcd_pmip.downstream.pmi_fd_active[pid]) {
-            MPL_snprintf(ftb_event_payload, HYDT_FTB_MAX_PAYLOAD_DATA,
-                         "pgid:%d rank:%d",
-                         HYD_pmcd_pmip.local.pgid, HYD_pmcd_pmip.downstream.pmi_rank[pid]);
-            status = HYDT_ftb_publish("FTB_MPI_PROCS_DEAD", ftb_event_payload);
-            HYDU_ERR_POP(status, "FTB publish failed\n");
-
             /* If this is not a forced cleanup, store a temporary
              * erroneous exit status. In case the application does not
              * return a non-zero exit status, we will use this. */
@@ -469,7 +461,6 @@ static HYD_status launch_procs(void)
     struct HYD_exec *exec;
     struct HYD_pmcd_hdr hdr;
     int sent, closed, pmi_fds[2] = { HYD_FD_UNSET, HYD_FD_UNSET };
-    char ftb_event_payload[HYDT_FTB_MAX_PAYLOAD_DATA];
     HYD_status status = HYD_SUCCESS;
 
     HYDU_FUNC_ENTER();
@@ -530,10 +521,6 @@ static HYD_status launch_procs(void)
         HYDU_ERR_POP(status, "unable to create env\n");
 
         /* Restart the proxy -- we use the first prefix in the list */
-        MPL_snprintf(ftb_event_payload, HYDT_FTB_MAX_PAYLOAD_DATA, "pgid:%d ranks:%d-%d",
-                     HYD_pmcd_pmip.local.pgid, HYD_pmcd_pmip.downstream.pmi_rank[0],
-                     HYD_pmcd_pmip.downstream.pmi_rank
-                     [HYD_pmcd_pmip.local.proxy_process_count - 1]);
         status = HYDT_ckpoint_restart(HYD_pmcd_pmip.local.pgid, HYD_pmcd_pmip.local.id,
                                       env, HYD_pmcd_pmip.local.proxy_process_count,
                                       HYD_pmcd_pmip.downstream.pmi_rank,
@@ -543,11 +530,6 @@ static HYD_status launch_procs(void)
                                       HYD_pmcd_pmip.downstream.err,
                                       HYD_pmcd_pmip.downstream.pid,
                                       HYD_pmcd_pmip.local.ckpoint_prefix_list[0]);
-        if (status)
-            status = HYDT_ftb_publish("FTB_MPI_PROCS_RESTART_FAIL", ftb_event_payload);
-        else
-            status = HYDT_ftb_publish("FTB_MPI_PROCS_RESTARTED", ftb_event_payload);
-        HYDU_ERR_POP(status, "checkpoint restart FTB publishing failure\n");
         goto fn_spawn_complete;
     }
 
@@ -873,7 +855,6 @@ HYD_status HYD_pmcd_pmip_control_cmd_cb(int fd, HYD_event_t events, void *userp)
 {
     int cmd_len, closed;
     struct HYD_pmcd_hdr hdr;
-    char ftb_event_payload[HYDT_FTB_MAX_PAYLOAD_DATA];
     char *buf;
     HYD_status status = HYD_SUCCESS;
 
@@ -894,10 +875,6 @@ HYD_status HYD_pmcd_pmip_control_cmd_cb(int fd, HYD_event_t events, void *userp)
     else if (hdr.cmd == CKPOINT) {
         HYDU_dump(stdout, "requesting checkpoint\n");
 
-        MPL_snprintf(ftb_event_payload, HYDT_FTB_MAX_PAYLOAD_DATA, "pgid:%d ranks:%d-%d",
-                     HYD_pmcd_pmip.local.pgid, HYD_pmcd_pmip.downstream.pmi_rank[0],
-                     HYD_pmcd_pmip.downstream.pmi_rank
-                     [HYD_pmcd_pmip.local.proxy_process_count - 1]);
         status = HYDT_ckpoint_checkpoint(HYD_pmcd_pmip.local.pgid, HYD_pmcd_pmip.local.id,
                                          HYD_pmcd_pmip.local.ckpoint_prefix_list[0]);
 
diff --git a/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c b/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c
index 8694f74..c2ec7e9 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c
@@ -9,7 +9,6 @@
 #include "bsci.h"
 #include "demux.h"
 #include "topo.h"
-#include "hydt_ftb.h"
 
 #define debug(...)                              \
     {                                           \
diff --git a/src/pm/hydra/tools/Makefile.mk b/src/pm/hydra/tools/Makefile.mk
index 4dfae98..630e4a5 100644
--- a/src/pm/hydra/tools/Makefile.mk
+++ b/src/pm/hydra/tools/Makefile.mk
@@ -12,4 +12,3 @@ include tools/ckpoint/Makefile.mk
 include tools/demux/Makefile.mk
 include tools/debugger/Makefile.mk
 include tools/nameserver/Makefile.mk
-include tools/ftb/Makefile.mk
diff --git a/src/pm/hydra/tools/ckpoint/ckpoint.c b/src/pm/hydra/tools/ckpoint/ckpoint.c
index 82da0a3..62b83ea 100644
--- a/src/pm/hydra/tools/ckpoint/ckpoint.c
+++ b/src/pm/hydra/tools/ckpoint/ckpoint.c
@@ -6,7 +6,6 @@
 
 #include "hydra.h"
 #include "ckpoint.h"
-#include "hydt_ftb.h"
 #ifdef HAVE_PTHREAD_H
 #include "pthread.h"
 #endif
@@ -66,7 +65,6 @@ HYD_status HYDT_ckpoint_init(const char *user_ckpointlib, int user_ckpoint_num)
 static void *ckpoint_thread(void *arg)
 {
     HYD_status status = HYD_SUCCESS;
-    char ftb_event_payload[HYDT_FTB_MAX_PAYLOAD_DATA];
 
 #if defined HAVE_BLCR
     if (!strcmp(HYDT_ckpoint_info.ckpointlib, "blcr")) {
@@ -77,8 +75,6 @@ static void *ckpoint_thread(void *arg)
     }
 #endif /* HAVE_BLCR */
 
-    HYDT_ftb_publish("FTB_MPI_PROCS_CKPTED", ftb_event_payload);
-
     ++HYDT_ckpoint_info.ckpoint_num;
 
   fn_exit:
@@ -86,7 +82,6 @@ static void *ckpoint_thread(void *arg)
     return (void *) (long) status;
 
   fn_fail:
-    HYDT_ftb_publish("FTB_MPI_PROCS_CKPT_FAIL", ftb_event_payload);
     goto fn_exit;
 
 }
@@ -153,7 +148,6 @@ HYD_status HYDT_ckpoint_restart(int pgid, int id, struct HYD_env * envlist, int
     HYD_status status = HYD_SUCCESS;
     struct stat st;
     int ret;
-    char ftb_event_payload[HYDT_FTB_MAX_PAYLOAD_DATA];
 
     HYDU_FUNC_ENTER();
 
@@ -176,8 +170,6 @@ HYD_status HYDT_ckpoint_restart(int pgid, int id, struct HYD_env * envlist, int
     }
 #endif /* HAVE_BLCR */
 
-    HYDT_ftb_publish("FTB_MPI_PROCS_RESTARTED", ftb_event_payload);
-
     /* next checkpoint number should be the one after the one we restarted from */
     ++HYDT_ckpoint_info.ckpoint_num;
 
@@ -186,6 +178,5 @@ HYD_status HYDT_ckpoint_restart(int pgid, int id, struct HYD_env * envlist, int
     return status;
 
   fn_fail:
-    HYDT_ftb_publish("FTB_MPI_PROCS_RESTART_FAIL", ftb_event_payload);
     goto fn_exit;
 }
diff --git a/src/pm/hydra/tools/ftb/Makefile.mk b/src/pm/hydra/tools/ftb/Makefile.mk
deleted file mode 100644
index f48d74e..0000000
--- a/src/pm/hydra/tools/ftb/Makefile.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-## -*- Mode: Makefile; -*-
-##
-## (C) 2008 by Argonne National Laboratory.
-##     See COPYRIGHT in top-level directory.
-##
-
-AM_CPPFLAGS += -I$(top_srcdir)/tools/ftb
-
-noinst_HEADERS += tools/ftb/hydt_ftb.h
-
-if hydra_have_ftb
-libhydra_la_SOURCES += tools/ftb/hydt_ftb.c
-else
-libhydra_la_SOURCES += tools/ftb/hydt_ftb_dummy.c
-endif
diff --git a/src/pm/hydra/tools/ftb/hydt_ftb.c b/src/pm/hydra/tools/ftb/hydt_ftb.c
deleted file mode 100644
index b684dc0..0000000
--- a/src/pm/hydra/tools/ftb/hydt_ftb.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2010 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include "hydra.h"
-#include "hydt_ftb.h"
-
-static FTB_client_handle_t ch;
-
-static FTB_event_info_t event_info[] = {
-    {"FTB_MPI_PROCS_RESTARTED", "info"},
-    {"FTB_MPI_PROCS_RESTART_FAIL", "error"},
-    {"FTB_MPI_PROCS_CKPTED", "info"},
-    {"FTB_MPI_PROCS_CKPT_FAILED", "error"},
-    {"FTB_MPI_PROCS_DEAD", "error"}
-};
-
-HYD_status HYDT_ftb_init(void)
-{
-    int ret;
-    FTB_client_t ci;
-    HYD_status status = HYD_SUCCESS;
-
-    MPL_strncpy(ci.event_space, "ftb.mpi.hydra", sizeof(ci.event_space));
-    MPL_strncpy(ci.client_name, "hydra " HYDRA_VERSION, sizeof(ci.client_name));
-    MPL_strncpy(ci.client_subscription_style, "FTB_SUBSCRIPTION_NONE",
-                sizeof(ci.client_subscription_style));
-    ci.client_polling_queue_len = -1;
-
-    ret = FTB_Connect(&ci, &ch);
-    if (ret)
-        HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "ftb connect\n");
-
-    ret = FTB_Declare_publishable_events(ch, NULL, event_info,
-                                         sizeof(event_info) / sizeof(event_info[0]));
-    if (ret)
-        HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "ftb declare publishable\n");
-
-  fn_exit:
-    HYDU_FUNC_EXIT();
-    return status;
-
-  fn_fail:
-    goto fn_exit;
-}
-
-HYD_status HYDT_ftb_finalize(void)
-{
-    int ret;
-    HYD_status status = HYD_SUCCESS;
-
-    ret = FTB_Disconnect(ch);
-    if (ret)
-        HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "ftb disconnect\n");
-
-  fn_exit:
-    HYDU_FUNC_EXIT();
-    return status;
-
-  fn_fail:
-    goto fn_exit;
-}
-
-HYD_status HYDT_ftb_publish(const char *event_name, const char *event_payload)
-{
-    FTB_event_properties_t event_prop;
-    FTB_event_handle_t event_handle;
-    int ret;
-    HYD_status status = HYD_SUCCESS;
-
-    event_prop.event_type = 1;
-    MPL_strncpy(event_prop.event_payload, event_payload, sizeof(event_prop.event_payload));
-
-    ret = FTB_Publish(ch, event_name, &event_prop, &event_handle);
-    if (ret)
-        HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "ftb publish\n");
-
-  fn_exit:
-    HYDU_FUNC_EXIT();
-    return status;
-
-  fn_fail:
-    goto fn_exit;
-}
diff --git a/src/pm/hydra/tools/ftb/hydt_ftb.h b/src/pm/hydra/tools/ftb/hydt_ftb.h
deleted file mode 100644
index 9635fec..0000000
--- a/src/pm/hydra/tools/ftb/hydt_ftb.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2010 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#ifndef HYDT_FTB_H_INCLUDED
-#define HYDT_FTB_H_INCLUDED
-
-#if defined ENABLE_FTB
-#include <libftb.h>
-#define HYDT_FTB_MAX_PAYLOAD_DATA FTB_MAX_PAYLOAD_DATA
-#else
-#define HYDT_FTB_MAX_PAYLOAD_DATA (1024)
-#endif /* ENABLE_FTB */
-
-HYD_status HYDT_ftb_init(void);
-HYD_status HYDT_ftb_finalize(void);
-HYD_status HYDT_ftb_publish(const char *event_name, const char *event_payload);
-
-#endif /* HYDT_FTB_H_INCLUDED */
diff --git a/src/pm/hydra/tools/ftb/hydt_ftb_dummy.c b/src/pm/hydra/tools/ftb/hydt_ftb_dummy.c
deleted file mode 100644
index 8fcee97..0000000
--- a/src/pm/hydra/tools/ftb/hydt_ftb_dummy.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2010 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include "hydra.h"
-#include "hydt_ftb.h"
-
-HYD_status HYDT_ftb_init(void)
-{
-    return HYD_SUCCESS;
-}
-
-HYD_status HYDT_ftb_finalize(void)
-{
-    return HYD_SUCCESS;
-}
-
-HYD_status HYDT_ftb_publish(const char *event_name, const char *event_payload)
-{
-    return HYD_SUCCESS;
-}
diff --git a/src/pm/hydra/ui/mpich/mpiexec.c b/src/pm/hydra/ui/mpich/mpiexec.c
index c07542f..eb969ec 100644
--- a/src/pm/hydra/ui/mpich/mpiexec.c
+++ b/src/pm/hydra/ui/mpich/mpiexec.c
@@ -9,7 +9,6 @@
 #include "mpiexec.h"
 #include "pmci.h"
 #include "bsci.h"
-#include "hydt_ftb.h"
 #include "demux.h"
 #include "ui.h"
 #include "uiu.h"
@@ -145,9 +144,6 @@ int main(int argc, char **argv)
     status = HYDU_set_common_signals(signal_cb);
     HYDU_ERR_POP(status, "unable to set signal\n");
 
-    status = HYDT_ftb_init();
-    HYDU_ERR_POP(status, "unable to initialize FTB\n");
-
     /* Get user preferences */
     status = HYD_uii_mpx_get_parameters(argv);
     HYDU_ERR_POP(status, "error parsing parameters\n");
@@ -374,9 +370,6 @@ int main(int argc, char **argv)
     status = HYD_pmci_finalize();
     HYDU_ERR_POP(status, "process manager error on finalize\n");
 
-    status = HYDT_ftb_finalize();
-    HYDU_ERR_POP(status, "error finalizing FTB\n");
-
 #if defined ENABLE_PROFILING
     if (HYD_server_info.enable_profiling) {
         HYDU_dump_noprefix(stdout, "\n");

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

commit b25093377303f390dae54bf00bb2614776f1c70c
Author: Pavan Balaji <balaji at anl.gov>
Date:   Sat Jan 23 12:04:55 2016 -0600

    CHANGES: fixup the version number.
    
    We released mpich-3.2 with the wrong version number, but better late
    than never.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/CHANGES b/CHANGES
index cf69372..5a7aece 100644
--- a/CHANGES
+++ b/CHANGES
@@ -31,7 +31,7 @@
 
    A full list of changes is available at the following link:
 
-     http://git.mpich.org/mpich.git/shortlog/v3.1.3..v3.2rc1
+     http://git.mpich.org/mpich.git/shortlog/v3.1.3..v3.2
 
    A full list of bugs that have been fixed is available at the
    following link:

http://git.mpich.org/mpich.git/commitdiff/781b6215eaf63f592b71b34cc6cf90801fec2038

commit 781b6215eaf63f592b71b34cc6cf90801fec2038
Author: Pavan Balaji <balaji at anl.gov>
Date:   Sat Jan 23 11:54:21 2016 -0600

    release: verify version number in CHANGES file.
    
    We keep forgetting to update the manual version number in the CHANGES
    file before releasing.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/maint/release.pl b/maint/release.pl
index 0d2db75..ccba751 100755
--- a/maint/release.pl
+++ b/maint/release.pl
@@ -174,7 +174,13 @@ print("\n");
 my $current_ver = `git show ${branch}:maint/version.m4 | grep MPICH_VERSION_m4 | \
                    sed -e 's/^.*\\[MPICH_VERSION_m4\\],\\[\\(.*\\)\\].*/\\1/g'`;
 if ("$current_ver" ne "$version\n") {
-    print("\tWARNING: Version mismatch\n\n");
+    print("\tWARNING: maint/version does not match user version\n\n");
+}
+
+my $changes_ver = `git show ${branch}:CHANGES | grep "http://git.mpich.org/mpich.git/shortlog" | \
+                   sed -e '2,\$d' -e 's/.*\.\.//g'`;
+if ("$changes_ver" ne "$version\n") {
+    print("\tWARNING: CHANGES/version does not match user version\n\n");
 }
 
 if ($append_commit_id) {

http://git.mpich.org/mpich.git/commitdiff/558c9681f2a3faa386c3ac62790963cd357afd4d

commit 558c9681f2a3faa386c3ac62790963cd357afd4d
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Jan 22 20:34:17 2016 -0600

    readme: remove svn references.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/README.vin b/README.vin
index bc7ef89..40b6e72 100644
--- a/README.vin
+++ b/README.vin
@@ -787,10 +787,10 @@ These instructions can also be found on the MPICH wiki:
 
 9. Developer Builds
 ===================
-For MPICH developers who want to directly work on the svn, there are
-a few additional steps involved (people using the release tarballs do
-not have to follow these steps). Details about these steps can be
-found here:
+For MPICH developers who want to directly work on the primary version
+control system, there are a few additional steps involved (people
+using the release tarballs do not have to follow these steps). Details
+about these steps can be found here:
 http://wiki.mpich.org/mpich/index.php/Getting_And_Building_MPICH
 
 -------------------------------------------------------------------------

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

Summary of changes:
 .gitignore                                         |    4 +-
 CHANGES                                            |    2 +-
 README.vin                                         |    8 +-
 confdb/aclocal_romio.m4                            |    2 +-
 confdb/ax_tls.m4                                   |   13 +-
 configure.ac                                       |  231 -----
 maint/configure.ac                                 |    4 +-
 maint/extractcvars.in                              |    4 +-
 {src/util/dbg => maint}/getfuncstack.in            |    0
 maint/release.pl                                   |    8 +-
 src/binding/cxx/buildiface                         |   16 +-
 src/binding/fortran/mpif_h/buildiface              |    4 +-
 src/binding/fortran/mpif_h/mpi_fortimpl.h          |    8 +-
 .../fortran/use_mpi_f08/wrappers_c/comm_spawn_c.c  |    2 +-
 .../use_mpi_f08/wrappers_c/comm_spawn_multiple_c.c |   20 +-
 src/binding/fortran/use_mpi_f08/wrappers_c/utils.c |    2 +-
 src/glue/romio/glue_romio.c                        |   18 +-
 src/include/glue_romio.h.in                        |   11 -
 src/include/mpifunc.h                              |   16 +-
 src/include/mpihandlemem.h                         |   14 +-
 src/include/mpiimpl.h                              |  127 ++-
 src/include/mpimem.h                               |  187 +----
 src/include/mpir_nbc.h                             |    4 +-
 src/include/mpitimpl.h                             |    4 +-
 src/include/mpiu_utarray.h                         |   10 +-
 src/include/mpiu_uthash.h                          |    6 +-
 src/include/mpiutil.h                              |    2 -
 src/mpi/attr/comm_create_keyval.c                  |    2 +-
 src/mpi/attr/type_create_keyval.c                  |    2 +-
 src/mpi/attr/win_create_keyval.c                   |    2 +-
 src/mpi/coll/exscan.c                              |   26 +-
 src/mpi/coll/helper_fns.c                          |   32 +-
 src/mpi/coll/ireduce.c                             |   12 +-
 src/mpi/coll/nbcutil.c                             |    2 +-
 src/mpi/coll/op_create.c                           |    2 +-
 src/mpi/coll/opband.c                              |   12 +-
 src/mpi/coll/opbor.c                               |   12 +-
 src/mpi/coll/opbxor.c                              |   12 +-
 src/mpi/coll/opland.c                              |   12 +-
 src/mpi/coll/oplor.c                               |   12 +-
 src/mpi/coll/oplxor.c                              |   12 +-
 src/mpi/coll/opmax.c                               |   12 +-
 src/mpi/coll/opmaxloc.c                            |   12 +-
 src/mpi/coll/opmin.c                               |   12 +-
 src/mpi/coll/opminloc.c                            |   12 +-
 src/mpi/coll/opprod.c                              |   12 +-
 src/mpi/coll/opsum.c                               |   12 +-
 src/mpi/coll/red_scat.c                            |   24 +-
 src/mpi/coll/red_scat_block.c                      |   24 +-
 src/mpi/coll/reduce.c                              |   26 +-
 src/mpi/coll/reduce_local.c                        |   24 +-
 src/mpi/coll/scan.c                                |   28 +-
 src/mpi/comm/comm_create.c                         |   12 +-
 src/mpi/comm/comm_create_group.c                   |    4 +-
 src/mpi/comm/comm_dup.c                            |    2 +-
 src/mpi/comm/comm_dup_with_info.c                  |    2 +-
 src/mpi/comm/comm_idup.c                           |    2 +-
 src/mpi/comm/comm_shrink.c                         |    2 +-
 src/mpi/comm/comm_split.c                          |    2 +-
 src/mpi/comm/comm_split_type.c                     |    2 +-
 src/mpi/comm/commutil.c                            |   34 +-
 src/mpi/comm/contextid.c                           |   36 +-
 src/mpi/comm/intercomm_create.c                    |   16 +-
 src/mpi/comm/intercomm_merge.c                     |    2 +-
 src/mpi/datatype/register_datarep.c                |    1 -
 src/mpi/datatype/type_contiguous.c                 |    2 +-
 src/mpi/datatype/type_create_darray.c              |    2 +-
 src/mpi/datatype/type_create_hindexed.c            |    2 +-
 src/mpi/datatype/type_create_hindexed_block.c      |    2 +-
 src/mpi/datatype/type_create_hvector.c             |    2 +-
 src/mpi/datatype/type_create_indexed_block.c       |    2 +-
 src/mpi/datatype/type_create_resized.c             |    2 +-
 src/mpi/datatype/type_create_struct.c              |    2 +-
 src/mpi/datatype/type_create_subarray.c            |    2 +-
 src/mpi/datatype/type_dup.c                        |    2 +-
 src/mpi/datatype/type_get_name.c                   |    2 +-
 src/mpi/datatype/type_hindexed.c                   |    2 +-
 src/mpi/datatype/type_hvector.c                    |    2 +-
 src/mpi/datatype/type_indexed.c                    |    2 +-
 src/mpi/datatype/type_struct.c                     |    2 +-
 src/mpi/datatype/type_vector.c                     |    2 +-
 src/mpi/debugger/dbginit.c                         |   28 +-
 src/mpi/errhan/comm_create_errhandler.c            |    2 +-
 src/mpi/errhan/dynerrutil.c                        |   14 +-
 src/mpi/errhan/errnames.txt                        |    4 +-
 src/mpi/errhan/errutil.c                           |   34 +-
 src/mpi/errhan/file_call_errhandler.c              |    3 -
 src/mpi/errhan/file_create_errhandler.c            |    2 +-
 src/mpi/errhan/win_call_errhandler.c               |    3 -
 src/mpi/errhan/win_create_errhandler.c             |    2 +-
 src/mpi/errhan/windefmsg.h                         |    8 +-
 src/mpi/group/group_difference.c                   |    2 +-
 src/mpi/group/group_excl.c                         |    2 +-
 src/mpi/group/group_incl.c                         |    2 +-
 src/mpi/group/group_intersection.c                 |    2 +-
 src/mpi/group/group_range_excl.c                   |    2 +-
 src/mpi/group/group_range_incl.c                   |    2 +-
 src/mpi/group/group_translate_ranks.c              |    2 +-
 src/mpi/group/group_union.c                        |    2 +-
 src/mpi/group/groupdebug.c                         |    2 +-
 src/mpi/group/grouputil.c                          |   10 +-
 src/mpi/info/info_delete.c                         |    4 +-
 src/mpi/info/info_dup.c                            |    4 +-
 src/mpi/info/info_set.c                            |    8 +-
 src/mpi/info/infoutil.c                            |    4 +-
 src/mpi/init/async.c                               |    1 -
 src/mpi/init/finalize.c                            |    2 +-
 src/mpi/init/init.c                                |    4 +-
 src/mpi/init/initthread.c                          |   80 ++-
 src/mpi/pt2pt/bsend_init.c                         |    2 +-
 src/mpi/pt2pt/bsendutil.c                          |   72 +-
 src/mpi/pt2pt/cancel.c                             |    4 +-
 src/mpi/pt2pt/greq_start.c                         |    6 +-
 src/mpi/pt2pt/ibsend.c                             |    6 +-
 src/mpi/pt2pt/mpir_request.c                       |    4 +-
 src/mpi/pt2pt/recv_init.c                          |    2 +-
 src/mpi/pt2pt/rsend_init.c                         |    2 +-
 src/mpi/pt2pt/send_init.c                          |    2 +-
 src/mpi/pt2pt/ssend_init.c                         |    2 +-
 src/mpi/rma/win_allocate.c                         |    2 +-
 src/mpi/rma/win_allocate_shared.c                  |    2 +-
 src/mpi/rma/win_create.c                           |    2 +-
 src/mpi/rma/win_create_dynamic.c                   |    2 +-
 src/mpi/romio/adio/ad_gpfs/ad_gpfs_aggrs.c         |    2 +-
 src/mpi/romio/adio/ad_gpfs/ad_gpfs_rdcoll.c        |    2 +-
 src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c        |    2 +-
 src/mpi/romio/adio/ad_gpfs/pe/ad_pe_aggrs.c        |    2 +-
 src/mpi/romio/adio/common/ad_iread_coll.c          |    2 +-
 src/mpi/romio/adio/common/ad_read_coll.c           |    2 +-
 src/mpi/romio/adio/common/flatten.c                |    2 +-
 src/mpi/romio/adio/common/lock.c                   |    4 +-
 src/mpi/romio/adio/common/malloc.c                 |    8 +-
 src/mpi/romio/adio/include/adioi.h                 |    3 +-
 src/mpi/romio/mpi-io/get_errh.c                    |    1 -
 src/mpi/romio/mpi-io/ioreq_c2f.c                   |    1 -
 src/mpi/romio/mpi-io/ioreq_f2c.c                   |    1 -
 src/mpi/romio/mpi-io/iotest.c                      |    1 -
 src/mpi/romio/mpi-io/iotestall.c                   |    1 -
 src/mpi/romio/mpi-io/iotestany.c                   |    1 -
 src/mpi/romio/mpi-io/iotestsome.c                  |    1 -
 src/mpi/romio/mpi-io/iowait.c                      |    1 -
 src/mpi/romio/mpi-io/iowaitall.c                   |    1 -
 src/mpi/romio/mpi-io/iowaitany.c                   |    1 -
 src/mpi/romio/mpi-io/iowaitsome.c                  |    1 -
 src/mpi/romio/mpi-io/set_errh.c                    |    1 -
 src/mpi/spawn/comm_accept.c                        |    2 +-
 src/mpi/spawn/comm_connect.c                       |    2 +-
 src/mpi/spawn/comm_join.c                          |    2 +-
 src/mpi/spawn/comm_spawn.c                         |    2 +-
 src/mpi/spawn/comm_spawn_multiple.c                |    2 +-
 src/mpi/topo/cart_create.c                         |    2 +-
 src/mpi/topo/dist_gr_create.c                      |   34 +-
 src/mpi/topo/dist_gr_create_adj.c                  |    2 +-
 src/mpi/topo/graphcreate.c                         |    2 +-
 src/mpi/topo/topoutil.c                            |   34 +-
 src/mpi_t/cvar_handle_free.c                       |    2 +-
 src/mpi_t/mpit.c                                   |   28 +-
 src/mpi_t/mpit_finalize.c                          |   24 +-
 src/mpi_t/pvar_handle_free.c                       |    2 +-
 src/mpi_t/pvar_session_free.c                      |    4 +-
 .../ch3/channels/nemesis/include/mpid_nem_debug.h  |    2 +-
 .../ch3/channels/nemesis/include/mpid_nem_impl.h   |   17 +-
 .../ch3/channels/nemesis/include/mpid_nem_inline.h |   68 +-
 .../ch3/channels/nemesis/include/mpidi_ch3_impl.h  |   10 +-
 .../ch3/channels/nemesis/include/mpidi_ch3_pre.h   |   24 +-
 .../ch3/channels/nemesis/netmod/llc/llc_poll.c     |   28 +-
 .../ch3/channels/nemesis/netmod/llc/llc_probe.c    |    2 +-
 .../ch3/channels/nemesis/netmod/llc/llc_send.c     |  106 ++--
 src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c  |    6 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_impl.h     |   10 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_init.c     |   42 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_poll.c     |   20 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_probe.c    |    2 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_send.c     |   30 +-
 src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c  |   54 +-
 .../ch3/channels/nemesis/netmod/ofi/ofi_init.c     |   12 +-
 src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_msg.c |   22 +-
 .../ch3/channels/nemesis/netmod/ofi/ofi_progress.c |    2 +-
 .../ch3/channels/nemesis/netmod/ofi/ofi_tagged.c   |    4 +-
 .../nemesis/netmod/ofi/ofi_tagged_template.c       |    8 +-
 .../channels/nemesis/netmod/portals4/ptl_impl.h    |   18 +-
 .../channels/nemesis/netmod/portals4/ptl_init.c    |   70 +-
 .../ch3/channels/nemesis/netmod/portals4/ptl_nm.c  |   28 +-
 .../channels/nemesis/netmod/portals4/ptl_poll.c    |    8 +-
 .../channels/nemesis/netmod/portals4/ptl_probe.c   |   10 +-
 .../channels/nemesis/netmod/portals4/ptl_recv.c    |   34 +-
 .../channels/nemesis/netmod/portals4/ptl_send.c    |   38 +-
 .../ch3/channels/nemesis/netmod/portals4/rptl.c    |   14 +-
 .../channels/nemesis/netmod/portals4/rptl_init.c   |    8 +-
 src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c  |  170 ++--
 src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h  |    6 +-
 .../ch3/channels/nemesis/netmod/tcp/tcp_getip.c    |    6 +-
 .../ch3/channels/nemesis/netmod/tcp/tcp_impl.h     |    2 +
 .../ch3/channels/nemesis/netmod/tcp/tcp_init.c     |   49 +-
 .../ch3/channels/nemesis/netmod/tcp/tcp_send.c     |   46 +-
 .../ch3/channels/nemesis/netmod/tcp/tcp_utility.c  |    8 +-
 src/mpid/ch3/channels/nemesis/src/ch3_init.c       |    6 +-
 src/mpid/ch3/channels/nemesis/src/ch3_isend.c      |    4 +-
 src/mpid/ch3/channels/nemesis/src/ch3_isendv.c     |   18 +-
 src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c  |    4 +-
 src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c |   16 +-
 src/mpid/ch3/channels/nemesis/src/ch3_progress.c   |   70 +-
 src/mpid/ch3/channels/nemesis/src/ch3_rma_shm.c    |    2 +-
 src/mpid/ch3/channels/nemesis/src/ch3i_comm.c      |    4 +-
 .../ch3/channels/nemesis/src/ch3i_eagernoncontig.c |    6 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_alloc.c |    4 +-
 .../ch3/channels/nemesis/src/mpid_nem_barrier.c    |    2 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_ckpt.c  |   10 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c |   10 +-
 .../ch3/channels/nemesis/src/mpid_nem_finalize.c   |   24 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c  |   10 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c   |   30 +-
 .../ch3/channels/nemesis/src/mpid_nem_lmt_dma.c    |   16 +-
 .../ch3/channels/nemesis/src/mpid_nem_lmt_shm.c    |   64 +-
 .../channels/nemesis/src/mpid_nem_lmt_vmsplice.c   |   16 +-
 src/mpid/ch3/channels/nemesis/src/mpid_nem_mpich.c |    2 +-
 .../ch3/channels/nemesis/src/mpid_nem_mpich_rma.c  |   64 +-
 .../ch3/channels/sock/include/mpidi_ch3_impl.h     |    6 +-
 src/mpid/ch3/channels/sock/src/ch3_init.c          |    6 +-
 src/mpid/ch3/channels/sock/src/ch3_isend.c         |   34 +-
 src/mpid/ch3/channels/sock/src/ch3_isendv.c        |   36 +-
 src/mpid/ch3/channels/sock/src/ch3_istartmsg.c     |   32 +-
 src/mpid/ch3/channels/sock/src/ch3_istartmsgv.c    |   32 +-
 src/mpid/ch3/channels/sock/src/ch3_progress.c      |   42 +-
 src/mpid/ch3/include/mpid_rma_issue.h              |   24 +-
 src/mpid/ch3/include/mpid_rma_lockqueue.h          |    2 +-
 src/mpid/ch3/include/mpid_rma_oplist.h             |    2 +-
 src/mpid/ch3/include/mpid_rma_shm.h                |   16 +-
 src/mpid/ch3/include/mpid_thread.h                 |   21 +-
 src/mpid/ch3/include/mpidimpl.h                    |  104 +--
 src/mpid/ch3/include/mpidpost.h                    |    6 +-
 src/mpid/ch3/include/mpidrma.h                     |   20 +-
 src/mpid/ch3/src/ch3u_buffer.c                     |   26 +-
 src/mpid/ch3/src/ch3u_comm.c                       |   12 +-
 src/mpid/ch3/src/ch3u_comm_spawn_multiple.c        |   36 +-
 src/mpid/ch3/src/ch3u_eager.c                      |   80 +-
 src/mpid/ch3/src/ch3u_eagersync.c                  |   44 +-
 src/mpid/ch3/src/ch3u_handle_connection.c          |   38 +-
 src/mpid/ch3/src/ch3u_handle_recv_pkt.c            |   30 +-
 src/mpid/ch3/src/ch3u_handle_recv_req.c            |   12 +-
 src/mpid/ch3/src/ch3u_handle_revoke_pkt.c          |    2 +-
 src/mpid/ch3/src/ch3u_handle_send_req.c            |    6 +-
 src/mpid/ch3/src/ch3u_port.c                       |   98 +-
 src/mpid/ch3/src/ch3u_recvq.c                      |   32 +-
 src/mpid/ch3/src/ch3u_request.c                    |   54 +-
 src/mpid/ch3/src/ch3u_rma_pkthandler.c             |  132 ++--
 src/mpid/ch3/src/ch3u_rma_sync.c                   |    2 +-
 src/mpid/ch3/src/ch3u_rndv.c                       |   50 +-
 src/mpid/ch3/src/mpid_cancel_recv.c                |    4 +-
 src/mpid/ch3/src/mpid_cancel_send.c                |   42 +-
 src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c  |   16 +-
 src/mpid/ch3/src/mpid_comm_revoke.c                |    4 +-
 src/mpid/ch3/src/mpid_finalize.c                   |    4 +-
 src/mpid/ch3/src/mpid_imrecv.c                     |    4 +-
 src/mpid/ch3/src/mpid_init.c                       |   39 +-
 src/mpid/ch3/src/mpid_irecv.c                      |   18 +-
 src/mpid/ch3/src/mpid_irsend.c                     |   10 +-
 src/mpid/ch3/src/mpid_isend.c                      |   12 +-
 src/mpid/ch3/src/mpid_issend.c                     |    8 +-
 src/mpid/ch3/src/mpid_port.c                       |   12 +-
 src/mpid/ch3/src/mpid_recv.c                       |   16 +-
 src/mpid/ch3/src/mpid_rsend.c                      |   10 +-
 src/mpid/ch3/src/mpid_send.c                       |   12 +-
 src/mpid/ch3/src/mpid_ssend.c                      |    8 +-
 src/mpid/ch3/src/mpid_startall.c                   |    8 +-
 src/mpid/ch3/src/mpid_vc.c                         |   20 +-
 src/mpid/ch3/src/mpidi_isend_self.c                |   10 +-
 src/mpid/ch3/src/mpidi_pg.c                        |   50 +-
 src/mpid/ch3/src/mpidi_printf.c                    |   68 +-
 src/mpid/ch3/src/mpidi_rma.c                       |   16 +-
 src/mpid/ch3/util/sock/ch3u_connect_sock.c         |  152 ++--
 src/mpid/ch3/util/sock/ch3u_getinterfaces.c        |    6 +-
 src/mpid/ch3/util/sock/ch3u_init_sock.c            |    2 +-
 src/mpid/ch3/util/sock/ch3usock.h                  |    2 +-
 src/mpid/ch3/util/sock/findinterfaces.c            |    8 +-
 src/mpid/ch3/util/unordered/unordered.c            |   10 +-
 src/mpid/common/datatype/dataloop/dataloop.c       |   42 +-
 .../datatype/dataloop/dataloop_create_struct.c     |    8 +-
 src/mpid/common/datatype/dataloop/segment.c        |   30 +-
 src/mpid/common/datatype/dataloop/segment_count.c  |    2 +-
 .../common/datatype/dataloop/segment_flatten.c     |    4 +-
 src/mpid/common/datatype/mpid_dataloop.h           |    4 +-
 src/mpid/common/datatype/mpid_datatype_contents.c  |    4 +-
 src/mpid/common/datatype/mpid_datatype_free.c      |    2 +-
 src/mpid/common/datatype/mpid_segment.c            |   10 +-
 src/mpid/common/datatype/mpid_type_commit.c        |    2 +-
 src/mpid/common/datatype/mpid_type_contiguous.c    |    2 +-
 .../common/datatype/mpid_type_create_resized.c     |    2 +-
 src/mpid/common/datatype/mpid_type_debug.c         |  118 ++--
 src/mpid/common/datatype/mpid_type_dup.c           |    2 +-
 src/mpid/common/datatype/mpid_type_indexed.c       |    4 +-
 src/mpid/common/datatype/mpid_type_vector.c        |    2 +-
 src/mpid/common/hcoll/hcoll.h                      |    4 +
 src/mpid/common/hcoll/hcoll_init.c                 |   19 +-
 src/mpid/common/hcoll/hcoll_ops.c                  |   60 +-
 src/mpid/common/hcoll/hcoll_rte.c                  |    4 +-
 src/mpid/common/sched/mpidu_sched.c                |   42 +-
 src/mpid/common/sock/iocp/sock.c                   |  122 ++--
 src/mpid/common/sock/poll/errnames.txt             |    2 +-
 src/mpid/common/sock/poll/sock_immed.i             |    4 +-
 src/mpid/common/sock/poll/sock_post.i              |   10 +-
 src/mpid/common/sock/poll/sock_set.i               |   22 +-
 src/mpid/common/sock/poll/sock_wait.i              |    6 +-
 src/mpid/common/sock/poll/socki_util.i             |   36 +-
 src/mpid/common/thread/mpidu_thread_fallback.h     |  332 ++++++--
 src/mpid/common/timers/mpid_timers_fallback.h      |   14 +-
 src/mpid/pamid/include/mpidi_macros.h              |   10 +-
 .../pamid/src/coll/allgather/mpido_allgather.c     |   24 +-
 .../pamid/src/coll/allgatherv/mpido_allgatherv.c   |   32 +-
 .../pamid/src/coll/allreduce/mpido_allreduce.c     |   12 +-
 src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c  |   20 +-
 .../pamid/src/coll/alltoallv/mpido_alltoallv.c     |   64 +-
 src/mpid/pamid/src/coll/barrier/mpido_barrier.c    |    4 +-
 src/mpid/pamid/src/coll/bcast/mpido_bcast.c        |   12 +-
 src/mpid/pamid/src/coll/gather/mpido_gather.c      |   28 +-
 src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c    |   28 +-
 src/mpid/pamid/src/coll/red_scat/mpido_red_scat.c  |   16 +-
 src/mpid/pamid/src/coll/reduce/mpido_reduce.c      |   16 +-
 src/mpid/pamid/src/coll/scan/mpido_scan.c          |   12 +-
 src/mpid/pamid/src/coll/scatter/mpido_scatter.c    |   26 +-
 src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c  |   68 +-
 src/mpid/pamid/src/comm/mpid_comm.c                |    4 +-
 src/mpid/pamid/src/comm/mpid_optcolls.c            |    8 +-
 src/mpid/pamid/src/comm/mpid_selectcolls.c         |    8 +-
 src/mpid/pamid/src/dyntask/mpid_comm_disconnect.c  |   12 +-
 .../pamid/src/dyntask/mpid_comm_spawn_multiple.c   |   38 +-
 src/mpid/pamid/src/dyntask/mpid_port.c             |   18 +-
 src/mpid/pamid/src/dyntask/mpidi_pg.c              |   62 +-
 src/mpid/pamid/src/dyntask/mpidi_port.c            |  134 ++--
 src/mpid/pamid/src/misc/mpid_mem.c                 |    4 +-
 src/mpid/pamid/src/mpid_buffer.c                   |    8 +-
 src/mpid/pamid/src/mpid_finalize.c                 |   22 +-
 src/mpid/pamid/src/mpid_imrecv.c                   |    2 +-
 src/mpid/pamid/src/mpid_init.c                     |   44 +-
 src/mpid/pamid/src/mpid_request.c                  |    4 +-
 src/mpid/pamid/src/mpid_request.h                  |   16 +-
 src/mpid/pamid/src/mpid_time.c                     |   28 +-
 src/mpid/pamid/src/mpid_vc.c                       |   24 +-
 src/mpid/pamid/src/mpidi_bufmm.c                   |   20 +-
 src/mpid/pamid/src/mpidi_env.c                     |    8 +-
 src/mpid/pamid/src/mpidi_pami_datatype.c           |   22 +-
 src/mpid/pamid/src/mpidi_util.c                    |   78 +-
 src/mpid/pamid/src/mpix/mpix.c                     |    6 +-
 src/mpid/pamid/src/onesided/mpid_1s.c              |   18 +-
 src/mpid/pamid/src/onesided/mpid_win_accumulate.c  |   12 +-
 src/mpid/pamid/src/onesided/mpid_win_allocate.c    |    2 +-
 .../pamid/src/onesided/mpid_win_allocate_shared.c  |   12 +-
 .../pamid/src/onesided/mpid_win_compare_and_swap.c |    4 +-
 src/mpid/pamid/src/onesided/mpid_win_create.c      |    2 +-
 .../pamid/src/onesided/mpid_win_create_dynamic.c   |    4 +-
 .../pamid/src/onesided/mpid_win_fetch_and_op.c     |    4 +-
 src/mpid/pamid/src/onesided/mpid_win_free.c        |   10 +-
 src/mpid/pamid/src/onesided/mpid_win_get.c         |   12 +-
 .../pamid/src/onesided/mpid_win_get_accumulate.c   |   44 +-
 src/mpid/pamid/src/onesided/mpid_win_lock.c        |    4 +-
 src/mpid/pamid/src/onesided/mpid_win_lock_all.c    |    4 +-
 src/mpid/pamid/src/onesided/mpid_win_put.c         |   12 +-
 src/mpid/pamid/src/pt2pt/mpid_cancel.c             |    2 +-
 src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c    |    4 +-
 src/mpid/pamid/src/pt2pt/mpidi_callback_short.c    |    2 +-
 src/mpid/pamid/src/pt2pt/mpidi_callback_util.c     |    2 +-
 src/mpid/pamid/src/pt2pt/mpidi_done.c              |    2 +-
 src/mpid/pamid/src/pt2pt/mpidi_recv.h              |    2 +-
 src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c           |    2 +-
 src/mpid/pamid/src/pt2pt/mpidi_rendezvous.c        |    2 +-
 src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c           |   16 +-
 src/mpl/configure.ac                               |  277 ++++++-
 src/mpl/include/mpl.h                              |    4 +
 src/mpl/include/mpl_argstr.h                       |   49 +
 src/mpl/include/mpl_base.h                         |    2 +-
 src/mpl/include/mpl_dbg.h                          |  148 +++
 src/mpl/include/mpl_iov.h                          |    8 +-
 src/mpl/include/mpl_msg.h                          |   10 -
 src/mpl/include/mpl_str.h                          |   10 -
 src/mpl/include/mpl_thread.h                       |   44 +
 src/mpl/include/mpl_thread_posix.h                 |  246 +++++
 src/mpl/include/mpl_thread_priv.h                  |   98 ++
 src/mpl/include/mpl_thread_solaris.h               |  195 ++++
 src/mpl/include/mpl_thread_win.h                   |  106 +++
 src/mpl/include/mpl_timer.h.in                     |   60 +-
 src/mpl/include/mpl_timer_clock_gettime.h          |    2 +-
 src/mpl/include/mpl_timer_device.h                 |   12 +-
 src/mpl/include/mpl_timer_gcc_ia64_cycle.h         |    4 +-
 src/mpl/include/mpl_timer_linux86_cycle.h          |    2 +-
 .../include/mpl_timer_query_performance_counter.h  |    2 +-
 src/mpl/include/mpl_timer_win86_cycle.h            |    2 +-
 src/mpl/include/mpl_trmem.h                        |  108 +++-
 src/mpl/include/mpl_yield.h                        |   64 ++
 src/mpl/src/Makefile.mk                            |    2 +
 src/mpl/src/dbg/Makefile.mk                        |    8 +
 src/mpl/src/dbg/mpl_dbg.c                          |  948 ++++++++++++++++++++
 src/mpl/src/mem/mpl_trmem.c                        |  139 +++-
 src/mpl/src/str/Makefile.mk                        |    2 +-
 src/mpl/src/str/mpl_argstr.c                       |  880 ++++++++++++++++++
 src/mpl/src/thread/Makefile.mk                     |   12 +
 src/mpl/src/thread/mpl_thread.c                    |   22 +
 src/mpl/src/thread/mpl_thread_posix.c              |   92 ++
 src/mpl/src/thread/mpl_thread_solaris.c            |   83 ++
 src/mpl/src/thread/mpl_thread_win.c                |  352 ++++++++
 src/mpl/src/timer/mpl_timer_clock_gettime.c        |   12 +-
 src/mpl/src/timer/mpl_timer_device.c               |   40 +-
 src/mpl/src/timer/mpl_timer_gcc_ia64_cycle.c       |   14 +-
 src/mpl/src/timer/mpl_timer_gethrtime.c            |   14 +-
 src/mpl/src/timer/mpl_timer_gettimeofday.c         |   12 +-
 src/mpl/src/timer/mpl_timer_linux86_cycle.c        |   16 +-
 src/mpl/src/timer/mpl_timer_mach_absolute_time.c   |   12 +-
 .../timer/mpl_timer_query_performance_counter.c    |   21 +-
 src/mpl/src/timer/mpl_timer_win86_cycle.c          |   31 +-
 src/nameserv/file/file_nameserv.c                  |   10 +-
 src/nameserv/pmi/pmi_nameserv.c                    |    8 +-
 src/pm/gforker/mpiexec.c                           |    2 +-
 src/pm/hydra/configure.ac                          |   19 -
 src/pm/hydra/include/hydra.h                       |    2 +-
 src/pm/hydra/pm/pmiserv/pmip.c                     |    7 -
 src/pm/hydra/pm/pmiserv/pmip_cb.c                  |   47 +-
 src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c              |    1 -
 src/pm/hydra/pm/pmiserv/pmiserv_cb.c               |   12 +-
 src/pm/hydra/tools/Makefile.mk                     |    1 -
 src/pm/hydra/tools/ckpoint/ckpoint.c               |    9 -
 src/pm/hydra/tools/ftb/Makefile.mk                 |   15 -
 src/pm/hydra/tools/ftb/hydt_ftb.c                  |   86 --
 src/pm/hydra/tools/ftb/hydt_ftb.h                  |   21 -
 src/pm/hydra/tools/ftb/hydt_ftb_dummy.c            |   23 -
 src/pm/hydra/ui/mpich/mpiexec.c                    |    7 -
 src/pm/hydra/utils/sock/sock.c                     |   89 +-
 src/pm/remshell/mpiexec.c                          |   20 +-
 src/pm/util/cmnargs.c                              |   12 +-
 src/pm/util/dbgiface.c                             |    4 +-
 src/pm/util/env.c                                  |   22 +-
 src/pm/util/labelout.c                             |    4 +-
 src/pm/util/pmiserv.c                              |   32 +-
 src/pm/util/pmutil.h                               |   14 +-
 src/pm/util/process.c                              |   10 +-
 src/pm/util/rm.c                                   |   28 +-
 src/pmi/pmi2/poe/poe2pmi.c                         |    6 +-
 src/pmi/pmi2/simple/pmi2compat.h                   |    6 +-
 src/pmi/pmi2/simple/simple2pmi.c                   |   24 +-
 src/pmi/simple/simple_pmi.c                        |    2 +-
 src/util/Makefile.mk                               |    3 +-
 src/util/assert/assert.c                           |   10 +-
 src/util/assert/mpiassert.h                        |    2 +-
 src/util/dbg/Makefile.mk                           |   13 -
 src/util/dbg/dbg_printf.c                          |  900 -------------------
 src/util/dbg/mpidbg.h                              |  122 ---
 .../rlog/TraceInput/logformat_trace_InputLog.c     |   70 +-
 src/util/logging/rlog/TraceInput/trace_input.c     |   22 +-
 src/util/logging/rlog/irlog2rlog.c                 |   30 +-
 src/util/logging/rlog/irlogutil.c                  |   16 +-
 src/util/logging/rlog/minalignrlog.c               |    2 +-
 src/util/logging/rlog/rlog.c                       |    4 +-
 src/util/logging/rlog/rlogutil.c                   |  100 +-
 src/util/mem/Makefile.mk                           |    2 -
 src/util/mem/argstr.c                              |  893 ------------------
 src/util/mem/handlemem.c                           |   18 +-
 src/util/mem/strerror.c                            |   14 +-
 src/util/mem/trmem.c                               |   75 --
 src/util/pointer/mpiu_pointer.h                    |    2 +-
 src/util/procmap/local_proc.c                      |    4 +-
 src/util/refcount/Makefile.mk                      |   14 +
 src/util/refcount/mpir_refcount.h                  |   26 +
 src/util/refcount/mpir_refcount_global.h           |   48 +
 src/util/refcount/mpir_refcount_pobj.h             |  108 +++
 src/util/refcount/mpir_refcount_single.h           |   47 +
 src/util/thread/Makefile.mk                        |   26 -
 src/util/thread/mpiu_thread.c                      |   33 -
 src/util/thread/mpiu_thread.h                      |  134 ---
 src/util/thread/mpiu_thread_global.h               |   64 --
 src/util/thread/mpiu_thread_multiple.h             |   95 --
 src/util/thread/mpiu_thread_pobj.h                 |  190 ----
 src/util/thread/mpiu_thread_posix.c                |  104 ---
 src/util/thread/mpiu_thread_posix.h                |  288 ------
 src/util/thread/mpiu_thread_priv.h                 |  117 ---
 src/util/thread/mpiu_thread_single.h               |   66 --
 src/util/thread/mpiu_thread_solaris.c              |   90 --
 src/util/thread/mpiu_thread_solaris.h              |  201 -----
 src/util/thread/mpiu_thread_win.c                  |  370 --------
 src/util/thread/mpiu_thread_win.h                  |  106 ---
 src/util/wrappers/Makefile.mk                      |    1 -
 src/util/wrappers/mpiu_os_wrappers.h               |    2 +-
 src/util/wrappers/mpiu_process_wrappers.h          |   64 --
 src/util/wrappers/mpiu_shm_wrappers.h              |   10 +-
 src/util/wrappers/mpiu_sock_wrappers.h             |   13 +-
 test/mpi/datatype/segtest.c                        |   18 +-
 test/mpi/group/glpid.c                             |    2 +-
 484 files changed, 8036 insertions(+), 7976 deletions(-)
 rename {src/util/dbg => maint}/getfuncstack.in (100%)
 create mode 100644 src/mpl/include/mpl_argstr.h
 create mode 100644 src/mpl/include/mpl_dbg.h
 create mode 100644 src/mpl/include/mpl_thread.h
 create mode 100644 src/mpl/include/mpl_thread_posix.h
 create mode 100644 src/mpl/include/mpl_thread_priv.h
 create mode 100644 src/mpl/include/mpl_thread_solaris.h
 create mode 100644 src/mpl/include/mpl_thread_win.h
 create mode 100644 src/mpl/include/mpl_yield.h
 create mode 100644 src/mpl/src/dbg/Makefile.mk
 create mode 100644 src/mpl/src/dbg/mpl_dbg.c
 create mode 100644 src/mpl/src/str/mpl_argstr.c
 create mode 100644 src/mpl/src/thread/Makefile.mk
 create mode 100644 src/mpl/src/thread/mpl_thread.c
 create mode 100644 src/mpl/src/thread/mpl_thread_posix.c
 create mode 100644 src/mpl/src/thread/mpl_thread_solaris.c
 create mode 100644 src/mpl/src/thread/mpl_thread_win.c
 delete mode 100644 src/pm/hydra/tools/ftb/Makefile.mk
 delete mode 100644 src/pm/hydra/tools/ftb/hydt_ftb.c
 delete mode 100644 src/pm/hydra/tools/ftb/hydt_ftb.h
 delete mode 100644 src/pm/hydra/tools/ftb/hydt_ftb_dummy.c
 delete mode 100644 src/util/dbg/Makefile.mk
 delete mode 100644 src/util/dbg/dbg_printf.c
 delete mode 100644 src/util/dbg/mpidbg.h
 delete mode 100644 src/util/mem/argstr.c
 delete mode 100644 src/util/mem/trmem.c
 create mode 100644 src/util/refcount/Makefile.mk
 create mode 100644 src/util/refcount/mpir_refcount.h
 create mode 100644 src/util/refcount/mpir_refcount_global.h
 create mode 100644 src/util/refcount/mpir_refcount_pobj.h
 create mode 100644 src/util/refcount/mpir_refcount_single.h
 delete mode 100644 src/util/thread/Makefile.mk
 delete mode 100644 src/util/thread/mpiu_thread.c
 delete mode 100644 src/util/thread/mpiu_thread.h
 delete mode 100644 src/util/thread/mpiu_thread_global.h
 delete mode 100644 src/util/thread/mpiu_thread_multiple.h
 delete mode 100644 src/util/thread/mpiu_thread_pobj.h
 delete mode 100644 src/util/thread/mpiu_thread_posix.c
 delete mode 100644 src/util/thread/mpiu_thread_posix.h
 delete mode 100644 src/util/thread/mpiu_thread_priv.h
 delete mode 100644 src/util/thread/mpiu_thread_single.h
 delete mode 100644 src/util/thread/mpiu_thread_solaris.c
 delete mode 100644 src/util/thread/mpiu_thread_solaris.h
 delete mode 100644 src/util/thread/mpiu_thread_win.c
 delete mode 100644 src/util/thread/mpiu_thread_win.h
 delete mode 100644 src/util/wrappers/mpiu_process_wrappers.h


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list